Jump to content
xisto Community
Sign in to follow this  
AlternativeNick

Php Help

Recommended Posts

firstly, id like to show you what im looking for.id like a site where it is something like this http://forums.xisto.com/no_longer_exists/ and where 10 is, it specifies a specific page, and then something.php adds that page as its content using an include. I know it has something to do with GET, but i have no idea how to do this, so any help would be awesome :)

Share this post


Link to post
Share on other sites

So, just to clarify: You want to be able to specify a page in the URL which will then be loaded into something.php? Such as something.php?page=cheese would load cheese.php? If that's what you want then this code should work:

<?php$page = $_GET['page'];$page = $page . ".php";include($page);?>
I haven't tried that code but it should work if you just put that where you want the page in the URL to appear. It also relies on the page you want to load being in the same directory as something.php

Also, rather than just ?=10 you have to use ?page=10 to get it to work. Feel free to PM me, email me or get me on MSN if you want any more help.

Share this post


Link to post
Share on other sites

Just be careful of include()ing a parameter passed from the URL. That is an easy to exploit weakness by hackers and can cause stuff to be included that you don't want to be.

For example:
http://www.example.com/?page=../../../../etc/passwd

Now I know with Xisto they are tight on security and that wouldn't work, but you get the point. just by substituting your URL data with their own they can expose sensitive data on your site.

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.