I am trying to create website, now i m facing some problems like.
- Get the all the arguments in one array in php
- Get the full url with all the arguments.
-
In my url, i have sent two different values by one key name.
How I will get all the values and corresponding keys. Like…http://localhost:8082/file:/C:/Users/Nitz/Desktop/NEw%20Ryt/LOCAL%20-%20website/data.php?Company=YouBroadband&Company=YouBroadband&Company=Vodafone&Company=YouBroadband&Company=Vodafone&Company=Tata Photon Plus&Company=YouBroadband&Company=Vodafone&Company=Tata Photon Plus&Company=Tata Photon
the function is performing some task on database also, so i wanted both key and there values. AND yes, I wanted to do this work in PHP.
Please any ideas !!!!
$_REQUEST will contain all GET and POST parameters, $_GET will contain only get and $POST will contain only post. One of these is the array you are looking for.
This will give you your full URL
$myURL = ‘http://’.$_SERVER[‘SERVER_NAME’].$_SERVER[‘REQUEST URI’];
Here’s some example code to get all values:
foreach ($_REQUEST as $key => $value)
{
// $key is your your key like Company
// $value would be the corresponding value like YouBroadband
}