PHP Help

saul

"My goodness, that's odd."
  • 742
    Posts
    21
    Years
    I'm having a bit of trouble with my site XD I don't know how to set up PHP I've looked at tons of tutorials but I just can't do it. I have all of my pages up and the layout is done too. I know how to make the links for the layout but I don't know how to get the content to appear in the middle. Can someone help?
     
    Can you give us the code you're trying to use?
     
    Just copy the code from your index file into here using the
    PHP:
     tag.[/color]
     
    Copy and paste the code here using the {php}{/php} tags so Greggy can look at it...
     
    Both is probably best. o.o
     
    Open index.php in notepad. Hit CTRL-A, then CTRL-C.

    Then in the reply box type
    PHP:
     and then hit CTRL-V.  Then type [*/php] (without the star) and you're done. -_-[/color]
     
    Sorry JK I ws really confused I hope this is what you wanted

    PHP:
    <HTML><HEAD><TITLE>:: Pokemon Sky</TITLE>
    <STYLE type=text/css>
    a:hover{text-transform:uppercase}
    </STYLE>
    
    <META content=Pokemon name=description>
    <META content=Pokemon name=keywords>
    <META content=Pokemon name=author Sky>
    <META content="10 days" name=revisit-after>
    <META content=Pokemon name=copyright Sky>
    <META content=Global name=distribution>
    <META content=General name=rating>
    <META content="index, follow" name=robots>
    <META content="index, follow" name=googlebot>
    <META http-equiv=content-type content="text/html; charset=iso-8859-1"><LINK media=screen href="" type=text/css rel=stylesheet>
    <META content="MSHTML 6.00.2800.1400" name=GENERATOR></HEAD>
    <BODY oncontextmenu="return false" background=https://img.photobucket.com/albums/v330/saulito/bg.png ontextcommand="retun false">
    <DIV id=layer1 style="LEFT: 0px; POSITION: absolute; TOP: 0px"><FONT face=Arial><IMG alt="" src="https://img.photobucket.com/albums/v330/saulito/pslayout/top.png"></FONT></DIV>
    <DIV id=layer1 style="Z-INDEX: 1; LEFT: 26px; WIDTH: 107px; POSITION: absolute; TOP: 91px; HEIGHT: 486px" align=center><FONT size=4></FONT>
    <DIV align=left><FONT face=Arial size=1>:: Catagory</FONT></DIV>
    <DIV align=left><FONT face=Arial size=1>>Link</FONT></DIV>
    <DIV align=left><FONT face=Arial size=1>>Link</FONT></DIV>
    <DIV align=left><FONT face=Arial size=1>>Link</FONT></DIV>
    <DIV align=left><FONT face=Arial size=1>>Link</FONT></DIV>
    <DIV align=left><FONT face=Arial size=1>>Link</FONT> 
    <DIV align=left><FONT face=Arial size=1>:: Catagory</FONT></DIV>
    <DIV align=left><FONT face=Arial size=1>>Link</FONT></DIV>
    <DIV align=left><FONT face=Arial size=1>>Link</FONT></DIV>
    <DIV align=left><FONT face=Arial size=1>>Link</FONT></DIV>
    <DIV align=left><FONT face=Arial size=1>>Link</FONT></DIV>
    <DIV align=left><FONT face=Arial size=1>>Link</FONT> 
    <DIV align=left><FONT face=Arial size=1>:: Catagory</FONT></DIV>
    <DIV align=left><FONT face=Arial size=1>>Link</FONT></DIV>
    <DIV align=left><FONT face=Arial size=1>>Link</FONT></DIV>
    <DIV align=left><FONT face=Arial size=1>>Link</FONT></DIV>
    <DIV align=left><FONT face=Arial size=1>>Link</FONT></DIV>
    <DIV align=left><FONT face=Arial size=1>>Link</FONT> 
    <DIV align=left><FONT face=Arial size=1>:: Catagory</FONT></DIV>
    <DIV align=left><FONT face=Arial size=1>>Link</FONT></DIV>
    <DIV align=left><FONT face=Arial size=1>>Link</FONT></DIV>
    <DIV align=left><FONT face=Arial size=1>>Link</FONT></DIV>
    <DIV align=left><FONT face=Arial size=1>>Link</FONT></DIV>
    <DIV align=left><FONT face=Arial size=1>>Link 
    <DIV align=left>:: Catagory</DIV>
    <DIV align=left>>Link</DIV>
    <DIV align=left>>Link</DIV>
    <DIV align=left>>Link</DIV>
    <DIV align=left>>Link</DIV>
    <DIV align=left>>Link 
    <DIV align=left>:: Catagory</DIV>
    <DIV align=left>>Link</DIV>
    <DIV align=left>>Link</DIV>
    <DIV align=left>>Link</DIV>
    <DIV align=left>>Link</DIV>
    <DIV align=left>>Link</DIV></DIV></FONT></DIV></DIV></DIV></DIV></DIV>
    <DIV id=layer1 style="Z-INDEX: 1; LEFT: 655px; WIDTH: 102px; POSITION: absolute; TOP: 115px; HEIGHT: 320px">
    <P align=center><STRONG><FONT face=Arial></FONT></STRONG></P>
    <DIV align=left>
    <DIV align=left><FONT face=Arial size=1>:: Catagory</FONT></DIV>
    <DIV align=left><FONT face=Arial size=1>>Link</FONT></DIV>
    <DIV align=left><FONT face=Arial size=1>>Link</FONT></DIV>
    <DIV align=left><FONT face=Arial size=1>>Link</FONT></DIV>
    <DIV align=left><FONT face=Arial size=1>>Link</FONT></DIV>
    <DIV align=left><FONT face=Arial size=1>>Link</FONT> 
    <DIV align=left><FONT face=Arial size=1>:: Catagory</FONT></DIV>
    <DIV align=left><FONT face=Arial size=1>>Link</FONT></DIV>
    <DIV align=left><FONT face=Arial size=1>>Link</FONT></DIV>
    <DIV align=left><FONT face=Arial size=1>>Link</FONT></DIV>
    <DIV align=left><FONT face=Arial size=1>>Link</FONT></DIV>
    <DIV align=left><FONT face=Arial size=1>>Link</FONT> 
    <DIV align=left><FONT face=Arial size=1>:: Catagory</FONT></DIV>
    <DIV align=left><FONT face=Arial size=1>>Link</FONT></DIV>
    <DIV align=left><FONT face=Arial size=1>>Link</FONT></DIV>
    <DIV align=left><FONT face=Arial size=1>>Link</FONT></DIV>
    <DIV align=left><FONT face=Arial size=1>>Link</FONT></DIV>
    <DIV align=left><FONT face=Arial size=1>>Link</FONT></DIV></DIV></DIV></DIV></B></B></DIV>
    <DIV id=layer1 style="Z-INDEX: 1; LEFT: 162px; WIDTH: 461px; POSITION: absolute; TOP: 104px; HEIGHT: 360px" align=center><B><FONT face=Arial>
    <P align=center><FONT face=Arial size=1>CONTENT HERE!!</FONT></P></FONT></B></DIV></BODY></HTML>
     
    O__o;

    That looks like it's all navigation bars. o__O
     
    I'm guessing you want to use PHP includes? If so, then you would put <?php include("filename.whatever"); ?> instead of "CONTENT HERE!!". =\ If not, show us the PHP code you're trying to use.
     
    Put this code:
    PHP:
    <?php
    if (!$id) {
    $id = "main";
    $include = $id . ".txt";
    }
    else {
    $include = $id . ".html";
    }
    if (is_file($include) == "1") {
            include $include;
    }
    else {
    include "404.txt";
    }
    ?>
    Where the content should go. Then for links, you put:
    PHP:
    index.php?id=pagename
    Replace pagename with the page's name. Then make a .txt or .html file with the name of whatever you put in the link. That's it. The page dosen't need the headers(<html>,<body>) or footers(</html>,</body>), but you can if you want. main.txt will be the first page that shows up in the content area. That is where you would input your news script code and welcome stuff. Basically, make pages like you would do in frames.
    You can also make a 404.txt in case that a page doesn't exsist.
     
    Keep in mind that you can change the ".txt" thing to be whatever your main page is...
     
    Kip-kip said:
    Put this code:
    PHP:
    <?php
    if (!$id) {
    $id = "main";
    $include = $id . ".txt";
    }
    else {
    $include = $id . ".html";
    }
    if (is_file($include) == "1") {
            include $include;
    }
    else {
    include "404.txt";
    }
    ?>
    Where the content should go. Then for links, you put:
    PHP:
    index.php?id=pagename
    Replace pagename with the page's name. Then make a .txt or .html file with the name of whatever you put in the link. That's it. The page dosen't need the headers(<html>,<body>) or footers(</html>,</body>), but you can if you want. main.txt will be the first page that shows up in the content area. That is where you would input your news script code and welcome stuff. Basically, make pages like you would do in frames.
    You can also make a 404.txt in case that a page doesn't exsist.

    Okay.. It's not working.
    Here's the Code of the layout
    PHP:
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
    <!-- saved from url=(0045)https://www.freewebs.com/pikachuda/pkmnsky.htm -->
    <HTML><HEAD><TITLE>:: Pokemon Sky</TITLE>
    <STYLE type=text/css>A:hover {
    	TEXT-TRANSFORM: uppercase
    }
    </STYLE>
    
    <META content=Pokemon name=description>
    <META content=Pokemon name=keywords>
    <META content=Pokemon name=author Sky>
    <META content="10 days" name=revisit-after>
    <META content=Pokemon name=copyright Sky>
    <META content=Global name=distribution>
    <META content=General name=rating>
    <META content="index, follow" name=robots>
    <META content="index, follow" name=googlebot>
    <META http-equiv=content-type content="text/html; charset=iso-8859-1"><LINK 
    media=screen href="" type=text/css rel=stylesheet>
    <META content="MSHTML 6.00.2800.1400" name=GENERATOR></HEAD>
    <BODY oncontextmenu="return false" background=https://dhost.info/pkmnsky/index_files/bg.png 
    ontextcommand="retun false">
    <DIV id=layer1 style="LEFT: 0px; POSITION: absolute; TOP: 0px"><FONT 
    face=Arial><IMG alt="" src="https://dhost.info/pkmnsky/index_files/top.png"></FONT></DIV>
    <DIV id=layer1 
    style="Z-INDEX: 1; LEFT: 26px; WIDTH: 107px; POSITION: absolute; TOP: 91px; HEIGHT: 486px" 
    align=center>
    <DIV align=left><FONT face=Arial size=1>Home</FONT></DIV>
    <DIV align=left><FONT face=Arial size=1>Staff</FONT></DIV>
    <DIV align=left><FONT face=Arial size=1>Staff Login</FONT></DIV>
    <DIV align=left><FONT face=Arial size=1>Project X Forums</FONT></DIV>
    <DIV align=left><FONT face=Arial size=1></FONT>
    <DIV align=left><FONT face=Arial size=1>Downloads</FONT></DIV>
    <DIV align=left><FONT face=Arial size=1>RPG</FONT></DIV>
    <DIV align=left><FONT face=Arial size=1>Affiliation</FONT></DIV>
    <DIV align=left><FONT face=Arial size=1>Topsites</FONT></DIV>
    <DIV align=left><FONT face=Arial size=1>Spanish Site</FONT></DIV><BR>
    <DIV align=left><FONT face=Arial size=1>:: Pokemon</FONT></DIV>
    <DIV align=left><FONT face=Arial size=1>Characters</FONT></DIV>
    <DIV align=left><FONT face=Arial size=1>Episode List</FONT></DIV>
    <DIV align=left><FONT face=Arial size=1>Episode Summarys</FONT></DIV>
    <DIV align=left><FONT face=Arial size=1></FONT> </DIV>
    <DIV align=left><FONT face=Arial size=1></FONT>
    <DIV align=left><FONT face=Arial size=1>:: GameBoy Games</FONT></DIV>
    <DIV align=left><FONT face=Arial size=1>Red/Blue/Yellow Version</FONT></DIV>
    <DIV align=left><FONT face=Arial size=1>Gold/Silver/Crystal Version</FONT></DIV>
    <DIV align=left><FONT face=Arial size=1>Ruby/Sapphire Version</FONT></DIV>
    <DIV align=left><FONT face=Arial size=1>Emerald Version</FONT></DIV>
    <DIV align=left><FONT face=Arial size=1></FONT> </DIV>
    <DIV align=left><FONT face=Arial size=1><STRONG>:: Nintendo 64 
    Games</STRONG></FONT></DIV>
    <DIV align=left>
    <DIV align=left><FONT face=Arial size=1>Pokemon Stadium</FONT></DIV>
    <DIV align=left><FONT face=Arial size=1>Super Smash Bros.</FONT></DIV>
    <DIV align=left><FONT face=Arial size=1>Hey You Pikachu!</FONT></DIV>
    <DIV align=left><FONT face=Arial size=1>Pokemon Snap</FONT></DIV>
    <DIV align=left><FONT face=Arial size=1>
    <DIV align=left>Pokemon Stadium 2</DIV>
    <DIV align=left>:: GameCube Games</DIV>
    <DIV align=left>Super Smash Bros. Melee</DIV>
    <DIV align=left>Pokemon Colloseum</DIV>
    <DIV align=left>Pokemon Box</DIV>
    <DIV align=left> </DIV>
    <DIV align=left>Diamond/Pearl</DIV>
    <DIV align=left> </DIV>
    <DIV align=left><STRONG>:: Movies</STRONG></DIV>
    <DIV align=left>
    <DIV align=left>Mewtwo Strikes Back</DIV>
    <DIV align=left>The Power Of One</DIV>
    <DIV align=left>Spell Of The Unown</DIV>
    <DIV align=left>Pokemon Heroes</DIV>
    <DIV align=left>Destiny Deoxys</DIV>
    <DIV align=left> </DIV>
    <DIV align=left>
    <DIV align=left><STRONG>:: Webmasters</STRONG></DIV>
    <DIV align=left>
    <DIV align=left>Free Buttons</DIV>
    <DIV align=left>Free Banners</DIV>
    <DIV align=left>Free 
    Layouts</DIV></DIV></DIV></DIV></FONT></DIV></DIV></DIV></DIV></DIV>
    <DIV id=layer1 
    style="Z-INDEX: 1; LEFT: 655px; WIDTH: 102px; POSITION: absolute; TOP: 115px; HEIGHT: 320px">
    <P align=center><STRONG><FONT face=Arial></FONT></STRONG></P>
    <DIV align=left>
    <DIV align=left><FONT face=Arial size=1>:: Catagory</FONT></DIV>
    <DIV align=left><FONT face=Arial size=1>>Link</FONT></DIV>
    <DIV align=left><FONT face=Arial size=1>>Link</FONT></DIV>
    <DIV align=left><FONT face=Arial size=1>>Link</FONT></DIV>
    <DIV align=left><FONT face=Arial size=1>>Link</FONT></DIV>
    <DIV align=left><FONT face=Arial size=1>>Link</FONT> 
    <DIV align=left><FONT face=Arial size=1>:: Catagory</FONT></DIV>
    <DIV align=left><FONT face=Arial size=1>>Link</FONT></DIV>
    <DIV align=left><FONT face=Arial size=1>>Link</FONT></DIV>
    <DIV align=left><FONT face=Arial size=1>>Link</FONT></DIV>
    <DIV align=left><FONT face=Arial size=1>>Link</FONT></DIV>
    <DIV align=left><FONT face=Arial size=1>>Link</FONT> 
    <DIV align=left><FONT face=Arial size=1>:: Catagory</FONT></DIV>
    <DIV align=left><FONT face=Arial size=1>>Link</FONT></DIV>
    <DIV align=left><FONT face=Arial size=1>>Link</FONT></DIV>
    <DIV align=left><FONT face=Arial size=1>>Link</FONT></DIV>
    <DIV align=left><FONT face=Arial size=1>>Link</FONT></DIV>
    <DIV align=left><FONT face=Arial 
    size=1>>Link</FONT></DIV></DIV></DIV></DIV></B></B></DIV>
    <DIV id=layer1 
    style="Z-INDEX: 1; LEFT: 162px; WIDTH: 461px; POSITION: absolute; TOP: 104px; HEIGHT: 360px" 
    align=center><B><FONT face=Arial>
    <P align=center><FONT face=Arial size=1>
    <?php 
    if (!$id) { 
    $id = "main"; 
    $include = $id . "main.txt"; 
    } 
    else { 
    $include = $id . ".html"; 
    } 
    if (is_file($include) == "1") { 
            include $include; 
    } 
    else { 
    include "404.txt"; 
    } 
    ?></FONT></P></FONT></B></DIV></BODY></HTML>

    The page of the index is:
    https://dhost.info/pkmnsky/index.php
    The Page of the main page is:
    https://dhost.ifno/pkmnsky/main.txt

    Nothing is showing up on index.php can someone help?
     
    Does your host surpport PHP? Because if it didn't work, it would show a PHP error message.
     
    Ya it supports it and I even tried it on Hostultra (I know for sure they support PHP) and Nothing came up.

    Edit: Never mind It has to do with the host XD I have finally learned how to do it XD Thanks everyone
     
    Last edited:
    Good luck then :P. I hope you get it working.
     
    Back
    Top