I have a bunch of custom modules that were created about 2 years ago. After my upgrade to .7.6.4 (actually it might have been at .7.5.0 but I can't recall) much of this custom code stopped working.
It appears that they way PN passes variables has changed significantly so pages that pass information to a script are not getting the information. I've fixed much of it, but I still have a bunch of pages that are not working. So I'm looking for some help in fixing them.
Here is an example:
This is the HTML code:
Code
<form name="reviews" action="modules.php" onsubmit="return validate();" method="get">
<input type="hidden" name="op" value="modload">
<input type="hidden" name="file" value="update_review_products">
<input type="hidden" name="name" value="database">
<table border="0" cellpadding="2" cellspacing="0" bgcolor="#3E8AED" align="center">
<tr>
<td>
<table width="50%" border="0" cellpadding="2" cellspacing="2" bgcolor="#BBE8FF">
<tr>
<td align="center" bgcolor="#3E8AED">Add Your Review</td>
</tr>
<tr>
<td> <input type="hidden" name="txtprodid" value=""></td>
</tr>
<tr>
<td><textarea name="txtreview" cols="80" rows="10"></textarea></td>
</tr>
<tr>
<td align="center"> </td>
</tr>
<tr>
<td align="center"> <input type="image" src="/themes/Aquarium_Blue/images/btn_submit.gif" width="67" height="17">
<a href="javascript:history.back();"><img src="/themes/Aquarium_Blue/images/btn_back.gif" name="close" value="Close" border="0"></a>
<a href="#" onclick="reviews.reset();"> <img src="/themes/Aquarium_Blue/images/btn_reset.gif" width="67" height="17" border="0"></a></td>
</tr>
<tr>
<td> </td>
</tr>
</table>
</td>
</tr>
</table>
</form>
<input type="hidden" name="op" value="modload">
<input type="hidden" name="file" value="update_review_products">
<input type="hidden" name="name" value="database">
<table border="0" cellpadding="2" cellspacing="0" bgcolor="#3E8AED" align="center">
<tr>
<td>
<table width="50%" border="0" cellpadding="2" cellspacing="2" bgcolor="#BBE8FF">
<tr>
<td align="center" bgcolor="#3E8AED">Add Your Review</td>
</tr>
<tr>
<td> <input type="hidden" name="txtprodid" value=""></td>
</tr>
<tr>
<td><textarea name="txtreview" cols="80" rows="10"></textarea></td>
</tr>
<tr>
<td align="center"> </td>
</tr>
<tr>
<td align="center"> <input type="image" src="/themes/Aquarium_Blue/images/btn_submit.gif" width="67" height="17">
<a href="javascript:history.back();"><img src="/themes/Aquarium_Blue/images/btn_back.gif" name="close" value="Close" border="0"></a>
<a href="#" onclick="reviews.reset();"> <img src="/themes/Aquarium_Blue/images/btn_reset.gif" width="67" height="17" border="0"></a></td>
</tr>
<tr>
<td> </td>
</tr>
</table>
</td>
</tr>
</table>
</form>
Which passes to the following PHP:
Code
<?
$txtprodid = pnSessionGetVar('txtprodid');
$txtreview = pnSessionGetVar('txtreview');
$uid = pnSessionGetVar('uid');
if($uid=="")
{
?>
alert("You are not a Registered member")
javascript:history.go(-2);
<?
}
else
{
include("DataBase.php");
$db=new database();
$data=trim($txtreview);
$pkid=$txtprodid;
$sql="insert into TBL_product_reviews(product_review_id,product_id,visitor_id,review) values('',$txtprodid,$uid,'$data')";
print($sql);
if($db->executequery($sql))
{
?>
javascript:history.go(-2);
<?
}
else
{
header("Location: sorry.php");
}
}// end of if condition
?>
$txtprodid = pnSessionGetVar('txtprodid');
$txtreview = pnSessionGetVar('txtreview');
$uid = pnSessionGetVar('uid');
if($uid=="")
{
?>
alert("You are not a Registered member")
javascript:history.go(-2);
<?
}
else
{
include("DataBase.php");
$db=new database();
$data=trim($txtreview);
$pkid=$txtprodid;
$sql="insert into TBL_product_reviews(product_review_id,product_id,visitor_id,review) values('',$txtprodid,$uid,'$data')";
print($sql);
if($db->executequery($sql))
{
?>
javascript:history.go(-2);
<?
}
else
{
header("Location: sorry.php");
}
}// end of if condition
?>
And here is the resulting SQL string generated:
insert into TBL_product_reviews(product_review_id,product_id,visitor_id,review) values('',,2,'')
As you can see several of the vars are coming in as empty. Any help is appreciated.
Sean
--
http://www.Aquaria.info --> 30k user postnuke site
http://www.EngineSubmittal.com -- Free search engine submission
