Include and case/switch HTML

JavaScript and client side scripting.

Moderator: General Moderators

Post Reply
Steveo31
Forum Contributor
Posts: 416
Joined: Sun Nov 23, 2003 9:05 pm
Location: San Jose CA

Include and case/switch HTML

Post by Steveo31 »

Heyo-

I worked on a simple script that uses a get var to echo a certain somethin. I think I am going about it all wrong, do you see anything I need to change?

Main.php:

Code: Select all

<!-- header -->
<?php 
include ('header.php');
?>
<!-- main content -->
<table width="100%" height="75%">
	<tr>
    	<td width="100%" valign="top">HERE</td>
	</tr>
</table>
<!-- footer -->
<?php 
include ('footer.php');
?>
getID.php:

Code: Select all

<?php
if(isset($_GET['locator'])){
	switch($_GET['locator']){
		case 'home':
			header("Location:  mainContent.php");
			break;
		case 'web':
			header("Location:  webContent.php");
			break;
	}
} else {
	include('mainContent.php');
}
?>

The 'mainContent.php' is a simple echo command.

I would like to have the resulting content of the getID.php to be displayed in the table with the HERE line, but I'm not sure of how. I know it has to be a "?locator=home" type of link, but what would be the rest of the link? "<a href="www.thesite.com?locator=home>Click here!</a>" where thesite.com is my site?

Would iFrames be any help here, to just change the content of the iFrame?

Hope this made sense, I'd be glad to reiterate if necessary.

Thanks :)

-S
Last edited by Steveo31 on Fri Mar 12, 2004 12:17 am, edited 1 time in total.
Steveo31
Forum Contributor
Posts: 416
Joined: Sun Nov 23, 2003 9:05 pm
Location: San Jose CA

Post by Steveo31 »

Ok, I got it to work, sorta. I revamped the code so if the ?locator is "home" then it redirects me to "mainContent.php" which in this case is a simple echo command for ease and test-ablilties sake.

However, I would like to have the mainContent.php to be returned into the table in the main.php page. Ideas?

:)
Post Reply