Jump to content

ace2721

Members
  • Posts

    22
  • Joined

  • Last visited

    Never

Contact Methods

  • Website URL
    http://www.thetrainingbuzz.co.uk

Profile Information

  • Gender
    Not Telling

ace2721's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Hi mikosiko thank you so much, that worked straight way thanks again have a great day
  2. Hi mikosiko I gave the first table as I thought it would be easy to explain sorry for the confusion the real table layout is table1 ID Title Course iframe_id table2 ID Start date End date course_id I need a query that say if the i_frame field in table one matches the course_id in table two then the startdate and enddate from table 2 is displayed Now when i try SELECT Start Date AND End Date FROM table2 WHERE table1.iframe_id = table2.course_id I get error 1054 unknown column table1.iframe_id in where clause but this def exists thanks again
  3. would I and could I use the join function for this query
  4. HI HD no the table layouts are the following table one id title course i_frame table two id startdate enddate course_id but I have changed the table names in the query, I just thought it would be easier to explain just to add to this I am running this query in phpadmin first to make sure it works, don't know if you need to know that
  5. HI HD thanks for your help, I have tried your reply but I am getting an error 1054 unknown column table1.title in where clause I have made sure that the tables have all the required fields
  6. Hi Guys I hope everyone is enjoying their day, I am having a few problems, I need help with a query what I need to do is display data from a table if two different fields in two different tables equal the same value. Table one has ID Title Course content table two has ID Title Start date End date I need a query that says if title from table one matches title from table 2 then it will display the start and end date from table two sorry if this is really simple I have tried but I am very new to this and it seems to be taking weeks to try and come up with an answer thanks guys, any help with be much appreciated
  7. Hi Guys I have run the query and this is what I am getting, mysql Column 'title' in on clause is ambiguous
  8. Hi Guys thanks so much for your help I will try it today and let you know how I get on, Thanks
  9. Hi Guys what I need to do is display data from two different tables that equal the same value in a specific field Table one has ID Title Course content table two has ID Title Start date End date I need a query that says if title from table one matches title from table 2 then will display the start and end date from table two sorry if this is really simple I am a newbie thanks inadvance
  10. HI stelthius thanks for your help dude, I am very new to php can you show me where to put the script as I have put it where I thought it should go but its not showing anything on the auto reply now so I am very confused thanks again
  11. Hi guys thanks for your help so far this is what I have below the auto responder is working but I am not getting any of the html, all that I am receiving is MIME-Version: 1.0 Content-type: text/html; charset=iso-8859-1 To: Mary <mary@example.com>, Kelly <kelly@example.com> From: Birthday Reminder <birthday@example.com> Cc: birthdayarchive@example.com Bcc: birthdaycheck@example.com this is a section of code // the email will be sent here $to = "com"; $user_message .= "Name: $f_name \r\n"; $user_message .= "postcode: $postcode \r\n"; $user_message .= "tel: $tel \r\n"; $user_message .= "mobile: $mobile \r\n"; $user_message .= "email: $email \r\n"; $user_message .= "course: $course \r\n"; $headers = "- Enquiry \r\n"; $headers .= "Reply-To: $email"; mail('.com',' Enquiry',$user_message,$headers); $autoreply="Thank you for your enquiry, $f_name."; // message $message = ' <html> <head> <title>5 Ways to get that dream job!</title> </head> <body> <p>Congratulations you have just taken one step closer to gaining your dream job</p> <ol> <li>In an interview situation, you are marketing yourself as a product, so you need to make the best personal impact possible.<a href="www..com/pdfs/Dressing for success.pdf">Click Here</a> to find out how to "Dress for success"</li> <li>Image is important if we want to create a good impression. More importantly, our image has an overall effect on how we feel about ourselves. <a href="www..com/pdfs/Look good, feel good.pdf">Click Here</a> for tips to "Look good feel good"</li> <li>Modern life seems to get increasingly hectic every day. We seem to have more and more tasks to do, either at work or in our personal lives, and less and less time to do them. Find the best methods to "Plan your day" <a href="http://www.com/pdfs/plan your day.pdf">Click here</a></li> <li>Your CV is an essential document needed to present yourself effectively in the job market. "The perfect cv" will considerably boost your chances <a href="www.com/pdfs/The Perfect CV.pdf">Click Here</a> to find out more </li> <li>“Great communication relies on a willingness to communicate whether you are sending or receiving a message. <a href="www./pdfs/top ten tips for communicating successfully.pdf">Click Here</a> for "10 ten tips for communicating "</li> </ol> <p>Most importantly of all .</p> <p>Contact us now to find out more</p> <p>Text</p> <p> </p> <p> </p> </body> </html> '; // To send HTML mail, the Content-type header must be set $headers = 'MIME-Version: 1.0' . "\r\n"; $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n"; // Additional headers $headers .= 'To: Mary <mary@example.com>, Kelly <kelly@example.com>' . "\r\n"; $headers .= 'From: Birthday Reminder <birthday@example.com>' . "\r\n"; $headers .= 'Cc: birthdayarchive@example.com' . "\r\n"; $headers .= 'Bcc: birthdaycheck@example.com' . "\r\n"; $subject="Thank you for Enquiring $name! "; mail($email, $subject, $headers, $autoreply); ?> </span> <div align="center" class="boldenquire style5">Well done! you have just taken the first step in securing that dream job. Please check your email now to get you started</div> <?php } } mysql_close(); if(!isset($_POST['send']) || $errmsg != '') { ?> <div align="center" class="ermsg"><?=$errmsg;?></div> <form method="post" name="msgform" id="msgform"> <table border="0" align="center" cellpadding="2" cellspacing="1" class="maincell"> <tr> <td align="center" class="boldenquire2" colspan="2">Fill in the form </tr> <tr> <td align="left">Your Name:</td> <td align="left"><input name="f_name" type="text" class="eqform" style="width:100px" value="<?=$f_name;?>" /></td> </tr> <tr> <td align="left">Nearest centre:</td> <td align="left"><label> <select name="postcode" size="1" class="eqform" style="width:100px" value=" <?=$postcode;?>"> <option value="Gravesend">Gravesend</option> <option value="Maidstone">Maidstone</option> <option value="Bromley">Bromley</option> <option value="Chatham">Chatham</option> <option value="Croydon">Croydon</option> <option value="Dartford">Dartford</option> <option value="Tunbridge Wells">Tunbridge Wells</option> </select> </label></td> </tr> <tr> <td align="left">Address:</td> <td><label> <textarea name="textarea" rows="5" class="eqform" id="textarea"></textarea> </label></td> </tr> <tr> <td align="left">Tel:</td> <td align="left"><input name="tel" type="text" class="eqform" style="width:100px" value="<?=$tel;?>" /></td> </tr> <tr> <td align="left">Mobile:</td> <td align="left"><input name="mobile" type="text" class="eqform" style="width:100px" value="<?=$mobile;?>" /></td> </tr> <tr> <td align="left">Email:</td> <td align="left"><input name="email" type="text" class="eqform" style="width:100px" value="<?=$email;?>" /></td> </tr> <tr> <td align="left"><span class="req">What is your ideal job:</span></td> <td align="left"><input name="course" type="text" class="eqform" style="width:100px" value="<?=$course;?>" size="40" /></td> </tr> <tr align="center"> <td colspan="2" class="boldenquire2"><input name="send" type="submit" class="eqbox" onClick="return checkForm();" value="Click Here" /> <br /> <span class="boldenquire2">For 5 ways to get that dream job</span></td> </tr> <tr align="left"> <td colspan="2"><br /> <script language="JavaScript"> var addr = ''; var host = ''; var email = ''; document.write(email); </script></td> </tr> </table> </form> <?php } function isEmail($email) { 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)); } ?>
  12. Mr Adam thanks for helping me, I did try that but when the auto response gets sent to outlook it just gets displayed like this <html> <head> <title>Birthday Reminders for August</title> </head> <body> <p>Here are the birthdays upcoming in August!</p> <table> <tr> <th>Person</th><th>Day</th><th>Month</th><th>Year</th> </tr> <tr> <td>Joe</td><td>3rd</td><td>August</td><td>1970</td> </tr> <tr> <td>Sally</td><td>17th</td><td>August</td><td>1973</td> </tr> </table> </body> </html> please help, I am new to php and I did have hair this morning
  13. Hi Guys how is everyone today, quick question I know one of you will answer this no problem. I have created a php contact form that once info is filled out it goes to the database and emails me, also it sends them a response which is working fine, the problem I have is I can't get html links to work when they receive the auto response email. I changed the text to red to indicate which text I want to link to a website Please see my script below I appreciate all the help I can get I have just started with php so I will be very grateful <?php // Connect to database $hostname = "0.0.0.0"; $username = ""; $password = ""; $dbname = ""; $usertable = ""; $f_name = $_REQUEST['f_name']; $postcode = $_REQUEST['postcode']; $tel = $_REQUEST['tel']; $mobile = $_REQUEST['mobile']; $email = $_REQUEST['email']; $course = $_REQUEST['course']; mysql_connect($hostname, $username, $password) or DIE("Unable to connect to MySQL server $hostname"); $selected = mysql_select_db($dbname) or DIE("Could not select requested db $dbname"); $errmsg = ''; // error message $f_name = ''; // sender's name $postcode = ''; // sender's name $tel = ''; // message tel $mobile = ''; // message tel $email = ''; // sender's email addres $course = ''; // the message itself if(isset($_POST['send'])) { $f_name = $_POST['f_name']; $postcode = $_POST['postcode']; $tel = $_POST['tel']; $mobile = $_POST['mobile']; $email = $_POST['email']; $course = $_POST['course']; if(trim($f_name) == '') { $errmsg = 'Please enter your name'; } else if(trim($postcode) == '') { $errmsg = 'Please enter your postcode'; } else if(trim($tel) == '') { $errmsg = 'Please enter Your Telephone Number:'; } else if(trim($mobile) == '') { $errmsg = 'Please enter your mobile'; } else if(trim($email) == '') { $errmsg = 'Please enter your email address'; } else if(!isEmail($email)) { $errmsg = 'Your email address is not valid'; } else if(trim($course) == '') { $errmsg = 'Please enter the course your interested in'; } if($errmsg == '') { if(get_magic_quotes_gpc()) { $tel = stripslashes($tel); $message = stripslashes($message); } $query = "INSERT INTO table (id, f_name, postcode, tel, mobile, email, course, pdate) VALUES ('', '$f_name', '$postcode', '$tel', '$mobile', '$email' , '$course', NOW())"; $result = mysql_query($query) or DIE("Could not Execute Query on table $usertable"); // the email will be sent here $to = "email address"; $user_message .= "Name: $f_name \r\n"; $user_message .= "postcode: $postcode \r\n"; $user_message .= "tel: $tel \r\n"; $user_message .= "mobile: $mobile \r\n"; $user_message .= "email: $email \r\n"; $user_message .= "course: $course \r\n"; $headers = "- Enquiry \r\n"; $headers .= "Reply-To: $email"; mail('email','Enquiry',$user_message,$headers); $autoreply="Thank you for your enquiry, $f_name. Congratulations you have just taken one step closer to gaining your dream job [color=red] Click Here to find out how to Dress for success [/color] [color=red]Click Here for tips to Look good feel good[/color] [color=red]Find the best methods to Plan your day Click here [/color] [color=red]Click Here to find out more [/color] [color=red]Click Here for 10 ten tips for communicating [/color] Contact us now to find out more This is an automated reply."; $subject="Thank you for Enquiring $name! "; mail($email, $subject, $message, $autoreply); ?> </span> <div align="center" class="boldenquire style5">Well done! you have just taken the first step in securing that dream job. Please check your email now to get you started</div> <?php } } mysql_close(); if(!isset($_POST['send']) || $errmsg != '') { ?> <div align="center" class="ermsg"><?=$errmsg;?></div> <form method="post" name="msgform" id="msgform"> <table border="0" align="center" cellpadding="2" cellspacing="1" class="maincell"> <tr> <td align="center" class="boldenquire2" colspan="2">It's Your Career </tr> <tr> <td>Your Name:</td> <td><input name="f_name" type="text" class="eqform" style="width:100px" value="<?=$f_name;?>" /></td> </tr> <tr> <td>Nearest centre:</td> <td><label> <select name="postcode" size="1" class="eqform" style="width:100px" value=" <?=$postcode;?>"> <option value="Gravesend">Gravesend</option> <option value="Maidstone">Maidstone</option> <option value="Bromley">Bromley</option> <option value="Chatham">Chatham</option> <option value="Croydon">Croydon</option> <option value="Dartford">Dartford</option> <option value="Tunbridge Wells">Tunbridge Wells</option> </select> </label></td> </tr> <tr> <td>Address:</td> <td><label> <textarea name="textarea" rows="5" class="eqform" id="textarea"></textarea> </label></td> </tr> <tr> <td>Tel:</td> <td><input name="tel" type="text" class="eqform" style="width:100px" value="<?=$tel;?>" /></td> </tr> <tr> <td>Mobile:</td> <td><input name="mobile" type="text" class="eqform" style="width:100px" value="<?=$mobile;?>" /></td> </tr> <tr> <td>Email:</td> <td><input name="email" type="text" class="eqform" style="width:100px" value="<?=$email;?>" /></td> </tr> <tr> <td><span class="req">What is your ideal job:</span></td> <td><input name="course" type="text" class="eqform" style="width:100px" value="<?=$course;?>" size="40" /> </td> </tr> <tr align="center"> <td colspan="2" class="boldenquire2"><input name="send" type="submit" class="eqbox" onClick="return checkForm();" value="Click Here" /> <br /> <span class="boldenquire2">For 5 ways to get that dream job</span></td> </tr> <tr align="left"> <td colspan="2"><br /> <script language="JavaScript"> var addr = ''; var host = ''; var email = ''; document.write(email); </script></td> </tr> </table> </form> <?php } function isEmail($email) { 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)); } ?>
  14. Hi Guys I have a contact form which i have managed to put together, and yes sorry I am a newbie to php so please forgive me if this is very easy. I need the form to go to a confirmation page after submit but i cant get it to work, at the moment when you click submit it displays a little message, I need to get rid of that and put in place the forward please can some one help I will include the script below I have been trying to insert the following scrip but unsure where header("Location: http://www.mydomain.co.uk/emailconfirm.htm"); <?php // Connect to database $hostname = "1.1.1.1"; $username = "user"; $password = "pass"; $dbname = "data"; $usertable = "table"; $f_name = $_REQUEST['f_name']; $tel = $_REQUEST['tel']; $email = $_REQUEST['email']; mysql_connect($hostname, $username, $password) or DIE("Unable to connect to MySQL server $hostname"); $selected = mysql_select_db($dbname) or DIE("Could not select requested db $dbname"); $query = "INSERT INTO pitman (id, f_name, tel, email, pdate) VALUES ('', '$f_name', '$tel', '$email' , NOW())"; $results = mysql_query($query) or DIE ("could not execute query : $query." . mysql_error()); $result = mysql_query($query) or DIE("Could not Execute Query on table $usertable"); mysql_close; $errmsg = ''; // error message $f_name = ''; // sender's name $tel = ''; // message tel $email = ''; // sender's email addres if(isset($_POST['send'])) { $f_name = $_POST['f_name']; $tel = $_POST['tel']; $email = $_POST['email']; if(trim($f_name) == '') { $errmsg = 'Please enter your name'; } else if(trim($tel) == '') { $errmsg = 'Please enter Your Telephone Number:'; } else if(trim($email) == '') { $errmsg = 'Please enter your email address'; } else if(!isEmail($email)) { $errmsg = 'Your email address is not valid'; } if($errmsg == '') { if(get_magic_quotes_gpc()) { $tel = stripslashes($tel); $message = stripslashes($message); } // the email will be sent here $to = "fklfa@fds.com"; $user_message .= "Name: $f_name \r\n"; $user_message .= "tel: $tel \r\n"; $user_message .= "email: $email \r\n"; $headers = "- company \r\n"; $headers .= "Reply-To: $email"; mail('test@mydomain.com','company',$user_message,$headers); header("Location: http://www.mydomain.co.uk/emailconfirm.htm"); ?> <div align="center" class="bigger"> <p>Thank you for sending your details, we look forward to seeing you on the 21st May</p> <p> </p> </div> <?php } } if(!isset($_POST['send']) || $errmsg != '') { ?> <div align="center" class="smallblue"><?=$errmsg;?></div> <form method="post" name="msgform" id="msgform"> <table border="0" align="left" cellpadding="2" cellspacing="1" class="maincell"> <tr> <td class="smallblue">Your Name</td> <td><input name="f_name" type="text" class="eqform" id="sname" style="width:100px" value="<?=$f_name;?>" /></td> <td> </td> </tr> <tr> <td class="smallblue">Email </td> <td><input name="email" type="text" class="eqform" id="hnum" style="width:100px" value="<?=$email;?>"/></td> <td> </td> </tr> <tr> <td width="100" class="smallblue">Contact Number </td> <td><input name="tel" type="text" class="eqform" id="tel" value="<?=$tel;?>" style="width:100px" /></td> <td><input name="send" type="submit" id="send" value="Send" onclick="return checkForm();" /></td> </tr> </table> </form> <?php } function isEmail($email) { 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)); } ?>
  15. Hi Guys I am still new to the php world so forgive me if I come across as a bit thick, I have a fully functioning contact form which I need a little help with. At the moment it stores contact details in a database as well as sends me an emails and an auto response to the customer, what I am trying to do it make it look a table called pit_locations and send it to the relevant branch as well as sending me a copy, I have put the code into the script now but keep getting this error Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource here is the script the error is in red <?php // Connect to database $hostname = "0.0.0.0"; $username = "test"; $password = "test"; $dbname = "test"; $usertable = "test"; $f_name = $_REQUEST['f_name']; $postcode = $_REQUEST['postcode']; $tel = $_REQUEST['tel']; $mobile = $_REQUEST['mobile']; $email = $_REQUEST['email']; $course = $_REQUEST['course']; $go = "1"; mysql_connect($hostname, $username, $password) or DIE("Unable to connect to MySQL server $hostname"); $selected = mysql_select_db($dbname) or DIE("Could not select requested db $dbname"); $errmsg = ''; // error message $f_name = ''; // sender's name $postcode = ''; // sender's name $tel = ''; // message tel $mobile = ''; // message tel $email = ''; // sender's email addres $course = ''; // the message itself if(isset($_POST['send'])) { $f_name = $_POST['f_name']; $postcode = $_POST['postcode']; $tel = $_POST['tel']; $mobile = $_POST['mobile']; $email = $_POST['email']; $course = $_POST['course']; if(trim($f_name) == '') { $errmsg = 'Please enter your name'; } else if(trim($postcode) == '') { $errmsg = 'Please enter your postcode'; } else if(trim($tel) == '') { $errmsg = 'Please enter Your Telephone Number:'; } else if(trim($mobile) == '') { $errmsg = 'Please enter your mobile'; } else if(trim($email) == '') { $errmsg = 'Please enter your email address'; } else if(!isEmail($email)) { $errmsg = 'Your email address is not valid'; } else if(trim($course) == '') { $errmsg = 'Please enter the course your interested in'; } if($errmsg == '') { if(get_magic_quotes_gpc()) { $tel = stripslashes($tel); $message = stripslashes($message); } $query = "INSERT INTO pitman (id, f_name, postcode, tel, mobile, email, course, pdate) VALUES ('', '$f_name', '$postcode', '$tel', '$mobile', '$email' , '$course', NOW())"; $result = mysql_query($query) or DIE("Could not Execute Query on table $usertable"); // the email will be sent here $to = "email"; $user_message .= "Name: $f_name \r\n"; $user_message .= "postcode: $postcode \r\n"; $user_message .= "tel: $tel \r\n"; $user_message .= "mobile: $mobile \r\n"; $user_message .= "email: $email \r\n"; $user_message .= "course: $course \r\n"; $headers = "- company \r\n"; $headers .= "Reply-To: $email"; $sql = mysql_query("SELECT Email FROM pit_locations WHERE Location ='$postcode' LIMIT 1"); $info = mysql_fetch_array($sql); mail('email','Company',$user_message,$headers); $autoreply="Thank you for your enquiry, $f_name. \n\n$user_message\n\nThis is an automated reply."; $subject="Thank you for Enquiring $name! "; mail($email, $subject, $autoreply); ?> <div align="center" class="boldenquire">Thank you for your enquiry and we look forward to helping you. </div> <?php } } mysql_close(); if(!isset($_POST['send']) || $errmsg != '') { ?>
×
×
  • 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.