Tech Support Guy banner
Status
Not open for further replies.
1 - 5 of 5 Posts

· Registered
Joined
·
79 Posts
Discussion Starter · #1 ·
I have set up a PHP form from thesitewizard.com. A demo of the form can be found at http://feedbackdemo.netfirms.com/.

It is all okay but I need to make sure that the information provided by the user are valid - they have entered information in all the fields or not, or they have provided a valid e-mail address or not.

Can anyone provide me the complete PHP code? I'm a PHP newbie.
 

· Registered
Joined
·
1,205 Posts
You can require users to input in all fields before they submit by using a little JavaScript. Here is the link: http://www.dynamicdrive.com/dynamicindex16/requiredcheck.htm .

And you can also use this JavaScript code to make sure an email is a valid email. It dosn't actually check if the email is really really valid, but for example, if you type like ksdlfasdfjlals;dk for an email, it will recognize that as invalid.

http://www.dynamicdrive.com/dynamicindex16/emailvalidate.htm

Edit: Cool site btw, I liked the pictures :up:
 

· Registered
Joined
·
79 Posts
Discussion Starter · #3 ·
You can require users to input in all fields before they submit by using a little JavaScript. Here is the link: http://www.dynamicdrive.com/dynamici...uiredcheck.htm .

And you can also use this JavaScript code to make sure an email is a valid email. It dosn't actually check if the email is really really valid, but for example, if you type like ksdlfasdfjlals;dk for an email, it will recognize that as invalid.

http://www.dynamicdrive.com/dynamici...ilvalidate.htm

Edit: Cool site btw, I liked the pictures
Thanks for the links. Though I was looking for PHP code, I think Java Script would do fine.

I'm not sure which of my sites you are referring to. My page is www.spandan.co.nr. A new version of the site is at www.spandan.ifastnet.com, which is still in beta stage. spandan.ifastnet.com will be converted to www.spandan.co.nr within a few days. (iFastNet is my new host; .co.nr is my domain)
 

· Registered
Joined
·
33 Posts
Urm in your form header its submitting to "chfeedback.pl" which is a Perl file if i'm not mistaken, so why do you want to validate the input using PHP?

If it were submitting to a PHP file, you would validate something like:

PHP:
$comments = $_POST['comments'];

if ($comments == ""){
die("No comment has been entered"");
}
 

· Registered
Joined
·
79 Posts
Discussion Starter · #5 ·
Howelly said:
Urm in your form header its submitting to "chfeedback.pl" which is a Perl file if i'm not mistaken, so why do you want to validate the input using PHP?

If it were submitting to a PHP file, you would validate something like:

PHP:
$comments = $_POST['comments'];

if ($comments == ""){
die("No comment has been entered"");
}
It's a demo page. I went to http://www.thesitewizard.com/wizards/feedbackform.shtml to create a PHP feedback form, and the link I provided is the perl version of the form.
 
1 - 5 of 5 Posts
Status
Not open for further replies.
Top