Note that there are some explanatory texts on larger screens.

plurals
  1. POpass a hidden input value to php
    primarykey
    data
    text
    <p>i found this code to upload profile image, </p> <p><a href="http://www.phpdevblog.eu/2011-04/combined/jquery-ajax-and-php-based-profile-image-upload-without-reloading-the-page.html#comments" rel="nofollow">http://www.phpdevblog.eu/2011-04/combined/jquery-ajax-and-php-based-profile-image-upload-without-reloading-the-page.html#comments</a></p> <p>everything are fine. but i want to set a name file = user_id</p> <p>how i pass the input hidden user_id value to the php upload file process?</p> <pre><code>var uploadURL = "processupload.php"; $(document).ready(function(){ $('a#uploadFile').file(); $('a#delete').click(function(){ $('input#profileImageFile').val(""); $('img#profileImage').attr("src","/images/styles/profileBlank.jpg"); $('div#messageBox').html("Image deleted !"); $('div#messageBox').attr("class","success"); $('a#delete').hide(); }); $('input#uploadFile').file().choose(function(e, input) { input.upload(uploadURL, function(res) { if (res=="invalid"){ $('div#messageBox').attr("class","error"); $('div#messageBox').html("Invalid extension !"); }else{ $('div#messageBox').attr("class","success"); $('div#messageBox').html("Imagen cargada !"); $('img#profileImage').attr("src","/images/avatars/"+res); $('input#profileImageFile').val(res); $('a#delete').show(); $(this).remove(); } }, ''); }); }); </code></pre> <p>html</p> <pre><code>&lt;div class="imageContainer"&gt; &lt;img alt="" src="/images/avatars/&lt;?php echo $row_rs_user['user_image']; ?&gt;" width="150" height="150" id="profileImage"&gt; &lt;a href="#" id="uploadFile" title="Upload"&gt;&lt;img alt="" src="/images/styles/upload.jpg"&gt;&lt;/a&gt; &lt;a href="#" id="delete" title="Delete" style="display:none;position:relative;z-index:999999;"&gt;&lt;img alt="" src="/images/styles/delete.jpg"&gt;&lt;/a&gt; &lt;input type="hidden" name="user_id" value="&lt;?php echo $row_rs_user['user_id']; ?&gt;"&gt; &lt;div id="messageBox"&gt;&lt;/div&gt; &lt;/div&gt; </code></pre> <p>PHP upload process</p> <pre><code>if(isset($_POST)) { . . . . </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload