iEntry 10th Anniversary Forum Rules Search
WebProWorld
Register FAQ Calendar Mark Forums Read
Web Programming Discussion Forum Working with an API? Developing a plugin? Writing a Mod or script for your favorite blog, Web 2.0 site or Forum? Welcome.

Share Thread: & Tags

Share Thread:

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 05-10-2007, 07:52 AM
Tim's Avatar
Tim Tim is offline
WebProWorld Veteran
 
Join Date: Jul 2004
Location: On the edge of the UK
Posts: 423
Tim RepRank 0
Default Response emails are blank

I am using Jack's formmail.php for the first time on a site in development. I have configured the php as directed (recipient, referers etc.) and put it in the cgi-bin (711 bin, 755 script). The xhtml (suffix .php) form (method="post") is also configured correctly and validates. The form handler works, an email is sent as does the redirect to a thanks page. The resulting emails contain the user's IP (REMOTE ADDR) as requested by a hidden field (env_report) but all other required data is missing. I get no php error messages and the error log is clean.

Has anyone else experienced this and can you please suggest what I have done wrong?
__________________
Pleasure in the job puts perfection in the work. Aristotle (384-322 BC)
Reply With Quote
  #2 (permalink)  
Old 05-10-2007, 09:06 AM
Tim's Avatar
Tim Tim is offline
WebProWorld Veteran
 
Join Date: Jul 2004
Location: On the edge of the UK
Posts: 423
Tim RepRank 0
Default

One other bit of info that might be relevant is that when I view the email headers in Mailwasher and until I click the header in Thunderbird, there is an attachment icon but nothing is attached.
__________________
Pleasure in the job puts perfection in the work. Aristotle (384-322 BC)
Reply With Quote
  #3 (permalink)  
Old 05-10-2007, 10:25 AM
sands's Avatar
WebProWorld Veteran
 
Join Date: Sep 2005
Location: Kerala, India
Posts: 395
sands RepRank 1
Default

Try this, might work. In the PHP code that processes the info sent by the form, add the lines:
Code:
$name  = $_POST['name'];
$email = $_POST['email'];
etc.
immediately below the opening <?php Start Tag for each field in the form.
__________________
My Nook | My Biz | My Photos
Reply With Quote
  #4 (permalink)  
Old 05-10-2007, 03:28 PM
Tim's Avatar
Tim Tim is offline
WebProWorld Veteran
 
Join Date: Jul 2004
Location: On the edge of the UK
Posts: 423
Tim RepRank 0
Default

Thanks Sands but unfortunately it didn't change a thing. Also, there is no <?php start just <? in the original but adding it made no difference.
__________________
Pleasure in the job puts perfection in the work. Aristotle (384-322 BC)
Reply With Quote
  #5 (permalink)  
Old 05-10-2007, 04:21 PM
DrTandem1's Avatar
WebProWorld 1,000+ Club
 
Join Date: Oct 2003
Location: Encinitas, CA
Posts: 1,830
DrTandem1 RepRank 2
Default

I'm not familiar with that particular script, but it seems to me that a PHP script does not need to be part of the cgi-bin. I think you may be confusing a cgi script with the PHP. Most run from root.

Anyway, if you are receiving a blank email, you simply haven't added the message to be included as the part of the email and/or the variable for the message has not been set.
__________________
DrTandem's San Diego Web Page Design, drtandem.com
Reply With Quote
  #6 (permalink)  
Old 05-10-2007, 04:45 PM
Tim's Avatar
Tim Tim is offline
WebProWorld Veteran
 
Join Date: Jul 2004
Location: On the edge of the UK
Posts: 423
Tim RepRank 0
Default

Thanks Dr, I put the script in the cgi-bin because I believe it is safer there than in the root. I often put vulnerable scripts there for the same reason. I have tried running it from several locations but it makes no difference to the results.

You can view the original script by clicking the link to it in my opening post. The only variable I haven't configured starts on line 144 function parse_form($array, $sort = ""), frankly I don't understand it and as according to the documentation the default sort order is the same as the structure of the form (1,2,3...) and I don't need to build a reserved keyword array.

I'm quite sure I have missed something simply vital and when I understand will feel foolish! Hey ho!
__________________
Pleasure in the job puts perfection in the work. Aristotle (384-322 BC)
Reply With Quote
  #7 (permalink)  
Old 05-10-2007, 05:41 PM
WebProWorld New Member
 
Join Date: Feb 2005
Posts: 11
gabrielharrison RepRank 0
Default

Hi Tim,

I've used the script a lot in the past and not had any problems but it is a very old script and it could be that your host's php settings are too modern for the script to work.

Another thing I would try is to change the line:

$content = parse_form($HTTP_POST_VARS, $sort);

to:

$content = parse_form($_POST, $sort);

Gabriel
Reply With Quote
  #8 (permalink)  
Old 05-11-2007, 04:49 AM
Tim's Avatar
Tim Tim is offline
WebProWorld Veteran
 
Join Date: Jul 2004
Location: On the edge of the UK
Posts: 423
Tim RepRank 0
Default

Thanks Gabriel...that fixed it!

Can you recommend a newer and better php form handler? I intend to add either a hidden field which must be left blank or a php 'captcha', to filter out the spam bots, so one that already contains either would be wonderful.

Thanks again, it was driving me nuts.
__________________
Pleasure in the job puts perfection in the work. Aristotle (384-322 BC)
Reply With Quote
  #9 (permalink)  
Old 05-14-2007, 04:38 PM
Vectorman211's Avatar
WebProWorld Member
 
Join Date: Jul 2006
Posts: 89
Vectorman211 RepRank 2
Default

This is a pretty nice one, easy to implement too.

http://www.stadtaus.com/en/php_scripts/formmail_script/
__________________
http://www.wis-tech.net
Reply With Quote
  #10 (permalink)  
Old 05-14-2007, 04:44 PM
Tim's Avatar
Tim Tim is offline
WebProWorld Veteran
 
Join Date: Jul 2004
Location: On the edge of the UK
Posts: 423
Tim RepRank 0
Default

Thanks Vectorman211,

I had already downloaded that script but haven't got round to checking it out yet. Your recommendation will ensure I do! Much appreciated... thanks
__________________
Pleasure in the job puts perfection in the work. Aristotle (384-322 BC)
Reply With Quote
  #11 (permalink)  
Old 05-14-2007, 04:56 PM
Vectorman211's Avatar
WebProWorld Member
 
Join Date: Jul 2006
Posts: 89
Vectorman211 RepRank 2
Default

:-)
__________________
http://www.wis-tech.net
Reply With Quote
Reply

  WebProWorld > Webmaster, IT and Security Discussion > Web Programming Discussion Forum

Thread Tools
Display Modes

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT -4. The time now is 04:06 PM.



Search Engine Optimization by vBSEO 3.3.0