I'm trying to display the large image on the same page as the thumbnails, to do that I'm passing a variable called $current. I know that the code to display large image works, because it works when no variables are passed along, in which case $current set to 0, but when i click on any other thumbnail, the xml info doesn't seem to be passed along. I check if $current is passed into test_table.php in the top right corner so I know that works. So I'm stuck, please help! Thanks!
The problem page can be found here: http://brooklynthings.com/tibet_carpet_test/test_table.php
Code: [Select]<?php
include 'carpets.php';
$xml = new SimpleXMLElement($xmlstr);
$item_count=-1; //fixes item count
$id=$_GET['id'];
if (isset($id)==false){
$id=0;
}
$page=$_GET['page'];
if (isset($page)==false){
$page=1;
}
$id_count=($page-1)*15;
foreach ($xml->rug as $rugs) {
$item_count++;
}
$current=$_GET['id_current'];
if (isset($current)==false){
$current=0;
}
$pages=round($item_count/15);
if(($item_count/15)-($pages*15)!=0){ // adjusts page number for overflow
$pages++;
}
?>
<center>
<table cellpadding="0" cellspacing="0" align="left" class="display">
<tr>
<td>
<table width="260" height="435" cellpadding="0" cellspacing="0">
<?php for ($i=0;$i<=4;$i++){ ?>
<tr height="85" valign="top">
<?php for ($j=0;$j<=2;$j++){?>
<td>
<?php if(isset($xml->rug[$id_count]->filename)==true){ ?> <!-- gets rid of empty images -->
<a href="test_table.php?page=<?php echo $page; ?>&id=<?php echo $id_count?>&id_current=<?php echo $id_count?>"><img src="images/small/<?php echo $xml->rug[$id_count]->filename?>.jpg" border="0"></a>
<?php $id_count++; }?>
<?php //echo $xml->rug[$count]->filename;?>
</td>
<td width="5"></td>
<?php }?>
</tr>
<?php }?>
</table>
<!--displays page numbers and links -->
<?php // $id_start=($page-1)*15;?>
page
<?php for ($k=1;$k<=$pages;$k++) {
if($page==$k) {?>
<b><?php echo $page; ?></b>
<?php } else {?>
<a href="test_table.php?page=<?php echo $k; ?>&id=<?php echo ($k-1)*15?>&id_current=<?php echo ($k-1)*15?>"><?php echo $k; ?></a>
<?php } ?>
<?php } ?>
</td><!--end of thubnails -->
<td width="388"valign="top" align="center">
<div class="image_large"><a href="images/large/<?php echo $xml->rug[$current]->filename?>.jpg" class="lightwindow hidden" rel="Random[Sample Images]" caption="<?php echo $xml->rug[$current]->rugname, $xml->rug[$current]->color, $xml->rug[$current]->size?>"><img src="images/large/<?php echo $xml->rug[$current]->filename?>.jpg" border="0" height="420" width="300"></a></div>
</td><!--end of large_image -->
<td width="98" valign="top" align="right">
Test $current: <?php echo $current ?><br />
Series: <?php echo $xml->rug[$current]->series?><br />
Name: <?php echo $xml->rug[$current]->rugname?><br />
Color: <?php //if (($xml->rug[$current]->color)==""){
//echo "as shown"; }else {}
echo $xml->rug[$current]->color;?><br />
Size: <?php echo $xml->rug[$current]->size?>
</td><!--end of rug_info -->
</table>
Help with form post data and arrays
Hi all,I am new to this forum... It has been awhile since i have worked with arrays, and i am starting to pull my hair out with this little issue i am having..I hope someone can help me out with it,
Sending UDP Raw socket
I truly need help on this. I am trying to write a test program that simulate a network environment that have 5 clients and 1 server. To do so, I need to be able to edit IP header to change it's
Multiple websites question.
Hi, does php have any functionality that enables a programmer to extract information from a website on the internet and display it on their own? Any help or suggestions on where to go and look for a
Why does my php page download images over and over
Can anybody please explain to me why my php page keeps downloading the images and other items every single time the page is loaded or refreshed. I would have thought that the images get cached and
Upload Code Help
Hi everyone I need some help with a bit of code ive been working with for a while. I am completely stumped to why it is now working correctly.Code: <?if(!isset($upload)) {$upload =
Socket Server Response Headers
Earlier I had a post about my Socket Server, I wasn't able to get it to connect, now I can I am using socket_write() to well hopefully send html to a web page, the problem I think is that I have to
Update Database
Hi All,I have a problem with this:Code: [Select]<?phpsession_start();include('../common/dbconnect.php');$stock_id = $_GET['stock_id'];$query='SELECT * FROM users_stocks WHERE user_id ="' .
Implementing Single Sign-On using SAML 1.1, x.509, LDAP in C#.net
Hi,
Session variable help
I'm having a very troubling issue. Maybe I'm just looking over something but I have looked at the code for several hours now, making small adjustments here and there to try to fix this problem.
Escape Latin Characters
I need to escape latin characters in an xml doc. Example: "é" is escaped to "é". I thought I could use the ASCII function, but SELECT ASCII('é') FROM DUAL in Oracle gives me 50089.