Page 1 of 1

[SOLVED] upgraded now code wont work

Posted: Sat Jan 08, 2005 5:45 pm
by surban99
first off here's my code

Code: Select all

<html>

<body>

<?php



$db = mysql_connect("localhost", "root");

mysql_select_db("test",$db);

$result = mysql_query("SELECT * FROM employees",$db);

if ($myrow = mysql_fetch_array($result)) {

  do {

    printf("<a href="%s?id=%s">%s %s</a><br>\n", $PHP_SELF, $myrow["id"], $myrow["name"], $myrow["bio"]);

  } while ($myrow = mysql_fetch_array($result));

} else {

  echo "Sorry, no records were found!";	

}

?>



</body>



</html>
this program used to work but now i get an error stating:
Notice: Undefined variable: PHP_SELF in c:\program files\easyphp\www\example4.php on line 19
someone please help me figure this one out


feyd | Help us, help you. Please use

Code: Select all

and

Code: Select all

tags where approriate when posting code. Read:  [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url][/color]

Posted: Sat Jan 08, 2005 5:46 pm
by markl999
Use $_SERVER['PHP_SELF']

thanks

Posted: Sat Jan 08, 2005 5:53 pm
by surban99
thanks a ton dude!! i think i love this website. that might have been the fastest reply ever