fg123 wrote:
Hopefully. It's mostly complex math that's not at my level.
Oh! But it's possible? I'd love to try, math is my favourite subject and I've got a decent year 11 preparation...
Offline
lallaway12 wrote:
Can you make the font in the text optons to be the forums?
What's wrong with the font?
Offline
LS97 wrote:
fg123 wrote:
Hopefully. It's mostly complex math that's not at my level.
Oh! But it's possible? I'd love to try, math is my favourite subject and I've got a decent year 11 preparation...
I'm pretty sure it's possible... Just how... ?
Offline
fg123 wrote:
LS97 wrote:
fg123 wrote:
Hopefully. It's mostly complex math that's not at my level.
Oh! But it's possible? I'd love to try, math is my favourite subject and I've got a decent year 11 preparation...
I'm pretty sure it's possible... Just how... ?
Well, what's the complex math you're having trouble with?
Offline
LS97 wrote:
lallaway12 wrote:
Can you make the font in the text optons to be the forums?
What's wrong with the font?
It looks well funny it not being the same as the forums
Offline
lallaway12 wrote:
LS97 wrote:
lallaway12 wrote:
Can you make the font in the text optons to be the forums?
What's wrong with the font?
It looks well funny it not being the same as the forums
But it's not supposed to have anything to do with the forums... Every site can have its own font and we chose to copy Scratch 2.0's!
Offline
sparks wrote:
Sorry about this, but the commission I'm working on at the moment it taking up a lot of my time. I don't know how much work on this I'll be able to do in the next few weeks
No problem, it's important you do your real work best you can, just like school comes before leisure (usually)
Honestly, it would be nice if you actually did some work eventually, especially since we're kinda stuck now, but there's no hurry.
Offline
MathWizz wrote:
I didn't make a drag and drop interface for JsScratch, but I have for a few other projects. I suppose I could help if you need any.
Well, not any substantial help since we already have plenty developers for this project, but just some useful examples or code to get us started on this... we really can't get it to work otherwise!
Offline
Hey, would you mind me peeking at your PHP code? I'm making a website, and I'd love to see how you did the Scratch authentication.
Offline
technoboy10 wrote:
Hey, would you mind me peeking at your PHP code? I'm making a website, and I'd love to see how you did the Scratch authentication.
Sure! Someone please paste the code, I can't possibly access the FTP at 52kbps internet
Offline
Yea of course, my awesome login.php code coming up
That first include should be require, but oh well.
<?php include("includes/settings.php"); if (isset($_POST['loginForm'])) { $username = $_POST['username']; $rawPassword = $_POST['password']; $password = md5($rawPassword); $res = mysql_query("SELECT * FROM users WHERE username = '$username' "); if (mysql_num_rows($res) == 0) //username doesn't exist { header("Location: login.php?error=1"); } else { while($data=mysql_fetch_array($res,MYSQL_ASSOC)) { $passwordFromDB = $data['password']; //retreive the password from the database $admin = $data['admin']; $scratchid = $data['scratchUserID']; $scratchun = $data['scratchUsername']; } if ($password != $passwordFromDB) //checking password { header("Location: login.php?error=1"); //wrong password } else //correct, logging in { session_set_cookie_params(3600 * 24 * 6); $_SESSION['login'] = 1; $_SESSION['username'] = $username; $_SESSION['admin'] = $admin; $_SESSION['scratchid'] = $scratchid; $_SESSION['scratchun'] = $scratchun; $_SESSION['password'] = $passwordFromDB; $ip = $_SERVER['REMOTE_ADDR']; //not always reliable, if better way, please replace $res = mysql_query("UPDATE users SET lastip = '$ip' WHERE username = '$username'"); //set login ip } } } if (isset($_SESSION['login'])) { header("Location: index.php"); } ?> <!DOCTYPE HTML5> <html> <head> <title>Login | Scratch Forum API</title> <? include(SRV_ROOT . '/includes/head.php'); ?> </head> <body> <? include(SRV_ROOT . '/includes/header.php'); ?> <div class="box"> <div class = 'box-head'> <h4>Login</h4> </div><!--/box-head--> <div class='box-content'> <div class='inner'> <p> <?php if(isset($_GET['error'])) { echo('<div class="ui-state-error ui-corner-all" style="padding: 0 .7em;"> <p><span class="ui-icon ui-icon-alert" style="float: left; margin-right: .3em;"></span>'); if($_GET['error'] == 1) { echo("Username Not Found or Password Incorrect"); } else if($_GET['error'] == 2) { echo("You must login to create an image!"); } else { echo("Unknown Error..."); } echo("</p></div><br>"); } if(isset($_GET['success'])) { echo("<div id='TxtSuccess'>"); if($_GET['success'] == 1) { echo("Registration success! Please login!"); } else { echo("Unknown success, but I suppose it's happy!"); } echo("</div><br>"); } ?> <form action="login.php" method="POST"> <b> Username: <input type="text" style="color:#333;" name="username" id="username"><br> Password: <input type="password" style="color:#333;" name="password" id="password"> </b> <input type="hidden" name="loginForm" value="1"><br><br> <input type="submit" name="loginBtn" value="Log in!" style="padding:15px;"><input type="button" name="registerBtn" value="Sign Up!" style="padding:15px;" onclick="window.location = 'register.php'"> </form> </p> </div><!--/inner--> </div><!--/box-content--> </div><!--/box--> <?php include(SRV_ROOT . '/includes/footer.php'); ?> </body> </html>
Last edited by fg123 (2012-08-17 14:00:58)
Offline
I tried to implement this on my site, but it gave me an error. The error was
Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING in /login.php on line 59 . Any ideas?
Offline
Probably a typo btw
Offline
fg123 wrote:
Sure, if you give credit. Can you post the code in question?
I just pasted in your code (replacing SRV_ROOT . /includes/head.php with includes:header.php). I couldn't pinpoint the line in question, as my text editor isn't great.
Offline
technoboy10 wrote:
fg123 wrote:
Sure, if you give credit. Can you post the code in question?
I just pasted in your code (replacing SRV_ROOT . /includes/head.php with includes:header.php). I couldn't pinpoint the line in question, as my text editor isn't great.
OK, seems like that is exactly the problem.
line 59 is, in our code, right after the body tag:
<? include(SRV_ROOT . '/includes/header.php'); ?>
I first want to point out that head.php and header.php aren't the same file, as the head and the header aren't the same thing on a web page.
head.php basically contains stylesheet and favicon information that is common to all pages on our site (which is why we used the include) and is outputted into the <head> element.
the visual navigation bar header, stored in header.php itself, is the blue top bar that helps users find their way throughout the site. It's part of the body of the site and has no special code.
So now, as for the error, could you paste us those few lines of code? You probably forgot a closing quote while replacing that text.
Offline
He says he can't exactly pinpoint the line, could you post the whole code for both files on something like pastebin, so we don't clog up the FluxBB database with code?
And backing onto topic, since sparks can't work on it, I guess I will do a little more testing and work to try to get this back and up and running...
Offline
fg123 wrote:
He says he can't exactly pinpoint the line, could you post the whole code for both files on something like pastebin, so we don't clog up the FluxBB database with code?
And backing onto topic, since sparks can't work on it, I guess I will do a little more testing and work to try to get this back and up and running...
I meant please paste the lines around the include, which I said to be line 59
It would be absolutely great if you worked on it, but whatever you do NEVER touch the viewer directory! I am actively creating the renderer.
Also, it's the third time I'm changing all the header items back to absolute links. Remember your backslashes
Offline
(update)
I started the viewer and it's working pretty well so far (done error handling, database reading, and a couple of elements).
you can already kind of test it out by manually setting the database values
Offline