I’m confused. It sounds like you’re trying to send a value from JavaScript to PHP, but the only id I saw in your code was already in PHP.
Do you have a value in your JavaScript that you want to save to a database? That’s relatively simple, especially with jQuery (which you seem to be using):
// something.php handles the actual "saving to a database" part
$.post('something.php', 'id=' + id);
thank you for your response. Here is my php code, I managed already the image to put it in a folder, what I want now is to put it in my database, the problem is I don’t know how to send such value to in js.
I put your suggestion after onComplete: I presume to send the value first before it will display the success message but my function now isn’t working.
still no work. I forgot the source, I just copied it. I posted my entire file, html/javascript and php…
I’m have also my external js script
Ajaxfileupload-jquery-1.3.2.js and ajaxupload.3.5.js, I think they all worked well. I really need your help.
Put it before the “new AjaxUpload” part, not in any of the functions. (I think I found the source of your AjaxUpload, and I’m pretty sure it’s a red herring…)
And if that doesn’t work, then can you link to a live example?
What does this mean? Is it failing when your JavaScript tries $(‘#ID’).val(), or is it failing when your PHP on stud_image_act.php tries to access $_GET[‘ID’]?
I tried the previous suggestion, every time I put this $.get(‘stud_image_act.php?ID=’ + yourId); inside my function, my js fail. Now I tried your recent suggestion, my js works but it missed to send the value of my id. I used echo $_GET[‘ID’] to fetch and show it’s value in stud_image_act.php but it shows nothing.
However, it looks like you’re on the right track with that DOM inspector. Just find your hidden <input> in the body, and verify that it actually has the value that you tried to set.
Off Topic:
Here’s why we’re doing all this: You’re trying to (a) set the value of a hidden <input> with PHP, (b) grab that input’s value with JavaScript, and (c) send it to another page in an AJAX request, where it can (d) be processed.
As you already posted, (d) seems to be working fine. There aren’t a whole lot of moving parts in (b) or (c); we’re letting jQuery take care of them for us. That just leaves (a)…