PHP Help

Started by saul October 17th, 2004 2:14 PM
  • 641 views
  • 18 replies

saul

"My goodness, that's odd."

Age 31
LOL, at my House
Seen March 21st, 2015
Posted August 23rd, 2013
742 posts
19.2 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?

aRedMoon

Wait for me outside the lines

Age 34
Male
Minnesota
Seen April 23rd, 2018
Posted September 10th, 2013
11,126 posts
19.2 Years
Can you give us the code you're trying to use?
facebook \\ twitter \\ blog a.k.a life // tumblr // google+

june 10, 2003 = registered at old pc
march 24, 2004 = registered at new pc
june, 2004 = modded ;;; august, 2004 = quit/fired (point of debate)
december, 2004 = banned ;;; december 2, 2005 = unbanned
june 10, 2008 = omg... five years!
june 10, 2012 = countdown to nine years on pc...

aRedMoon

Wait for me outside the lines

Age 34
Male
Minnesota
Seen April 23rd, 2018
Posted September 10th, 2013
11,126 posts
19.2 Years
Just copy the code from your index file into here using the [php] tag.
facebook \\ twitter \\ blog a.k.a life // tumblr // google+

june 10, 2003 = registered at old pc
march 24, 2004 = registered at new pc
june, 2004 = modded ;;; august, 2004 = quit/fired (point of debate)
december, 2004 = banned ;;; december 2, 2005 = unbanned
june 10, 2008 = omg... five years!
june 10, 2012 = countdown to nine years on pc...

Cherrim

Age 34
she / her
Toronto
Seen 20 Hours Ago
Posted 20 Hours Ago
33,052 posts
20.4 Years
Both is probably best. o.o


paired with professor plum.

aRedMoon

Wait for me outside the lines

Age 34
Male
Minnesota
Seen April 23rd, 2018
Posted September 10th, 2013
11,126 posts
19.2 Years
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. -_-
facebook \\ twitter \\ blog a.k.a life // tumblr // google+

june 10, 2003 = registered at old pc
march 24, 2004 = registered at new pc
june, 2004 = modded ;;; august, 2004 = quit/fired (point of debate)
december, 2004 = banned ;;; december 2, 2005 = unbanned
june 10, 2008 = omg... five years!
june 10, 2012 = countdown to nine years on pc...

saul

"My goodness, that's odd."

Age 31
LOL, at my House
Seen March 21st, 2015
Posted August 23rd, 2013
742 posts
19.2 Years
Sorry JK I ws really confused I hope this is what you wanted


