# Solved: Making a text field required



## LauraMJ (Mar 18, 2004)

Hi,

I'm currently using Frontpage 2003 as a web editor. One of my sites has page that is a feedback/request more information type of page with fields to fill out that sends an email for the owner to look at. Is there a way to make a field required, so that one gets an error message and MUST fill out a particular field? Does Frontpage do that?

I'm also looking at using Visual Web Developer 2008.........does this have that capability?


----------



## Techmonkeys (Feb 10, 2005)

It is not so much the package, but the language you are coding that does the error checking.

HTML on it's doesnt have this ability (I dont think) you would need a server side language such as PHP or ASP to do the checking.

This would make it so when you click the Submit button, the script then checks the field and if it is empty would display an error.

in PHP


```
<?php 
if (strlen($_POST['required_field'] < "1")) {
echo "you must provide a value in the required field
}
?>
```
In this example the name of the text box would be "required_field".


----------



## LauraMJ (Mar 18, 2004)

So I could just stick that code into the page in the appropriate page and that will make it work?


----------



## Techmonkeys (Feb 10, 2005)

No I am afraid not.

I am guessing the pages you are currently making are in html (or htm) format? so your page might be index.htm ?

The code i posted is in php format and requires your pages to be in this format too, also it is not complete as you would need some more code in your page and the correct type of hosting?

Can you show us the code you have so far for your form and we can work out if it can be easily changed to php?

Also is this for your www.themanestreet.com website? as that does support php it would appear.


----------



## LauraMJ (Mar 18, 2004)

No, it is not for that website, unfortunately.

Here is the one that this question is for:

http://www.poolguyconstruction.com/

The page that has the fields in question are on the "Ask for Quote" page.


----------



## Techmonkeys (Feb 10, 2005)

EDIT - sorry I post this after your last post. Try this out on that website and see if it works, if it does then your host supports php and we can work on a form otherwise you may have issues as the rest of the poolguy website is in basic html.

Here's a more complete example:


```
<?php

if (isset($_POST['submit'])) { //this checks to see if the submit button has been pressed
	if (strlen($_POST['text_field'] < "1")) { //this checks to see if the contents of the text field has more than 0 characters
		echo "Text Field is a required field, please  fill it out correctly and try again"; //this sends the error message
	} else {
		echo "Thanks your form has been submitted!"; // this sends a thank you if the form is complete!
	}
} 
?>
<!-- This is just a standard form -->
<form method="post" action="<?php echo $_SERVER['PHP_SELF']; ?>">   <!-- This tells the form to send the info back to itself once submit is press -->
	<input type="text" name="text_field" value="" />
	<input type="submit" name="submit" value="Submit!">
</form>
```
Copy and paste this in a text file, call it test.php (making sure to get rid of the .txt part) upload it to your host and then try it.

If you enter nothing in the text field it should give you the error, if you enter something it should thank you instead.


----------



## LauraMJ (Mar 18, 2004)

Oh, and here is the code for that:

Ask for Quote












*Pool Guy Construction
*
Lynchburg, 
VA


*
*




*Welcome to Pool Guy Construction!*

Please 
Fill out the form below if you would like to receive a quote, tell us of 
a problem with this site, and of course you are welcome to tell us of 
your satisfaction!





Request 
Quote 
Website Problem 
Praise

* Subject:*

* 
*



* Enter Your Comments In the Space Provided Below:*

* 
*



* Tell Us How To Contact You:*

* Name: 
Email: 

Phone: 

Fax: 

Location: *











*Have a Wonderful Day, and God Bless!!*

This site was last updated





​


----------



## LauraMJ (Mar 18, 2004)

We need to have the "location" field be required.


----------



## Techmonkeys (Feb 10, 2005)

Can you try that example script on the guys page and see if it works ok then we know if it is worth trying the rest of the form?


----------



## LauraMJ (Mar 18, 2004)

Is there a specific place on the page that I need to insert that code?


----------



## Techmonkeys (Feb 10, 2005)

no if you take that code and paste it in to notepad

Then save the file as test.php

Then upload the file the website and just put it in the main directory when the index.htm file is, then go to http://www.poolguyconstruction.com/test.php and see if it works.


----------



## LauraMJ (Mar 18, 2004)

OH, I gotcha.  Thanks, I'll be right back.


----------



## Techmonkeys (Feb 10, 2005)

I shall wait eagerly 

If it does work, what do you want the form to do when the submit button is pressed? is it just emailing it somewhere?


----------



## LauraMJ (Mar 18, 2004)

Okay, I added it, it seems to work. I clicked on the link for the test page, entered the word "hello" and clicked submit and it said it was submitted.


----------



## LauraMJ (Mar 18, 2004)

Yeah, the entire form is emailed to the owner's email address. In order to reply with the correct information, they must have the person's location included. Many people are not including their location.  So, we want the form to NOT be emailed/submitted until they put in their location, and to give them an error that lets them know that they must put in a location.


----------



## Techmonkeys (Feb 10, 2005)

Riiiight, took a little longer than I thought, but here you go give this a whirl.


