iplus Posted January 8, 2009 Share Posted January 8, 2009 Hey Everyone! This is a really silly little thing that for some reason I cant get past...its proably because its late here and i've had a beer Anyway, I cant get the Post variables on this form to work...they are always empty etc..it was working with $_REQUEST but doesnt seem to work with post even though the method is set to post. Any ideas why? <?php //Start loop and check if form has been submitted if (!isset($_POST['submit'])) { //Include Functions File include 'functions.php'; // Clean Input $_POST = cleanInput($output); // Sanitize Input $_POST = sanitize($output); // Grab Variables $first = $_POST['first']; $last = $_POST['last']; $email = $_POST['email']; $password = $_POST['password']; // Capitlize First Leeter of Names $first = ucwords($first); $last = ucwords($last); // Connect to Database or display error message connect(); echo $first,$last,$email,$password; echo $_POST['submit']; } // end IF loop else { php?> <html> <head> <title>Create Account</title> </head> <body> <form name="createaccount" method="POST" action= "<?php echo $_SERVER['PHP_SELF']; ?>" > <p><u><b>First Name:</b> </u><input type="text" name="first" size="20"></p> <p><u><b>Last Name:</b></u> <input type="text" name="last" size="20"></p> <p><b><u>Email:</u> </b> <input type="text" name="email" size="20"></p> <p><b><u>Password</u> </b> <input type="text" name="password" size="20"></p> <p><u><b>Password Again:</b></u> <input type="text" name="password2" size="20"></p> <p><input type="submit" value="Submit" name="submit"><input type="reset" value="Reset" name="B2"></p> </form> </body> </html> <?php // end else loop } php?> Link to comment https://forums.phpfreaks.com/topic/139978-solved-stupid-issues-with-post/ Share on other sites More sharing options...
robb73 Posted January 8, 2009 Share Posted January 8, 2009 if (!isset($_POST['submit'])) remove the ! Link to comment https://forums.phpfreaks.com/topic/139978-solved-stupid-issues-with-post/#findComment-732347 Share on other sites More sharing options...
iplus Posted January 8, 2009 Author Share Posted January 8, 2009 The problem is that the post variables are still empty though...even though they have been posted by the form etc. Link to comment https://forums.phpfreaks.com/topic/139978-solved-stupid-issues-with-post/#findComment-732353 Share on other sites More sharing options...
robb73 Posted January 8, 2009 Share Posted January 8, 2009 Comment out your user defined functions and re-check, if your echo statement shows the values then there is an issue with your functions. Link to comment https://forums.phpfreaks.com/topic/139978-solved-stupid-issues-with-post/#findComment-732354 Share on other sites More sharing options...
iplus Posted January 8, 2009 Author Share Posted January 8, 2009 Spot on Robb...I was just doing that as you posted and realised its an issue with my sanitize functions. CheersMate! Link to comment https://forums.phpfreaks.com/topic/139978-solved-stupid-issues-with-post/#findComment-732356 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.