Forum Moderators: coopster

Message Too Old, No Replies

Short URLs

Wap Push Message

         

franco190453

11:52 pm on Feb 23, 2009 (gmt 0)

10+ Year Member



I was in need to send the shortest possible URL as a Wap push message to a celular phone.
Finally I came up with this ->

//I set up an .htaccess file with this inside ->
//ForceType application/x-httpd-php
//And contact is a file without extension with php code inside!
//Suppose we have this URL.
//http://mydomain.com/Experiment/contact.php?one=7&&two=8$$three=9
/////////////////////////////////////////////////////
//http://mydomail.com/Experimento/contacto/7/8/9
/////////////////////////////////////////////////////
$url = $SERVER['REQUEST_URI'];
echo "$url<br>"; ///Experiment/contact/7/8/9
$laurl = explode("/", $url);
print_r($laurl);
//Array ( [0] => [1] => Experiment [2] => contact [3] => 7 [4] => 8 [5] => 9)

How safe is to transfer variables this way?
Is there a better way?

Regards
Franco

rob7591

3:06 am on Feb 24, 2009 (gmt 0)

10+ Year Member



It's the same thing as getting them from a query string (?one=7&two=8&etc=..)

They can both be easily manipulated but if you implement any decent level of security, you should be fine (ie. using mysql_real_escape_string if you're accessing a database)