Jump to content

deansatch

Members
  • Posts

    300
  • Joined

  • Last visited

Everything posted by deansatch

  1. You don't refresh the page 3 times by any chance? Can we see the whole page?
  2. Any chance of a sticky or notice at the top of the page informing posters to include the dodgy code when they post?
  3. not without seeing the code first
  4. Do you mean as in this? WHERE user_submitte != '$_SESSION[username]'
  5. $results = mysql_query("SELECT * FROM submittedresults where home_user = '".$_SESSION[username]."' or away_user = '".$_SESSION[username]."'"); *EDIT: removed a space. oops!
  6. Assuiming date is a time() timestamp format $thirty_days_ago = mktime(0,0,0,date("m"),date("d")-30,date("Y")); $query = "SELECT * FROM applicant WHERE AppliedDate >= $thirty_days_ago ORDER BY AppliedDate DESC";
  7. I notice directory is "uploads" and you have "upload" in your code
  8. In fact, here is your original code how it should work: your page: <?php //This function can go here or, if this only a portion of the page, you can put it right at the top before your doctype function isEmail($email) { // Email address verification, do not edit. return(preg_match("/^[-_.[:alnum:]]+@((([[:alnum:]]|[[:alnum:]][[:alnum:]-]*[[:alnum:]])\.)+(ad|ae|aero|af|ag|ai|al|am|an|ao|aq|ar|arpa|as|at|au|aw|az|ba|bb|bd|be|bf|bg|bh|bi|biz|bj|bm|bn|bo|br|bs|bt|bv|bw|by|bz|ca|cc|cd|cf|cg|ch|ci|ck|cl|cm|cn|co|com|coop|cr|cs|cu|cv|cx|cy|cz|de|dj|dk|dm|do|dz|ec|edu|ee|eg|eh|er|es|et|eu|fi|fj|fk|fm|fo|fr|ga|gb|gd|ge|gf|gh|gi|gl|gm|gn|gov|gp|gq|gr|gs|gt|gu|gw|gy|hk|hm|hn|hr|ht|hu|id|ie|il|in|info|int|io|iq|ir|is|it|jm|jo|jp|ke|kg|kh|ki|km|kn|kp|kr|kw|ky|kz|la|lb|lc|li|lk|lr|ls|lt|lu|lv|ly|ma|mc|md|mg|mh|mil|mk|ml|mm|mn|mo|mp|mq|mr|ms|mt|mu|museum|mv|mw|mx|my|mz|na|name|nc|ne|net|nf|ng|ni|nl|no|np|nr|nt|nu|nz|om|org|pa|pe|pf|pg|ph|pk|pl|pm|pn|pr|pro|ps|pt|pw|py|qa|re|ro|ru|rw|sa|sb|sc|sd|se|sg|sh|si|sj|sk|sl|sm|sn|so|sr|st|su|sv|sy|sz|tc|td|tf|tg|th|tj|tk|tm|tn|to|tp|tr|tt|tv|tw|tz|ua|ug|uk|um|us|uy|uz|va|vc|ve|vg|vi|vn|vu|wf|ws|ye|yt|yu|za|zm|zw)$|(([0-9][0-9]?|[0-1][0-9][0-9]|[2][0-4][0-9]|[2][5][0-5])\.){3}([0-9][0-9]?|[0-1][0-9][0-9]|[2][0-4][0-9]|[2][5][0-5]))$/i",$email)); } ?> <!--******* Left Column *******--> <div id="left_col"> <!--******* Logo *******--> <div id="logo"> <a href="http://www.tktest.co.uk/branston/index.php" target="_self" title="The Branston Golf & Country Club">The Branston Golf & Country Club</a> </div> <!--******* END - Logo - END *******--> <!--******* Left Container *******--> <div id="leftcontainer"> <!--******* Promotions *******--> <div id="promotions"> <a href="http://www.tktest.co.uk/branston/promotions.php" target="_self" title="PROMOTIONS">PROMOTIONS</a> </div> <div id="slidePanel"> <div id="slideHeader">SIGN UP TO PROMO UPDATES</div> <div id="slideBody" style="display: <?php echo $displayStatus; ?>;"></div> </div> <!--******* END - Promotions - END *******--> <!--******* Book a Tour *******--> <div id="slidePanel2"> <div id="slideHeader2">BOOK <strong>A TOUR</strong></div> <div id="slideBody2" style="display: <?php echo $displayStatus2; ?>;"><?php include('booking.php'); ?></div> </div> <!--******* END - Book a Tour - END *******--> <div id="bgcol"> <div id="contactbg"></div> <!--******* Contact Us *******--> <div id="slidePanel3"> <div id="slideHeader3"><strong>CONTACT</strong>US</div> <div id="slideBody3" style="display: <?php echo $displayStatus3; ?>;"></div> </div> <div id="maplink"><a href="directions_and_location.php" title="FIND US ON THE MAP">FIND US ON THE MAP</a></div> <div id="contact"> <p><strong>The Branston Golf<br /> & Country Club</strong><br /> Branston<br /> Burton on Trent<br /> Staffordshire<br /> DE14 3DP<br /> <br /> <strong>Tel: 01283 512211</strong></p> </div> </div> <!--******* END - Contact Us - END *******--> </div> <!--******* END - Left Container - END *******--> </div> <!--******* END - Left Column - END *******--> booking.php <div id="contact1"> <?php // Attention! Please read the following. // It is important you do not edit pieces of code that aren't tagged as a configurable options identified by the following: // Configuration option. // Each option that is easily editable has a modified example given. $error = ''; $email = ''; $phone = ''; $interest = ''; $month = ''; $day = ''; $time = ''; $people = ''; if(isset($_POST['contact'])) { $email = $_POST['email']; $phone = $_POST['phone']; $interest = $_POST['interest']; $month = $_POST['month']; $day = $_POST['day']; $time = $_POST['time']; $people = $_POST['people']; if(trim($email) == 'Email address') { $error = '<div class="error_message">Attention! Please enter a valid email address.</div>'; } else if(!is_numeric($phone)) { $error = '<div class="error_message">Attention! Phone number can only contain digits.</div>'; } else if(!isEmail($email)) { $error = '<div class="error_message">Attention! You have enter an invalid e-mail address, try again.</div>'; } if(trim($interest) == '') { $error = '<div class="error_message">Attention! Please select area of interest.</div>'; } else if(trim($month) == '') { $error = '<div class="error_message">Attention! Please select a month.</div>'; } else if(trim($day) == '') { $error = '<div class="error_message">Attention! Please select a day.</div>'; } else if(trim($time) == '') { $error = '<div class="error_message">Attention! Please select a time.</div>'; } if($error == '') { if(get_magic_quotes_gpc()) { $comments = stripslashes($comments); } // Configuration option. // Enter the email address that you want to emails to be sent to. // Example $address = "joe.doe@yourdomain.com"; $address = "craig@tolputtkeeton.co.uk"; // Configuration option. // i.e. The standard subject will appear as, "You've been contacted by John Doe." // Example, $e_subject = '$name . ' has contacted you via Your Website.'; $e_subject = 'You have a Tour booking for ' . $interest . '.'; // Configuration option. // You can change this if you feel that you need to. // Developers, you may wish to add more fields to the form, in which case you must be sure to add them here. $e_body = "You have a Tour booking for $interest, and they wish to come on a $day in $month at $time.\r\n\n"; $e_content = "Number of people in their party is $people.\r\n\n"; // Configuration option. // RIf you active phone number, swap the tags of $e-reply below to include phone number. //$e_reply = "You can contact $name via email, $email or via phone $phone"; $e_reply = "You can contact them via email, $email"; $msg = $e_body . $e_content . $e_reply; mail($address, $e_subject, $msg, "From: $email\r\nReply-To: $email\r\nReturn-Path: $email\r\n"); // Email has sent successfully, echo a success page. echo "<div id='succsess_page'>"; echo "<h1>Email Sent Successfully.</h1>"; echo "<p align='center'>Thank you <strong>$name</strong>, your message has been submitted to us.</p>"; echo "</div>"; } } if(!isset($_POST['contact']) || $error != '') // Do not edit. { ?> <?php echo $error; ?> <form method="post" action=""> <select name="month" type="text" id="month" class="month"> <option value="January 2010">January 2010</option> <option value="February 2010">February 2010</option> <option value="March 2010">March 2010</option> <option value="April 2010">April 2010</option> <option value="May 2010">May 2010</option> <option value="June 2010">June 2010</option> <option value="July 2010">July 2010</option> <option value="August 2010">August 2010</option> <option value="October 2010">September 2010</option> <option value="Support">October 2010</option> <option value="November 2010">November 2010</option> <option value="December 2010">December 2010</option> </select> <br /> <select name="day" type="text" id="day" class="day"> <option value="Monday">Monday</option> <option value="Tuesday">Tuesday</option> <option value="Wednesday">Wednesday</option> <option value="Thursday">Thursday</option> <option value="Friday">Friday</option> <option value="Saturday">Saturday</option> <option value="Sunday">Sunday</option> </select> <select name="time" type="text" id="time" class="time"> <option value="9.00am">9.00am</option> <option value="10.00am">10.00am</option> <option value="11.00am">11.00am</option> <option value="12.00am">12.00am</option> <option value="1.00pm">1.00pm</option> <option value="2.00pm">2.00pm</option> <option value="3.00pm">3.00pm</option> <option value="4.00pm">4.00pm</option> <option value="5.00pm">5.00pm</option> <option value="6.00pm">6.00pm</option> <option value="7.00pm">7.00pm</option> <option value="8.00pm">8.00pm</option> <option value="9.00pm">9.00pm</option> </select> <br /> <select name="people" type="text" id="people" class="people"> <option value="1">1</option> <option value="2">2</option> <option value="3">3</option> <option value="4">4</option> <option value="5">5</option> <option value="6">6</option> <option value="7">7</option> <option value="8">8</option> <option value="9">9</option> <option value="10">10</option> </select><label>Number of people</label> <br /><br /> <label>Please select area of interest</label> <select name="interest" type="text" id="interest" class="interest"> <option value="The Club">The Club</option> <option value="Health & Fitness">Health & Fitness</option> <option value="Golf">Golf</option> <option value="Events">Events</option> <option value="Business">Business</option> <option value="Weddings">Weddings</option> </select> <br /> <input name="email" type="text" id="email" value="Email address" onfocus="if (this.value == this.defaultValue) {this.value='';}" onblur="if (this.value == '') {this.value = this.defaultValue;}" class="email"> <br /> <input name="phone" type="text" id="phone" value="Tel number" onfocus="if (this.value == this.defaultValue) {this.value='';}" onblur="if (this.value == '') {this.value = this.defaultValue;}" class="tel"> <br /> <input name="contact" type="submit" class="submit" id="contact" value="send" /> </form> <?php } ?> </div>
  9. OK Where you took this part out: <?php } //<------put this bracket back in here //take this part and either stick it at the top of the main file that contains all the includes //or put in in a new functions.php file and include functions.php at the top of your main file. //Make sure you also remove this part from all the other form files that you are including, so that it is only run once. function isEmail($email) { // Email address verification, do not edit. return(preg_match("/^[-_.[:alnum:]]+@((([[:alnum:]]|[[:alnum:]][[:alnum:]-]*[[:alnum:]])\.)+(ad|ae|aero|af|ag|ai|al|am|an|ao|aq|ar|arpa|as|at|au|aw|az|ba|bb|bd|be|bf|bg|bh|bi|biz|bj|bm|bn|bo|br|bs|bt|bv|bw|by|bz|ca|cc|cd|cf|cg|ch|ci|ck|cl|cm|cn|co|com|coop|cr|cs|cu|cv|cx|cy|cz|de|dj|dk|dm|do|dz|ec|edu|ee|eg|eh|er|es|et|eu|fi|fj|fk|fm|fo|fr|ga|gb|gd|ge|gf|gh|gi|gl|gm|gn|gov|gp|gq|gr|gs|gt|gu|gw|gy|hk|hm|hn|hr|ht|hu|id|ie|il|in|info|int|io|iq|ir|is|it|jm|jo|jp|ke|kg|kh|ki|km|kn|kp|kr|kw|ky|kz|la|lb|lc|li|lk|lr|ls|lt|lu|lv|ly|ma|mc|md|mg|mh|mil|mk|ml|mm|mn|mo|mp|mq|mr|ms|mt|mu|museum|mv|mw|mx|my|mz|na|name|nc|ne|net|nf|ng|ni|nl|no|np|nr|nt|nu|nz|om|org|pa|pe|pf|pg|ph|pk|pl|pm|pn|pr|pro|ps|pt|pw|py|qa|re|ro|ru|rw|sa|sb|sc|sd|se|sg|sh|si|sj|sk|sl|sm|sn|so|sr|st|su|sv|sy|sz|tc|td|tf|tg|th|tj|tk|tm|tn|to|tp|tr|tt|tv|tw|tz|ua|ug|uk|um|us|uy|uz|va|vc|ve|vg|vi|vn|vu|wf|ws|ye|yt|yu|za|zm|zw)$|(([0-9][0-9]?|[0-1][0-9][0-9]|[2][0-4][0-9]|[2][5][0-5])\.){3}([0-9][0-9]?|[0-1][0-9][0-9]|[2][0-4][0-9]|[2][5][0-5]))$/i",$email)); } ?>
  10. Look at the end of your source code: <b>Fatal error</b>: Cannot redeclare isemail() (previously declared in /home/sites/tktest.co.uk/public_html/branston/signup.php:152) in <b>/home/sites/tktest.co.uk/public_html/branston/booking.php</b> on line <b>191</b><br />
  11. put this at the top of your file <?php ini_set('display_errors',1); error_reporting(E_ALL|E_STRICT); ?>
  12. Did you change them in the include files too? Also, turn on error reporting to find out where the error is
  13. Just thought I'd repost his code in php tags so its easier to read. <textarea name="content" cols="75" rows="20" id="content"> <?php if ($_POST) {$content = stripslashes($_POST['content']);} else {$content = $row['content'];} echo $content; ?> </textarea> I have an error statement like this: <?php if (!empty($_POST)) { if ($_POST['content'] == "") {$error = true; $errmsg = "Content can not be empty";} // end if content } // end if post ?>
  14. Not sure what you mean by brake, but if you mean it stops rendering the page at the first include it might be because you are using short tags with short tags switched off. i.e. use <?php ?> instead of <? ?>
  15. I struggle a bit with classes and OOP but if I understand correctly, you should only build the array with the ones that have a value. Otherwise something like this? <?php if($extraField->value !=''){ ?> <li class="<?php echo ($key%2) ? "odd" : "even"; ?> type<?php echo ucfirst($extraField->type); ?> group<?php echo $extraField->group; ?>"> <span class="itemExtraFieldsValue"><?php echo $extraField->value; ?></span> <span class="itemExtraFieldsLabel"><?php echo $extraField->name; ?>:</span> <br class="clr" /> </li> <?php } ?> Probably wrong but I am still doing old school php
  16. Best trying a css or javascript forum for that one
  17. Does the directory exist? Does it have correct permissions?
  18. what error message do you get? DO you have error reporting on?
  19. Assuming $awardtype is the name of the jpg without the extension: echo "<td><img src=\"images/awards/$awardtype.jpg\" width=\"8\" height=\"18\" /></td>"; OR echo '<td><img src="images/awards/'.$awardtype.'.jpg" width="8" height="18" /></td>';
  20. Try this: $path= $_server['DOCUMENT_ROOT'] . '/test/upload/job_files/';
  21. And maybe you need some backticks on the other variable e.g.`$gigstable` In fact I don't actually see where $gigstable is declared.
  22. Could you elaborate on that please? Also, how long will the cookie survive? What happens when I clear my cookies or my AV software does a cleanup etc...?
  23. and should: "SELECT '$_SESSION[`currentgig`]' FROM $gigstable " not be "SELECT '".$_SESSION['currentgig']."' FROM $gigstable " ??
  24. I notice you don't have your {} for your if statement
×
×
  • 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.