Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Reply
Old 03-22-2005, 02:51 PM URL constant
Novice Talker

Posts: 5
Trades: 0
hi all

Been trying to setup a website where the url wont change in the address bar for security reasons. this is index. php

PHP Code:
<?
session_start
(); 
switch (
$PAGE)
{
     case 
"HOME":
          
$OPEN "./myhomepage.php";
          break;
     case 
"NEWS":
          
$OPEN "./mynewspage.php";
          break;
     case 
"ADMIN_LOGIN":
          
$OPEN "<a href='Special.htm'>Click here to log in etc</a>";
          break;
     default:
          
$OPEN "./notFound.php";
          break;
}

include(
$OPEN);

?> 
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>New Page 1</title>
</head>
<body>
<a href='index2.php?PAGE=ADMIN_LOGIN'>Click here to log in etc</a>
</body>
</html>
When the user clicks on the link it just writes downloading index2.php in the status bar, it actualy wont go to the Special.htm page.
kurdishvoice is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 03-22-2005, 03:46 PM
Christopher's Avatar
Iced Cap

Latest Blog Post:
Cross-domain AJAX with JSONP
Posts: 3,110
Location: Toronto, Ontario
Trades: 0
Your problem is $PAGE isn't working? Try replacing it with $_GET['PAGE'], since your register globals value in php.ini may be disabled.

But for the record, hiding an admin cp or anything like that behind a simple query string condition is not very secure at all. Security through obscurity doesn't work too well.
__________________

Please login or register to view this content. Registration is FREE
- Latest Articles:
Please login or register to view this content. Registration is FREE
,
Please login or register to view this content. Registration is FREE

--
Please login or register to view this content. Registration is FREE

Christopher is offline
Reply With Quote
View Public Profile
 
Old 03-22-2005, 03:49 PM
Phaedrus's Avatar
Ultra Talker

Posts: 271
Location: CA
Trades: 0
Using mod_rewrite to rewrite your URLs is an excellent way to secure your website if you don't want the user to know the directory structure. You might look into doing it that way.
__________________

Please login or register to view this content. Registration is FREE
Phaedrus is offline
Reply With Quote
View Public Profile
 
Old 03-23-2005, 12:47 PM
simptech's Avatar
Skilled Talker

Posts: 81
Location: Cape Coral, Florida, United States
Trades: 0
What about passing variables via post to a page that determines what to execute from the variables received?

Enclose every page in <form> tags and make links perform javascript submit() calls instead of using actual the href

By the way, we have done this on a site in the past and Phaedrus is write, using mod_reqrite in Apache using HTaccess files is a much better solution.
__________________

Please login or register to view this content. Registration is FREE

FREE PHP scripts for your website!
simptech is offline
Reply With Quote
View Public Profile
 
Old 03-23-2005, 01:02 PM
dk01's Avatar
Ultra Talker

Posts: 373
Location: Ames, IA
Trades: 0
This:
$OPEN = "<a href='Special.htm'>Click here to log in etc</a>";

Should be this:
$OPEN = "./Special.htm";

You can include a hyperlink, you can only include other pages.

-dk
__________________
Did I help you? If so, be nice and throw me some
Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE
-
Please login or register to view this content. Registration is FREE
dk01 is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to URL constant
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.15091 seconds with 12 queries