```
<html>

<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<meta http-equiv="Content-Language" content="en-us">
<title>Ask for Quote</title>
<meta name="Custom" content="None ">
<meta http-equiv="Page-Enter" content="revealTrans(Duration=2.0,Transition=3)">
</head>

<body bgcolor="#1F8BB4">
<div align="center">


<table cellpadding="0" cellspacing="0" width="750" background="images/image0011.jpg" bgcolor="#D5EAFF" style="border-left-style:ridge; border-left-width:10px; border-right-style:ridge; border-right-width:10px; border-top-style:ridge; border-top-width:10px" height="160">
<tr>
<td width="150" colspan="2" align="center" style="border-style:ridge; border-width:4px; padding-left:4px; padding-right:4px; padding-top:1px; padding-bottom:1px" height="150">
<img border="0" src="images/pglogo_edited-100x91.jpg" width="100" height="91"></td>
<td width="557" align="center" style="border-style:ridge; border-width:4px; padding-left:4px; padding-right:4px; padding-top:1px; padding-bottom:1px" height="150">
<font face="Black Chancery" size="7" color="#1F8BB4">
<b>Pool Guy Construction<br>
</b>
</font><font face="Black Chancery" size="5" color="#1F8BB4">Lynchburg,
VA</font></td>
</tr>
</table>
<table cellpadding="0" cellspacing="0" width="750" height="900" style="border-style:ridge; border-width:11px; padding:0" background="images/image0011.jpg">
<tr style="border: 5px solid #808080; ">
<td valign="top" width="147" style="border-style:ridge; border-width:4px" align="center">
<strong><font size="4" face="Georgia">
<!--webbot bot="Navigation" s-orientation="vertical" s-rendering="graphics" s-type="siblings" b-include-home="TRUE" b-include-up="TRUE" S-Theme="copy-of-industrial2 0110" --></font></strong>
<p>&nbsp;</p>
</td>
<td valign="top" height="128%" style="border-style:ridge; border-width:4px; padding-left:4px; padding-right:4px; padding-top:1px; padding-bottom:1px" align="center">
<b><font size="4">Welcome to Pool Guy Construction!</font></b><p>Please
Fill out the form below if you would like to receive a quote, tell us of
a problem with this site, and of course you are welcome to tell us of
your satisfaction!</p>
<?php



if (isset($_POST['submit'])) { //this checks to see if the submit button has been pressed
	if (strlen($_POST['Location'] < "1")) { //this checks to see if the contents of the text field has more than 0 characters
	 echo "<p><strong><font color='#FFFFFF'>You must specify a location, please check and try again</font></strong></p>";
	} else {
		$sendto = "put the email you want to send to here";
		$name = $_POST['Name'];
		$type = $_POST['R1'];
		$phone = $_POST['Phone'];
		$fax = $_POST['Fax'];
		$email = $_POST['Email'];
		$subject = $_POST['Subject'];
		$location = $_POST['Location'];
		$comments = $_POST['Comments'];
		$message = "Name: $name \n
		Phone: $phone \n
		Fax: $fax \n
		E-mail: $email \n
		Location: $location \n
		Subject: $subject \n
		Comments: $comments \n
		=======================================";
		mail($sendto,"$type from Website Form", $message, "From: [email protected]");
		echo "<p>Thanks your comments have been received, we shall respond to enquiry shorlty!</p>";
	}
}
?>	


<form method="POST" action="<?php echo $_SERVER['PHP_SELF']; ?>" onSubmit="" name="From the Website">
<!--webbot bot="SaveResults" U-File="_private/form_results.htm" S-Format="HTML/PRE" S-Label-Fields="TRUE" startspan B-Reverse-Chronology="FALSE" S-Email-Format="TEXT/PRE" B-Email-Label-Fields="TRUE" B-Email-Subject-From-Field="TRUE" S-Email-Subject="From the Website" S-Date-Format="%B %d, %Y" S-Time-Format="%I:%M %p" S-Builtin-Fields="Date Time" S-Email-Address="[email protected]" S-Form-Fields="R1 Subject Comments Name Email Phone Fax " --><input TYPE="hidden" NAME="VTI-GROUP" VALUE="0"><!--webbot bot="SaveResults" endspan i-checksum="43374" -->
<p>&nbsp;</p>
<p><input type="radio" value="Quote" <?php if ($_POST['R1'] = "Quote") { echo "checked"; } ?> name="R1">Request
Quote&nbsp;&nbsp;&nbsp;
<input type="radio" name="R1" <?php if ($_POST['R1'] = "Problem") { echo "checked"; } ?> value="Problem">Website Problem&nbsp;&nbsp;&nbsp;&nbsp;
<input type="radio" name="R1" <?php if ($_POST['R1'] = "Praise") { echo "checked"; } ?> value="Praise">Praise</p>
<p align="left"><b>&nbsp;Subject:</b></p>
<p align="left"><b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp ;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<input type="text" name="Subject" size="25" value="<?php echo $_POST['Subject']; ?>"> </b></p>
<p align="left">&nbsp;</p>
<p align="left"><b>&nbsp;Enter Your Comments In the Space Provided Below:</b></p>
<p align="left"><b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp ;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<textarea rows="8" name="Comments" cols="40"><?php echo $_POST['Comments']; ?></textarea></b></p>
<p align="left"><b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </b>
</p>
<p align="left"><b>&nbsp;Tell Us How To Contact You:</b></p>
<p align="left"><b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Name:&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <input type="text" name="Name" value="<?php echo $_POST['Name']; ?>"size="25"><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Email:&nbsp;&nbsp;&nbsp;&nbsp;&nb sp;&nbsp;
<input type="text" name="Email" value="<?php echo $_POST['Email']; ?>" size="25"><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Phone:&nbsp;&nbsp;&nbsp;&nbsp;&nb sp;
<input type="text" name="Phone" value="<?php echo $_POST['Phone']; ?>" size="25"><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Fax:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp ;&nbsp;&nbsp;&nbsp;&nbsp;
<input type="text" name="Fax" value="<?php echo $_POST['Fax']; ?>" size="25"><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Location:&nbsp; <input type="text" name="Location" value="<?php echo $_POST['Location']; ?>" size="25"></b></p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p><input type="submit" value="Submit" name="submit"></p>
</form>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p><font size="5"><b>Have a Wonderful Day, and God Bless!!</b></font></p>
<hr>
<p>This site was last updated
<!--webbot bot="Timestamp" s-type="EDITED" s-format="%m/%d/%y" -->
</p>
<center>
<p>
<!--webbot bot="Navigation" s-orientation="horizontal" s-rendering="html" s-bar="Bars" s-btn-nml="&lt;A HREF=&quot;#URL#&quot; TARGET=&quot;#TARGET#&quot; STYLE=&quot;text-decoration: none;&quot;&gt;#LABEL#&lt;/A&gt;" s-btn-sel="#LABEL#" s-btn-sep="&amp;nbsp;|&amp;nbsp;" s-type="children" b-include-home="TRUE" b-include-up="FALSE" --></p>
</center></td>
</tr>
</table>
<p>&nbsp;</div>
</body>
```
copy and paste it in to notepad like before, find the line that says:



> $sendto = "put the email you want to send to here";


Put the email address you want to send to in the quotes, eg: $sendto = "[email protected]";

then save this file as something like "feedback.php" or whatever you like to call it.

Then upload this to your host as before and change the "Ask for a quote" link so it points to the new file feedback.php or whatever you called it.

I have test it here and it works, but there is a chance that you host does not allow use of the php mail function, if this is the case we shall come up with a work around.

I am off home now, so it may be tomorrow before I see any reply, but I will come back if there is a problem.

Bye for now!


----------



## LauraMJ (Mar 18, 2004)

Thanks so much, I will let you know how it goes!


----------



## LauraMJ (Mar 18, 2004)

