Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Geek Culture / David T - Question

Author
Message
Hoss
20
Years of Service
User Offline
Joined: 7th Jun 2004
Location: Someplace with a PC
Posted: 16th Jul 2004 22:59 Edited at: 19th Jul 2004 03:18
FIXED

There's no problem so large it can't be solved by killing the user off, deleting their files, closing their account and reporting their REAL earnings to the IRS.
C l a r k
20
Years of Service
User Offline
Joined: 18th Apr 2004
Location: Rhode Island...State motto: Who Cares?
Posted: 16th Jul 2004 23:57
Do you mean make it "index.php?page=about" make it include about.php?




Then you would make a directory called "pages" and put about.php in there.

If you felt so inclined, you could even make every single page on index.php.




Sorry for my lengthly and unneeded descriptions....I used to write php tutorials, I guess its a habit



READ IF YOU DON'T KNOW WHAT $_GET[' '] IS:
By the way, $_GET[' '] is means to "get" the value of a certain varibable stored in the url. The word in the [' '] is the variable its value is returned as.

For instance, if the page was "index.php?test=3"
Then

Would print "3" on the page.
It can work with multiple variables.

index.php?test=3&testagain=1

This would print "4" on the page.

Dave J
Retired Moderator
21
Years of Service
User Offline
Joined: 11th Feb 2003
Location: Secret Military Pub, Down Under
Posted: 17th Jul 2004 00:00
You actually don't need to $_GET[] them, just it's better 'practice' to.


"Computers are useless they can only give you answers."
David T
Retired Moderator
22
Years of Service
User Offline
Joined: 27th Aug 2002
Location: England
Posted: 17th Jul 2004 00:09 Edited at: 17th Jul 2004 00:10


Lets say that the above page is in a file called site.php. It doesn't have to be called that, it's just an example.

Now, create a folder called "pages" and create a folder within that called "about". Place in "about" a file called index.html containing some content.

Now call site.php?about/ and you'll be shown the index.html within about/. You can add more directories within the pages folder and to call their content just call site.php?directoryname/.

Get 15 new commands, all the date / time commands left out of DBPro for free!
DOWNLOAD PLUGINS HERE: http://www.davidtattersall.me.uk/ and select "DarkBasic"
Hoss
20
Years of Service
User Offline
Joined: 7th Jun 2004
Location: Someplace with a PC
Posted: 17th Jul 2004 00:18 Edited at: 19th Jul 2004 03:18
[EDIT] FIXED

There's no problem so large it can't be solved by killing the user off, deleting their files, closing their account and reporting their REAL earnings to the IRS.
David T
Retired Moderator
22
Years of Service
User Offline
Joined: 27th Aug 2002
Location: England
Posted: 17th Jul 2004 00:20
Yes. It makes a template system very easy.

Get 15 new commands, all the date / time commands left out of DBPro for free!
DOWNLOAD PLUGINS HERE: http://www.davidtattersall.me.uk/ and select "DarkBasic"
C l a r k
20
Years of Service
User Offline
Joined: 18th Apr 2004
Location: Rhode Island...State motto: Who Cares?
Posted: 17th Jul 2004 01:02
Quote: "You actually don't need to $_GET[] them, just it's better 'practice' to."


Yeah, but older versions of IE need it, so I always use them.

Jeku
Moderator
21
Years of Service
User Offline
Joined: 4th Jul 2003
Location: Vancouver, British Columbia, Canada
Posted: 17th Jul 2004 04:19
Quote: " You actually don't need to $_GET[] them, just it's better 'practice' to."


I've switched between webhosts quite a few times, and I've found that some of them need this and some don't--- so a good idea is to use that new style for everything. In the future if you have to move your site to another host you won't have to go through your entire site and update it later

Hoss
20
Years of Service
User Offline
Joined: 7th Jun 2004
Location: Someplace with a PC
Posted: 17th Jul 2004 09:35 Edited at: 17th Jul 2004 09:36
NVM...fixed

There's no problem so large it can't be solved by killing the user off, deleting their files, closing their account and reporting their REAL earnings to the IRS.
Hoss
20
Years of Service
User Offline
Joined: 7th Jun 2004
Location: Someplace with a PC
Posted: 17th Jul 2004 20:43 Edited at: 19th Jul 2004 03:19
[EDIT] Thanks everybody for your time and help.

There's no problem so large it can't be solved by killing the user off, deleting their files, closing their account and reporting their REAL earnings to the IRS.
Hoss
20
Years of Service
User Offline
Joined: 7th Jun 2004
Location: Someplace with a PC
Posted: 17th Jul 2004 23:14
hm........i tried renaming it, it still doesn't work.

There's no problem so large it can't be solved by killing the user off, deleting their files, closing their account and reporting their REAL earnings to the IRS.
Hoss
20
Years of Service
User Offline
Joined: 7th Jun 2004
Location: Someplace with a PC
Posted: 18th Jul 2004 02:31
bump - dont mean to bump my own post, but this problem is really buggin me

There's no problem so large it can't be solved by killing the user off, deleting their files, closing their account and reporting their REAL earnings to the IRS.
Hoss
20
Years of Service
User Offline
Joined: 7th Jun 2004
Location: Someplace with a PC
Posted: 18th Jul 2004 03:39
bump - dont mean to bump my own post, but this problem is really buggin me.

