Robin_W
06-06-2001, 09:52 PM
I'm a near-total newbie at PHP4 (can do include files and email forms, that's about it), and have a slightly convoluted problem here. How do you pass a variable via a link in PHP4?
I have a columnist on my Website and I want to have an archive of his old columns for visitors.
The archived columns are actually plaintext files. I have an index page listing the columns as a series of links. There's another page which is meant to load the column requested as a server-side include.
What I want to have happen is this: Each link includes a variable that it passes to that second page, which tells it which text file to use for the include. Am I making sense so far?
Here's the code I *tried* to use on the links page, which you can see at http://www.liberalmafia.org/agitprop/racano/archives/:
<? echo "<a href="\column.php4?$the_url=5.18.2001.txt'>May 18, 2001</a>
"; ?>
And this is the code I've got on the column page:
<? include "$the_url" ?>
Obviously, something here is wrong. Any advice would be appreciated.
Eventually, no doubt, I'll figure out how to write code that automaticallyly archives the columns and generates the links page, but that's far in the future while I refresh my C++ and learn how to use MS-DOS....[nbsp]
I have a columnist on my Website and I want to have an archive of his old columns for visitors.
The archived columns are actually plaintext files. I have an index page listing the columns as a series of links. There's another page which is meant to load the column requested as a server-side include.
What I want to have happen is this: Each link includes a variable that it passes to that second page, which tells it which text file to use for the include. Am I making sense so far?
Here's the code I *tried* to use on the links page, which you can see at http://www.liberalmafia.org/agitprop/racano/archives/:
<? echo "<a href="\column.php4?$the_url=5.18.2001.txt'>May 18, 2001</a>
"; ?>
And this is the code I've got on the column page:
<? include "$the_url" ?>
Obviously, something here is wrong. Any advice would be appreciated.
Eventually, no doubt, I'll figure out how to write code that automaticallyly archives the columns and generates the links page, but that's far in the future while I refresh my C++ and learn how to use MS-DOS....[nbsp]