Okay, basically, everything works.  I made some minor changes in the text (took me a while to figure out that I need to change the php file on my computer first, save it, then re-upload it to the site to make the changes  ). But, there are some errors on the page. You can see that there are some of the coding showing on the actual page. Every time I try to remove that, then it will no longer work. 

Plus, the navigation bar on the left does not show up. It's in the code, but not on the page. If you need, I can give you the code for another page that has the navigation bar on it to compare?

Thanks, I appreciate your doing this for me.........I've never worked much with php coding.


----------



## Techmonkeys (Feb 10, 2005)

Morning Laura, just looking back through the code you posted originally and the menu isnt in that either.

The menu has a button called "finished pools" which is using the finishedpools.jpg as it's button image, however searching the code for "finishedpools.jpg" shows no results.

Can you copy and paste the code of one of the other pages here and I should be able to grab the menu out of it.


----------



## LauraMJ (Mar 18, 2004)

This is from the "Pool Diagrams" page. The navigation menu for this one should be the same as for the page we are working on:

Pool Diagrams












*Pool Guy Construction
*
Lynchburg, 
VA


*
*





*Click on Picture to Enlarge*



*
Inground Pools

~~~~~~~~~~~~~~~~~*





*More Photos Coming Soon*







*Above Ground Pools
~~~~~~~~~~~~~~~~~~*







* Photos 
Coming Soon*

















This site was last updated



*
*​ 
 [/TD]
[/TR]
[/TABLE]


----------



## LauraMJ (Mar 18, 2004)

Here's another page (Finished Pools):

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

Finished Pools










*Pool Guy Construction
*Lynchburg, VA

*
*



*
Click on Any Picture to Enlarge*

*Inground Pools
~~~~~~~~~~~~~~*



*Above Ground Pools
~~~~~~~~~~~~~~~~~*

*Pictures Coming Soon*

This site was last updated 



<nobr>Home</nobr>​
[/TD]
[/TR]
[/TABLE]


----------



## Techmonkeys (Feb 10, 2005)

Ah hah it's your fault 

For some reason, when you are copying and pasting the code for the pages here, it is missing out a lrge section of the code which contains the structure of the menu, this is the code missing from your paste:


```
<!--webbot bot="Navigation" s-orientation="vertical" s-rendering="graphics" s-type="top" b-include-home="TRUE" b-include-up="TRUE" S-Theme="copy-of-industrial2 0110" startspan --><script language="JavaScript"><!--
MSFPhover = 
  (((navigator.appName == "Netscape") && 
  (parseInt(navigator.appVersion) >= 3 )) || 
  ((navigator.appName == "Microsoft Internet Explorer") && 
  (parseInt(navigator.appVersion) >= 4 ))); 
function MSFPpreload(img) 
{
  var a=new Image(); a.src=img; return a; 
}
// --></script><script language="JavaScript"><!--
if(MSFPhover) { MSFPnav1n=MSFPpreload("_derived/home_cmp_copy-of-industrial2110_vbtn.gif"); MSFPnav1h=MSFPpreload("_derived/home_cmp_copy-of-industrial2110_vbtn_a.gif"); }
// --></script><a href="./" language="JavaScript" onmouseover="if(MSFPhover) document['MSFPnav1'].src=MSFPnav1h.src" onmouseout="if(MSFPhover) document['MSFPnav1'].src=MSFPnav1n.src"><img src="_derived/home_cmp_copy-of-industrial2110_vbtn.gif" width="140" height="50" border="0" alt="Home" name="MSFPnav1"></a><br><script language="JavaScript"><!--
if(MSFPhover) { MSFPnav2n=MSFPpreload("_derived/feedback.php_cmp_copy-of-industrial2110_vbtn.gif"); MSFPnav2h=MSFPpreload("_derived/feedback.php_cmp_copy-of-industrial2110_vbtn_a.gif"); }
// --></script><a href="feedback.php" language="JavaScript" onmouseover="if(MSFPhover) document['MSFPnav2'].src=MSFPnav2h.src" onmouseout="if(MSFPhover) document['MSFPnav2'].src=MSFPnav2n.src"><img src="_derived/feedback.php_cmp_copy-of-industrial2110_vbtn.gif" width="140" height="50" border="0" alt="Ask for Quote" name="MSFPnav2"></a><br><img src="_derived/pooldiagrams.htm_cmp_copy-of-industrial2110_vbtn_p.gif" width="140" height="50" border="0" alt="Pool Diagrams"><br><script language="JavaScript"><!--
if(MSFPhover) { MSFPnav3n=MSFPpreload("_derived/construction.htm_cmp_copy-of-industrial2110_vbtn.gif"); MSFPnav3h=MSFPpreload("_derived/construction.htm_cmp_copy-of-industrial2110_vbtn_a.gif"); }
// --></script><a href="construction.htm" language="JavaScript" onmouseover="if(MSFPhover) document['MSFPnav3'].src=MSFPnav3h.src" onmouseout="if(MSFPhover) document['MSFPnav3'].src=MSFPnav3n.src"><img src="_derived/construction.htm_cmp_copy-of-industrial2110_vbtn.gif" width="140" height="50" border="0" alt="Pool Construction" name="MSFPnav3"></a><br><script language="JavaScript"><!--
if(MSFPhover) { MSFPnav4n=MSFPpreload("_derived/finishedpools.htm_cmp_copy-of-industrial2110_vbtn.gif"); MSFPnav4h=MSFPpreload("_derived/finishedpools.htm_cmp_copy-of-industrial2110_vbtn_a.gif"); }
// --></script><a href="finishedpools.htm" language="JavaScript" onmouseover="if(MSFPhover) document['MSFPnav4'].src=MSFPnav4h.src" onmouseout="if(MSFPhover) document['MSFPnav4'].src=MSFPnav4n.src"><img src="_derived/finishedpools.htm_cmp_copy-of-industrial2110_vbtn.gif" width="140" height="50" border="0" alt="Finished Pools" name="MSFPnav4"></a><!--webbot bot="Navigation" i-checksum="30114" endspan --></strong></font>
```
Which if you look is missing from all the pages you have posted, but is needed for the menu.

So here is hopefully the code in full for the contact page:


