Jump to content

[SOLVED] Stupid Issues with POST


iplus

Recommended Posts

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.