Joined for PHP hosting but have no idea what Im doing!

Status
Not open for further replies.

djstevejames

New Member
Messages
1
Reaction score
0
Points
0
Hello,

I have a virgin media account (ntlworld) and want to have a php to email form on my website.

Im entirely new to all this as its taken me something like 18 months to get NTL hosting up and running, even with their help....which consisted of saying they dont know and will call back....(they didnt)

I have finally figured out a few things, but cannot for the life of me get PHP up and running.

My html script returns a PHP page but will not email anything at all ever, no matter what I try.

The page always starts <?PHP and then follows with the script. I have tried many ready made scripts listed as working but none of them do anything other than return the ?PHP

I assume then, that ntlworld does not support PHP hosting? as some users say in their forums...or I am completely miss understanding something.

I really need to get this site up/finished and running ASAP. and could really do with some step by step help to get the PHP hosted, linked and emailing me.

Kindest regards to all

This is a copy of the page returning when I attempt to send an email :

<?php
// Website Contact Form Generator
// http://www.tele-pro.co.uk/scripts/contact_form/
// This script is free to use as long as you
// retain the credit link

// get posted data into local variables
$EmailFrom = Trim(stripslashes($_POST['EmailFrom']));
$EmailTo = "EMAIL REMOVED FOR FORUM POST";
$Subject = Trim(stripslashes($_POST['Subject']));
$FirstName = Trim(stripslashes($_POST['FirstName']));
$LastName = Trim(stripslashes($_POST['LastName']));
$Email = Trim(stripslashes($_POST['Email']));
$PostCode = Trim(stripslashes($_POST['PostCode']));
$AnythingElse = Trim(stripslashes($_POST['AnythingElse']));

// validation
$validationOK=true;
if (Trim($EmailFrom)=="") $validationOK=false;
if (Trim($FirstName)=="") $validationOK=false;
if (Trim($LastName)=="") $validationOK=false;
if (Trim($Email)=="") $validationOK=false;
if (!$validationOK) {
print "<meta http-equiv=\"refresh\" content=\"0;URL=error.htm\">";
exit;
}

// prepare email body text
$Body = "";
$Body .= "FirstName: ";
$Body .= $FirstName;
$Body .= "\n";
$Body .= "LastName: ";
$Body .= $LastName;
$Body .= "\n";
$Body .= "Email: ";
$Body .= $Email;
$Body .= "\n";
$Body .= "PostCode: ";
$Body .= $PostCode;
$Body .= "\n";
$Body .= "AnythingElse: ";
$Body .= $AnythingElse;
$Body .= "\n";

// send email
$success = mail($EmailTo, $Subject, $Body, "From: <$EmailFrom>");

// redirect to success page
if ($success){
print "<meta http-equiv=\"refresh\" content=\"0;URL=ok.htm\"thankyou.html";
}
else{
print "<meta http-equiv=\"refresh\" content=\"0;URL=error.htm\"error.html";
}
?>
 
Last edited:

diabolo

Community Advocate
Community Support
Messages
1,682
Reaction score
32
Points
48
well I was not able to access ntlworld.com
but just to CYA, is your webpage saved as *.html or *.php?
(* is wildcard)
 
Status
Not open for further replies.
Top