Hello, I"m a total noob to PHP so please be nice. 😃
I'm working on a simple login script and I read the whole PHP book on hudzilla.org. But the $_POST is not explained in the best terms for me to understand. I did a search on this site but it seems many of the login and passing variables exampes are over my head. I'm looking for a basic pratice thing.
Here is the code I have so far. I'm just trying to enter info from a form "username" and "password", and send it to some other PHP page via $_POST and display it using echo (print maybe?). But I get no output from my code, just blank.
I read something about registered globals and superglobals, is this what the problem lies? Because this feature is turned off in PHP 5? If so, can you show me an example how I can get this to work? Keep in mind that I'm very new to PHP. Short samples with great comments work best for me. 😃
#Login.php
<FORM ACTION="someform.php" METHOD="POST">
UserName: <INPUT TYPE="TEXT" NAME="username" /><BR />
Password: <INPUT TYPE="PASSWORD" NAME="password" /><BR />
<INPUT TYPE="submit" />
</FORM>
#Someform.php
<?php
//if(!empty($_GET)) extract($_GET);
if(!empty($_POST)) extract($_POST);
?>
<? php
// Get info from POST
$user = $_POST['username'];
$pass = $_POST['password'];
echo $user;
echo $pass;
?>
😃 😃 😃