Jump to content

Recommended Posts

Is there a way to hide all urls like masking them so that instead of:

 

www.name.com/code.php

 

it'll be www.name.com

 

similar to when you are on a flash website and the url remains the same but your going to many pages .. ?

 

Reason i ask is i have like thousands of pages and i have a feature whereby if the user is locked they cannot access the pages until they are unlocked.. but to put a script on all of these pages would be the last case scenario, if i could remove the url showing the entire name, they can't know what to type into the url to avoid this locking feature...

 

so is it possible?

Link to comment
https://forums.phpfreaks.com/topic/69769-hiding-the-urls-of-your-php-files/
Share on other sites

Hi there,

 

you should look into mod rewriting, you'll need to capture the /code.php in order to serve up the correct page, and this is the way to go.

here's a helpful tutorial to get you started: http://www.yourhtmlsource.com/sitemanagement/urlrewriting.html

 

* its a good idea to verify your server has the mod rewrite module installed.

 

good luck to ya

 

jesi.. i dont think i follow too well :S

 

basically say a user gets locked a field in the table named "lockedid" is set to 1 and not 0.... then i have an if statement to make sure they go to that page. But users kept changing the url to any one of my pages and so were free to roam and im trying to find a way to stop this "without" putting if statements on 1000 odd php scripts :(

How do you check if they are logged in or not? If they can view those pages when not logged in, you have a bigger problem.

 

Instead of using if statements, write functions. Then when you edit that one function, it will affect all pages.

well i do a query like:

 

 

find user with userid as session

if row not found exit and error.

 

i then tried doing the same for :

 

check if locked == 1 ...{ header. locked.php}else{ codeee}

 

and it causes a catastrophic server failure and my Xampp stops responding.. i can show u the code ?

This is what i got which does the you must be logged in script and the locked feature but its not working..

 

<?
session_start();
//this block of code is called up with an include command on the html page that the user displays
$connect = mysql_connect("localhost", "root", "private");

//error handle
if (!$connect) {
echo "Unable to connect to DataBase: " . mysql_error();
exit;
}

//error handle
if (!mysql_select_db("civilian")) {
echo "Unable to select Civilain: " . mysql_error();
exit;
}
// Start up the session

if (!isset($_SESSION['Current_User']) || !$_SESSION['Current_User']) {
die('You must be logged in to view this page');
}

// Get the user's info from the database by putting
// the user id stored in the session into the WHERE clause
$GetUserID = mysql_query("SELECT * FROM userregistration
                    WHERE UserID='{$_SESSION['Current_User']}'");

                  
// Fetch the row from the database
if (!($row = mysql_fetch_assoc($GetUserID))) {
    echo "User not found!";
    exit;
echo mysql_error();
}

$Jail = $row["JailID"];

If ($Jail == 1) {
Header    ("Location: Londonjail.php");
}




?>

ya ive done that

 

<framset 100%*100%> :D :D :D It is so awesome.

 

Although if they right click the page and hit properties they will get the exact link of the page, unless you disable right clicking :D :D :D.

 

I just have my site in a frame, then the frame opens up a window wiht no status bar and no file menus that has the site :D no way for them to get the url, then I disable right clicking in the new window.

 

Now there is no way for them to pass through it lol.

ya ive done that

 

<framset 100%*100%> :D :D :D It is so awesome.

 

Although if they right click the page and hit properties they will get the exact link of the page, unless you disable right clicking :D :D :D.

 

I just have my site in a frame, then the frame opens up a window wiht no status bar and no file menus that has the site :D no way for them to get the url, then I disable right clicking in the new window.

 

Now there is no way for them to pass through it lol.

 

What if someone disables javasript? They could then view the source quite happily.

As far as the question is concered, i have to wonder why you have 1000 files. I assume this is some sort of game. Surely most of these files are very similar? Surely you could cut down no the number of files vastly with some variables?

the site is VERY large cos of the amount of stuff im coding... its a 2 year project of like 10 hours a day coding via a team. And yes it is a game.. and the site is cut down it was hitting 5000 odd but that was back in the days when we weren't so good at coding but we have learnt alot better methods since.

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.