Please guide me. How can I send variables from a PHP script to another URL using POST without using forms and hidden variables?
I don't think you can, I can't remember if you could do this off the top of my head; tell us what exactly you are trying to do instead of being so general.
ok thanks i will try it.
Have u got solution for this.
Basically you can create an HTTP request from within your page and get back and process a responce.
I guess this could be possible in PHP also. I have a look into it.
You can open an HTTP socket connection and send HTTP POST commands. Here is
an example :
// Generate the request header
"POST $URI HTTP/1.1\n".
// Open the connection to the host
$socket = fsockopen($Host, 80, &$errno, &$errstr);
$Result["errno"] = $errno;
$Result["errstr"] = $errstr;
$idx = 0;
$Result[$idx++] = fgets($socket, 128);
Or you can use the cURL extensions for PHP (http://curl.haxx.se). Once you build it and compile their support into PHP, it is fairly easy to do posting stuff (even over https):
$ch = curl_init();
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, "Data1=blah&Data2=blah");curl_exec ($ch);
This will have the net effect of posting your data to the $URL site, without any header hacking.
You can also do other nifty things with cURL, like retrieve the HTML into variables and scrape through it for neat functionality.
To use cURL you need to recompile PHP or check with your ISP to see if they support it (http://www.php4hosting.com does)
If you are posting within your own server, you may not need to connect to the host as shown by manishMCAIT.
<a href="adminpanal.php?task=edit&id=<? echo $id ?> ">
$ver = $_REQUEST=[task]; .....(this i use for SWITCH case)
$idi = $_REQUEST=[id]; ..... (this i use for database id)