Right first of all i'm new to php and i know that this is simple, but i just can't figure it out...

1st, I set up a php site that on the first page it has a textbox, lets say its name is text1...

I set up the sql so that the value of text1 was a criteria to serch for in the title record of the database...

Now the 1st page of results are correct but the next are wrong because the value of text1 is gone...

i've tried this:

echo "<input type='hidden' name='hiddenField' value = '";
echo $_REQUEST;
echo "'>";

and this:

echo "<input type='hidden' name='hiddenField' value = '";
echo $festname;
echo "'>";

will someone help me please, i will be very grateful....

The best way to go about this is to keep a URL variable as you're going through the pages. So anywhere you create the link to go to the next page or back, include a variable of the search term. So something like this:

search.php?query=ninjas

Then, all you have to do to retrieve it is:

$_GET['query']

So for your code, it'd be something like this:

echo "<input type='hidden' name='hiddenField' value = '";
echo $_GET['query']; 
echo "'>";

Also, when passing variables around through the URL, always consinder SQL Injections. Click here for more info:

http://www.daniweb.com/techtalkforums/thread199.html

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.