Jump to content

lur

Members
  • Posts

    53
  • Joined

  • Last visited

    Never

Everything posted by lur

  1. Maybe cURL isn't following redirections, have a look at CURLOPT_FOLLOWLOCATION (http://www.php.net/manual/en/function.curl-setopt.php)
  2. if (substr($_SERVER['REMOTE_ADDR'], 0, 10) !== '192.168.1.') exit(); if (!preg_match('/^192\.168\.1\./', $_SERVER['REMOTE_ADDR'])) exit(); if (0 !== strpos($_SERVER['REMOTE_ADDR'], '192.168.1.')) exit();
  3. $xml = file_get_contents('http://example.net/somexmlfile.php?url=msn.com');
  4. $values = "87a003000c28"; $a=hexdec(substr($values, 0, 2)); $b=hexdec(substr($values, 2, 2)); $c=hexdec(substr($values, 4, 2)); $d=hexdec(substr($values, 6, 2)); $e=hexdec(substr($values, 8, 2)); $f=hexdec(substr($values, 10, 2)); echo $a^$b^$c^$d^$e^$f;
  5. if (phpversion() >= 5) { echo '<table>', PHP_EOL; foreach (simplexml_load_string($xml) as $key => $value) { echo '<tr><td>', $key, '</td><td>', $value, '</td></tr>', PHP_EOL; } echo '</table>', PHP_EOL; }
  6. __FILE__ - The full path and filename of the file. If used inside an include, the name of the included file is returned. dirname - Given a string containing a path to a file, this function will return the name of the directory.
  7. Nope. (int) 'STRING' = 0; (bool) 'STRING' = TRUE;
  8. URL file-access is disabled in the server configuration http://google.com/search?q=allow_url_fopen
  9. function ob_callback($buffer) { ob_start(); // Fatal error: ob_start(): Cannot use output buffering in output buffering display handlers } ob_start('ob_callback'); ob_end_flush(); function _flush() { $buffer = ob_get_clean(); ob_start(); require 'foo.php'; echo $buffer . ob_get_clean(); flush(); } ob_start(); echo date('r'); _flush();
  10. http://php.net/array_count_values $a = array('a','b','c','a','a','c','d'); $b = array_count_values($a); echo $b['a']; // number of a's print_r($b);
  11. function ob_callback($buffer) { $buffer; // holds buffer } ob_start('ob_callback'); // ... ob_end_flush();
  12. http://php.net/manual/en/language.types.string.php#language.types.string.syntax.heredoc The closing identifier must begin in the first column of the line. Remove the spaces infront of "EOD;".
  13. http://en.wikipedia.org/wiki/List_of_ISO_639-1_codes
  14. There's probably nothing wrong with your code, failed to open stream: Permission denied Change the permissions on the file. http://www.dartmouth.edu/~rc/help/faq/permissions.html http://en.wikipedia.org/wiki/Chmod
  15. You have no method called db_limiter(), you have a variable called $db_limiter and a method called page_limit_db() that returns $db_limiter. // using the variable, removed trailing parenthesis. while ($row_info = mysql_fetch_assoc($paging_system->db_limiter)){ // using the page_limit_db() method while ($row_info = mysql_fetch_assoc($paging_system->page_limit_db())){
  16. You overwrite $row in your second while() loop. The second while() loop doesn't print anything, it just loops over the result rows and assigns variables until there are no more results. If you want to print all results you'll need to do so inside the loop.
  17. <input type="text" value="<?php echo htmlentities($string_in_database, ENT_QUOTES); ?>" />
  18. "Content-Length: " . strlen($some_string);
  19. The double comma is the Scope Resolution Operator, in this case it's probably used to call the static method "getInstance" in the "Person" class. This method probably returns an object (instance of the class "Person"). The single arrow (->) is the standard object "operator", $person->getChildFamilies() calls the "getChildFamilies()" method in the $person object/instance of the class "Person". http://php.net/manual/en/language.oop.php http://php.net/manual/en/language.oop5.php
  20. When you follow a link from the starting point, you're at a depth of 1. Every subsequent link you follow in that "thread" will increase the current depth. Set a limit for how deep the crawler is allowed to go.
  21. When using mysql_num_rows(), you're never actually fetching the result data. if (mysql_num_rows($techMatch) > 0) # found existing tech { $techMatch = mysql_fetch_assoc($techMatch); //added $tNum = $techMatch['t_num']; }
  22. My default/standard/unmodified Apache 2.x install is about 32 megabytes in size.
  23. When $display['p'] is empty, you set $f to some html for an empty cell. When it is not empty, you set $file to a cell containing $display['p']. Finally you print neither $f nor $file, but $display['f'].
×
×
  • 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.