• Howdy! Welcome to our community of more than 130.000 members devoted to web hosting. This is a great place to get special offers from web hosts and post your own requests or ads. To start posting sign up here. Cheers! /Peo, FreeWebSpace.net
managed wordpress hosting

Debugging this PHP script...

Riverworld

New Member
Hey all...

I'm just trying to figure out what I've done wrong here... this script is meant to send the already saved information via email:

Code:
<?

// Change [email]you@your.com[/email] to the email address you want to receive these at.
$admin = ("email-address@riverworld.net");

// Change YourSite.Com to your site's name. Can be Your Site or YourSite.com or whatever.
$sitename = ("Hermione.com.ru");

// These are your form's fields. 
$FName = $_POST['FName'];
$LName = $_POST['LName'];
$username = $_POST['username'];
$subdomain = $_POST['subdomain'];
$password = $_POST['password'];
$mysql = $_POST['mysql'];
$email = $_POST['email'];
$alternate_contact = $_POST['alternate_contact'];
$Email = $_POST['Email'];
$Message = $_POST['Message'];

$submissiondate = date("D dS M, Y h:i a");

$ipaddress = GetHostByName($REMOTE_ADDR);

$filename= "reqcounter.txt" ; // Numbers the submissions of the form
$fd = fopen ($filename , "r") or die ("Can't open $filename") ;
$fstring = fread ($fd , filesize ($filename)) ;
fclose($fd) ;

$fd = fopen ($filename , "w") or die ("Can't open $filename") ;
$fcounted = $fstring + 1 ;
$fout = fwrite ($fd , $fcounted ) ;
fclose($fd) ;

// This is your formatted message.

$msg = "----- Website Submission -----\n\n";
$msg .= "Date/Time Submitted:     $submissiondate - EST\n";
$msg .= "Submission ID:           $fcounted\n\n";
$msg .= "IP address:              $ipaddress\n;
$msg .= "Name:                    $FName $LName\n\n";
$msg .= "Address wanted:          $username $subdomain\n\n";
$msg .= "Password:                $password\n;
$msg .= "mySql:                   $mysql\n";
$msg .= "Email Address:           $email\n\n";
$msg .= "Alternate contact:       $alternate_contact\n;
$msg .= "Reason for wanting hosting:\n\n";
$msg .= "$Message\n\n";

$to = "$admin";
$subject = "$sitename Hosting Request No. $fcounted\n";
$mailheaders = "From: $FName $LName <$Email>\n";
$mailheaders .= "Reply-To: $FName $LName <$Email>\n";

mail($to, $subject, $msg, $mailheaders);

?>
 
Code:
// Change [email]you@your.com[/email] to the email address you want to receive these at.
$admin = ("email-address@riverworld.net");

// Change YourSite.Com to your site's name. Can be Your Site or YourSite.com or whatever.
$sitename = ("Hermione.com.ru");

to

// Change [email]you@your.com[/email] to the email address you want to receive these at.
$admin = "email-address@riverworld.net";

// Change YourSite.Com to your site's name. Can be Your Site or YourSite.com or whatever.
$sitename = "Hermione.com.ru";
Mabe? I don't think you put the '( )' around.

And what error are you recieving exactly?
 
oohhh... sorry, thats always helpful

"Parse error: parse error, unexpected T_IF in [see code above] on line 74"
 
Code:
$msg .= "IP address:              $ipaddress\n;
$msg .= "Name:                    $FName $LName\n\n";
$msg .= "Address wanted:          $username $subdomain\n\n";
$msg .= "Password:                $password\n;
$msg .= "mySql:                   $mysql\n";
$msg .= "Email Address:           $email\n\n";
$msg .= "Alternate contact:       $alternate_contact\n;
there are some closing " missing...

it should look like this:
Code:
$msg .= "IP address:              $ipaddress\n";
$msg .= "Name:                    $FName $LName\n\n";
$msg .= "Address wanted:          $username $subdomain\n\n";
$msg .= "Password:                $password\n";
$msg .= "mySql:                   $mysql\n";
$msg .= "Email Address:           $email\n\n";
$msg .= "Alternate contact:       $alternate_contact\n";
 
Back
Top