Re: PHP Scripting errors

From: Date: Wed, 14 May 2003 14:15:19 +0000
Subject: Re: PHP Scripting errors
References: 1 2  Groups: php.windows 
Request: Send a blank email to php-windows+get-19934@lists.php.net to get a copy of this message
***** welcomeform.html ***** <head><title>Welcome Form</title></head> <form action="welcome.php" method="get"> First Name: <input type="text" name="firstname" id="firstname" /> Last Name: <input type="test" name="lastname" id="lastname" /> <input type="submit" value="GO!" /> </form> ***** welcome.php ***** <?php echo "Welcome to my Website, $firstname $lastname!" ; ?>
keep register_glogals = off for security reasons, it allows easy hacks made. new versions of PHP introduced the $_GET, $_POST, ... (global arrays) instead. change you code to the following: <?php
    echo "Welcome to my Website, $_GET['firstname'] $_GET['lastname']";
?> Best regards,
 Kit DeKat                         mailto:kitdekat@earthlink.net
Systems Programmer -----BEGIN PERL GEEK CODE BLOCK----- Version: 0.01 P++>+++@$c---P6-R >++M+$O+>+++(++)$MA >+E+PU >+BD >++C >*$ D++S++>+++@X>++WP?MO?PP!n?CO?PO--o?G A--Ee+++Ev w+m! ------END PERL GEEK CODE BLOCK------

« previous php.windows (#19934) next »