PHP Help
Results 1 to 2 of 2

Thread: PHP Help

  1. #1
    Junior Member
    Join Date
    Apr 2013
    Posts
    1

    PHP Help

    I am trying to remember a code I used about 6 years ago to fetch certain pages for my website(I haven't written code in almost 6 years) and I can't remember how to do it.

    I used to be able to put:
    <a href="index.php?pe=home"><img src="images/Home.jpg"></a>

    and then a code in the content section of my layout and when clicking on that link(or any of my other links) it would then bring up that page's content in the content section. My problem is:
    A) I don't remember the PHP code that I should be putting in the content section.
    B) I don't remember what I should be saving the pages as; home.php, home.html?

    My website is pixelatedempire.net and if you take a quick look at where I'm trying to pull the content up I'm sure you'll figure it out very quickly.

    Here is my source code(please don't judge too much, I used to be very organized and wrote nice code but like I said I haven't touched a piece of code in 6(maybe more years) and a lot of things have not only changed but I've forgotten almost everything I used to know):

    PHP Code:
    <html xmlns="http://www.w3.org/1999/xhtml">

    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <title>Pixelated Empire</title>
    <link rel="stylesheet" type="text/css" href="style.css" />
    </head>

    <style>
    html, body, #main, #content {
    height: 100%;
    margin: 0;
    padding: 0;
    border: none;
    text-align: left;
    background-color:#ff5b5b;
    }

    #main {
    margin: 0 auto;
    text-align: left;
    vertical-align: top;
    height: 100%;
    width: 800px;
    background-color:#c40e0e;
    }

    #content {
    margin: 0 auto;
    text-align: left;
    vertical-align: top;
    height: 100%;
    width: 784px;
    background-color:#c40e0e;
    }
    </style>

    <body height="100%">


    <center>
    <table id="main" cellpadding="0" cellspacing="0">
    <tr>
    <td background="images/Seperator.jpg" width="800" height="10" colspan="9" valign="top">
    </td>
    </tr>

    <tr>
    <td background="images/Banner.jpg" width="800" height="70" colspan="9" valign="top">
    </td>
    </tr>

    <tr>
    <td background="images/Seperator.jpg" width="800" height="10" colspan="9" valign="top">
    </td>
    </tr>

    <tr>
    <td bgcolor="#000000" width="1" height ="30" valign="top">
    </td>
    <td width="99" height="30" valign="top">
    <a href="index.php?pe=home"><img src="images/Home.jpg"></a>
    </td>
    <td bgcolor="#000000" width="1" height ="30" valign="top">
    </td>
    <td width="99" height="30" valign="top">
    <a href="index.php?pe=clan"><img src="images/Clan.jpg"></a>
    </td>
    <td bgcolor="#000000" width="1" height ="30" valign="top">
    </td>
    <td width="99" height="30" valign="top">
    <a href="index.php?pe=contact"><img src="images/Contact.jpg"></a>
    </td>
    <td bgcolor="#000000" width="1" height ="30" valign="top">
    </td>
    <td background="images/Button-Bar.jpg" width="498" height="30" valign="top">
    </td>
    <td bgcolor="#000000" width="1" height ="30" valign="top">
    </td>
    </tr>

    <tr>
    <td bgcolor="#000000" width="800" height="1" colspan="9" valign="top">
    </td>
    </tr>

    <tr>
    <td bgcolor="#000000" width="1">
    </td>
    <td bgcolor="#c40e0e" width="798" cellpadding="7" cellspacing="0" colspan="7" align="left" valign="top">

    <center>
    <table id="content">

    <tr height="5">
    <td>
    </td>
    </tr>

    <tr>
    <td>

    [COLOR="#FF0000"]<?php
      
    include("index.php?pe=");
    ?>
    Content goes here.
    [/COLOR]
    </td>
    </tr>

    <tr height="5">
    <td>
    </td>
    </tr>
    </table>
    </center>


    </td>
    <td bgcolor="#000000" width="1">
    </td>
    </tr>

    <tr>
    <td background="images/Seperator.jpg" width="800" height="10" colspan="9" valign="top">
    </td>
    </tr>

    </table>
    </body>
    </html>
    The bright red section is where I need help. Also, I`ve replaced the usual "žd" with "pe" just because it goes with the website name, if "id" will make it function better, feel free to change it.

  2. #2
    Member
    Join Date
    Oct 2009
    Posts
    97
    Hi welcome to the forums

    If you would like some help with your PHP file, then you need to show us your PHP file. Clearly index.php is working in some fashion as your page changes when you click on the tabs. Incidentally it's best not to use images for text as screen readers can't read them. If you need to style text use CSS to produced the look you are after.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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