Page 1 of 1

Hiding URL info

Posted: Tue Feb 13, 2007 10:03 am
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

Posted: Tue Feb 13, 2007 10:13 am
by feyd
I totally don't understand what you're wanting. If you don't want to show stuff in the URL, use post. :?

Posted: Tue Feb 13, 2007 10:29 am
by kingdbag
well i needed to use get so I can have the drop downs remember what the person selected on the previous page.

Posted: Tue Feb 13, 2007 10:34 am
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.

Posted: Tue Feb 13, 2007 10:40 am
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.

Posted: Tue Feb 13, 2007 10:58 am
by Kieran Huggins
it's virtually identical to GET except it's POST - then in PHP use $_POST instead of $_GET

Posted: Tue Feb 13, 2007 10:59 am
by RobertGonzalez
Post your code that uses GET.

Posted: Tue Feb 13, 2007 11:22 am
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: .

Posted: Tue Feb 13, 2007 11:38 am
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/

Posted: Tue Feb 13, 2007 11:51 am
by crazytopu
using that mode_rewrite?

Do you have an example? Can you post here please?

Posted: Tue Feb 13, 2007 12:41 pm
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.

Posted: Tue Feb 13, 2007 1:37 pm
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!