Jump to content

Yves

Members
  • Posts

    76
  • Joined

  • Last visited

    Never

Contact Methods

  • Website URL
    http://www.carbtube.com

Profile Information

  • Gender
    Male
  • Location
    Belgium

Yves's Achievements

Member

Member (2/5)

0

Reputation

  1. Ok. Thanks man. Sorry for the implicit caps. Thanks!!
  2. Do I have to set these cookies as empty first? like so... setcookie ('USERID','','$cookie_expire'); setcookie ('EMAIL','','$cookie_expire'); setcookie ('USERNAME','','$cookie_expire'); setcookie ('VERIFIED','','$cookie_expire'); setcookie ('FAMILYFILTER','','$cookie_expire'); ...because when I load a page (as an unregistered new visitor) where there's $_COOKIE['whatever'] somewhere in the source code it just doesn't load that part of the page. It's asif it can't interpret what a cookie is and defenatly not when that cookie can't be found anywhere. What's causing this?
  3. I'm getting blank pages. I replaced this in my login.php <?php /* SESSION_REGISTER("USERID");$_SESSION[uSERID]=$result->fields['USERID']; SESSION_REGISTER("EMAIL");$_SESSION[email]=$result->fields['email']; SESSION_REGISTER("USERNAME");$_SESSION[uSERNAME]=$result->fields['username']; SESSION_REGISTER("VERIFIED");$_SESSION[VERIFIED]=$result->fields['verified']; SESSION_REGISTER("FAMILYFILTER");$_SESSION[FAMILYFILTER]=$result->fields['familyfilter']; */ function DaysToSeconds($strDays) { $str24Hour = time()+86400; $strReturn = $str24Hour * $strDays; return $strReturn; } $userid = $result->fields['USERID']; $email = $result->fields['email']; $username = $result->fields['username']; $verified = $result->fields['verified']; $familyfilter = $result->fields['familyfilter']; $cookie_expire = DaysToSeconds(30); #30 Days $cookie_domain = ".carbtube.com"; setcookie ('USERID', '$userid', '$cookie_expire', '', '$cookie_domain', 0); setcookie ('EMAIL', '$email', '$cookie_expire', '', '$cookie_domain', 0); setcookie ('USERNAME', '$username', '$cookie_expire', '', '$cookie_domain', 0); setcookie ('VERIFIED', '$verified', '$cookie_expire', '', '$cookie_domain', 0); setcookie ('FAMILYFILTER', '$familyfilter', '$cookie_expire', '', '$cookie_domain', 0); ?> And I changed all $_SESSION[VARIABLE] to $_COOKIE['VARIABLE'] on all pages of the site. I also changed all $smarty.session.VARIABLE to $smarty.cookies.VARIABLE. All php pages also start with session_start(); So it should all just work. But sadly I'm getting blank pages on any page I try to load. And they all have no source code whatsoever. Also, when I delete all my cookies in my browser and reload the site. I still get a PHPSESSID cookie created. Don't know why that is. Any idea why I'm getting a blank pages?
  4. I see. I have some work to do then. Hope this works.
  5. Hm. I tried replacing all the $_SESSION[VARIABLE] with $_COOKIE['VARIABLE'] but it doesn't log me in.
  6. I read about cookies here: Set Cookie PHP. So I know how to set them, retrieve them and unset them. (I think) but I don't know how I can use them to automatically log someone in at any page of the site. If someone logs in what should I put in a cookie? Just the username? I'm just having trouble putting the pieces of the puzzle together. ???
  7. In my login.php there is the following piece of code... After it checks if the username is found in the members table it executes this: <?php $query="update members set lastlogin='".time()."' WHERE username='".mysql_real_escape_string($username)."'"; $conn->execute($query); SESSION_REGISTER("USERID");$_SESSION[uSERID]=$result->fields['USERID']; SESSION_REGISTER("EMAIL");$_SESSION[email]=$result->fields['email']; SESSION_REGISTER("USERNAME");$_SESSION[uSERNAME]=$result->fields['username']; SESSION_REGISTER("VERIFIED");$_SESSION[VERIFIED]=$result->fields['verified']; SESSION_REGISTER("FAMILYFILTER");$_SESSION[FAMILYFILTER]=$result->fields['familyfilter']; ?> When I'm logged in and I check my cookies I find this for my domain: carbtube.com PHPSESSID When I close my browser, reopen it and load carbtube.com again the PHPSESSID is gone. What I want is to be logged in forever up untill the moment I click the lougout link on the site (handled by the lougout.php). How can I do this (securely) and can you give me an example?
  8. whad up? jk Well, I've noticed these little timeouts for little over a week now and it's really getting to me. I can't stay with this host. It's too embarassing. Eventhough it only started happening at beginning of this week and especially when my host's site never ever times out... Any specific host you'd recommend?
  9. Well, it beats me too. Anyway, I'm glad it's sorted out. That description area really looked like a mess. I wouldn't want first few members to complain about that. How do you like the site btw? Any suggestions/comments/remarks? :-X
  10. Right. So the \r's and \n's will always be put into MySQL fields like \r's and \n's, but will have to be transformed once you want them to come out again, sort of, to parse as real \r's and \n's. Thanks for your elaboration.
  11. I think I know what you meant, corbin. It repected the way the \r and \n where written in the database output. So, what should of been in the database output all along for \r and \n? Some html encoded characters?
  12. Well, I didn't quite understand what you posted, corbin, but it seems you provided the solution! The database output is literally \r\n (or \r\n\r\n when 2 linebreaks where entered). So I did't know why all the above didn't work... but I will try to remember this ... situation (?). I cannot thank all of you guys enough. But I CAN thank all equally!!! You've all been a great help! Thanks!!! PS: Sorry for being gone for a while. Yves
  13. When I'm converting the \r and \n I'm replaceing this: {$videoarray[0].description} with this: {insert name=transform_to_textarea_description value=var description=$videoarray[0].description} and this is the function supporting it: <?php function insert_transform_to_textarea_description($var) { $textareadescription = $var[description]; $textareadescription = str_replace('\r','\n',$textareadescription); echo "$textareadescription"; } ?> When the string is this: $videoarray[0].description = "My name is Yves.\r\n\r\nHere's another line of text." It outputs this (in the textarea): <textarea>My name is Yves.\n\n\n\nHere's another line of text.</textarea> But, the "\n\n\n\n" are displayed in the textarea. Readable. Not actual linebreaks. Also, when I make a simple test.html with this in it: <textarea>test\ntest</textarea> and load, it shows the \n too.
  14. http://www.carbtube.com/myvideosedit_php.txt http://www.carbtube.com/myvideosedit_tpl.txt
  15. teynon Yes. I need it to work in the textarea. That's the problem. :-\ SharkBait Replacing the \r with \n just prints "\n\n\n\n" instead of "\r\n\r\n" They are still not interpreted as real linebreaks. At least not in a textarea. :-\
×
×
  • 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.