954,198 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

PHP Form Input

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 "";

and this:

echo "";

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

niemad
Newbie Poster
1 post since Jun 2004
Reputation Points: 10
Solved Threads: 0
 

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:
[php]
echo "";
[/php]

Also, when passing variables around through the URL, always consinder SQL Injections. Click here for more info: http://www.daniweb.com/techtalkforums/thread199.html

samaru
a.k.a inscissor
Team Colleague
1,256 posts since Feb 2002
Reputation Points: 262
Solved Threads: 18
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You