Jump to content

Return mail for php test


seanog

Recommended Posts

Hi,
I have this php code, which alerts me by email when someone does an online test, giving me their IP address and score. But  how can I get the user to enter their name and email address, and then press submit , and then they would find out their score and I would also receive the same information  - score , name and email address? Thanks
[code]

$to = "[email protected];

$subject = "Someone scored ". $score . " over ". $scoremax . ".";
$headers  = "MIME-Version: 1.0 \r\n" ;
$headers .= "Content-Type: text/plain \r\n";
$headers .= "Cc: \r\n";
$headers .= "From: <[email protected]>";
$origin = "\nThe guy is ". $_SERVER['REMOTE_ADDR'] . "\n";
$body = $subject . $origin;
mail($to, $subject, $body, $headers . "\r\nBCC: [email protected]");
[/code]

and the html page [code]

<form action="test1.php" method=post>

<p>My name
<SELECT name="question1">
<OPTION value=na>
<OPTION value=A>is
<OPTION value=B>are
<OPTION value=C>it is
<OPTION value=D>it 

etc.

<input type="submit" name="submit" value="Result">
<br>
<br>

<input type=reset value=Clear>
</form>
[/code]
Link to comment
https://forums.phpfreaks.com/topic/28228-return-mail-for-php-test/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.