newbie question
i started playing with php... and i get a delayed message with no
information from my form. my form has the correct post action.... what
am i doing wrong? I included both files... please help!
CONTACT.PHP
<html>
<head>
<title>Maintanet Contact Us</title>
<meta http-equiv="Content-Type" content="text/html;
charset=iso-8859-1">
<style type="text/css">
<!--
body {
background-color: #f1f1f1;
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 12px;
font-style: normal;
line-height: normal;
font-weight: normal;
color: #666666;
text-decoration: none;
}
#formHolder {
width: 800px;
background-color: e1e1e1;
}
..style3 { font-weight: bold;
font-size: xx-large;
font-family: Georgia, "Times New Roman", Times, serif;
}
-->
</style>
<script type="text/JavaScript">
<!--
function MM_preloadImages() { //v3.0
var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0;
i<a.length; i++)
if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j+
+].src=a[i];}}
}
//-->
</script>
</head>
<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<div id="formHolder">
<form name="form1" method="post" action="mail.php">
<body>
<div align="center">
<table width="600" height="63" border="0">
<div align="center"><br>
<p align="center">Home || Contact Us</p>
<div align="center">
<table width="100%" border="0" cellspacing="0" cellpadding="6">
<tr>
<td><label for="email">
<div align="right">Email Address:</div>
</label> </td>
<td><div align="left">
<input name="email" type="text" id="email" size="35"
maxlength="100">
</div></td>
</tr>
<tr>
<td><label for="name">
<div align="right">Name:</div>
</label> </td>
<td><div align="left">
<input name="name" type="text" id="name" size="35"
maxlength="80">
</div></td>
</tr>
<tr>
<td><label for="phone">
<div align="right">Phone:</div>
</label> </td>
<td><div align="left">
<input name="phone" type="text" id="phone" size="35"
maxlength="12">
</div></td>
</tr>
<tr>
<td><div align="right">
<label for="size">Office Size?</label>
</div></td>
<td><div align="left">
<select name="size" id="size">
<option>Choose...</option>
<option value="<5"><5</option>
<option value="5 - 10">5 - 10</option>
<option value="10 - 25">10 - 25</option>
<option value="25+">25+</option>
</select>
</div></td>
</tr>
<tr>
<td><div align="right">How did you hear about us?</div></td>
<td><input name="referrer" type="text" id="referrer"
size="35" maxlength="12"></td>
</tr>
<tr>
<td><div align="right">
<label for="comments">Comments:</label>
</div></td>
<td><div align="left">
<textarea name="comments" id="comments" cols="26"
rows="5"></textarea>
</div></td>
</tr>
<tr>
<td><div align="right">
<label for="clear"></label>
<input type="reset" name="clear" id="clear" value="Reset
Form">
</div></td>
<td><div align="right">
<label for="submit"></label>
<div align="left">
<input type="submit" name="submit" id="submit"
value="Send Email!">
</div>
</div></td>
</tr>
</table>
</div>
</form>
<p align="center"> </p>
</div>
</body>
</html>
************************************************************ ***********************************
MAIL.PHP
<?php
$emailSubject = 'Online Contact';
$webmaster = 'email [at] email.com';
$emailField = $_POST['email'];
$nameField = $_POST['name'];
$phoneField = $_POST['phone'];
$sizeField = $_POST['size'];
$referrerField = $_POST['referrer'];
$commentsField = $_POST['comments'];
$body = <<<EOD
<br><hr><br>
Email: $email <br>
Name: $name <br>
Phone: $phone <br>
Size: $size <br>
Referrer: $referrer <br>
Comments: $comments <br>
EOD;
$headers = "From: $email\r\n";
$headers .= "Content-type: text/html\r\n";
$success = mail($webmaster, $emailSubject, $body, $headers);
$theresults = <<<EOD
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Maintanet</title>
<style type="text/css">
<!--
..style3 {
font-weight: bold;
font-size: xx-large;
font-family: Georgia, "Times New Roman", Times, serif;
}
body,td,th {
color: #666666;
}
body {
background-color: #f1f1f1;
}
-->
</style>
</head>
<body>
<div align="center">
<table width="600" height="63" border="0">
<tr>
<td><div align="center"><span class="style3">Default</span><br /
>
IT Solution Provider
</div>
<p align="center">Home || Contact Us</
p>
<p align="center">Thanks for you inquiry, we will get back to
you shortly!</p>
<p> </p>
<p> </p></td>
</tr>
</table>
</div>
<p align="center"> </p>
<div align="center"></div>
</body>
</html>
EOD;
echo "$theresults";
?>
Re: newbie question
In our last episode,
<610c7186-cd7c-44d2-a23f-6528344b8d95 [at] e10g2000prf.googlegroups.com>,
the lovely and talented SammyL
broadcast on comp.lang.php:
> i started playing with php... and i get a delayed message with no
> information from my form. my form has the correct post action.... what
> am i doing wrong? I included both files... please help!
> CONTACT.PHP
><html>
><head>
><title>Maintanet Contact Us</title>
><meta http-equiv="Content-Type" content="text/html;
> charset=iso-8859-1">
><style type="text/css">
><!--
> body {
> background-color: #f1f1f1;
> font-family: Verdana, Arial, Helvetica, sans-serif;
> font-size: 12px;
> font-style: normal;
> line-height: normal;
> font-weight: normal;
> color: #666666;
> text-decoration: none;
> }
> #formHolder {
> width: 800px;
> background-color: e1e1e1;
> }
> .style3 { font-weight: bold;
> font-size: xx-large;
> font-family: Georgia, "Times New Roman", Times, serif;
> }
> -->
></style>
><script type="text/JavaScript">
><!--
> function MM_preloadImages() { //v3.0
> var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
> var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0;
> i<a.length; i++)
> if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j+
> +].src=a[i];}}
> }
> //-->
></script>
></head>
><body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
><div id="formHolder">
> <form name="form1" method="post" action="mail.php">
> <body>
Two BODY tags? This is an html problem, not a php question.
Your document is invalid. What browsers do with invalid documents is not
prescribed. Some of them will render the document as if it starts with the
second BODY tag --- there are no guarantees in error recovery.
You have two body elements. One contains an empty FORM element. The
other contains no FORM element. If a browser chooses to try to render this
invalid document, it will probably try to render one or the other, and
neither can post anything.
><div align="center">
> <table width="600" height="63" border="0">
> <div align="center"><br>
> <p align="center">Home || Contact Us</p>
> <div align="center">
> <table width="100%" border="0" cellspacing="0" cellpadding="6">
> <tr>
> <td><label for="email">
> <div align="right">Email Address:</div>
> </label> </td>
> <td><div align="left">
> <input name="email" type="text" id="email" size="35"
> maxlength="100">
> </div></td>
> </tr>
> <tr>
> <td><label for="name">
> <div align="right">Name:</div>
> </label> </td>
> <td><div align="left">
> <input name="name" type="text" id="name" size="35"
> maxlength="80">
> </div></td>
> </tr>
> <tr>
> <td><label for="phone">
> <div align="right">Phone:</div>
> </label> </td>
> <td><div align="left">
> <input name="phone" type="text" id="phone" size="35"
> maxlength="12">
> </div></td>
> </tr>
> <tr>
> <td><div align="right">
> <label for="size">Office Size?</label>
> </div></td>
> <td><div align="left">
> <select name="size" id="size">
> <option>Choose...</option>
> <option value="<5"><5</option>
> <option value="5 - 10">5 - 10</option>
> <option value="10 - 25">10 - 25</option>
> <option value="25+">25+</option>
> </select>
> </div></td>
> </tr>
> <tr>
> <td><div align="right">How did you hear about us?</div></td>
> <td><input name="referrer" type="text" id="referrer"
> size="35" maxlength="12"></td>
> </tr>
> <tr>
> <td><div align="right">
> <label for="comments">Comments:</label>
> </div></td>
> <td><div align="left">
> <textarea name="comments" id="comments" cols="26"
> rows="5"></textarea>
> </div></td>
> </tr>
> <tr>
> <td><div align="right">
> <label for="clear"></label>
> <input type="reset" name="clear" id="clear" value="Reset
> Form">
> </div></td>
> <td><div align="right">
> <label for="submit"></label>
> <div align="left">
> <input type="submit" name="submit" id="submit"
> value="Send Email!">
> </div>
> </div></td>
> </tr>
> </table>
> </div>
> </form>
> <p align="center"> </p>
></div>
></body>
></html>
> ************************************************************ ***********************************
> MAIL.PHP
><?php
> $emailSubject = 'Online Contact';
> $webmaster = 'email [at] email.com';
> $emailField = $_POST['email'];
> $nameField = $_POST['name'];
> $phoneField = $_POST['phone'];
> $sizeField = $_POST['size'];
> $referrerField = $_POST['referrer'];
> $commentsField = $_POST['comments'];
> $body = <<<EOD
><br><hr><br>
> Email: $email <br>
> Name: $name <br>
> Phone: $phone <br>
> Size: $size <br>
> Referrer: $referrer <br>
> Comments: $comments <br>
> EOD;
> $headers = "From: $email\r\n";
> $headers .= "Content-type: text/html\r\n";
> $success = mail($webmaster, $emailSubject, $body, $headers);
> $theresults = <<<EOD
><html>
><head>
><meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
><title>Maintanet</title>
><style type="text/css">
><!--
> .style3 {
> font-weight: bold;
> font-size: xx-large;
> font-family: Georgia, "Times New Roman", Times, serif;
> }
> body,td,th {
> color: #666666;
> }
> body {
> background-color: #f1f1f1;
> }
> -->
></style>
></head>
><body>
><div align="center">
> <table width="600" height="63" border="0">
> <tr>
> <td><div align="center"><span class="style3">Default</span><br /
>>
> IT Solution Provider
> </div>
> <p align="center">Home || Contact Us</
> p>
> <p align="center">Thanks for you inquiry, we will get back to
> you shortly!</p>
> <p> </p>
> <p> </p></td>
> </tr>
> </table>
> </div>
><p align="center"> </p>
><div align="center"></div>
></body>
></html>
> EOD;
> echo "$theresults";
> ?>
--
Lars Eighner <http://larseighner.com/> usenet [at] larseighner.com
Countdown: 291 days to go.
Re: newbie question
thanks! too overwhelmed and trying to learn s/t new.... thanks again!
On Apr 3, 9:20 pm, Lars Eighner <use... [at] larseighner.com> wrote:
> In our last episode,
> <610c7186-cd7c-44d2-a23f-6528344b8... [at] e10g2000prf.googlegroups.com>,
> the lovely and talented SammyL
> broadcast on comp.lang.php:
>
>
>
> > i started playing with php... and i get a delayed message with no
> > information from my form. my form has the correct post action.... what
> > am i doing wrong? I included both files... please help!
> > CONTACT.PHP
> ><html>
> ><head>
> ><title>Maintanet Contact Us</title>
> ><meta http-equiv="Content-Type" content="text/html;
> > charset=iso-8859-1">
> ><style type="text/css">
> ><!--
> > body {
> > background-color: #f1f1f1;
> > font-family: Verdana, Arial, Helvetica, sans-serif;
> > font-size: 12px;
> > font-style: normal;
> > line-height: normal;
> > font-weight: normal;
> > color: #666666;
> > text-decoration: none;
> > }
> > #formHolder {
> > width: 800px;
> > background-color: e1e1e1;
> > }
> > .style3 { font-weight: bold;
> > font-size: xx-large;
> > font-family: Georgia, "Times New Roman", Times, serif;
> > }
> > -->
> ></style>
> ><script type="text/JavaScript">
> ><!--
> > function MM_preloadImages() { //v3.0
> > var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
> > var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0;
> > i<a.length; i++)
> > if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j+
> > +].src=a[i];}}
> > }
> > //-->
> ></script>
> ></head>
> ><body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
> ><div id="formHolder">
> > <form name="form1" method="post" action="mail.php">
> > <body>
>
> Two BODY tags? This is an html problem, not a php question.
>
> Your document is invalid. What browsers do with invalid documents is not
> prescribed. Some of them will render the document as if it starts with the
> second BODY tag --- there are no guarantees in error recovery.
>
> You have two body elements. One contains an empty FORM element. The
> other contains no FORM element. If a browser chooses to try to render this
> invalid document, it will probably try to render one or the other, and
> neither can post anything.
>
>
>
> ><div align="center">
> > <table width="600" height="63" border="0">
> > <div align="center"><br>
> > <p align="center">Home || Contact Us</p>
> > <div align="center">
> > <table width="100%" border="0" cellspacing="0" cellpadding="6">
> > <tr>
> > <td><label for="email">
> > <div align="right">Email Address:</div>
> > </label> </td>
> > <td><div align="left">
> > <input name="email" type="text" id="email" size="35"
> > maxlength="100">
> > </div></td>
> > </tr>
> > <tr>
> > <td><label for="name">
> > <div align="right">Name:</div>
> > </label> </td>
> > <td><div align="left">
> > <input name="name" type="text" id="name" size="35"
> > maxlength="80">
> > </div></td>
> > </tr>
> > <tr>
> > <td><label for="phone">
> > <div align="right">Phone:</div>
> > </label> </td>
> > <td><div align="left">
> > <input name="phone" type="text" id="phone" size="35"
> > maxlength="12">
> > </div></td>
> > </tr>
> > <tr>
> > <td><div align="right">
> > <label for="size">Office Size?</label>
> > </div></td>
> > <td><div align="left">
> > <select name="size" id="size">
> > <option>Choose...</option>
> > <option value="<5"><5</option>
> > <option value="5 - 10">5 - 10</option>
> > <option value="10 - 25">10 - 25</option>
> > <option value="25+">25+</option>
> > </select>
> > </div></td>
> > </tr>
> > <tr>
> > <td><div align="right">How did you hear about us?</div></td>
> > <td><input name="referrer" type="text" id="referrer"
> > size="35" maxlength="12"></td>
> > </tr>
> > <tr>
> > <td><div align="right">
> > <label for="comments">Comments:</label>
> > </div></td>
> > <td><div align="left">
> > <textarea name="comments" id="comments" cols="26"
> > rows="5"></textarea>
> > </div></td>
> > </tr>
> > <tr>
> > <td><div align="right">
> > <label for="clear"></label>
> > <input type="reset" name="clear" id="clear" value="Reset
> > Form">
> > </div></td>
> > <td><div align="right">
> > <label for="submit"></label>
> > <div align="left">
> > <input type="submit" name="submit" id="submit"
> > value="Send Email!">
> > </div>
> > </div></td>
> > </tr>
> > </table>
> > </div>
> > </form>
> > <p align="center"> </p>
> ></div>
> ></body>
> ></html>
> > ************************************************************ ***********************************
> > MAIL.PHP
> ><?php
> > $emailSubject = 'Online Contact';
> > $webmaster = 'em... [at] email.com';
> > $emailField = $_POST['email'];
> > $nameField = $_POST['name'];
> > $phoneField = $_POST['phone'];
> > $sizeField = $_POST['size'];
> > $referrerField = $_POST['referrer'];
> > $commentsField = $_POST['comments'];
> > $body = <<<EOD
> ><br><hr><br>
> > Email: $email <br>
> > Name: $name <br>
> > Phone: $phone <br>
> > Size: $size <br>
> > Referrer: $referrer <br>
> > Comments: $comments <br>
> > EOD;
> > $headers = "From: $email\r\n";
> > $headers .= "Content-type: text/html\r\n";
> > $success = mail($webmaster, $emailSubject, $body, $headers);
> > $theresults = <<<EOD
> ><html>
> ><head>
> ><meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
> ><title>Maintanet</title>
> ><style type="text/css">
> ><!--
> > .style3 {
> > font-weight: bold;
> > font-size: xx-large;
> > font-family: Georgia, "Times New Roman", Times, serif;
> > }
> > body,td,th {
> > color: #666666;
> > }
> > body {
> > background-color: #f1f1f1;
> > }
> > -->
> ></style>
> ></head>
> ><body>
> ><div align="center">
> > <table width="600" height="63" border="0">
> > <tr>
> > <td><div align="center"><span class="style3">Default</span><br /
>
> > IT Solution Provider
> > </div>
> > <p align="center">Home || Contact Us</
> > p>
> > <p align="center">Thanks for you inquiry, we will get back to
> > you shortly!</p>
> > <p> </p>
> > <p> </p></td>
> > </tr>
> > </table>
> > </div>
> ><p align="center"> </p>
> ><div align="center"></div>
> ></body>
> ></html>
> > EOD;
> > echo "$theresults";
> > ?>
>
> --
> Lars Eighner <http://larseighner.com/> use... [at] larseighner.com
> Countdown: 291 days to go.