shedokan Posted November 19, 2007 Share Posted November 19, 2007 Hi, the script is abot 6 short pages so I couldn't give the script here but I attached a zip file including all the 6 files, please help me It's important. thanks in advance. [attachment deleted by admin] Quote Link to comment Share on other sites More sharing options...
Wuhtzu Posted November 19, 2007 Share Posted November 19, 2007 I don't think anyone will look through that much code without knowing what they are looking for and especially not when they have to download a and unzip a file.. What seems to be the problem with your script? Quote Link to comment Share on other sites More sharing options...
shedokan Posted November 19, 2007 Author Share Posted November 19, 2007 the problem: when I login it doesn't make me logged on and doesn't add any cookies. and I think you should look at the files: process session Quote Link to comment Share on other sites More sharing options...
snk Posted November 19, 2007 Share Posted November 19, 2007 if you use session u dont need cookies. try to be more specific.. the truth is that nobody looks in files, sorry for any disappointment or discourage. Quote Link to comment Share on other sites More sharing options...
shedokan Posted November 19, 2007 Author Share Posted November 19, 2007 but I want the user to be remebered. Quote Link to comment Share on other sites More sharing options...
cooldude832 Posted November 19, 2007 Share Posted November 19, 2007 you use cookies to initialize the sessions. basically on login you define the cookie and session, and then for in site use you use the session only as its 100x easier. then on a revisit before making them login run a check if the cookie is there if it is initalize the session Quote Link to comment Share on other sites More sharing options...
shedokan Posted November 20, 2007 Author Share Posted November 20, 2007 and how does that help me excactly? Quote Link to comment Share on other sites More sharing options...
cooldude832 Posted November 20, 2007 Share Posted November 20, 2007 well i can't help you if you are 100% clueless on how your scripts work, and you ain't paying me to read it so i guess you won't get helped Quote Link to comment Share on other sites More sharing options...
teng84 Posted November 20, 2007 Share Posted November 20, 2007 yes better if you will explain it clearly and not just giving codes and waiting for the edited and running codes. what i see is that you give your codes and let all the jobs to who ever will help you .. the best way that you can do do is chop line by line of the codes that you think causes some error.. if you will just post all your codes and expect for decent answers or solution better to post it in freelance section Quote Link to comment Share on other sites More sharing options...
shedokan Posted November 20, 2007 Author Share Posted November 20, 2007 ok ok... here are the remaining places tat I think doing the problems: function procLogin(){ global $session, $form; /* Login attempt */ $retval = $session->login($_POST['user'], $_POST['pass'], isset($_POST['remember'])); /* Login successful */ if($retval){ header("Location: ".$session->referrer); } /* Login failed */ else{ $_SESSION['value_array'] = $_POST; $_SESSION['error_array'] = $form->getErrorArray(); header("Location: ".$session->referrer); } } function login($subuser, $subpass, $subremember){ global $check, $form; //The check and form object /* Username error checking */ $field = "user"; //Use field name for username if(!$subuser || strlen($subuser = trim($subuser)) == 0){ $form->setError($field, "* Username not entered"); } else{ /* Check if username is not alphanumeric */ if(!eregi("^([0-9a-z])*$", $subuser)){ $form->setError($field, "* Username not alphanumeric"); } } /* Password error checking */ $field = "pass"; //Use field name for password if(!$subpass){ $form->setError($field, "* Password not entered"); } /* Return if form errors exist */ if($form->num_errors > 0){ return false; } $result = $check->userPass(md5($subuser), md5($subpass)); /* Check error codes */ if($result == 1){ $field = "user"; $form->setError($field, "* Username not found"); } else if($result == 2){ $field = "pass"; $form->setError($field, "* Invalid password"); } /* Return if form errors exist */ if($form->num_errors > 0){ return false; } /* Username and password correct, register session variables */ $this->userinfo = $check->get("user"); $this->username = $_SESSION['username'] = $this->userinfo; /** * This is the cool part: the user has requested that we remember that * he's logged in, so we set two cookies. One to hold his username, * and one to hold his random value userid. It expires by the time * specified in constants.php. Now, next time he comes to our site, we will * log him in automatically, but only if he didn't log out before he left. */ if($subremember){ setcookie("cookname", $this->username, time()+COOKIE_EXPIRE, COOKIE_PATH); } /* Login completed successfully */ return true; } is that better? and just for you to know I'm just a 14 year old kid hehe... Quote Link to comment Share on other sites More sharing options...
teng84 Posted November 20, 2007 Share Posted November 20, 2007 first ... do you know how to use session and cookies? do you know how to implement your classes? Quote Link to comment Share on other sites More sharing options...
shedokan Posted November 20, 2007 Author Share Posted November 20, 2007 cookies yes and sessions just learning... Quote Link to comment Share on other sites More sharing options...
teng84 Posted November 20, 2007 Share Posted November 20, 2007 try this sample i made page1.php <?php session_start(); $_SESSION['name']= 'teng'; echo '<a href="page2.php">click here</a>'; ?> page2.php <?php session_start(); echo $_SESSION['name'];// will echo teng ?> simple but that what session ... or see this link http://www.w3schools.com/php/php_sessions.asp Quote Link to comment Share on other sites More sharing options...
shedokan Posted November 20, 2007 Author Share Posted November 20, 2007 ok now I know sessions thanks!! Quote Link to comment Share on other sites More sharing options...
teng84 Posted November 20, 2007 Share Posted November 20, 2007 then i guess try to fix your script using the sample i gave you the get back if you have still prob.. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.