![]() |
| |||
| php variables in url..? What do you call it when the url is hiding/encrypting/encoding the variables... i need something like this, <? $test='Bruce'; echo " <a href='client.php?name=$test'>ANYTHING</a>"; ?> i need to make it that ppl cant see the url, or not read the url.. something like: www.yahoo.com/ client.php?client=234sdkjshcsaw3edp12i3%sdf% hope you understand what im trying to say. If someone can just point me in the right direction, all will be good. Thx |
| |||
| To encrypt your variable add the md5() function as you see it in the below code: <? $test=md5('Bruce'); echo " <a href='client.php?name='" . $test . "'>A... ?> as a safety to having errors in php, you must concatenate your variables when in an echo/print statement. Just look above and you will notice how I inserted the two dots. |
| |||
| If the variable needs to be hidden, you might want to consider another strategy, such as using $_POST or even better (if possible, $_SESSION variables. Failing that, try to keep URL manipulation separate from your PHP code if you can... most major PHP applications that manipulate the URL do so by configuring Apache's mod_rewrite module. It's actually such a powerful module that it warrents a whole book on the subject... |
| |||
| I agree with xRWolfx on both points. Yes, use $_POST variables. And, if you can help it at all, make use of mod_rewrite to manipulate your URL's. It's a lot more sophisticated and safer that way. I myself am just at the basic level of PHP know-how, but these were the first few important things that I've learned. Good luck! |
| |||
| make your own function : <?php function hide($var) { $x =1; while ($x > 33) { $var = base64_encode($var); } return $var; } $encoded = hide("JoniMontana"); echo $encoded;
__________________ JoniMontana - Programmer ![]() icq-50015047
|
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
| |
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| ASP.NET Global function & variables? | mentoo | Programming | 2 | 02-07-2007 07:15 AM |
| Inserting PHP variables into a PHP document using fwrite? | Jules | PHP | 1 | 01-08-2007 08:17 PM |
| about php...do session variables transmit themselves from a php page to another? | neca | PHP | 2 | 11-13-2006 12:48 PM |