```
<html>

<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<meta http-equiv="Content-Language" content="en-us">
<title>Ask for Quote</title>
<meta name="Custom" content="None ">
<meta http-equiv="Page-Enter" content="revealTrans(Duration=2.0,Transition=3)">
</head>

<body bgcolor="#1F8BB4">
<div align="center">


<table cellpadding="0" cellspacing="0" width="750" background="http://forums.techguy.org/images/image0011.jpg" bgcolor="#D5EAFF" style="border-left-style:ridge; border-left-width:10px; border-right-style:ridge; border-right-width:10px; border-top-style:ridge; border-top-width:10px" height="160">
<tr>
<td width="150" colspan="2" align="center" style="border-style:ridge; border-width:4px; padding-left:4px; padding-right:4px; padding-top:1px; padding-bottom:1px" height="150">
<img border="0" src="http://forums.techguy.org/images/pglogo_edited-100x91.jpg" width="100" height="91"></td>
<td width="557" align="center" style="border-style:ridge; border-width:4px; padding-left:4px; padding-right:4px; padding-top:1px; padding-bottom:1px" height="150">
<font face="Black Chancery" size="7" color="#1F8BB4">
<b>Pool Guy Construction<br>
</b>
</font><font face="Black Chancery" size="5" color="#1F8BB4">Lynchburg,
VA</font></td>
</tr>
</table>
<table cellpadding="0" cellspacing="0" width="750" height="900" style="border-style:ridge; border-width:11px; padding:0" background="http://forums.techguy.org/images/image0011.jpg">
<tr style="border: 5px solid #808080; ">
<td valign="top" width="147" style="border-style:ridge; border-width:4px" align="center">
<strong><font size="4" face="Georgia">
<!--webbot bot="Navigation" s-orientation="vertical" s-rendering="graphics" s-type="top" b-include-home="TRUE" b-include-up="TRUE" S-Theme="copy-of-industrial2 0110" startspan --><script language="JavaScript"><!--
MSFPhover = 
  (((navigator.appName == "Netscape") && 
  (parseInt(navigator.appVersion) >= 3 )) || 
  ((navigator.appName == "Microsoft Internet Explorer") && 
  (parseInt(navigator.appVersion) >= 4 ))); 
function MSFPpreload(img) 
{
  var a=new Image(); a.src=img; return a; 
}
// --></script><script language="JavaScript"><!--
if(MSFPhover) { MSFPnav1n=MSFPpreload("_derived/home_cmp_copy-of-industrial2110_vbtn.gif"); MSFPnav1h=MSFPpreload("_derived/home_cmp_copy-of-industrial2110_vbtn_a.gif"); }
// --></script><a href="./" language="JavaScript" onmouseover="if(MSFPhover) document['MSFPnav1'].src=MSFPnav1h.src" onmouseout="if(MSFPhover) document['MSFPnav1'].src=MSFPnav1n.src"><img src="_derived/home_cmp_copy-of-industrial2110_vbtn.gif" width="140" height="50" border="0" alt="Home" name="MSFPnav1"></a><br><script language="JavaScript"><!--
if(MSFPhover) { MSFPnav2n=MSFPpreload("_derived/feedback.php_cmp_copy-of-industrial2110_vbtn.gif"); MSFPnav2h=MSFPpreload("_derived/feedback.php_cmp_copy-of-industrial2110_vbtn_a.gif"); }
// --></script><a href="feedback.php" language="JavaScript" onmouseover="if(MSFPhover) document['MSFPnav2'].src=MSFPnav2h.src" onmouseout="if(MSFPhover) document['MSFPnav2'].src=MSFPnav2n.src"><img src="_derived/feedback.php_cmp_copy-of-industrial2110_vbtn.gif" width="140" height="50" border="0" alt="Ask for Quote" name="MSFPnav2"></a><br><img src="_derived/pooldiagrams.htm_cmp_copy-of-industrial2110_vbtn_p.gif" width="140" height="50" border="0" alt="Pool Diagrams"><br><script language="JavaScript"><!--
if(MSFPhover) { MSFPnav3n=MSFPpreload("_derived/construction.htm_cmp_copy-of-industrial2110_vbtn.gif"); MSFPnav3h=MSFPpreload("_derived/construction.htm_cmp_copy-of-industrial2110_vbtn_a.gif"); }
// --></script><a href="construction.htm" language="JavaScript" onmouseover="if(MSFPhover) document['MSFPnav3'].src=MSFPnav3h.src" onmouseout="if(MSFPhover) document['MSFPnav3'].src=MSFPnav3n.src"><img src="_derived/construction.htm_cmp_copy-of-industrial2110_vbtn.gif" width="140" height="50" border="0" alt="Pool Construction" name="MSFPnav3"></a><br><script language="JavaScript"><!--
if(MSFPhover) { MSFPnav4n=MSFPpreload("_derived/finishedpools.htm_cmp_copy-of-industrial2110_vbtn.gif"); MSFPnav4h=MSFPpreload("_derived/finishedpools.htm_cmp_copy-of-industrial2110_vbtn_a.gif"); }
// --></script><a href="finishedpools.htm" language="JavaScript" onmouseover="if(MSFPhover) document['MSFPnav4'].src=MSFPnav4h.src" onmouseout="if(MSFPhover) document['MSFPnav4'].src=MSFPnav4n.src"><img src="_derived/finishedpools.htm_cmp_copy-of-industrial2110_vbtn.gif" width="140" height="50" border="0" alt="Finished Pools" name="MSFPnav4"></a><!--webbot bot="Navigation" i-checksum="30114" endspan -->
</font></strong>
<p>&nbsp;</p>
</td>
<td valign="top" height="128%" style="border-style:ridge; border-width:4px; padding-left:4px; padding-right:4px; padding-top:1px; padding-bottom:1px" align="center">
<b><font size="4">Welcome to Pool Guy Construction!</font></b><p>Please
Fill out the form below if you would like to receive a quote, tell us of
a problem with this site, and of course you are welcome to tell us of
your satisfaction!</p>
<?php



if (isset($_POST['submit'])) { //this checks to see if the submit button has been pressed
	if (strlen($_POST['Location'] < "1")) { //this checks to see if the contents of the text field has more than 0 characters
	 echo "<p><strong><font color='#FFFFFF'>You must specify a location, please check and try again</font></strong></p>";
	} else {
		$sendto = "insert email address here";
		$name = $_POST['Name'];
		$type = $_POST['R1'];
		$phone = $_POST['Phone'];
		$fax = $_POST['Fax'];
		$email = $_POST['Email'];
		$subject = $_POST['Subject'];
		$location = $_POST['Location'];
		$comments = $_POST['Comments'];
		$message = "Name: $name \n
		Phone: $phone \n
		Fax: $fax \n
		E-mail: $email \n
		Location: $location \n
		Subject: $subject \n
		Comments: $comments \n
		=======================================";
		mail($sendto,"$type from Website Form", $message, "From: [email protected]");
		echo "<p>Thanks your comments have been received, we shall respond to enquiry shorlty!</p>";
	}
}
?>	


<form method="POST" action="<?php echo $_SERVER['PHP_SELF']; ?>" onSubmit="" name="From the Website">
<!--webbot bot="SaveResults" U-File="_private/form_results.htm" S-Format="HTML/PRE" S-Label-Fields="TRUE" startspan B-Reverse-Chronology="FALSE" S-Email-Format="TEXT/PRE" B-Email-Label-Fields="TRUE" B-Email-Subject-From-Field="TRUE" S-Email-Subject="From the Website" S-Date-Format="%B %d, %Y" S-Time-Format="%I:%M %p" S-Builtin-Fields="Date Time" S-Email-Address="[email protected]" S-Form-Fields="R1 Subject Comments Name Email Phone Fax " --><input TYPE="hidden" NAME="VTI-GROUP" VALUE="0"><!--webbot bot="SaveResults" endspan i-checksum="43374" -->
<p>&nbsp;</p>
<p><input type="radio" value="Quote" <?php if ($_POST['R1'] = "Quote") { echo "checked"; } ?> name="R1">Request
Quote&nbsp;&nbsp;&nbsp;
<input type="radio" name="R1" <?php if ($_POST['R1'] = "Problem") { echo "checked"; } ?> value="Problem">Website Problem&nbsp;&nbsp;&nbsp;&nbsp;
<input type="radio" name="R1" <?php if ($_POST['R1'] = "Praise") { echo "checked"; } ?> value="Praise">Praise</p>
<p align="left"><b>&nbsp;Subject:</b></p>
<p align="left"><b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp ;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<input type="text" name="Subject" size="25" value="<?php echo $_POST['Subject']; ?>"> </b></p>
<p align="left">&nbsp;</p>
<p align="left"><b>&nbsp;Enter Your Comments In the Space Provided Below:</b></p>
<p align="left"><b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp ;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<textarea rows="8" name="Comments" cols="40"><?php echo $_POST['Comments']; ?></textarea></b></p>
<p align="left"><b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </b>
</p>
<p align="left"><b>&nbsp;Tell Us How To Contact You:</b></p>
<p align="left"><b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Name:&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <input type="text" name="Name" value="<?php echo $_POST['Name']; ?>"size="25"><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Email:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<input type="text" name="Email" value="<?php echo $_POST['Email']; ?>" size="25"><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Phone:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<input type="text" name="Phone" value="<?php echo $_POST['Phone']; ?>" size="25"><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Fax:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<input type="text" name="Fax" value="<?php echo $_POST['Fax']; ?>" size="25"><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Location:&nbsp; <input type="text" name="Location" value="<?php echo $_POST['Location']; ?>" size="25"></b></p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p><input type="submit" value="Submit" name="submit"></p>
</form>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p><font size="5"><b>Have a Wonderful Day, and God Bless!!</b></font></p>
<hr>
<p>This site was last updated
<!--webbot bot="Timestamp" s-type="EDITED" s-format="%m/%d/%y" -->
</p>
<center>
<p>
<!--webbot bot="Navigation" s-orientation="horizontal" s-rendering="html" s-bar="Bars" s-btn-nml="&lt;A HREF=&quot;#URL#&quot; TARGET=&quot;#TARGET#&quot; STYLE=&quot;text-decoration: none;&quot;&gt;#LABEL#&lt;/A&gt;" s-btn-sel="#LABEL#" s-btn-sep="&amp;nbsp;|&amp;nbsp;" s-type="children" b-include-home="TRUE" b-include-up="FALSE" --></p>
</center></td>
</tr>
</table>
<p>&nbsp;</div>
</body>
</html>
```
I have also added a bit on the bottom as that appeared to be missing, however if it causes issues then just delete it again.

