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

C++, C#, Java, PHP, ect...
Post Reply
User avatar
vitinho444
Posts: 2819
Joined: Mon Mar 21, 2011 4:54 pm

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

Post 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?
My Company Website: http://www.oryzhon.com

Skype: vpegas1234
Xaleph
Posts: 897
Joined: Mon Feb 07, 2011 2:55 am

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

Post 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.
ConceptDestiny
Posts: 261
Joined: Wed Apr 28, 2010 8:35 am

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

Post 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";
}
Xaleph
Posts: 897
Joined: Mon Feb 07, 2011 2:55 am

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

Post by Xaleph »

Oh that like that. I had a tutorial here somewhere that teaches how to use a router in combination with .htaccess.
User avatar
vitinho444
Posts: 2819
Joined: Mon Mar 21, 2011 4:54 pm

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

Post 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
My Company Website: http://www.oryzhon.com

Skype: vpegas1234
ConceptDestiny
Posts: 261
Joined: Wed Apr 28, 2010 8:35 am

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

Post 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?
Xaleph
Posts: 897
Joined: Mon Feb 07, 2011 2:55 am

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

Post 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".
ConceptDestiny
Posts: 261
Joined: Wed Apr 28, 2010 8:35 am

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

Post 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. :)
User avatar
vitinho444
Posts: 2819
Joined: Mon Mar 21, 2011 4:54 pm

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

Post 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.
My Company Website: http://www.oryzhon.com

Skype: vpegas1234
Xaleph
Posts: 897
Joined: Mon Feb 07, 2011 2:55 am

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

Post 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;
}
Post Reply

Return to “Coding”