21, November 2008

PHP forms - a few questions - webmaster forum

 
Webdigity webmaster forums
This forum shares its ad revenue with its members!
[ Home | Help | Search | Forum's Shop | Archive | Login | Register | Webmaster Directory ]
Webdigity Webmaster Forums  >  Web Development  >  PhP
Topic: PHP forms - a few questions
« previous next »
Pages: 1 [2] Print

Author Topic: PHP forms - a few questions  (Read 1148 times)
World Wide Whale
***
Gender: Female
Posts: 152
1036 credits
Members referred : 0



« Reply #20 on: Feb 13, 2007, 07:31:29 PM »

If possible I would also like to know the IP address that is sending it the form
I am a metal monkey!
Administrator
Community Supporter ?
Jedai Sword Master
*****
Gender: Male
Posts: 8245
42457 credits
Members referred : 3



« Reply #21 on: Feb 13, 2007, 07:35:25 PM »

To send headers (using the header function) you should use the command before outputing anything in the browser.

That means that you have to change your code to this :

Code:
<?php
if ( count($_GET) ){
 
$mail '';
 
$_GET['Ip adress'] = $_SERVER['REMOTE_ADDR'];
 foreach ( 
$_GET as $var => $val $mail .= $var ' -> ' $val "\n";
 
mail'myemail@myhost.com''Free Quote Request'$mail );
 
header('Location: http://www.example.com/');
 exit;
}
echo 
'<form method="get" action="' $_SERVER['PHP_SELF'] . '">
<table border="0">
<tr>
<td>Name:*</td> 
<td><input type="text" name="Name"></td>
</tr>
<tr>
<td>Company:</td>  
<td><input type="text" name="Company"></td>
</tr>
<tr>
<td>Title:</td>   
<td><input type="text" name="Title"></td>
</tr>
<tr>
<td>Contact Number:</td>   
<td><input type="text" name="Number"></td>
</tr>
<tr>
<td>Email:*</td>   
<td><input type="text" name="Email"></td>
</tr>
</table>
<hr>
<b>Requesting a Quote for:</b><br>
<table border="0" cellspacing="10px">
<tr>
<td><input type="radio" name="QuoteType" value="Print_WO"> Print Design without printing</td>
<td><input type="radio" name="QuoteType" value="Web_W"> Web Design with hosting & domain name</td>
</tr>
<tr>
<td><input type="radio" name="QuoteType" value="Print_W"> Print Design with printing</td>
<td><input type="radio" name="QuoteType" value="Web_WO"> Web Design without hosting & domain name</td>
</tr>
</table>
<hr>
<h3>Print Design</h3>
<p>Please complete this section if you would like a print design quote.</p>
Item being quoted:<br>
<table border="0" cellspacing="10px">
<tr>
<td><input type="radio" name="PrintItemType" value="BC"></td> 
<td>Business Card</td>
<td><input type="radio" name="PrintItemType" value="Flyer"></td>
<td>Flyer</td>

</tr>
<tr>
<td><input type="radio" name="PrintItemType" value="2FB"></td>
<td>2-Fold Brochure</td> 
<td><input type="radio" name="PrintItemType" value="3FB"></td> 
<td>3-Fold Brochure</td>
</tr>
<tr>
<td><input type="radio" name="PrintItemType" value="PC"></td>
<td>Post Card</td>
<td><input type="radio" name="PrintItemType" value="Sign"></td> 
<td>Signs</td>
</tr>
<tr>
<td><input type="radio" name="PrintItemType" value="PA"></td>
<td>Publication Advertisment, <i>we cannot provide printing prices on this item</i>.</td>
<td><input type="radio" name="PrintItemType" value="Other"></td>
<td>Other, <i>Please indicate in comment box what type of item you are having quoted</i></td>

</tr>
</table>
<br>
Colors:<br>
If you are quoting pricing for printing please be sure to identify the colors you would like to use if you choose 2 or 3 colors in the comment box.<br>
<table border="0" cellspacing="10px">
<tr>
<td><input type="radio" name="Color" value="CMYK"></td>
<td>Full Color (CMYK)</td>
<td><input type="radio" name="Color" value="2"></td> 
<td>2 Colors</td>
</tr>
<tr>
<td><input type="radio" name="Color" value="BW"></td>
<td>Black & White or Grey Scale</td>
<td><input type="radio" name="Color" value="3"></td> 
<td>3 Colors</td>
</tr>
</table>
<br>
Answer the below question only if you would chose to have printing priced also.<br>
Quanity: <input type="text" name="Quanity1">&nbsp;&nbsp;<input type="text" name="Quanity2"><br>
<br>
<hr>
<h3>Web Design</h3>
<p>Please complete this section if you would like a web design quote.</p>
Number of Pages on Site: <input type="text" name="Pages"><br>
<br>
Maintaince Package:<br>
<table border="0" cellspacing="10px">
<tr>
<td><input type="radio" name="maint" value="Weekly"> </td>
<td>Weekly</td>
<td><input type="radio" name="maint" value="Monthly"> </td>
<td>Monthly</td>
</tr>
<tr>
<td><input type="radio" name="maint" value="AN"> </td>
<td>As Needed</td>
<td><input type="radio" name="maint" value="None"> </td>
<td>None,&nbsp;I will maintain my own site</td>
</tr>
</table>
<br>
Online Features: <br>
<table border="0" cellspacing="10px">
<tr>
<td><input type="checkbox" name="OnlineFeatures" value="PhotoAlbum"></td>
<td>Photo Album </td>
<td><input type="checkbox" name="OnlineFeatures" value="ScrollingImages"></td>
<td>Scrolling Images </td>
<td><input type="checkbox" name="OnlineFeatures" value="DDMenu"></td>
<td>Drop Down Menu </td>
</tr>
<tr>
<td><input type="checkbox" name="OnlineFeatures" value="SS"></td>
<td>Style Switcher <br><i>Please include how <br>many syles you need</i> </td>
<td><input type="checkbox" name="OnlineFeatures" value="ShoppingCart"></td>
<td>Shopping Cart </td>
<td><input type="checkbox" name="OnlineFeatures" value="GB"></td>
<td>Guest Book </td>
</tr>
<tr>
<td><input type="checkbox" name="OnlineFeatures" value="Contact"></td>
<td>Contact Form </td>
<td><input type="checkbox" name="OnlineFeatures" value="Music"></td>
<td>Music </td>
<td><input type="checkbox" name="OnlineFeatures" value="Form"></td>
<td>Form <br>(like this one) </td>
</tr>
<tr>
<td><input type="checkbox" name="OnlineFeatures" value="PWP"></td>
<td>Password Protection </td>
<td><input type="checkbox" name="OnlineFeatures" value="Admin"></td>
<td>Administrative Back end </td>
<td><input type="checkbox" name="OnlineFeatures" value="RSS"></td>
<td>RSS Feed </td>
</tr>
<tr>
<td colspan="1"><input type="checkbox" name="OnlineFeatures" value="Other"><br></td>
<td colspan="5">Other <br><i>Please specify what type feature you are looking for in the comment box.</i> </td>

</tr>
</table>
<hr>
<h3>Comments</h3>
<p>Please give us any information you feel is important, or we have requested in the comment box below so you can recieve the most accurte quote available.</p>
<TEXTAREA NAME="feedback" ROWS=15 COLS=100></TEXTAREA>
<br><br>
<input type="submit" value="Submit">&nbsp;&nbsp;&nbsp;<input type="reset" value="Reset">
</form>'
;
?>


This will also send the ip adress.

Enjoy Smiley

Trial and Error my two best teachers Cool
Join us @ facebook Visit through proxy or twitter Visit through proxy

Last blog : Free Unlimited Bandwith and disk space to good to be true?
World Wide Whale
***
Gender: Female
Posts: 152
1036 credits
Members referred : 0



« Reply #22 on: Feb 13, 2007, 07:41:23 PM »

I am getting this error message...
"Warning: Cannot modify header information - headers already sent by (output started at /home/content/A/m/m/myname/html/quote.php:11) in /home/content/A/m/m/myname/html/quote.php on line 29"

But the email is working fine....
« Last Edit: Feb 13, 2007, 07:45:37 PM by PHPNewbie-KY »
I am a metal monkey!
Administrator
Community Supporter ?
Jedai Sword Master
*****
Gender: Male
Posts: 8245
42457 credits
Members referred : 3



« Reply #23 on: Feb 13, 2007, 07:49:50 PM »

It should work. Is there any other output before that script?

Trial and Error my two best teachers Cool
Join us @ facebook Visit through proxy or twitter Visit through proxy

Last blog : Free Unlimited Bandwith and disk space to good to be true?
World Wide Whale
***
Gender: Female
Posts: 152
1036 credits
Members referred : 0



« Reply #24 on: Feb 13, 2007, 07:53:41 PM »

I don't think so, here is the full code (minus identifying stuff)

Code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title></title>
<link href="3.css" rel="stylesheet" type="text/css">
</head>

<body>
<div id="whitebigbar" class="whitebigbar">&nbsp;<div class="bar">&nbsp;</div></div>
<div id="mainContentWindow">
<div class="barlight">&nbsp;</div>
<div id="bodyContent">
<div id="LogoTop">&nbsp;</div>
<div id="LogoLeft">&nbsp;</div> <div id="menuContainer">
<iframe id="menu.htm" src="menu.htm" height="90px" width="770px" marginwidth="0" marginheight="0" scrolling="No" frameborder="0"  ALLOWTRANSPARENCY="true"></iframe>
</div>
</div>
<div id="centerDiv" style=" z-index: 10; width: 90%; left: 40px; padding: 10px; text-align: left; margin-top: 170px; ">
<h1>FREE QUOTE</h1>
<p>Please fill out this form for a free, no obligation quote.</p>
<p><i>* signify required fields.</i></p>
<?php
if ( count($_GET) ){
 
$mail '';
 
$_GET['Ip adress'] = $_SERVER['REMOTE_ADDR'];
 foreach ( 
$_GET as $var => $val $mail .= $var ' -> ' $val "\n";
 
mail'myemail@mydomain.com''Free Quote Request'$mail );
 
header('Location: http://www.mydomain.info/thanks.htm');
 exit;
}
echo 
'<form method="get" action="' $_SERVER['PHP_SELF'] . '">
<table border="0">
<tr>
<td>Name:*</td> 
<td><input type="text" name="Name"></td>
</tr>
<tr>
<td>Company:</td>  
<td><input type="text" name="Company"></td>
</tr>
<tr>
<td>Title:</td>   
<td><input type="text" name="Title"></td>
</tr>
<tr>
<td>Contact Number:</td>   
<td><input type="text" name="Number"></td>
</tr>
<tr>
<td>Email:*</td>   
<td><input type="text" name="Email"></td>
</tr>
</table>
<hr>
<b>Requesting a Quote for:</b><br>
<table border="0" cellspacing="10px">
<tr>
<td><input type="radio" name="QuoteType" value="Print_WO"> Print Design without printing</td>
<td><input type="radio" name="QuoteType" value="Web_W"> Web Design with hosting & domain name</td>
</tr>
<tr>
<td><input type="radio" name="QuoteType" value="Print_W"> Print Design with printing</td>
<td><input type="radio" name="QuoteType" value="Web_WO"> Web Design without hosting & domain name</td>
</tr>
</table>
<hr>
<h3>Print Design</h3>
<p>Please complete this section if you would like a print design quote.</p>
Item being quoted:<br>
<table border="0" cellspacing="10px">
<tr>
<td><input type="radio" name="PrintItemType" value="BC"></td> 
<td>Business Card</td>
<td><input type="radio" name="PrintItemType" value="Flyer"></td>
<td>Flyer</td>

</tr>
<tr>
<td><input type="radio" name="PrintItemType" value="2FB"></td>
<td>2-Fold Brochure</td> 
<td><input type="radio" name="PrintItemType" value="3FB"></td> 
<td>3-Fold Brochure</td>
</tr>
<tr>
<td><input type="radio" name="PrintItemType" value="PC"></td>
<td>Post Card</td>
<td><input type="radio" name="PrintItemType" value="Sign"></td> 
<td>Signs</td>
</tr>
<tr>
<td><input type="radio" name="PrintItemType" value="PA"></td>
<td>Publication Advertisment, <i>we cannot provide printing prices on this item</i>.</td>
<td><input type="radio" name="PrintItemType" value="Other"></td>
<td>Other, <i>Please indicate in comment box what type of item you are having quoted</i></td>

</tr>
</table>
<br>
Colors:<br>
If you are quoting pricing for printing please be sure to identify the colors you would like to use if you choose 2 or 3 colors in the comment box.<br>
<table border="0" cellspacing="10px">
<tr>
<td><input type="radio" name="Color" value="CMYK"></td>
<td>Full Color (CMYK)</td>
<td><input type="radio" name="Color" value="2"></td> 
<td>2 Colors</td>
</tr>
<tr>
<td><input type="radio" name="Color" value="BW"></td>
<td>Black & White or Grey Scale</td>
<td><input type="radio" name="Color" value="3"></td> 
<td>3 Colors</td>
</tr>
</table>
<br>
Answer the below question only if you would chose to have printing priced also.<br>
Quanity: <input type="text" name="Quanity1">&nbsp;&nbsp;<input type="text" name="Quanity2"><br>
<br>
<hr>
<h3>Web Design</h3>
<p>Please complete this section if you would like a web design quote.</p>
Number of Pages on Site: <input type="text" name="Pages"><br>
<br>
Maintaince Package:<br>
<table border="0" cellspacing="10px">
<tr>
<td><input type="radio" name="maint" value="Weekly"> </td>
<td>Weekly</td>
<td><input type="radio" name="maint" value="Monthly"> </td>
<td>Monthly</td>
</tr>
<tr>
<td><input type="radio" name="maint" value="AN"> </td>
<td>As Needed</td>
<td><input type="radio" name="maint" value="None"> </td>
<td>None,&nbsp;I will maintain my own site</td>
</tr>
</table>
<br>
Online Features: <br>
<table border="0" cellspacing="10px">
<tr>
<td><input type="checkbox" name="OnlineFeatures01" value="PhotoAlbum"></td>
<td>Photo Album </td>
<td><input type="checkbox" name="OnlineFeatures02" value="ScrollingImages"></td>
<td>Scrolling Images </td>
<td><input type="checkbox" name="OnlineFeatures03" value="DDMenu"></td>
<td>Drop Down Menu </td>
</tr>
<tr>
<td><input type="checkbox" name="OnlineFeatures04" value="SS"></td>
<td>Style Switcher <br><i>Please include how <br>many syles you need</i> </td>
<td><input type="checkbox" name="OnlineFeatures05" value="ShoppingCart"></td>
<td>Shopping Cart </td>
<td><input type="checkbox" name="OnlineFeatures06" value="GB"></td>
<td>Guest Book </td>
</tr>
<tr>
<td><input type="checkbox" name="OnlineFeatures07" value="Contact"></td>
<td>Contact Form </td>
<td><input type="checkbox" name="OnlineFeatures08" value="Music"></td>
<td>Music </td>
<td><input type="checkbox" name="OnlineFeatures09" value="Form"></td>
<td>Form <br>(like this one) </td>
</tr>
<tr>
<td><input type="checkbox" name="OnlineFeatures10" value="PWP"></td>
<td>Password Protection </td>
<td><input type="checkbox" name="OnlineFeatures11" value="Admin"></td>
<td>Administrative Back end </td>
<td><input type="checkbox" name="OnlineFeatures12" value="RSS"></td>
<td>RSS Feed </td>
</tr>
<tr>
<td colspan="1"><input type="checkbox" name="OnlineFeatures13" value="Other"><br></td>
<td colspan="5">Other <br><i>Please specify what type feature you are looking for in the comment box.</i> </td>

</tr>
</table>
<hr>
<h3>Comments</h3>
<p>Please give us any information you feel is important, or we have requested in the comment box below so you can recieve the most accurte quote available.</p>
<TEXTAREA NAME="feedback" ROWS=15 COLS=100></TEXTAREA>
<br><br>
<input type="submit" value="Submit">&nbsp;&nbsp;&nbsp;<input type="reset" value="Reset">
</form>'
;
?>
</div>

</body>
</html>
I am a metal monkey!
Administrator
Community Supporter ?
Jedai Sword Master
*****
Gender: Male
Posts: 8245
42457 credits
Members referred : 3



« Reply #25 on: Feb 13, 2007, 08:04:17 PM »

Put whatever there is before the <?php into the echo command, and it will work Wink

Trial and Error my two best teachers Cool
Join us @ facebook Visit through proxy or twitter Visit through proxy

Last blog : Free Unlimited Bandwith and disk space to good to be true?
Global Moderator
Community Supporter ?
Jedai Sword Master
*****
Gender: Male
Posts: 6437
39446 credits
Members referred : 374


It's time to use PHP5!


« Reply #26 on: Feb 13, 2007, 08:08:18 PM »

I am getting this error message...
"Warning: Cannot modify header information - headers already sent by (output started at /home/content/A/m/m/myname/html/quote.php:11) in /home/content/A/m/m/myname/html/quote.php on line 29"

But the email is working fine....
remove the whitespace at the top of your script


Last blog : Just a better Internet portal provided by Google
World Wide Whale
***
Gender: Female
Posts: 152
1036 credits
Members referred : 0



« Reply #27 on: Feb 13, 2007, 08:15:18 PM »

Like this?
Code:
<?php
if ( count($_GET) ){
 
$mail '';
 
$_GET['Ip adress'] = $_SERVER['REMOTE_ADDR'];
 foreach ( 
$_GET as $var => $val $mail .= $var ' -> ' $val "\n";
 
mail'myemail@myhost.com''Free Quote Request'$mail );
 
header('Location: http://www.mydomain.info/thanks.htm');
 exit;
}
echo 
'<form method="get" action="' $_SERVER['PHP_SELF'] . '">
echo '
<div id="whitebigbar" class="whitebigbar">&nbsp;<div class="bar">&nbsp;</div></div>
<
div id="mainContentWindow">
<div class="barlight">&nbsp;</div>
<
div id="bodyContent">
<div id="LogoTop">&nbsp;</div>
<div id="LogoLeft">&nbsp;</div> <div id="menuContainer">
<iframe id="menu.htm" src="menu.htm" height="90px" width="770px" marginwidth="0" marginheight="0" scrolling="No" frameborder="0"  ALLOWTRANSPARENCY="true"></iframe>
</div>
</
div>
<
div id="centerDiv" style=" z-index: 10; width: 90%; left: 40px; padding: 10px; text-align: left; margin-top: 170px; ">
<
h1>FREE QUOTE</h1>
<
p>Please fill out this form for a freeno obligation quote.</p>
<
p><i>* signify required fields.</i></p>'
<table border="0">
<tr>
<td>Name:*</td> 
<td><input type="text" name="Name"></td>
</tr>
<tr>
<td>Company:</td>  
<td><input type="text" name="Company"></td>
</tr>
<tr>
<td>Title:</td>   
<td><input type="text" name="Title"></td>
</tr>
<tr>
<td>Contact Number:</td>   
<td><input type="text" name="Number"></td>
</tr>
<tr>
<td>Email:*</td>   
<td><input type="text" name="Email"></td>
</tr>
</table>
<hr>
<b>Requesting a Quote for:</b><br>
<table border="0" cellspacing="10px">
<tr>
<td><input type="radio" name="QuoteType" value="Print_WO"> Print Design without printing</td>
<td><input type="radio" name="QuoteType" value="Web_W"> Web Design with hosting & domain name</td>
</tr>
<tr>
<td><input type="radio" name="QuoteType" value="Print_W"> Print Design with printing</td>
<td><input type="radio" name="QuoteType" value="Web_WO"> Web Design without hosting & domain name</td>
</tr>
</table>
<hr>
<h3>Print Design</h3>
<p>Please complete this section if you would like a print design quote.</p>
Item being quoted:<br>
<table border="0" cellspacing="10px">
<tr>
<td><input type="radio" name="PrintItemType" value="BC"></td> 
<td>Business Card</td>
<td><input type="radio" name="PrintItemType" value="Flyer"></td>
<td>Flyer</td>

</tr>
<tr>
<td><input type="radio" name="PrintItemType" value="2FB"></td>
<td>2-Fold Brochure</td> 
<td><input type="radio" name="PrintItemType" value="3FB"></td> 
<td>3-Fold Brochure</td>
</tr>
<tr>
<td><input type="radio" name="PrintItemType" value="PC"></td>
<td>Post Card</td>
<td><input type="radio" name="PrintItemType" value="Sign"></td> 
<td>Signs</td>
</tr>
<tr>
<td><input type="radio" name="PrintItemType" value="PA"></td>
<td>Publication Advertisment, <i>we cannot provide printing prices on this item</i>.</td>
<td><input type="radio" name="PrintItemType" value="Other"></td>
<td>Other, <i>Please indicate in comment box what type of item you are having quoted</i></td>

</tr>
</table>
<br>
Colors:<br>
If you are quoting pricing for printing please be sure to identify the colors you would like to use if you choose 2 or 3 colors in the comment box.<br>
<table border="0" cellspacing="10px">
<tr>
<td><input type="radio" name="Color" value="CMYK"></td>
<td>Full Color (CMYK)</td>
<td><input type="radio" name="Color" value="2"></td> 
<td>2 Colors</td>
</tr>
<tr>
<td><input type="radio" name="Color" value="BW"></td>
<td>Black & White or Grey Scale</td>
<td><input type="radio" name="Color" value="3"></td> 
<td>3 Colors</td>
</tr>
</table>
<br>
Answer the below question only if you would chose to have printing priced also.<br>
Quanity: <input type="text" name="Quanity1">&nbsp;&nbsp;<input type="text" name="Quanity2"><br>
<br>
<hr>
<h3>Web Design</h3>
<p>Please complete this section if you would like a web design quote.</p>
Number of Pages on Site: <input type="text" name="Pages"><br>
<br>
Maintaince Package:<br>
<table border="0" cellspacing="10px">
<tr>
<td><input type="radio" name="maint" value="Weekly"> </td>
<td>Weekly</td>
<td><input type="radio" name="maint" value="Monthly"> </td>
<td>Monthly</td>
</tr>
<tr>
<td><input type="radio" name="maint" value="AN"> </td>
<td>As Needed</td>
<td><input type="radio" name="maint" value="None"> </td>
<td>None,&nbsp;I will maintain my own site</td>
</tr>
</table>
<br>
Online Features: <br>
<table border="0" cellspacing="10px">
<tr>
<td><input type="checkbox" name="OnlineFeatures01" value="PhotoAlbum"></td>
<td>Photo Album </td>
<td><input type="checkbox" name="OnlineFeatures02" value="ScrollingImages"></td>
<td>Scrolling Images </td>
<td><input type="checkbox" name="OnlineFeatures03" value="DDMenu"></td>
<td>Drop Down Menu </td>
</tr>
<tr>
<td><input type="checkbox" name="OnlineFeatures04" value="SS"></td>
<td>Style Switcher <br><i>Please include how <br>many syles you need</i> </td>
<td><input type="checkbox" name="OnlineFeatures05" value="ShoppingCart"></td>
<td>Shopping Cart </td>
<td><input type="checkbox" name="OnlineFeatures06" value="GB"></td>
<td>Guest Book </td>
</tr>
<tr>
<td><input type="checkbox" name="OnlineFeatures07" value="Contact"></td>
<td>Contact Form </td>
<td><input type="checkbox" name="OnlineFeatures08" value="Music"></td>
<td>Music </td>
<td><input type="checkbox" name="OnlineFeatures09" value="Form"></td>
<td>Form <br>(like this one) </td>
</tr>
<tr>
<td><input type="checkbox" name="OnlineFeatures10" value="PWP"></td>
<td>Password Protection </td>
<td><input type="checkbox" name="OnlineFeatures11" value="Admin"></td>
<td>Administrative Back end </td>
<td><input type="checkbox" name="OnlineFeatures12" value="RSS"></td>
<td>RSS Feed </td>
</tr>
<tr>
<td colspan="1"><input type="checkbox" name="OnlineFeatures13" value="Other"><br></td>
<td colspan="5">Other <br><i>Please specify what type feature you are looking for in the comment box.</i> </td>

</tr>
</table>
<hr>
<h3>Comments</h3>
<p>Please give us any information you feel is important, or we have requested in the comment box below so you can recieve the most accurte quote available.</p>
<TEXTAREA NAME="feedback" ROWS=15 COLS=100></TEXTAREA>
<br><br>
<input type="submit" value="Submit">&nbsp;&nbsp;&nbsp;<input type="reset" value="Reset">
</form>'
;
?>
</div>
Global Moderator
Community Supporter ?
Jedai Sword Master
*****
Gender: Male
Posts: 6437
39446 credits
Members referred : 374


It's time to use PHP5!


« Reply #28 on: Feb 13, 2007, 08:33:13 PM »

before this code need to be nothing:

<?php
if ( count($_GET) ){
 $mail = '';
 $_GET['Ip adress'] = $_SERVER['REMOTE_ADDR'];
 foreach ( $_GET as $var => $val ) $mail .= $var . ' -> ' . $val . "\n";
 mail( 'myemail@myhost.com', 'Free Quote Request', $mail );
 header('Location: http://www.mydomain.info/thanks.htm Visit through proxy');
 exit;
}


Last blog : Just a better Internet portal provided by Google
World Wide Whale
***
Gender: Female
Posts: 152
1036 credits
Members referred : 0



« Reply #29 on: Feb 13, 2007, 08:35:07 PM »

Then how do I format it to look like the rest of my pages?
I am a metal monkey!
Administrator
Community Supporter ?
Jedai Sword Master
*****
Gender: Male
Posts: 8245
42457 credits
Members referred : 3



« Reply #30 on: Feb 13, 2007, 08:42:35 PM »

You can post html in the form. So it is actually the same thing Smiley

Trial and Error my two best teachers Cool
Join us @ facebook Visit through proxy or twitter Visit through proxy

Last blog : Free Unlimited Bandwith and disk space to good to be true?
World Wide Whale
***
Gender: Female
Posts: 152
1036 credits
Members referred : 0



« Reply #31 on: Feb 13, 2007, 08:48:44 PM »

I don't understand... I put it as an echo & then the form wouldn't even come up anymore....

Everything is working except it's not sending me to the thanks.htm page after I submit the form....

Here is my entire code, the way it works....

Code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Free Quote Form</title>
<link href="3.css" rel="stylesheet" type="text/css">
</head>

<body>
<div id="whitebigbar" class="whitebigbar">&nbsp;<div class="bar">&nbsp;</div></div>
<div id="mainContentWindow">
<div class="barlight">&nbsp;</div>
<div id="bodyContent">
<div id="LogoTop">&nbsp;</div>
<div id="LogoLeft">&nbsp;</div> <div id="menuContainer">
<iframe id="menu.htm" src="menu.htm" height="90px" width="770px" marginwidth="0" marginheight="0" scrolling="No" frameborder="0"  ALLOWTRANSPARENCY="true"></iframe>
</div>
</div>
<div id="centerDiv" style=" z-index: 10; width: 90%; left: 40px; padding: 10px; text-align: left; margin-top: 170px; ">
<h1>FREE QUOTE</h1>
<p>Please fill out this form for a free, no obligation quote.</p>
<p><i>* signify required fields.</i></p><?php
if ( count($_GET) ){
 
$mail '';
 
$_GET['Ip adress'] = $_SERVER['REMOTE_ADDR'];
 foreach ( 
$_GET as $var => $val $mail .= $var ' -> ' $val "\n";
 
mail'me@mydomain.com''Free Quote Request'$mail );
 
header('Location: http://www.mydomain.com/thanks.htm');
 exit;
}
echo 
'<form method="get" action="' $_SERVER['PHP_SELF'] . '">
<table border="0">
<tr>
<td>Name:*</td> 
<td><input type="text" name="Name"></td>
</tr>
<tr>
<td>Company:</td>  
<td><input type="text" name="Company"></td>
</tr>
<tr>
<td>Title:</td>   
<td><input type="text" name="Title"></td>
</tr>
<tr>
<td>Contact Number:</td>   
<td><input type="text" name="Number"></td>
</tr>
<tr>
<td>Email:*</td>   
<td><input type="text" name="Email"></td>
</tr>
</table>
<hr>
<b>Requesting a Quote for:</b><br>
<table border="0" cellspacing="10px">
<tr>
<td><input type="radio" name="QuoteType" value="Print_WO"> Print Design without printing</td>
<td><input type="radio" name="QuoteType" value="Web_W"> Web Design with hosting & domain name</td>
</tr>
<tr>
<td><input type="radio" name="QuoteType" value="Print_W"> Print Design with printing</td>
<td><input type="radio" name="QuoteType" value="Web_WO"> Web Design without hosting & domain name</td>
</tr>
</table>
<hr>
<h3>Print Design</h3>
<p>Please complete this section if you would like a print design quote.</p>
Item being quoted:<br>
<table border="0" cellspacing="10px">
<tr>
<td><input type="radio" name="PrintItemType" value="BC"></td> 
<td>Business Card</td>
<td><input type="radio" name="PrintItemType" value="Flyer"></td>
<td>Flyer</td>

</tr>
<tr>
<td><input type="radio" name="PrintItemType" value="2FB"></td>
<td>2-Fold Brochure</td> 
<td><input type="radio" name="PrintItemType" value="3FB"></td> 
<td>3-Fold Brochure</td>
</tr>
<tr>
<td><input type="radio" name="PrintItemType" value="PC"></td>
<td>Post Card</td>
<td><input type="radio" name="PrintItemType" value="Sign"></td> 
<td>Signs</td>
</tr>
<tr>
<td><input type="radio" name="PrintItemType" value="PA"></td>
<td>Publication Advertisment, <i>we cannot provide printing prices on this item</i>.</td>
<td><input type="radio" name="PrintItemType" value="Other"></td>
<td>Other, <i>Please indicate in comment box what type of item you are having quoted</i></td>

</tr>
</table>
<br>
Colors:<br>
If you are quoting pricing for printing please be sure to identify the colors you would like to use if you choose 2 or 3 colors in the comment box.<br>
<table border="0" cellspacing="10px">
<tr>
<td><input type="radio" name="Color" value="CMYK"></td>
<td>Full Color (CMYK)</td>
<td><input type="radio" name="Color" value="2"></td> 
<td>2 Colors</td>
</tr>
<tr>
<td><input type="radio" name="Color" value="BW"></td>
<td>Black & White or Grey Scale</td>
<td><input type="radio" name="Color" value="3"></td> 
<td>3 Colors</td>
</tr>
</table>
<br>
Answer the below question only if you would chose to have printing priced also.<br>
Quanity: <input type="text" name="Quanity1">&nbsp;&nbsp;<input type="text" name="Quanity2"><br>
<br>
<hr>
<h3>Web Design</h3>
<p>Please complete this section if you would like a web design quote.</p>
Number of Pages on Site: <input type="text" name="Pages"><br>
<br>
Maintaince Package:<br>
<table border="0" cellspacing="10px">
<tr>
<td><input type="radio" name="maint" value="Weekly"> </td>
<td>Weekly</td>
<td><input type="radio" name="maint" value="Monthly"> </td>
<td>Monthly</td>
</tr>
<tr>
<td><input type="radio" name="maint" value="AN"> </td>
<td>As Needed</td>
<td><input type="radio" name="maint" value="None"> </td>
<td>None,&nbsp;I will maintain my own site</td>
</tr>
</table>
<br>
Online Features: <br>
<table border="0" cellspacing="10px">
<tr>
<td><input type="checkbox" name="OnlineFeatures01" value="PhotoAlbum"></td>
<td>Photo Album </td>
<td><input type="checkbox" name="OnlineFeatures02" value="ScrollingImages"></td>
<td>Scrolling Images </td>
<td><input type="checkbox" name="OnlineFeatures03" value="DDMenu"></td>
<td>Drop Down Menu </td>
</tr>
<tr>
<td><input type="checkbox" name="OnlineFeatures04" value="SS"></td>
<td>Style Switcher <br><i>Please include how <br>many syles you need</i> </td>
<td><input type="checkbox" name="OnlineFeatures05" value="ShoppingCart"></td>
<td>Shopping Cart </td>
<td><input type="checkbox" name="OnlineFeatures06" value="GB"></td>
<td>Guest Book </td>
</tr>
<tr>
<td><input type="checkbox" name="OnlineFeatures07" value="Contact"></td>
<td>Contact Form </td>
<td><input type="checkbox" name="OnlineFeatures08" value="Music"></td>
<td>Music </td>
<td><input type="checkbox" name="OnlineFeatures09" value="Form"></td>
<td>Form <br>(like this one) </td>
</tr>
<tr>
<td><input type="checkbox" name="OnlineFeatures10" value="PWP"></td>
<td>Password Protection </td>
<td><input type="checkbox" name="OnlineFeatures11" value="Admin"></td>
<td>Administrative Back end </td>
<td><input type="checkbox" name="OnlineFeatures12" value="RSS"></td>
<td>RSS Feed </td>
</tr>
<tr>
<td colspan="1"><input type="checkbox" name="OnlineFeatures13" value="Other"><br></td>
<td colspan="5">Other <br><i>Please specify what type feature you are looking for in the comment box.</i> </td>

</tr>
</table>
<hr>
<h3>Comments</h3>
<p>Please give us any information you feel is important, or we have requested in the comment box below so you can recieve the most accurte quote available.</p>
<TEXTAREA NAME="feedback" ROWS=15 COLS=100></TEXTAREA>
<br><br>
<input type="submit" value="Submit">&nbsp;&nbsp;&nbsp;<input type="reset" value="Reset">
</form>'
;
?>
</div>

<!-- Start of StatCounter Code -->
<script type="text/javascript" language="javascript">
var sc_project=;
var sc_invisible=1;
var sc_partition=17;
var sc_security="";
var sc_remove_link=1;
</script>

<script type="text/javascript" language="javascript" src="http://www.statcounter.com/counter/counter.js"></script><noscript><img  src="http://c18.statcounter.com/counter.php?sc_project=&java=0&security=&invisible=1" alt="page hit counter" border="0"> </noscript>
<!-- End of StatCounter Code -->

</body>
</html>
Global Moderator
Internet Junkie
*****
Gender: Male
Posts: 1807
9006 credits
Members referred : 6



« Reply #32 on: Feb 13, 2007, 09:17:47 PM »

Code:
<?php
if ( count($_GET) ){
 
$mail '';
 
$_GET['Ip adress'] = $_SERVER['REMOTE_ADDR'];
 foreach ( 
$_GET as $var => $val $mail .= $var ' -> ' $val "\n";
 
mail'me@mydomain.com''Free Quote Request'$mail );
 
header('Location: http://www.mydomain.com/thanks.htm');
 exit;
?>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Free Quote Form</title>
<link href="3.css" rel="stylesheet" type="text/css">
</head>

<body>
<div id="whitebigbar" class="whitebigbar">&nbsp;<div class="bar">&nbsp;</div></div>
<div id="mainContentWindow">
<div class="barlight">&nbsp;</div>
<div id="bodyContent">
<div id="LogoTop">&nbsp;</div>
<div id="LogoLeft">&nbsp;</div> <div id="menuContainer">
<iframe id="menu.htm" src="menu.htm" height="90px" width="770px" marginwidth="0" marginheight="0" scrolling="No" frameborder="0"  ALLOWTRANSPARENCY="true"></iframe>
</div>
</div>
<div id="centerDiv" style=" z-index: 10; width: 90%; left: 40px; padding: 10px; text-align: left; margin-top: 170px; ">
<h1>FREE QUOTE</h1>
<p>Please fill out this form for a free, no obligation quote.</p>
<p><i>* signify required fields.</i></p>
<?php

echo '<form method="get" action="' $_SERVER['PHP_SELF'] . '">
<table border="0">
<tr>
<td>Name:*</td> 
<td><input type="text" name="Name"></td>
</tr>
<tr>
<td>Company:</td>  
<td><input type="text" name="Company"></td>
</tr>
<tr>
<td>Title:</td>   
<td><input type="text" name="Title"></td>
</tr>
<tr>
<td>Contact Number:</td>   
<td><input type="text" name="Number"></td>
</tr>
<tr>
<td>Email:*</td>   
<td><input type="text" name="Email"></td>
</tr>
</table>
<hr>
<b>Requesting a Quote for:</b><br>
<table border="0" cellspacing="10px">
<tr>
<td><input type="radio" name="QuoteType" value="Print_WO"> Print Design without printing</td>
<td><input type="radio" name="QuoteType" value="Web_W"> Web Design with hosting & domain name</td>
</tr>
<tr>
<td><input type="radio" name="QuoteType" value="Print_W"> Print Design with printing</td>
<td><input type="radio" name="QuoteType" value="Web_WO"> Web Design without hosting & domain name</td>
</tr>
</table>
<hr>
<h3>Print Design</h3>
<p>Please complete this section if you would like a print design quote.</p>
Item being quoted:<br>
<table border="0" cellspacing="10px">
<tr>
<td><input type="radio" name="PrintItemType" value="BC"></td> 
<td>Business Card</td>
<td><input type="radio" name="PrintItemType" value="Flyer"></td>
<td>Flyer</td>

</tr>
<tr>
<td><input type="radio" name="PrintItemType" value="2FB"></td>
<td>2-Fold Brochure</td> 
<td><input type="radio" name="PrintItemType" value="3FB"></td> 
<td>3-Fold Brochure</td>
</tr>
<tr>
<td><input type="radio" name="PrintItemType" value="PC"></td>
<td>Post Card</td>
<td><input type="radio" name="PrintItemType" value="Sign"></td> 
<td>Signs</td>
</tr>
<tr>
<td><input type="radio" name="PrintItemType" value="PA"></td>
<td>Publication Advertisment, <i>we cannot provide printing prices on this item</i>.</td>
<td><input type="radio" name="PrintItemType" value="Other"></td>
<td>Other, <i>Please indicate in comment box what type of item you are having quoted</i></td>

</tr>
</table>
<br>
Colors:<br>
If you are quoting pricing for printing please be sure to identify the colors you would like to use if you choose 2 or 3 colors in the comment box.<br>
<table border="0" cellspacing="10px">
<tr>
<td><input type="radio" name="Color" value="CMYK"></td>
<td>Full Color (CMYK)</td>