![]() |
| |||||||
| FAQ | The Drunks | Calendar | Arcade | Search | Today's Posts | Mark Forums Read |
![]() |
| | LinkBack | Thread Tools | Display Modes |
| | #1 (permalink) |
| "It's a faaaake!" | I've been trying my hand at PHP coding lately, with marginal success. But, I've yet to get working any login system beyond a simple form that doesn't send cookies, so it hasn't the convenience of autologin. ![]() Here's my attempt at a login form that uses cookies. Can anyone tell me what might be wrong with it? All this form will do, is reload itself in its default state when the submit button is pressed. I'm not an experienced scripter, so I'm probably missing something...PHP Code: )I also tried HTTP authentication, too. The results were just as dismal; the popup window wouldn't accept input, it just reloaded with blank fields. PHP Code: Does anyone have any ideas?
__________________ "People should not be afraid of their governments. Governments should be afraid of their people." -V for Vendetta "Don't tell me what I can't do!" -John Locke, Lost Visit me on the web: Hypersyllogistic | Flickr | Twitter ![]() |
| | |
| | #2 (permalink) |
| Astro-Monkey | In the first one, the mistake keeping it from working is the fact that you've got an HTML error, not a PHP one. ![]() <input type="submit" value="Login" /> Your submit button needs a name: <input type="submit" value="Login" name="submit" /> You've also got a problem with your setcookie functions. setcookie ('username', '$u', time()+10000000, '/'); The single quote doesn't interpret variables, so in this instance you're not setting the cookie to the value of $u, you're actually setting it to the two characters. I didn't get a chance to look at your HTTP authentication one yet, and I've got to start my day. I'll try later this evening.BTW, what are you using to learn PHP?
__________________ The writers of this post apologize for you being too stupid to understand it. |
| | |
| | #3 (permalink) | |
| "It's a faaaake!" | Quote:
LOL, I can't believe I made that elementary single quote mistake. That's what I get for rushing.As for the submit button issue, I think I used Dreamweaver to set up the submit button, I'm not sure. To learn PHP, I've been using PHP for the World Wide Web, 2nd Edition, and PHP and MySQL, both Visual QuickStart Guides by Larry Ullman. The mistakes I made are mine, though, not his. Thanks again.
__________________ "People should not be afraid of their governments. Governments should be afraid of their people." -V for Vendetta "Don't tell me what I can't do!" -John Locke, Lost Visit me on the web: Hypersyllogistic | Flickr | Twitter ![]() | |
| | |
![]() |
| Thread Tools | |
| Display Modes | |
| |