let us say we created a curl resource and set options on it. we can see whether option is set or not by printing return of curl_setopt() but I want to know all the options that have been set a curl resource at any point of time, how do I do that?
for ex:
if i have set CURLOPT_URL
CURLOPT_POST
CURLOPT_POSTDATA
CURLOPT_FOLLOWLOCATION
i want some way to list all the options set on a given curl resource....how?
viewing curl options
Moderator: General Moderators
- raghavan20
- DevNet Resident
- Posts: 1451
- Joined: Sat Jun 11, 2005 6:57 am
- Location: London, UK
- Contact:
- raghavan20
- DevNet Resident
- Posts: 1451
- Joined: Sat Jun 11, 2005 6:57 am
- Location: London, UK
- Contact:
2. this simple curl code does not seem to POST but it reaches the target URL...can you tell me why?
target file code
result
Code: Select all
$ch = curl_init( 'http://sitename/curlTest/getPOST.php' );
curl_setopt( $ch, "CURLOPT_POST", 1 );
curl_setopt( $ch, "CURLOPT_POSTFIELDS", "fileName=uploadthisfile&size=23+Bytes" );
curl_setopt( $ch, "CURLOPT_RETURNTRANSFER", 1 );
echo curl_exec( $ch );
if (curl_errno($ch)) {
print curl_error($ch);
}Code: Select all
<?php
echo "\n\nprinting the received post array:\n"; print_r( $_POST );
?>Code: Select all
printing the received post array:
Array
(
)
1- raghavan20
- DevNet Resident
- Posts: 1451
- Joined: Sat Jun 11, 2005 6:57 am
- Location: London, UK
- Contact:
- raghavan20
- DevNet Resident
- Posts: 1451
- Joined: Sat Jun 11, 2005 6:57 am
- Location: London, UK
- Contact: