Hello World,
I payed a programmer to put together a PHP website for me, and we're having trouble getting it working on my server. After data is posted on any page, it's not stored as a variable correctly. Here's an example of what she did:
<form action=results.php method=post><input type=text name=searchingred size=40> <input type=submit value=Search></form>
This form will submit data to results.php.
Here's a bit of results.php:
<?php
$sql = "select * from search_terms where term = '$searchingred'";
$result = mysql_query($sql ,$db);
if (mysql_num_rows($result) > 0) {
$row = mysql_fetch_row($result);
$count = $row[1];
$newcount = $count + 1;
$sql = "update search_terms set count = $newcount where term = '$searchingred'";
} else {
$sql = "insert into search_terms (term, count) values ('$searchingred', 1)";
}
$result = mysql_query($sql ,$db);
?>
This doesn't work, as the variable "$searchingred" is never declared. If I add $searchingred = $_POST['searchingred'] to the top, it works perfectly.
The script is working fine, on her server. I don't want to modify each page that has any form on it, so I'd like to know what she's using to do this. My guess is that it's some Pear module, or such.
Any clue as to what kind of goodie she has on her server?
Thanks,
Ron