As before copy this to notepad, save as feedback.php and upload again.

Good luck!


----------



## LauraMJ (Mar 18, 2004)

Honest to God, I copied and pasted EVERYTHING that is in the window. I clicked on "code view" and then selected everything, and copied it. 

I'll give this a try and let you know what happens.


----------



## Techmonkeys (Feb 10, 2005)

It could just be the editor your using that hides certain parts of the code it doesn't think you need to see, some do this to try and make it easier for newer users.

Personally I do all my code by hand just so I can see whats going on.


----------



## LauraMJ (Mar 18, 2004)

Okay, I think the navigation buttons are working now. I've made some minor changes to the text in a couple of places, but I am not sure of how (or what) to remove to get the little items of code out of the viewed webpage. You see there are some in the top right corner, under the logo, and some under the word "subject" and some next to the comments field.

Here is the code as it is now after I changed some text:

Ask for Quote










width="100" height="91">

*Pool Guy Construction
*
Lynchburg,
VA


*












*




*Welcome to Pool Guy Construction!*

Please
Fill out the form below if you would like to receive a quote, tell us of
a problem with this site, and of course you are welcome to tell us of
your satisfaction!

<?php

if (isset($_POST['submit'])) { //this checks to see if the submit button has been pressed
if (strlen($_POST['Location'] < "1")) { //this checks to see if the contents of the text field has more than 0 characters
echo "

*YOU MUST SPECIFY A LOCATION. PLEASE FILL OUT THE LOCATION FIELD AND TRY AGAIN.*

";
} else {
$sendto = "[email protected]";
$name = $_POST['Name'];
$type = $_POST['R1'];
$phone = $_POST['Phone'];
$fax = $_POST['Fax'];
$email = $_POST['Email'];
$subject = $_POST['Subject'];
$location = $_POST['Location'];
$comments = $_POST['Comments'];
$message = "Name: $name \n
Phone: $phone \n
Fax: $fax \n
E-mail: $email \n
Location: $location \n
Subject: $subject \n
Comments: $comments \n
=======================================";
mail($sendto,"$type from Website Form", $message, "From: [email protected]");
echo "

,*THANKS, YOUR FORM HAS BEEN SUBMITTED. IF YOU MADE AN INQUIRY, WE WILL REPLY SHORTLY!,*

";
}
}
?>

" onSubmit="" name="From the Website">




name="R1">Request
Quote 
value="Problem">Website Problem 
value="Praise">Praise

* Subject:*

* &nbsp ; 
"> *



* Enter Your Comments In the Space Provided Below:*

* &nbsp ; 
<?php echo $_POST['Comments']; ?>*



* Tell Us How To Contact You:*

* Name: "size="25">
Email: 
" size="25">
Phone: 
" size="25">
Fax: 
" size="25">
Location: " size="25">*











