Jump to content

max_w1

Members
  • Posts

    122
  • Joined

  • Last visited

Everything posted by max_w1

  1. well now i have but does'nt work still. i think it is not necessary to have session_start(); on the first line because the ob_start(); will be gone to second line and the headers will stop working.. <?php session_start(); ob_start(); print "SESSION ID: ".session_id(); print "\nSession module: ".session_module_name(); print "\nSession save path: ".session_save_path(); $_SESSION['loggedin'] = 'testuser'; $_SESSION['time'] = time(); print "\nSession data: "; print_r($_SESSION); //////////////////////////////////////////////////////////////////////////////////////////// /**//**//**/require ("config.php");/**//**//**//**//**//**//**//**//**//**//**//**//**//**/// ///////////////////////////////////////////////////////////////////////////////////////////// if (isset ($_COOKIE['password']) || isset ($_COOKIE['rempassword'])) { echo("you are already logged in"); } else { // Variables that data come from the form $username = $_POST["username"]; $password = $_POST["password"]; $login = $_POST["login"]; $ipaddress = $REMOTE_ADDR; $remember = $_POST["remem"]; // Check if username and password where submitted if(isset($login)) { if(isset($login)) { if (!$username) { echo "Please enter username"; exit; } if (!$password) { echo "Please enter password"; exit; } $issuchusername = mysql_query("SELECT * FROM users WHERE username = '$username'"); $usernamelogin = mysql_num_rows($issuchusername); if ($usernamelogin == 1) { $issuchpassword = mysql_query("SELECT * FROM users WHERE username='$username' AND password='$password'"); $passwordlogin = mysql_num_rows($issuchpassword); if ($passwordlogin == 1) { if(isset($remember)) { if(isset($remember)){ setcookie('username', $username, time()+1209600); setcookie('password', base64_encode ($password), 0); setcookie('remember', $remember, 0); setcookie('ipaddress', $ipaddress, 0); } //remove the anti-hacking cookie setcookie ('tries', '', time()-60, '/', '', 0); $_SESSION['loggedin'] = $_POST['username']; $_SESSION['time'] = time(); header ('Location: /members.php'); exit; } else { session_start(); //remove the anti-hacking cookie setcookie ('tries', '', time()-60, '/', '', 0); $_SESSION['loggedin'] = $_POST['username']; $_SESSION['time'] = time(); header ('Location: members.php'); } } } else { echo "Incorrect username/password1"; header("Location: index.php?error=true"); exit; } } if(!$usernamelogin) { echo "incorrect username or password"; header("Location: index.php?error=true"); exit; } } } //=============================================== //script compleated on friday 14 december 6:35 pm //=============================================== // errors has to be sorted out in the next version //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\ //loginscpt tested in mozilla firefox and internet explorer while cookies are enabled|) //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++/ //popup blocker must be enabled. //++++++++++++++++++++++++++++++ //TATA BYEBYE SEEYOU . //++++++++++++++++++++++++++++++ ?>
  2. :(i did it.. now index.htm is index.php but its giving me the same problem.
  3. the entire login.php looks like this <?php ob_start(); print "SESSION ID: ".session_id(); print "\nSession module: ".session_module_name(); print "\nSession save path: ".session_save_path(); $_SESSION['loggedin'] = 'testuser'; $_SESSION['time'] = time(); print "\nSession data: "; print_r($_SESSION); //////////////////////////////////////////////////////////////////////////////////////////// /**//**//**/require ("config.php");/**//**//**//**//**//**//**//**//**//**//**//**//**//**/// ///////////////////////////////////////////////////////////////////////////////////////////// if (isset ($_COOKIE['password']) || isset ($_COOKIE['rempassword'])) { echo("you are already logged in"); } else { // Variables that data come from the form $username = $_POST["username"]; $password = $_POST["password"]; $login = $_POST["login"]; $ipaddress = $REMOTE_ADDR; $remember = $_POST["remem"]; // Check if username and password where submitted if(isset($login)) { if(isset($login)) { if (!$username) { echo "Please enter username"; exit; } if (!$password) { echo "Please enter password"; exit; } $issuchusername = mysql_query("SELECT * FROM users WHERE username = '$username'"); $usernamelogin = mysql_num_rows($issuchusername); if ($usernamelogin == 1) { $issuchpassword = mysql_query("SELECT * FROM users WHERE username='$username' AND password='$password'"); $passwordlogin = mysql_num_rows($issuchpassword); if ($passwordlogin == 1) { if(isset($remember)) { if(isset($remember)){ setcookie('username', $username, time()+1209600); setcookie('password', base64_encode ($password), 0); setcookie('remember', $remember, 0); setcookie('ipaddress', $ipaddress, 0); } //remove the anti-hacking cookie setcookie ('tries', '', time()-60, '/', '', 0); $_SESSION['loggedin'] = $_POST['username']; $_SESSION['time'] = time(); header ('Location: /members.php'); exit; } else { session_start(); //remove the anti-hacking cookie setcookie ('tries', '', time()-60, '/', '', 0); $_SESSION['loggedin'] = $_POST['username']; $_SESSION['time'] = time(); header ('Location: members.php'); } } } else { echo "Incorrect username/password1"; header("Location: index.php?error=true"); exit; } } if(!$usernamelogin) { echo "incorrect username or password"; header("Location: index.php?error=true"); exit; } } } ?>
  4. how am i suppose to find it? php.ini is a very long page...
  5. it's still not displaying the session in the members.php. i am using index.htm to submit data to login.php.
  6. yes login.php says: and members.php says: what does that mean?? i dont understand....
  7. i tried using those codes but nothing happens ... i am still not able to view session... what to do.. please help!!!
  8. i think there is a problem with my local server... i think it does not support sessions. thats why they are getting destroyed as soon as i leave the page. can i use cookies insted of using sessions??? because cookies are working perfectly?
  9. there is no white space the code looks like this: <?php ob_start(); session_start(); ///////////////////////////////////////////////////////////////////////////////////////////// /**//**//**/require ("config.php");/**//**//**//**//**//**//**//**//**//**//**//**//**//**/// ///////////////////////////////////////////////////////////////////////////////////////////// if (isset ($_COOKIE['password']) || isset ($_COOKIE['rempassword'])) { echo("you are already logged in"); } else {
  10. i tried moving it to top. and as i said before... i am able to display sessions from login.php page but unable to display it from members.php page.
  11. yes i did, i noticed one more thing!,, i am able to read session from login.php page but not able to read it from members.php page
  12. i did that buy it does not work. i think there is a problem in the code which sets session. one more thing... there is a index.html page which POSTs data to login.php and login.php sets the session and redirects us to members.php, so can members.php display session? ??? if yes please help me!! thankyou in advance
  13. hi, i have a login page which looks like this i dont have any problem with my login page but when it redirects to memebers.php i am unable to echo session. i am using the following code in my memebers.php page: i will be glad to receve any help!
  14. what would happen if we add too many fields in a single table?? ???
  15. you can also try using a DHTML pop-up for the AJAX image uploader... in this way you will not break the layout of your form...
  16. Sorry for that! but it didnt work!! can someone tell me what is users.id and fighters.id and how to create links
  17. try this AJAX uploader with Progress bar! http://extjs.com/learn/Extension:UploadForm
  18. i think you must try REGEXP '84%'
  19. Thankyou GingerRobot! that was very helpful, i solved my problem, and my website will be ready to launch after three days. thankyou once again... keepup the good work!
  20. thankyou GingerRobot, hope that will solve my problem. but what if i include all colums in a single table "users"? like: users username = the username of mr.xyz password = the passowrd of mr.xyz details = details of mr.xyz fighter1 = the first fighter mr.xyx has captured fighter2 = the secont one fighter3 = third "... fighter100 = till the last one attack1 = first attack attack2 = second "... attack50 = last one F1a1= Fighter Attack(the attack which has been thought to fighter) f1a2 = the second till f100a50 = last attack of the last fighter. will this be possible.?? or creating this many colums will slow down my website? because there would be more than 500 colums in a single table.
  21. hi! i am designing a website in php & mysql which is like a game. every thing was going file till now but now i am stuck and confused.. in this website members can capture around 100 fighters and teach them over 50 different attacks. i know the php part but don't know how the sql structure should be for this. any kind of idea or help will be appreciated EDIT: Changed subject to conform to forum rules.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.