Jump to content

Form not posting?


ChrisMartino

Recommended Posts

Well I found a css layout on the net for a form, its quite nice although there's a slight downside to it, when you hit the submit button its not posting the value submit, so for example if I where do a if statement with the following:

 

if($_POST['submit'])
{
        // something.
}

 

The above statement wouldn't do anything but if I do the if statement with the post check value as one of the text input fields like so:

 

if($_POST['account_username'])
{
        // something.
}

 

it would return true to the above statement if you specified something in the box.

 

Here is my form:

 

				<div id="container">
					<p>Register a new account at <b>X-Host</b> to purchase products and other items!</p>
					<form action="index.php?v&#61;account&#38;register" method="post" class="niceform" id="regform">
						<table width="329" border="0">
						  <tr>
							<td><label for="account_username">Username:</label></td>
							<td><input type="text" id="account_username" name="account_username" size="20" /></td>
						  </tr>
						  <tr>
							<td><label for="account_password">Password:</label></td>
							<td><input type="password" id="account_password" name="account_password" size="20" /></td>
						  </tr>
						  <tr>
							<td><label for="account_password_check">Password(Again):</label></td>
							<td><input type="password" id="account_password_check" name="account_password_check" size="20" /></td>
						  </tr>
						  <tr>
							<td><label for="account_email">Email Address:</label></td>
							<td><input type="text" id="account_email" name="account_email" size="20" /></td>
						  </tr>
						  <tr>
							<td> </td>
							<td><input type="submit" value="Register Account" /></td>
						  </tr>
					  </table>
						<br />
						<p>By signing up at X-Host you agree to our <a href="index.php?v&#61;tos">Terms of Service</a></p>
					</form>
				</div>
			</div>

 

I would like to thank anyone in advance who could spare some time to shed some light into this :s  :wtf:

 

 

Link to comment
https://forums.phpfreaks.com/topic/208097-form-not-posting/
Share on other sites

The submit button needs a name="submit" . . .

 

<input type="submit" value="Register Account" />

 

 

EDIT: Or better still, add a hidden field to pander to the weaknesses of some versions of Internet Exploder . . .

 

 

<input type="hidden" name="submit" value="submit" />

Link to comment
https://forums.phpfreaks.com/topic/208097-form-not-posting/#findComment-1087794
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.