Suppose its my script: <?php echo “ <a href=’receive_something.php?c_value=1&&p_value=2&&data=3&&page=4’ >â€.$user_something.â€</a>â€; ?> Then if I click this link its do something whatever I want to do in the receive_something.php page but it the address bar of the browser its show a address like: receive_something.php? c_value=1&&p_value=2&&data=3&&page=4 for that cause, anyone can see that what parameters are passing. If i want to pass this parameter like this but I want to avoid the full link in the address bar then what can I do ? last of all, though I click the link but its just show receive_something.php in the address bar, nothing else. May think its possible. but how ? can anyone help me ? I am waiting…………………..
You can pass those variables to other page either in session, or in cookie. Even if you use .htaccess to rewrite the url, still something will be seen in url. If you just want to reduce the number of variables send in url, base64_encode the string, and send like: href="recieve.php?query=all_based_data"> click in recieve.php base64_decode the query parameter. Thanks
thanks for response.but if u don't mind then please give me the full php code that can i do this think : test.php ------------ <?php echo “ <a href=’receive_something.php?a=1&& b=2&& c=3&& d=4’ >â€.$user_something.â€</a>â€; ?> -------------- receive_something.php --------------------------------- <?php $a=$_REQUEST[' a ']; $b=$_REQUEST[' b ']; $c=$_REQUEST[' c ']; $d=$_REQUEST[' d ']; // now just print: echo $a."<br/>".$b."<br/>".$c."<br/>".$d; ?> then how?? please
The use of session data is very easy. test.php <?php // call this function before printing any output session_start() // store your request data $_SESSION['receiveSomething']['a'] = 1; $_SESSION['receiveSomething']['b'] = 2; $_SESSION['receiveSomething']['c'] = 3; $_SESSION['receiveSomething']['d'] = 4; echo “ <a href=’receive_something.php’ >â€.$user_something.â€</a>â€; ?> PHP: receive_something.php <?php // call this function before printing any output session_start() // retrieve previously stored data from session array $a=$_SESSION['receiveSomething']['a']; $b=$_SESSION['receiveSomething']['b']; $c=$_SESSION['receiveSomething']['c']; $d=$_SESSION['receiveSomething']['d']; // now just print: echo $a."<br/>".$b."<br/>".$c."<br/>".$d; ?> PHP:
why not use POST? get all your parameters into one variable then user base64_encode($variableOfParameters);