Forum Moderators: coopster
Do I need to encode the value of $string somehow to get it to pass to the next page?
what if they put this in the url
delete from yourtable
bye bye data. What if they insert something to allow them to exploit it.
Pass parts of the query in the url and then build your query from there.
if your query is
select * from mytable where field1='somevalue' and field2='otherval'
have your url look something like so
search.php?id=1&f1=somevalue&f2=otherval
then in search.php
$query = "select * from mytable where field1='" . $_GET['f1'] . "' and field2='" . $_GET['f2'] . "'";
you should also always test user entered data to protect yourself even more from the possibilty of sql injection.