note 111704 added to faq
| From: | shashank dot malikk at gmail dot com | Date: | Tue, 19 Mar 2013 03:20:24 +0000 |
| Subject: | note 111704 added to faq | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-194119@lists.php.net to get a copy of this message | ||
someone help me about the following, i have this PHP code,
i want a webpage where i can enter values is it possible directly through this PHP code or do i have
to create a HTML form code and then link it with this PHP code ?
i tried to link it with the HTML form but the values i'm entering inside HTML those values are
not coming into this PHP code.
<?php
$post_data['key'] = 'your key here';
$post_data['firstname'] = 'first name here';
$post_data['lastname'] = 'last name here';
$post_data['address'] = 'address here';
foreach ( $post_data as $key => $value)
{
$post_items[] = $key . '=' . $value;
}
$post_string = implode ('&', $post_items);
$curl_connection = curl_init('https://example.com/api.php');
curl_setopt($curl_connection, CURLOPT_CONNECTTIMEOUT, 30);
curl_setopt($curl_connection, CURLOPT_USERAGENT, curl_setopt($curl_connection,
CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl_connection, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($curl_connection, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($curl_connection, CURLOPT_POSTFIELDS, $post_string);
$result = curl_exec($curl_connection);
echo "Transaction Result: " . $result . "<br><br>";
print_r(curl_getinfo($curl_connection));
echo curl_errno($curl_connection) . '-' . curl_error($curl_connection);
curl_close($curl_connection);
?>
----
Server IP: 69.147.83.199
Probable Submitter: 1.23.96.93
----
Manual Page -- http://php.net/manual/en/faq.php
Edit -- https://master.php.net/note/edit/111704
Del: integrated -- https://master.php.net/note/delete/111704/integrated
Del: useless -- https://master.php.net/note/delete/111704/useless
Del: bad code -- https://master.php.net/note/delete/111704/bad+code
Del: spam -- https://master.php.net/note/delete/111704/spam
Del: non-english -- https://master.php.net/note/delete/111704/non-english
Del: in docs -- https://master.php.net/note/delete/111704/in+docs
Del: other reasons-- https://master.php.net/note/delete/111704
Reject -- https://master.php.net/note/reject/111704
Search -- https://master.php.net/manage/user-notes.php