Search found 9 matches

by phpkid01
Thu Aug 18, 2011 9:13 pm
Forum: Tutorials
Topic: API Tutorial... Decoding JSON
Replies: 5
Views: 1020

Re: API Tutorial... Decoding JSON

it only returns "Array" as the result... :/
by phpkid01
Thu Aug 18, 2011 2:19 pm
Forum: Tutorials
Topic: API Tutorial... Decoding JSON
Replies: 5
Views: 1020

Re: API Tutorial... Decoding JSON

so i should use: session_start(); $login = surfcms::validate_credentials($_POST['username'], $_POST['password'], $_POST['key']); $session = $login['session']; $username = $login['username']; $errors = json_decode($login['errors']); if($session==1){ $_SESSION['site'] = "scms_" . $username; ...
by phpkid01
Thu Aug 18, 2011 12:09 am
Forum: Tutorials
Topic: API Tutorial... Decoding JSON
Replies: 5
Views: 1020

API Tutorial... Decoding JSON

hey guys... i have a question... you know the errors parameters in the JSON well its encoded in another array... i was wondering how you decode that array aswell... to show the independant error messages as im kinda stuck... init.inc.php: session_start(); $login = surfcms::validate_credentials($_POS...
by phpkid01
Thu Jul 28, 2011 5:51 pm
Forum: Tutorials
Topic: API Tutorial... Im Stuck
Replies: 11
Views: 1808

Re: API Tutorial... Im Stuck

haha YOU ARE A STAR!!!

THank you soooo much :)

Test it out if you want:
http://www.api.test.develop.surf-cms.co.uk/
username: james
password: gardner1
by phpkid01
Wed Jul 27, 2011 2:14 pm
Forum: Tutorials
Topic: API Tutorial... Im Stuck
Replies: 11
Views: 1808

Re: API Tutorial... Im Stuck

im trying to return the session variable, and if the session===1 then i want to log the user in... if not add to $errors[] my error message.

but i cannot get the individual params and store them into a variable ...

you get that??
by phpkid01
Tue Jul 26, 2011 10:51 pm
Forum: Tutorials
Topic: API Tutorial... Im Stuck
Replies: 11
Views: 1808

Re: API Tutorial... Im Stuck

Okay i got it working with all the validation things but how can i put the array information displayed into variables :?: ive tried this: /developers_site/index.php: <?php echo "<pre>"; $array = surfcms::validate_credentials($_POST['username'], $_POST['password'], $_POST['key']); while (li...
by phpkid01
Tue Jul 26, 2011 8:56 pm
Forum: Tutorials
Topic: API Tutorial... Im Stuck
Replies: 11
Views: 1808

Re: API Tutorial... Im Stuck

i dont understand how i could set the session over JSON.. thats why i set the variable $session and included it in the /mysite/api.php and sent it to the developers site... but it doesnt seem to work... i mean the query there is no errors displayed??

phpkid
by phpkid01
Tue Jul 26, 2011 3:04 pm
Forum: Tutorials
Topic: API Tutorial... Im Stuck
Replies: 11
Views: 1808

Re: API Tutorial... Im Stuck

okay that works like a charm now how would i actually give them the functionality to login on the developers site using the credentials from my database?? /developers_site/api_interface.inc.php: <?php class surfcms { const API_URL = 'http://www.develop.surf-cms.co.uk/api.php'; // DONT EDIT FROM HERE...
by phpkid01
Sun Jul 24, 2011 3:34 pm
Forum: Tutorials
Topic: API Tutorial... Im Stuck
Replies: 11
Views: 1808

API Tutorial... Im Stuck

Hey, Last night i was working through the API tutorials On Your Youtube Page i recieved no errors when completed everything worked but the purpose of the API seems to be different?? can i use the API to allow External sites to Login with users from my Database using the API, i thought i could so i t...