Jump to content

Recommended Posts

Hello I have a photobooth app that posts photos with comments to a facebook fanpage. The app posts the photos with no problem but the comments are not being posted. there is a form that you comment on an then when you click upload it submits the form and passes the data to another page. I know that the data is passed correctlt because I have tested it with an "echo" statement and it shows up. for some reason though I cannot take the passed variable and insert it into my comment that will be posted with the photo. I have attached the entire upload code but here is a snippet. If I take out $_POST["lcomment"], and use "a generic comment between single quotes' it works fine and posts the generic comment. but when I try to insert the passed variable as the comment 'message' => $_POST["comment"], I get a null message when it posts to facebook. You can see the app in action here http://eyesocialeyes.com/webcam/ and here is where the photos are being posted on Facebook https://www.facebook.com/pages/Izon/190815390965794 . Please help!

 

#Upload photo here

$args = array(
'message' => $_POST["comment"],
'img' => '@' . $original,
'aid' => $album_id,
'access_token' => $fanpage_token
);
$photo = $facebook->api($album_id .'/photos','post',$args) ;

upload.php

Edited by eyesocialeyes
Link to comment
https://forums.phpfreaks.com/topic/270664-passing-variables-help/
Share on other sites

Normaly you would use single quotes to address array key names aswell. Have you tried assigning the $_POST value to a varialbe and passing that into the array? Are there any conditions that the api places on string format for comments? (sorry, I Fking hate facebook so know very little about it). Have you tried passing the same generic comment through the form to see if it works then? any chance of some examples of things you have tried so far?

You say "comment" in one place and "lcomment" in another. Are you sure you're using the right one?

 

Normaly you would use single quotes to address array key names aswell.

Normally you would use whatever quoting style you want. Single or double doesn't matter.

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.