Page 1 of 1

Two in one

Posted: Sat Jul 16, 2011 11:00 am
by gosponTarik
Hello everyone,

I complete User Profile (with avatar) and System Registration (with cookies and email validation) tutorials. Now I was wondering how can I make one just one system, so users can register, get email validation code, connect to their profile?

Hope you'll understand what a wrote up there :)

Re: Two in one

Posted: Sat Jul 16, 2011 11:31 am
by jacek
Well the idea is that you can use the stuff from those tutorials to make one completely new system that would contain all of the things.

So I guess just have a go, and see where you get stuck.

Re: Two in one

Posted: Sat Jul 16, 2011 11:36 am
by gosponTarik
Curenty I'am working on registration. Hope there wont be problems 8-)

Re: Two in one

Posted: Sat Jul 16, 2011 12:03 pm
by gosponTarik
OK, now I'm stuck, i just add some new registratio fields, write them to user.ini.php file and when I fill form a got totaly wrong iformations in my db. Only Username and email are on right place, all other is mixed.

[syntax=php]mysql_query("INSERT INTO `users` (`user_username`, `user_password`, `user_email`, `user_firstname`, `user_lastname`, `user_location`) VALUES ('{$user}', '{$pass}', '{$email}', '{$firstname}', '{$lastname}', '{$location}')");[/syntax] I test this in phpmyadmin and show no errors.

This is form in register.php

[syntax=xhtml]<form action="" method="post">
<p>
<label for="username">Username:</label>
<input type="text" name="username" id="username" value="<?php if (isset($_POST['username'])) echo htmlentities($_POST['username']); ?>" />
</p>
<p>
<label for="email">Email:</label>
<input type="text" name="email" id="email" value="<?php if (isset($_POST['email'])) echo htmlentities($_POST['email']); ?>" />
</p>
<p>
<label for="firstname">Firstname:</label>
<input type="text" name="firstname" id="firstname" value="<?php if (isset($_POST['firstname'])) echo htmlentities($_POST['firstname']); ?>" />
</p>
<p>
<label for="lastname">Lastname:</label>
<input type="text" name="lastname" id="lastname" value="<?php if (isset($_POST['lastname'])) echo htmlentities($_POST['lastname']); ?>" />
</p>
<p>
<label for="email">Location:</label>
<input type="text" name="location" id="location" value= "<?php if (isset($_POST['location'])) echo htmlentities($_POST['location']); ?>" />
</p>
<p>
<label for="password">Password:</label>
<input type="password" name="password" id="password" />
</p>
<p>
<label for="repeat_password">Repeat Password:</label>
<input type="password" name="repeat_password" id="repeat_password" />
</p>
<p>
<input type="submit" value="register" />
</p>
</form>[/syntax]

Can someone help me with this one?

[b]EDIT: And it never write something to the Firstname, this might be biggest problem.[/]

FIXED

Re: Two in one

Posted: Sun Jul 17, 2011 2:25 pm
by kalipsso
i already did that.. :)

Re: Two in one

Posted: Sun Jul 17, 2011 3:07 pm
by Linkjuice57
Care to explain how you fixed it? I'm curious :D