*Have a Wonderful Day, and God Bless!!*

This site was last updated





​


----------



## LauraMJ (Mar 18, 2004)

Oops, there is one other thing. The navigation button for "ask for quote," when on the quote page, is not colored blueish as they are supposed to be when on that actual page, and the "pool diagrams" button IS bluish, but is not clickable at all on that page, though it is on the others. 

Sorry I'm being such a pain, but I have always done all my editing with an html editor, and I know very little about coding by hand, though I can sometimes muddle through and "get it" if I have something to compare it to. Sometimes.


----------



## Techmonkeys (Feb 10, 2005)

Ok almost there;

*1) The code under the logo.*
Find this text in the page:

```
<img border="0" src="images/pglogo_edited-100x91.jpg" width="100" height="91"> width="100" height="91"></td>
```
Remove this bit:

```
width="100" height="91">
```
SO that it now looks like this:

```
<img border="0" src="images/pglogo_edited-100x91.jpg" width="100" height="91">
```
Done

*2) Code next to subject and comments.*
In HTML this

```
&nbsp;
```
is the code for a TAB.

You have a couple of lines like this:

```
<p align="left"><b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp ;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
```
With loads of tabs to make them line up properly. However one of the has a space before the ; you need to remove the space (hopefully this makes sense, there are 2 lines that have the space.

*3) The wrong buttons being highlighted*

I will have to come to this tomorrow am afraid, gotta take the cat to the vets!


----------



## LauraMJ (Mar 18, 2004)

Oh, I hope the cat is okay. We have two cats, and they are terrible to get to the vets, even for routine stuff. Getting them there when they are already hurt or sick and upset is even worse.


----------



## Techmonkeys (Feb 10, 2005)

Argh I am afraid I am beaten on this one Laura 

The bit of code that is not acting right is in a language called JavaScript which I have not used before (or at least not coded before) so I am going round in circles.

I don't suppose you have a copy of the original feedback.html file that was there before we made the feedback.php file ? if you do can zip it up and attach it to this thread so I can see it?

Sorry about this my dear!


----------



## LauraMJ (Mar 18, 2004)

Hey, no problem.  You have gotten me further than I got on my own, lol. 

And yep, I saved the original page file.  

I'll post it here in just a sec.


----------



## LauraMJ (Mar 18, 2004)

Here ya go.


----------



## Techmonkeys (Feb 10, 2005)

Oh what a pain in the backside, for some reason which ever way you seem to get the code it strips out the bit we are after.

There is a line in that code that says:


```
<!--webbot bot="Navigation" s-orientation="vertical" s-rendering="graphics" s-type="siblings" b-include-home="TRUE" b-include-up="TRUE" S-Theme="copy-of-industrial2 0110" --></font></strong>
```
After this line there should be some JavaScript code, when you I to poolguycontstruction page and right click and choose view source, I can see this code, but unfortunately I need the code from the original feedback page as this tells it what the buttons are doing.

I am not sure what to suggest Laura, but basically we need that original code or someone who is good with JavaScript :/


----------



## LauraMJ (Mar 18, 2004)

Hmmm......I'll play around with Frontpage and see if I can get it to give up the actual code. Thanks for all the time you've spent on this.


----------



## LauraMJ (Mar 18, 2004)

How about this,

Is there a way to make a code by hand to make those buttons change the colors and all appropriately (like how they change when hovered over and how they are colored for the page being viewed) and I can then just get rid of the internal web-bot navigation thingy altogether on all the pages and replace it with that? Or would that then turn all the pages to php? Or be too much trouble ? I love the look of those navigation buttons, and I have always like navigation buttons that do something when hovered over and are slightly different when viewing the page...........but I have never done anything like that without having Frontpage do it for me, so I have no idea if it would be a lot of work or not, or if it would all have to be javascript coding, or php or whatever.


----------



## LauraMJ (Mar 18, 2004)

I don't know if this is of any significance or not, but I've noticed something.

In Frontpage, here is a section near the top. I've bolded the part I want to draw your attention to.

Lynchburg,
VA[/TD]
[/TR]
[/TABLE]


*

*

Near the bottom of the page, there is this:

*Have a Wonderful Day, and God Bless!!*

This site was last updated




*

*​



The "s-type=" are not the same in the php file for the one near the top.

In the php file we created the "s-type=" is different for the top one:

Lynchburg,
VA[/TD]
[/TR]
[/TABLE]


*
<script language="JavaScript">



Here is one from a page that is working:

Lynchburg, 
VA*
*
*
*
**










This site was last updated




​
[/TD]*


----------



## Techmonkeys (Feb 10, 2005)

You can do it manually I suppose using css

If you can let me know the names of the image files you want to use, I think there will be 3 for each button, one for when it is not active, one for when it is hovered over and 1 for when it is the active button then I am sure we can code it in CSS.

I will need to know the exact name of the image file, also where the images are located in relation to the home page.

So if your homepage is www.poolguyconstruction.com/index.html then if your images are stored in www.poolguyconstruction.com/images/blah then this is what I will need to know.


----------



## Techmonkeys (Feb 10, 2005)

LauraMJ said:


> I don't know if this is of any significance or not, but I've noticed something.
> 
> In Frontpage, here is a section near the top. I've bolded the part I want to draw your attention to.
> 
> Stuff....


This is the problem you see, the code you are looking at is not the whole code it would appear that FrontPage hides some code it doesn't think you need to see. The code it is hiding is the code that handles the button image changes.

Without know javascript I couldnt see if what you have posted is related or relevant to why the wrong image is highlighted on the page we created.

If you download the original feedback.html page then open it in notepad, copy and paste the code here, does it seem like it has extra code after that first Webbot part?


----------



## LauraMJ (Mar 18, 2004)

Here's what exporting it to my computer and opening it in notepad gives:

Ask for Quote












*Pool Guy Construction
*
Lynchburg, 
VA


*
*




*Welcome to Pool Guy Construction!*

Please 
Fill out the form below if you would like to receive a quote, tell us of 
a problem with this site, and of course you are welcome to tell us of 
your satisfaction!





Request 
Quote 
Website Problem 
Praise

* Subject:*

* 
*



* Enter Your Comments In the Space Provided Below:*

* 
*



* Tell Us How To Contact You:*

* Name: 
Email: 

Phone: 

Fax: 

Location: *











*Have a Wonderful Day, and God Bless!!*

This site was last updated
08/14/08




​


----------



## Techmonkeys (Feb 10, 2005)

Bummer, I thought doing it that way may make it show the javascript, but unfortunately not.

A hah!!! genius idea.

For the moment please switch back to using the html version on the website instead of the php we made.

I can then grab the code from the source of the page and then we can put it in to the php file.


----------



## LauraMJ (Mar 18, 2004)

Okay, it's up.


----------



## LauraMJ (Mar 18, 2004)

Oooooo...........I do believe it is there.


----------



## Techmonkeys (Feb 10, 2005)

certainly looks like it, try this one (unfortunately you will have to make your changes again like the email address etc)


```
<html>

<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<meta http-equiv="Content-Language" content="en-us">
<title>Ask for Quote</title>
<meta name="Custom" content="None ">
<meta http-equiv="Page-Enter" content="revealTrans(Duration=2.0,Transition=3)">
</head>

<body bgcolor="#1F8BB4">
<div align="center">


<table cellpadding="0" cellspacing="0" width="750" background="http://forums.techguy.org/images/image0011.jpg" bgcolor="#D5EAFF" style="border-left-style:ridge; border-left-width:10px; border-right-style:ridge; border-right-width:10px; border-top-style:ridge; border-top-width:10px" height="160">
<tr>
<td width="150" colspan="2" align="center" style="border-style:ridge; border-width:4px; padding-left:4px; padding-right:4px; padding-top:1px; padding-bottom:1px" height="150">
<img border="0" src="http://forums.techguy.org/images/pglogo_edited-100x91.jpg" width="100" height="91"></td>
<td width="557" align="center" style="border-style:ridge; border-width:4px; padding-left:4px; padding-right:4px; padding-top:1px; padding-bottom:1px" height="150">
<font face="Black Chancery" size="7" color="#1F8BB4">
<b>Pool Guy Construction<br>
</b>
</font><font face="Black Chancery" size="5" color="#1F8BB4">Lynchburg,
VA</font></td>
</tr>
</table>
<table cellpadding="0" cellspacing="0" width="750" height="900" style="border-style:ridge; border-width:11px; padding:0" background="http://forums.techguy.org/images/image0011.jpg">
<tr style="border: 5px solid #808080; ">
<td valign="top" width="147" style="border-style:ridge; border-width:4px" align="center">
<strong><font size="4" face="Georgia">
		<!--webbot bot="Navigation" s-orientation="vertical" s-rendering="graphics" s-type="top" b-include-home="TRUE" b-include-up="TRUE" S-Theme="copy-of-industrial2 0110" startspan --><script language="JavaScript"><!--
MSFPhover = 
  (((navigator.appName == "Netscape") && 
  (parseInt(navigator.appVersion) >= 3 )) || 
  ((navigator.appName == "Microsoft Internet Explorer") && 
  (parseInt(navigator.appVersion) >= 4 ))); 
function MSFPpreload(img) 
{
  var a=new Image(); a.src=img; return a; 
}
// --></script><script language="JavaScript"><!--
if(MSFPhover) { MSFPnav1n=MSFPpreload("_derived/home_cmp_copy-of-industrial2110_vbtn.gif"); MSFPnav1h=MSFPpreload("_derived/home_cmp_copy-of-industrial2110_vbtn_a.gif"); }
// --></script><a href="./" language="JavaScript" onmouseover="if(MSFPhover) document['MSFPnav1'].src=MSFPnav1h.src" onmouseout="if(MSFPhover) document['MSFPnav1'].src=MSFPnav1n.src"><img src="_derived/home_cmp_copy-of-industrial2110_vbtn.gif" width="140" height="50" border="0" alt="Home" name="MSFPnav1"></a><br><img src="_derived/feedback1.htm_cmp_copy-of-industrial2110_vbtn_p.gif" width="140" height="50" border="0" alt="Ask for Quote"><br><script language="JavaScript"><!--
if(MSFPhover) { MSFPnav2n=MSFPpreload("_derived/pooldiagrams.htm_cmp_copy-of-industrial2110_vbtn.gif"); MSFPnav2h=MSFPpreload("_derived/pooldiagrams.htm_cmp_copy-of-industrial2110_vbtn_a.gif"); }
// --></script><a href="pooldiagrams.htm" language="JavaScript" onmouseover="if(MSFPhover) document['MSFPnav2'].src=MSFPnav2h.src" onmouseout="if(MSFPhover) document['MSFPnav2'].src=MSFPnav2n.src"><img src="_derived/pooldiagrams.htm_cmp_copy-of-industrial2110_vbtn.gif" width="140" height="50" border="0" alt="Pool Diagrams" name="MSFPnav2"></a><br><script language="JavaScript"><!--
if(MSFPhover) { MSFPnav3n=MSFPpreload("_derived/construction.htm_cmp_copy-of-industrial2110_vbtn.gif"); MSFPnav3h=MSFPpreload("_derived/construction.htm_cmp_copy-of-industrial2110_vbtn_a.gif"); }
// --></script><a href="construction.htm" language="JavaScript" onmouseover="if(MSFPhover) document['MSFPnav3'].src=MSFPnav3h.src" onmouseout="if(MSFPhover) document['MSFPnav3'].src=MSFPnav3n.src"><img src="_derived/construction.htm_cmp_copy-of-industrial2110_vbtn.gif" width="140" height="50" border="0" alt="Pool Construction" name="MSFPnav3"></a><br><script language="JavaScript"><!--
if(MSFPhover) { MSFPnav4n=MSFPpreload("_derived/finishedpools.htm_cmp_copy-of-industrial2110_vbtn.gif"); MSFPnav4h=MSFPpreload("_derived/finishedpools.htm_cmp_copy-of-industrial2110_vbtn_a.gif"); }
// --></script><a href="finishedpools.htm" language="JavaScript" onmouseover="if(MSFPhover) document['MSFPnav4'].src=MSFPnav4h.src" onmouseout="if(MSFPhover) document['MSFPnav4'].src=MSFPnav4n.src"><img src="_derived/finishedpools.htm_cmp_copy-of-industrial2110_vbtn.gif" width="140" height="50" border="0" alt="Finished Pools" name="MSFPnav4"></a><!--webbot bot="Navigation" i-checksum="47246" endspan --></font></strong>
<p>&nbsp;</p>
</td>
<td valign="top" height="128%" style="border-style:ridge; border-width:4px; padding-left:4px; padding-right:4px; padding-top:1px; padding-bottom:1px" align="center">
<b><font size="4">Welcome to Pool Guy Construction!</font></b><p>Please
Fill out the form below if you would like to receive a quote, tell us of
a problem with this site, and of course you are welcome to tell us of
your satisfaction!</p>
<?php



if (isset($_POST['submit'])) { //this checks to see if the submit button has been pressed
	if (strlen($_POST['Location'] < "1")) { //this checks to see if the contents of the text field has more than 0 characters
	 echo "<p><strong><font color='#FFFFFF'>You must specify a location, please check and try again</font></strong></p>";
	} else {
		$sendto = "insert email address here";
		$name = $_POST['Name'];
		$type = $_POST['R1'];
		$phone = $_POST['Phone'];
		$fax = $_POST['Fax'];
		$email = $_POST['Email'];
		$subject = $_POST['Subject'];
		$location = $_POST['Location'];
		$comments = $_POST['Comments'];
		$message = "Name: $name \n
		Phone: $phone \n
		Fax: $fax \n
		E-mail: $email \n
		Location: $location \n
		Subject: $subject \n
		Comments: $comments \n
		=======================================";
		mail($sendto,"$type from Website Form", $message, "From: [email protected]");
		echo "<p>Thanks your comments have been received, we shall respond to enquiry shorlty!</p>";
	}
}
?>	


<form method="POST" action="<?php echo $_SERVER['PHP_SELF']; ?>" onSubmit="" name="From the Website">
<!--webbot bot="SaveResults" U-File="_private/form_results.htm" S-Format="HTML/PRE" S-Label-Fields="TRUE" startspan B-Reverse-Chronology="FALSE" S-Email-Format="TEXT/PRE" B-Email-Label-Fields="TRUE" B-Email-Subject-From-Field="TRUE" S-Email-Subject="From the Website" S-Date-Format="%B %d, %Y" S-Time-Format="%I:%M %p" S-Builtin-Fields="Date Time" S-Email-Address="[email protected]" S-Form-Fields="R1 Subject Comments Name Email Phone Fax " --><input TYPE="hidden" NAME="VTI-GROUP" VALUE="0"><!--webbot bot="SaveResults" endspan i-checksum="43374" -->
<p>&nbsp;</p>
<p><input type="radio" value="Quote" <?php if ($_POST['R1'] = "Quote") { echo "checked"; } ?> name="R1">Request
Quote&nbsp;&nbsp;&nbsp;
<input type="radio" name="R1" <?php if ($_POST['R1'] = "Problem") { echo "checked"; } ?> value="Problem">Website Problem&nbsp;&nbsp;&nbsp;&nbsp;
<input type="radio" name="R1" <?php if ($_POST['R1'] = "Praise") { echo "checked"; } ?> value="Praise">Praise</p>
<p align="left"><b>&nbsp;Subject:</b></p>
<p align="left"><b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<input type="text" name="Subject" size="25" value="<?php echo $_POST['Subject']; ?>"> </b></p>
<p align="left">&nbsp;</p>
<p align="left"><b>&nbsp;Enter Your Comments In the Space Provided Below:</b></p>
<p align="left"><b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<textarea rows="8" name="Comments" cols="40"><?php echo $_POST['Comments']; ?></textarea></b></p>
<p align="left"><b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </b>
</p>
<p align="left"><b>&nbsp;Tell Us How To Contact You:</b></p>
<p align="left"><b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Name:&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <input type="text" name="Name" value="<?php echo $_POST['Name']; ?>"size="25"><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Email:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<input type="text" name="Email" value="<?php echo $_POST['Email']; ?>" size="25"><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Phone:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<input type="text" name="Phone" value="<?php echo $_POST['Phone']; ?>" size="25"><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Fax:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<input type="text" name="Fax" value="<?php echo $_POST['Fax']; ?>" size="25"><br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Location:&nbsp; <input type="text" name="Location" value="<?php echo $_POST['Location']; ?>" size="25"></b></p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p><input type="submit" value="Submit" name="submit"></p>
</form>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p><font size="5"><b>Have a Wonderful Day, and God Bless!!</b></font></p>
<hr>
<p>This site was last updated
<!--webbot bot="Timestamp" s-type="EDITED" s-format="%m/%d/%y" -->
</p>
<center>
<p>
<!--webbot bot="Navigation" s-orientation="horizontal" s-rendering="html" s-bar="Bars" s-btn-nml="&lt;A HREF=&quot;#URL#&quot; TARGET=&quot;#TARGET#&quot; STYLE=&quot;text-decoration: none;&quot;&gt;#LABEL#&lt;/A&gt;" s-btn-sel="#LABEL#" s-btn-sep="&amp;nbsp;|&amp;nbsp;" s-type="children" b-include-home="TRUE" b-include-up="FALSE" --></p>
</center></td>
</tr>
</table>
<p>&nbsp;</div>
</body>
</html>
```
Again copy to notepad, save as feedback.php and off we go 

