School project help


hi im doing a school project using PHP and i am not very familiar with it but basically what i need to do is create a search bar that once the submit button is clicked that info is stored in a list of all people to have ever done it and upon the submission it brings them to the “results page” where everyones prior searches are kept.

im using a server through my school i have to sign in to so i don’t per say have full access to admin pages.

can someone help explain how to do this to me or if this is even possible

<?php if(!empty($_POST['search'])) file_put_contents('searches.txt', $_POST['search']."\n", FILE_APPEND); ?>
	<form action="" method="POST">
		<input type="text" name="search" value="" />
		<input type="submit" name="submit" value="send" />

But why didn’t you try anything by yourself? Reading tutorials etc.


the quoted text is essentially pseudocode. You should memorize basic php to convert pseudocode to working code.

create a search bar = use html to make a form with a search type input.
once the submit button is clicked = process a submitted form on the server side
processing will involve saving the sanitized search string
brings them to results page = prg form handling. recall the saved data from the processing

in order to be a programmer, one must program. try it yourself, then ask for help when you battle something long enough to produce a still not working result (learning).

i hope that i don’t seem rude but i taught myself how to program while working a full-time night job and babysitting my niece and nephew as a fulltime day job. You should try harder.