Page 1 of 1

How to Hide www.mywebsite.com/THIS.PHP

Posted: Wed Jul 20, 2011 11:45 am
by vitinho444
Hey guys, i think the title says everything

I need to hide the page that the user is currently viewing. How can i do that?

Re: How to Hide www.mywebsite.com/THIS.PHP

Posted: Wed Jul 20, 2011 12:49 pm
by Xaleph
What do you mean? You want to hide the complete URI string? I can see no reason why. Anyway, you could use iframes to hide them. But no way that i`m going to recommend that.

Re: How to Hide www.mywebsite.com/THIS.PHP

Posted: Wed Jul 20, 2011 1:19 pm
by ConceptDestiny
You should use dynamic pages.

For example:

Code: Select all


<a href='index.php?page=inventory'>Inventory</a>
<a href='index.php?page=skills'>Inventory</a>

if (isset($_GET['page']))
{
  $page = mysql_real_escape_string($_GET['page']);
  
  include "$page.php";
}

Re: How to Hide www.mywebsite.com/THIS.PHP

Posted: Wed Jul 20, 2011 1:22 pm
by Xaleph
Oh that like that. I had a tutorial here somewhere that teaches how to use a router in combination with .htaccess.

Re: How to Hide www.mywebsite.com/THIS.PHP

Posted: Wed Jul 20, 2011 2:01 pm
by vitinho444
No thats not it

I want to hide the .php like: rank.php, auth.php

But now that i checked concept destiny post, how can i learn how to make things like www.mysite.com/index.php?register
that kind of thing xD

Re: How to Hide www.mywebsite.com/THIS.PHP

Posted: Wed Jul 20, 2011 2:03 pm
by ConceptDestiny
vitinho444 wrote:No thats not it

I want to hide the .php like: rank.php, auth.php

But now that i checked concept destiny post, how can i learn how to make things like http://www.mysite.com/index.php?register
that kind of thing xD
Curious, but why do you want to hide only the filetype?

Re: How to Hide www.mywebsite.com/THIS.PHP

Posted: Wed Jul 20, 2011 2:24 pm
by Xaleph
I can understand, really. Dynamic loading is a pain using the filesystem. But check out http://indie-resource.com/forums/viewto ... =26&t=2820 to see how you can filter files and use URI strings as "pages".

Re: How to Hide www.mywebsite.com/THIS.PHP

Posted: Wed Jul 20, 2011 2:28 pm
by ConceptDestiny
Xaleph wrote:I can understand, really. Dynamic loading is a pain using the filesystem. But check out http://indie-resource.com/forums/viewto ... =26&t=2820 to see how you can filter files and use URI strings as "pages".
That's a great tutorial. :)

Re: How to Hide www.mywebsite.com/THIS.PHP

Posted: Wed Jul 20, 2011 3:03 pm
by vitinho444
well i want to hide it because i got a pvp test that is a pvp.php when you put the ID of the target than it goes to a page called attack.php and if you acess that page without pass by pvp.php it "ghost attack"...

Just trying to hide like if you visit google.com you dont see google.com/index.php.. just that for the other pages.

@EDIT
i read the Xaleph tutorial but i dont get what it does.

Re: How to Hide www.mywebsite.com/THIS.PHP

Posted: Wed Jul 20, 2011 3:42 pm
by Xaleph
Ok, well first of, if you don`t understand the tutorial, it`s OK. It wasn`t that well written to begin with ( I was tired ). The concept stays the same nonetheless. Anyway, what you want is using $_POST. Submit the target ID in a form, that way you can submit "sneaky" values. It`s not visible in the URI string. However, it is visible in the source code. One way to counter that is using a hash() function or a scramble like md5/sha1.

@edit: md5 and sha1 are hashes, i meant hashes or encryption ( like RSA), and thanks ConceptDestiny :)

Oh and the tutorial aims to solve this:

You have this right?:

site.com/index.php,
site.com/pvp.php
site.com/armory.php

et cetera

Now, if you use the code from the tutorial, you can use something like:

site.com/home ( your index.php default or something)
site.com/pvp
site.com/armory
site.com/armory/repair/item
site.com/workshop/buy/item

This really does filter away the .php. You`ll have to setup your own dynamic loading, but that`s not that hard using a simple switch to start with.

switch($uri->getFirstNode()){
case 'pvp':
include 'pvp.php';
break;
case 'workshop':
include 'workshop.php';
break;
case 'home':default:
include 'homepage.php';
break;
}