![]() |
php action script for forms I found this simple script on the web and started to play with it. For some reason it sends me emails but I dont get any of the fields returned. I get the message that "We've recived your information" and I get an email but they are always empty. The names and Ids of the fields in the form are: subject,detail,customer_mail,name Code: <?php |
Re: php action script for forms If you just upload this script, you can't see any Subject/Detail or anything. Because, the subject/details are generated dynamically from the form page that is missed here. If you don't understand what I mean then, read any php book (form chapter) or use this tutorial "PHP Forms" Hope it helps. |
Re: php action script for forms OK, I assume this is how you have your script set up: You have a form page (not displayed in your post), which upon form submission posts it to your action script above. I also assume the PHP script posted above is the full action script, without you having left any code out. Here is your problem: you assign variables to other variables, which are empty. That's why you recieve empty emails. In fact, the only var you did correctly assign, is the 'to' email adress. Example: $subject = "$subject"; You are assigning an empty var to itself, this equals: $subject = ""; I assume you are confusing this with the form field names. If that is the case, this code should work for you: Code: <?php |
Re: php action script for forms Thanks good to know it was the page I copied not me. That gives me the info from the input fields in the body but I get this in the from field: Code: jimmyg@, UNEXPECTED_DATA_AFTER_ADDRESS@.SYNTAX-ERROR. |
Re: php action script for forms The line: $header="from: ".$_POST['name'] ."<".$_POST['mail_from'].">"; should be: $header="from: ".$_POST['name'] ."<".$_POST['customer_mail'].">"; |
Re: php action script for forms I just use this. I've actually used it for almost ten years I think Matt's Script Archive: FormMail |
Re: php action script for forms Are you sure mail(); function is turned on your server? Some companys close this function. I think you've to use smtp. |
| All times are GMT -6. The time now is 06:28 AM. |