I'm passing variables in my url and reading them on a page (i.e. and my code doesn't appear recognize the variables "ctypeid" and "list". When I echo $ctypeid and $list on my page they are both null. My code for tt.php works on my development server and the variables are recognized fine but not on the production . Other php pages which pass a variable (i.e. work fine, regardless of the server.
I'm attaching the relevant code here:
The production server is brand new and we've never used it before. I'm not sure if it matters but register_globals=On in the php.ini. Any help would be greatly appreciated as the site is supposed to go live today
I'm attaching the relevant code here:
Code:
<?php include("db_connect.php");?><?php echo "list = ".$list."<br>ctypeid=".$ctypeid;?><?
if ($list==0)
{
$tips_query = "SELECT * from news where newsid=$newsid";
$tips_result = mysql_query($tips_query, $conn);
$tips_num_rows = mysql_num_rows($tips_result);
if ($tips_num_rows == 0)
{
echo "we have no records";
/*echo "there were $login_num_rows returned<p>";*/
}
else
{ echo "<table><tr><td width=\"50%\"><b>";
if ($ctypeid==2){echo "Tips & Tricks";}
else if ($ctypeid==3) {echo "News";}
else if ($ctypeid==1) {echo "Whitepapers";}
else if ($ctypeid==4) {echo "Macro Library";}
echo "</b></td></tr>";
for ($i=0; $i<$tips_num_rows; $i++)
{
$row=mysql_fetch_array($tips_result);
$year = substr($row["dateadded"], 0,4);
$day = substr($row["dateadded"],8,2);
$month = substr($row["dateadded"],5,2);
$newsdate=$month.'-'.$day.'-'.$year;
echo "<tr><td>";
echo $row["headline"];
echo "<br><i>";
echo $row["tinydescription"];
echo "</i><br>";
echo $row["description"];
echo "</td></tr>";
}
echo "</table>";
}
}
else if ($list==1)
{
$tips_query = "SELECT * from news where ctypeid=$ctypeid";
$tips_result = mysql_query($tips_query, $conn);
$tips_num_rows = mysql_num_rows($tips_result);
if ($tips_num_rows == 0)
{
echo "we have no records";
/*echo "there were $login_num_rows returned<p>";*/
}
else
{ echo "<table><tr><td width=\"50%\"><b>Date Added</b></td><td width=\"50%\"><b>";
if ($ctypeid==2){echo "Tips & Tricks";}
else if ($ctypeid==3) {echo "News";}
else if ($ctypeid==1) {echo "Whitepapers";}
else if ($ctypeid==4) {echo "Macro Library";}
echo "</b></td></tr>";
for ($i=0; $i<$tips_num_rows; $i++)
{
$row=mysql_fetch_array($tips_result);
echo "<tr><td>";
echo $row["dateadded"];
echo "</td><td><a href=\"tt.php?ctypeid=";
echo $ctypeid;
echo "&list=0&";
echo "newsid=";
echo $row["newsid"];
echo "\">";
echo $row["headline"];
echo "</a><br>";
//echo "<i>";
//echo $row["tinydescription"];
//echo "</i><br>";
//echo $row["description"];
echo "</td></tr>";
}
echo "</table>";
}
}
?>
The production server is brand new and we've never used it before. I'm not sure if it matters but register_globals=On in the php.ini. Any help would be greatly appreciated as the site is supposed to go live today