Aqua-Soft Forums: Required for forms? - Aqua-Soft Forums

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Required for forms? Rate Topic: -----

#1 User is offline   Jeter2Fan93 Icon

  • Group: Subscribers
  • Posts: 140
  • Joined: 21-December 07

Posted 29 February 2008 - 03:13 PM

Not sure of the exact name for this but basically, I would like my form to be submitted ONLY if the name, email address, and message body are filled out. Right now, if you just hit submit, the form is sent to me, blank of course. How can this be done? Sorry for sounding like a n00b here, I'm really not, just stumped at the moment.
0

#2 User is offline   davidsword Icon

  • Group: Subscribers
  • Posts: 1,016
  • Joined: 19-December 06

Posted 29 February 2008 - 03:18 PM

throw this in at the beginning of where ever your form action leads to

				if(empty($name) || empty($email) || empty($message )) {
				echo "error fill in required fieldsn";
				die (""); 
				}


you can also make sure people include the @ and . in their emails with
				if(!$mail == "" && (!strstr($email,"@") || !strstr($email,".")))  {
				echo "erorr: use a real email address n"; 
				die ("");
				}

0

#3 User is offline   Jeter2Fan93 Icon

  • Group: Subscribers
  • Posts: 140
  • Joined: 21-December 07

Posted 29 February 2008 - 03:43 PM

Great, thanks.
0

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic