Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Reply
Old 07-12-2005, 08:41 PM php form helppp
Average Talker

Posts: 28
Trades: 0
someone helped me before but i got an error & it wouldnt show up.

i have the form made i just need help getting it to send to my email address. if you can help here is the form: http://seamsewswell.t35.com/orderform.htm

thanks much.

Last edited by makemesick; 07-12-2005 at 08:44 PM..
makemesick is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 07-12-2005, 08:52 PM
KML9870's Avatar
One Bad Mamma :-)

Posts: 5,489
Name: Kandi
Location: Western NY
Trades: 0
script please
KML9870 is offline
Reply With Quote
View Public Profile
 
Old 07-12-2005, 09:11 PM
Average Talker

Posts: 28
Trades: 0
the here is a page with the error: http://seamsewswell.t35.com/order/orderform.php OR seamsewswell.t35.com/order/order.htm

orderform.php below
Code:
<?php
$error = $_POST['err'];
if (!$error) { $error = 0; }
?>
<html>
<head>
<style type="text/css">
input.text {
font-family: verdana;
font-size: 10px;
border: solid black 1px;}
textarea {
font-family: verdana;
font-size: 10px;
border: solid black 1px;}
</style>
</head>

<body style="
scrollbar-base-color: 73BDBD;
scrollbar-track-color: white;
scrollbar-face-color: white;
scrollbar-highlight-color: white;
scrollbar-3dlight-color: 73BDBD;
scrollbar-darkshadow-color: white;
scrollbar-shadow-color: 73BDBD;
scrollbar-arrow-color: black;">
<?php
if ($error == "email") { echo "<span style=''color:red">The email address you entered did not conform to recognised standards.</span><br>; }
?>
<form method="post" action="thanks.php">
		First name:<br><input type="text" name="fname" class="text"><br>
		Last name:<br><input type="text" name="lname" class="text"><br>
		Email:<br><input type="text" name="email" class="text"><br>
		Address:<br><input type="text" name="address" class="text"><br>
		Apt. #:<br><input type="text" name="aptnum" class="text"><br>
		City:<br><input type="text" name="city" class="text"><br>
		State:<br><input type="text" name="state" class="text"><br>
		Zip code:<br><input type="text" name="zip" class="text"><br>
		Country:<br><input type="text" name="country" class="text"><br><br>
		Means of payment:<br>
		<input type="checkbox" name="check" value="check">Check<br>
		<input type="checkbox" name="moneyorder" value="moneyorder">Money Order<br>
		(choose only one)<br><br>
		Items wanted (list full item name):<br><textarea name="question_text" rows="5" cols="50"></textarea><br><br>
		<center>Before you submit please double check your information.<br>
		<input type="submit" value="submit" style="font-size:8pt; font-family: verdana;"></center>
</font>
</form>
</body>
</html>
thanks.php below
Code:
<?php
$fname = $_POST['fname'];
$lname = $_post['lname'];
$email = $_POST['email'];
if (!eregi ("^([a-z0-9_]|\\-|\\.)+@(([a-z0-9_]|\\-)+\\.)+[a-z]{2,4}$", $email)) {
    header("Location: http://" . $_SERVER['HTTP_HOST'] . dirname($_SERVER['PHP_SELF']) . "/form.php?err=email");
}
$address = $_POST['address'];
$aptnum = $_POST['aptnum'];
$city = $_POST['city'];
$zip = $_POST['zip'];
$country = $_POST['country'];
$check = $_POST['check'];
if (!$check) { $check = "No"; } else { $check = "Yes"; }
$moneyorder = $_POST['moneyorder'];
if (!$moneyorder) { $moneyorder = "No"; } else { $moneyorder = "Yes"; }
$text = $_POST['question_text'];
$to = ilovetheused5374@yahoo.com;
$subject = "Results from online form";
$message = "First name: ".$fname."\nLast Name: ".$lname."\nEmail: ".$email."\nAddress: ".$address."\nApt# :".$aptnum."\nCity: ".$city."\nZip: ".$zip."\nCountry :".$country."\nPayment : Check - ".$check." or Moneyorder - ".$moneyorder."\nQuery: ".$text."\n";
$headers = "From: OnlineForm <ilovetheused5374@yahoo.com>\n";
mail($to, $subject, $message, $headers);

?>


<html>
<head>
</head>

<body>
<font face="verdana">
<b>Thank you for your purchase!!</b><br><br>
You will receive an email shortly.
</font>
</body>
</html>
makemesick is offline
Reply With Quote
View Public Profile
 
Old 07-13-2005, 03:50 AM
onlyplace4's Avatar
Extreme Talker

