Note that there are some explanatory texts on larger screens.

plurals
  1. POPOST isset but not echo'ing out
    primarykey
    data
    text
    <p>I have a form posting to a page and I have a weird problem getting the values from the <code>POST</code> data. As you can see, I can check to see if <code>image_id</code>, <code>vote</code> and <code>fb_id_form</code> are all set before I run the conditional.</p> <p>The javascript alerts run so I know the three variables are set. But what I get is confusing. I get the first alert window that says 'worked'. And then I get two blank alert windows. How can the <code>fb_id_form</code> be 'set' (via the conditional) yet have no value when I try to alert them out?</p> <pre><code>if(isset($_POST['image_id']) &amp;&amp; isset($_POST['vote']) &amp;&amp; isset($_POST['fb_id_form'])){ $image_id = $mysqli-&gt;real_escape_string($_POST['image_id']); $vote = $mysqli-&gt;real_escape_string($_POST['vote']); $fb_id_form = $mysqli-&gt;real_escape_string($_POST['fb_id_form']); echo "&lt;script&gt;alert('worked');&lt;/script&gt;"; echo "&lt;script&gt;alert('".$fb_id_form."');&lt;/script&gt;"; echo "&lt;script&gt;alert('".$_POST['fb_id_form']."');&lt;/script&gt;"; } </code></pre> <p>this is the form data (on the same page):</p> <pre><code>echo "&lt;form method=\"post\" action=\"\"&gt; &lt;input type=\"hidden\" name=\"image_id\" value=\"".$id."\" /&gt; &lt;input type=\"hidden\" name=\"vote\" value=\"1\" /&gt; &lt;input type=\"hidden\" name=\"fb_id_form\" value\"".$fb_id."\" /&gt; &lt;input type=\"submit\" name=\"submitvote\" value=\"Vote\" /&gt; &lt;/form&gt;"; </code></pre> <p>Here's the issue. I have echo'ed out an alert of $fb_id RIGHT before the form and it gives me the correct value. When I submit it, I suppose that value gets lost.</p>
    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.
 

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