Jump to content

johnmark

Members
  • Posts

    26
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

johnmark's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. I've searched all over and all the tutorials are really confusing to me. I was wondering if anyone has a zip file of a secure login script that I can study so i can do it myself. Any help would be so appreciated!
  2. Is there a code so that when people submit a letter or blog to my database that when it comes back to the site that it still has all the breaks that they put in it. All the paragraphs.
  3. I have a problem with my code, when I put in the correct username and password I get the error... Warning: Cannot modify header information - headers already sent by (output started at...) in ... on line 13 this is the code i'm using... <html> <body> <?php // valid login credentials $username = 'admin'; $password = 'admin_pass'; // grab current time $time=time(); // handle validation event if ($_POST[user] && $_POST[pass]) { if ($_POST[user]==$username && $_POST[pass]==$password) { setcookie ("user", md5($_POST[user]), $time+3200); setcookie ("pass", md5($_POST[pass]), $time+3200); header("Location: index.php"); } else { $login_error= true; } } // handle the logout event if ($logout == true) { setcookie ("user", md5($_POST[user]), $time-3200); setcookie ("pass", md5($_POST[pass]), $time-3200); header("Location: index.php"); } // handle login event, both successful and erroneous, or show login screen if ($login_error == true) { ?> <table align=center style="font-family:arial; font-size:12; border:1 solid #000000;"> <tr><td align=center bgcolor=#123dd4>LOGIN ERROR</td></tr> <tr><td align=center><b>Invalid Username and/or Password</b><br><br><a href=index.php>Back</a></td></tr> </table> <? } elseif ($_COOKIE[user] == md5($username) && $_COOKIE[pass] == md5($password)) { ?> <table align=center style="font-family:arial; font-size:12; border:1 solid #000000;"> <tr><td align=center bgcolor=#123dd4>SECURE AREA</td></tr> <tr><td align=right><a href=index.php?logout=true>Logout</a></td></tr> <tr><td>You have successfully logged in.<br><br> Encrypted Username: <b><?php $_COOKIE[user] ?></b><br> Encrypted Password: <b><?php $_COOKIE[pass] ?></b><br> </td></tr> </table> <? } else { ?> <form action=index.php method=post> <table align=center style="font-family:arial; font-size:12; border:1 solid #000000;"> <tr><td colspan=2 align=center bgcolor=#123dd4>LOGIN</td></tr> <tr><td align=right>Username: </td><td><input type=text name=user size=15></td></tr> <tr><td align=right>Password: </td><td><input type=password name=pass size=15></td></tr> <tr><td align=center colspan=2><input type=submit value=Login></td></tr> </table> </form> <? } ?> </body> </html>
  4. Hello, I want to create a drop down list that has multiple emails in it, that when one is selected, after the form is filled out it will be sent to that email. I have searched around but haven't found the solution. I can see it in my head just can't get it out. If you could give me a link that applies to this, or even an easy code... I would be very grateful. Thank You for the help. John
  5. Hey, i've been trying to work on some log in scripts but I can't seem to get anything right. If anybody has the time... do you think you could post a log in script or send it to my email? My database consists of uname, pw, and email. I would be much abliged John
  6. Can you explain what to do in littler pieces like do i need to place a whole new user? or can i use the main user? It's a little confusing to my little head.
  7. Ok, i realized that this problem might have to do with my friends sql. So i downloaded it myself and now this is what i'm getting... Warning: mysql_connect() [function.mysql-connect]: Access denied for user 'username'@'localhost' (using password: YES) in /home/jblair77/public_html/johnblairdesign/test.php on line 16 Unable to connect... Hey, at least it's something.
  8. Well php works, because i can use $_POST to get email and stuff, but when it gets to the database it just stops.
  9. Yeah
  10. Nope. Thanks guys for all your help, when I do get it running, i'll be just that much smarter.
  11. It gives me all the php info.
  12. Yes, when i run that code, i'm not sure of anything really, i'm not sure if my IIS is hooked up properly either.
  13. When i run the page with that code, Nothing happens, it loads the page and says it's loading for a while... then just stops like it's done.
  14. Putty.
  15. Well I can connect to it manualy so i'm guessing yes. Maybe i'll try to download sql on my computer and see what happens.
×
×
  • 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.