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
How To Hide Variables While Using GET? Mod Rewrite Perhaps?
Old 02-17-2007, 08:13 PM How To Hide Variables While Using GET? Mod Rewrite Perhaps?
Novice Talker

Posts: 8
Trades: 0
If mod_rewrite cannot do this, then can you tell me what I can do to hide something like:

http://www.mysite.com/index.php?identity=8
to
http://www.mysite.com/index.php

The point of it is, to not allow users to know what identity=8 part as the variable for identity would be generated randomly by the script itself on index.php, which stores it using GET into a variable $identifynum. The point of it is, I do not want users to be abusing the script by typing in randomly identity=9, identity=10, etc in the browser to execute it with their number. by their own leisure to execute the script. I figured by using mod_rewrite, I would be able to hide the variables as I believe it is possible to hide them by rewriting the actual identity=8 to something like id=8 so that users would not be able to see any of the args in the browser line as they would only see the index.php, while still enabling me to use the $_GET from the url that it is being redirected to.

Last edited by Kartel; 02-17-2007 at 08:18 PM..
Kartel is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 02-18-2007, 02:53 AM Re: How To Hide Variables While Using GET? Mod Rewrite Perhaps?
vn5ltr's Avatar
Skilled Talker

Posts: 93
Location: Melbourne, Australia
Trades: 0
Assume that identity was a page ID.
So you would want to access it with something like "page/8/" in your (A HREF).

Your rule would be like this:

RewriteRule ^page/([0-9]+)/ index.php?page=$1

That means the link must start with 'page/' or else tthe rule will be ignored, the accept a variable from 0-9 only but have as many digits as you want.

that will call index.php and apply your numeric value to $1.
vn5ltr is offline
Reply With Quote
View Public Profile
 
Old 02-18-2007, 10:18 AM Re: How To Hide Variables While Using GET? Mod Rewrite Perhaps?
Ultra Talker

Posts: 483
Trades: 0
Having said all that, it doesn't really change the fact that the end user can change the values themselves: you're just moving the point of the change.

If you want to associate a number with a particular user without them being able to change it (easily), look into storing the number in a session instead.
__________________

Please login or register to view this content. Registration is FREE
TwistMyArm is offline
Reply With Quote
View Public Profile
 
Old 02-18-2007, 01:23 PM Re: How To Hide Variables While Using GET? Mod Rewrite Perhaps?
Novice Talker

Posts: 8
Trades: 0
Can you show me an example of storing multiple variables into multiple unique sessions and actually passing them into a variable on another page? All I know is POST and GET.
Kartel is offline
Reply With Quote
View Public Profile
 
Old 02-19-2007, 01:54 AM Re: How To Hide Variables While Using GET? Mod Rewrite Perhaps?
mtishetsky's Avatar
King Spam Talker

Posts: 1,226
Name: Mike
Location: Mataro, Spain
Trades: 0
PHP Code:
session_start();

if (
user_logged_ok()) {
   
$_SESSION['user'] = get_user_record_from_db();
   
redirect();
}

if (isset(
$_SESSION['user'])) {
   
get_user_data($_SESSION['user']->id);
}
else {
   echo 
'You are not logged in!';

Something like that
__________________

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

And don't forget to give me talkupation!
mtishetsky is offline
Reply With Quote
View Public Profile Visit mtishetsky's homepage!
 
Reply     « Reply to How To Hide Variables While Using GET? Mod Rewrite Perhaps?
 

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.20981 seconds with 12 queries