Running a huge php/mysql pages that needs to pass data three times.
Here is the initial page with the relevant snippets
Due to complaints about too many URLs PLease view this URL https://groups.google.com/forum/#!topic ... R9IczYYdd8
Passing variables to 3 pages
Moderators: egami, macek, gesf
hopefully this snippets might help pinpoint the question:
//here is the section giving me an issue //
Update on snippets:
1st Step:
<?php
session_start();
//$_SESSION['sessiondata'] = $results;
if(mysqli_num_rows($result)){
$results = array(); $i = 0;
while($row = mysqli_fetch_assoc($result)){
$i++;
$sessionid1=$row['sessionid'];
$abbr1=$row['abbr'];
$seminar1=$row['seminar'];
$date1=$row['date'];
$time1=$row['time'];
echo '<tr>';
echo " <td class=\"style3\" align=\"center\">
<input name=\"id" . $row['sessionid'] . "\" id=\"id". $row['sessionid']. "\" v
alue=\"" .$row['abbr']. "-" .$row['sessionid']. "\" size=\"10\"></td>
<td align=\"center\"><input name=\"price". $row['sessionid']. "\" id=\"price".
$row['sessionid']. "\" value=\"63.00\" size=\"7\" type=\"checkbox\" ></td>
<td class=\"style3\" align=\"center\"><input class=\"style3\" name=\"description
". $row['sessionid']. "\" id=\"description". $row['sessionid']. "\" value=\"".
$row['seminar']. "\" type=\"text\"></td>
<td class=\"style3\" align=\"center\"><input class=\"style3\" name=\"quantity".
$row['sessionid']. "\" value=\"0\" size=\"4\" type=\"text\" id=\"quans". $row[
'sessionid']. "\"></td>
<td align=\"center\"><div align=\"center\"><span class=\"style3\">". $row['date
']. " ". $row['time']. "</span></div> </td>";
echo "</tr>";^M
}
$_SESSION['sessiondata'] = $results;
$results[$i][]=$row;
}
echo $i;
echo $results;
?>
2nd Step
<?php
...
if (isset($_POST['submit'])){
$sessValue = $_POST['sessionid'];
};
...
echo "Session :". print_r($sessValue) . "<br /><br />";
$results = $_SESSION[$results];
echo "<br />results : ". print_r(array_values($results)) ."<br />";
//$i = 0;
//while ($row = mysqli_fetch_assoc($results)){
while ($results){
$id=$row['id'];
$price=$row['price'];
$description=$row['description'];
$quantity=$row['quantity'];
$date=$row['date'];
echo "<br />" . $id . "<br />" . $price . "<br />" . $description . "<br />" . $
quantity . "<br />". $date . "<br />";
}
var_export($description);
//for ($n =700 ; $n < 900; $n++)
//{
//id[$n]=$_POST[id($n)];
//description[$n]=$_POST[description($n)];
//quantity[$n]=$_POST[quantity($n)];
//price[$n]=$_POST[price($n)];
//subtotal[$n]=$_POST[subtotal($n)];
//echo "<br />". description[$n] . "<br />" . quantity[$n]. "<br />" . price[$n
]. "<br />" . subtotal[$n] ."<br />";
//}
$url ="https://www3.moneris.com/HPPDP/index.php"; //QA Url
$dataToSend = "ps_store_id=$store_id&hpp_key=$hpp_key&charge_total=$charge_total
&bill_first_name=$bill_first_name&bill_last_name=$bill_last_name&bill_company_na
me=$bill_company_name&bill_address_one=$bill_address_one&bill_city=$bill_city&bi
ll_state_or_province=$bill_state_or_province&bill_postal_code=$bill_postal_code&
bill_phone=$bill_phone&email=$email&hpp_preload=";
//unset $_SESSION['results'];
//here is the section giving me an issue //
Update on snippets:
1st Step:
<?php
session_start();
//$_SESSION['sessiondata'] = $results;
if(mysqli_num_rows($result)){
$results = array(); $i = 0;
while($row = mysqli_fetch_assoc($result)){
$i++;
$sessionid1=$row['sessionid'];
$abbr1=$row['abbr'];
$seminar1=$row['seminar'];
$date1=$row['date'];
$time1=$row['time'];
echo '<tr>';
echo " <td class=\"style3\" align=\"center\">
<input name=\"id" . $row['sessionid'] . "\" id=\"id". $row['sessionid']. "\" v
alue=\"" .$row['abbr']. "-" .$row['sessionid']. "\" size=\"10\"></td>
<td align=\"center\"><input name=\"price". $row['sessionid']. "\" id=\"price".
$row['sessionid']. "\" value=\"63.00\" size=\"7\" type=\"checkbox\" ></td>
<td class=\"style3\" align=\"center\"><input class=\"style3\" name=\"description
". $row['sessionid']. "\" id=\"description". $row['sessionid']. "\" value=\"".
$row['seminar']. "\" type=\"text\"></td>
<td class=\"style3\" align=\"center\"><input class=\"style3\" name=\"quantity".
$row['sessionid']. "\" value=\"0\" size=\"4\" type=\"text\" id=\"quans". $row[
'sessionid']. "\"></td>
<td align=\"center\"><div align=\"center\"><span class=\"style3\">". $row['date
']. " ". $row['time']. "</span></div> </td>";
echo "</tr>";^M
}
$_SESSION['sessiondata'] = $results;
$results[$i][]=$row;
}
echo $i;
echo $results;
?>
2nd Step
<?php
...
if (isset($_POST['submit'])){
$sessValue = $_POST['sessionid'];
};
...
echo "Session :". print_r($sessValue) . "<br /><br />";
$results = $_SESSION[$results];
echo "<br />results : ". print_r(array_values($results)) ."<br />";
//$i = 0;
//while ($row = mysqli_fetch_assoc($results)){
while ($results){
$id=$row['id'];
$price=$row['price'];
$description=$row['description'];
$quantity=$row['quantity'];
$date=$row['date'];
echo "<br />" . $id . "<br />" . $price . "<br />" . $description . "<br />" . $
quantity . "<br />". $date . "<br />";
}
var_export($description);
//for ($n =700 ; $n < 900; $n++)
//{
//id[$n]=$_POST[id($n)];
//description[$n]=$_POST[description($n)];
//quantity[$n]=$_POST[quantity($n)];
//price[$n]=$_POST[price($n)];
//subtotal[$n]=$_POST[subtotal($n)];
//echo "<br />". description[$n] . "<br />" . quantity[$n]. "<br />" . price[$n
]. "<br />" . subtotal[$n] ."<br />";
//}
$url ="https://www3.moneris.com/HPPDP/index.php"; //QA Url
$dataToSend = "ps_store_id=$store_id&hpp_key=$hpp_key&charge_total=$charge_total
&bill_first_name=$bill_first_name&bill_last_name=$bill_last_name&bill_company_na
me=$bill_company_name&bill_address_one=$bill_address_one&bill_city=$bill_city&bi
ll_state_or_province=$bill_state_or_province&bill_postal_code=$bill_postal_code&
bill_phone=$bill_phone&email=$email&hpp_preload=";
//unset $_SESSION['results'];