Skip to main content
Inspiring
January 25, 2019
Answered

Code is showing up on my website. How do I remove it?

  • January 25, 2019
  • 3 replies
  • 966 views

I would appreciate some help. I am not a web designer or developer. I have been thrown into looking after my website since my guy quit. I have made some changes on Dream Weaver to my website without problems. But the Contact page would not load the changes I made. It's the only page that has html and a php files. The changes on the html wouldn't load. So I tried the php file. Mistake. Now the page shows the code and the toll free number I was trying to remove is still there. Plus when I go back to html it won't load now. Ideas? Career change? Thanks.

    This topic has been closed for replies.
    Correct answer marthac15941951

    I hope for your sake you have a back up copy of the original contact.php file someplace.


    Problem solved. Thanks so much for responding and your help.

    I'll be more careful about copying the info before I make changes.

    Have a great weekend!

    Martha

    On Fri, Jan 25, 2019 at 4:23 PM Martha Cameron <marthacameron081@gmail.com>

    3 replies

    Inspiring
    January 26, 2019

    Problem has been solved. Thanks to those offering help.

    Have a great weekend!

    Nancy OShea
    Adobe Expert
    January 25, 2019
    Nancy O'Shea— Product User, Community Expert &amp; Moderator
    Inspiring
    January 25, 2019

    Thanks Nancy but I don't know enough about coding to find the mistakes. I have now got it to where the site shows the contact page as php but if I manually change it to html the page is correct. cancunziplinetours/contact.html . But if you close and reopen the site it is automatically php and shows code. cancunziplinetours/contact.php . My question now is how do I get the site to use the html code on the Contact page and not the php code. If I can do that all will be fixed. Thanks.

    Nancy OShea
    Adobe Expert
    January 25, 2019

    <!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>Cancun Zipline Tours</title>

    <META NAME="Title" CONTENT="You are taking the first step to adventure on a zip line tour in the Cancun and Riviera Maya area">

    <META NAME="Description" CONTENT="We offer several options so that you can pick the tour that’s right for you and your family and friends. Call 52-998-884-1662.">

    <META NAME="Keywords" CONTENT="tours, hotels, groceries, activities, transportation, Cancun, Riviera Maya, Mayan ruins, Zip lines, Isla Mujeres, Snorkeling, Sailing, Airport, Caribbean, Rainforests">

    <link href="css/templatemo_style.css" rel="stylesheet" type="text/css" />

    <script type="text/javascript" src="js/jquery-1-4-2.min.js"></script>

    <!--script type="text/javascript" src="/jqueryui/js/jquery-ui-1.7.2.custom.min.js"></script-->

    <script type="text/javascript" src="js/jquery-ui.min.js"></script>

    <script type="text/javascript" src="js/showhide.js"></script>

    <script type="text/JavaScript" src="js/jquery.mousewheel.js"></script>

    <link rel="stylesheet" type="text/css" href="css/ddsmoothmenu.css" />

    <script type="text/javascript" src="js/jquery.min.js"></script>

    <script type="text/javascript" src="js/ddsmoothmenu.js">

    /***********************************************

    * Smooth Navigational Menu- (c) Dynamic Drive DHTML code library (www.dynamicdrive.com)

    * This notice MUST stay intact for legal use

    * Visit Dynamic Drive at http://www.dynamicdrive.com/ for full source code

    ***********************************************/

    </script>

    <script type="text/javascript">

    ddsmoothmenu.init({

    mainmenuid: "templatemo_menu", //menu DIV id

    orientation: 'h', //Horizontal or vertical menu: Set to "h" or "v"

    classname: 'ddsmoothmenu', //class added to menu's outer DIV

    //customtheme: ["#1c5a80", "#18374a"],

    contentsource: "markup" //"markup" or ["container_id", "path_to_menu_file"]

    })

    </script>

    <script>

      (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i=i||function(){

      (i.q=i.q||[]).push(arguments)},i.l=1*new Date();a=s.createElement(o),

      m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)

      })(window,document,'script','//www.google-analytics.com/analytics.js','ga');

      ga('create', 'UA-42415840-1', 'cancunziplinetours.com');

      ga('send', 'pageview');

    </script>

    </head>

    <body id="contact">

    <div id="templatemo_header_wrapper">

    <div id="site_title"><h1><a href="#">Cancun Zipline Tours</a></h1></div>

         <div id="templatemo_menu" class="ddsmoothmenu">

            <ul>

                <li><a href="index.html">Home</a></li>

                <li><a href="gallery.html">Gallery</a>

                 

                </li>

                <li><a href="#">Zipline Tours</a>

                    <ul>

                        <li><span class="top"></span><span class="bottom"></span></li>

                        <li><a href="gimmeallchallenge.html">Gimme all Challenge</a></li>

                    

                        <li><a href="selvatica.html">Extreme zip line</a></li>

                    

                     

                        <li><a href="offroadandflightchallenge.html">Off Road Flight Challenge</a></li>

                     

                        <li><a href="royalgarrafon.html">Garrafon</a></li>

                        <li><a href="junglemayaexpedition.html">Jungle Maya Expedition</a></li>

                        <li><a href="cobamayanencounter.html">Coba Mayan Encounter</a></li>

                        <li><a href="snorkelextreme.html">Snorkel Xtreme</a></li>

                        <li><a href="mayanextreme.html">Mayan Xtreme</a></li>

                        <li><a href="tulumextreme.html">Tulum Xtreme</a></li>

                        <li><a href="dolphinxtreme.html">Dolphin Xtreme</a></li>

                        <li><a href="naturalmentemexico.html">ATV Xtreme Jungle Jim’s</a></li>

                  </ul>

                </li>

                <li><a href="http://www.cancunbestdiscounts.com">More Tours</a></li>

                <li><a href="contact.php" class="selected">Contact</a></li>

            </ul>

            <br style="clear: left" />

        </div> <!-- end of templatemo_menu -->

        <div class="cleaner"></div>

    </div> <!-- END of templatemo_header_wrapper -->

    <div id="templatemo_main">

        <h2>Contact Information</h2>

            <div class="half float_l">

            <h4>Send us a message now!</h4>

             

                <div id="contact_form">

                

                   <?php

                

                   $emailsitio = emailaddresshere';

                

                   if($_GET['msg']) {

                    $mensaje=$_GET['msg'];

       }

                                

                   if($_POST['accion']=="enviar")

                

                    if(!strpos(" ".$_SERVER['HTTP_REFERER'], 'zipline') ) exit("Intento de ingreso externo detectado");

                

                    $nombre=$_REQUEST['author'];

                    $email=$_REQUEST['email'];

                    $mensaje=$_REQUEST['mensaje'];

                    $titulo=$_REQUEST['subject'];

                

                

                

                    if(strlen($nombre)<4 || strlen($mensaje)<5) $errores .= "Please fill all fields<br />";

                    if(!filter_var($email, FILTER_VALIDATE_EMAIL)) $errores .= "Incorrect eMail address<br />";

                

                    contains_bad_str($nombre);

                    contains_newlines($nombre);

                

                    contains_bad_str($email);

                    contains_newlines($email);

                

                    contains_bad_str($subject);

                    contains_newlines($subject);

                

                    contains_bad_str($mensaje);

                 

                

                    //envia

                    if($errores==""){

                

                    ob_start();

                    include('mensaje.html');}

                    $mensajehtml = ob_get_contents();

                    ob_end_clean();

                

                    $mensajehtml=str_replace('[fecha]', date("d/m/Y"), $mensajehtml);

                    $mensajehtml=str_replace('[nombredelsitio]', 'Cancun Zipline Tours', $mensajehtml);

                    $mensajehtml=str_replace('[direcciondelsitio]', 'http://www.cancunziplinetours.com/', $mensajehtml);

                    $mensajehtml=str_replace('[maildelsitio]', $emailsitio, $mensajehtml);

                

                    $mensajehtml=str_replace('[email]', $email, $mensajehtml);

                    $mensajehtml=str_replace('[nombre]', $nombre.' '.$apellido, $mensajehtml);

                    $mensajehtml=str_replace('[titulo]', $titulo, $mensajehtml);

                    $mensajehtml=str_replace('[mensaje]', $mensaje, $mensajehtml);

                

                

                

                    $emailto=$emailsitio;

                    $titulo="message from Cancun Zipline Tours";

                  

                    if (!strpos(' '.$emailsitio, str_replace("www.", "", $_SERVER['SERVER_NAME'])) ) {

                    $emailfrom = "noresponder@".str_replace("www.", "", $_SERVER['SERVER_NAME']);

                    } else {

                    $emailfrom = $emailsitio;

                    }

                  

                    $titulositioISO=utf8_decode('Cancun Zipline Tours');

                    $titulo=utf8_decode($titulo);

                    $nombre=utf8_decode($nombre.' '.$apellido);

                    $mensajehtml=utf8_decode($mensajehtml);

                

                        $cabeza .= "From: ".$titulositioISO." <".$emailfrom.">\n";

                    $cabeza .= "Reply-To: ".$nombre." <".$email.">\n";

                    $cabeza .= "X-Sender: <".$emailsitio.">\n";

                    $cabeza .= "MIME-Version: 1.0\n";

                    $cabeza .= "Content-type: text/html\n";

                                  

                    //echo "$emailto $titulo $mensajehtml $cabeza";

                    mail("$emailto", "$titulo", "$mensajehtml", $cabeza); {

                

                    $msgOk = 'Your message has been sent. We will contact you shortly.'; 

                

                    }

                

                   if($_POST['accion']=="enviar") {

                

                    if(!strpos(" ".$_SERVER['HTTP_REFERER'], 'zipline') ) exit("Intento de ingreso externo detectado");

                

                    $nombre=$_REQUEST['author'];

                    $email=$_REQUEST['email'];

                    $mensaje=$_REQUEST['mensaje'];

                    $titulo=$_REQUEST['subject'];

                

                

                

                

                    }

                

                   if($_POST['accion']=="enviar") {

                

                    if(!strpos(" ".$_SERVER['HTTP_REFERER'], 'zipline') ) exit("Intento de ingreso externo detectado");

                

                    $nombre=$_REQUEST['author'];

                    $email=$_REQUEST['email'];

                    $mensaje=$_REQUEST['mensaje'];

                    $titulo=$_REQUEST['subject'];

                

                

                   //funciones de proteccion

                   function is_valid_email($email) {

                     return preg_match('#^[a-z0-9.!\#$%&\'*+-/=?^_`{|}~]+@([0-9.]+|([^\s]+\.+[a-z]{2,6}))$#si', $email);

                   }

                

                   function contains_bad_str($str_to_test) {

                     $bad_strings = array(

                                   "content-type:"

                                   ,"mime-version:"

                                   ,"multipart\/mixed"

                    ,"Content-Transfer-Encoding:"

                                   ,"bcc:"

                    ,"cc:"

                    ,"to:"

                     ); }

                  

                     foreach($bad_strings as $bad_string) {

                     /* ------ NO ANDA ----*/

                       if(preg_match("/\b(\w*".$bad_string."\w*)\b/", strtolower($str_to_test))) {

                         echo "$bad_string found. Suspected injection attempt - mail not being sent.";

                         exit;

                       }

                     }

                   }

                

                   function contains_newlines($str_to_test) {

                      if(preg_match("/(%0A|%0D|\\n+|\\r+)/i", $str_to_test) != 0) {

                        echo "newline found in $str_to_test. Suspected injection attempt - mail not being sent.";

                        exit;

                      }

                   }

                

                   ?>

                

                

                   <?php if(!$msgOk){ ?>

                   <form method="post" name="contact" action="contact.php">

                           <input type="hidden" name="accion" value="enviar" />

                            <?php if($errores){ ?>

                            <strong style="color: red;"><?php echo $errores ?></strong>

                            <?php } else { ?>

                            <h6>Toll FREE:<br/>US and Canada:<br/>1-855-229-TOUR (8687)</h6>

                            <?php } ?>

                            <label for="author">Name:</label> <input type="text" id="author" name="author" class="required input_field" value="<?=$nombre?>" />

                            <div class="cleaner h10"></div>

                            <label for="email">Email:</label> <input type="text" id="email" name="email" class="validate-email required input_field" value="<?=$email?>" />

                            <div class="cleaner h10"></div>

                         

    <label for="subject">Subject:</label> <input type="text" name="subject" id="subject" class="input_field" value="<?=$titulo?>" />

    <div class="cleaner h10"></div>

         

                            <label for="text">Message:</label> <textarea id="text" name="mensaje" rows="0" cols="0" class="required"><?=$mensaje?></textarea>

                            <div class="cleaner h10"></div>

                         

                            <input type="submit" value="Send" id="submit" name="submit" class="submit_btn float_l" />

    <input type="reset" value="Reset" id="reset" name="reset" class="submit_btn float_r" />

                         

                </form>

                <?php } else { ?>

            

                <strong><?php echo $msgOk ?></strong>

            

                <?php } ?>

                </div>

    </div>

            <div class="half float_r">

            <h4>Contact Us</h4>

                <h6><strong>From Outside of Mexico</strong></h6>

              52-998-884-1662<br />

           

                <strong>Email:</strong> <a href="mailtoemailaddresshere</a>  <br />

             

                <div class="cleaner h40"></div>

                <h6><strong>From Inside of Mexico<br /> and

    From outside of the<br />

    Cancun 998 area code</strong></h6>

              (998) 884-1662 <br />

    From in the <br />

    Cancun 998 area code <br />

    884-1662<br />

           

             

             

             

            </div>

         

            <div class="cleaner h40"></div>

         

         

     

        <div class="cleaner"></div>

     

        <div class="cleaner"></div>

    </div> <!-- END of templatemo_main -->

    <div id="templatemo_bottom_wrapper">

        <div id="templatemo_bottom">

        <div class="col one_third">

            <h4><span></span>Other Services</h4>

                <div class="bottom_box">

                    <ul class="footer_list">

                        <li><a href="http://www.cancun-bestdiscounts.com/">Cancun Best Discounts</a></li>

                        <li><a href="http://www.wedeliver-cancun.com/">We Deliver Cancun</a></li>

                        <li><a href="http://www.fishinginformationcenter.com/">Fishing Information Center</a></li>

                     

                     

                  </ul>

    </div>

            </div>

            <div class="col one_third">

            <h4><span></span>Contact Us</h4>

                <div class="bottom_box">

                    <ul class="twitter_post">

                   

                        <li>From Outside of Mexico:<br />52-998-884-1662</li><li>From Inside of Mexico<br />

    From outside of the

    Cancun<br />998 area code<br />

    (998) 884-1662 <br></li><li>From in the

    Cancun 998 area code <br />

    884-1662 </li>

                    </ul>

    </div>

            </div>

            <div class="col one_third no_margin_right">

            <h4><span></span>Follow Us</h4>

                <div class="bottom_box">

                    <p><em>Find special deals or get the latest news</em></p><br />           

                    <div class="footer_social_button">

                        <a href="#"><img src="images/icon-facebook.png" title="facebook" alt="facebook" /></a>

                        <a href="#"><img src="images/icon-twitter.png" title="flickr" alt="flickr" /></a>

                        <a href="#"><img src="images/icon-google.png" title="twitter" alt="twitter" /></a>

                        <a href="#"><img src="images/icon-blog.png" title="youtube" alt="youtube" /></a>

                        <a href="#"><img src="images/icon-trip.png" title="rss" alt="rss" /></a>

                        <a href="#"><img src="images/icon-pinterest.png" title="rss" alt="rss" /></a>

                    </div>

                </div>

            </div>

         

        <div class="cleaner"></div>

        </div> <!-- END of tempatemo_bottom -->

    </div> <!-- END of tempatemo_bottom_wrapper -->

    <div id="templatemo_footer_wrapper">

        <div id="templatemo_footer">

        Copyright © 2013 Cancun Zipline Tours | Designed by <a href="http://www.thehighmedia.com" target="_parent">The High Media</a>

        </div> <!-- END of templatemo_footer_wrapper -->

    </div> <!-- END of templatemo_footer -->

    </body>

    </html>


    I hope for your sake you have a back up copy of the original contact.php file someplace.

    Nancy O'Shea— Product User, Community Expert &amp; Moderator
    Brainiac
    January 25, 2019

    For anyone to be able to help you they would need to see the code the page is currently using.

    Inspiring
    January 25, 2019

    I should post the code online?