Post status + image with TwitterAPIExchange on Twitter

后端 未结 3 954
醉话见心
醉话见心 2021-01-26 13:52

I\'ve got the following working code, the code simply posts a status and an image om my twitter page.

       require_once(\'TwitterAPIExchange.php\');

        $         


        
3条回答
  •  离开以前
    2021-01-26 14:28

    You have to implement the slight logic here-- Now on click of submit do following 1.store the image in the some folder of your project (Refer the below code to store the image in the folder)

    upload_file.php //upload file code here

    2.store text and upload the image name in the database. 3.Now you have the images in the image folder... and you also have the image name and the corresponding message in your database.

    4. $tweetmsg = $_POST['post_text']; $twimage = "Images/twitter-icon.png"; //before this

       retrive the last inserted row and fetch message and image name 
    
       $tweetmsg = $row['msg'];
       $image = $row['image_name'];
        $twimage = "Images/".$image;
    

    I hope this will be work for you.. Thanks

提交回复
热议问题