Note that there are some explanatory texts on larger screens.

plurals
  1. POMultiple Forms in php
    primarykey
    data
    text
    <p>I am trying to create three forms. The way it should work is a form should appear and the user is able to input their info. When the submit button is pressed an email should be sent to the supervisor and the supervisor should click on a link and another form should appear. When the supervisor fills the form and then clicks submit an email should be submitted to the client. the client will click on the link and fill the form out. The client should be then able to send an email to the employee and the both the supervisor and the original user should be able to get the response. However when I keep creating the form the php keeps breaking after the second form. I cant seem to figure out why it keeps breaking in the third form. </p> <p>here is a snippit of the php code for the second form:</p> <pre><code> if ($_POST['token'] == "2") { $m = new mysql($connection_information); $m-&gt;update('hello',array('approval'=&gt;$_POST['approval'], 'comment'=&gt;$_POST['comment'], 'approved_by'=&gt;$_POST['approval_by'], 'approved_date'=&gt;time()),'uid=\''.$_POST['uid'].'\''); $records = $m-&gt;row(array('table' =&gt; 'hello','condition' =&gt; 'uid=\''.$_POST['uid'].'\'')); $eemail = records['email']; $supemail = $records['supervemail']; $clemail = $records['cemail']; $approvaltime = date("m/d/y g:i a",$records['approved_date']); $subject = " " . $clemail; $headers = 'From: ' . $supemail . "\r\n" . 'Reply-To: ' . $supemail . "\r\n" . 'MIME-Version: 1.0' . "\r\n"; if($records['approval'] == 1){ $travel_action = 'approved'; }else{ $travel_action = 'rejected'; } $message = " Travel Estimation ".$travel_action." on ".$approvaltime." by ".$records['approved_by']. "\r\n" . "Comment: " .$records['comment']. "\r\n"; mail($eemail, $subject, $message, $headers); </code></pre> <p>Here is my html portion:</p> <pre><code> &lt;?php if ($_POST['token'] == "2") { ?&gt; &lt;h1&gt;Approval Decision Submited.&lt;/h1&gt; &lt;?php } else if ($_POST['token'] == "1") { echo "&lt;h1&gt;Form has been submitted&lt;/h1&gt;"; } else { if (isset($_GET['uid']) &amp;&amp; isset($records)){ ?&gt; &lt;form id="approvalForm" name="form2" action="hello.php" method="POST"&gt; &lt;input type="hidden" name="token" value="2"&gt; &lt;input type="hidden" name="uid" value="&lt;?php echo $_GET['uid'] ?&gt;"&gt; &lt;fieldset&gt; &lt;legend&gt;Manager Approval Required&lt;/legend&gt; Submitted on: &lt;?php echo date("m/d/y g:i a",$records['submitted']) ?&gt;&lt;br/&gt; By: &lt;?php echo $records['email'] ?&gt;&lt;br/&gt; &lt;label for="email"&gt;Supervisor's Email: &lt;/label&gt; &lt;input type="text" name="email" title="Email" value="&lt;?php echo $records['supervemail'] ?&gt;"&gt;&lt;br&gt; &lt;label for="email"&gt;Client's Email: &lt;/label&gt; &lt;input type="text" name="email" title="Email" value="&lt;?php echo $records['supervemail'] ?&gt;"&gt;&lt;br&gt; &lt;label for="email"&gt;Employee's Email: &lt;/label&gt; &lt;input type="text" name="email" title="Email" value="&lt;?php echo $records['supervemail'] ?&gt;"&gt;&lt;br&gt; &lt;label for="approval_by"&gt;Please Enter your name for approval: &lt;/label&gt; &lt;input type="text" name="approval_by" id="approval_by" title="Approved By" &gt;&lt;br&gt; &lt;label for="approval"&gt;Please select appropriate action: &lt;/label&gt; &lt;select name="approval" id="approval"&gt; &lt;option value=""&gt;Please Select Action&lt;/option&gt; &lt;option value="1"&gt;Approval&lt;/option&gt; &lt;option value="0"&gt;Rejection&lt;/option&gt; &lt;/select&gt; &lt;label for="comment" &gt;Comment: &lt;/label&gt; &lt;input type="text" name="comment" id="comment" title="comment"&gt;&lt;br&gt; &lt;input class="submit" type="submit" value="Submit"/&gt; &lt;/fieldset&gt; &lt;/form&gt; </code></pre> <p>In my third form I want the supervisor to send an email to the client so the that the client will receive the link and approve or disapprove in the third form. From there they can submit an email to the user if they agree or disagree. I made it so the third form looks almost identical to the second form. Is that where my fault lies? </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