How to pass variable one page to another page in opencart

182 views Asked by At

Please give me a ideas i have to created a variable like ($data['image2']) i want pass one page to other page how please help me.Actually,(What ever i added in product(image) for admin panel(opencart) that product image automatically should go to pinterest account i have tried but almost done i doing some miner issue i don't know please help me this.)

Here my code: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);  

I want pass the value to pinterest.php file how.

<?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";
0

There are 0 answers