Jump to content

Lamez

Members
  • Posts

    1,686
  • Joined

  • Last visited

    Never

Everything posted by Lamez

  1. Lamez

    MYSQL

    sure. $q = mysql_query("SELECT * FROM videos ORDER BY id DESC"); while($f = mysql_fetch_assoc($q)){ echo $f['id']."<BR>"; } I'm not sure if that is what you are looking for. That while loop returns an array names $f.
  2. What's a CRM System?
  3. Okay gotcha, sorry I was tired when I was responding. I just woke up. I will finish writing my class and post it here for inspection.
  4. I started when I was about 15, creating my own website in PHP, for no reason really. I would download code of the internet and take a look at it, and try to reproduce it. I then eventually became to the point where I could write code on my own without looking. I am now to the point where I can write clean, efficient code, I am now learning OOP. I figured it was time. I am 19 now. Oh, and this forum helped me out tons with my problems, I mean tons! PHP was my first language, I now C, C++, and Java. I do think learning a different language does help you grasp the concept in beginner programmers.
  5. Okay Thanks for the help. So do I not need to connect? Or are you just showing me an example? I am a bit new to mysqli as well.
  6. 1.OpenID, if I add it to my website, will I be able to gather data such as email, first name, last name, etc. 2.I am leaning OOP in PHP and I am trying to make a mysqli class, I'm not very good at it. Maybe you guys can help me here is what I have so far. Am I doing okay? <?php class database{ var $mysqli; function __construct($host, $user, $pass, $db){ $this->mysqli = new MySQLi($host, $user, $pass, $db); } function query($query){ return mysqli_query($this->mysqli, $query); } function fetchAssoc($query){ return mysqli_fetch_assoc(mysqli_query($this->mysqli, $query)); } function numRows($query){ return mysqli_num_rows(mysqli_query($this->mysqli, $query)); } function delete($table, $where){ return $this->query("DELETE FROM $table WHERE ".$where); } } ?>
  7. Gosh, how could I miss that. Thanks. I feel so dumb after you guys fix my mistakes.
  8. I have actually seen a free script out there that detects adult images, what you could do is have that analyze the images uploaded if one is found to be an adult image, have the website email you and you can login and take a look at it, and approve it or delete it. I would do a search for you, but I am at work and I am afraid something naughty will result in my quest for this script.
  9. A Trojan Horse is a virus that attaches itself to other programs that are known to NOT be harmful, and then when the program is executed, the Trojan horse starts doing whatever it was programmed to do. The best thing to do is when you start seeing your mouse move again, unplug yourself from the internet. Doing so by, unplugging your ethernet cable, unplugging external wireless receivers, or somehow disconnecting yourself through hardware, not software. That way if you do have a intruder they don't know you are disconnecting them. If the mouse has stopped moving, they are accessing you over the internet, and you need to remove any software that allows direct access to your computer. (Any remote desktop protocols: RDP's, Logmein, VNC, etc.) If the mouse still is moving, it might be something interfering with your wireless mouse, as mentioned above. Remove the wireless receiver. If the mouse has stopped moving, you have found your problem. If the mouse is still moving, chances are they you have some sort of playful virus (I doubt it, since most viruses want to be incognito). It could be faulty mouse drivers, or improper mouse drivers. If you are on a laptop, it might be you accidentally touching the track pad while using your other mouse or something of that nature.
  10. You can do something like this $q = mysql_query("SELECT song FROM table WHERE artist = '$artist'"); if(mysql_num_rows($q) == 0){ echo "Song Exists"; }
  11. I could post the entire form, lol - not, but I will post this: <?php $id = $f['id']; ?> <input type="checkbox" name="del" id="del" value="<?php echo $id; ?>">
  12. Hmm, something like this? if(is_array($_POST['del'])){ foreach($_POST['del'] as $id){ mysql_query("DELETE FROM ".TBL_ADMINS." WHERE id = '$id'"); } }else mysql_query("DELETE FROM ".TBL_ADMINS." WHERE id = '$id'");
  13. I have a multiple checkbox page. I have handled these before, well. However, this time I am getting a strange error. Here it is: Here is Line 10: foreach($_POST['del'] as $id){ Entire foreach body: foreach($_POST['del'] as $id){ mysql_query("DELETE FROM ".TBL_ADMINS." WHERE id = '$id'"); } Any ideas? I have done this before, as such, and it worked well.
  14. Never mind.
  15. What is the best way of taking a user's input and running it directly in PHP? So I have a textarea and the user puts in: echo "hi"; how can I run that? Any ideas?
  16. Lol I like how this was posted on May 6th. So you are still not a noob ? Learning takes time. Here is how I validate emails: function validEmail($email){ return filter_var($email, FILTER_VALIDATE_EMAIL); } Good ol' one liners.
  17. Not sure on the trim function, but the first line takes out the spaces of the string and mashes it all into one for easier checking. See the manual for the second function: http://php.net/manual/en/function.ctype-alnum.php I've used it before, can't remember for what.
  18. Gosh, how come I did not see that. Thanks!
  19. I think it checks to see if the string contains any letters or digits. If it does not, it returns 2
  20. I'm more or less getting a logic error, so I cannot provide any syntactical errors. The function in question is suppose to take two variables and compare them. I also have a boolean variable to see if I care about the case of the variables. However if I do something like this: compare("NAME", "name", false); The function returns false. Here is the function: function compare($var1, $var2, $caseMatters){ if(!$caseMatters && !is_numeric($var1) && !is_numeric($var2)){ strtolower($var1); strtolower($var2); } return md5($var1) === md5($var2); } Any thoughts?
  21. I knew several different languages before I picked up PHP. It really is just adjusting to the language. I'm still learning better ways to write programs. I love being a programmer and a CS major.
  22. I've always wondered when to use them in proper context. I found this from google. http://support.apple.com/kb/HT2300 It's an support article from Apple. It helped me, maybe I can spread the word now.
  23. I revised my functions like so: function startTime($min){ //Starts the time clock (TC), should only be used in the loginAdmin and updateTime functions. $min *= 60; if(!isset($_SESSION['~TC:Min']) || $_SESSION['~TC:Min'] != $min) $_SESSION['~TC:Min'] = $min; //$_SESSION['~TC:Time'] = time() + $_SESSION['~TC:Min']; updateTime(); } function updateTime(){ //startTime($_SESSION['~TC:Min']); //No need to do the same thing twice. Resets the clock per page. $_SESSION['~TC:Time'] = time() + $_SESSION['~TC:Min']; } function expiredTime(){//True if time has expired; false otherwise. return time() > $_SESSION['~TC:Time']; } Then I forgot to refresh the page, so it works great now!
  24. Okay, so I printed out the timestamps. I am doing something wrong: Here is time(): 1272660826 Here is $_SESSION['~TC:Time']: 1.6926659444736E+30 I got that large number after I refreshed the page a couple times. Any suggestions?
  25. add "/files/". to name. like so $name = "/files/".$_FILES['filename']['name']; or wait do this instead: $name = $_FILES['filename']['name']; $folder = "/files/".$_FILES['filename']['name']; move_uploaded_file($_FILES['filename']['tmp_name'], $folder);
×
×
  • 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.