[Dreamweaver] Open Content Inside of a Template [Help]

Discussion in 'HTML & Website Design' started by Kriptonyc, Nov 21, 2010.

  1. #1
    Ok So I just finished all the coding for my webpage and am currently tieing everything together in dreamweaver. I want to make it to my hompage always stays the same and when someone clicks on a link(ect) the content opens in the middle of the page(I dont care if the whole page refreshes) I just dont want my picture layout changing.

    So Heres how ive attempted it so far:

    <?php
    session_start(); // start up your PHP session! 
    ?>
    <?php
    $title = "Home";
    $keywords = "paid to shrink, paid to shorten, shorten urls, url shortner";
    $description = "Earn money shrinking urls and sharing them with your friends";
    if(isset($_GET['ref']))
    {
    setcookie("ref_id",intval($_GET['ref']),time()+3600);
    }
    ?>
    <?php
    if(!isset($_GET['menu']))
    {
    ?>
    <?php
    include('inc/header.php');
    ?>
    <html>
    *Styles and HTML HERE
    <tr>
    <td colspan="9">
    <img src="images/footer.jpg" width="1020" height="72" alt=""></td>
    </tr>
    <tr>
    <td>
    <img src="images/spacer.gif" width="57" height="1" alt=""></td>
    <td>
    <img src="images/spacer.gif" width="87" height="1" alt=""></td>
    <td>
    <img src="images/spacer.gif" width="98" height="1" alt=""></td>
    <td>
    <img src="images/spacer.gif" width="103" height="1" alt=""></td>
    <td>
    <img src="images/spacer.gif" width="76" height="1" alt=""></td>
    <td>
    <img src="images/spacer.gif" width="179" height="1" alt=""></td>
    <td>
    <img src="images/spacer.gif" width="148" height="1" alt=""></td>
    <td>
    <img src="images/spacer.gif" width="116" height="1" alt=""></td>
    <td>
    <img src="images/spacer.gif" width="156" height="1" alt=""></td>
    </tr>
    </table>
    </div>
    <!-- End Save for Web Slices -->
    <?php
    }
    else
    {
    $user = array("usercp","advertise","contact","community","howto","tos","privacy");
    $guest = array("login","register","contact","activateaccount","community","activate","forgotpass","tos","privacy","howto");
    $page = $_GET['menu'];
    switch($_SESSION['tt_level'])
    {
    case '1'://user
    if(in_array($page,$user))
    {
    define('admin','1');
    include('inc/'.$page.'.php');
    }
    elseif(in_array($page,$guest))
    {
    echo "<center><span class='heading'>Only guests or users that are not logged in can visit this page.</span></center>";
    }
    else
    {
    echo "<center><span class='heading'>Sorry but the page you were looking for does not exist</span></center>";
    }
    break;
    default:
    if(in_array($page,$guest))
    {
    define('admin','1');
    include('inc/'.$page.'.php');
    }
    elseif(in_array($page,$user))
    {
    echo "<center><span class='heading'>You must <a href='index.php?menu=login'>Login</a> or <a href='index.php?menu=register'>Register</a> to view this page</span></center>";
    }
    else
    {
    echo "<center><span class='heading'>Sorry but the page you were looking for does not exist</span></center>";
    }
    break;
    }
    }
    ?>
    </body>
    </html>
    Code (markup):
    and then I link off to other codes like this:

    index.php?menu=login
    Code (markup):
    I used to be using a header file that was an image and using CSS styles for it but I needed More versatality so I removed the links and images in the header and imported a layout that was in photoshop.

    Now I cant find a way to get the same result :/

    ANYONE KNOW HOW!?

    -Thanks
     
    Kriptonyc, Nov 21, 2010 IP
  2. GWiz

    GWiz Peon

    Messages:
    359
    Likes Received:
    17
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Not quite sure what you are trying to achieve, but I am thinking you could consider using htaccess rewrites to get the effect you want. Please clarify what you are trying to achieve.
     
    GWiz, Nov 22, 2010 IP
  3. boggledash

    boggledash Peon

    Messages:
    6
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Interesting problem - I think you need to seek out professional technical assistance.
     
    boggledash, Nov 22, 2010 IP
  4. CSM

    CSM Active Member

    Messages:
    1,047
    Likes Received:
    25
    Best Answers:
    0
    Trophy Points:
    55
    #4
    Yeah, and besides that, learn some HTML/CSS first. Using tables for layout is not the right way.

    Just to mention that your "HTML code" is incomplete anyway, and very very bad.

    No DOCTYPE, no <head></head>, i can not see any <body> tag,...

    
    <html>
    *Styles and HTML HERE
    <tr>
    <td colspan="9">
    <img src="images/footer.jpg" width="1020" height="72" alt=""></td>
    </tr>
    <tr>
    <td>
    <img src="images/spacer.gif" width="57" height="1" alt=""></td>
    <td>
    <img src="images/spacer.gif" width="87" height="1" alt=""></td>
    <td>
    <img src="images/spacer.gif" width="98" height="1" alt=""></td>
    <td>
    <img src="images/spacer.gif" width="103" height="1" alt=""></td>
    <td>
    <img src="images/spacer.gif" width="76" height="1" alt=""></td>
    <td>
    <img src="images/spacer.gif" width="179" height="1" alt=""></td>
    <td>
    <img src="images/spacer.gif" width="148" height="1" alt=""></td>
    <td>
    <img src="images/spacer.gif" width="116" height="1" alt=""></td>
    <td>
    <img src="images/spacer.gif" width="156" height="1" alt=""></td>
    </tr>
    </table>
    </div>
    
    Code (markup):
    If you have that stuff online, give a me link please :D

    Oh just to mention: what you want to achieve can be done easily with AJAX (I would do it with jQuery .load() )
     
    CSM, Nov 23, 2010 IP
  5. Kriptonyc

    Kriptonyc Peon

    Messages:
    24
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #5
    The head tags (ect) are in other pieces of the code such as the footer which are loading along with the header.

    Basically I have it setup so the header loads then each page displays "blah blah blah" and then the footer loads ^.^

    You can check it out at clx.me

    I'm trying to make it so the body currently displays a background but am having some serious issues :/ I'll send you a pm
    Anyone got msn?
     
    Kriptonyc, Nov 30, 2010 IP