Help with contact form

Pho

Pho

Soldato
Joined
18 Oct 2002
Posts
9,324
Location
Derbyshire
You're missing message-received.php which is where the browser sends the entered form data and emails it to you.

You're also missing HTTPS. Prepare to have your site show loads of warnings in Chrome due to unsecured user data.
 

Pho

Pho

Soldato
Joined
18 Oct 2002
Posts
9,324
Location
Derbyshire
Thanks for pointing that out.

Regards the https...... am I right in saying I need an slow certificate for that?

You probably want to enable recaptcha otherwise you might get bombarded by spam. It's free and works passively:
https://developers.google.com/recaptcha/docs/v3

Like Hyburnate suggested, a large amount of hosts nowadays offer letsencrypt integration for free SSL certs so start with that.

Use Let's Encrypt or CloudFlare CDN for SSL

With Cloudflare you still want your real host to be using HTTPS too (even a self-signed cert is OK assuming Cloudflare let you whitelist it) otherwise you're going User -> [https] -> Cloudflare -> [http] -> Webhost which whilst fixes any browser warnings still results in non-encrypted data being sent.
 
Associate
OP
Joined
20 Sep 2003
Posts
2,361
Location
Scotland
Code:
<!DOCTYPE html>
<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>R Doyle Consultancy Contact</title>
      
        <meta name="description" content="">
        <meta name="viewport" content="width=device-width, initial-scale=1">
        <!--[if lte IE 8]><script src="assets/js/ie/html5shiv.js"></script><![endif]-->
        <link rel="stylesheet" href="assets/css/main.css">
        <!--[if lte IE 8]><link rel="stylesheet" href="assets/css/ie8.css" /><![endif]-->    
      
    </head>
    <body cz-shortcut-listen="true">
      
        <div id="page-wrapper">

            <!-- Header -->
                <header id="header">
                    <nav id="nav">
                        <ul>
                            <li style="white-space: nowrap;"><a href="index.html">Home</a></li>
                            <li class="opener" style="user-select: none; cursor: pointer; white-space: nowrap;">
                                <a href="message-received.php#" class="icon fa-angle-down">Menu</a>
                              
                            <ul style="user-select: none; display: none; position: absolute;" class="">
                                    <li style="white-space: nowrap;"><a href="#" style="display: block;">Pricing</a></li>
                                    <li style="white-space: nowrap;"><a href="#" style="display: block;">Computer Services</a></li>
                                    <li style="white-space: nowrap;"><a href="#" style="display: block;">Contact</a></li>
                                        </ul></li></ul>      
                    </nav>
                </header>
              
               
                <!-- Main -->
                <section id="main" class="container">

                        <header>
                        <h2>Fix Computers</h2>
                        <span class="image featured"><img src="images/logo.png" alt="R Doyle Consultancy"></span>
                        <h2>Message Received</h2>
                        <h3>We will be in touch very soon, thank you. </h3>
                        </header>
                            </section>
                          
                            </div>
                                                                                                                                      
            <!-- Footer -->
                <footer id="footer">
                    <ul class="icons">                     
                        <li><a href="https://www.facebook.com/rdoyleconsultancy/" class="icon fa-facebook"><span class="label target=" _blank"="">Facebook</span></a></li>
                        <li><a href="https://twitter.com/rdoyleinfo" class="icon fa-twitter "><span class="label target=" _blank"="">Twitter</span></a></li>
                        <li><a href="https://goo.gl/maps/RpYjKuJiUN7i16ST8" class="icon fa-map-marker"><span class="label target=" _blank"="">Map Marker</span></a></li>
                      </ul>
                    <ul class="copyright">
                   <li>Fix Computers</li>  <li>50 Pennelton Place, Bo'ness, EH51 0PE</li><li>Mobile: 07845344846</li>
                        <li><a href="https://goo.gl/maps/RpYjKuJiUN7i16ST8" target="_blank">Google Location Map</a></li>
                           </ul>
                </footer>
      
        <!-- Scripts -->
            <script src="./message-received_files/jquery.min.js"></script>
            <script src="./message-received_files/jquery.dropotron.min.js"></script>
            <script src="./message-received_files/jquery.scrollgress.min.js"></script>
            <script src="./message-received_files/skel.min.js"></script>
            <script src="./message-received_files/util.js"></script>
            <!--[if lte IE 8]><script src="assets/js/ie/respond.min.js"></script><![endif]-->
            <script src="./message-received_files/main.js"></script>
  
<ul style="user-select: none; display: none; position: absolute; z-index: 1000;" class="dropotron level-0">
                                    <li style="white-space: nowrap;"><a href="https://www.fix-computers.net/computer-repair-customer-reviews.html" style="display: block;">Customer Reviews</a></li>
                                    <li style="white-space: nowrap;"><a href="https://www.fix-computers.net/computer-repair-services.html" style="display: block;">Computer Services</a></li>
                                    <li style="white-space: nowrap;"><a href="https://www.fix-computers.net/contact.html" style="display: block;">Contact</a></li>
                                        </ul><div id="navButton"><a href="https://www.fix-computers.net/message-received.php#navPanel" class="toggle"></a></div><div id="navPanel"><nav><a class="link depth-0" href="https://www.fix-computers.net/index.html" style="-webkit-tap-highlight-color: rgba(0, 0, 0, 0);"><span class="indent-0"></span>Home</a><a class="link depth-0" href="https://www.fix-computers.net/message-received.php#" style="-webkit-tap-highlight-color: rgba(0, 0, 0, 0);"><span class="indent-0"></span>Menu</a><a class="link depth-1" href="https://www.fix-computers.net/computer-repair-customer-reviews.html" style="-webkit-tap-highlight-color: rgba(0, 0, 0, 0);"><span class="indent-1"></span>Customer Reviews</a><a class="link depth-1" href="https://www.fix-computers.net/computer-repair-services.html" style="-webkit-tap-highlight-color: rgba(0, 0, 0, 0);"><span class="indent-1"></span>Computer Services</a><a class="link depth-1" href="https://www.fix-computers.net/contact.html" style="-webkit-tap-highlight-color: rgba(0, 0, 0, 0);"><span class="indent-1"></span>Contact</a></nav></div></body></html>
 
Soldato
Joined
28 Oct 2006
Posts
12,456
Location
Sufferlandria
That's an HTML file, not a PHP file.
message-received.php needs to be PHP and take in the form values and send the email. It then either returns a simple string like "Message Received" or redirects to an html page which displays the same message.

edit: to be clear, there's many other languages this can be done in. When I say it "needs to be done in PHP" I mean, it's not a simple html page you need. That's how it's done on the site you're copying from.

If you don't have FTP (or similar) access to that other site, you won't be able to see the content of the php file.
 
Last edited:
Associate
OP
Joined
20 Sep 2003
Posts
2,361
Location
Scotland
I used wget to grab all the files from the site but it didn't grab any php files. I was just wanting a simple webpage to promote some laptop fixing services and the like. Having a butchers around I have found some base bootstrap templates as well like Marshmallow or there is always WP.
 
Soldato
Joined
28 Oct 2006
Posts
12,456
Location
Sufferlandria
PHP files are all server-side code and wont be visible at all to website visitors or crawlers.

There's php examples out there for doing what you want but if you don't know any coding then you'd be better off using a pre-built contact form. All the popular CMS systems and web builders have contact form options or plugins. Bootstrap templates are for front-end html and won't do any backend email sending stuff unless combined with something else.
 
Back
Top Bottom