Hi all! ... I used TrendyFlash Site Builder to create a site, which generated a 'contact.php' file that I need to modify. Basically it calls for the user to send a comment with a name, email id, subject and message. I need it to send those details to an external email id that I specify. Here's the script generated 'as is' by the software in that 'contact.php' file :
<?
$contactfield1=$HTTP_GET_VARS["contactfield1"]
$contactfield2=$HTTP_GET_VARS["contactfield2"]
$contactfield3=$HTTP_GET_VARS["contactfield3"]
$contactfield4=$HTTP_GET_VARS["contactfield4"]
$email_from = "you@yourdomain.com";
$email_subject = "" ;
//$email_txt = "";
$email_to = "info@yourdomain.com";
$email_message = "field1: $contactfield1\n
field2 :$contactfield2 \n
field3 :$contactfield3 \n
field4 : $contactfield4 \n
";
mail($email_to, $email_subject, $email_message,$email_from);
?>
OK ... i went through some sample contact form scripts online and modified it like this :
<?php
// I should think the following 4 lines correspond to the 4 fields indicated in the screenshot attached at the
// end of this message
$contactfield1=$_POST["name"]
$contactfield2=$_POST["email_from"]
$contactfield3=$_POST["subject"]
$contactfield4=$_POST["comment"]
$email_from = "";
$subject = "" ;
//$email_txt = "";
$email_to = "[b]my email id here[/b]";
$message = "field1: $contactfield1\n
field2 :$contactfield2 \n
field3 :$contactfield3 \n
field4 : $contactfield4 \n
";
mail($email_to, $subject, $message,$email_from);
?>
So is this right ? I uploaded it to test it, but it doesn't seem to work as I'm not getting anything in my email box. If I can only get this script right, I can apply it to all future sites that I create using this software (excellent software btw, the site I created only came to <500kb!!!). So I just need to get it right once. This software isn't designed for scripting- PHP or otherwise, so it needs the user to know PHP if he wishes to go by that route (else I'd have to only publish the site to CD). Also if the code requires any proper formatting (as some lines in the script seem to me to be out of place), then pls provide that too.
Image Link :
PS. In case anyone's interested, the site can be found at this link http://visitmyspace.sitegoz.com/ <br>Don't use the contact form tho .... just need that damn script to work first !