Pavlos1316 Posted June 3, 2008 Share Posted June 3, 2008 hi How do i get to store data like username and email upon login, so when a member submits a form username is posted in mysql db among the other info of the form so I know who submited it and use the email to send him the result. thanks Link to comment https://forums.phpfreaks.com/topic/108486-store-data-upon-login-for-later-use/ Share on other sites More sharing options...
corbin Posted June 3, 2008 Share Posted June 3, 2008 We won't write code for you.... Try to make something, and we'll help you with problems. http://www.w3schools.com/PHP/php_post.asp http://www.w3schools.com/PHP/php_mysql_intro.asp Link to comment https://forums.phpfreaks.com/topic/108486-store-data-upon-login-for-later-use/#findComment-556249 Share on other sites More sharing options...
Pavlos1316 Posted June 3, 2008 Author Share Posted June 3, 2008 allready use session_regenerate_id(); $member=mysql_fetch_assoc($result); $_SESSION['SESS_ ID']=$member['ID']; //Write session to disc session_write_close(); header("location: member-index.php"); exit(); to know that user is authendicated.. how can i use that to have my info stored? Link to comment https://forums.phpfreaks.com/topic/108486-store-data-upon-login-for-later-use/#findComment-556254 Share on other sites More sharing options...
haku Posted June 3, 2008 Share Posted June 3, 2008 You have already stored your information as $_SESSION['SESS_ ID']. You can use this variable in any script, as long as you have called session_start() earlier in that script. Link to comment https://forums.phpfreaks.com/topic/108486-store-data-upon-login-for-later-use/#findComment-556257 Share on other sites More sharing options...
Pavlos1316 Posted June 3, 2008 Author Share Posted June 3, 2008 ok.. i use the below to sent email after registration. $subject="$yoursite Registration"; $message="Dear $Name, Welcome $Username Your are now a registered member of $yoursite For any information you need or any suggestion to make just contact us at $youremail Thank you, $webmaster"; mail($E_mail, $subject, $message, "From: $yoursite<$youremail>\nX-Mailer:PHP/" .phpversion()); How do i combine this with $_SESSION['SESS_ ID'] to send user an email when submiting the form? Link to comment https://forums.phpfreaks.com/topic/108486-store-data-upon-login-for-later-use/#findComment-556264 Share on other sites More sharing options...
Pavlos1316 Posted June 3, 2008 Author Share Posted June 3, 2008 I use this on the top of my page where I have my form //Start session session_start(); //Check whether the session variable //SESS_MEMBER_ID is present or not if(!isset($_SESSION['SESS_ID']) || (trim($_SESSION['SESS_ID'])=='')){ header("location: http://www.sonophoenix.com/"); exit(); } How do i set the email function now to send email to the current user? Link to comment https://forums.phpfreaks.com/topic/108486-store-data-upon-login-for-later-use/#findComment-556267 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.