The Scratch advanced forum is currently receiving a lot of threads either sharing information on how to use various web programming languages or asking for help in using them and this is taking up quite a bit of space. This thread aims to unify those questions so that there is one place where potential helpers can check for questions they might answer and where individual questions have a higher chance of being addressed.
HTML Tutorials
Easy
How to make a web-page play music/sounds. ~WindowsExplorer
PHP Tutorials
Easy
PHP Variables ~Sparks
Javascript Tutorials
Moderate
JavaScript Objects Part I: Properties ~Hardmath123
JavaScript Objects Part II: Methods ~Hardmath123
JavaScript Objects Part III: Custom Objects ~Hardmath123
How to write a good tutorial. Consider reading this to get the most out of your submission.
Statistics!
Last edited by sparks (2011-11-11 12:18:22)
Offline
^home
HTML Tutorial: How to make a web-page play music/sounds
Shared by: WindowsExplorer
Difficulty: Easy
<iframe src='MUSIC_FILE_LINK' width='0' height='0'></iframe>
Where to use: Anywhere between the <body> and </body> tags in your document.
Notes:
o Replace the text MUSIC_FILE_LINK with the link URL to your sound.
o This uses an iframe and will therefore leave a small white dot on your screen. To completely hide the iframe containing your sound, optionally add a CSS display attribute to the code and use this instead:
<iframe src='MUSIC_FILE_LINK' width='0' height='0' style = 'display:none;'></iframe>
Last edited by sparks (2011-11-10 13:05:37)
Offline
Interesting! I'll be contributing a lot a JS, I hope. Look out!
Offline
Hardmath123 wrote:
Interesting! I'll be contributing a lot a JS, I hope. Look out!
(y) Sounds good! With any luck this will allow people to continue discussing web-languages here without creating a thread for every question - which I know mildly annoys some people
Offline
Thanks for creating this Sparks! This will probably become very useful for later in the future.
Offline
Yays!
Offline
Can someone post a tutorial on how to make a download in HTML/CSS/JS, and also playing sounds with it? My chances of getting a server aren't so great, so I'm stuck with HTML/CSS/JS.
Offline
maxskywalker wrote:
Can someone post a tutorial on how to make a download in HTML/CSS/JS, and also playing sounds with it? My chances of getting a server aren't so great, so I'm stuck with HTML/CSS/JS.
There is not way to download with JS unless it is from your server or the file you are trying to download has 'Access-Control-Allow-Origin: *' in its header (most sites don't have this.)
Offline
Is there a way to UN-MD5 something in php? I have a login and register and when I md5 the password, there is no way to undo it, so how would md5ng passwords work?
Offline
WindowsExplorer wrote:
Is there a way to UN-MD5 something in php? I have a login and register and when I md5 the password, there is no way to undo it, so how would md5ng passwords work?
Just compare the MD5 of the entered password with the real MD5 password in the db.
md5 are not ment to be UN-MD5'd by the way. That's the whole purpose of MD5
Last edited by MathWizz (2011-11-10 11:03:33)
Offline
MathWizz wrote:
WindowsExplorer wrote:
Is there a way to UN-MD5 something in php? I have a login and register and when I md5 the password, there is no way to undo it, so how would md5ng passwords work?
Just compare the MD5 of the entered password with the real MD5 password in the db.
md5 are not ment to be UN-MD5'd by the way. That's the whole purpose of MD5
Yes, but it doesn't seem to work. It seems like it has two different md5 values
Offline
WindowsExplorer wrote:
MathWizz wrote:
WindowsExplorer wrote:
Is there a way to UN-MD5 something in php? I have a login and register and when I md5 the password, there is no way to undo it, so how would md5ng passwords work?
Just compare the MD5 of the entered password with the real MD5 password in the db.
md5 are not ment to be UN-MD5'd by the way. That's the whole purpose of MD5Yes, but it doesn't seem to work. It seems like it has two different md5 values
![]()
Then the passwords must be different.
Offline
MathWizz wrote:
WindowsExplorer wrote:
MathWizz wrote:
Just compare the MD5 of the entered password with the real MD5 password in the db.
md5 are not ment to be UN-MD5'd by the way. That's the whole purpose of MD5Yes, but it doesn't seem to work. It seems like it has two different md5 values
![]()
Then the passwords must be different.
nope - both the same passes.
Offline
sparks, the sound thingie for PHP won't work without tags. I suggest you use single quotes instead to encase the html,so that there is no need to use escape characters for the "".
Offline
LS97 wrote:
sparks, the sound thingie for PHP won't work without tags. I suggest you use single quotes instead to encase the html,so that there is no need to use escape characters for the "".
Thank you, I'll fix it up.
@WindowsExplorer:
1) user enters password
2) password MD5'd
3) password sent to database in MD5 format for protection
4) User logs in by entering their unencrypted password
5) MD5'd password retrieved from database
6) password entered by login form MD5'd, then compared to the one you pulled from the database
something like:
if(md5($_POST['password']) == $encryptedPass) {
$passwordState = True;
}You should not be un-MD5-ing passwords of your users as they should be the only ones who know their pass, you are breaching their privacy if you take their passwords and view them without telling them that you can/will do so.
_____________________________________________
EDIT: As it is technically nothing more than pure HTML edited, I have recategorised WindowsExplorer's tutorial to the HTML section
Last edited by sparks (2011-11-10 13:06:51)
Offline
sparks wrote:
LS97 wrote:
sparks, the sound thingie for PHP won't work without tags. I suggest you use single quotes instead to encase the html,so that there is no need to use escape characters for the "".
Thank you, I'll fix it up.
@WindowsExplorer:
1) user enters password
2) password MD5'd
3) password sent to database in MD5 format for protection
4) User logs in by entering their unencrypted password
5) MD5'd password retrieved from database
6) password entered by login form MD5'd, then compared to the one you pulled from the database
something like:Code:
if(md5($_POST['password']) == $encryptedPass) { $passwordState = True; }You should not be un-MD5-ing passwords of your users as they should be the only ones who know their pass, you are breaching their privacy if you take their passwords and view them without telling them that you can/will do so.
That's what I'm trying to do, but I have it this way:
$username = $_POST['username']; // Gets the inputted username from the form
$password2 = $_POST['password']; // Gets the inputted password from the form
$password = md5($password2);
$icon = $resultng;
$time = time(); // Gets the current server time
$check = $_POST['setcookie']; // Checks if the remember me button was ticked
$db = mysql_connect($dbHost,$dbUser,$dbPass); // Connection Code
mysql_select_db($dbname,$db); // Connects to database
$query = "SELECT user, pass FROM login WHERE user = '$username' AND pass = '$password'";
$result = mysql_query($query, $db);
$queryr = "SELECT * FROM login WHERE user = '$username'";
$resultr = mysql_query($queryr, $db);
$row2=mysql_fetch_array($resultr);
$type = $row2['type'];
$icon = $row2['icon'];
if(mysql_num_rows($result)) {
logged in code
} else {
echo "wrong pass";
}i keep getting wrong pass error.
Offline
sparks wrote:
LS97 wrote:
sparks, the sound thingie for PHP won't work without tags. I suggest you use single quotes instead to encase the html,so that there is no need to use escape characters for the "".
Thank you, I'll fix it up.
@WindowsExplorer:
1) user enters password
2) password MD5'd
3) password sent to database in MD5 format for protection
4) User logs in by entering their unencrypted password
5) MD5'd password retrieved from database
6) password entered by login form MD5'd, then compared to the one you pulled from the database
something like:Code:
if(md5($_POST['password']) == $encryptedPass) { $passwordState = True; }You should not be un-MD5-ing passwords of your users as they should be the only ones who know their pass, you are breaching their privacy if you take their passwords and view them without telling them that you can/will do so.
_____________________________________________
EDIT: As it is technically nothing more than pure HTML edited, I have recategorised WindowsExplorer's tutorial to the HTML section![]()
Yeah, the point of hashing things is so people can't figure out the passwords. So what you can do is:
// Register:
$user = $_POST['username'];
$pass = md5($_POST['password']);
$result = mysql_query("INSERT INTO users_table (username, password) VALUES '$user', '$pass'");
//Login
$user = $_POST['username'];
$pass = md5($_POST['password']);
$result = mysql_query("SELECT * FROM users_table WHERE username='$user'");
$row = mysql_fetch_array($result);
if ($pass == $row['password']) { echo 'Login successful'; }By the way, that code I made, is so insecure, that I am speechless; but that is just to show the concept. Basically it md5s the password then it checks to see if it is the same md5'd password.
So here is what happens:
The user inserts the data into a form:
Username: RandomUser1234
Password: RandomPassword1234
The data is sent to the server: Note the password is not sent encrypted yet, the server gets the data then encrypts ( hashes ) it.
$user = 'RandomUser1234'
$pass = '00567bc61bab9cdd677c676559d2e5f5' // Password "RandomPassword1234" is encrypted into '00567bc61bab9cdd677c676559d2e5f5'
Now if this were the registration page it would insert that data into the database:
mysql_query("INSERT INTO users_table (username, password) VALUES '$user', '$pass'");
If it's the login ( and the user has already registered ) it checks to see if the hashes are the same:
if ('00567bc61bab9cdd677c676559d2e5f5'='00567bc61bab9cdd677c676559d2e5f5') { echo 'Logged in!'; }
But if they type something else in like "RandomNotPassword" ( which is encrypted into 'e6b3dadbb2f33811d31ac4eeea99341d' ):
if ('e6b3dadbb2f33811d31ac4eeea99341d'=='00567bc61bab9cdd677c676559d2e5f5' { echo 'It will never get here, because the passwords are not the same.'; }
So either you aren't inserting the hashed password correctly, or you are not hashing the password and checking it to the one in the database correctly.
EDIT: I spent an entire 30 minutes preparing this post and then someone replies before I can post it... Can you show us the registration code as well?
Last edited by Magnie (2011-11-10 13:25:19)
Offline
Still not working
I have
$username = $_POST['username'];
$pass3r = md5($_POST['password']);
$result3r = mysql_query("SELECT * FROM login WHERE user='$username'");
$row3r = mysql_fetch_array($result3r);
if ($pass3r == $row3r['pass']) {Offline
@sparks: It's a possibility.
@WindowsExplorer: Can you give me the registration code you have?
Offline
MathWizz wrote:
maxskywalker wrote:
Can someone post a tutorial on how to make a download in HTML/CSS/JS, and also playing sounds with it? My chances of getting a server aren't so great, so I'm stuck with HTML/CSS/JS.
There is not way to download with JS unless it is from your server or the file you are trying to download has 'Access-Control-Allow-Origin: *' in its header (most sites don't have this.)
Um, it would be me making the site.
Offline
Magnie wrote:
@sparks: It's a possibility.
![]()
@WindowsExplorer: Can you give me the registration code you have?
<link rel="stylesheet" type="text/css" href="global.css" />
<script type="text/javascript">
function disabled2() {
alert("This website is in beta test mode. Therefore your account will not be activated, and will not work when logging in.");
}
</script>
<?php
include "connect.php";
if ($_GET['error'] == "true") {
include "demo.html";
echo "<p><g style=\"border-style:solid; border-color:darkred; background-color:red; color:darkred;\">
Registrations are disabled as the site is in beta mode.</g></p>";
} else {
include "demo.html";
$badlist = array("censored words are here");
$submit = $_POST['submit'];
$username = strip_tags($_POST['username']);
$password = $_POST['password'];
$ipaddress = $_SERVER['REMOTE_ADDR'];
$email = $_POST['email'];
$repeatpassword = strip_tags($_POST['repeatpassword']);
$date = date("Y-m-d");
$namecheck = substr($username, -2);
$namecheck2 = substr($username, -1);
$namecheck2 = substr($username, -1);
$namecheck3 = str_word_count($username);
$usernamefr = strtolower ($username);
$resultrug = mysql_query("SELECT * FROM `login` WHERE `user`='$username'") or die ("Error:" . mysql_error());
$num_rowsgyr = mysql_num_rows($resultrug);
if ($submit) {
if ($num_rowsgyr > "0") {
echo "<p><g style=\"border-style:solid; border-color:darkred; background-color:red; color:darkred;\">
Registration failed. The username \"$username\" is already taken. Sorry about that.</g></p>";
mysql_query("INSERT INTO failed_registrations (ip, time, reason, user, pass, email)
VALUES ('$ip', '$date', 'Attempting to use an already taken username.', '$username', '$password', '$email')");
}
if ($namecheck3 > "3") {
echo "<p><g style=\"border-style:solid; border-color:darkred; background-color:red; color:darkred;\">
Registration failed. No more than three words are allowed in your username.</g></p>";
mysql_query("INSERT INTO failed_registrations (ip, time, reason, user, pass, email)
VALUES ('$ip', '$date', 'Attempting to use over three words in username.', '$username', '$password', '$email')");
}
if ($usernamefr == $badlist) {
echo "<p><g style=\"border-style:solid; border-color:darkred; background-color:red; color:darkred;\">
Registration failed. Your name contains bad words.</g></p>";
mysql_query("INSERT INTO failed_registrations (ip, time, reason, user, pass, email)
VALUES ('$ip', '$date', 'Attempting to use bad words in username.', '$username', '$password', '$email')");
}
if ($namecheck == "'s" || $namecheck == "'S" || $namecheck2 == "*") {
echo "<p><g style=\"border-style:solid; border-color:darkred; background-color:red; color:darkred;\">
Registration failed. Please don't try to trick our system again.</g></p>";
mysql_query("INSERT INTO failed_registrations (ip, time, reason, user, pass, email)
VALUES ('$ip', '$date', 'Attempting to trick the registration system.', '$username', '$password', '$email')");
} else {
if ($username && $password && $repeatpassword && $email) {
if ($password == $repeatpassword && !($num_rowsgyr > "0")) {
$passwordmd5 = md5($password);
mysql_query("INSERT INTO login (user, pass, ban, email, ip, type, time)
VALUES ('$username', '$passwordmd5', 'false', '$email', '$ip', 'User', '$date')");
$to1 = "support@plaxon.org";
$subject1 = "New registration at Mini Universe: $username";
$message1 = "A new user has registered at Mini Universe!
Username: $username
Password: $password";
$from1 = "notification-index@plaxon.org";
$headers1 = "From:" . $from1;
mail($to1,$subject1,$message1,$headers1);
$to = "$email";
$subject = "Welcome to Mini Universe, $username!";
$message = "Welcome to Mini Universe, $username! Your account has successfully been created! You can login with the following details:
Username: $username
Password: $password
Have fun,
Mini Universe team!";
$from = "support@plaxon.org";
$headers = "From:" . $from;
mail($to,$subject,$message,$headers);
echo "<p><g style=\"border-style:solid; border-color:darkgreen; background-color:green; color:darkgreen;\">
You are registered! You can now login! Your account details have been sent to <b>$email</b>! (Also, don't forget to check your spam folder!) <a href=\"login.php\">[Login Now]</a></g></p>";
} if (!($password == $repeatpassword)) {
echo "<p><g style=\"border-style:solid; border-color:darkred; background-color:red; color:darkred;\">
The passwords you entered do not match. Please try again.</g></p>";
}
} if (!($username && $password && $repeatpassword)) {
echo "<p><g style=\"border-style:solid; border-color:darkred; background-color:red; color:darkred;\">
All fields are required to create your account. Please try again.</g></p>";
}
}
}
echo '<p>
<html>
<form action="register.php" method="POST">
<p><label for="username">Username: <input type="text" name="username" id="username" maxlength="25" /></label></p>
<p><label for="password">Password: <input type="password" name="password" id="password" maxlength="25" /></label></p>
<p><label for="repeatpassword">Password: <input type="password" name="repeatpassword" id="repeatpassword" maxlength="25" /></label></p>
<p><label for="email">Email: <input type="text" name="email" id="email" maxlength="100" /></label></p>
<p><input type="submit" name="submit" value="Join Now!"></p>
</form>
</p>
</html>';
}
?>Offline
WindowsExplorer wrote:
Magnie wrote:
@sparks: It's a possibility.
![]()
@WindowsExplorer: Can you give me the registration code you have?Code:
<link rel="stylesheet" type="text/css" href="global.css" /> <script type="text/javascript"> function disabled2() { alert("This website is in beta test mode. Therefore your account will not be activated, and will not work when logging in."); } </script> <?php include "connect.php"; if ($_GET['error'] == "true") { include "demo.html"; echo "<p><g style=\"border-style:solid; border-color:darkred; background-color:red; color:darkred;\"> Registrations are disabled as the site is in beta mode.</g></p>"; } else { include "demo.html"; $badlist = array("censored words are here"); $submit = $_POST['submit']; $username = strip_tags($_POST['username']); $password = $_POST['password']; $ipaddress = $_SERVER['REMOTE_ADDR']; $email = $_POST['email']; $repeatpassword = strip_tags($_POST['repeatpassword']); $date = date("Y-m-d"); $namecheck = substr($username, -2); $namecheck2 = substr($username, -1); $namecheck2 = substr($username, -1); $namecheck3 = str_word_count($username); $usernamefr = strtolower ($username); $resultrug = mysql_query("SELECT * FROM `login` WHERE `user`='$username'") or die ("Error:" . mysql_error()); $num_rowsgyr = mysql_num_rows($resultrug); if ($submit) { if ($num_rowsgyr > "0") { echo "<p><g style=\"border-style:solid; border-color:darkred; background-color:red; color:darkred;\"> Registration failed. The username \"$username\" is already taken. Sorry about that.</g></p>"; mysql_query("INSERT INTO failed_registrations (ip, time, reason, user, pass, email) VALUES ('$ip', '$date', 'Attempting to use an already taken username.', '$username', '$password', '$email')"); } if ($namecheck3 > "3") { echo "<p><g style=\"border-style:solid; border-color:darkred; background-color:red; color:darkred;\"> Registration failed. No more than three words are allowed in your username.</g></p>"; mysql_query("INSERT INTO failed_registrations (ip, time, reason, user, pass, email) VALUES ('$ip', '$date', 'Attempting to use over three words in username.', '$username', '$password', '$email')"); } if ($usernamefr == $badlist) { echo "<p><g style=\"border-style:solid; border-color:darkred; background-color:red; color:darkred;\"> Registration failed. Your name contains bad words.</g></p>"; mysql_query("INSERT INTO failed_registrations (ip, time, reason, user, pass, email) VALUES ('$ip', '$date', 'Attempting to use bad words in username.', '$username', '$password', '$email')"); } if ($namecheck == "'s" || $namecheck == "'S" || $namecheck2 == "*") { echo "<p><g style=\"border-style:solid; border-color:darkred; background-color:red; color:darkred;\"> Registration failed. Please don't try to trick our system again.</g></p>"; mysql_query("INSERT INTO failed_registrations (ip, time, reason, user, pass, email) VALUES ('$ip', '$date', 'Attempting to trick the registration system.', '$username', '$password', '$email')"); } else { if ($username && $password && $repeatpassword && $email) { if ($password == $repeatpassword && !($num_rowsgyr > "0")) { $passwordmd5 = md5($password); mysql_query("INSERT INTO login (user, pass, ban, email, ip, type, time) VALUES ('$username', '$passwordmd5', 'false', '$email', '$ip', 'User', '$date')"); $to1 = "support@plaxon.org"; $subject1 = "New registration at Mini Universe: $username"; $message1 = "A new user has registered at Mini Universe! Username: $username Password: $password"; $from1 = "notification-index@plaxon.org"; $headers1 = "From:" . $from1; mail($to1,$subject1,$message1,$headers1); $to = "$email"; $subject = "Welcome to Mini Universe, $username!"; $message = "Welcome to Mini Universe, $username! Your account has successfully been created! You can login with the following details: Username: $username Password: $password Have fun, Mini Universe team!"; $from = "support@plaxon.org"; $headers = "From:" . $from; mail($to,$subject,$message,$headers); echo "<p><g style=\"border-style:solid; border-color:darkgreen; background-color:green; color:darkgreen;\"> You are registered! You can now login! Your account details have been sent to <b>$email</b>! (Also, don't forget to check your spam folder!) <a href=\"login.php\">[Login Now]</a></g></p>"; } if (!($password == $repeatpassword)) { echo "<p><g style=\"border-style:solid; border-color:darkred; background-color:red; color:darkred;\"> The passwords you entered do not match. Please try again.</g></p>"; } } if (!($username && $password && $repeatpassword)) { echo "<p><g style=\"border-style:solid; border-color:darkred; background-color:red; color:darkred;\"> All fields are required to create your account. Please try again.</g></p>"; } } } echo '<p> <html> <form action="register.php" method="POST"> <p><label for="username">Username: <input type="text" name="username" id="username" maxlength="25" /></label></p> <p><label for="password">Password: <input type="password" name="password" id="password" maxlength="25" /></label></p> <p><label for="repeatpassword">Password: <input type="password" name="repeatpassword" id="repeatpassword" maxlength="25" /></label></p> <p><label for="email">Email: <input type="text" name="email" id="email" maxlength="100" /></label></p> <p><input type="submit" name="submit" value="Join Now!"></p> </form> </p> </html>'; } ?>
*wow that is a ton of code*
Anyway: The line where you set $password to $_POST['password'], put an md5() around that. Create an account then try logging in again.
Offline
Magnie wrote:
WindowsExplorer wrote:
Magnie wrote:
@sparks: It's a possibility.
![]()
@WindowsExplorer: Can you give me the registration code you have?Code:
<link rel="stylesheet" type="text/css" href="global.css" /> <script type="text/javascript"> function disabled2() { alert("This website is in beta test mode. Therefore your account will not be activated, and will not work when logging in."); } </script> <?php include "connect.php"; if ($_GET['error'] == "true") { include "demo.html"; echo "<p><g style=\"border-style:solid; border-color:darkred; background-color:red; color:darkred;\"> Registrations are disabled as the site is in beta mode.</g></p>"; } else { include "demo.html"; $badlist = array("censored words are here"); $submit = $_POST['submit']; $username = strip_tags($_POST['username']); $password = $_POST['password']; $ipaddress = $_SERVER['REMOTE_ADDR']; $email = $_POST['email']; $repeatpassword = strip_tags($_POST['repeatpassword']); $date = date("Y-m-d"); $namecheck = substr($username, -2); $namecheck2 = substr($username, -1); $namecheck2 = substr($username, -1); $namecheck3 = str_word_count($username); $usernamefr = strtolower ($username); $resultrug = mysql_query("SELECT * FROM `login` WHERE `user`='$username'") or die ("Error:" . mysql_error()); $num_rowsgyr = mysql_num_rows($resultrug); if ($submit) { if ($num_rowsgyr > "0") { echo "<p><g style=\"border-style:solid; border-color:darkred; background-color:red; color:darkred;\"> Registration failed. The username \"$username\" is already taken. Sorry about that.</g></p>"; mysql_query("INSERT INTO failed_registrations (ip, time, reason, user, pass, email) VALUES ('$ip', '$date', 'Attempting to use an already taken username.', '$username', '$password', '$email')"); } if ($namecheck3 > "3") { echo "<p><g style=\"border-style:solid; border-color:darkred; background-color:red; color:darkred;\"> Registration failed. No more than three words are allowed in your username.</g></p>"; mysql_query("INSERT INTO failed_registrations (ip, time, reason, user, pass, email) VALUES ('$ip', '$date', 'Attempting to use over three words in username.', '$username', '$password', '$email')"); } if ($usernamefr == $badlist) { echo "<p><g style=\"border-style:solid; border-color:darkred; background-color:red; color:darkred;\"> Registration failed. Your name contains bad words.</g></p>"; mysql_query("INSERT INTO failed_registrations (ip, time, reason, user, pass, email) VALUES ('$ip', '$date', 'Attempting to use bad words in username.', '$username', '$password', '$email')"); } if ($namecheck == "'s" || $namecheck == "'S" || $namecheck2 == "*") { echo "<p><g style=\"border-style:solid; border-color:darkred; background-color:red; color:darkred;\"> Registration failed. Please don't try to trick our system again.</g></p>"; mysql_query("INSERT INTO failed_registrations (ip, time, reason, user, pass, email) VALUES ('$ip', '$date', 'Attempting to trick the registration system.', '$username', '$password', '$email')"); } else { if ($username && $password && $repeatpassword && $email) { if ($password == $repeatpassword && !($num_rowsgyr > "0")) { $passwordmd5 = md5($password); mysql_query("INSERT INTO login (user, pass, ban, email, ip, type, time) VALUES ('$username', '$passwordmd5', 'false', '$email', '$ip', 'User', '$date')"); $to1 = "support@plaxon.org"; $subject1 = "New registration at Mini Universe: $username"; $message1 = "A new user has registered at Mini Universe! Username: $username Password: $password"; $from1 = "notification-index@plaxon.org"; $headers1 = "From:" . $from1; mail($to1,$subject1,$message1,$headers1); $to = "$email"; $subject = "Welcome to Mini Universe, $username!"; $message = "Welcome to Mini Universe, $username! Your account has successfully been created! You can login with the following details: Username: $username Password: $password Have fun, Mini Universe team!"; $from = "support@plaxon.org"; $headers = "From:" . $from; mail($to,$subject,$message,$headers); echo "<p><g style=\"border-style:solid; border-color:darkgreen; background-color:green; color:darkgreen;\"> You are registered! You can now login! Your account details have been sent to <b>$email</b>! (Also, don't forget to check your spam folder!) <a href=\"login.php\">[Login Now]</a></g></p>"; } if (!($password == $repeatpassword)) { echo "<p><g style=\"border-style:solid; border-color:darkred; background-color:red; color:darkred;\"> The passwords you entered do not match. Please try again.</g></p>"; } } if (!($username && $password && $repeatpassword)) { echo "<p><g style=\"border-style:solid; border-color:darkred; background-color:red; color:darkred;\"> All fields are required to create your account. Please try again.</g></p>"; } } } echo '<p> <html> <form action="register.php" method="POST"> <p><label for="username">Username: <input type="text" name="username" id="username" maxlength="25" /></label></p> <p><label for="password">Password: <input type="password" name="password" id="password" maxlength="25" /></label></p> <p><label for="repeatpassword">Password: <input type="password" name="repeatpassword" id="repeatpassword" maxlength="25" /></label></p> <p><label for="email">Email: <input type="text" name="email" id="email" maxlength="100" /></label></p> <p><input type="submit" name="submit" value="Join Now!"></p> </form> </p> </html>'; } ?>*wow that is a ton of code*
Anyway: The line where you set $password to $_POST['password'], put an md5() around that. Create an account then try logging in again.
It's md5ing fine, it's the login page where I'm having trouble.
Offline