Hiding URL info

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
kingdbag
Forum Newbie
Posts: 22
Joined: Wed Jul 12, 2006 6:22 pm

Hiding URL info

Post by kingdbag »

Hey guys,

Is there anyway to hide URL info?

I switched from a <FORM action="lg.php" method="post"> to <FORM action="lg.php" method="get">

So now you can see what im passing to the next page.

lg.php?cisco_router=11.11.11.11&cisco_dev_cmd=ping&cisco_para=10.0.0.1
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

I totally don't understand what you're wanting. If you don't want to show stuff in the URL, use post. :?
kingdbag
Forum Newbie
Posts: 22
Joined: Wed Jul 12, 2006 6:22 pm

Post by kingdbag »

well i needed to use get so I can have the drop downs remember what the person selected on the previous page.
User avatar
RobertGonzalez
Site Administrator
Posts: 14293
Joined: Tue Sep 09, 2003 6:04 pm
Location: Fremont, CA, USA

Post by RobertGonzalez »

You can do that with POST, COOKIE or SESSION. You do not need to use GET. Alternatively, you can use a solution like mod_rewrite to make your urls not look so ugly and transparent.
kingdbag
Forum Newbie
Posts: 22
Joined: Wed Jul 12, 2006 6:22 pm

Post by kingdbag »

Do you have a sample that shows how to remember a drop down selection using POST i couldn't find one so I had to use GET to make it work.
User avatar
Kieran Huggins
DevNet Master
Posts: 3635
Joined: Wed Dec 06, 2006 4:14 pm
Location: Toronto, Canada
Contact:

Post by Kieran Huggins »

it's virtually identical to GET except it's POST - then in PHP use $_POST instead of $_GET
User avatar
RobertGonzalez
Site Administrator
Posts: 14293
Joined: Tue Sep 09, 2003 6:04 pm
Location: Fremont, CA, USA

Post by RobertGonzalez »

Post your code that uses GET.
crazytopu
Forum Contributor
Posts: 259
Joined: Fri Nov 07, 2003 12:43 pm
Location: London, UK
Contact:

Post by crazytopu »

You can do that with POST, COOKIE or SESSION. You do not need to use GET. Alternatively, you can use a solution like mod_rewrite to make your urls not look so ugly and transparent.
So I could use mod_rewrite to hide this ugly looking code?

My first project - http://www.ibcs-primax.com/link1.php?link_id=5

Ah! wish i had known it then...i so much hated how it looked so transparent and was reavealing all my skills :lol: .
User avatar
RobertGonzalez
Site Administrator
Posts: 14293
Joined: Tue Sep 09, 2003 6:04 pm
Location: Fremont, CA, USA

Post by RobertGonzalez »

As long as you are on Apache, yes. You could make that URL look like this if you wanted to...

http://www.ibcs-primax.com/links/5/

Alternatively, you could add text instead of ids, so it looks like

http://www.ibcs-primax.com/links/title-of-the-link/
crazytopu
Forum Contributor
Posts: 259
Joined: Fri Nov 07, 2003 12:43 pm
Location: London, UK
Contact:

Post by crazytopu »

using that mode_rewrite?

Do you have an example? Can you post here please?
User avatar
RobertGonzalez
Site Administrator
Posts: 14293
Joined: Tue Sep 09, 2003 6:04 pm
Location: Fremont, CA, USA

Post by RobertGonzalez »

Search the forums for mod_rewrite or rewrite rules. Or google it. There are a lot of sites with a lot of help available.
kingdbag
Forum Newbie
Posts: 22
Joined: Wed Jul 12, 2006 6:22 pm

Post by kingdbag »

I'm such an idoit sometimes.....I guess I was so excited that get and $_GET worked i never tried using post and $_POST that totally hides the variables being pass in the URL.

Thanks for the help guys.

I'm going to look into mod_rewrite also see what thats all about!
Post Reply