hey all,
** I am fairly new to the whole php thing. **
I had some code that used to work on my old host, but doesn't now. This code is for if i wanted to type in something like content.php?page=logs and have it show /logs.php in an iframe further down the page. (check out
http://rb.pdgradio.com for an example).
Quote:
<?php
if($page=="home") {
$page = "/home.php";
} else if($page=="bios") {
$page = "bios.php";
} else if($page=="logs") {
$page = "/logs.php";
} else if($page=="guests") {
$page = "/guests.php";
} else if($page=="affiliates") {
$page = "/affiliates.php";
} else if($page=="contact") {
$page = "/contact.php";
} else $page = "/home.php";
?>
|
(HTML Part)
Quote:
<iframe
name="contentFrame"
src="<? echo($page); ?>"
height="316"
width="347"
frameborder="0"
marginheight="0"
marginwidth="0"
scrolling="auto"
allowtransparency="1">
</iframe>
|
My problem is that no matter that i type in the Address bar, $page will always result in "/home.php."
In fact, clearning all that code and putting the following still fails:
Quote:
string entered in url is "test.php?word=foo"
<?php
$word="";
//this following should display "Foo"?? It doesn't.
echo ($word);
?>
|
any ideas on how to get it to pass the variable from the url?
thanks in advance!!!