Twitter API probleem

Gestart doorShahiem3 reacties34 weergaven

4 berichten · pagina 1 van 1

Shahiem

Lid · Topicstarter

Berichten
20.364
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Hi,

Voor een kleine site probeer ik een twitter api erop te smijten emo Maar nu kan ik wel inloggen op Twitter maar als je dan bent ingelogd krijg ik dit:

Undefined index: port
Foutcode #8
Bestand /twitter/twitteroauth/OAuth.php
Lijn 383

$parts = parse_url($this->http_url);

    $port = @$parts[port]; // Regel 383
    $scheme = $parts[scheme];
    $host = $parts[host];
    $path = @$parts[path];


Wie weet hoe ik dat kan fixen? Want als ik bijvoorbeeld in me twitter api map ga dan zie je dat er geen errors zijn maar wanneer ik de onderstaande code in me header.php doe dan geeft hij errors aan.

Door die connectie variables geeft hij die undefined errors aan. (let niet op uitlijning)

[COLOR= #0000BB]<?php[/COLOR]
                    [URL="http://www.php.net/include"]include[/URL] [COLOR= #0000BB]$_SERVER[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]DOCUMENT_ROOT[/COLOR][COLOR= #007700]].[/COLOR][COLOR= #DD0000]/projecten/pf/api/twitter/twitteroauth/twitteroauth.php[/COLOR][COLOR= #007700];[/COLOR]
                    [URL="http://www.php.net/include"]include[/URL] [COLOR= #0000BB]$_SERVER[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]DOCUMENT_ROOT[/COLOR][COLOR= #007700]].[/COLOR][COLOR= #DD0000]/projecten/pf/api/twitter/config.php[/COLOR][COLOR= #007700];[/COLOR]

                    [URL="http://www.php.net/if"]if[/URL] [COLOR= #007700]([/COLOR][URL="http://www.php.net/empty"]empty[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_SESSION[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]access_token[/COLOR][COLOR= #007700]]) ||[/COLOR] [URL="http://www.php.net/empty"]empty[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_SESSION[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]access_token[/COLOR][COLOR= #007700]][[/COLOR][COLOR= #DD0000]oauth_token[/COLOR][COLOR= #007700]]) ||[/COLOR] [URL="http://www.php.net/empty"]empty[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_SESSION[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]access_token[/COLOR][COLOR= #007700]][[/COLOR][COLOR= #DD0000]oauth_token_secret[/COLOR][COLOR= #007700]]))[/COLOR] 
                        [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]<a href="[/COLOR][COLOR= #007700].[/COLOR][URL="http://www.php.net/LINK"]LINK[/URL][COLOR= #007700].[/COLOR][COLOR= #DD0000]api/twitter/redirect" title="Sign in with Twitter" class="sign twitter"><span>Twitter</span></a>[/COLOR][COLOR= #007700];[/COLOR]
                    [URL="http://www.php.net/else"]else[/URL]
                    [COLOR= #007700]{[/COLOR]
                        [COLOR= #FF8000]/* Get user access tokens out of the session. */[/COLOR]
                        [COLOR= #0000BB]$access_token[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #0000BB]$_SESSION[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]access_token[/COLOR][COLOR= #007700]];[/COLOR]

                        [COLOR= #FF8000]/* Create a TwitterOauth object with consumer/user tokens. */[/COLOR]
                        [COLOR= #0000BB]$connection[/COLOR] [COLOR= #007700]= new[/COLOR] TwitterOAuth[COLOR= #007700]([/COLOR]CONSUMER_KEY[COLOR= #007700],[/COLOR] CONSUMER_SECRET[COLOR= #007700],[/COLOR] [COLOR= #0000BB]$access_token[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]oauth_token[/COLOR][COLOR= #007700]],[/COLOR] [COLOR= #0000BB]$access_token[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]oauth_token_secret[/COLOR][COLOR= #007700]]);[/COLOR]

                        [COLOR= #0000BB]$content[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #0000BB]$connection[/COLOR][COLOR= #007700]->[/COLOR]get[COLOR= #007700]([/COLOR][COLOR= #DD0000]account/verify_credentials[/COLOR][COLOR= #007700]);[/COLOR]
                        
                        [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #0000BB]$content[/COLOR][COLOR= #007700];
                    }[/COLOR]
                    ?>


Gegroet,
Shahiem
0
Berichten
12.729
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Hoort deze "{" niet anders om te staan?
0
Erik

Lid

Berichten
7.109
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Nah de brackets ({ en }) staan goed.
0
Berichten
13.482
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
probeer dit dan:

$port = isset($parts[port]) ? $parts[port] : null; // Regel 383
0

Jouw reactie

Deel je idee, stel een vraag of help een ander verder.

Editor laden…

Praat mee met de One2xs-community.

Inloggen om te reageren