Posts: 159
Location: Skegness, Lincolnshire, England
Trades: 0
Just found another error from my original help ... I really must try and not type so fast

The line:

<?php
if ($error == "email") { echo "<span style=''color:red">The email address you entered did not conform to recognised standards.</span><br>; }
?>


should read:

<?php
if ($error == "email") { echo "<span style='color:red'>The email address you entered did not conform to recognised standards.</span><br>"; }
?>


As I say, I will have a play tonight and fix it for you.
__________________

Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE
onlyplace4 is offline
Reply With Quote
View Public Profile Visit onlyplace4's homepage!
 
Old 07-13-2005, 01:44 PM
Average Talker

Posts: 28
Trades: 0
you are like... my hero! haha. but really thank you.

im still having problems, but at least it shows up now.

http://seamsewswell.t35.com/order/order.htm

why does it automatically have the red error? & then once submit is clicked theres an error on thanks.php so it doesnt show.

orderform.php
Code:
<?php
$error = $_POST['err'];
if (!$error) { $error = 0; }
?>

<html>
<head>
<style type="text/css">
input.text {
font-family: verdana;
font-size: 10px;
border: solid black 1px;}
textarea {
font-family: verdana;
font-size: 10px;
border: solid black 1px;}
</style>
</head>

<body style="
scrollbar-base-color: 73BDBD;
scrollbar-track-color: white;
scrollbar-face-color: white;
scrollbar-highlight-color: white;
scrollbar-3dlight-color: 73BDBD;
scrollbar-darkshadow-color: white;
scrollbar-shadow-color: 73BDBD;
scrollbar-arrow-color: black;">
<?php
if ($error == "email") { echo "<span style='color:red'>The email address you entered did not conform to recognized standards.</span><br>"; }
?>

<form method="post" action="thanks.php">
		First name:<br><input type="text" name="fname" class="text"><br>
		Last name:<br><input type="text" name="lname" class="text"><br>
		Email:<br><input type="text" name="email" class="text"><br>
		Address:<br><input type="text" name="address" class="text"><br>
		Apt. #:<br><input type="text" name="aptnum" class="text"><br>
		City:<br><input type="text" name="city" class="text"><br>
		State:<br><input type="text" name="state" class="text"><br>
		Zip code:<br><input type="text" name="zip" class="text"><br>
		Country:<br><input type="text" name="country" class="text"><br><br>
		Means of payment:<br>
		<input type="checkbox" name="check" value="check">Check<br>
		<input type="checkbox" name="moneyorder" value="moneyorder">Money Order<br>
		(choose only one)<br><br>
		Items wanted (list full item name):<br><textarea name="question_text" rows="5" cols="50"></textarea><br><br>
		<center>Before you submit please double check your information.<br>
		<input type="submit" value="submit" style="font-size:8pt; font-family: verdana;"></center>
</font>
</form>
</body>
</html>
thanks.php
Code:
<?php
$fname = $_POST['fname'];
$lname = $_post['lname'];
$email = $_POST['email'];
if (!eregi ("^([a-z0-9_]|\\-|\\.)+@(([a-z0-9_]|\\-)+\\.)+[a-z]{2,4}$", $email)) {
header("Location: http://" . $_SERVER['HTTP_HOST'] . dirname($_SERVER['PHP_SELF']) . "/orderform.php?err=email");
}
$address = $_POST['address'];
$aptnum = $_POST['aptnum'];
$city = $_POST['city'];
$zip = $_POST['zip'];
$country = $_POST['country'];
$check = $_POST['check'];
if (!$check) { $check = "No"; } else { $check = "Yes"; }
$moneyorder = $_POST['moneyorder'];
if (!$moneyorder) { $moneyorder = "No"; } else { $moneyorder = "Yes"; }
$text = $_POST['question_text'];
$to = ilovetheused5374@yahoo.com;
$subject = "Results from online form";
$message = "First name: ".$fname."\nLast Name: ".$lname."\nEmail: ".$email."\nAddress: ".$address."\nApt# :".$aptnum."\nCity: ".$city."\nZip: ".$zip."\nCountry :".$country."\nPayment : Check - ".$check." or Moneyorder - ".$moneyorder."\nQuery: ".$text."\n";
$headers = "From: OnlineForm <ilovetheused5374@yahoo.com>\n";
mail($to, $subject, $message, $headers);

?>

<html>
<head>
</head>

<body>
<font face="verdana">
<b>Thank you for your purchase!!</b><br><br>
You will receive an email shortly.
</font>
</body>
</html>
makemesick is offline
Reply With Quote
View Public Profile
 
Old 07-13-2005, 02:19 PM
Average Talker

