i want to pass a value to my disimage.php from shtml. is the code correct? it does not pass any value to that php page. what is wrong with it? please help!
the code:
<!--#include virtual="/review/admin/disimage.php?subcat=Net"-->
Printable View
i want to pass a value to my disimage.php from shtml. is the code correct? it does not pass any value to that php page. what is wrong with it? please help!
the code:
<!--#include virtual="/review/admin/disimage.php?subcat=Net"-->
what's the filetype of the file that has that ssi?
i'm using
include virtual in ssi. is this the filetype u are asking?
as for file extension is .shtml
Inside of your include file, have you declared all variables as global? example: global $x;
Declaring all of the variables as global may set their scope to page level not your included page level. So declare all of your varibles as global in the include file. :p
not 100% sure, but i don't think you can pass stuff from a php script in a .sthml file.
I've declared all the variables as global.
joyce why not attach the code for them to view? That way they will know what is wrong with it.
below is the code that from disimage.php. i want to pass the value of subcat,
<!--#include virtual="/review/admin/disimage.php?subcat=Net"-->
to the php file as below.
echo "<table width='100%' border='0' cellspacing='1' cellpadding='0' align='center'><tr bgcolor=#000000><td>";
echo "<font face='verdana' color=#FFFFFF size='2'><b> Categories</b></font></td></tr>";
echo "<tr height=10></tr></table>";
global $subcat;
$table = "cat_review";
$field = "*";
$criteria = "order by cat_cat asc";
$review_obj=new review_DB($dbhost,$dbusername,$dbpasswd,$db);
$getdata=$review_obj->get_data($table, $field, $criteria);
$data=$getdata[0];
$numrows=$getdata[1];
if ($numrows > 0)
{
for ($i=0; $i < $numrows; $i++)
{
$id = $data[$i][0];
$cat = $data[$i][1];
$subcat = $data[$i][2];
$title = $data[$i][3];
$desc = $data[$i][4];
$image = $data[$i][5];
echo"<table width=100% border=0 cellpadding=1 cellspacing=1>";
echo "<tr><td width=20%>";
echo"<table width=100% border=0 cellpadding=1 cellspacing=1>";
echo "<tr><td width=80%><a href=\"../admin/display.php?gid=$id&cat=$cat&subcat=$subcat&title=$title&desc=$desc&image=$image&flag=$flag\"><img src=\"".$data[$i][5]."\" width=80 height=120 border=0></a>\n</td></tr>";
echo "</table>";
echo "<td width=80%>";
echo "<table width=100% border=0>";
echo "<tr><td width=100%><font face=arial size=3><b><u>$subcat</u></b></font> <font face=arial size=1>($cat)</font></td></tr>";
echo "<tr><td width=100%><font face=arial size=2><b><i>$title</i></b></font></td></tr>";
echo "<tr><td width=100%><font face=arial size=2>$desc</font></td></tr>";
echo "</table>";
echo "</table>";
echo "<hr>";
}
}
You can't do what you're asking. Which is weird cause I thought it would work but after some testing it apprently doesn't.
Just for general reference, variables do not need to be set as global in PHP unless inside a function or class.