There's no problem so large it can't be solved by killing the user off, deleting their files, closing their account and reporting their REAL earnings to the IRS.
Hoss
20
Years of Service
User Offline
Joined: 7th Jun 2004
Location: Someplace with a PC
Posted: 18th Jul 2004 03:46
bump - dont mean to bump my own post, but this problem is really buggin me..

There's no problem so large it can't be solved by killing the user off, deleting their files, closing their account and reporting their REAL earnings to the IRS.
Hoss
20
Years of Service
User Offline
Joined: 7th Jun 2004
Location: Someplace with a PC
Posted: 18th Jul 2004 08:42
Please, anybody who can help.

There's no problem so large it can't be solved by killing the user off, deleting their files, closing their account and reporting their REAL earnings to the IRS.
Hoss
20
Years of Service
User Offline
Joined: 7th Jun 2004
Location: Someplace with a PC
Posted: 18th Jul 2004 21:38
*whistle* HELP *whistle*

There's no problem so large it can't be solved by killing the user off, deleting their files, closing their account and reporting their REAL earnings to the IRS.
adr
21
Years of Service
User Offline
Joined: 21st May 2003
Location: Job Centre
Posted: 18th Jul 2004 21:45
Why have you been using $_SERVER['QUERY_STRING'] rather than $_GET['page']?

I haven't read DavidT's tutorial/solution, because I'd rather just make my own solution (sorry DavidT, I'm sure you know what it's like to use someone else's code when you can just do it yourself ). But using the QUERY_STRING usually doesn't make sense if you're trying to pass around variables.

learn to use print_r - it rules for debugging. Also, learn not to bump a post 4 times in a single day. Surefire way to piss people off.

Floats like a butterfly, stings like when I pee
Hoss
20
Years of Service
User Offline
Joined: 7th Jun 2004
Location: Someplace with a PC
Posted: 18th Jul 2004 22:41
Well....i am just trying to make it so page.php processes the infromation on the page I want included, and then include the page specified.

<?
$file = "pages/".$_GET['page'].".html";
if (file_exists($file)) { include ($file); }
else { print "404 error" }
?>

and I call the page I want like this

page.php?page=index

And yet, none of the contents of page/index.html shows up.

There's no problem so large it can't be solved by killing the user off, deleting their files, closing their account and reporting their REAL earnings to the IRS.
Dave J
Retired Moderator
21
Years of Service
User Offline
Joined: 11th Feb 2003
Location: Secret Military Pub, Down Under
Posted: 18th Jul 2004 23:27
Does it print "404 error" or does the page just _not_ show up?


"Computers are useless they can only give you answers."
Hoss
20
Years of Service
User Offline
Joined: 7th Jun 2004
Location: Someplace with a PC
Posted: 19th Jul 2004 01:34
just doesn't show up at all...it doesn't print the error message

There's no problem so large it can't be solved by killing the user off, deleting their files, closing their account and reporting their REAL earnings to the IRS.
C l a r k
20
Years of Service
User Offline
Joined: 18th Apr 2004
Location: Rhode Island...State motto: Who Cares?
Posted: 19th Jul 2004 02:02
Try renaming to index.php (even if there's no php in there.)
I dunno if it makes a difference, but I always make my includes .php or .phtml.

Concept Software
STMCBA Battle Engine: http://forum.thegamecreators.com/?m=forum_view&t=35407&b=8
Team positions open!
Hoss
20
Years of Service
User Offline
Joined: 7th Jun 2004
Location: Someplace with a PC
Posted: 19th Jul 2004 02:12
Well, I have tried that, still to no avail.

There's no problem so large it can't be solved by killing the user off, deleting their files, closing their account and reporting their REAL earnings to the IRS.
Hoss
20
Years of Service
User Offline
Joined: 7th Jun 2004
Location: Someplace with a PC
Posted: 19th Jul 2004 03:18 Edited at: 19th Jul 2004 03:19
Thanks everybody for your help and support. It works now, not because my code was wrong, but because my previous host didn't support PHP, so I switched, and it now works.

Cheers

There's no problem so large it can't be solved by killing the user off, deleting their files, closing their account and reporting their REAL earnings to the IRS.
Wik
21
Years of Service
User Offline
Joined: 21st May 2003
Location: CT, United States
Posted: 19th Jul 2004 07:26
tee hee


David T
Retired Moderator
22
Years of Service
User Offline
Joined: 27th Aug 2002
Location: England
Posted: 24th Jul 2004 07:36
Quote: "I haven't read DavidT's tutorial/solution, because I'd rather just make my own solution (sorry DavidT, I'm sure you know what it's like to use someone else's code when you can just do it yourself ). But using the QUERY_STRING usually doesn't make sense if you're trying to pass around variables."


Yeah, I agree. I didn't want to pass around variables, just create a memorable URL that includes a path. Often, when = signs get in there it scares people off

Get 15 new commands, all the date / time commands left out of DBPro for free!
DOWNLOAD PLUGINS HERE: http://www.davidtattersall.me.uk/ and select "DarkBasic"

Login to post a reply

Server time is: 2024-09-22 08:40:56
Your offset time is: 2024-09-22 08:40:56