I am a student in Florida State University working on developing a page for interfacing with Pro-E. I have to make a table of selected parts from one previous page. Say I select 4 parts from the page it goes to the first row of next page. The next 4 parts should go to the 2nd row of the next page and so on and so forth.
I think I have to use cookies for that. I am not sure. Here is the code that I am using for the page to first select the parts. But I am not able to use set cookies. Kindly help in that.
<?php
require ("sql.php");
echo("$username<br><br>");
$count=0;
$function=0;
$SQL = "SELECT * FROM Parts ORDER BY PartNum";
$NumofParts = numSQL($SQL);
$dir_name="Parts";
$dir=opendir($dir_name);
while ($file_name = readdir($dir))
{
if (ereg(".", $file_name) && ($file_name != ".") && ($file_name != ".."))
{
$file_list = "$file_name";
$arlink[] = $file_list;
$name = explode(".", $file_list);
$link = $name[0];
$arname[] = $link;
}
}
closedir($dir);
// echo("$count<br>");
// echo("$NumofParts<br>");
while($count < $NumofParts)
{
if ($arlink[$count])
{
$SQL = "SELECT * FROM Parts WHERE FilePath = 'Parts/$arlink[$count]'";
$FilePath[$count] = rmSQL($SQL,0,"FilePath");
$Submitted_By[$count] = rmSQL($SQL,0,"Submitted_By");
$Email[$count] = rmSQL($SQL,0,"Email");
$Description[$count] = rmSQL($SQL,0,"Description");
$PartNum[$count] = rmSQL($SQL,0,"PartNum");
$ImagePath[$count] = rmSQL($SQL,0,"ImagePath");
//echo("pankaj<br>");
//echo("$arlink[$count]<br>");
//check for the selected mark
$select1 = isset($Select_MorphoItem[$count]);
//echo("$select1<br>");
//echo("$Select_MorphoItem[$count]<br>");
//echo("$PartNum[$count]<br>");
if($select1){
$Morphofunarlink[$function]=$arlink[$count];
echo("$Morphofunarlink[$function]<br>");
$MorphofunFilePath[$function]=$FilePath[$count];
echo("$MorphofunFilePath[$function]<br>");
$MorphofunSubmitted_By[$function]=$Submitted_By[$count];
echo("$MorphofunSubmitted_By[$function]<br>");
$MorphofunEmail[$function]=$Email[$count];
echo("$MorphofunEmail[$function]<br>");
$MorphofunDescription[$function]=$Description[$count];
echo("$MorphofunDescription[$function]<br>");
$MorphofunPartNum[$function]=$PartNum[$count];
echo("$MorphofunPartNum[$function]<br>");
$MorphofunImagePath[$function]=$ImagePath[$count];
echo("$MorphofunImagePath[$function]<br><br>");
$function=$function+1;
//60
}
}
$count=$count+1;
}
//echo("$function<br><br><br>");
setcookie("testcookie", "$Select_MorphoItem", $expiretime, "/", "www.eng.fsu.edu");
//setcookie("quantity[$function]", "1");
//$function++;
//setcookie("function", $function);
?>
<INPUT TYPE ="button" VALUE = "GO BACK" ONCLICK="self.history.back();">