Jump to content

DarkWater

Members
  • Posts

    6,173
  • Joined

  • Last visited

    Never

Everything posted by DarkWater

  1. Hahaha! The om thread was the best. I think it's the resurrection, another 100 post thread! Listen, you can't ever top that thread. It's impossible. That thread made it to the "Most Active Thread" thing. It's #1. Check out the stats at the bottom of the forum, lol. om will live on forever in our memories. And our burnt retinas. Amen.
  2. <?php class testklass { public function hello() { $this->amihere = 'assigned in class'; } } $controller = 'testklass'; $k2 = new $controller(); call_user_func_array(array($k2 , 'hello'),array()); print_r($k2); // Object ( ) Works for me. Version: PHP 5.3.0alpha3 (cli) (built: Jan 3 2009 23:19:19)
  3. Err, okay...trim() wouldn't accomplish that ANYWAY. You're looking for str_replace(). $str = str_replace('ABC', '', $str);
  4. Well, actually, it results in "TEST B TEST". trim() actually just makes a character mask of the characters in the 2nd parameter and uses that to pull the left and right characters off and stuff. What are you trying to do? Remove a specific string from the end of a line?
  5. Don't use ereg() or anything in the ereg() family. It's being removed from PHP6 and will only be available as a PECL extension, so it's not very forward compatible.
  6. The logic you're going for absolutely needs to use one equals sign. To shut Zend up, you can try: while (FALSE !== ($row = mysql_fetch_assoc($query))) { But then your code will start looking like C.
  7. Well, considering that you have the source code...go look at what the functions do yourself? =P
  8. if (!valid_username($username) || !valid_password($password) || !valid_email($email) || $password != $password2 || user_exists($username)) { You left the || off of !valid_password($password). The code above is the fixed version; compare it to yours.
  9. I get no syntax error from that code.
  10. That works too, but cURL is faster. And if you need to POST any data or log in or use cookies for the site, you need cURL. file_get_contents() is certainly easier though.
  11. It's absolutely possible. I'd suggest checking out the cURL library and regular expressions.
  12. Load it into GD with imagecreatefromstring() and then use normal resizing procedure.
  13. <?php $nedit = preg_replace('/(\s\'\w)/e', 'strtoupper("$1");', $nedit); Have fun.
  14. <?php $sport = mysql_real_escape_string($_GET['sports']); $query = "SELECT * FROM articles WHERE sport = '$sports' AND publish = '".date('Y-m-d')."'"; You're using $sports in the query, and setting $sport on the line above it. Pick one.
  15. You never set $this->result in the Mysql_statement class...
  16. Or glob(). glob() is really one of the cleanest directory traversal solutions.
  17. DarkWater

    HELP!!!

    There's a Linux version of Limewire...
  18. Change those ? after the numbers to ' too....
  19. You are not using standard quotation marks. Are you using Microsoft Word to edit code?
  20. UPDATE table SET field = DATE_SUB(field, INTERVAL 14 DAY);
  21. SELECT * FROM thelist WHERE pskill = 'carpentry' OR sskill = 'carpentry';
  22. Okay. When you get the results of mysql_fetch_assoc(), you get $total_pages to be: Array ( [num] => 21 ) Then, you do: $total_pages = $total_pages[num]; That makes $total_pages: int(21) Because you overwrote it. Now, you go and do: <?php echo $total_pages['num']; ?> PHP looks at this and says, "Oh, $total_pages? We can pretend that's a string (for all we know it could be a string of numbers, so it's fine!), and we'll use array syntax to access individual characters." Almost like: Array ( [0] => 2 [1] => 1 ) So, anyway, PHP looks at the code again and says, "Now wait. You can't have a string character index as a string, it needs to be an integer." They do a typecast to int, and: (int) 'num'; Evaluates to 0. That leaves: <?php echo $total_pages[0]; ?> That tells PHP to grab the first character only. Get it now?
  23. $total_pages = $total_pages[num]; It's that line. You set $total_pages to a string. Then, when you do: <?php echo $total_pages['num']; ?> PHP uses the array-like string syntax to grab characters. 'num' evaluates to 0 as an int, so you get: <?php echo $total_pages[0]; ?> Which grabs the first character.
×
×
  • 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.