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
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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.