<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=http://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="http://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>&gt;Link</FONT></DIV>
<
DIV align=left><FONT face=Arial size=1>&gt;Link</FONT></DIV>
<
DIV align=left><FONT face=Arial size=1>&gt;Link</FONT></DIV>
<
DIV align=left><FONT face=Arial size=1>&gt;Link</FONT></DIV>
<
DIV align=left><FONT face=Arial size=1>&gt;Link</FONT
<
DIV align=left><FONT face=Arial size=1>:: Catagory</FONT></DIV>
<
DIV align=left><FONT face=Arial size=1>&gt;Link</FONT></DIV>
<
DIV align=left><FONT face=Arial size=1>&gt;Link</FONT></DIV>
<
DIV align=left><FONT face=Arial size=1>&gt;Link</FONT></DIV>
<
DIV align=left><FONT face=Arial size=1>&gt;Link</FONT></DIV>
<
DIV align=left><FONT face=Arial size=1>&gt;Link</FONT
<
DIV align=left><FONT face=Arial size=1>:: Catagory</FONT></DIV>
<
DIV align=left><FONT face=Arial size=1>&gt;Link</FONT></DIV>
<
DIV align=left><FONT face=Arial size=1>&gt;Link</FONT></DIV>
<
DIV align=left><FONT face=Arial size=1>&gt;Link</FONT></DIV>
<
DIV align=left><FONT face=Arial size=1>&gt;Link</FONT></DIV>
<
DIV align=left><FONT face=Arial size=1>&gt;Link</FONT
<
DIV align=left><FONT face=Arial size=1>:: Catagory</FONT></DIV>
<
DIV align=left><FONT face=Arial size=1>&gt;Link</FONT></DIV>
<
DIV align=left><FONT face=Arial size=1>&gt;Link</FONT></DIV>
<
DIV align=left><FONT face=Arial size=1>&gt;Link</FONT></DIV>
<
DIV align=left><FONT face=Arial size=1>&gt;Link</FONT></DIV>
<
DIV align=left><FONT face=Arial size=1>&gt;Link 
<DIV align=left>:: Catagory</DIV>
<
DIV align=left>&gt;Link</DIV>
<
DIV align=left>&gt;Link</DIV>
<
DIV align=left>&gt;Link</DIV>
<
DIV align=left>&gt;Link</DIV>
<
DIV align=left>&gt;Link 
<DIV align=left>:: Catagory</DIV>
<
DIV align=left>&gt;Link</DIV>
<
DIV align=left>&gt;Link</DIV>
<
DIV align=left>&gt;Link</DIV>
<
DIV align=left>&gt;Link</DIV>
<
DIV align=left>&gt;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>&gt;Link</FONT></DIV>
<
DIV align=left><FONT face=Arial size=1>&gt;Link</FONT></DIV>
<
DIV align=left><FONT face=Arial size=1>&gt;Link</FONT></DIV>
<
DIV align=left><FONT face=Arial size=1>&gt;Link</FONT></DIV>
<
DIV align=left><FONT face=Arial size=1>&gt;Link</FONT
<
DIV align=left><FONT face=Arial size=1>:: Catagory</FONT></DIV>
<
DIV align=left><FONT face=Arial size=1>&gt;Link</FONT></DIV>
<
DIV align=left><FONT face=Arial size=1>&gt;Link</FONT></DIV>
<
DIV align=left><FONT face=Arial size=1>&gt;Link</FONT></DIV>
<
DIV align=left><FONT face=Arial size=1>&gt;Link</FONT></DIV>
<
DIV align=left><FONT face=Arial size=1>&gt;Link</FONT
<
DIV align=left><FONT face=Arial size=1>:: Catagory</FONT></DIV>
<
DIV align=left><FONT face=Arial size=1>&gt;Link</FONT></DIV>
<
DIV align=left><FONT face=Arial size=1>&gt;Link</FONT></DIV>
<
DIV align=left><FONT face=Arial size=1>&gt;Link</FONT></DIV>
<
DIV align=left><FONT face=Arial size=1>&gt;Link</FONT></DIV>
<
DIV align=left><FONT face=Arial size=1>&gt;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

aRedMoon

Wait for me outside the lines

Age 34
Male
Minnesota
Seen April 23rd, 2018
Posted September 10th, 2013
11,126 posts
19.2 Years
O__o;

That looks like it's all navigation bars. o__O
facebook \\ twitter \\ blog a.k.a life // tumblr // google+

june 10, 2003 = registered at old pc
march 24, 2004 = registered at new pc
june, 2004 = modded ;;; august, 2004 = quit/fired (point of debate)
december, 2004 = banned ;;; december 2, 2005 = unbanned
june 10, 2008 = omg... five years!
june 10, 2012 = countdown to nine years on pc...

Cherrim

Age 34
she / her
Toronto
Seen 20 Hours Ago
Posted 20 Hours Ago
33,052 posts
20.4 Years
I'm guessing you want to use PHP includes? If so, then you would put instead of "CONTENT HERE!!". =\ If not, show us the PHP code you're trying to use.


paired with professor plum.

Kipkip

Join the Revolution

Age 32
Seen June 24th, 2007
Posted October 18th, 2005
968 posts
19.5 Years
Put this code:

<?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:

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.
Age 62
Male
Melbourne, Australia
Seen April 26th, 2018
Posted June 9th, 2014
11,439 posts
19.7 Years
Keep in mind that you can change the ".txt" thing to be whatever your main page is...


