Jump to content

Alex

Staff Alumni
  • Posts

    2,467
  • Joined

  • Last visited

Everything posted by Alex

  1. You should be more specific. If that's the entire code then you're missing a closing }.
  2. You mean you want to append a line break to the end of each line written to the file? fwrite($fh, $stringData . PHP_EOL);
  3. I meant you should check the source of the page to see if <img src= '../images/down.png'> appears.
  4. First check the output to see if it's actually outputting your image. If it is then confirm the path is correct.
  5. Use: header('Location: index.php?lg=' . $lg); exit;
  6. You need to explain more. If you have a PHP socket server running it will accept connections from any IP.
  7. Just put whatever prefix you want into the MySQL query. $sql = "INSERT INTO users (username, ...) VALUES ('super$username')";
  8. $query_delete = "DELETE FROM log_April2010 USING April2010 INNER JOIN roster_April2010 WHERE April2010.user_id = roster_April2010.user_id AND roster_April2010.user_id = '{$_SESSION['user_id']}'";
  9. I joined last June, when I was 15, I'm now 16.
  10. Yes, those are the keys. Check the manual for the array syntax.
  11. Yes, ../ goes up one directory.
  12. I already said, use it on the text before outputting. Given you haven't supplied us with any code I can't be more specific.
  13. You were already given the answer. Run nl2br on the data before outputting it.
  14. $deletelist = array(1, 2, 3); $query = "DELETE FROM messages WHERE id IN (" . implode(',', $deletelist) . ")";
  15. I've had similar experiences. In fact, currently I'm taking a web design course which is horrible. The course is designed as if the web hasn't changed over the past 10 years, and we're being taught horrible practices left and right. I just have to bite the bullet and take the easy A, I suggest you do the same.
  16. Anonymous functions are only available in PHP 5.3.0+. Use create_function.
  17. As you can see from the link provided he's the creator of PHP.
  18. $blackList = array( 'shit', 'crap' ); $valid = true; foreach($blackList as $blackItem) { if(strpos($str, $blackItem) !== false) { valid = false; break; } } if(!$valid) { // Did not validate }
  19. In my original post I didn't realize that you wanted the keys reset. You can do something like this to get that effect: <?php $arr = array( 0 => 'A', 1 => 'B', 2 => 'C', 3 => 'D', 4 => 'E' ); unset($arr[2]); $new_arr = array_combine(range(0, sizeof($arr) - 1), array_values($arr)); print_r($new_arr);
  20. To access properties and methods from within the class you need to use the $this variable. $this->id $query = mysql_query("select * from `users` where `id`='{$this->id}'"); // or $query = mysql_query("select * from `users` where `id`='" . $this->id . "'"); edit: Beat to it
×
×
  • 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.