FAQ   Search   Register   Profile   Log in to check your private messages   Log in 

 

How to Not Submit Blank Fields



 
Post new topic   Reply to topic    Dreamweaver Downloads Forum Index -> PHP Form To Mail
Author Message
allisonsabo



Joined: 11 Apr 2008
Posts: 2

PostPosted: Fri Apr 11, 2008 3:51 pm    Post subject: How to Not Submit Blank Fields Reply with quote
Hi there.

Is there a way for the script to not send form fields that have not been filled in? So only fields with values are emailed.

Thanks very much.
Back to top
Karen
Support Team
Support Team


Joined: 24 Mar 2008
Posts: 26

PostPosted: Fri Apr 11, 2008 10:11 pm    Post subject: Reply with quote
Step #1: Open the file "Form2Mail.php"

Step #2: Search for this:

Code:
foreach ($_GET as $item => $value)


..and replace by this:

Code:
foreach ($_GET as $item => $value) if ($value)


Step #3: Search for this:

Code:
foreach ($_POST as $item => $value)


..and replace by this:

Code:
foreach ($_POST as $item => $value) if ($value)


Step #4: Search for this:

Code:
foreach ($_FILES as $item => $value)


..and replace by this:

Code:
foreach ($_FILES as $item => $value) if ($value)


Let me know if you need further assistance.

Thanks.
Back to top
allisonsabo



Joined: 11 Apr 2008
Posts: 2

PostPosted: Sat Apr 12, 2008 8:24 am    Post subject: Reply with quote
Thank you very much. It worked like a charm.

Much appreciated.
Back to top
Display posts from previous:   
Post new topic   Reply to topic    Dreamweaver Downloads Forum Index -> PHP Form To Mail All times are GMT - 5 Hours
Page 1 of 1

 




about