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; ?> Link to comment https://forums.phpfreaks.com/topic/189039-_post-not-working-i-cant-see-why/ 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']; Link to comment https://forums.phpfreaks.com/topic/189039-_post-not-working-i-cant-see-why/#findComment-998106 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 Link to comment https://forums.phpfreaks.com/topic/189039-_post-not-working-i-cant-see-why/#findComment-998117 Share on other sites More sharing options...
Buddski Posted January 19, 2010 Share Posted January 19, 2010 $POST is not the global, use $_POST Link to comment https://forums.phpfreaks.com/topic/189039-_post-not-working-i-cant-see-why/#findComment-998121 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; ?> Link to comment https://forums.phpfreaks.com/topic/189039-_post-not-working-i-cant-see-why/#findComment-998122 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 Link to comment https://forums.phpfreaks.com/topic/189039-_post-not-working-i-cant-see-why/#findComment-998134 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.