This is a bit complicated, I'm just hoping someone else has run into this and knows how to do it a different way or make it work.
When sending a file as part of form information included in a cURL request, it appears you can not include a query string in the file name. Take a look at my example to see what I'm talking about.
Code: //This creates an example image with some text from $_GET['img'] you can try calling this directly to see what the output looks like
if(isset($_GET['img'])){
$im = imagecreatetruecolor(120, 20);
$text_color = imagecolorallocate($im, 255, 255, 255);
imagestring($im, 3, 3, 3, $_GET['img'], $text_color);
header('Content-type: image/jpeg');
imagejpeg($im);
imagedestroy($im);
exit;
}
//Show what was sent to the $_POST and $_FILES variables
if(isset($_POST['showpost'])){
echo '<pre>';
print_r($_POST);
print_r($_FILES);
exit;
}
//Here's the part where we get in trouble...
//This works
//$imgURL = '@'.$_SERVER['SCRIPT_FILENAME'];
//This doesn't work
$imgURL = '@'.$_SERVER['SCRIPT_FILENAME'].'?img=true';
$data = array('showpost' => 'true', 'file' => $imgURL);
//Now do the cURL request to show information about the file that was sent
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'http://'.$_SERVER["SERVER_NAME"].$_SERVER["REQUEST_URI"]);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
curl_exec($ch);
if(curl_errno($ch))
echo curl_error($ch);
curl_close($ch);
When using the section that says "This doesn't work" you'll get the cURL error "failed creating formpost data".
Any suggestions?
dynamic table with forms
I have a table that is populated with mysql data and in teh first column there is a raido button that i would like to have it when selected and i hit either edit or delete the ID is passed to another
Form File Upload
I've read through tons of resources and tutorials and as far as I can tell, my code is accurate, but for some reason it's not working...My HTML Form:Code: <form action="script.php"
How do I get the row number from from an sql table query
Hi allI have a table that I query and it returns a number of rows.mysql_num_rows($query) = $totalI want to have next and previous buttons, is there a way of retrieving the current row number, and can
php automatically escaping single quotes
I'm trying to test out my security a bit and I've noticed that php is escaping my single quotes. For instance I enter x' OR 1=1-- in a form and the output it gives me is x\' OR 1=1--.Is there a
form variables from database help.
Hi all,I would like to have a form that gives you options based on the results of an mysql query.My example is this, say I have a mysql row with the colum name points and the result is 5. How would I
Printer configuration
Hi All,
Can't find a decent web analytics!!!
I've downloaded and installed Piwik. It's location detection based on IP addresses is fairly inaccurate even after installing the recommended plugins. Can someone please suggest a free solution with
DOMDocument
Hello All,I need to take an XML document, modify some of the nodes in it and then perform a selective reordering of a subset of nodes. The modification I have done without too much difficulty -
Dump with added_funcion cl_salv_table
Hi there, I'm having some troubles adding a self defined function to an ALV in fullscreen. The thing is that I'm getting a dump after I press de button of my added function; the exception is
onclick problem
I have <input type="text" name="message"><a href=page2.php>click here</a> Can i parse the value whatever written in the textbox on url