Jump to content

Passing Variables Help


eyesocialeyes

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

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.

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.