PHP Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsProgrammingPHP Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
  #1  
Old June 5th, 2003, 08:31 AM
kh44na kh44na is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jan 2003
Posts: 37 kh44na User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 6
PHP Form Validation

Hey guys - I just needed your help for a quick question.

I have a form located at http://www.dreamnation.ca/testing/a...egistration.php

If you submit the form without filling out any fields, I get an error page. Is there a way that I can write or add certain php lines of code, that indicates which fields are required, and turns the text "bold red" if a required field is missed? So that the form isn't submitted without all the neccessary data?

Your help would be great....
thanks in advance.

Reply With Quote
  #2  
Old June 5th, 2003, 11:43 AM
jpenn jpenn is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Oct 2002
Location: Washington, DC
Posts: 317 jpenn User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 m 3 sec
Reputation Power: 7
Are you sending the posted data to the right script?
__________________
~ Joe Penn

We work for free to help make this a valuable resource on the internet. Do you appreciate the help - did we provide help that will help you prosper and help that has contributed to sharpening your current skill set?

Show your appreciation and purchase something from our Amazon Wishlist's - it's simple and a great way to say thank you.




Reply With Quote
  #3  
Old June 5th, 2003, 03:45 PM
kh44na kh44na is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jan 2003
Posts: 37 kh44na User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 6
yes - I am using a php script that determines where the data goes

THIS IS WHAT MY RESPONSE.PHP PAGE LOOKS LIKE:


<?php
include '../header.php';
?>

<?php

$mailTo="bball@ahmadiyya.ca";
$mailSubject="AMBI Web Site - Team Registration";

$mailBody=$mailBody."Team Name: " .$teamname. "\n";

$mailBody=$mailBody."Captains Name: " .$captainname."\n";

$mailBody=$mailBody."Captains Address: " .$captainaddress. "\n";

$mailBody=$mailBody."Captains Phone: " .$captainphone. "\n";

$mailBody=$mailBody."Captains Email: " .$captainemail. "\n";

$mailBody=$mailBody."Comments: " .$comments. "\n";

mail($mailTo, $mailSubject, $mailBody, $mailHeaders);

?>

<html>
<head>
<title> Response Page - Blast Entertainment </title>
<head>

<body bgcolor="#ffffff">
<font face="arial,helvetica,sans-serif" size="4" color="red">
<b> Submitted </b>
</font>

<p>

<font face="arial, helvetica, sans-serif" size=2">
Your information has been submitted! Thank you!
<p>



<a href=http://www.dreamnation.ca/testing/abi/page.php> Return to Main Page </a>
</font>

<?php
include '../footer.php';
?>

</body>
</html>


Last edited by kh44na : June 5th, 2003 at 04:22 PM.

Reply With Quote
  #4  
Old June 5th, 2003, 09:39 PM
jpenn jpenn is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Oct 2002
Location: Washington, DC
Posts: 317 jpenn User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 m 3 sec
Reputation Power: 7
First - this is wrong:
PHP Code:
 $mailBody=$mailBody."Team Name: " .$teamname"\n"

$mailBody=$mailBody."Captains Name: " .$captainname."\n"

$mailBody=$mailBody."Captains Address: " .$captainaddress"\n"

$mailBody=$mailBody."Captains Phone: " .$captainphone"\n"

$mailBody=$mailBody."Captains Email: " .$captainemail"\n"

$mailBody=$mailBody."Comments: " .$comments"\n"

Should be:
PHP Code:
 $mailBody "Team Name: " .$teamname"\n"

$mailBody .= "Captains Name: " .$captainname."\n"

$mailBody .= "Captains Address: " .$captainaddress"\n"

$mailBody .= "Captains Phone: " .$captainphone"\n"

$mailBody .= "Captains Email: " .$captainemail"\n"

$mailBody .= "Comments: " .$comments"\n"

Now, you have $mailHeaders in the mail function - but I don't see where you defined the mail headers.

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsProgrammingPHP Development > PHP Form Validation


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 5 hosted by Hostway
Stay green...Green IT