Jump to content

hitman6003

Members
  • Posts

    1,807
  • Joined

  • Last visited

Everything posted by hitman6003

  1. use the file command then a for loop: http://www.php.net/file $file = file($filename); for ($i = 1; $i < count($file); $i++) { echo $file[$i]; }
  2. Generally speaking, the values that were registered came from the $_POST and $_GET super globals. I'm assuming that you have a $_POST or $_GET array element with the key "adminpass", along with the other variables. You can recreate the effect using extract (http://www.php.net/extract): extract($_POST); Or you can simply set the values equal to the variable name: $adminpass = $_POST['adminpass']
  3. You probably won't find those two "functions" in one package unless you go with a CMS...joomla, mambo, drupal, etc. You'll also probably get better quality for each one if you use a "standalone" package, where the developers are focused on one type of system, rather than two or more. For blogs, there are many...wordpress, moveabletype (I think is php, maybe perl), bblog, serendipity. For forums, SMF (which runs phpfreaks' forums), phpbb, many others.
  4. are you sure that your snmpwalk function is returning the results you are expecting? use print_r to view the contents of the array: echo '<pre>' . print_r($detection, true) . '</pre>'; if it is an array, then use some normalization on the data returned to make sure it's matching your string: if (in_array("firefox.exe",strtolower(trim($val)))) { echo "firefox is opened"; } else if (in_array("iexplore.exe",strtolower(trim($val)))) { echo "Internet Explorer is opened"; }
  5. It tells you the error: headers already sent by (output started at /redirect.php:11)
  6. sort or natsort or natcasesort or rsort or asort or arsort http://www.php.net/sort
  7. There's a decent article here: http://devzone.zend.com/node/view/id/1265
  8. don't put your "Location...." in single quotes, use double... <?php header("Location: http://www.{$_GET['SITENAME']}.com"); ?> Look at the difference in how the code get's syntax hilighted...the "SITENAME" is intrepreted as a misplaced string in your example because you are using single quotes around the whole string. Doing so causes an extra operation for the processor as it checks to see if there is a constant named SITENAME before trying with the string "SITENAME". It's better practice to use quotes around your array keys. My preferred method is the same as phpsensei.
  9. use preg_match: //not tested: if (preg_match('/\$result=mkdir\((.*?)\).*/i', file_get_contents(plmNewAcctData.php), $matches)) { print_r($matches); }
  10. Not sure about the exact syntax for using the xml parser, but you can just put the titles into an array: foreach($parser->document->screenshot as $screenshots){ $images = $screenshots->filename[0]->tagData; if (!in_array($screenshots->game[0]->tagData, $game_titles)) { $game_titles[] = $screenshots->game[0]->tagData; } } array_map(create_function('$g_t', 'echo "Title: $g_t\n"'), $game_titles);
  11. MySQL is fast for small implementations with the default configuration. If you know how to tune the database, which isn't all that difficult and there is a ton of information on the internet, then you can make MySQL very fast for nearly any implementation...including a transactional environment. The key is knowing which engine to use for what. MyISAM is better for read heavy environments...this is because it uses a table level lock system. InnoDB is better at write heavy tasks...it uses a row level lock mechanism. If you need ACID compliance, then InnoDB is your only choice. There are a lot of other differences between the storage engines, however MySQL is not nearly as complicated as Oracle. That's because MyISAM isn't a transactional database engine. InnoDB, and in version 6 Falcon, are MySQL's ACID safe engines.
  12. Make sure error reporting is set high enough and display errors is turned on: Insert the following at the top of your script (above the include). ini_set("display_errors", 1); error_reporting(E_ALL); ini_set("display_startup_errors", 1);
  13. mapped drives are user specific. The webserver, and consequentially php, run under a different username (IUSER_servername). Therefor, the mapped drives that you have, are not available to php. Use something like the following to access that server: copy('./source_file.txt', '\\255.255.255.255\c$\uploaded_files\source_file.txt'); Note the two backslashes before the server IP (or server name). I used c$, but you can use any shared folder.
  14. It tells you what the problem is. is "ROOT" defined as a constant somewhere?
  15. The manual has some pretty good examples. I would look there. Try for yourself...it's not difficult. If you do have any problems, post your code here, and we'll help. http://us3.php.net/manual/en/features.file-upload.php
  16. You need a directory separator for your "ROOT" constant and the file name: change: require ROOT.'config.php'; to require ROOT.'/config.php';
  17. That doesn't check the file content, which makes it easier to rename a script to "whatever.jpg", and then execute it remotely. If the content type returns as something you don't want, you simply don't save the file.
  18. You need to escape the single quotes in your mysql query...use mysql_real_escape_string $new_link = mysql_real_escape_string("<a href='game.php?title={$title}'>{$title}</a>"); http://www.php.net/mysql_real_escape_string
  19. Use fileinfo. http://www.php.net/fileinfo Or the depreciated, mime_content_type. http://www.php.net/mime_content_type
  20. you have to escape double quotes inside of double quotes: echo "... <a href=\"./guestbook.php\" ..."; Or wrap the whole thing in single quotes rather than double: echo '<center> Your comment has been added to the system. Congratulations!<br> Click <a href="./guestbook.php">HERE</a> to return to the Guestbook.';
  21. <?=$variable ?> Is a valid "shortcut" for using <?php echo $variable; ?> See here: http://us.php.net/manual/en/language.basic-syntax.php, example 2.
  22. Don't use single quotes...using single quotes php won't place the variable's value in it's place. For example: $var1 = 'abc'; $var2 = 'def'; echo 'var1 is $var1 and var2 is $var2'; //you get "var1 is $var1 and var2 is $var2" echo "var1 is $var1 and var2 is $var2"; //you get "var1 is abc and var2 is def" And, what thorpe said...( beat me to it )
  23. Not really clear on what your asking for, but this may help: http://www.php.net/oop5 http://www.php.net/oop5.static
×
×
  • 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.