请给我一个想法,我必须创建一个变量,如($ data [' image2'])我想将一页传递到其他页面请如何帮助我。实际上,(我添加了什么产品(图片)为管理面板(opencart)产品图像自动应该去pinterest帐户我已经尝试但几乎完成我做一些矿工问题我不知道请帮帮我。)
这里是我的代码:controller:
if (isset($this->request->post['image'])) {
$data['image2'] = $this->request->post['image'];
//print_r($data['image']);die;
}
// print_r($data['image2']);
//--------Post image-------///
//-------------curl starting---------------//
$url = 'http://localhost/mspink_new/pintest.php';
$ch = curl_init();
curl_setopt($ch,CURLOPT_URL, $url);
curl_setopt($ch,CURLOPT_POST, count(0));
curl_setopt($ch,CURLOPT_POSTFIELDS, 1);
//execute post
$result = curl_exec($ch);
print_r($result);die;
curl_close($ch);
我想将值传递给pinterest.php文件。
<?php
//$get =$_get('image');die;
//$image = $_GET['image'];
//print_r($image);die;
require_once "Pinterest.class.php";
// Create the pinterest object and log in
$p = new Pinterest();
$p->login("loginid", "password");
if( $p->is_logged_in() )
echo "Success, we're logged in\n";
//$image = $p->generate_image_preview("slider-old.jpg");
// if (isset($_POST)) {
// $image ="image";
// }
// print_r($image);die;
// Set up the pin
//$p->pin_url = "http://yellow5.com";
$p->pin_url = "http://www.mspinkpanther.com/";
$p->pin_description = "My awesome pin";
$p->pin_image_preview = $p->generate_image_preview('slider.jpg');
// Get the boards
$p->get_boards();
// Pin to the board called "Items"
if( !isset($p->boards['Items']) ) {
echo "For testing, please create a board called 'Items' and try again!\n";
exit;
}
$p->pin($p->boards['Items']);
// And we're done
echo "Hooray!\n";