PDA

View Full Version : Php Question


McGuffin
05-06-2001, 02:12 AM
Obviosuly I have no clue how to use php and mysql, but this seems like a relatively easy question. I have a page with x amount of links on them, I want to link each page to one template page, but from the link carrying over information that will pull from a folder a txt file that will populate the page. I have done it in Cold Fusion without any issues. But need to do it in php. I have looked around on various resource areas and have found some interesting things that I will implement, but have not found anything that can solve my problem here.

here is an example:

index page
has 3 current links
3.php
2.php
1.php

I have a template page called 00.php

when the user clicks on 3.php it will call up 00.php but pull a file into the page labelled 3.txt from a folder called txt.

do you understand? can you help?

eric418
05-06-2001, 04:00 PM
why not use query string intead of having some many files.

McGuffin
05-07-2001, 12:13 AM
how would I do that?

eric418
05-07-2001, 02:19 PM
i'm not quite sure what is ur exact situation.
but like if you just want to have different links print on a layout file. then:

if ($QUERY_STRING) {
$link = "<a href=$QUERY_STRING.php>$QUERY_STRING</a>";
} else {
$link = "<a href=default.php>default</a>";
}

if you want different content to be used in the same layout file:

if ($QUERY_STRING) {
include("$QUERY_STRING.txt");
} else {
include("default.txt");
}

Hope this helps.