Register and Login (Email Activation) and User profile
Register and Login (Email Activation) and User profile
How do we combine the 2 scripts together?
What modifications are needed for this 2 to work together?
I added the code from the profile user.inc.php to the user.inc.php from Login/Register file, made the modifications to connect to the same database, i added the tables in the database... i registered a user activated it and when i go to profile.php page, i get this result:"That user does not exist. "
What did i do wrong?
Best regards and any help will be appreciated.
What modifications are needed for this 2 to work together?
I added the code from the profile user.inc.php to the user.inc.php from Login/Register file, made the modifications to connect to the same database, i added the tables in the database... i registered a user activated it and when i go to profile.php page, i get this result:"That user does not exist. "
What did i do wrong?
Best regards and any help will be appreciated.
Re: Register and Login (Email Activation) and User profile
This kind of question is not going to get you many replies, instead of asking how to combine two tutorials, have a go yourself then post any problems you have along with the code you tried to use.
Re: Register and Login (Email Activation) and User profile
the thing is that the user_list.php does not get my user_id...
<div> <?php foreach (fetch_users() as $user){ ?> <p> <a href="profile.php?uid=<?php echo $user['id']; ?>"><?php echo $user['username']; ?></a> </p> <?php } ?> </div>What is the problem???
Re: Register and Login (Email Activation) and User profile
OK...fixed for now
BTW...is there any way you can make a tutorial on how to add user avatar or profile picture?
BTW...is there any way you can make a tutorial on how to add user avatar or profile picture?
Re: Register and Login (Email Activation) and User profile
What was the problem ?kalipsso wrote:OK...fixed for now
there is a suggestions section, if you have a tutorial suggestion, post it therekalipsso wrote:BTW...is there any way you can make a tutorial on how to add user avatar or profile picture?
Re: Register and Login (Email Activation) and User profile
the problem was that i save the file without adding the echo fromjacek wrote:What was the problem ?kalipsso wrote:OK...fixed for now
there is a suggestions section, if you have a tutorial suggestion, post it therekalipsso wrote:BTW...is there any way you can make a tutorial on how to add user avatar or profile picture?
<?php echo $user['id']; ?>">
Re: Register and Login (Email Activation) and User profile
i am getting this error on edit_profile.php:
also...what do i need to put to replace this code:
Thanks in advance
i have removed the session_start from init.inc.php and the error disappeared.Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at D:\xampp\htdocs\avatar\profiles\edit_profile.php:1) in D:\xampp\htdocs\avatar\profiles\core\init.inc.php on line 2
also...what do i need to put to replace this code:
$_SESSION['uid'] = 1;to reflect the logged in ?
Thanks in advance
Re: Register and Login (Email Activation) and User profile
Removing session_start() is not the correct way to fix that, as it is needed for the session to work. The problem is that the session_start() function needs to send a cookie which has to be done via a header, and headers cannot be sent after output from the script has begun. The correct fix would be to remove any output from the script before the session_start line.
And I don't really know what you mean by the other thing
And I don't really know what you mean by the other thing
Re: Register and Login (Email Activation) and User profile
$_SESSION['uid'] = 1; means that the user with id 1 is logged in.jacek wrote:Removing session_start() is not the correct way to fix that, as it is needed for the session to work. The problem is that the session_start() function needs to send a cookie which has to be done via a header, and headers cannot be sent after output from the script has begun. The correct fix would be to remove any output from the script before the session_start line.
And I don't really know what you mean by the other thing
As i told you, i use it with login - register tutorial script...How do i make it so, that when the user login to be able to edit his profile?
So i need to change there something...
If you wold-of continue with the register-login tutorial to make the user profile page, what was the code you put there in init.inc.php?
TKS.
Re: Register and Login (Email Activation) and User profile
You can get the users id from the database and store it in the session when they login ...
Re: Register and Login (Email Activation) and User profile
Something is not complete in register/log-in script.
Because when a user is logged in, it still shows the log-in form..
What does it need to be added so when a user is logged in to show the log-out button(link) if he visit the log-in page again after he logs in?
Regards.
Because when a user is logged in, it still shows the log-in form..
What does it need to be added so when a user is logged in to show the log-out button(link) if he visit the log-in page again after he logs in?
Regards.
Re: Register and Login (Email Activation) and User profile
You know how to check to see if the user is logged in ? you need to use that.
Re: Register and Login (Email Activation) and User profile
Yeah...i was expecting this answer..
You don't want to give any tips... lol
You don't want to give any tips... lol
Re: Register and Login (Email Activation) and User profile
I'm sorry what?kalipsso wrote: You don't want to give any tips... lol
Sorry you're right, that's not a tip, he's actually telling you what you have to do.....You know how to check to see if the user is logged in ? you need to use that.
Re: Register and Login (Email Activation) and User profile
Since I get the feeling you're not gonna do this yourself, I will provide you with one really easy function that checks if the user is online or not.
function is_logged_in(){ if(empty($_SESSION['username'])){ return false; }else{ return true; } }
if(is_logged_in === false){Show login form}else{don't show login form}
Re: Register and Login (Email Activation) and User profile
Thanks...i already tried that but does not work...it seems like the user is not logged out when i click the log out button...and is not showing the log-in form when i add that code...Temor wrote:Since I get the feeling you're not gonna do this yourself, I will provide you with one really easy function that checks if the user is online or not.
function is_logged_in(){ if(empty($_SESSION['username'])){ return false; }else{ return true; } }if(is_logged_in === false){Show login form}else{don't show login form}
Re: Register and Login (Email Activation) and User profile
That's probably because you're not setting the $_SESSION['username'] variable. You're setting the $_SESSION['uid'] variable.kalipsso wrote:Thanks...i already tried that but does not work...it seems like the user is not logged out when i click the log out button...and is not showing the log-in form when i add that code...Temor wrote:Since I get the feeling you're not gonna do this yourself, I will provide you with one really easy function that checks if the user is online or not.
function is_logged_in(){ if(empty($_SESSION['username'])){ return false; }else{ return true; } }if(is_logged_in === false){Show login form}else{don't show login form}