Search the Community
Showing results for tags '500 error'.
-
I have been working on a custom form for our office to use, and I am rounding the final corner (checkboxes!) and am stuck. I have finally gotten the code to actually function the way I want, but am greeted with a 500 error instead of the confirmation page. Maybe I'm just tired and missing something... HTML: <form name="htmlform" method="post" action="html_form_send.php"> <p><center><font size="18">Tucker Arensberg IT Equipment Request Form</font></center></p> <center><b><font color="red">Please Fill Out Entire Form, IT Department Is Not Responsible For Incomplete Information On Requests.</font></b></center><br> <table width="450px"> </tr> <tr> <td valign="top"> <label for="first_name"><b>First Name:</b></label> </td> <td valign="top"> <input type="text" name="first_name" maxlength="50" size="30"> </td> </tr> <tr> <td valign="top""> <label for="last_name"><b>Last Name:</b></label> </td> <td valign="top"> <input type="text" name="last_name" maxlength="50" size="30"> </td> </tr> <tr> <td valign="top"> <label for="email"><b>Email Address:</b><br> </label> </td> <td valign="top"> <input type="text" name="email" maxlength="80" size="30"> <br><b><font color="red">FULL EMAIL MUST BE ENTERED OR FORM WILL NOT BE SUBMITTED</font></b><br> </td> </tr> <tr> <td valign="top"> <label for="daterequest"><b>Pickup Date:</b><br> (mm/dd/yyyy)<br> <br> </label> </td> <td valign="top"> <input type="text" name="daterequest" maxlength="10" size="10"> </td> </tr> <tr> <td valign="top"> <label for="datereturn"><b>Estimated Return Date:</b><br> (mm/dd/yyyy)<br> <br> </label> </td> <td valign="top"> <input type="text" name="datereturn" maxlength="10" size="10"> </td> </tr> <tr> <td valign="top""> <b><label class="radio" for="usage">Usage:</label></b> </td> <td valign="top"> <input class="radio" type="radio" name="usage" value="internal" checked /> <span>Internal (On-Site)</span><br> <input class="radio" type="radio" name="usage" value="external" /> <span>External (Off-Site)</span><br><br> </td> <tr> <td valign="top"> <label for="equipment"><b>Equipment Needed:</b><br> (Any items not checked will not be included)</label> </td> <td valign="top"> <input type="checkbox" name="equipment" value="Laptop" /> Laptop<br /> <input type="checkbox" name="equipment" value="Carrying Case" /> Carrying Case<br /> <input type="checkbox" name="equipment" value="Mouse" /> Mouse<br /> <input type="checkbox" name="equipment" value="Hotspot" /> HotSpot/MiFi/Portable WiFi Device<br /> <input type="checkbox" name="equipment" value="usb" /> USB Thumb Drive<br /> <input type="checkbox" name="equipment" value="Vodka" /> Vodka<br /> <br> <br> </td> </tr> <tr> <td valign="top"> <b>Laptop Features Required:</b><br> (Any items not checked cannot be guaranteed on laptop) </td> <td valign="top"> <input type="checkbox" name="features[]" value="cd" /> CD Drive<br /> <input type="checkbox" name="features[]" value="dvd" /> DVD Drive<br /> <input type="checkbox" name="features[]" value="vpn" /> VPN Connection<br /> <input type="checkbox" name="features[]" value="netilla" /> Netilla<br /> <input type="checkbox" name="features[]" value="media" /> Media Playback (video files)<br> (Please include extension/format of video/audio files in COMMENTS section.)<br /> <input type="checkbox" name="features[]" value="vmware" /> VMWare<br /> <br> <br> </td> </tr> <tr> <td valign="top"> <label for="comments"><b>Additional Comments:</b></label> </td> <td valign="top"> <textarea name="comments" maxlength="1000" cols="25" rows="6"></textarea> </td> </tr> <br> <br> <tr> <td colspan="2" style="text-align:center"> <input type="submit" value="Submit"> </td> </tr> </table> </form> <br> <br> <center><img src='logo.jpg'> <br> Copyright 2015 Tucker Arensberg IT Department</center> PSP: <?php if(isset($_POST['email'])) { // EDIT THE 2 LINES BELOW AS REQUIRED $email_to = "blank@blank.com"; $email_subject = "New Equipment Checkout Request"; $first_name = $_POST['first_name']; // required $last_name = $_POST['last_name']; // required $email_from = $_POST['email']; // required $daterequest = $_POST['daterequest']; // not required $datereturn = $_POST['datereturn']; $usage = $_POST['usage']; $features .= implode(', ', $_POST['features']); $comments = $_POST['comments']; // required $comments = $_POST['comments']; // required $email_message = "Form details below.\n\n"; function clean_string($string) { $bad = array("content-type","bcc:","to:","cc:","href"); return str_replace($bad,"",$string); } $email_message .= "First Name: ".clean_string($first_name)."\n"; $email_message .= "Last Name: ".clean_string($last_name)."\n"; $email_message .= "Email: ".clean_string($email_from)."\n"; $email_message .= "Date Requested: ".clean_string($daterequest)."\n"; $email_message .= "Estimated Return Date: ".clean_string($datereturn)."\n"; $email_message .= "Usage: ".clean_string($usage)."\n"; $email_message .= "Features Requested: ".clean_string($features)."\n"; // $email_message .= "Estimated Return Date: ".clean_string($datereturn)."\n"; // $email_message .= "Comments: ".clean_string($comments)."\n"; // create email headers $headers = 'From: '."requests@tuckerlaw.com"."\r\n". 'Reply-To: '.$email_from."\r\n" . 'X-Mailer: PHP/' . phpversion(); @mail($email_to, $email_subject, $email_message, $headers); ?> <!-- include your own success html here --> Thank you for contacting us. We will be in touch with you very soon. <?php } ?> Of note, when I comment out the assignment and email-print for the "$features" variable, it runs without emailing the checkboxes, and gives the proper "confirmation" page. Thanks!
-
Improving efficiency on a time-consuming Cron job
RealityRipple posted a topic in Application Design
I run a service via a shared host provided by 1and1, which, if a user subscribes for it, stores their login information for a website and regularly grabs some information from a page on the site, parses it, and stores the data on my site. The user later downloads the data through a client program running on their computer. This is all for tracking bandwidth usage on Satellite Internet, which has very rigorous limits. The issue I'm running into is that this cron job running every 15 minutes is slowing down now that I have a handful of clients, and is starting to pop ISE 500's on my website every fifteen minutes past the hour for two or three minutes. Each client potentially has to load a different address, parse a different style layout of data, and the rest of it, basically as an individual script. However, I tried to simplify matters by making a single script which then exec's the client script with the required parameters in a loop. (One strange thing I noticed was my webhost doesn't allow this kind of exec "splitting" on client-requested pages, but it works fine within Cron jobs or when run from SSH. However, since the loop of the main script waits for each exec to complete before the next starts anyway, I don't see why they label it splitting anyway, but that's shared hosting for you.) Anyway, I would like to know what the best method for doing this sort of loading of pages (there's HTTPS, POSTs and GETs involved regardless of the address) and saving of data in an efficient method through PHP scripts called by a cron job. Is there a way to actually split these calls into threads so they don't wait, and hopefully execute simultaneously so as not to interfere with the site's normal operations? Do I need to talk to 1and1? Should I be using some other looping methodology?