Hey!
Hello everybody!
My name is Jarno. I’m from the Netherlands. I’m 12 years old and i’m pretty good with computers
(for my age) but i’m above all curious! I know HTML and a bit of CSS. I have some experience with SQL Injection.
(I used Havij for the injection) And now i’m trying to make a login page with PHP and HTML. I guess this is everything
about me.
Greetings,
Jarno
[justify]The largest computer problem sits between the keyboard and the back of the chair.
[/justify]
Hi @Jarno, welcome to the dark side (I mean, forum) of this decent website.
[justify]The largest computer problem sits between the keyboard and the back of the chair.
[/justify]
welcome around, when ever you need help you can ask, and im sure someone will know how to help you.
I Hate Signatures.
10 years ago
0
Welcome to Hack This!
12 years old and a great future with computers I hope!
10 years ago
0
Hi there. That’s awesome that you’re only 12 years of age and have a good amount of knowledge concerning computers. I didn’t start learning stuff until I was 15. I hope you have lots of fun here. :)
crypticvoid, i started learning at the age of 22 (self learning), even though i toke some things in college, never used them nor thought about using what i have learnd….
I Hate Signatures.
10 years ago
0
I started self learning at 15, I’ve learned more from my computer than I have at school, lol.
@ADIGA: So we are walking the same path, dude. My major in the college was economics. Then I realized something and now I am here talking about hacking stuff. :p
lol, i was I.T. still only attended like 5% of lectures… i was such a pain in the ass that all the lecturers told me not to attend.
i was more than pleased to do what i was asked to do :)
I Hate Signatures.
10 years ago
0
I’ll bet you were, ADIGA.
i still remeber that in the VB lecture i was the only one to do “programing exam” for the final, the exam was supposed to be so, but few days earlier many students asked if it can be changed to be on paper, so let it be the lecturer said, so i just stodup and told him that i would not do it on paper and i would rather fail.
ended up doing it alone with no one to cheat from, did not know what to answer, but the exam ended like 10 min after it started with the lecturer saying “would 95% be good if you leave now not finishing the exam?” thinking i would answer everything and he did not want to waste his time ….
just lol.
and for fun a couple more stories from my college days, i was staying up late one night and fell a sleep at like 7 AM, got a call from a lecturer at 9 asking why am i not in the multimedia final exam, my answer was “im too sleepy, this is not the right time to call”… i failed :(.
but the funniest one was with the HTML/javascript course, i was working night shift at an internet cafe, finished my shift and remembered that i should do the final exam, was already 1 hour late when i got to college, knocked on the door to enter and do the exam, the lecturer asked me where i have been and i answered that i forgot i had a final exam, so he shooed me off saying he will fail me, went and got me a cup of coffee, my mobile rings, the lecturer asked me to come take the exam… and as always being an ass my answer was, ill be right up, just wait for me to finish my coffee … i passed after all.
I Hate Signatures.
hey :) welcome to the site and here is a simple login page without CSS :)
<?php echo '<h3>Login</h3><br />'; //first, check if the user is already signed in. If that is the case, there is no need to display this page if(isset($_SESSION['signed_in']) && $_SESSION['signed_in'] == true) { echo 'you are already logged in'; } else { if($_SERVER['REQUEST_METHOD'] != 'POST') { echo '<form method="POST" action="' . htmlspecialchars() . '"> <label for="username">Username : </label><center><input type="text" name="username" /></center><br /> <label for="pass">Password : </label><center><input type="password" name="pass"></center><br /> <input type="submit" name="submit" value="Log in" /> </form>'; } else { /* so, the form has been posted, we'll process the data in three steps: 1. Check the data 2. Let the user refill the wrong fields (if necessary) 3. Varify if the data is correct and return the correct response */ $errors = array(); /* declare the array for later use */ if(!isset($_POST['username'])) { $errors[] = 'The username field must not be empty.'; } if(!isset($_POST['pass'])) { $errors[] = 'The password field must not be empty.'; } if(!empty($errors)) /*check for an empty array, if there are errors, they're in this array (note the ! operator)*/ { echo 'Please Correct the following errors :<br /><br />'; echo '<ul>'; foreach($errors as $key => $value) /* walk through the array so all the errors get displayed */ { echo '<li>' . $value . '</li>'; /* this generates a nice error list */ } echo '</ul>'; } else { //the form has been posted without errors, so save it //notice the use of mysql_real_escape_string, keep everything safe! //also notice the sha1 function which hashes the password $sql = "SELECT user_id, user_name, FROM users WHERE user_name = '" . mysql_real_escape_string($_POST['username']) . "' AND user_pass = '" . md5($_POST['pass']) . "'"; $result = mysql_query($sql); if(!$result) { //something went wrong, display the error echo 'Something went wrong while signing in. Please try again later.'; //echo mysql_error(); //debugging purposes, uncomment when needed } else { //the query was successfully executed, there are 2 possibilities //1. the query returned data, the user can be signed in //2. the query returned an empty result set, the credentials were wrong if(mysql_num_rows($result) == 0) { echo 'Your username or password are incorrect , please make sure to write the correct information'; } else { //set the $_SESSION['signed_in'] variable to TRUE $_SESSION['signed_in'] = true; //we also put the user_id and user_name values in the $_SESSION, so we can use it at various pages while($row = mysql_fetch_assoc($result)) { $_SESSION['user_id'] = $row['user_id']; $_SESSION['user_name'] = $row['user_name']; } echo 'Logged in successfully; } } } } } ?>
Sorry if their is any wrong i just pasted it from my notepad :P
If you make people think they’re thinking, they’ll love you. but if you really make them think, they’ll hate you.
~ Harlan Ellison
I see that most of you are ‘Self-learning’. I’m doing that aswel, but my school used to give programming lessons to everyone who wanted (Java and later some Gamemaker stuff), but there waren’t a lot of people who choosed it, so they don’t give it anymore :(
So now i started learning from YouTube and other site’s :).
[justify]The largest computer problem sits between the keyboard and the back of the chair.
[/justify]
10 years ago | edited 10 years ago
0
[quote=Jarno]So now i started learning from YouTube and other site’s [/quote]
It’s okay to watch videos, some of which are educational, but in order to really learn, you must contemplate and understand whatever it is you want to learn, and I think it’s better to read than to watch videos. Simply watching videos isn’t always enough. :)
Have you been on w3schools.com yet? :D
I know xD. But if you find the right video’s, then you can still learn alot of it. (It’s a pain in the ass that most video’s are just like: bla bla bla… you see? and than again bla bla bla… and then the video ends., and then i’m like: Dafuck? What did he say?)
[justify]The largest computer problem sits between the keyboard and the back of the chair.
[/justify]
10 years ago
0
Cool. XD
I know what you mean man, a lot of times I have wasted my own time watching videos made by total idiots. :/
JAYSSJ11- “I’d rather be hated for who I am, than loved for who I am not.”
Yup, i once watched a video of someone that said that he was a badass hacker, but 20% of the video he was just trying to open the source code XD
[justify]The largest computer problem sits between the keyboard and the back of the chair.
[/justify]
10 years ago
0
I don’t even really remember the dumb videos that I watched, since it was quite some time ago. Anyway, I’m more accustomed to reading now than watching videos, at least when I’m reading I can go at my own pace. :D
it is good u have started it early . when i was 13 year old , i remember , i took the book on vb from library . and read it , it was so fun that next day in computer lab i made a calculator with it . it was so fun . my school only gave classes of HTML and c++ to senior students , while students at my age was taught how to use ms word , acces and shit . i was like WTF .
then i got into studeis and left the book and forgot what i learned . afte 2 years i started again .
JAYSSJ11- “I’d rather be hated for who I am, than loved for who I am not.”
[justify]The largest computer problem sits between the keyboard and the back of the chair.
[/justify]
10 years ago
0
After year two at school was complete, we chose our own classes, one of which was Computing & I.T for myself, back then I wasn’t serious about hacking or anything, I remember doing VB and HTML. I didn’t do anymore programming until 5th year, but this time I taught myself to program, I didn’t choose Computing as one of my 5th year subjects… :/
JAYSSJ11- “I’d rather be hated for who I am, than loved for who I am not.”
I’ve found an app, Hacking Tutorials (With an skull logo) and it helps me alot! It also explains evertthing instead just posting the code :D
[justify]The largest computer problem sits between the keyboard and the back of the chair.
[/justify]
[justify]The largest computer problem sits between the keyboard and the back of the chair.
[/justify]
[justify]The largest computer problem sits between the keyboard and the back of the chair.
[/justify]
JAYSSJ11- “I’d rather be hated for who I am, than loved for who I am not.”
[justify]The largest computer problem sits between the keyboard and the back of the chair.
[/justify]
@Jarno: If you want to program an application (such as Windows apps), C++ is your way.
10 years ago | edited 10 years ago
0
This is a simple login page using HTML & PHP/MySQL:
HTML form:
Username:Password:
PHP/MySQL code:
<?php
// define variables
$con = mysqli_connect(‘host’,‘username’,‘password’,‘database’); // connect to database
$user = $POST[‘user’]; // username that the user posted is now assigned to the user variable
$pass = $POST[‘pass’]; // password that the user posted is now assigned to the pass variable
$check = mysqli_query($con,“SELECT user,pass FROM Members WHERE user=‘$user’ AND pass=‘$pass’”); // check the database where the username AND password match the user input
$count = mysqli_num_rows($check); // check the number of matching rows
if ($count == 1)
// if there is a result then store the username in a session and head to the members page
{
session_start();
$_SESSION[‘user’] = $user;
header(‘Location: members.php’);
}
else
// go to the login_unsuccessful page
{
header(‘Location: login_unsuccessful.php’);
}
?>
Logout.php:
<?php
session_start();
session_destroy();
header(‘Location: index.php’);
?>
That was just off the top of my head, and it appears that the code within the brackets [] aren’t showing, but you can look at this link: http://php.about.com/od/finishedphp1/ss/php_login_code.htm :D
I see. I had a try with a login page myself, (with phpmyadmin) but the coding saves wouldn’t connect with the database. I’ve tried it more than 5 times, but now I’ve got rid of the database and now i’m going to try some C/C++ programming.
Good tutorials are welcome!
[justify]The largest computer problem sits between the keyboard and the back of the chair.
[/justify]
10 years ago | edited 10 years ago
0
If you have the correct values, the PHP SHOULD connect you to your database. Anyhow, better luck next time. :) And best of luck with C/C++ :D
And remember www.w3schools.com is an awesome place to learn web design.
[justify]The largest computer problem sits between the keyboard and the back of the chair.
[/justify]
10 years ago
0
Ok, cool. B)
[justify]The largest computer problem sits between the keyboard and the back of the chair.
[/justify]
10 years ago | edited 10 years ago
0
Awesome! :) I don’t actually use C often myself, I’m more accustomed to C++ even though they are almost the exact same.
@Jarno: Good job. Keep improving further. If you have any problem when developing it, feel free to ask. :p
Btw, you should close this thread and create another one because it is getting too long.