|
Post by vegemitethief on May 6, 2004 9:09:17 GMT 10
I ordered a book on PHP to learn it, but I need to know something quick: how do you do a script in which you can make the same page display different content depending on what you click, like the way Matt does when he does all the hoax pages?
It's just one of my friend's webpages, theanimehaven.net, has a serious case of the HTML's, go to the site and see. There's no content yet, but I just wanna see if I can help...
|
|
|
Post by Matt_TY on May 7, 2004 14:18:48 GMT 10
I do it by passing variables in the URL i.e. the link to your hoaxpage, w. , is <a href = "hoaxmenu.php?hoaxer=wdot">
Then hoaxmenu.php has a line $hoaxer = $_GET['hoaxer']; that picks up on the "wdot" in the URL and opens your hoax data thusly:
$content = file("$hoaxer/hoax.txt");
That line slurps the entire file up into one variable called $content. Because of the way my page is set up, I made it so everyone had a separate directory, but you don't have to do that. You could have file("$hoaxer.txt") if you had files in the same directory called matt.txt and wdot.txt, for example.
You can then use a foreach loop to split said file into lines. Need any more help, PM/email me and I shall be happy to assist!
|
|
|
Post by vegemitethief on May 8, 2004 21:31:01 GMT 10
*crash*
Yeah... I don't know one bit of pHP. That's why I ordered a book from the library. I think I'll need to email you...
Thanks though!
|
|
Eco
Person with Lots of Posts
I LEIK MEMES
75%
SV is pretty dead. Saddening. Skype/Steam/XBL: EcoReck Twitter: @BM_Eco
Posts: 454
|
Post by Eco on May 11, 2004 14:30:41 GMT 10
they have those at a library
|
|
|
Post by Matt_TY on May 12, 2004 14:36:49 GMT 10
Thankyou for that scintillating contribution to the discussion, Eco.
W-Dot, I shall email you shortly.
|
|
Eco
Person with Lots of Posts
I LEIK MEMES
75%
SV is pretty dead. Saddening. Skype/Steam/XBL: EcoReck Twitter: @BM_Eco
Posts: 454
|
Post by Eco on May 13, 2004 10:46:04 GMT 10
I meant to put a ? on my other post
|
|