hi all im a little new to php code i has searched a lot of site in hope of being able to work this one out and now im stuck.
i have a page for a product on it and the php file for it is
<?php
//******************************
//Custom Code for getting data
//******************************
if (!$_REQUEST['pid']){
echo "<META HTTP-EQUIV=Refresh CONTENT='0; URL=index.php?xps=pindex'>";
exit();
} else {
$pids = explode("-", $_REQUEST['pid']);
$_REQUEST['pid'] = $pids[0];
}
$product = $myItems->getAll("single", $_REQUEST['pid']); //get the products data from the database
$pv_array = explode(",", $product[$_REQUEST['pid']][variations]);
$i=0;
$totalpvs = 0;
$result = $myDB->query_select("SELECT * FROM " . $config['table_product_var']);
while ($row = mysql_fetch_array($result,MYSQL_ASSOC)) {
if (in_array($row['ID'], $pv_array)) {
$pv[$i][title] = $row['title'];
$options_array = explode(", ", $row['options']);
$counter = $i;
$optionhtml = "<select name=\"pv_{$i}\">";
for ($j = 0; $j < sizeof($options_array); $j++) {
$optionhtml .= "<option value=\"{$options_array[$j]}\">{$options_array[$j]}</option>";
}
$optionhtml .= "</select>";
$pv[$i][options] = $optionhtml;
$totalpvs++;
$i++;
}
}
$result = $myDB->query_select("SELECT * FROM " . $config['table_product_types'] . " WHERE Id = '" . $product[$_REQUEST['pid']][type] . "'");
$row = mysql_fetch_array($result,MYSQL_ASSOC);
$customfields = $row['customfields'];
$cf_array_labels = explode("|", $customfields);
$cf_array_data = explode("|", $product[$_REQUEST['pid']][customdata]);
for ($i=0; $i<sizeof($cf_array_data); $i++) {
if ($cf_array_data[$i]) {
$customdata[$i][label] = $cf_array_labels[$i];
$customdata[$i][data] = $cf_array_data[$i];
}
}
//******************************
//Template Code below this point
//******************************
$pagetpl = new template; //Creates a new instance of the template class for this page
$pagetpl->set_template($page_url, "[", "]"); //Sets the tpl (template) file and the prefix and sufix characters
//Theses are all the varibles that we can use in the tpl file.
$pagetpl->set_var('SKINDIR', './templates/' . $config['skin_id'] . '/images');
$pagetpl->set_var('USERID', $user_id);
$pagetpl->set_var('PDBID', $product[$_REQUEST['pid']][pid]);
$pagetpl->set_var('PID', $product[$_REQUEST['pid']][product_id]);
$pagetpl->set_var('PNAME', $product[$_REQUEST['pid']][name]);
$pagetpl->set_var('PDESCRP', $product[$_REQUEST['pid']][descrip]);
$pagetpl->set_var('PCOST', $product[$_REQUEST['pid']][cost]);
if ($product[$_REQUEST['pid']][saleprice] == "0.00") {
$product[$_REQUEST['pid']][saleprice] = "";
}
if (($product[$_REQUEST['pid']][rrp] != "0.00") || ($product[$_REQUEST['pid']][rrp] != "")){
if ($product[$_REQUEST['pid']][saleprice]) {
$product[$_REQUEST['pid']][cost] = $product[$_REQUEST['pid']][saleprice];
} else {
}
$pagetpl->set_var('PDIF', $product[$_REQUEST['pid']][rrp]-$product[$_REQUEST['pid']][cost]);
if ($product[$_REQUEST['pid']][rrp] > 0) {
$savings = ($product[$_REQUEST['pid']][rrp]-$product[$_REQUEST['pid']][cost]);
$percent = round( ($savings/$product[$_REQUEST['pid']][rrp])*100, 0 );
$pagetpl->set_var('PPER', $percent);
} else {
$product[$_REQUEST['pid']][rrp] = "N/A";
$pagetpl->set_var('PPER', "N\A");
$pagetpl->set_var('PDIF', "N/A");
}
} else {
$product[$_REQUEST['pid']][rrp] = "N/A";
$pagetpl->set_var('PPER', "N/A");
$pagetpl->set_var('PDIF', "N/A");
}
$pagetpl->set_var('PRRP', $product[$_REQUEST['pid']][rrp]);
$pagetpl->set_var('PNP', $product[$_REQUEST['pid']][pnp_cost]);
$pagetpl->set_var('PIMG', $C->imageviewer("pimgviewer", $_REQUEST['pid']));
$pagetpl->set_var('ADDED', $product[$_REQUEST['pid']][add_to_cart]);
$pagetpl->set_var('VIEWS', $product[$_REQUEST['pid']][views]);
$pagetpl->set_var('USERID', $user_id);
$pagetpl->set_var('loggedin', $C->logictest($user_id), '', TRUE); //if statement
$pagetpl->set_var('loggedin2', $C->logictest($user_id), '', TRUE); //if statement
$pagetpl->set_var('shopstatus', $C->logictest($config['shop_status'], 0), '', TRUE); //if statement
$pagetpl->set_var('OFFLINEMSG', $config['offline_message']);
$pagetpl->set_var('customdata', $customdata, '');
if ($product[$_REQUEST['pid']][saleprice] == "0.00" ) { $product[$_REQUEST['pid']][saleprice] = ""; }
$pagetpl->set_var('saleprice', $C->logictest($product[$_REQUEST['pid']][saleprice]), '', TRUE); //sets up the empty cart if statement
$pagetpl->set_var('SALECOST', $product[$_REQUEST['pid']][saleprice]);
$pagetpl->set_var('item_pnp_value', $C->logictest($product[$_REQUEST['pid']][pnp_cost]), '', TRUE); //if statement
$pagetpl->set_var('item_pnp', $C->equalto($config['pnptype'], 2), '', TRUE);
$pagetpl->set_var('stocklevel', $C->equalto($product[$_REQUEST['pid']][stock], 0), '', TRUE); //if statement
$pagetpl->set_var('STOCK', $product[$_REQUEST['pid']][stock]);
$pagetpl->set_var('pv', $pv, '');
$pagetpl->set_var('TOTALPV', $totalpvs);
$pagetpl->set_var('REVIEWS', $myItems->_getproductreviews($_REQUEST['pid'], '', "reviews"));
$pagetpl->set_var('rrp', $C->equalto($product[$_REQUEST['pid']][rrp], '0.00'), '', TRUE); //if statement
//This draw the page with all its changes to the screen.
$pagetpl->parse();
$content = $pagetpl->draw();
?>
i want to pass the = $pids value to the next page which is just a html page at the mo and it contains an email form where i need the value to be copied. i have tried passing it via the url using GET command and all i get is errors or it just does nothing. im hoping some one can help or point me in the right direction.
thanks all