Thanks for the tip. I have another issue once I click on a form. Could you take a quick look at this one:
//----------- START OF CODE ------ <html><body> <form method="post" action="<?php echo $_SERVER['PHP_SELF']?>"> First name:<input type="Text" name="first"><br> Last name:<input type="Text" name="last"><br> Address:<input type="Text" name="address"><br> Position:<input type="Text" name="position"><br> <input type="Submit" name="submit" value="Enter information"> </form> </body></html> // ------ END OF CODE ---- I open it and I get the following text boxes: First name: < BALANK TEXT BOX> Last name: < BALANK TEXT BOX> Address: < BALANK TEXT BOX> Position: < BALANK TEXT BOX> < Enter Information BUTTON IS HERE> Once I click onthe Enter Information button I get the following error: // -------- START OF ERROR ------ Forbidden You don't have permission to access /<br /><b>Notice</b>: Undefined variable: PHP_SELF in <b>C:/Program Files/Apache Group/Apache/htdocs/mysql4.php</b> on line <b>2</b><br /> on this server. ---------------------------------------------------------------------------- Apache/1.3.27 Server at localhost Port 80 //-------- END OF ERROR --------- Thanks again for you help Mario "Vidyut Luther" <[EMAIL PROTECTED]> wrote in message news:1035565328.1171.2.camel@;lapdog.linuxpowered.com... > The simple but potentially wrong..harmful solution is to turn on > register globals in php.ini, > > The right solution is to use $_SERVER['PHP_SELF']; > > > > On Fri, 2002-10-25 at 11:48, Mario Montag wrote: > > First time playing with PHP, Apache, and MySQL. I have a simple form error > > and I don't know how to solve it. I was doing the Webmonkey PHP/MySQL > > tutorial and when I started using forms with $PHP_SELF I started getting > > errors with variables not defined. > > > > PHP 4.2.3 > > MySQL 4.0 Windows 2000 > > Apache 1.3.27 (Since I was not able to get 2.0 working on Windows 2K Pro) > > > > My code is: > > > > //---------- START OF CODE -------------- > > <html><body><?php > > > > $db = mysql_connect("localhost", "root"); > > mysql_select_db("mydb",$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["first"], > > $myrow["last"] > > ); > > } while ($myrow = mysql_fetch_array($result)); > > } > > > > else { > > echo "Sorry, no records were found!"; > > } > > > > ?> > > </body></html> > > > > //------------------------------------------------- > > > > My ERROR is: > > > > Notice: Undefined variable: PHP_SELF in C:\Program Files\Apache > > Group\Apache\htdocs\mysql2.php on line 11 > > Bob Smith > > > > Notice: Undefined variable: PHP_SELF in C:\Program Files\Apache > > Group\Apache\htdocs\mysql2.php on line 11 > > John Roberts > > > > Notice: Undefined variable: PHP_SELF in C:\Program Files\Apache > > Group\Apache\htdocs\mysql2.php on line 11 > > Brad Johnson > > > > Notice: Undefined variable: PHP_SELF in C:\Program Files\Apache > > Group\Apache\htdocs\mysql2.php on line 11 > > Mar f > > > > --------------- END OF ERROR ---------------------------- > > > > I am able to connect to the MySQL DB and retrieve info, but I don't get the > > error. I changed the REGISTER_GLOBALS of the php.ini file to ON and I still > > get the variables error. I also added $_POST as stated in another form > > issue but it did not resolve my problem. It must be simple but I don't know > > enough to identify the issue. > > > > Thanks for any help or input. > > > > Mario > > [EMAIL PROTECTED] > > > > > > > > > > -- > > PHP General Mailing List (http://www.php.net/) > > To unsubscribe, visit: http://www.php.net/unsub.php > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php