There may not be a php solution to this - but I will explain what I want to do first.
I want to be able to show a link in an article resource box that points to my root domain with a variable in the querystring - eg "
When clicked, my php script will $_GET["id"] the value of id and then open a text file to read the "page.html" on my domain that is associated to that id.
So id=1 might be cats.html, id=2 might be dogs.html and so on.
The idea is that I can show an appropriate page which will appear to be on home page. So I would need that to always appear in the address bar.
I can get it to work so the appropriate page is displayed but I always get in the address bar regardles of the page I am displaying.
Is there anyway to change the appearance of the url in the address bar so it loses the ?id=123 bit?
I have tried frames but cannot get it to work?
Any help and code snippet appreciated
Here's some code so far: I haev a text file id_list.txt to store page data in format 1,page1.html, 2,page2.html, etc
I want to be able to show a link in an article resource box that points to my root domain with a variable in the querystring - eg "
When clicked, my php script will $_GET["id"] the value of id and then open a text file to read the "page.html" on my domain that is associated to that id.
So id=1 might be cats.html, id=2 might be dogs.html and so on.
The idea is that I can show an appropriate page which will appear to be on home page. So I would need that to always appear in the address bar.
I can get it to work so the appropriate page is displayed but I always get in the address bar regardles of the page I am displaying.
Is there anyway to change the appearance of the url in the address bar so it loses the ?id=123 bit?
I have tried frames but cannot get it to work?
Any help and code snippet appreciated
Here's some code so far: I haev a text file id_list.txt to store page data in format 1,page1.html, 2,page2.html, etc
Code:
<?php
$id = $_GET["id"];
$root_domain = $_SERVER['HTTP_HOST'];
$filename = "id_list.txt"; // this is where i store the html page names e.g. 1, page1.html, 2,page2.html etc, comma delimited
$fd = fopen ($filename, "r");
$contents = fread ($fd,filesize ($filename));
fclose ($fd);
$delimiter = ",";
$splitcontents = explode($delimiter, $contents);
//echo"<p>file $id = $splitcontents[$id]</p>";
?>
<HTML><HEAD>
<META NAME="description" CONTENT="<?=$root_domain;?>">
<META NAME="keywords" CONTENT="">
</HEAD>
<FRAMESET border=0 rows="100%,*" frameborder="no"
marginleft=0 margintop=0 marginright=0 marginbottom=0>
<frame src="<?=$splitcontents[$id];?>" scrolling=auto frameborder="no" border=0 noresize> <frame topmargin="0" marginwidth=0 scrolling=no marginheight=0
frameborder="no" border=0 noresize>
</FRAMESET>
</HTML>