"One reason why mathematics enjoys special esteem, above all other sciences, is that its laws are absolutely certain and indisputable, while those of other sciences are to some extent debatable and in constant danger of being overthrown by newly discovered facts."
Albert Einstein

"What science can there be more noble, more excellent, more useful for men, more admirably high and demonstrative than mathematics."
Benjamin Franklin

"Mathematics, rightly viewed, possesses not only truth, but supreme beauty – a beauty cold and austere, like that of sculpture, without appeal to any part of our weaker nature, without the gorgeous trappings of paintings or music, yet sublimely pure and capable of a stern perfection such as only the greatest art can show."
Bertrand Russell

avatar and signature by FoxHound

ANNOY ME AT YOUR PERIL. I am becoming increasingly tired of the unmanly elitism and closed-mindedness of certain members who shall remain unnamed.

saul

"My goodness, that's odd."

Age 31
LOL, at my House
Seen March 21st, 2015
Posted August 23rd, 2013
742 posts
19.2 Years
Put this code:

<?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:

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

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">

<!-- saved from url=(0045)http://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=http://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="http://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>&nbsp;</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>&nbsp;</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>&nbsp;</DIV>
<DIV align=left>Diamond/Pearl</DIV>
<DIV align=left>&nbsp;</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>&nbsp;</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>&gt;Link</FONT></DIV>
<DIV align=left><FONT face=Arial size=1>&gt;Link</FONT></DIV>
<DIV align=left><FONT face=Arial size=1>&gt;Link</FONT></DIV>
<DIV align=left><FONT face=Arial size=1>&gt;Link</FONT></DIV>
<DIV align=left><FONT face=Arial size=1>&gt;Link</FONT> 
<DIV align=left><FONT face=Arial size=1>:: Catagory</FONT></DIV>
<DIV align=left><FONT face=Arial size=1>&gt;Link</FONT></DIV>
<DIV align=left><FONT face=Arial size=1>&gt;Link</FONT></DIV>
<DIV align=left><FONT face=Arial size=1>&gt;Link</FONT></DIV>
<DIV align=left><FONT face=Arial size=1>&gt;Link</FONT></DIV>
<DIV align=left><FONT face=Arial size=1>&gt;Link</FONT> 
<DIV align=left><FONT face=Arial size=1>:: Catagory</FONT></DIV>
<DIV align=left><FONT face=Arial size=1>&gt;Link</FONT></DIV>
<DIV align=left><FONT face=Arial size=1>&gt;Link</FONT></DIV>
<DIV align=left><FONT face=Arial size=1>&gt;Link</FONT></DIV>
<DIV align=left><FONT face=Arial size=1>&gt;Link</FONT></DIV>
<DIV align=left><FONT face=Arial 
size=1>&gt;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:
http://dhost.info/pkmnsky/index.php
The Page of the main page is:
http://dhost.ifno/pkmnsky/main.txt

Nothing is showing up on index.php can someone help?

saul

"My goodness, that's odd."

Age 31
LOL, at my House
Seen March 21st, 2015
Posted August 23rd, 2013
742 posts
19.2 Years
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
Age 62
Male
Melbourne, Australia
Seen April 26th, 2018
Posted June 9th, 2014
11,439 posts
19.7 Years
Good luck then :P. I hope you get it working.


"One reason why mathematics enjoys special esteem, above all other sciences, is that its laws are absolutely certain and indisputable, while those of other sciences are to some extent debatable and in constant danger of being overthrown by newly discovered facts."
Albert Einstein

"What science can there be more noble, more excellent, more useful for men, more admirably high and demonstrative than mathematics."
Benjamin Franklin

"Mathematics, rightly viewed, possesses not only truth, but supreme beauty – a beauty cold and austere, like that of sculpture, without appeal to any part of our weaker nature, without the gorgeous trappings of paintings or music, yet sublimely pure and capable of a stern perfection such as only the greatest art can show."
Bertrand Russell

avatar and signature by FoxHound

ANNOY ME AT YOUR PERIL. I am becoming increasingly tired of the unmanly elitism and closed-mindedness of certain members who shall remain unnamed.