Register

If this is your first visit, please click the Sign Up now button to begin the process of creating your account so you can begin posting on our forums! The Sign Up process will only take up about a minute of two of your time.

Page 1 of 4 1 2 3 ... LastLast
Results 1 to 10 of 39
  1. #1
    Junior Member windwood's Avatar
    Join Date
    Feb 2010
    Location
    Cincinnati, Ohio
    Posts
    9
    Member #
    21176
    I've started working on a website and I was wondering if there's a way to make a template of the page so that the only content that changes is in the middle. The other question is regarding the header/title on the page. The lettering is very pixelated on the edges and I can't seem to rectify that. Any help would be appreciated. The site in question can be found here. TIA

    I've tried both Photoshop CS3 and Inkscape for designing the text logo at the top.

  2.  

  3. #2
    Senior Member Dorky's Avatar
    Join Date
    Jun 2009
    Location
    Destin Florida
    Posts
    1,430
    Member #
    19103
    Liked
    4 times
    <a href='whatever.com?page=page_1'>Whatever</a>

    the ?page=_1 is the part we will talk about for this. the whatever parts are dependent on you url and the text you want show for the link.

    ?page= is how we are going to initiate the html $_GET so we can get our variable.

    then at the top of the page you place this

    <?php $page = $_GET['page']; ?>

    the $page now hold the information following the ?page= in the link, in this example it was page_1 .

    then in the center column div you place this and only this

    <?php
    if (!isset($_GET['page'])) { include("default.html"); }
    else { include("path_to_file/$page.html"); }
    ?>

    the path_to_file you will need to edit to your own server path information. and now the $page you see in the include is the name of the .html file thus $page.html
    and default is the file of the home page content. be sure to make your home link just the url to your site without the variable of this tutorial, just a standard link to your site. the parts of this to google for further info are as follows in keyword form.

    php
    php if
    php include
    php variable
    html $_GET

    while($get_it !== true){ continue; }

  4. #3
    Junior Member windwood's Avatar
    Join Date
    Feb 2010
    Location
    Cincinnati, Ohio
    Posts
    9
    Member #
    21176
    Thank you for your reply. Before I "try" to implement this, I have another question.

    Is it necessary that my server has the php capability, or does it just have to do with my html?

  5. #4
    WDF Staff mlseim's Avatar
    Join Date
    Apr 2004
    Location
    Cottage Grove, Minnesota
    Posts
    7,724
    Member #
    5580
    Liked
    718 times
    I you're talking about your webhost server, it probably already has PHP ready-to-go.


  6. #5
    Junior Member windwood's Avatar
    Join Date
    Feb 2010
    Location
    Cincinnati, Ohio
    Posts
    9
    Member #
    21176
    Not sure mlseim. I'd have to check. Last time I talked to them, they were using MS Frontpage?????? and definitely not allowing for databases, as I was trying to put up a Wordpress page and they couldn't/wouldn't do it because of the database feature. I need to and am going to change hosts soon. Looking for that as well. Any ideas welcome. Been with these folks so long (1998), don't know what else is out there, but looking.

  7. #6
    Senior Member Dorky's Avatar
    Join Date
    Jun 2009
    Location
    Destin Florida
    Posts
    1,430
    Member #
    19103
    Liked
    4 times
    what i gave you requires no db. also i forgot to mention the index.html will need to be changed to index.php no worries it wont effect anything, just allow the php to run.

    while($get_it !== true){ continue; }

  8. #7
    Junior Member windwood's Avatar
    Join Date
    Feb 2010
    Location
    Cincinnati, Ohio
    Posts
    9
    Member #
    21176
    O.K. Thanks Dorky. I'll work on this for next couple days and see what I get. I'll post back here when I screw it up.

  9. #8
    Senior Member Dorky's Avatar
    Join Date
    Jun 2009
    Location
    Destin Florida
    Posts
    1,430
    Member #
    19103
    Liked
    4 times
    lol. ok cool.

    while($get_it !== true){ continue; }

  10. #9
    Junior Member windwood's Avatar
    Join Date
    Feb 2010
    Location
    Cincinnati, Ohio
    Posts
    9
    Member #
    21176
    O.K. I screwed it up big time. Had to delete my page and start from scratch. Fortunately, I saved a copy.

    A couple of questions:
    1. I assume this tag (<?php $page = $_GET['page']; ?>)
    goes in "index.html" but what is it's proper position? below or above <body>? ....below or above <head>?....clueless here.

    2. In reference to:
    <?php
    if (!isset($_GET['page'])) { include("default.html"); }
    else { include("path_to_file/$page.html"); }
    ?>

    can I assume this goes in the style.css file?, or does it go in index.html.?

    I'd send you a link to the screw up, but you'ld probably just get a "404" or something equally non revealing.

    Thanks for your help,

    Rick

  11. #10
    Senior Member Dorky's Avatar
    Join Date
    Jun 2009
    Location
    Destin Florida
    Posts
    1,430
    Member #
    19103
    Liked
    4 times
    this goes at the very top of the index.php before anything else.

    <?php $page = $_GET['page']; ?>


    this goes in the index.php inside the div you want to change dynamically. it should be the only thing between the div tags in question.

    <?php
    if (!isset($_GET['page'])) { include("default.html"); }
    else { include("path_to_file/$page.html"); }
    ?>
    dont forget the link structure i gave you.

    while($get_it !== true){ continue; }


Page 1 of 4 1 2 3 ... LastLast

Remove Ads

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
All times are GMT -6. The time now is 10:20 AM.
Powered by vBulletin® Version 4.2.3
Copyright © 2019 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: PurevB.com