Question: I'm trying to curl a page (server.php) and send it three variables in a header ($webServiceId $hash and $timestamp), shown below. How can I grab the two variables out of the header in server.php so I can process them and send a response? I've tried googling and searching here, but I can't seem to find out how.

```
$ch = curl_init();
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_URL, 'server.php');
curl_setopt($ch, CURLOPT_HTTPGET, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, array("Authorization: URL-Encoded-API-Key {$webServiceId},{$hash},{$timestamp}"));
$response = curl_exec($ch);
curl_close ($ch);
// dump response
print_r( $response );

```

If server.php echos the headers its recieved back through the response, the print\_r of $response yields:

```
HTTP/1.1 200 OK Date: Thu, 02 Aug 2012 22:18:59 GMT Server: LiteSpeed Connection: close X-Powered-By: PHP/5.3.14 Allow: GET

```

the Authorization: URL-Encoded-API-Key is't in there. Could I be setting up the curl header wrong?

Answer: 
Yes, you can use ON DUPLICATE KEY UPDATE if you want to update values for records with matching unique keys. Of course that means you have to have unique keys on the table to begin with.
You could write a stored procedure 

proc\_insert\_or\_update(var1, var2, varN, link)

if link exists
 UPDATE query
ELSE
 INSERT query

<http://dev.mysql.com/doc/refman/5.0/en/create-procedure.html>