Can somebody help with the correct php code to make a cURL PUT request. Here is a sample of code below that uses POST, but I need to modify this one so that it uses PUT instead.
Code: <?php
//Modify these
$API_KEY = 'xxx';
$SECRET = 'yyy';
$TOKEN = 'zzz';
$STORE_URL = 'sss.myshopify.com';
$url = 'https://' . $API_KEY . ':' . md5($SECRET . $TOKEN) . '@' . $STORE_URL . '/admin/products.xml';
$xmlsrc = <<<XML
SOMETHING WILL GO HERE
XML;
$session = curl_init();
curl_setopt($session, CURLOPT_URL, $url);
curl_setopt($session, CURLOPT_POST, 1);
curl_setopt($session, CURLOPT_POSTFIELDS, $xmlsrc);
curl_setopt($session, CURLOPT_HEADER, false);
curl_setopt($session, CURLOPT_HTTPHEADER, array('Accept: application/xml', 'Content-Type: application/xml'));
curl_setopt($session, CURLOPT_RETURNTRANSFER, true);
if(ereg("^(https)",$url)) curl_setopt($session,CURLOPT_SSL_VERIFYPEER,false);
$result = curl_exec($session);
curl_close($session);
echo $result; // this shows exactly what you'd expect to see, as given in API documentation
?>
Rounding a number queried from a database
I know that to display a rounded number you just do echo "round($number)";. But how would I convert the $number varible into a rounded number, so that when I say echo "$number";
gmmktime or mktime
I live in the UK, i am within the GMT (with daylight saving time ie 1 hour difrence between summer and winter) Should i be using GMDATE and GMMKTIME or DATE and MKTIME... for all my date and time
getting rid of quotes in strings
sick of trying to deal with them in multiple ways (entering in and taking from database, echoing, echoing within a text input, etc) so i would just like to get rid of them.turn: bob's houseinto: bobs
single page with referrer to show correct page
I have a simple website with a couple of different pages. I would like to be able to in a div tag with a php require or even inside the same page be able to show whatever link is clicked on that part
array_map() probably obvious mistake
The code below is part of a class to escape strings, but should also accept an array, using array_map() to do the job. Unfortunately, passing an array results in the original, unescaped array being
Parse String
I need to parse the string below into three variables. How would I do that?john + 10/20/2008 - 10/30/2008+ and - are separators
how do i make new line after *
First check this page here. and you see my report. Im pulling form a mysql db. I want to beable to make a new line before each * Also why does some characters come out all funky?Hers my code.. I dont
"From field" in PHP email form
I used a wizard to create a PHP email form. I was able to customize it with the exception of the From field. I need the email that is sent to be "From" the email that the sender input.
ScriptResource.axd gives an error on fresh install of ASP.NET Ajax 1.0
Hello,I have a fresh install of Microsoft ASP.NET Ajax 1.0. When I create an Ajax enabled website in Visual Studio, and immediately run the Default.aspx page I get a javascript error: Sys is not
login from external site
Hi my new experience begins, Now what i am trying to do is i make three pages, login.php logout.php index.php . Now if i will not give correct detail i can not see the index.php ,all working perfect