/me crosses fingers


----------



## LauraMJ (Mar 18, 2004)

By jove...........I think you've got it!


----------



## LauraMJ (Mar 18, 2004)

What an absolute genius you are!


----------



## Techmonkeys (Feb 10, 2005)

WOOOO HOOOO!

Thank F...err....fun for that \o/

Dont forget to mark the thread as solved


----------



## MMJ (Oct 15, 2006)

$_SERVER['PHP_SELF'] can be used for XSS attacks, you should use $_SERVER['SCRIPT_NAME'].

http://google.com/search?q=php_self+xss

The mail form can also be hijacked as you aren't checking the user input.

http://www.google.com/search?q=php+mail+header+injection


----------



## LauraMJ (Mar 18, 2004)

MMJ, I don't know how to do that? What do you mean?


----------



## Techmonkeys (Feb 10, 2005)

Well you learn something new every day.

Change this line:

```
<form method="POST" action="<?php echo $_SERVER['PHP_SELF']; ?>" onSubmit="" name="From the Website">
```
to this:


```
<form method="POST" action="<?php echo $_SERVER['SCRIPT_NAME']; ?>" onSubmit="" name="From the Website">
```
The second problem with PHP mail function I am unsure what to tell you for the best Laura, perhaps MMJ can tell us what to do?


----------



## LauraMJ (Mar 18, 2004)

Okay, that part's done.


----------



## MMJ (Oct 15, 2006)

MMJ said:


> The mail form can also be hijacked as you aren't checking the user input.
> 
> http://www.google.com/search?q=php+mail+header+injection


My bad, when I checked the code I thought you were setting the From: header dynamically; so nevermind.


----------



## LauraMJ (Mar 18, 2004)

Okay. 

Then I think I can mark this thread solved. :up: 

Thanks, guys, I really appreciate it!


----------

