random

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
SidewinderX
Forum Contributor
Posts: 407
Joined: Fri Jul 16, 2004 9:04 pm
Location: NY

random

Post by SidewinderX »

how do i make my php script randomally generate a code using numbers and then have the form verify that the code is right and continue the login.

Kind of like phpnuke when you log in it asks for a username and password and asks you to type in that number it generates and then it allows you to login.

Thats exactley what i want, all help is appreciated.
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

SidewinderX
Forum Contributor
Posts: 407
Joined: Fri Jul 16, 2004 9:04 pm
Location: NY

Post by SidewinderX »

ok thanks
another thing, you can pull text from a text document
ie) readfile("ips.log")
and that will display all the information in ips.log

is there a function to edit ips.log instead of just view it?
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

readfile just tosses the file at the browser. If you want to save alterations that you make to a file, you'll need to use a combination of [php_man]fopen[/php_man]/[php_man]fwrite[/php_man]/[php_man]fclose[/php_man], or using regular expressions, but that can be complicated...
Post Reply