Page 4 of 8 First ... 23456 ... Last
  • Jump to page:
    #46
  1. No Profile Picture
    guest
    Guest
    Devshed Newbie (0 - 499 posts)

    Re: Cookie doesn't work in IE5??


    It reads the cookie in IE that I've seen, although I'm having a host of problems logging into the MySQL database, are you getting any errors in particular??
  2. #47
  3. No Profile Picture
    guest
    Guest
    Devshed Newbie (0 - 499 posts)

    doc contains no data


    When I hit the "return" to index, I get the error "documen cotains no data" I have tried high and low. The data is in the table, the cookie is set - what am I missing?

    Any ideas?
  4. #48
  5. No Profile Picture
    guest
    Guest
    Devshed Newbie (0 - 499 posts)

    can't get news


    when I try to grab the news all I get is first few lines in the slashdot.lnk
    #!/user/bin/perl all the way to $before="

    Can someone tell me what I'm doing wrong.


    Thanks Johnny
  6. #49
  7. No Profile Picture
    guest
    Guest
    Devshed Newbie (0 - 499 posts)

    Cookies + Passwords


    I'm fairly new to this so bear with me...

    Is it correct to use cookies to store passwords?


    <!-- Code -->
    <p><pre><font color=#008000><xmp>
    setcookie("username", $username, time()+1200);
    setcookie("password", $password, time()+1200);
    </xmp></font></pre><p>
    <!-- Code -->


    I'm working on a test site that tries to put
    to use whatever I learn about PHP and I've
    added a login box. After reading this tutorial, I'm using cookies to send username and password back to the server. If this is ok, I will continue to do it this way. Otherwise I really want to do this correctly.

    Thanks in advance
  8. #50
  9. No Profile Picture
    guest
    Guest
    Devshed Newbie (0 - 499 posts)

    More concerns with cookies and passwords.


    This is difficult to put into words, but I'll try to be as brief as possible.

    Say I use cookies for login and passwords,,,
    A user logs in and 2 cookies get set:


    <!-- Code -->
    <p><pre><font color=#008000><xmp>
    setcookie("user", $user, time()+1200);
    setcookie("password, $password, time()+1200);
    </xmp></font></pre><p>
    <!-- Code -->


    My concern is that when you have multiple users logged in, the variables
    <!-- Code -->
    <p><pre><font color=#008000><xmp>$user</xmp></font></pre><p>
    <!-- Code -->
    and
    <!-- Code -->
    <p><pre><font color=#008000><xmp>$password</xmp></font></pre><p>
    <!-- Code -->
    don't remain unique to each user. Please explain why this is or is not the case.

    Thanks in advance.

  10. #51
  11. No Profile Picture
    guest
    Guest
    Devshed Newbie (0 - 499 posts)

    Re: Multiple Values in Cookies


    I just saw this tonight and thought about your question. Here's a way to have multiple values associated to a single cookie.

    <p>Step 1.


    <!-- Code -->
    <p><pre><font color=#008000><xmp>
    setcookie("TheCookie", Value1:Value2:Value3, time()+1200);
    </xmp></font></pre><p>
    <!-- Code -->


    Now I know, it's really one value, but next is the cool part, we use explode() to break it back apart...

    <p>Step 2.


    <!-- Code -->
    <p><pre><font color=#008000><xmp>
    $array = explode(":", $TheCookie);
    </xmp></font></pre><p>
    <!-- Code -->


    See, explode accepts 2 arguments: The name and what you used to separate your values. It doesn't have to be ":".

    <p>Step 3.

    Here's how you get the values out of your array...


    <!-- Code -->
    <p><pre><font color=#008000><xmp>
    $firstvalue = $array[0];
    $secondvalue = $array[1];
    $thirdvalue = $array[2];
    </xmp></font></pre><p>
    <!-- Code -->


    That should head you in the right direction.
    -Mike
  12. #52
  13. No Profile Picture
    guest
    Guest
    Devshed Newbie (0 - 499 posts)

    Re: More concerns with cookies and passwords.


    Mike,
    Cookies are sent as part of the session, so there's no need to worry about one person's cookies intermingling with other people's cookies. All the cookies for a particular domain are sent as part of the http request header, and they are sent over for every page that is requested.

    If you are using passwords to hide sensitive data, it's not a good idea to store them in a cookie. Cookies are sent as clear text, so anyone with a sniffer could discover the passwords with little effort.

    The exception to this is using the secure flag when setting the cookie. This tells your browser to only send the cookie over an SSL connection, so this is a viable solution when using a secure server.

    If you really think you have to store passes in cookies, just be aware you will probably pass them in the clear.

    Duncan
  14. #53
  15. No Profile Picture
    guest
    Guest
    Devshed Newbie (0 - 499 posts)

    Re: More concerns with cookies and passwords.


    Another thing to keep in mind is that many computers out there are shared. If you stor someone's password in a cookie, another user can log on to your store using the same computer, and have full access to whatever the original user has access too. Also, cookie files are plain text files, so it would be really easy to just pull up someone's cookie file on their computer to get their password and use it from another computer.

  16. #54
  17. No Profile Picture
    guest
    Guest
    Devshed Newbie (0 - 499 posts)

    Re: Story is way to brief


    Very good point Mark! I totally Agree ;-)
  18. #55
  19. No Profile Picture
    guest
    Guest
    Devshed Newbie (0 - 499 posts)

    Re: More concerns with cookies and passwords.


    Ok, i see what you guys are saying. Thanks for the reply. My little test site uses cookies for authentication, but I'm now encrypting them with
    <!-- Code -->
    <p><pre><font color=#008000><xmp>md5($variable)</xmp></font></pre><p>
    <!-- Code -->

    Is this good enough for a site that needs a small level of security just to maintain user prefs. and permission to post to the MySQL server? Just as a learning exercise I'm trying to mimic some of the features of Slashdot.org and Themes.org. If you're familiar with those you'll probably get an idea what I'm trying to do. Or you can check out my little test site (http://justanotherwebsite.dhs.org). Again, it's just a learning project, and I work on it a lot so some things may be broken. Thanks again for the tips.

    -Mike
  20. #56
  21. No Profile Picture
    guest
    Guest
    Devshed Newbie (0 - 499 posts)

    Re: php version of headline grabber


    Does this php script get the headlines everytime a person visits the site? or does it get it every 30 minutes like Slashdot suggests?

    -Karl
  22. #57
  23. No Profile Picture
    guest
    Guest
    Devshed Newbie (0 - 499 posts)

    Re: php version of headline grabber


    The second argument to getrdf() specifies the number of minutes that the results are to be cached.

    I'm using a modified version of this on my Web site, http://yelvington.com/, to grab headlines from Slashdot and several other sources.
  24. #58
  25. No Profile Picture
    guest
    Guest
    Devshed Newbie (0 - 499 posts)

    same here!


    After I set up my user name and password and pick my news source. (for testing I used slashdot for all three news sources) and I continue to the news page all I ever get is this...<code> #!/usr/bin/perl $pagename="Slashdot"; $newsurl ="www.slashdot.org/slashdot.xml"; $homeurl="http://slashdot.org/"; $file="slashdot.lnk"; $before = " </code>
  26. #59
  27. No Profile Picture
    guest
    Guest
    Devshed Newbie (0 - 499 posts)

    Re: php version of headline grabber


    I keep getting parse errors. You open two sets of curly braces in the first function but never close them. Where should the closing braces go? I get the parse error on the last line of the script and If I add two curly braces the error goes away but I get no results.
  28. #60
  29. No Profile Picture
    guest
    Guest
    Devshed Newbie (0 - 499 posts)

    Retreiving Lost/Forgotten Password


    Any ideas, and have it email to the email on account.

    Dan
Page 4 of 8 First ... 23456 ... Last
  • Jump to page:

IMN logo majestic logo threadwatch logo seochat tools logo