Search found 9 matches

by nerolight
Mon Aug 26, 2013 11:19 pm
Forum: Tutorials
Topic: PHP Tutorial: Register and Login (Split)
Replies: 17
Views: 5030

Re: PHP Tutorial: Register and Login (Split)

Temor wrote:Well, varchar is enough usually.
If you're just going to insert a few letters, then varchar is enough.
If you're inserting numbers, then use int.

And that's all you need to set, apart from the max length. The rest is default.



Alright perfect, thank you!
by nerolight
Mon Aug 26, 2013 10:56 pm
Forum: Tutorials
Topic: PHP Tutorial: Register and Login (Split)
Replies: 17
Views: 5030

Re: PHP Tutorial: Register and Login (Split)

an option is just like any other form input, and is treated the exact same way as you would do with an "Input type=text". What you need to do depends on what you're going to to with the options. If you're required to be in a certain state for your offer to apply, you would have to check i...
by nerolight
Sun Aug 25, 2013 1:42 am
Forum: Tutorials
Topic: PHP Tutorial: Register and Login (Split)
Replies: 17
Views: 5030

Re: PHP Tutorial: Register and Login (Split)

Finally got it to work! Thank you guys for all your help The functions were fine. It was the if statements. I re-wrote them, and here they are in case anyone else ever needs them: [syntax=php]<?php include("core/init.inc.php"); $errors= array(); if (isset($_POST['username'], $_POST['email'...
by nerolight
Sun Aug 25, 2013 12:43 am
Forum: Tutorials
Topic: PHP Tutorial: Register and Login (Split)
Replies: 17
Views: 5030

Re: PHP Tutorial: Register and Login (Split)

ScTech wrote:In the add_user function query, is user-password actually supposed to be user_password?

user_password is the title for the password input in my database, so I suppose yes, it should be user_password?
by nerolight
Sun Aug 25, 2013 12:05 am
Forum: Tutorials
Topic: PHP Tutorial: Register and Login (Split)
Replies: 17
Views: 5030

Re: PHP Tutorial: Register and Login (Split)

I did what you suggested. Still no change. I'm being redirected to contact.php but the inputs are not being stored in the database. I'm gonna try and rewrite the functions, maybe that will work.
by nerolight
Sat Aug 24, 2013 9:31 pm
Forum: Tutorials
Topic: PHP Tutorial: Register and Login (Split)
Replies: 17
Views: 5030

Re: PHP Tutorial: Register and Login (Split)

Thanks for the help so far guys, I really appreciate it. I fixed the name but still no use. If you notice in this code:[syntax=php]<?php include"init.inc.php"; $user= $_POST['username']; $email= $_POST['email']; $pass= md5($_POST['password']); //checks if the given username exists in the t...
by nerolight
Sat Aug 24, 2013 7:59 pm
Forum: Tutorials
Topic: PHP Tutorial: Register and Login (Split)
Replies: 17
Views: 5030

Re: PHP Tutorial: Register and Login (Split)

oops no, I meant index.php. So I know its being parsed. I changed the code a bit to look like this: [syntax=php]<?php include"init.inc.php"; $user= $_POST['username']; $email= $_POST['email']; $pass= md5($_POST['password']); //checks if the given username exists in the tale// function user...
by nerolight
Sat Aug 24, 2013 4:04 am
Forum: Tutorials
Topic: PHP Tutorial: Register and Login (Split)
Replies: 17
Views: 5030

Re: PHP Tutorial: Register and Login (Split)

This is my init.inc file: [syntax=php]<?php session_start(); $exceptions= array('index','contactus'); $page = explode('/', $_SERVER['SCRIPT_NAME']); $page = end($page); $page = substr($page, 0, -4); if (in_array($page, $exceptions) === false){ if (isset($_SESSION['username']) === false){ header('Loc...
by nerolight
Sat Aug 24, 2013 12:23 am
Forum: Tutorials
Topic: PHP Tutorial: Register and Login (Split)
Replies: 17
Views: 5030

PHP Tutorial: Register and Login (Split)

[syntax=php]<?php //checks if the given username exists in the tale// function user_exists($user){ $user= mysql_real_escape_string($user); $total= mysql_query("SELECT COUNT(`user_id`) FROM `users` WHERE `user_name` = '{$user}' "); return (mysql_result($total, 0) == '1') ? true : false; } /...