i have a link on zoom.php here i have a link where iam send image_id

<a href=\"editimage.php?img=$image_id\">Edit</a>

now i have a editimage.php where i reciving the image_id.

$image_id_g = isset($_GET['img']) ? $_GET['img'] : 0;

but i printing always 0's but i want to print the image id here

i also tried.but it say variable not found (img image_id)

$image_id = $_GET['image_id'];
$image_id = $_GET['img'];

you need to echo $image_id in link, otherwise you will not receive actually image id value.

<a href=\"editimage.php?img=<?php echo $image_id ?>\">Edit</a>

To check how value passed in your editimage.php, you can dump variables in the beginging

<?php
//editimage.php
echo "<pre>";
print_r($_GET);
echo "</pre>";
.
.
.
other code

?>

o i for got to say that i already have php echo for ex

<?php
echo"
    <a href=\"editimage.php?img=$image_id\">Edit</a>
";
?>

i cant revice it tho.

$image_id_g = isset($_GET['img']) ? $_GET['img'] : 0;

iam doing this to get the image_id but i get 0 every time -_-

Have you echo what i sent you in previous post

<?php
//editimage.php
echo "<pre>";
print_r($_GET);
echo "</pre>";
.
.
.
other code
?>

i tried it and prints

Array(
)

so nothing is passed to your page

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.