ugrás a tartalomhoz

Archívum

február 22, 2013

Facebook access token, jogosultsággal?

zzrek · 2013. Feb. 21. (Cs), 23.42
Sziasztok!
PHP-val, tárolt access token segítségével szeretnék postolni egy page falára.
Ezzel a kóddal megy is:

$url = "https://graph.facebook.com/$pageid/feed";
$fields = array (
    'message' => urlencode('teszt post'),
    'access_token' => urlencode($access_token)
);

$fields_string = "";
foreach ($fields as $key => $value):
    $fields_string .= $key . '=' . $value . '&';
endforeach;
rtrim($fields_string, '&');

$ch = curl_init();

curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_POST, count($fields));
curl_setopt($ch, CURLOPT_POSTFIELDS, $fields_string);

$result = curl_exec($ch);
curl_close($ch);
Ha az access tokent a graph api explorer-rel kérem le, ott be lehet jelölni a jogosultságokat (permissions) és egy igen hosszú access tokent ad, ezzel működik a fenti kód.

Persze megpróbáltam én kérni az access tokent, ezzel a kóddal:


  $app_token_url = 'https://graph.facebook.com/oauth/access_token?client_id='
                   .$app_id.'&client_secret='.$app_secret
                   .'&grant_type=client_credentials'
		   .'&scope=publish_stream';
		   
				   
  $ch = curl_init();
  curl_setopt($ch, CURLOPT_URL, $app_token_url);
  curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
  $res = curl_exec($ch);
  parse_str($res, $token);
  curl_close($ch);

  if (isset($token['access_token'])) 
  {
   $access_token=$token['access_token'];
  }

...de amit így kapok, azzal a tokennel nem tudok a falra postolni, "The user hasn't authorized the application to perform this action" hibát kapok vissza.

Parse error: syntax error, unexpected T_STRING

Horváth Ádám · 2013. Feb. 21. (Cs), 20.28
Sziasztok.

Ezt a hibát írja ki a böngésző.Nem tudom mi a hiba. Tudnátok segíteni?Nem tudom mi kell oda.

A hiba: Parse error: syntax error, unexpected T_STRING in /home/u231374952/public_html/post_mysql_01.php on line 22

A válaszotokat előre is köszönöm.

Üdv:Ádám

Testing the Open Web Platform

Joó Ádám · 2013. Feb. 21. (Cs), 16.25
A GitHubon nyíltan elérhető lesz a W3C technológiákhoz tartozó tesztek köre
 ■

Chrome app launcher developer preview

Joó Ádám · 2013. Feb. 21. (Cs), 16.20
Chrome alkalmazások indítóképernyője
 ■

Firefox introduces PDF viewer to browse the Web without interruption

Joó Ádám · 2013. Feb. 21. (Cs), 16.14
Natív PDF megjelenítés a Firefoxban
 ■

Regular Expressions 101 quiz

tgr · 2013. Feb. 21. (Cs), 15.49
Regex feladványok profiknak
 ■

Your Language Sucks

tgr · 2013. Feb. 21. (Cs), 15.48
Különféle programnyelvek hibáinak gyűjteménye
 ■

Tizen 2.0 released (Linux-based OS for phones, tablets, more)

Hidvégi Gábor · 2013. Feb. 21. (Cs), 15.41
A mobil operációs rendszer eszközeit HTML API-n keresztül is elérhetjük
 ■

FONT broder - keretes betű

simisoma · 2013. Feb. 21. (Cs), 06.46
Sziasztok!

Tudna valaki segíteni, hogy keretes betűket kellene használjak egy Weboldalon, de képként nem tudom beilleszteni.
Fehér alapú fekete keretes betű
Van esetleg valami jQuery script ami jól használható erre?

Köszönöm!
 ■

február 21

Php-val adatok módosítása táblában

geforce9600gt · 2013. Feb. 20. (Sze), 22.04
Hello

Kiíratom táblából a felvitt adatokat inputokba, és ezeket szeretném módosítani, de nem működik. Köszönöm előre is a segitséget.

[colorer=php]
<?php
$select=mysql_query("select * from termek where Termek='$termek' order by Id desc");
if(mysql_num_rows($select)>0)
{
echo '<form name="termekek" method="post">';
while($data=mysql_fetch_assoc($select))
{
echo '
<div class="adminDiv">
<span class="adminSpan">Szín (#......)</span>
<input type="text" name="szin['.$id.']" class="adminInput" placeholder="'.$data['Szin'].'" value="'.$data['Szin'].'"/>
</div>
<div class="adminDiv">
<span class="adminSpan">Betűméret (pixel)</span>
<input type="text" name="betumeret['.$id.']" class="adminInput" placeholder="'.$data['Betumeret'].'" value="'.$data['Betumeret'].'"/>
</div>
<div class="adminDiv">
<span class="adminSpan">Szín ár</span>
<input type="text" name="szin_ar['.$id.']" class="adminInput" placeholder="'.$data['Szin_ar'].'" value="'.$data['Szin_ar'].'"/>
</div>
<div class="adminDiv">
<span class="adminSpan">Betűméret ár</span>
<input type="text" name="betu_ar['.$id.']" class="adminInput" placeholder="'.$data['Betumeret_ar'].'" value="'.$data['Betumeret_ar'].'"/>
</div>
<div class="adminDiv">
<span class="adminSpan">Rendelhető ( 1 - 0 )</span>
<input type="text" name="status['.$id.']" class="adminInput" placeholder="'.$data['Status'].'" value="'.$data['Status'].'"/>
</div>';
echo '<input type="hidden" name="id['.$id.']" value="'.$data['Id'].'">';
}
echo '<div class="clear"></div>';
echo '<input type="submit" name="termekModify" value="Mentés" class="adminButton" />';
echo '</form>';
}
else
{
echo '<p>Ebben a kategóriában nincs felvéve termék</p>