Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <pre><code>document.location.href='ecr-detail-edit.php?prs_mode=edit&amp;prs_id='+x; </code></pre> <p>should be </p> <pre><code>location.href='ecr-detail-edit.php?prs_mode=edit&amp;prs_id='+x; </code></pre> <p>and also you should use <code>mysql_real_escape_string()</code> to escape malicious data user may pass on to your script. </p> <p>hence change</p> <pre><code>$ids = $_POST['prs_rid']; </code></pre> <p>to </p> <pre><code>$ids = mysql_real_escape_string($_POST[prs_rid]); </code></pre> <p>you are missing script type, when you want to use javascript you need to tell to browser that the code being declared is of javascript, you need to change</p> <pre><code>&lt;script&gt; </code></pre> <p>to </p> <pre><code>&lt;script type="text/javascript"&gt; </code></pre> <p>you are missing single quotes in your POST data. add single quotes to the following.</p> <pre><code>$ids = $_POST['prs_rid']; </code></pre> <p>one last thing is i would never output javascript with PHP. it is better you keep javascript and PHP different. for example your above code can be changed to.</p> <pre><code>&lt;?php if ($mode == "edit"): $ids = mysql_real_escape_string($_POST['prs_rid']); $result = mysql_query("SELECT * FROM ECRDTL_edit WHERE id='$ids'") or die(mysql_error()); $row = mysql_fetch_assoc($result); ?&gt; &lt;script type="text/javascript"&gt; var x = document.getElementById('prs_rid').value alert(x); location.href = 'ecr-detail-edit.php?prs_mode=edit&amp;prs_id='+x; &lt;/script&gt; &lt;?php endif; ?&gt; </code></pre>
    singulars
    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.
    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