
Will
Members-
Posts
215 -
Joined
-
Last visited
Never
Content Type
Profiles
Forums
Events
Everything posted by Will
-
How To Do V1 Crons ( Hope This Will Help )
Will replied to SoulOfDeath's topic in General Discussion
Re: How To Do V1 Crons ( Hope This Will Help ) Hopefully you have password protected them.... -
How To Do V1 Crons ( Hope This Will Help )
Will replied to SoulOfDeath's topic in General Discussion
Re: How To Do V1 Crons ( Hope This Will Help ) Why would you need to change the mysql.phph file? -
Re: Count in base 27 Ah. I think I get it now. :-D
-
Re: Count in base 27 Any example of a code how to do this?
-
I am trying to make a script which generates all the possible letter combinations to a certain length. Is there anyway to count in base 27, by this I mean for($a=1; a<10000; a+=1) { if ($a=1) { $b='a' } etc.. It would then enter the string into a database. It would count like this http://www.thecrimelife.com/files/example.txt NOTE: I typed this up. Any help would be appreciated.
-
How To Do V1 Crons ( Hope This Will Help )
Will replied to SoulOfDeath's topic in General Discussion
Re: How To Do V1 Crons ( Hope This Will Help ) Hmm. Good point. -
How To Do V1 Crons ( Hope This Will Help )
Will replied to SoulOfDeath's topic in General Discussion
Re: How To Do V1 Crons ( Hope This Will Help ) I don't use the beginner one as I will waste valuable time scrolling down the page. -
How To Do V1 Crons ( Hope This Will Help )
Will replied to SoulOfDeath's topic in General Discussion
Re: How To Do V1 Crons ( Hope This Will Help ) Yeah I combined them -
How To Do V1 Crons ( Hope This Will Help )
Will replied to SoulOfDeath's topic in General Discussion
Re: How To Do V1 Crons ( Hope This Will Help ) Hers an example of what my cron table looks like. NOTE: I have combined my crons into less crons so they are less in the table. -
How To Do V1 Crons ( Hope This Will Help )
Will replied to SoulOfDeath's topic in General Discussion
Re: How To Do V1 Crons ( Hope This Will Help ) I found that doing it this way means that anyone can run your crons. You can password protect then by putting this code at the top: if ($_GET['pass'] != 'Your_pass') { die("Go away"); } Then in the crons table put ?pass=Your_pass e.g. http://game-name/daysold.php?pass=Your_pass NOTE: Change the "Your_pass" to something else -
Re: Text file into database Hmm yeah. 839,299,366,000,000,000 is alot. I'm just using a password generator to generate random passwords and putting them on the database. It is using a lot of space thought. At time of print there are 329,616 using 23.9 MiB of space. If your interested the site which this is for is; www.thecrimelife.com/md5 Anyway one day I will do that. I have a dream that one day md5 encryptions will be useless. :-D :-D
-
Re: Text file into database Thanks
-
Re: Text file into database Well not really a passowrd file more a large databse of word and phraes for my md5 decryption database. Although that file sound usefull. Could you send to [email protected]
-
Re: Text file into database I mean like this www.thecrimelife.com/files/example.txt NOTE: I typed this up manually, I would like a code which makes a file like this which goes to around 10 digits.
-
Re: Text file into database Another question, is it possible to create a code which cretes a text file (of direcently to database) which counts up letters? e.g a c ..... z aa ab ac ad ........... ba bc etc etc.
-
Re: Text file into database Thanks. It worked. I now have to run a large query to md5 encrypt everything (Don't worry I have already made this script). Anyway thanks again. :-D :-D
-
Re: Text file into database I get the following error Warning: mysql_query() [function.mysql-query]: Access denied for user 'nobody'@'localhost' (using password: NO) in /home/thecrime/public_html/md5/import.php on line 13 Warning: mysql_query() [function.mysql-query]: A link to the server could not be established in /home/thecrime/public_html/md5/import.php on line 13 Access denied for user 'nobody'@'localhost' (using password: NO) I need to be able to enter a username and password on the query.
-
Re: Text file into database I want the whole file on different rows (as many rows in database as the rows of the text file) but only entered into the 'text' column.
-
I have a text file which is single words separated by a new line; www.thecrimelife.com/files/dic.txt I have a database with 4 columns; id(auto_increment), text, md5, done. Is there any way to import the text file into the database in the column 'text'? Any help would be appreciated.
-
Re: URGENT HELP CONVERTING RAR TO PHP I think that is what you get if you try and open a *.rar in notepad or a simple text editor.
-
This is a password reset script which involves several emails. This is for people who use md5 encryption on there passwords. It works for me but there might be some unknown bugs but it's free and you can change and mess around with it. It was made for version 1 Firstly open global_func.php, go to the bottom and add function randomString($length) { $string = md5(time()); $highest_startpoint = 32-$length; $randomString = substr($string,rand(0,$highest_startpoint),$length); return $randomString; } NOTE:This is the only part which isn't my own but it is allowed to be freely used FOR V1: Secondly create a file called forgot_password.php adn put this in it: <?php /*----------------------------------------------------------- -- William -- Password reset ------------------------------------------------------------*/ require "mysql.php"; require "global_func.php"; global $c; print " YOUR GAME NAME Forgot Password [img=logo.png]"; if($_GET['action'] == '') { print "Your Username (game name): [url='login.php']>back[/url]"; } if($_GET['action'] == 'submit') { if(!$_POST['username']) { die("You forgot to enter your username!"); } else { $a=mysql_query("SELECT * FROM users WHERE username='{$_POST['username']}'",$c) or die(mysql_error()); $b=mysql_fetch_array($a); if (mysql_num_rows($a)==0) { print "This user does not exist Back"; exit; } $key=randomString(10); mysql_query("INSERT INTO passreset VALUES ('','$key','{$b['userid']}','2');",$c) or die(mysql_error()); $to = $b['email']; $subject = "YOUR GAME NAME"; $headers = "From: YOUR GAME EMAIL"; $body = "Hello {$b['username']}! To reset you password goto http://www.thecrimelife.com/passreset.php?key=$key&ID={$b['userid']} NOTE: This link is only active for 2 days!"; mail($to, $subject, $body, $headers); print "Password reset sent to your e-mail! NOTE:The link is only active for 2 days! [url='login.php']back[/url]"; } } ?> Then create a file called passreset.php and put this in it: <?php /*----------------------------------------------------------- -- William -- Password reset ------------------------------------------------------------*/ require "mysql.php"; require "global_func.php"; global $c; print " YOUR GAME NAME Forgot Password [img=logo.png]"; if($_GET['ID'] == 0) { die("Invalid userid"); } if(!$_GET['key']) { die("Just go now"); } $key=$_GET['key']; $a=mysql_query("SELECT * FROM `passreset` WHERE `key`='$key' AND userid={$_GET['ID']}",$c) or die(mysql_error()); if (mysql_num_rows($a)==0) { print "Invalid key, please try again Back"; exit; } $b=mysql_fetch_array($a); $tt=mysql_query("SELECT * FROM users WHERE userid={$_GET['ID']}",$c) or die(mysql_error()); $gh=mysql_fetch_array($tt); $random=$_GET['key']; mysql_query("DELETE FROM passreset WHERE userid={$_GET['ID']}",$c) or die(mysql_error()); mysql_query("UPDATE `users` SET userpass=md5('{$_GET['key']}') WHERE userid={$_GET['ID']}",$c) or die(mysql_error()); print "Your new password has been mailed to you, use this to log in and then change it in the preferences."; $to = $gh['email']; $subject = "Forgot Password - YOUR GAME NAME"; $headers = "From: YOUR GAME EMAIL"; $body = "Hello {$gh['username']}! Your new password is $random log in with this password and change it in the preferences menu."; mail($to, $subject, $body, $headers); print "Password sent to your e-mail! [url='login.php']back[/url]"; ?> The add this to your daily cron: mysql_query("UPDATE passreset SET time=time-1 WHERE time > 0",$c) or die(mysql_error()); mysql_query("DELETE FROM passreset WHERE time<=0",$c) or die(mysql_error()); For V2: Secondly create a file called forgot_password.php adn put this in it: <?php /*----------------------------------------------------------- -- William -- Password reset ------------------------------------------------------------*/ include "config.php"; global $_CONFIG; define("MONO_ON", 1); require "class/class_db_{$_CONFIG['driver']}.php"; $db=new database; $db->configure($_CONFIG['hostname'], $_CONFIG['username'], $_CONFIG['password'], $_CONFIG['database'], $_CONFIG['persistent']); $db->connect(); $c=$db->connection_id; require "global_func.php"; print " YOUR GAME NAME Forgot Password [img=logo.png]"; if($_GET['action'] == '') { print "Your Username (game name): [url='login.php']>back[/url]"; } if($_GET['action'] == 'submit') { if(!$_POST['username']) { die("You forgot to enter your username!"); } else { $a=$db->query("SELECT * FROM users WHERE username='{$_POST['username']}'") or die(mysql_error()); $b=mysql_fetch_array($a); if ($db->num_rows($a)==0) { print "This user does not exist Back"; exit; } $key=randomString(10); $db->query("INSERT INTO passreset VALUES ('','$key','{$b['userid']}','2');") or die(mysql_error()); $to = $b['email']; $subject = "YOUR GAME NAME"; $headers = "From: YOUR GAME EMAIL"; $body = "Hello {$b['username']}! To reset you password goto http://www.thecrimelife.com/passreset.php?key=$key&ID={$b['userid']} NOTE: This link is only active for 2 days!"; mail($to, $subject, $body, $headers); print "Password reset sent to your e-mail! NOTE:The link is only active for 2 days! [url='login.php']back[/url]"; } } ?> Then create a file called passreset.php and put this in it: <?php /*----------------------------------------------------------- -- William -- Password reset ------------------------------------------------------------*/ include "config.php"; global $_CONFIG; define("MONO_ON", 1); require "class/class_db_{$_CONFIG['driver']}.php"; $db=new database; $db->configure($_CONFIG['hostname'], $_CONFIG['username'], $_CONFIG['password'], $_CONFIG['database'], $_CONFIG['persistent']); $db->connect(); $c=$db->connection_id; require "global_func.php"; print " YOUR GAME NAME Forgot Password [img=logo.png]"; if($_GET['ID'] == 0) { die("Invalid userid"); } if(!$_GET['key']) { die("Just go now"); } $key=$_GET['key']; $a=$db->query("SELECT * FROM `passreset` WHERE `key`='$key' AND userid={$_GET['ID']}") or die(mysql_error()); if (mysql_num_rows($a)==0) { print "Invalid key, please try again Back"; exit; } $b=mysql_fetch_array($a); $tt=$db->query("SELECT * FROM users WHERE userid={$_GET['ID']}") or die(mysql_error()); $gh=mysql_fetch_array($tt); $random=$_GET['key']; $db->query("DELETE FROM passreset WHERE userid={$_GET['ID']}") or die(mysql_error()); $db->query("UPDATE `users` SET userpass=md5('{$_GET['key']}') WHERE userid={$_GET['ID']}") or die(mysql_error()); print "Your new password has been mailed to you, use this to log in and then change it in the preferences."; $to = $gh['email']; $subject = "Forgot Password - YOUR GAME NAME"; $headers = "From: YOUR GAME EMAIL"; $body = "Hello {$gh['username']}! Your new password is $random log in with this password and change it in the preferences menu."; mail($to, $subject, $body, $headers); print "Password sent to your e-mail! [url='login.php']back[/url]"; ?> The add this to your daily cron: $db->query("UPDATE passreset SET time=time-1 WHERE time > 0") or die(mysql_error()); $db->query("DELETE FROM passreset WHERE time<=0") or die(mysql_error()); Run this database query: CREATE TABLE `passreset` ( `id` INT( 11 ) NOT NULL AUTO_INCREMENT PRIMARY KEY , `key` VARCHAR( 255 ) NOT NULL , `userid` INT( 11 ) NOT NULL , `time` INT( 11 ) NOT NULL ) ENGINE = MYISAM ; And finally create a link to forgot_password.php on the homepage. Oh, and change the header and email accordingly.
-
Re: MD5 password encode I have posted the code used on the DBS mod forum if you want to use it.
-
Re: URGENT HELP CONVERTING RAR TO PHP *.rar is a compressed file format like *.zip. You need to uncompress it first using an uncompressing program like winrar.
-
Re: MD5 password encode Ah well I have made some code now using a randomly generated string as an activation key and the password is reset.
-
Re: MD5 password encode Any example code of how to do this?