Hi there guys!!
I'm really new to php nad just need help with the following script.
I need to set up a basic subscribe and unsubscribe form which will be generated by a php script, then the results sent to my email account
I'm really not sure if I'm doing this right however.
Here's my html code for my form->>
<form action='generate.php' method='post' target="_parent">
<p>
<input type='hidden' name='passcount' value='1' />
Email:
<input type='text' name='email' />
Subscribe:
<input type="radio" name="radiobutton1" value="radiobutton1">
unsubscribe:
<input name="radiobutton2" type="radio" value="radiobutton2">
<input type="submit" name="Submit" value="SUBMIT HERE">
Here's my php code ->>
<?php
if (!isset($POST['passcount']))
{
$POST['passcount'] = 0;
}
if ($POST['passcount'] != 1)
{
//The subscribe/unsubscribe form here
echo "<form method='post' action='generate.php'>";
echo "<input type='hidden' name='passcount' value='1' />";
echo "Your Email: <input type='text' name='email' />";
echo "Subscribe: <input type='radiobutton1' name='option' value='subscribe' />";
echo "Remove Me: <input type='radiobutton2' name='option' value='unsubscribe' />";
echo "<input type='submit' /></form>";
}
elseif ($POST['passcount'] == 1)
{
//Make sure you have a working SMTP or sendmail server configured correctly.
$admin_mail = "firebrand_ni@hotmail.com"; //Change
$mail_subject = "Subscription!"; //Change to suit you
if ($POST['option'] == subscribe)
{
$mail_subject = "New Subscription!";
$mail_body = "Add the email $POST['email'] to your list!";
}
elseif ($POST['option'] == unsubscribe)
{
$mail_subject = "Email For Removal!";
$mail_body = "Remove the email $POST['email'] from the list!";
}
if (mail($admin_mail, $mail_subject, $mail_body))
{
echo "Thank You Message"; //Customize
}
?>
But when I try to submit anything I get the following error message->>
"Parse error: parse error, expecting T_STRING' orT_VARIABLE' or `T_NUM_STRING'/generate.php on line 24 "
Any ideas guys??
Thanks!!