Jump to content

Recommended Posts

Hi. I was just wondering if anyone could tell me what is wrong with my mail form. Its supposed to have two boxes (URL + Description) and a submit button. Then i'm meant to receive the mail telling me what they have entered. The only problem is (i think) that its hosted on a free hoster - php0h.com, beacuse my proper hoster (NTL) doesn't support PHP. Does the email I type in have to be on the same domain name thing as where the script is? e.g if my address was www.cat.com my email would have to be anythinghere@cat.com? cause if this is true im stuffed, cause php0h doesn't offer free email services. If there are any other email form restrictions or stuff i need to know i'd be greatfull. heres my html code and php script if it will help:

[code]
<form method="POST" action="http://everythingred.php1h.com/scripts/contact.php">
Fields marked (*) are required

<p>LinkURL:<br>
<input type="text" name="LinkURL">
<p>Description:<br>
<textarea name="Description"></textarea>
<p><input type="submit" name="submit" value="Submit">
</form>
<p>
[/code]

and the php script (hosted somwhere else)

[code]
<?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 = "A Visitor";
$EmailTo = "myemail@ntlworld.com";
$Subject = "Submitted Link";
$LinkURL = Trim(stripslashes($_POST['LinkURL']));
$Description = Trim(stripslashes($_POST['Description']));

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

// prepare email body text
$Body = "";
$Body .= "LinkURL: ";
$Body .= $LinkURL;
$Body .= "\n";
$Body .= "Description: ";
$Body .= $Description;
$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\">";
}
else{
  print "<meta http-equiv=\"refresh\" content=\"0;URL=error.htm\">";
}
?>
[/code]


PLEASE help i've been stuck on this for ages.
Link to comment
https://forums.phpfreaks.com/topic/10877-mail-form-help/
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.