Jump to content

PHP Validation


rockonmetal

Recommended Posts

Ok, I am new, I have no idea where to post this so if its in the wrong place let me know!!!

Ok, so I hardly know any php code... i am wondering if someone could help me write a validation for my form that would be great, I have the form code below...

 

<form action="uploader.php" method="post" enctype="multipart/data">
<input type="hidden" name="3p42r3ad3a4than32" value="329r8g" /> 
<div class="pureadd">
<br>
<br>Your Name:
<br><input type="text" name="Name" class="input" />
<br>Your Email:
<br><input type="text" name="Email" class="input"/>
<br>
<script type="text/javascript">
var d = new Date()
document.write("<input type='hidden' value='"+Date()+"' name='time' />")
</script>
<br>
<br>Agree To Terms of Service
<br><input type="checkbox" name="TermsOfService" value="Agreed" /> Yes I Agree To the Terms of Service
<br>

File Description:
<br>
<textarea rows="5" cols="40" name="description" id="maxcharfield" onKeyDown="textCounter(this,'progressbar1',200)" onKeyUp="textCounter(this,'progressbar1',200)" onFocus="textCounter(this,'progressbar1',200)" class="textarea"></textarea><br />
<div id="progressbar1" class="progress"></div>

<input type="submit" class="input">


</div>
</form>

Don't worry about the first hidden input thats totally under controll.

I would like for the form to validate when the user clicks the submit button and if the form is valid then it goes and if not the form does not send... thanks!

Link to comment
https://forums.phpfreaks.com/topic/66962-php-validation/
Share on other sites

There are some e-mail patterns here. For the name, I assume you only want letters and spaces, but within which character set? ASCII would be [a-zA-Z ]+, and Unicode [\p{L}\p{Zs}]+. You'll also need to consider punctuation if it is an entire name, e.g., "Bob Smith, Jr."

Link to comment
https://forums.phpfreaks.com/topic/66962-php-validation/#findComment-336213
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.