BloodRayne Blood
BloodRayne Blood

Reputation: 63

Get a variable from href with id

How can I get the id as a variable from that statement in same page?

I need to capture the #dialog to display in a popup and can't do that if I send the id to a different page.

<a href="#dialog?id=<?php echo $image['image_id']; ?>" name="modal"  class="info">Link</a>

I've been using this to get it from the link but I need to capture it in same page. This is what i was using :

$img = isset($_GET['id'])

Upvotes: 0

Views: 1097

Answers (1)

TimWolla
TimWolla

Reputation: 32731

Everything after the Hash-Sign is evaluated by the browser only and not sent to the server. You therefore cannot access it.

Maybe you meant:

?id=<?php echo $image['image_id']; ?>#dialog

Otherwise you would have to use JS.

Upvotes: 2

Related Questions