If your url actually shows something like editimage.php?img=3, then it should work:
$image_id_g = (isset($_GET['img'])) ? intval($_GET['img']) : 0;
echo $image_id_g;
diafol
Keep Smiling
10,666 posts since Oct 2006
Reputation Points: 1,628
Solved Threads: 1,514
Skill Endorsements: 57
Whoaa - I ain't gonna wade through all that code just for a quite $_GET variable!
Did you try my fix?
diafol
Keep Smiling
10,666 posts since Oct 2006
Reputation Points: 1,628
Solved Threads: 1,514
Skill Endorsements: 57
Why does it say image_id?
It should be a number?
diafol
Keep Smiling
10,666 posts since Oct 2006
Reputation Points: 1,628
Solved Threads: 1,514
Skill Endorsements: 57
What does the url in your address bar show? Sure you've got something like:
http://www.mysite.com/editimage.php?img=3
If so place this code at the very start of your page:
<?php
print_r($_GET);
exit;
?>
And try it again.
diafol
Keep Smiling
10,666 posts since Oct 2006
Reputation Points: 1,628
Solved Threads: 1,514
Skill Endorsements: 57
Coz you're using 'post' from the form.
$image_id_g = isset($_POST['img']) ? $_POST['img'] : 0;
But that name ('img') does not seem to exist in the form.
I can't work out what you're trying to do with the code above. You seem to want to save with the form, so the code line above is probably not what you want. This $_GET['img'] should be taken fromt he url, which in turn should be taken from a link on another page?
I'd suggest that you place this number into a hidden form field and then use that when you come to save.
diafol
Keep Smiling
10,666 posts since Oct 2006
Reputation Points: 1,628
Solved Threads: 1,514
Skill Endorsements: 57
This?
<input type="hidden" name ="random" class="random" value="<?php echo($_GET['img']);?>" />
diafol
Keep Smiling
10,666 posts since Oct 2006
Reputation Points: 1,628
Solved Threads: 1,514
Skill Endorsements: 57
Question Answered as of 11 Months Ago by
diafol
and
coltks2004