Help: Undefined index
Posted: Sat Jul 09, 2005 7:35 am
I am developing a website for my company and I have a few forms in there.
The php file works well when I use with another hosting site with Linux OS but it does give a few problems when I use with my company's hosting server running on Windows server.
http://raghavan.allhyper.com/contact.html
http://www.omnisoft.co.uk/contact.html
click any of the links 'call me back' or 'request info' and scroll down the popped window to see the error message.
The php file works well when I use with another hosting site with Linux OS but it does give a few problems when I use with my company's hosting server running on Windows server.
You can visit two pages to see the difference<body>
<table width="700" class = 'bordersOnly' cellspacing="0" style="margin-top:10px; background-color:#000099; color:#FFFFFF">
<tr style="background-color:#999999; "><td></td><td class="Lalign"><h4>Omnisoft - Request Quote</h4></td></tr>
<tr><td><?php //echo $msg; ?></td></tr>
<form name="frmRequestQuote" method="get" action="" onsubmit="javascript:return validateForm(this)">
<tr><td> Name:</td><td class="Lalign"><input type = "text" name="txtName" value="<? echo $_GET['txtName']; ?>" size="60" /></td></tr>
<tr><td> Position:</td><td class="Lalign"><input type = "text" name="txtPosition" value="<? echo $_GET['txtPosition']; ?>" size="60" /></td></tr>
<tr><td> Company:</td><td class="Lalign"><input type = "text" name="txtCompany" value="<? echo $_GET['txtCompany']; ?>" size="60" /></td></tr>
<tr><td> Telephone:</td><td class="Lalign"><input type = "text" name="txtTelephone" value="<? echo $_GET['txtTelephone']; ?>" size="60" /></td></tr>
<tr><td> Email Address:</td><td class="Lalign"><input type = "text" name="txtEmail" value="<? echo $_GET['txtEmail']; ?>" size="60" /></td></tr>
<tr><td> Subject:</td>
<td class="Lalign"> <input name="txtSubject" type="text" value="<? echo $_GET['txtSubject']; ?>" checked="checked" size="60" /></td>
</tr>
<tr>
<td> Comments:</td>
<td>
<textarea name="txtComments" cols="50" rows="10"><? echo $_GET['txtComments']; ?></textarea>
</td></tr>
<tr><td></td><td><input type="submit" name="subRequestQuote" value="Request Quote" <? echo $disableStatus; ?> /></td></tr>
</form>
</table>
</body>
</html>
<?php
if ($_GET["subRequestQuote"] == "Request Quote"){
//get the fields from the form
$name = $_GET["txtName"];
$position = $_GET["txtPosition"];
$company = $_GET["txtCompany"];
$telephone = $_GET["txtTelephone"];
$email = $_GET["txtEmail"];
$subject = $_GET["txtSubject"];
$comments = $_GET["txtComments"];
//form the query
$fields = "(Name, Position, Company, Phone, Email, Subject, Comments, `Time`, IpAddress)";
$query = "insert into RequestQuote_tbl $fields values('$name', '$position', '$company', '$telephone', '$email', '$subject', '$comments', '". date("D d.m.Y G:i:s") ."','{$_SERVER['REMOTE_ADDR']}')";
//echo $query;
$result = mysql_query($query);
if ($result){
$msg = "<h4 class = 'Calign'>Your details have been recorded and we will call you to discuss about the quote!!!</h4>";
echo $msg;
$disableStatus = "disabled";
}
}
?>
http://raghavan.allhyper.com/contact.html
http://www.omnisoft.co.uk/contact.html
click any of the links 'call me back' or 'request info' and scroll down the popped window to see the error message.