Jump to content
xisto Community
Sign in to follow this  
Amezis

I Need Help...

Recommended Posts

I saw on a page that the adress was 'index.php?page=something.html'. I don't know anything in PHP, but I think the 'index.php' was the menu, and 'something.html' was the content. I think it works like a frame... Anyway... Can someone give me a code so I can do it, maybe a little tutorial too?
BTW the page i'm talking about can be found here...

Share this post


Link to post
Share on other sites

I know what you are talking about. What you're seeing is a variable being passed to the browser. This is very common in php-based websites. Instead of creating multiple pages for a website, you can use a variable to indicate what content you
want to show. For example:

echo "<a href='index.php?page=pagetwo'>Some Page</a>";if($page=="" or $page=="home"){     echo "Welcome to my website! I hope you enjoy it.";}else{     if($page=="pagetwo")     {           /* Let's assume that this code here is index.html */           echo "This is the second page on my website. ";     }}

This code should help you understand why there was a webpage's name behind a variable. I hope it does.

By the way, you're partly right when you said that "index.php" is a menu and
"something.html" a choice. But, it's not a frame. Not at all. It's a page "generated"
by the .php file. Well, it's not a "page" really, but you get the idea.

Share this post


Link to post
Share on other sites

U Can Make PHP Page with If (Fun)For Example u set if index.php?action=alexthen your iframe browse to yahoo.comand you can many think in this option you can manage 100 ta html page with this Funyou can write 100 ta if and 100 html site and user can Switch with this optionsNice Job ;)

Share this post


Link to post
Share on other sites

you can also make the page redirect to the given url.

$page = $_GET['page'];header("Location: $page");

this is much more efficient since you do not have to fill one html file with all the html tags for your pages.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | 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.