Form Mail Problem<

admin

Administrator
Staff member
I have a form redirect to sentInfo.php which is below...


<?php

$var1 = $_GET['isPass'];
$var2 = $_GET['passChange'];
$var3 = $_GET['passPersonal'];
$var4 = $_GET['doBackup'];
$var5 = $_GET['backupOften'];
$var6 = $_GET['backupWhere'];
$var7 = $_GET['netSec'];
$var8 = $_GET['firewallDo'];
$var9 = $_GET['virusScan'];
$var10 = $_GET['attachOp'];
$var11 = $_GET['dataDo'];
$var12 = $_GET['dataDet'];
$var13 = $_GET['dataPrivate'];
$var14 = $_GET['dataProtection'];

$message = array($_GET['isPass'],$_GET['passChange'],$_GET['passPersonal'],$_GET['doBackup'],$_GET['backupOften'],$_GET['backupWhere'],$_GET['netSec'],$_GET['firewallDo'],$_GET['virusScan'],$_GET['attachOp'],$_GET['dataDo'],$_GET['dataDet'],$_GET['dataPrivate'],$_GET['dataProtection']);
$subject = 'AVCE Questionnaire';
$mailto = '*******@**********.karoo.co.uk';

mail($mailto,$subject,$message)

echo "Thanks for your time";

?>

My problem is that it doesn't send the message.remember the semicolon at the end of your mail line?Hmm.. Yes the semicolon is missing. Also, you're sending an array as third argument to mail(). It must be a string. there are some line breaks in the declaration of $message, but maybe it's the forum doing that. Don't break lines in the middle of a variable name anyway ;)
You're initializing a lot of variables for nothing.. all the $var's. They can go.
If you want to print an array into your mail, you could do like this:

<?php

$message = array($_GET['isPass'],$_GET['passChange'],$_GET['passPersonal'],$_GET['doBackup'],$_GET['backupOften'],
$_GET['backupWhere'],$_GET['netSec'],$_GET['firewallDo'],$_GET['virusScan'],$_GET['attachOp'],$_GET['dataDo'],
$_GET['dataDet'],$_GET['dataPrivate'],$_GET['dataProtection']);
$subject = 'AVCE Questionnaire';
$mailto = '*******@**********.karoo.co.uk';

mail($mailto,$subject,print_r($message, true));

echo "Thanks for your time";

?>


That won't produce a very practical mail though. I don't really know why your loading the $_GET values in an array again, they're already in one. Well, it's your script, and I won't mess any further with your structure, unless you really want me to. Maybe you could look in all the other mail()+form threads in here..
This one has an example of how to produce a little more comprehensive e-mail:
<!-- m --><a class="postlink" href="http://www.htmlforums.com/showthread.php?s=&threadid=29570Would">http://www.htmlforums.com/showthread.ph ... 29570Would</a><!-- m --> it be easier to store the information into a text file then Download it and analize it?Well, it's pretty much the same amount of work. But if you would have to really Download every file individually, it would be messy. You'd need a practical web-interface that displays the files to you, the admin. If you want the info on your own computer, and not on the server, then e-mail the info. If you could keep it on the server, and make a practical interface for it, a database would be recommended, but files would do too.hmm, check that you are maybe using $_POST not $_GET, it would be more secure...I can keep it on the server no problems. I would need help on how to store the information into the MySQL database (PHP coding thats is), I ain't very good at MySQL you know.
 
Back
Top