Jump to content

How to have index.php load different content


pintee

Recommended Posts

Hi everyone,

I would like to have my website display different content while remaining on the same index.php page. The functionality I am after is demonstrated bywww.sryth.com. If you sign up for an account, login, and start a new game, you will see what I mean. The address stays the same throughout the game(i.e.www.sryth.com/game/index.php), even as new content is being displayed. How do I achieve this effect??

I have been searching all morning for the solution to this problem but have come up with nothing. Answers given in forums have all lead to dead ends, so I'm hoping someone can come up with a definitive solution.

 

Link to comment
Share on other sites

Either use a frame/iframe tag or do URLRewrite.

 

An example for an iframe and a frame tag (my school uses the frame tag on their home page, by the way):

 

<!DOCTYPE html>
<head>
<title>
Site Title
</title>
</head>
<body>
<iframe src="index.php" name="Index"></iframe>
<!-- or use this
<frame name="Main Site" src="index.php?rewrite=main%20site"></frameset>
-->
</body>
</html>
You can in fact do this with embed and object tags, too.

 

I wouldn't use the URLRewrite option unless you are not familiar with HTML (which is unlikely because HTML is much easier than URL Rewriting), though.

Link to comment
Share on other sites

Backbone.js can do this. It basically keeps the user from loading new pages but rather refreshes parts of the page using AJAX.

 

But even with normal JS you can go a long way. Dont use iframes.

Link to comment
Share on other sites

I've been experimenting with this www.sryth.com site in order to glean how it might be implemented.

 

* Firstly I login and start off from www.sryth.com/game/index.php.     (this has content on it like text and links)

 

* Secondly, I open a link on the page in a new window. This brings up the address http://www.sryth.com/game/ci.php?f_c=set_pc_location2.inc&f_zoneid=4&f_sectionid=10561&f_previouszoneid=4&f_previoussectionid=1

 

for a split second before redirecting to the address http://www.sryth.com/game/ci.php?f_c=parser2.inc          (this page also has content on it like text and links).

 

Any guesses as to the implementation from what I have just described? Forgive my curiosity.......

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.