how to retrive a value on the same page through a link - php

Please help with code PHP…

My loop to display project titles

<?php while($vrecords_assoc = mysql_fetch_assoc($vresult_set)){?>
<?php echo $vrecords_assoc["ctitle"];?>
<?php }?>

Receiving value to echo project details(does not receive)

<a class=“thumb” href="<?php if($_GET[“kcid”] == $vrecords_assoc[‘cid’])
{ echo $vrecords_assoc[‘cimage1’];} ?>" title="<?php echo $vrecords_assoc['cimage1']; ?>">

		<img src="<?php if($_GET["kcid"] == $vrecords_assoc['cid'])

{ echo $vrecords_assoc[‘cthumb1’];} ?>" title="<?php echo $vrecords_assoc['cthumb1']; ?>"/>

This is all on the same page, my projects are called into a jquery gallery from the nav.

I hope this makes any sense…

Put:ini_set('display_errors', 'On'); error_reporting(-1); right after your first <?php tag and then load the page to see any errors.

Also when posting code try use [ php] tags

The kcid is sent and it picks up the correct id from my database but my error is undefined index: kcid…
So the id isn’t received where it needs to be displayed:

<a class=“thumb” href="<?php if($_GET[“kcid”] == $vrecords_assoc[‘cid’])
{ echo $vrecords_assoc[‘cimage1’];} ?>" title="<?php echo $vrecords_assoc['cimage1']; ?>">

       <img src="<?php if($_GET["kcid"] == $vrecords_assoc['cid'])

{ echo $vrecords_assoc[‘cthumb1’];} ?>" title="<?php echo $vrecords_assoc['cthumb1']; ?>"/>

Thanks for your response :slight_smile:

Ok, so I just tried sending to another page, and it worked, so the problem is that the link is on the same page, but it needs to be… so if anyone can help… please…?

Can I see the whole code you have and i’ll run it through my IDE see what I get back

Sponsor our Newsletter | Privacy Policy | Terms of Service