Code: Select all
,Code: Select all
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
I developed a site several years ago that has never had any problems.
However, this week our hosting company upgraded servers and now whenever I try navigate or pull data on the site using any kind of form function I get nothing.
You can see an example at http://www.tcvb.org/dining.php . The dropdown is pulling from the database so it doesn't seem to be database related. I also tried this site on another new server and have the same problem.
I'm a beginner PHP developer and this code was done by a former developer. I would probably not do this the way he did but I don't really want to rewrite anything I don't have to. Any suggestions anyone might be able to provide might be a lifesaver.
Here is the PHP code for this page (minus database connection info)Code: Select all
<?php
//switch ($process) {
//default:
$connection=mysql_connect ("", "", "") or die (mysql_error());
$db=mysql_select_db ("", $connection) or die (mysql_error());
$query = "SELECT DISTINCT rType FROM dining";
$sql_result = mysql_query($query, $connection) or die (mysql_error());
echo"
<table border=0 cellpadding=0 cellspacing=0 align=left>
<tr>
<td>
<form method='POST' action='$PHP_SELF?process=view'>
<select name='type' onChange='this.form.submit()'>
<option value=''> -- Dining Types -- </option>";
while ($row = mysql_fetch_array($sql_result)) {
$rType = $row["rType"];
echo "<option value = '$rType'>$rType</option>";
}
echo "
</select>
</td>
</tr>
</table>
<br><br><br>
";
//break;
switch ($process) {
case "view":
$type = $_REQUEST["type"];
$connection=mysql_connect ("localhost", "", "") or die (mysql_error());
$db=mysql_select_db ("", $connection) or die (mysql_error());
$query = "SELECT * FROM dining WHERE rType = '$type' ORDER BY rName ASC";
$sql_result = mysql_query($query, $connection) or die (mysql_error());
echo"
<table border=0 cellpadding=0 cellspacing=0 align=left>
<tr>
<td>
<table cellspacing='1' cellpadding='0' border='0' bgcolor='#FFFFFF' align='center'>
<tr>
<td style='font-family:verdana; color:black; font-weight:bold; font-size:13px; text-transform:uppercase; text-decoration:underline;'>
".$_POST["type"]."
</td>
</tr>
<tr><td> </td></tr>
";
while ($row = mysql_fetch_array($sql_result)) {
$id= $row["id"];
$rName = $row["rName"];
$rAddress = $row["rAddress"];
$rLocal = $row["rLocal"];
$rFax = $row["rFax"];
$rTollfree = $row["rTollfree"];
$rWeb = $row["rWeb"];
$rInfo = $row["rInfo"];
$rType = $row["rType"];
$rName = str_replace('\"','"',$rName);
$rName = str_replace("\'","'",$rName);
$rInfo = str_replace('\"','"',$rInfo);
$rInfo = str_replace("\'","'",$rInfo);
$rInfo = str_replace(":::","<br>", $rInfo);
$rInfo = str_replace("::","<p>", $rInfo);
echo"
<tr bgcolor='#ffffff'>
<td valign=top class='bodytx'>
<span style='font-size:11px; color:maroon; font-weight:bold;'><b>$rName</b></span><br>
$rAddress<br>
<i>Local:</i> $rLocal<br>
";
if ($rFax) { echo"<i>Fax:</i> $rFax<br>"; } else { echo""; }
if ($rTollfree) { echo"<i>Toll Free:</i> $rTollfree<br>"; } else { echo""; }
if ($rWeb) { echo"<a href='http://".$rWeb."' target=_blank>$rWeb</a><br>"; } else { echo""; }
echo"
<i>$rInfo</i>
</td>
</tr>
<tr><td> </td></tr>";
}
echo"
</table>
</td>
</tr>
</table>
";
break;
}
?>Everah | Please use
Code: Select all
,Code: Select all
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]