SitePoint Sponsor

User Tag List

Results 1 to 7 of 7
  1. #1
    SitePoint Zealot barleytwist's Avatar
    Join Date
    Dec 2005
    Location
    Lulworth, Dorset, UK
    Posts
    183
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Integrate a PHP Form

    I have an accessible and secure form script for my site with instructions, Ok so far. I am not familiar with doing PHP.

    My site currently composed of .shtml pages. I want to add a PHP enquiry form (configuration rules provided for the form I have so I can fiddle to get the fields I want: senders address, name and text field, really simple) to my Office page.

    My server allows PHP so do I need to do anything to get it to run?

    I need to know what I need to do to the office.shtml to get it to run the PHP. This installation instruction is given:

    "5. Using the PHP include function, include the file gbcf_form.php
    in any *.php page file where you want it to be. It must be
    below the <body> tag and preferably below the main heading.
    I recommend placing it in the main content area.
    See Example 1, below.
    Example 1
    <?php include("form-files-directory/gbcf_form.php"); ?>"

    What do I do to my office.shtml file to get it to run the PHP. Change it to office.php?

    Any other advice I've forgotten appreciated. Thanks.

  2. #2
    Follow Me On Twitter: @djg gold trophysilver trophybronze trophy Dan Grossman's Avatar
    Join Date
    Aug 2000
    Location
    Philadephia, PA
    Posts
    20,580
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Changing the file extension should do it.

  3. #3
    SitePoint Zealot barleytwist's Avatar
    Join Date
    Dec 2005
    Location
    Lulworth, Dorset, UK
    Posts
    183
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Ok thanks

    It's just that I'd read that there might be problems getting the .shtml parsed as well. I shall try that.

  4. #4
    Follow Me On Twitter: @djg gold trophysilver trophybronze trophy Dan Grossman's Avatar
    Join Date
    Aug 2000
    Location
    Philadephia, PA
    Posts
    20,580
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    What were you using the .shtml extension for? SSI includes can be replaced with PHP includes in that case.

  5. #5
    SitePoint Zealot barleytwist's Avatar
    Join Date
    Dec 2005
    Location
    Lulworth, Dorset, UK
    Posts
    183
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Yes it was for includes, common header and footer for each page including js, css. What would be the php equivalent of:

    <!--#include file="includes/head.html" -->?

    Just as an aside (it looks from your post credentials as if you're an expert generally for websites), I want a domain name from a supplier (I think I will use UKreg) but the actual website is on another host (remote). Is it just the nameserver I change e.g. ns1/2 to get to the site pages for site and emails to that site?

    Thanks.

  6. #6
    Follow Me On Twitter: @djg gold trophysilver trophybronze trophy Dan Grossman's Avatar
    Join Date
    Aug 2000
    Location
    Philadephia, PA
    Posts
    20,580
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Yes, point the nameservers to the hosting account. What else you need to do beyond that depends on the host.

    The equivalent in PHP is <?php include('includes/head.html'); ?>.

  7. #7
    SitePoint Zealot barleytwist's Avatar
    Join Date
    Dec 2005
    Location
    Lulworth, Dorset, UK
    Posts
    183
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Thumbs up

    Thanks, Dan. I will go away and try.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •