Jump to content

Jeniveve

Members
  • Posts

    16
  • Joined

  • Last visited

Profile Information

  • Gender
    Not Telling

Jeniveve's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Hello, I work for a non-profit agency and I have been up all night trying to fix a registration form that has suddenly stopped working after a php upgrade from v 5.0 to v 5.2. The server admin says it is my coding. When you hit submit the form actually does what it is supposed to however the missing link here is that I am not being emailed after each registration with the registraiton informationl. You can see the form in action at www.nctt.net/coreTest.php I have also cut and pasted the contents of that file below and have attached it to this email. There is also the last version of the form I used still up on the website that I never took down after our summer program. There are a few modifications to this page to meet the program requirements but in July www.nctt.net/SIReg.php was working fine. Any assitance, hints, suggestions, anything at all is welcome and I thnk you in advance for taking a loot. Jennifer <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>NCTT Registration Form</title> <style type="text/css"> body { margin: 10px padding: 0; font-size: 100%; } * { } h1.register { text-align: center; padding: 18px; background: #cc0033; color: #ffffff; font: 160% Arial, Helvetica, sans-serif; font-weight: bold; text-transform: uppercase; } h1.costs { margin: 10px 0 0 0; padding: 0; border-bottom: 5px solid #cccccc; font: 320% Arial, Helvetica, sans-serif; color: #0071b7; font-weight: bold; text-transform: uppercase; line-height: 1.5em; text-align: left; } h1.title { margin: 10px 0 0 0; padding: 0; border-bottom: 5px solid #cccccc; font: 180% Arial, Arial, Helvetica, sans-serif; color:#0071b7; font-weight: bold; text-transform: uppercase; line-height: 1.5em; text-align: left; } h1.regbox { color: #cc0033; font: 200% Trebuchet Ms, Arial; letter-spacing: -1px; margin: 0; padding: 0; text-align: center; } h1.side { letter-spacing: -1px; text-align: center; font: 140% Arial, Helvetica, sans-serif; font-weight: bold; color: #ffffff; padding: 0; margin: 0; } h2 { text-align: left; margin: 0; padding: 0; line-height: 1.8em; color: #cc0033; font-size: 170%; font-family: trebuchet ms; } h2.regbox { color: #0071b7; font: 140% Trebuchet Ms, Arial; letter-spacing: -1px; font-weight: bold; margin: 5px 0 0 0; padding: 0; text-align: center; } h2.enroll { color: #0071b7; font: 120% Trebuchet Ms, Arial; font-weight: bold; text-align: left; border-bottom: 3px solid #cccccc; margin: 15px 0 0 0;} h3 { margin: 0; padding: 0; line-height: 1.8em; color: #cc0033; font-size: 110%; font-family: trebuchet ms; } h4 { margin: 0; padding: 0; line-height: 1.8em; color: #cc0033; font-size: 90%; font-family: trebuchet ms; } p.normal { text-align: left; font: 75% Arial, Helvetica, sans-serif; line-height: 1.4em; margin: 5px; padding: 0; color: #000000; } .prices { border-bottom: 1px solid #ccc; color: #cc0033; line-height: 2em; font: 80% Arial, Helvetica, sans-serif; margin: 0; padding: 5px; } p.special { text-align: left; padding: 10px; margin: 5px 0 5px 0; background-color: #efefef; border: 1px solid #0071b7; font: 80% Arial, Helvetica, sans-serif; line-height: 1.5em; } p.normal1 { text-align: center; font: 75% Arial, Helvetica, sans-serif; line-height: 1.4em; margin: 5px; padding: 0; color: #000000; } span.price { border-bottom: 1px solid #ccc; color: #0071b7; line-height: 2em; font: 80% Arial, Helvetica, sans-serif; margin: 0; padding: 5px; } td.reg { background: #0071b7; border-bottom: 5px solid #0071b7; color: #ffffff; font-family: Arial, Helvetica, sans-serif; font-size: 150%; font-weight: bold; text-transform: uppercase; letter-spacing: -1px; } td.reg-line { border-bottom: 5px solid #0071b7; } td.title { font: 100% Arial, Helvetica, sans-serif; color: #000000; font-weight: bold; } label { font: 100% trebuchet ms, arial; color: #0071b7; font-weight: bold; } input { margin: 0; padding: 5px; } input.sub { padding: 10px; font-family: arial; color: #000033; font-size: 12pt; font-weight: bold; background: #ccc; text-transform: uppercase; } .success { color: #ffffff; background: #0071b7; font-weight: bold; font: 100% arial; border: 1px solid #000; padding: 10px; } .error { color: #fff; background: #FF0000; padding: 10px; border: 1px solid #990000; font: 90% arial; } a:link { text-align: left; font: 125% Arial, Helvetica, sans-serif; line-height: 1.4em; font-weight: bold; padding: 0; color: #cc3333; text-decoration: underline; } a:active {text-align: left; font: 125% Arial, Helvetica, sans-serif; line-height: 1.4em; font-weight: bold; padding: 0; color: #ff9933; text-decoration: none; } a:visited {text-align: left; font: 125% Arial, Helvetica, sans-serif; line-height: 1.4em; font-weight: bold; padding: 0; color: #009933; text-decoration: underline; } a:hover {text-align: left; font: 125% Arial, Helvetica, sans-serif; line-height: 1.4em; font-weight: bold; padding: 0; color: #0099ff; text-decoration: none;} p.check {text-align: left; font: 110% Arial, Helvetica, sans-serif; line-height: 1.4em; font-weight: bolder; padding: 0; color: #cc0033; } </style> </head> <body> <center> <? if($_POST['submit']) { $first = $_POST['first_name']; $last = $_POST['last_name']; $middle = $_POST['middle_name']; $dob = $_POST['dob']; $module_1 = $_POST['module_1']; /*$module_2 = $_POST['module_2'];*/ $province = $_POST['province']; $address_1 = $_POST['address_1']; $address_2 = $_POST['address_2']; $city = $_POST['city']; $state = $_POST['state']; $zip = $_POST['zip']; $school = $_POST['school']; $country = $_POST['country']; $taught = $_POST['taught']; $grade = $_POST['grade']; $home = $_POST['home']; $work = $_POST['work']; $email = $_POST['email']; if(!empty($first) && !empty($last) && !empty($address_1) && !empty($city) && !empty($state) && !empty($zip) && !empty($home) && !empty($email)) { if($module_1) { $cost = $cost+195; $add_email .= "<li>December 5, 2014: YES ($195)</li>"; } /* if($module_2) { $cost = $cost+1075; $add_email .= "<li>Week II: YES ($1075)</li>"; } if(date("n") <= 15) { $before = $cost*.05; $before = round($before,2); $cost = $cost-$before; } */ $msg .= "<body style=\"font-family: arial; font-size: 10pt; line-height: 1.5em;\">"; $msg .= "<p>These are the registration details submitted from the website.</p>"; $msg .= "<ul>"; $msg .= $add_email; $msg .= "<li><strong>Name:</strong> " . $first . " " . $middle . " " . $last . "</li>"; $msg .= "<li><strong>Address One:</strong> " . $address_1 . "</li>"; $msg .= "<li><strong>Address Two:</strong> " . $address_2 . "</li>"; $msg .= "<li><strong>City:</strong> " . $city . "</li>"; $msg .= "<li><strong>State:</strong> " . $state . "</li>"; $msg .= "<li><strong>Zipcode:</strong> " . $zip . "</li>"; $msg .= "<li><strong>Province:</strong> " . $province . "</li>"; $msg .= "<li><strong>Country:</strong> " . $country . "</li>"; $msg .= "<li><strong>School:</strong> " . $school . "</li>"; $msg .= "<li><strong>Grade Taught:</strong> " . $grade . "</li>"; $msg .= "<li><strong>Field/Subject Taught:</strong> " . $taught . "</li>"; $msg .= "<li><strong>Home Phone:</strong> " . $home . "</li>"; $msg .= "<li><strong>Work Phone:</strong> " . $work . "</li>"; $msg .= "<li><strong>Email:</strong> " . $email . "</li>"; $msg .= "</ul>"; $msg .= "<p>Total Cost: $" . $cost . "</p>"; /* if($before) { $msg .= "<p>This was sent before April 15, 2013, so 5% has been taken off the total.</p>"; }*/ $msg .= "</body>"; $headers = 'MIME-Version: 1.0' . "\r\n"; $headers .= 'Content-type: text/html; charset=UTF-8' . "\r\n"; $headers .= 'From: donotreply@nctt.net'; $to = "info@nctt.net"; $subject = "Registration Form | " . $first . " " . $middle . " " . $last; mail($to,$subject,$msg,$headers); ?> <div class="success"> We have successfully sent your registration details to NCTT. Please click on "Add to Cart" below, and checkout with Paypal to complete your resgistration. <strong>Space will not be held for registration without payment unless you have contacted the office at 417-773-1654 and spoken to Jennifer to make special arrangements.</strong> <br /> <form target="paypal" action="https://www.paypal.com/cgi-bin/webscr" method="post"> <input type="hidden" name="cmd" value="_cart"> <input type="hidden" name="business" value="info@nctt.net"> <input name="item_name" type="hidden" class="title" value="Registration: Critical Thinking, Reading, Writing and the Common Core "> <input type="hidden" name="amount" value="<? echo $cost; ?>"> <input type="hidden" name="no_note" value="1"> <input type="hidden" name="currency_code" value="USD"> <input type="hidden" name="no_shipping" value="1" /> <input type="hidden" name="on0" value="name"> <input type="hidden" name="os0" maxlength="60" value="<? echo $first . " " . $middle . " " . $last; ?>"> <input type="image" src="https://www.paypal.com/en_US/i/btn/x-click-but22.gif" border="0" name="submit" alt="Make payments with PayPal - it's fast, free and secure!"> <input type="hidden" name="add" value="1"> </form><!--<form target="paypal" action="https://www.paypal.com/cgi-bin/webscr" method="post"> <input type="hidden" name="cmd" value="_cart"> <input type="hidden" name="business" value="info@nctt.net"> <input type="image" src="https://www.paypal.com/en_US/i/btn/btn_viewcart_LG.gif" border="0" name="submit" alt="Make payments with PayPal - it's fast, free and secure!"> <input type="hidden" name="display" value="1"> </form>--> </div> <? } else { echo "<div class=\"error\">Sorry, please fill out all of the required fields.</div>"; } } else { ?> <form action="core.php" method="post"> <table border="0" cellpadding="5" cellspacing="0" width="80%"> <tr> <td colspan=3><h1 class="costs"><div align="center">REGISTER ONLINE</div></h1></td> </tr> <tr> <td width=10%></td> <td width="90%" valign="top"> <table border=0 cellpadding=3 cellspacing=0 width="100%"> <tr> <td class="prices" align="left"><a href="core.htm">Critical Thinking, Reading, Writing and the Common Core</a> <br /><p>December 5, 2014</p></td> <td width="30%" align="right" class="prices"><p style="font-weight:bold; color:#cc3300; font-size:14px;">$195.00</p></td> </tr> </table> </td> <td width=20%></td> </tr> </table> <table border="0" cellpadding="5" cellspacing="0" width="80%"> <tr> <td width="50%" align="center" class="reg">Registration</td> </tr> </table> <table border="0" cellpadding="5" cellspacing="0" width="80%"> <tr> <td width=17%></td> <td width="66%" valign="top"> <div align="center"><h1 class="title">Critical Thinking, Reading, Writing and the Common Core</h1></div> <p class="check">You <i>must check</i> the box below for your registration to be valid. Thank you.</p> <input type="checkbox" name="module_1" value="1" /> <label for="module_1">Critical Thinking, Reading, Writing and the Common Core</label> <!--<table border="0" cellpadding="3" cellspacing="1" width="100%"> <tr> <td width="25%" valign="top"> <p style="font-weight:bold; font-size:14px; color:#cc3300;">December 6, 2013 $150.00</p> </td> <td width="25%"></td> </tr> <tr> <td width="25%"><input type="checkbox" name="module_1" value="1" /> <label for="module_1">Critical Thinking, Reading, Writing and the Common Core</label></td> <td></td> </tr> <tr> <td width="25%" valign="top"> <h4>Week II ($1075.00)</h4> </td> <td width="25%"></td> </tr> <tr> <td width="25%"><input type="checkbox" name="module_2" value="1" /> <label for="module_2">Summer Institute Week II</label></td> <td></td> </tr> </table>--> <hr size=1 width=100% noshade /> <table border="0" cellpadding="2" cellspacing="0" width="100%"> <tr> <td width="33%" align="center"><input type="text" name="first_name" size="30" /></td> <td width="33%" align="center"><input type="text" name="middle_name" size="30" /></td> <td width="33%" align="center"><input type="text" name="last_name" size="30" /></td> </tr> <tr> <td width="33%" align="center"><p class="normal1">First Name</p></td> <td width="33%" align="center"><p class="normal1">Middle Initial</p></td> <td width="33%" align="center"><p class="normal1">Last Name</p></td> </tr> </table> <table border="0" cellpadding="5" cellspacing="0" width="100%"> <tr> <td><p class="normal">Address 1</p></td> <td colspan="3" align="left"><input type="text" name="address_1" size="94" /></td> </tr> <tr> <td><p class="normal">Address 2</p></td> <td colspan="3" align="left"><input type="text" name="address_2" size="94" /></td> </tr> <tr> <td><p class="normal">City</p></td> <td align="left"><input type="text" name="city" size="20" /></td> <td><p class="normal">State</p></td> <td align="left"><input type="text" name="state" size="20" /></td> </tr> <tr> <td><p class="normal">Zip</p></td> <td align="left"><input type="text" name="zip" size="20" /></td> <td><p class="normal">Province</p></td> <td><input type="text" name="province" size="20" /></td> </tr> <tr> <td><p class="normal">School/College</p></td> <td align="left"><input type="text" name="school" size="56" /></td> <td><p class="normal">Country</p></td> <td><input type="text" name="country" size="20" /></td> </tr> <tr> <td><p class="normal">Field/Subject Taught</p></td> <td align="left"><input type="text" name="taught" size="56" /></td> <td><p class="normal">Grade</p></td> <td><input type="text" name="grade" size="20" /></td> </tr> <tr> <td><p class="normal">Telephone (H)</p></td> <td align="left"><input type="text" name="home" size="20" /></td> <td><p class="normal">(W)</p></td> <td><input type="text" name="work" size="20" /></td> </tr> <tr> <td><p class="normal">Email Address</p></td> <td colspan="3"><input type="text" name="email" size="94" /></td> </tr> <tr> <td colspan=4 align=center><input type="submit" name="submit" value="Submit Form" class="sub" /></td> </tr> </table> <td width=17%></td> </td> </tr> </table> </form> <? } ?> </center> </body> </html> coreTest.php SIReg.php
  2. would you mind if I only sent it to you so I don't advertise it all over the site, I don't know if that is OK or not, I am NOT a regular user, can I post the entire file here in public?
  3. I asked this once b4 and the answer seemed to work but now the discount is being caclulated again...I wanted the discount to stop after April 15...The below code doesn't work, can someone help??? } if(date("j") < 14) { $before = $cost*.05; $before = round($before,2); $cost = $cost-$before; } Thank you in advance for ANY help that can be provided. Jennifer
  4. Thank you so very much!!! And I appreciate the link so I can learn more! Jennifer
  5. Hi, I am trying to figure out how to stop my script from offering a discount when the date that is listed passes by. It seems to always 'reset' itself even after the 15th of the month...I want it to stop after April 15...This is what I had, can anyone assist? Thank you in advance for your help! Jennifer } if(date("n") < 15) { $before = $cost*.05; $before = round($before,2); $cost = $cost-$before; }
  6. OK, so call me stupid if you want to but I have read the forum information on making sure you list a post as solved and it says people are supposed to be able to use the link at the bottom of the post to do so but I cannot find any link or choice, even in additional options to mark a post I have started as solved. Could someone assist me in figuring out how to do this please. Thank you, Jennifer
  7. Nope, not interested in spamming phpfreaks just to be able to send messages hehehe. Thanks for the information I appreciate it! Jennifer
  8. OK, thank you very much. May I ask, is that level of trust only defined by the user or is it related to how long you have been a member and how many posts you have made? Jen
  9. When someone's email address is hidden on this site does that mean there is no way to send a message to this person or contact them unless they respond to a post and happen to read the reply? Or, is there some way to send a site 'private message' or contact them through the site in some way? Thank you, Jennifer
  10. Thanks for the comment Emma however, every if elseif else statement I have ever written reads like this: if { echo.. } elseif (conditional statement) { echo.. } elseif (conditional) { } else { I looked over my code and I can't seem to find any missing brackets, can you be more specific as to exactly where you think the missing ones should go? Thank you, Jen
  11. I have created a simple browser and platform detect script that a few people here helped me with a couple days ago. Everything was working great until I tried to add a preg_match statement to detect a safari browser on a mac. For some reason, no matter what string I use from the http_user_agent information for safari, I cannot get the script to detect safari on a mac... Could someone assist me with this one statement? The entire script is below but the line of code that will not work is as follows: /* Check for Safari on Macintosh: I also tried Gecko given phpinfo returned this value for http_user_agent, Mozilla/5.0 (Macintosh; U; Intel Mac OS X; en) AppleWebKit/419 (KHTML, like Gecko) Safari/419.3 */ } elseif (preg_match('/Safari(?:.*)Macintosh/i', $_SERVER['HTTP_USER_AGENT'])) { echo '<link rel="stylesheet" type="text/css" href="macsaf_styles.css" />'; The entire script looks like this: <?php /* First check for IE on Win */ if (preg_match('/MSIE(?:.*)Win/i', $_SERVER['HTTP_USER_AGENT'])) { echo '<link rel="stylesheet" type="text/css" href="win_styles.css" />'; /* Check for Safari on Macintosh: I also tried Gecko given phpinfo returned this value for http_user_agent, Mozilla/5.0 (Macintosh; U; Intel Mac OS X; en) AppleWebKit/419 (KHTML, like Gecko) Safari/419.3 */ } elseif (preg_match('/Safari(?:.*)Macintosh/i', $_SERVER['HTTP_USER_AGENT'])) { echo '<link rel="stylesheet" type="text/css" href="macsaf_styles.css" />'; /* Then check for Firefox on Macintosh */ } elseif (preg_match('/Mozilla(?:.*)Macintosh/i', $_SERVER['HTTP_USER_AGENT'])) { echo '<link rel="stylesheet" type="text/css" href="macfire_styles.css" />'; /* Then direct everything else to the default page... */ }else{ echo '<link rel="stylesheet" type="text/css" href="styles.css" />'; } ?> Any assistance with this would be extremely helpful. Thank you in advance! Jennifer
  12. Thanks to the two people who answered my questions, I appreciate it a lot! To Prozente: your examples helped me a lot, thank you very much. I am playing with the conditional comments as well. I do have one question however, it's about dropping the elseif, I have to add 2 more different conditions that have to be matched...I also need to look for and separate out Safari for the Mac and FF for the Mac... I thought that I *had* to use elseif when I am listing more than one condition.. Is this correct? Or, could I just keep writing else statements until all matches are found? To boo_lolly thank you for the hudzilla page but it is not doing what I need specifically and doesn't really address the issue I am trying to deal with, which has to do with how to list 2 expressions and match them to one string when the string is a global variable... Also the php.net page manual, I have read that, especially the page you refer to hwoever I find it incredibly hard to understand their writing and that is why I posted my question here. However, thank you for your input, I appreciate it. Jennifer
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.