jigsawsoul Posted January 19, 2010 Share Posted January 19, 2010 I trying to echo out information from a forum using $_POST but its not working and i can't really see what i have done wrong if anything. form. create-staff.php <h4>Create Staff Member</h4> <p>To create a staff member fill out the form below.</p> <div class="meeting png_bg"> <form action="create-staff-2.php" method="post"> <p> <label>Email:</label> <input class="text-input small-input" type="text" id="email" name="email" /> </p> <p> <label>Password:</label> <input class="text-input small-input" type="text" id="password" name="password" /> </p> <p> <label>First Name:</label> <input class="text-input small-input" type="text" id="firstname" name="firstname" /> </p> <p> <label>Last Name:</label> <input class="text-input small-input" type="text" id="lastname" name="lastname" /> </p> <p> <input class="button" type="submit" value="Submit" /> </p> </form> </div> php. create-staff-2.php <?php session_start(); include ("../_functions/f_login.php"); sessionAuthenticate( ); $email = $_POST['email']; $password = $POST['password']; $firstname = $POST['firstname']; $lastname = $POST['lastname']; echo $email; echo $password; echo $firstname; echo $lastname; ?> Quote Link to comment Share on other sites More sharing options...
Buddski Posted January 19, 2010 Share Posted January 19, 2010 error_reporting(E_ALL); ini_set('display_errors',1); It will tell you if you have any errors in your script. Also $email = $_POST['email']; $password = $_POST['password']; $firstname = $_POST['firstname']; $lastname = $_POST['lastname']; Quote Link to comment Share on other sites More sharing options...
jigsawsoul Posted January 19, 2010 Author Share Posted January 19, 2010 errors ? Notice: Undefined variable: POST in /home/hr728/public_html/_uni/_admin/create-staff-2.php on line 13 Notice: Undefined variable: POST in /home/hr728/public_html/_uni/_admin/create-staff-2.php on line 14 Notice: Undefined variable: POST in /home/hr728/public_html/_uni/_admin/create-staff-2.php on line 15 Quote Link to comment Share on other sites More sharing options...
Buddski Posted January 19, 2010 Share Posted January 19, 2010 $POST is not the global, use $_POST Quote Link to comment Share on other sites More sharing options...
jigsawsoul Posted January 19, 2010 Author Share Posted January 19, 2010 i haven't used POST i've only used $_POST as below <?php session_start(); include ("../_functions/f_login.php"); sessionAuthenticate( ); error_reporting(E_ALL); ini_set('display_errors',1); $email = $_POST['email']; $password = $_POST['password']; $firstname = $_POST['firstname']; $lastname = $_POST['lastname']; echo $email; echo $password; echo $firstname; echo $lastname; ?> Quote Link to comment Share on other sites More sharing options...
jigsawsoul Posted January 19, 2010 Author Share Posted January 19, 2010 for some reason i retyped method="post" no changes just rertyped and saved the file and now its working Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.