Topic awaiting preservation: searching flat files (php) (Page 1 of 1) |
|
---|---|
Paranoid (IV) Inmate From: Kansas City, MO , USA |
posted 10-21-2006 03:05
i'm having a problem here... my imagehost bug tracker uses flat files... typically, this worked just fine with no problems, however, i am switching servers. the old server is using php 4.4.4 and the new server is using php 5.1.4... code: $find_form .="<center>"; $find_form .="<form action=\"bug.php\" method=\"put\">"; $find_form .="View Report #<input type=\"hidden\" name=\"search\" value=\"add\">"; $find_form .="<input type=\"text\" name= \"string\" value=\"" . $_GET['string'] . "\">"; $find_form .="<input type =submit value=\"View it\">"; $find_form .="</form>"; $find_form .="</center>"; echo "\n<div class='gallitemmain left'>"; if (!$string) { echo "<center><p>Please enter your tracking number to check on the status of your report.<br /> If you enter an invalid number, you will see this again.<br /> <br />If you need to submit a bug/error, <a href='?do=bugreport'>click here</a>.</p></center>"; } $size=filesize("4.txt"); $string = $_GET['string']; if (!$size =="0") { if ($search) { $fp = fopen("4.txt","r"); $line = 0; while (!feof ($fp) ){ $uname = fgets($fp,filesize("4.txt")); $line = $line + 1; $uname2=Chop($uname); $res = preg_split("/####/",$uname2); if ($res[1]) { $c= eregi("$string", $uname); if ($c) { echo "<p style='margin:0;font-size:20px;'><b>ERROR REPORT #$string</b></p>"; $res[0] = stripslashes($res[0]); echo str_replace("|", " </span> ", "\n<p><span class=\"updates\">" . $res[0] . "</p>"); } } } fclose($fp); } echo $find_form; echo "\n</div>";
|
Nervous Wreck (II) Inmate From: Cleveland, OH |
posted 10-22-2006 23:26
From what I see on your example pages, the new page can't see $_GET['string'] at all, because it's not even filling in the text box. |