Posts: 28
Trades: 0
ahhhh, i put quotes around my email address & the thanks.php showed up.

but it didnt email the form to me. arrggggg
makemesick is offline
Reply With Quote
View Public Profile
 
Old 07-14-2005, 07:43 AM
onlyplace4's Avatar
Extreme Talker

Posts: 159
Location: Skegness, Lincolnshire, England
Trades: 0
I have run both scripts through my server, tweaked a couple of things, used my own email address (put yours back in now though), and it worked for me. The only suggestion I have with regard to it not sending mail is that your host may have the PHP mail function disabled, so check with them.

The two pages (that work) are as follows:

orderform.php
Code:
<?php
$err = $_GET['err'];
if (!$err) { $err = 0; }
?>
<html>
<head>
<style type="text/css">
input.text {
font-family: verdana;
font-size: 10px;
border: solid black 1px;}
textarea {
font-family: verdana;
font-size: 10px;
border: solid black 1px;}
</style>
</head>
<body style="scrollbar-base-color: 73BDBD; scrollbar-track-color: white; scrollbar-face-color: white; scrollbar-highlight-color: white; scrollbar-3dlight-color: 73BDBD; scrollbar-darkshadow-color: white; scrollbar-shadow-color: 73BDBD; scrollbar-arrow-color: black;">
<?php
if ($err != 0) { echo "<span style='color:red'>The email address you entered did not conform to recognized standards.</span><br>"; }
?>
<form method="post" action="thanks.php">
		First name:<br><input type="text" name="fname" class="text"><br>
		Last name:<br><input type="text" name="lname" class="text"><br>
		Email:<br><input type="text" name="email" class="text"><br>
		Address:<br><input type="text" name="address" class="text"><br>
		Apt. #:<br><input type="text" name="aptnum" class="text"><br>
		City:<br><input type="text" name="city" class="text"><br>
		State:<br><input type="text" name="state" class="text"><br>
		Zip code:<br><input type="text" name="zip" class="text"><br>
		Country:<br><input type="text" name="country" class="text"><br><br>
		Means of payment:<br>
		<input type="checkbox" name="check" value="check">Check<br>
		<input type="checkbox" name="moneyorder" value="moneyorder">Money Order<br>
		(choose only one)<br><br>
		Items wanted (list full item name):<br><textarea name="question_text" rows="5" cols="50"></textarea><br><br>
		<center>Before you submit please double check your information.<br>
		<input type="submit" value="submit" style="font-size:8pt; font-family: verdana;"></center>
</form>
</body>
</html>
thanks.php
Code:
<?php
$fname = $_POST['fname'];
$lname = $_POST['lname'];
$email = $_POST['email'];
if (!eregi ("^([a-z0-9_]|\\-|\\.)+@(([a-z0-9_]|\\-)+\\.)+[a-z]{2,4}$", $email)) {
header("Location: http://" . $_SERVER['HTTP_HOST'] . dirname($_SERVER['PHP_SELF']) . "/orderform.php?err=1");
}
$address = $_POST['address'];
$aptnum = $_POST['aptnum'];
$city = $_POST['city'];
$zip = $_POST['zip'];
$country = $_POST['country'];
$check = $_POST['check'];
if (!$check) { $check = "No"; } else { $check = "Yes"; }
$moneyorder = $_POST['moneyorder'];
if (!$moneyorder) { $moneyorder = "No"; } else { $moneyorder = "Yes"; }
$text = $_POST['question_text'];
$to = "ilovetheused5374@yahoo.com";
$subject = "Results from online form";
$message = "First name: ".$fname."\nLast Name: ".$lname."\nEmail: ".$email."\nAddress: ".$address."\nApt# :".$aptnum."\nCity: ".$city."\nZip: ".$zip."\nCountry :".$country."\nPayment : Check - ".$check." or Moneyorder - ".$moneyorder."\nQuery: ".$text."\n";
$headers = "From: OnlineForm <ilovetheused5374@yahoo.com>\n";
mail($to, $subject, $message, $headers);
?>
<html>
<head>
</head>
<body>
<font face="verdana">
<b>Thank you for your purchase!!</b><br><br>
You will receive an email shortly.
</font>
</body>
</html>
I hope that sorts you out
__________________

Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE
onlyplace4 is offline
Reply With Quote
View Public Profile Visit onlyplace4's homepage!
 
Old 07-14-2005, 11:14 AM
bman's Avatar
Skilled Talker

Posts: 85
Location: USA
Trades: 0
Check with your host if the mail server needs authentication the mail() will not work. You will have to setup a mail server.

Hope this helps
bman is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to php form helppp
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.29083 seconds with 12 queries