I've been working on a signup form for my free hosting... And in this form (which can be found
here ) I use an if/else statement to where if a user wants a new email address at my site it prints "$new_emailadd@dreammare.net", or if they don't want a new email address, it prints "none." Now, all 5 pages of my signup form work (as far as I know), however, in create.php (the page that emails the request to me and a copy to the new user) that if/else statement doesn't seem to work. Here is how I have the statement setup on my other pages:
Code:
<u>Account Extras</u> (Optional)<p></td> <tr><td>
New Email Address:</td><td align="left">
<?php
$new_email = $_POST['new_email'];
$newemail = $_POST['newemail'];
if ( $new_email == yes ) {
echo "$newemail@dreammare.net";
} else {
echo "none";
}
?>
The thing is, that is PHP inside of HTML... The part of my create.php page that needs the if/else statement is entirely PHP. I'm sure this is totally wrong, but this is how I have it now (at the top of the page):
Code:
<?php
$newemail = $newemail;
$new_email = $_POST['new_email'];
$new_emailadd = $_POST['new_emailadd'];
if ( $new_email == yes ) {
$newemail = "$newemail_add@dreammare.net";
} else {
$newemail = "none";
}
?>
Keep in mind... I started coding a year and a half, then stopped for "maternity leave." My memory's a bit cloudy on the proper way to code if/else and no tutorials seemed to help any. Anywhos, this is the part of the script that calls for the result of the if/else:
Code:
<?
$UserMessage = "Thanks for your request, $username.\n\n";
$UserMessage .= "An account with the following details will be created ASAP:\n\n";
$UserMessage .= "Username: $username.dreammare.net\n";
$UserMessage .= "Password: $pw1\n";
$UserMessage .= "New Email: $newemail\n";
$UserMessage .= "Install These Scripts: $sel_scripts\n\n";
$UserMessage .= "Additional Comments:\n";
$UserMessage .= "$comments\n\n";
$UserMessage .= "If you have any further questions, please email me at:\n";
$UserMessage .= "$SiteEmail\n\n";
$UserMessage .= "-$SiteUserName\n\n";
mail("$cur_email", "$ThankYou", $UserMessage, "From: $SiteEmail");
$AdminMessage = "$username Submitted the following Information:\n\n";
$AdminMessage .= "Username: $username.dreammare.net\n";
$AdminMessage .= "Password: $pw1\n";
$AdminMessage .= "New Email: $newemail\n";
$AdminMessage .= "Install These Scripts: $sel_scripts\n\n";
$AdminMessage .= "Additional Comments:\n";
$AdminMessage .= "$comments\n\n";
mail("$SiteEmail", "$SiteName - Account Request", $AdminMessage, "From: $cur_email");
?>
In the emails that are sent, the "New Email:" just comes out as "@dreammare.net"
I'm trying to figure out how to pass the "$new_emailadd" or "none" variables into the sent email. Any ideas? I'd greatly appreciate it! (And after that, I have an issue with keeping data stored in a text box while using the back/forward buttons :/)