eyesocialeyes Posted November 14, 2012 Share Posted November 14, 2012 (edited) 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 November 14, 2012 by eyesocialeyes Quote Link to comment https://forums.phpfreaks.com/topic/270664-passing-variables-help/ Share on other sites More sharing options...
Muddy_Funster Posted November 14, 2012 Share Posted November 14, 2012 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? Quote Link to comment https://forums.phpfreaks.com/topic/270664-passing-variables-help/#findComment-1392205 Share on other sites More sharing options...
requinix Posted November 14, 2012 Share Posted November 14, 2012 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. Quote Link to comment https://forums.phpfreaks.com/topic/270664-passing-variables-help/#findComment-1392417 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.