Jump to content


  • Posts

  • Joined

  • Last visited


About monkeytooth

  • Birthday 11/10/1980

Contact Methods

  • AIM
  • MSN
  • Website URL
  • Yahoo

Profile Information

  • Gender
  • Location
    Hartford, CT

monkeytooth's Achievements

Advanced Member

Advanced Member (4/5)



  1. What you really need to do is take a giant stick and shove it up your grande ass.. I mean uh.. I mean.. $homo= "SELECT * FROM users_logins WHERE login_date BETWEEN NOW() AND DATE_SUB(login_date , INTERVAL 5 day)"; $lesbians = mysql_query($homo) or die(mysql_error()); $totals = array(); while($yourMom = mysql_fetch_array($lesbians)){ $z = 0; while($x=1;$x < 5;$++) { $compareTimes = strtotime(date('Y-m-d H:i:s') . ' +1 day'); if(strtotime($yourMom['login_date']) <= strtotime('-".$x." day")) { $z++; } } array_push($totals, $z); } foreach($totals as $counted) { echo $counted."<br>"; } now will this work? I have no idea.. just kinda came up on this in a whim its a bit sloppy but it could work..
  2. // Find out if user is locked out of their account if (($row['lock_date'] != "0000-00-00 00:00:00") && strtotime($lock_date) <= time()) { $output = array('errorsExist' => $errors, 'message' => $message); } else { // Clear the lock $query = "UPDATE users_logins_attempts SET lockDate = NULL, ip_address = NULL, failed_logins = 0 WHERE users_id = '".$users_id."'"; $result = mysqli_query($dbc,$query); // Account locked error $errors = true; $message = "Account is unlocked. You may now try to log in again!"; $output = array('errorsExist' => $errors, 'message' => $message); } when you initially set a lock_date, set that time 10 minutes a head of the time you are setting it at.. so if its 12:00 when your setting it, store it in the DB as 12:10
  3. Figured out my own answer.. it was lousy use of between and curdate().. For those curious the working result would resemble: SELECT * FROM votelog WHERE ipaddress = '' AND BETWEEN DATE_SUB( datevoted , INTERVAL 24 HOUR ) LIMIT 0 , 30
  4. SELECT * FROM votelog WHERE ipaddress = '' AND datevoted BETWEEN DATE_SUB( CURDATE( ) , INTERVAL 24 HOUR ) AND CURDATE( ) LIMIT 0 , 30 That is an example of the query I am attempting to run to find posts within the past 24 hours. I am also running a separate one for different needs for in the past 60 minutes. Issue is there is at least 4 rows in the table I am testing with 3 of which fall under the 24 hour clause. this is what the timestamp in the DB looks like, standard DATETIME.. 2011-09-01 13:20:08 with that being said I am yielding no results, well as far as mysql_num_rows($result) seems to be concerned..
  5. no worries my brains the same way today.. but fortunately for both of us.. jamesxg1 answered it pretty well
  6. no where in your query are you setting a session value if one isn't set. so, if the session doesn't exist it wont echo anything out. its worth mentioning also that you may wanna reconsider echoing out a straight session/cookie/post/get value also. Its always worth making sure the values are what are expected first otherwise you are opening your site up to serious security risks from exploits.
  7. <?php isset($counter) ? $counter++ : $counter=1; ?> the idea is right.. However, php doesn't store variables past the pages load. You will have to make use of sessions or cookies to achieve this.
  8. well if they are saved in the db one way.. and displayed another then you need something conditional to revert the output to match what they once saw.. so lets say something simplistic.. your storing numeric id's from what i gather from your post. so when you pull them out of the DB your only getting the number you stored, there is no automated logic that will convert it from what you put in vs what the end user saw.. soo you have to build the logic.. the simple concept is cow always equals 1 in the db chicken always equals 2 in the db cat always equals 3 in the db.... etc.. $outputValue1 = $newnode->setAttribute("detectorid",$row['detectorid']); if($outputValue1 == 1){echo 'cow';} elseif($outputValue1 == 2){echo 'chicken';} elseif($outputValue1 == 3){echo 'cat';} else{echo 'scratch-n-sniff, something broke';}
  9. where is the "$_POST['filedel']" field in the above example.. if a input checkbox, radio, text, or otherwise doesnt have the name/id of "filedel" then it is never set, and will just run past the if statement.
  10. number of ways.. if you have access to the httpd.conf for apache you can tell it where there.. you can also mod_rewrite via .htaccess and do it that way.. or.. depending how you build up your custom cms.. have it display an error page within it if the page being called is not found
  11. What would be the best way to compare files and or directories. Lets say I want to store files on a sever or collective of servers like a cloud based system. My users are in collaboration with one another in many cases and some not. Either way I can have upwards of a hundred people or more with the same exact file. Only key difference is they likey renamed the file or whatever. But essentially same exact data all around. Now other thing is there is no specific file type. There's pdf, doc, docx, txt, videos, audio files, etc.. but the issue boils down to the same files over and over. What i want to do is cut it down. Remove the hundreds of dupes and with the help of a database store things like the file name the user provided so I can in turn store the single file left how and where I want while still providing the info they used essentially. Now i know I can do something with md5 or sha1 or sha2 or something equivalent that will essentially give me a unique value I can use for such comparisons. But i am not exactly sure how or where to begin with that. Such as how with php can I get the sha or md5 of a file? When i look up stuff for those I get methods for strings but not files.. Overall I am here looking to bounce ideas around to figuring this out not so much as a direct means.. any help would be great.
  12. What about JavaScript? any opinions on storing that? Echoing that will execute it, someone storing a php script and embeding JavaScript in it will cause it to still run the JS
  13. Ok. I am working on a project where I guess the closest proximity to describe it would be something like http://pastebin.com/ I am building the project with PHP and mySQL as the backend. But I know the combination of the two can be deadly if not handled carefully with what I want to do. I already know I can store in mySQL raw code if I so choose, but that would be stupid as the code that will be stored will be input by users and well trusting any one of them is just stupid. So with that I want to mention that this code will be used in a number of ways. From simply outputting it for display on a page to actually saving it as a file for use automatically. I will be storing all sorts of code from C# to PHP to JavaScript and everything in-between. So I guess my ultimate question here today would be whats the best and safest way I can convert code to be stored in the DB without really effecting my ability to use it for display, demo (in some cases), or writing it to a file for someone to save. Would base64_encode/decode be a good logic to work on? or should I do something like htmlentities/specialchars or I dunno. I guess I am ultimately seeking opinions on the best way to tackle it.
  14. Lets say I have a string var myString = "I was sitting at the green light thinking about the Green Hornet and thought about the greenish tints he had on the windows"; I need to split the string so its broken down by spaces like a CSV but just the space.. Then I need to find every instance of "green" but case sensitive, any ideas? I thought I had an idea but I just ended up doing something entirely wrong... What I need my output to look like is 20, 45, 50.. (thats not exact but just for the sake of sample). What i need to know is the indexOf() splitting it into an array is for something else. which the spliting I have an understanding of.. Its the indexOf for multiple instances thats got me confused.
  15. Fatal error: Class 'SoapClient' not found is my error.. I can't say I have ever seen this error before so I am a bit confused. I am on a local machine server is setup and running properly in my php.ini "extension=php_soap.dll" is not commented out, so I'm a bit lost can anyone help point me in the right direction?
  • 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.