Jump to content


  • Posts

  • Joined

  • Last visited


Everything posted by phpSensei

  1. I always thought this script explained it pretty well, from PHP security Consortium <?php define('SALT_LENGTH', 9); function generateHash($plainText, $salt = null) { if ($salt === null) { $salt = substr(md5(uniqid(rand(), true)), 0, SALT_LENGTH); } else { $salt = substr($salt, 0, SALT_LENGTH); } return $salt . sha1($salt . $plainText); } ?>
  2. We all began somewhere, no one is born with ultimate knowledge of PHP. Your doing great btw, don't worry about it. Keep pushing yourself, never stay in your comfort zone, and always set a challenge for yourself in programming and you'll learn over time.
  3. this. and i think the OP is wondering how the ORDER of the if/else will work.. PHPchick, If you simply do if($var ==""){ print "please enter the var 1 field" ; } if($var2 ==""){ print "please enter the var 2 field"; } if($var3 ==""){ print "please enter the var 3 field"; } Output Please enter the var 1 field Please enter the var 2 field Please enter the var 3 field it will display all 3 errors.. although if you do this method if($var == ""){ print "please enter the var 1 field"; }elseif($var2 ==""){ print "please enter the var 2 field"; } Then it will go in sequence. It will run through the entire if/elseif script, and if the one of the conditions are met, it will print that error... It will keep printing 1 error everytime as long as the conditions are met until there are no more errors...
  4. Cool, you know what, I really love the array_map function, I just came back from a competition in skills and technology, it saved me alot of time, but this is kind of off topic
  5. You are ignoring the solutions provided. Your code is all over the place, the "!" exclamation mark means the opposite of the function result. IF the database does not connect, then DO NOT run the while loop. Use your frickin brackets... and this ($all = 0){ completely useless What is that function even supose to return? Why is your max_item and db globalized? Wheres $result coming from? Some parsing problems here you should fix echo "<TR><TD><ahref=\"{$_SERVER['PHP_SELF']}" . "?action = show&id={$row['id']}\<Comments</a>($comment_row[0]}</TD></TR>\n)";
  6. is_numeric performs faster results than ctype.. but i guess ctype checks if its purely digits only.
  7. Yeah, but if you dig a little deeper you will get some more problems such as if they close their browser and don't bother to even click cancel. Heres what I would do... If a user decides to upload an attachement I will store in a database table, and each attachement has a POST ID which is assigned to it. When they click submit, you can have boolean field which confirms if the post has been submitted or not, if it has then make sure you update the attachement in the table and set the attachement_submitted field to true. You can also delete the attachement if they click cancel, and run a cron job to everyday at a certain time which will check for all attachement who have the attachement_submitted field set to false.
  8. Your still uploading content to the folder. OP, I think the "Cancel" / "Delete" button can trigger a function that will check if there were any attachments made, find them, and delete them. simple.
  9. [quote author=utdfederation link=topic=106377.msg969399#msg969399 date=1219182379] hello all the story behind my username...hmmm well to be honest it is a dead give away really. utdfederation i chose because i am a fan of startrek  united federation of planets so there you go utd (united) federation just decided to keep the planets part off but i think it is original. utdfed [/quote] I think I am the only coder in the world that has never seen more than 1 episode of star trek, or watched star wars. Sometimes I try watching it but it gives me nightmares and my mom thinks its porn. I seriously should get a geekier name! Maybe like PHPgeek or FourEyesSensei [quote author=baronsamedi link=topic=106377.msg969496#msg969496 date=1219191562] baron samedi is the voodoo doll i worship [/quote] Who made the doll? Some factory. Who made the factory? Humans. Who made humans? God. worship god. :P I know ur kidding.
  10. IiISenseiIiI SICK! story behind username: It was a stormy day and I was drinking a redbull.... My wife was having an afair and.... I got pissed so I smashed my keyboard and my computer typed IiIEnterYourNameHereAndStopSmashingMeGAWDIiI edit: I need to get a life.
  11. My new name will be XxPHPsensexXPoniesxOxOxOxOxOxOxo0XXXXXXXXXXXXXXXXXXXXXXXXXXXXXxxxXXxxxx
  12. [quote author=gijew link=topic=106377.msg921334#msg921334 date=1214279447] Mine was my nickname when I was in the army. I would always make jokes that I was too fragile to do (x) as I was in the Infantry because I was Jewish so one day a friend of mine starts calling me, G.I. Jew - The Greatest American Hebrew. It stuck. [/quote] HAHAHA
  13. You're name those have a sexy and creative feel to it.
  14. I just finished watching a kung fu movie that night, and i called me PHPsensei. No one can mess with the sensei...... no one. ever. no. stop. no one. just nobody.... not even chuck norris. Okay! maybe he can, but no one else.  8) edit: The user above me, you are hopeless, I thought your name was Hopeless Sex, because having sex was hopeless?
  15. Ill give it a shot now...But it couldn't be a problem in my connection string could it? I mean the script is connecting, its just displaying all the ranks in the rank column, instead of the rank for the specific user. If you want a specific user then try $id = // some users id by $_POST or $_GET or given number $result = mysql_query("SELECT * FROM users WHERE user_id = '$id'"); I don't know what you column name is for the user id's so i called it user_id, change that if you like. That query just selects all the users, no specific value is given.
  16. Try using a die(mysql_error()) statement.
  17. Heres a simple way to do it. mysqldump -ce --user=username --password=password dbname | gzip | uuencode dbbackup_e.gz | mail email@address.com Chaneg the dbbackup_e.giz to a time(); format, use mkdir and name it the time(); format, and move the renamed file to your backup folder. or like this $backupFile = $dbname . date("Y-m-d-H-i-s") . '.gz'; $command = "mysqldump --opt -h $dbhost -u $dbuser -p $dbpass $dbname | gzip > $backupFile"; system($command);
  18. [quote author=cgm225 link=topic=106377.msg838285#msg838285 date=1205327224] [quote author=neylitalo link=topic=106377.msg837825#msg837825 date=1205271596] No, it doesn't provide valuable, must-read information... [/quote] And this does? [url=http://www.phpfreaks.com/forums/index.php/topic,112560.0.html]http://www.phpfreaks.com/forums/index.php/topic,112560.0.html[/url]  ;) [/quote] Its to prevent repeating topics on the same subject everytime. Why are you complaining anyways, just leave it be...
  19. You might as well consider it stickied, because it is always at the top of the Miscellaneous section anyways.
  20. [quote author=GameYin link=topic=106377.msg816005#msg816005 date=1203134316] www.GAMEYIN.com (Ignore the limited content  ::) ;D :D ;) :-\ :'( :-[ :P [/quote] Site just crashed my computer, its very slow.
  21. Mine came from a mysterious programming language called PHP, and the word SENSEI is a forbidden MOB name in Italy. Believable? I think so.
  • 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.