Note that there are some explanatory texts on larger screens.

plurals
  1. POIf statment issue with submit form php
    primarykey
    data
    text
    <p>I have a site in which an Admin User looks at rows of invoices which have been submitted by users, when they click on an 'Approve Invoice' button from one of these rows it will take them on the page below. </p> <p>Once the Admin User approves this invoice, they hit the 'yes' radio button and submit at the bottom of the page which enters the value 'AUDITED' under the 'npc_active' column in that row. It then multiplies the quantity and points and inserts the total onto a new row in 'tally_points' (along with their user id and sales id). This is all working fine, but...</p> <p>What I am trying to do, however, is make a condition in which once the sale is audited, that it can't be re-audited. ie the 'This invoice has been audited' print should show once the submission has taken place, but it isn't working. </p> <p>I'm close but can't seem to figure out what the problem is. The code in which I think I am having the problem is below, the full page code is at the bottom of this post.</p> <pre><code>$str ='&lt;form method="post" action="audit_invoice.php"&gt; &lt;font style="font-size:11px;"&gt; &lt;em&gt;Is this invoice approved?&lt;br /&gt;'; if($approved == "AUDITED") { $str .='Please select carefully as this action cannot be undone.&lt;/em&gt; &lt;em&gt;Yes:&lt;/em&gt;&lt;input type="radio" value="AUDITED" name="npc_active"&gt; &lt;em&gt;No:&lt;/em&gt; &lt;input type="radio" value=" " name="npc_active"&gt; &lt;input type="submit" name="submit" value="Submit" /&gt; &lt;input type="hidden" name="submitted" value="TRUE" /&gt; &lt;input type="hidden" name="id" value="' . $id . '" /&gt; &lt;/font&gt; &lt;/form&gt;&lt;/tr&gt;'; } else { $str .='This invoice has been audited'; } echo $str; </code></pre> <p>If I put the '==' before "AUDITED" it will show up with the echo 'The invoice has been audited' in each instance, if I put '=' in front of "AUDITED" it will show the yes button and submit button in each instance.</p>
    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.
 

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