Jump to content

icon

Members
  • Posts

    10
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

icon's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. dont worry i have sorted, thanks again
  2. [!--quoteo(post=364619:date=Apr 13 2006, 05:56 PM:name=michaellunsford)--][div class=\'quotetop\']QUOTE(michaellunsford @ Apr 13 2006, 05:56 PM) [snapback]364619[/snapback][/div][div class=\'quotemain\'][!--quotec--] Just tested with NULL and it works... NULL is a value, so don't enclose it in quotes or anything. Just like this: setcookie("time_visited", date('m/D/Y'), NULL, "/", ".domain.net", 0); if it still gives you trouble, everything after name is optional. Worst case scenario, just put the name and the value -- leave the rest off. setcookie("time_visited", date('m/D/Y')); [/quote] thanks mate it work great now, oh just one more thing how would i dispaly the username which i have logged in has cheers
  3. [!--quoteo(post=364611:date=Apr 13 2006, 05:35 PM:name=michaellunsford)--][div class=\'quotetop\']QUOTE(michaellunsford @ Apr 13 2006, 05:35 PM) [snapback]364611[/snapback][/div][div class=\'quotemain\'][!--quotec--] I can't remember exactly, so you'll have to experiment. I think it's two double quotes with nothing in the middle. If that doesn't work, try the word NULL -- but I don't think NULL works. so: setcookie("time_visited", date('m/D/Y'), "", "/", ".domain.net", 0); or (not likely) setcookie("time_visited", date('m/D/Y'), NULL, "/", ".domain.net", 0); [/quote] now it come up with the other problem Warning: setcookie() expects parameter 3 to be long :@
  4. [!--quoteo(post=364603:date=Apr 13 2006, 05:22 PM:name=michaellunsford)--][div class=\'quotetop\']QUOTE(michaellunsford @ Apr 13 2006, 05:22 PM) [snapback]364603[/snapback][/div][div class=\'quotemain\'][!--quotec--] you are setting the expiration to the current time. your browser will delete it the moment it's set. try adding the +14400 after time() -- that should work. [/quote] thanks , but what i want to do is have the cookie deleted when the browser closes thanks for all ya help
  5. [!--quoteo(post=364570:date=Apr 13 2006, 03:55 PM:name=hadoob024)--][div class=\'quotetop\']QUOTE(hadoob024 @ Apr 13 2006, 03:55 PM) [snapback]364570[/snapback][/div][div class=\'quotemain\'][!--quotec--] Here's the function declaration for setcookie(): [code] bool setcookie ( string name [, string value [, int expire [, string path [, string domain [, bool secure]]]]] ) [/code] Setcookie() expects an integer for the third parameter, but I think you called it using a string value as the third parameter. [/quote] thanks it ok now but now it aint setting the cookie this is what i enter to solve the other problem setcookie("cookie", $username, time(), "/", ".domain.net", 0); but i looked in the cookie folder of the broswer and there aint a cookie there for my domain but if i run the test.php with this bit of code it sets the cookie ------test.php---------- <? setcookie("time_visited", date('m/D/Y'), time()+14400, "/", ".domain.net", 0); ?> any ideas thanks :@
  6. hi i have this code: <? $user="username"; $pass="password"; $database="db"; $username=$_POST['username']; $password=$_POST['password']; $first=$_POST['first']; $last=$_POST['last']; $occupation=$_POST['occupation']; $location=$_POST['location']; $email=$_POST['email']; $username = $_REQUEST['username'] ; $password = $_REQUEST['password'] ; if (empty($username) || empty($password)) { include "validate_error.php"; } else { mysql_connect(localhost,$user,$pass); @mysql_select_db($database) or die( "Unable to select database"); $query = "SELECT id FROM user WHERE username='$username' AND password='$password'"; $result = mysql_query($query) or die ("Query failed at login verifcation."); $worked = mysql_num_rows($result); If ($worked == "") { include "error_username.html"; } else { setcookie("cookie", $username, ".domain.net", 0); header('Location: [a href=\"http://www.domain.net/web/00,,111.111.html');\" target=\"_blank\"]http://www.domain.net/web/00,,111.111.html');[/a] } } ?> but it say Warning: setcookie() expects parameter 3 to be long why is this happening thanks
  7. [!--quoteo(post=364247:date=Apr 12 2006, 08:06 PM:name=ToonMariner)--][div class=\'quotetop\']QUOTE(ToonMariner @ Apr 12 2006, 08:06 PM) [snapback]364247[/snapback][/div][div class=\'quotemain\'][!--quotec--] Have you made sure you posted those url's correctly? The second scenario has you going to a subdomain (go.domain.com) if that is the case then perhaps the server will not allow session cookies to traverse domains/subdomains. [/quote] the url are posted correctly,is there any way of solving this problem
  8. hi i am having a bit of a problem with sessions, if i have the protected page has [a href=\"http://www.domain.com/web/protectedpage.php\" target=\"_blank\"]http://www.domain.com/web/protectedpage.php[/a] it goes [a href=\"http://www.domain.com/web/security/members/?sec=login\" target=\"_blank\"]http://www.domain.com/web/security/members/?sec=login[/a] if session username aint there,once logged in it show welcome username etc which is great. but ........ if the prottected page is [a href=\"http://www.domain.com/support/members/\" target=\"_blank\"]http://www.domain.com/support/members/[/a] and it goes to [a href=\"http://go.domain.com/web/security/members/?sec=login\" target=\"_blank\"]http://go.domain.com/web/security/members/?sec=login[/a] once i submit the form it goes back to the index page but still say welcome guest instead of welcome username etc and when i access the protected page again to goes back to the login page any ideas why this might be happening thanks
  9. i have added url=http://referrer&amp on the end of the url but it doesnt work, is there a variable that calls what page it come from
  10. hi i have made a site which uses mysql with sessions, but what i wont to know is i have the following code: <? if(!$_SESSION['username']){ header("Location: [a href=\"http://domain");\" target=\"_blank\"]http://domain");[/a] } else { print <<<END html END; } ?> on the page to protect and if there is no session name in the current session it redirect to the login page how do i have a query string added to the url that send it back to the page it come from like ie domain.com/bahbah/?url=http://home.domain.com thanks
×
×
  • 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.