JohnnyJekyll
Members
-
Joined
-
Last visited
Reputation Activity
-
JohnnyJekyll reacted to fisicx in Website In-Page Device SwitcherThat's a whole different thing. I'm sure someone will post a link to a suitable script but you are making things difficult for yourself, all you really need to do is post images of the client sites in various formats. Far simpler and more effective as this means people browsing your site on a phone will see the client site as it should be seen.
Sometimes you can over complicate things. The simpler you keep it the easier it is to mange and the less thinking the visitor has to do.
Or you could ask these guys if they will sell you a whitelabel version of their tool: http://quirktools.com/screenfly/
-
You can't regulate off site links though, it's always a good idea to set up some kind of forwarding system to correct the 4 url possibilities.
http://www.mydomain.com
http://www.mydomain.com/index.html
http://mydomain.com
http://mydomain.com/index.html
Are four possible addresses that google can see, however they lead to the same location. Their are plenty of methods, .htaccess and canonicalization are two fairly quick and easy methods.
http://www.mattcutts.com/blog/seo-advice-url-canonicalization/
-
www.euro-peanflooring.co.uk/ and www.euro-peanflooring.co.uk/index.htm are not two different pages, they are the same page. When you put just a domain name url in the browser address bar the host server looks for a file beginning with index, usually in the order of extension .htm .html .php .txt and so on although the order may vary from host to host.
So in your html markup where you have:-
<url>
<loc>http://www.euro-peanflooring.co.uk/</loc>
<lastmod>2009-12-18T11:48:07+00:00</lastmod>
<changefreq>monthly</changefreq>
<priority>1.00</priority>
</url>
<url>
<loc>http://www.euro-peanflooring.co.uk/index.htm</loc>
<lastmod>2009-12-18T11:48:07+00:00</lastmod>
<changefreq>monthly</changefreq>
<priority>0.80</priority>
</url>
the same file is being accessed. You must keep the index.htm file (or index.html) but you could add a file with a different name, say home.html or index.html which could both have different content from index.htm.
-
JohnnyJekyll reacted to webdeveloper93 in Advance contact form scriptI built this contact form script and hope you guys find it useful some features are.
1.Captcha
2.Full validation
3.Settings class where you may turn diff fields and such on or off and change certain settings
4.Email validation and header injection validation
5.An option in settings file you may turn on to write all submittions to a text file insted of emailing them
If you enjoy my work give me a +1
CONTACT.PHP
<?php //Start session for captcha session_start(); /*********************************** CONTACT SCRIPT V1.0 Created on 28th November 2009 Copyright (C) Stephen Morgan 2009-2010 E-mail:webtech83@hotmail.com FOR SUPPORT CONTACT THE EMAIL ADDRESS ABOVE **********************************/ ?> <html> <head> <style type="text/css"> label{ width:100px; float:left; } .input{ border:1px #999999 solid; } .content{ padding:20px 30px 20px 30px; width:550px; border:1px #000033 solid; } .h2{ background-color:#993300; padding:20px; color:#ffffff; } </style> </head> <body> <?php //Include settings class file require ("settings.class.php"); //New object $settings = new settings(); //Create protection function function protect($string){ $string = strip_tags($string); $string = trim($string); return $string; } //DONT CHANGE $check_mail variable $check_mail = "/^[a-z0-9]+([_\\.-][a-z0-9]+)*@([a-z0-9]+([\.-][a-z0-9]+)*)+\\.[a-z]{2,}$/i"; //Your info $to = "yoursite@yourdomain.com"; $subject = "My subject"; //Changeable variables //Only create name variable if name field is turned on in settings else return NULL if($settings->name_field_show == "yes"){ $name = protect($_POST['name']); }else{ $name = ""; } //Only create phone variable if phone field is turned on in settings else return NULL if($settings->phone_field_show == "yes"){ $phone = protect($_POST['telephone']); }else{ $phone = ""; } //Only create email variable if email field is turned on in settings else return NULL if($settings->email_field_show == "yes"){ $email = protect($_POST['email']); }else{ $email = ""; } //Only create message variable if message field is turned on in settings else return NULL if($settings->message_field_show == "yes"){ $message = protect($_POST['message']); }else{ $message = ""; } if($settings->log_ip == "yes"){ $ip = $_SERVER["REMOTE_ADDR"]; }else{ $ip = ""; } $headers = "From: $name <$to>"; $spam = $_POST['spam']; //Error array $errors = array(); //Start error validating if($settings->error_validation_on == "yes"){ if($settings->name_field_show == "yes"){ if(!$name){ $errors[] = "I am sorry you must enter your name!"; } if($name){ if(preg_match('/.@/',$name)){ $errors[] = "You have used invalid characters in your name please enter only valid characters!"; } } } if($settings->phone_field_show == "yes"){ if(!$phone){ $errors[] = "Please enter a phone number!"; } } if($settings->email_field_show == "yes"){ if(!$email){ $errors[] = "Please enter a email address!"; } if($email){ if(!preg_match($check_mail,$email)){ $errors[] = "Please enter a valid email address"; } } } if($settings->message_field_show =="yes"){ if(!$message){ $errors[] = "You must fill in your message!"; } } if($settings->captcha_show =="yes"){ if(!$spam){ $errors[] = "Please enter the spam code as seen in the image!"; } if($spam){ if($spam !== $_SESSION['key']){ $errors[] = "The spam code you entered is not correct entered it exactly as seen!"; } } } if(isset($_POST['submit'])){ if(count($errors) > 0){ echo "<h1 style='color:#CC0000;'>Uh-Oh Errors-Found</h1>"; foreach($errors AS $error){ echo "$error <br />"; } echo "<a href='contact.php'>Go back and try again</a>"; }else{ $body = "\n\n \n\nName: $name\n\n Phone: $phone\n\n E-mail: $email\n\n Message: $message\n\n IP: $ip"; //If write_to_file equals to yes dont send info to email insted save info to file if($settings->write_info_to_file == "yes"){ $open = fopen("results.txt",'a','w'); fwrite($open,$body); echo "<h2>THANK YOU! ".$name." Your message has been successfully logged we will get back to you as soon as possible. </h2>"; }else{ $body = "Name: $name<br /><br /> Phone: $phone<br /><br /> E-mail: $email<br /><br /> Message: $message<br /><br /> IP: $ip"; //Call mail function mail($to,$subject,$body,$headers); echo "<h2>THANK YOU! ".$name." Your message has been successfully sent to ".$to." we will get back to you as soon as possible review your submitted info below </h2>"; echo "".$body.""; } } } }else{ if(isset($_POST['submit'])){ $body = "Name: $name<br /><br /> Phone: $phone<br /><br /> E-mail: $email<br /><br /> Message: $message<br /><br /> IP: $ip"; if($settings->write_info_to_file == "yes"){ $open = fopen("results.txt",'a','w'); fwrite($open,$body); echo "<h2>THANK YOU! ".$name." Your message has been successfully logged we will get back to you as soon as possible review your submitted info below </h2>"; fclose($open); }else{ //Call mail function mail($to,$subject,$body,$headers); echo "<h2>THANK YOU! ".$name." Your message has been successfully sent to ".$to." we will get back to you as soon as possible review your submitted info below </h2>"; } } } ?> <?php //Check if form is submitted if not show the form if(!isset($_POST['submit'])){ ?> <div class="content"> <h2 class="h2">Php Contact v1.0</h2> <form name="contactUs" method="post" action=""> <?php //Check if name_field_show equals to yes if so show name field if($settings->name_field_show == "yes"){ ?> <label for="name">Name:</label><input name="name" class="input" type="text" id="name" /><br /><br /> <?php } ?> <?php //Check if Phone_field_show equals to yes if so show phone field if($settings->phone_field_show == "yes"){ ?> <label for="telephone">Telephone:</label><input name="telephone" class="input" type="text" id="telephone" /><br /><br /> <?php } ?> <?php //Check if email_field_show equals to yes if so show email field if($settings->email_field_show == "yes"){ ?> <label for="email">Email:</label><input name="email" type="text" class="input" id="email" /><br /><br /> <?php } ?> <?php //Check if message_field_show equals to yes if so show message field if($settings->message_field_show == "yes"){ ?> <label for="message">Message:</label><textarea name="message" class="input" id="message" rows="5" cols="40" ></textarea><br /><br /> <?php } ?> <?php //Check if captcha_show equals to yes if so show captcha if($settings->captcha_show =="yes"){ ?> <img src="captcha.php" width="300px" height="90" alt="Captcha image"><br /><br /> <p>Enter the word you see in the image words are case-sensitive</p> <label for="spam"><b>Are you human?</b></label><input name="spam" type="text" class="input" size="7" id="spam" /><br /><br /> <?php } ?> <input type="submit" name="submit" id="submit" value="Send Email" /> </form> </div> <?php } ?> </body> </html>
CAPTCHA.PHP
<?php /*********************************** CAPTCHA V1.0 Created on 27th November 2009 Copyright (C) Stephen Morgan 2009-2010 E-mail:webtech83@hotmail.com FOR SUPPORT CONTACT THE EMAIL ADDRESS ABOVE **********************************/ /************** START SESSION *************/ session_start(); function generate(){ //Create word list $word_list = array( 'Light house', 'Barn yard', 'President', 'UFO', 'Doggie', 'TommY Boy', 'Grave yard', 'Reason', 'Subtraction', 'Store', 'Addition', 'One day', 'Sell tires', 'Abrasive', 'Covert', 'Hangar', 'Renown', 'Enhance', 'Plaintiff', 'Blasphemy', 'Tardy', 'Creditable', 'Obdurate' ); //Pick random words from array $captcha_text = ""; while($captcha_text === ""){ $captcha_text = $word_list[array_rand($word_list)]; } //Create captcha image from jpg file $captcha = imagecreatefromjpeg("captcha.jpg"); //Create text color $textcolor = imagecolorallocate($captcha,205,183,158); //Create line color $linecolor = imagecolorallocate($captcha,193,205,193); //Draw a set of random lines to confuse robots for($i = 0; $i < 30; $i++) { imageline($captcha,mt_rand(0,300),mt_rand(0,90),mt_rand(0,300),mt_rand(0,90),$linecolor); } //Set path to font file and set font size $font = "Jokerman.TTF"; $font_size = mt_rand(17,28); //Draw random string from array on image imagettftext($captcha,$font_size,mt_rand(0,,mt_rand(1,60), mt_rand(40,70),$textcolor,$font,$captcha_text); //Blur image to make it harder for robots to read imagefilter($captcha,IMG_FILTER_GAUSSIAN_BLUR); //Out put image header("Content-type:image/jpeg"); imagejpeg($captcha); //Clean up imagedestroy($captcha); //Create key to hold word $_SESSION['key'] = $captcha_text; } //Generate new captcha and output it to client generate(); ?>
SETTINGS.CLASS.PHP
<?php /*********************************** CONTACT SCRIPT v1.0 SETTINGS CLASS Created on 28th November 2009 Copyright (C) Stephen Morgan 2009-2010 E-mail:webtech83@hotmail.com FOR SUPPORT CONTACT THE EMAIL ADDRESS ABOVE **********************************/ class settings{ //Public variables you may edit var $name_field_show = "yes"; var $phone_field_show = "yes"; var $email_field_show = "yes"; var $message_field_show = "yes"; //NOTE: IF YOU TURN ERROR VALIDATION OFF TURN THE CAPTCHA OFF TO //Recommended setting is to show captcha and leave error validating on var $captcha_show = "yes"; var $error_validation_on = "yes"; //This option if set to yes will write all submissions to a file insted of emailing them var $write_info_to_file = "no"; //Turn ip logging on or off var $log_ip = "yes"; } ?>
SCREENSHOT
Hop you enjoy zip file attached which includes all the files and the font file for the captcha
contact v1.0.zip