Page 1 of 5 12345 LastLast
Results 1 to 10 of 49

Thread: .php headers?

  1. #1
    Join Date
    Oct 2006
    Posts
    12,405
    Tokens
    0

    Latest Awards:

    Default .php headers?

    I don't even know if that title makes sense, but I've decided to use a free coded layout to have a go at editing it and stuff.

    Anyway, this is the layout in question: http://www.habbville.com/site/files/.../L22/index.php

    As you can see, there's three boxes to the left each with a header. However the coding for the header is as follows, (this is the first box):

    Code:
    #nav_top {
      height: 22px;
      background-image: url(header.php?t=Navigation);
    }
    That's all fine and I love the idea of doing it that way, but when I open index.php to view in my browser, those headers don't display at all.

    I was wondering if anyone knew why this may be the case? (I also removed the script that makes the boxes slide up and down but the problem occured both before and after I did so).

    As a seperate question, if the folder has a main.php file with the home page's content, how do I make this actually display on the homepage? Or should I just continue adding the home page's content straight to index.php as I have been?

    Thanks in advance .
    Last edited by Black_Apalachi; 18-07-2009 at 05:23 PM.

  2. #2
    Join Date
    Apr 2009
    Location
    United Kingdom
    Posts
    1,111
    Tokens
    100

    Latest Awards:

    Default

    Quote Originally Posted by Robald View Post
    I don't even know if that title makes sense, but I've decided to use a free coded layout to have a go at editing it and stuff.

    Anyway, this is the layout in question: http://www.habbville.com/site/files/.../L22/index.php

    As you can see, there's three boxes to the left each with a header. However the coding for the header is as follows, (this is the first box):

    Code:
    #nav_top {
      height: 22px;
      background-image: url(header.php?t=Navigation);
    }
    That's all fine and I love the idea of doing it that way, but when I open index.php to view in my browser, those headers don't display at all.

    I was wondering if anyone knew why this may be the case? (I also removed the script that makes the boxes slide up and down but the problem occured both before and after I did so).

    As a seperate question, if the folder has a main.php file with the home page's content, how do I make this actually display on the homepage? Or should I just continue adding the home page's content straight to index.php as I have been?

    Thanks in advance .
    You got the header.php on ur server? In same directory.

    And to display homepage, <?php include 'pagetodisplay.php'; ?> inside the content area.

  3. #3
    Join Date
    Apr 2009
    Location
    Illinois, USA
    Posts
    130
    Tokens
    359

    Default

    Do you have PHP GD downloaded on your web server (or computer)?


    My last reputation was from ThisNameWillDo!.

  4. #4
    Join Date
    Oct 2006
    Posts
    12,405
    Tokens
    0

    Latest Awards:

    Default

    Quote Originally Posted by BoyBetterKnow View Post
    You got the header.php on ur server? In same directory.
    Yep. And this is what's in it if that helps:

    Code:
    <?php
    header("Content-type: image/png");
    $text = $_GET['t'];
    $im = imagecreatefrompng("images/top.png");
    $font = "volterb.ttf";
    $white = imagecolorallocate($im, 255, 255, 255);
    imagettftext($im, 7, 0, 9, 14, $white, $font, $text);
    imagepng($im);
    imagedestroy($im);
    ?>
    And to display homepage, <?php include 'pagetodisplay.php'; ?> inside the content area.
    I don't think I'm doing it right... I've put <?php include 'main.php'; ?> (with and without the question marks lol) between <!-- Start Main Content --> and <!-- End Content -->


    Quote Originally Posted by Foskett View Post
    Do you have PHP GD downloaded on your web server (or computer)?
    don't think so.. what's that?
    Last edited by Black_Apalachi; 18-07-2009 at 05:47 PM.

  5. #5
    Join Date
    Apr 2009
    Location
    United Kingdom
    Posts
    1,111
    Tokens
    100

    Latest Awards:

    Default

    Quote Originally Posted by Robald View Post
    Yep. And this is what's in it if that helps:

    Code:
    <?php
    header("Content-type: image/png");
    $text = $_GET['t'];
    $im = imagecreatefrompng("images/top.png");
    $font = "volterb.ttf";
    $white = imagecolorallocate($im, 255, 255, 255);
    imagettftext($im, 7, 0, 9, 14, $white, $font, $text);
    imagepng($im);
    imagedestroy($im);
    ?>
    I don't think I'm doing it right... I've put <?php include 'main.php'; ?> (with and without the question marks lol) between <!-- Start Main Content --> and <!-- End Content -->




    don't think so.. what's that?
    GD is what is needed to generate the images.

    and have u put the <?php include 'main.php'; ?> inside the <div id="content"> or w/e it is ??

    Also does images/top.png exist?

  6. #6
    Join Date
    Oct 2006
    Posts
    12,405
    Tokens
    0

    Latest Awards:

    Default

    Quote Originally Posted by BoyBetterKnow View Post
    GD is what is needed to generate the images.

    and have u put the <?php include 'main.php'; ?> inside the <div id="content"> or w/e it is ??

    Also does images/top.png exist?
    The other images work, so I must have that then. It is in the content div and the image does exist .

    Does the main.php file have to have anything in particular in it to work?


    Edit: on the topic of the content, the same thing happens with the navigation. The original layout has working navigation links but when I open the index.php in my browser they just bring a blank page an I haven't even touched them...
    Last edited by Black_Apalachi; 18-07-2009 at 06:19 PM.

  7. #7
    Join Date
    Apr 2009
    Location
    United Kingdom
    Posts
    1,111
    Tokens
    100

    Latest Awards:

    Default

    Quote Originally Posted by Robald View Post
    The other images work, so I must have that then. It is in the content div and the image does exist .

    Does the main.php file have to have anything in particular in it to work?


    Edit: on the topic of the content, the same thing happens with the navigation. The original layout has working navigation links but when I open the index.php in my browser they just bring a blank page an I haven't even touched them...
    I don't know what this specific script does. Perhaps the main incldue has got to have the $_GET page name.

  8. #8
    Join Date
    Oct 2006
    Posts
    12,405
    Tokens
    0

    Latest Awards:

    Default

    Quote Originally Posted by BoyBetterKnow View Post
    I don't know what this specific script does. Perhaps the main incldue has got to have the $_GET page name.
    so where would you add '$_GET'?

  9. #9
    Join Date
    Apr 2009
    Location
    United Kingdom
    Posts
    1,111
    Tokens
    100

    Latest Awards:

    Default

    Well I don't know how your script works.

    But say main.php or w/e was ur page processor you would do something like (on the index.php page u got).

    Well u would need to do $_GET['page']; before your include then it'd get it I suppose.

  10. #10
    Join Date
    Oct 2006
    Posts
    12,405
    Tokens
    0

    Latest Awards:

    Default

    Quote Originally Posted by BoyBetterKnow View Post
    Well I don't know how your script works.

    But say main.php or w/e was ur page processor you would do something like (on the index.php page u got).

    Well u would need to do $_GET['page']; before your include then it'd get it I suppose.
    how exactly would you add it though?

    for example I've tried:

    $_GET'main.php'<?php include 'main.php'; ?>

    <$_GET'main.php' ?php include 'main.php'; ?>

    <$_GET'main.php'><?php include 'main.php'; ?>

    <$_GET'main.php'; ?php include 'main.php'; ?>

    I know I'm a noob lol

    besides, it works fine in the one --ss-- has done, and all I've done is open the index.php in Firefox, so I don't see what can cause it... :S
    Last edited by Black_Apalachi; 18-07-2009 at 09:16 PM.

Page 1 of 5 12345 LastLast

Posting Permissions

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