Kahuki Webmaster Forum  

Go Back   Kahuki Webmaster Forum > Website Development & Management > Programming > PHP

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 06-14-2007, 10:02 AM
Rookie
 
Join Date: Feb 2006
Posts: 48
erhard is on a distinguished road
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

Reply With Quote
  #2 (permalink)  
Old 06-15-2007, 04:13 PM
Rookie
 
Join Date: Sep 2006
Posts: 5
daHippo is on a distinguished road
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.

Reply With Quote
  #3 (permalink)  
Old 06-15-2007, 08:39 PM
Rookie
 
Join Date: May 2006
Posts: 9
xRWolfx is on a distinguished road
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...

Reply With Quote
  #4 (permalink)  
Old 08-24-2007, 02:22 PM
Rookie
 
Join Date: Sep 2007
Posts: 11
el11000 is on a distinguished road
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!

Reply With Quote
  #5 (permalink)  
Old 10-30-2007, 01:58 PM
Rookie
 
Join Date: Oct 2007
Posts: 16
jonimontana is on a distinguished road
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
  • Php
  • Html
  • Sql

Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

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 On
Pingbacks are On
Refbacks are On

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


All times are GMT. The time now is 08:49 PM.


Powered by vBulletin® Version 3.7.2
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0