Welcome to the Mod Share forums.
You are not logged in.
Pages: 1
Is it possible that you could let me use the script for validating usernames and passwords against Scratch for my website?
Mod Share- with Collab Features!
Learning Programming in a Nutshell: "You're missing a closing parenthesis" - LS97
Offline
Is it possible that you could let me use the script for validating usernames and passwords against Scratch for my website?
Certainly. (once I get FTP working, the stupid program crashed)
In PHP:
<?php
if(stristr(file_get_contents('http://scratch.mit.edu/api/authenticateuser?username=' . $someusername . '&password=' . $somepassword), 'false')) {
echo 'Wrong';
die;
}
?>
Just the URL:
http://scratch.mit.edu/api/authenticateuser?username=SOMEUSERNAME&password=SOMEPASSWORD
Last edited by jacob (2012-06-20 19:03:39)
Offline
Thanks.
In the credits, I'll give you guys credit for that.
Do you have to md5 the password?
Cause I tried it on mine, and with the real password it said false and a fake password said false.
Mod Share- with Collab Features!
Learning Programming in a Nutshell: "You're missing a closing parenthesis" - LS97
Offline
Thanks.
In the credits, I'll give you guys credit for that.Do you have to md5 the password?
Cause I tried it on mine, and with the real password it said false and a fake password said false.
Are you sure? It appeared to work when you are registering, and I just checked it again with my username!
The following code did work.
http://scratch.mit.edu/api/authenticateuser?username=jvvg&password=*****
Offline
I found why.
Your password cannot contain symbols. Only letters and numbers.
That would explain my difficulty signing up and my inability to log in to Clutter.
Last edited by SJRCS_011 (2012-01-26 18:27:34)
Mod Share- with Collab Features!
Learning Programming in a Nutshell: "You're missing a closing parenthesis" - LS97
Offline
SJRCS_011 wrote:Is it possible that you could let me use the script for validating usernames and passwords against Scratch for my website?
Certainly. (once I get FTP working, the stupid program crashed)
In PHP:<?php if(stristr(file_get_contents('http://scratch.mit.edu/api/authenticateuser?username=' . $someusername . '&password=' . $somepassword, 'false')) { } ?>
Just the URL:
http://scratch.mit.edu/api/authenticateuser?username=SOMEUSERNAME&password=SOMEPASSWORD
wait, shouldn't it be
<?php
if(stristr(file_get_contents('http://scratch.mit.edu/api/authenticateuser?username=' . $someusername . '&password=' . $somepassword),'false', TRUE) == FALSE) {
}
because otherwise it would always return false?
Mod Share- with Collab Features!
Learning Programming in a Nutshell: "You're missing a closing parenthesis" - LS97
Offline
SJRCS is right, Jacob-- you forgot a !
The correct boolean expression is
!stristr(file_get_contents('http://scratch.mit.edu/api/authenticateuser?username=' . $someusername . '&password=' . $somepassword), 'false')
LS97 - Mod Share Admin
Offline
SJRCS is right, Jacob-- you forgot a !
The correct boolean expression is
!stristr(file_get_contents('http://scratch.mit.edu/api/authenticateuser?username=' . $someusername . '&password=' . $somepassword), 'false')
you forgot a parentheses though
Last edited by SJRCS_011 (2012-04-26 14:22:34)
Mod Share- with Collab Features!
Learning Programming in a Nutshell: "You're missing a closing parenthesis" - LS97
Offline
Offline
Offline
Offline
I get Parse error: syntax error, unexpected '{' in /hermes/waloraweb025/b1275/pow.halfabee/ckc/mw/contact.php on line 4?
check your coding; you made a mistake somewhere in your code, on line 4
Mod Share- with Collab Features!
Learning Programming in a Nutshell: "You're missing a closing parenthesis" - LS97
Offline
magmawulf wrote:I get Parse error: syntax error, unexpected '{' in /hermes/waloraweb025/b1275/pow.halfabee/ckc/mw/contact.php on line 4?
check your coding; you made a mistake somewhere in your code, on line 4
I used the one that was provided ;_;
I checked over and over again
Offline
SJRCS_011 wrote:magmawulf wrote:I get Parse error: syntax error, unexpected '{' in /hermes/waloraweb025/b1275/pow.halfabee/ckc/mw/contact.php on line 4?
check your coding; you made a mistake somewhere in your code, on line 4
I used the one that was provided ;_;
I checked over and over again
Can you provide the complete file?
Offline
<?php
$username = $_POST["username"];
$password = $_POST["password"];
if(!stristr(file_get_contents('http://scratch.mit.edu/api/authenticateuser?username=' . $username . '&password=' . $password), 'false'){
echo "This is a test";
}
?>
I know I got something obvious wrong, just can't place it.
Offline
<?php $username = $_POST["username"]; $password = $_POST["password"]; if(!stristr(file_get_contents('http://scratch.mit.edu/api/authenticateuser?username=' . $username . '&password=' . $password), 'false'){ echo "This is a test"; } ?>
I know I got something obvious wrong, just can't place it.
You're missing a closing parenthesis
LS97 - Mod Share Admin
Offline
magmawulf wrote:<?php $username = $_POST["username"]; $password = $_POST["password"]; if(!stristr(file_get_contents('http://scratch.mit.edu/api/authenticateuser?username=' . $username . '&password=' . $password), 'false'){ echo "This is a test"; } ?>
I know I got something obvious wrong, just can't place it.
You're missing a closing parenthesis
Thanks.
Offline
Pages: 1