Reply
Old 07-07-2004, 11:30 PM help!
Bicstar's Avatar
Skilled Talker

Posts: 55
how do you do that www.blah.com/index.php?id=blah
i used to know but i forget... and can u make those links like text files and have the html included into a table?

basically i want the content/html inside a table to change using php when clicking different links.
__________________
http://www.bicstar.com
Bicstar is offline
Reply With Quote
View Public Profile
 
When You Register, These Ads Go Away!
Old 07-08-2004, 04:52 AM
doubleD's Avatar
Novice Talker

Posts: 5
the link www.blah.com/index.php?id=blah doesn't work and neither www.blah.com/index.php

maybe someone can help you but he needs to see it
doubleD is offline
Reply With Quote
View Public Profile
 
Old 07-08-2004, 04:58 AM
Bicstar's Avatar
Skilled Talker

Posts: 55
i hope that wasnt serious... and i was wondering how to do the index.php?= stuff...
__________________
http://www.bicstar.com
Bicstar is offline
Reply With Quote
View Public Profile
 
Old 07-08-2004, 09:36 AM
witchblade32's Avatar
Super Talker

Posts: 140
Location: Lititz, PA
I think the problem is that no one is sure what you're asking.

Because of the order in which the page is interpreted by the server, you cannot use a variable as a file name to include content

include ($_GET['id'] . ".txt") - would not work.

You can set conditionals though, specific files are displayed depending on the variable in the querystring.

$id = $_GET['id']

if ($id == "blah") {
include ("blah.txt");
} elseif ($id == "blahblah") {
include ("blahblah.txt");
} else {
include ("default.txt");
}


If you have a lot of content that you want to use this way, that's extremely tedious. You might want to structure a database with an id, linkname, content then dynamicly create your menu and links and pull the content from the database on the fly.
witchblade32 is offline
Reply With Quote
View Public Profile Visit witchblade32's homepage!
 
Old 07-08-2004, 10:47 AM
Republikin's Avatar
Super Moderator

Posts: 3,191
I agree with witchblade but if you are doing it as a learning experience, working with files and such then I would look into php's filesystem functions in particular file_get_contents(). This nifty function will read files, even web address' into a string, file() however will read it into an array.
Republikin is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to help!
 

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off




   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML

 


Page generated in 5.14343 seconds with 12 queries