Jump to content

ManiacDan

Staff Alumni
  • Posts

    2,604
  • Joined

  • Last visited

  • Days Won

    10

Everything posted by ManiacDan

  1. You're not doing any error-handling on these queries. Use mysql_error to view an error if the result of mysql_query is false. Also, you spelled address wrong in $duplicate, that's the actual problem.
  2. $query = mysql_query("SELECT * FROM product WHERE productMenu=" . mysql_real_escape_string((int)$id) . " LIMIT {$start}, {$perpage}")or die(mysql_error());
  3. I assume you mean: echo '<div id="css">' . $AB_LANGS['CalendarInstructions'] . '</div>'; The manual chapter you're looking for was String Operations
  4. include files should not really be done like this. include files should contain functionality that your page needs, like a database class or a function that generates the emails. If you start making include files that indiscriminately spit data out to the user's screen, you run into...this exact issue.
  5. What, exactly, does another.php do? Does it render an entire web page? If that's the case, you may be able to do something like: ob_start(); include('another.php'); $message = ob_get_clean();
  6. When you include a PHP file, it has the exact same effect as copying and pasting that PHP file directly into your code. You cannot include a file in the middle of a line like you're trying to do. What does the email generation file do? You should wrap it in a function which returns a string, then simply include the file at the top of your script, and call the function when you need it.
  7. Definite SQL Injection possibility. Use this as your username and password: admin' OR 1=1;# You get "invalid password." Use this: admin" OR 1=1;# And you get "that user does not exist". Replace "admin" with your username, see if you get logged in. Also, a bare login form with no user information or website isn't the best measure of security.
  8. And now for the second and third things I said.
  9. Your browser is hiding the XML, you need to view source to see it.
  10. Define "not working." View the source, find the error.
  11. The PHP script is not in this folder, is it? You're running a find command (incorrectly, still) inside a folder, and it's only working because `find` will return all the files in the current folder if you use it wrong. Since the PHP file is NOT in this folder, when it tries to run `find` it will behave wrong.
  12. You ran this command on the command line? find MEMNPWOHX* -type f -exec grep "HEAT ADVISORY IS IN EFFECT" /dev/null {} \; And that command produced the list in your last post? That command is not correctly formatted. Also, you absolutely must run these strings through escapeshellarg (which automatically quotes them for you).
  13. Ok...what's the problem then? You originally came on here to post a completely unnecessary loop. Remove the loop, is the problem still a problem?
  14. Ok, one more time: If you're trying to make $x into an array of all the $rdrs records, $rdrs is already that array, why are you trying to make two copies of it?
  15. That's lovely. There was a question back there.
  16. PHP variables aren't interpolated inside single quotes, you have to concatenate them. You should also run them through shell_escape. Also, remember that $pil is in the wrong format, you need <location> and <pattern> out of that.
  17. The character set of the upload form, database, and display page all have to be the same, and they all have to support the stupid microsoft characters. Everything should be UTF-8. You may also need to use the mb_string functions if you're doing string manipulations prior to insert.
  18. rdrs is already an array of all the records, what are you even trying to accomplish with the $x variable? Also, to append to an array you use $arrayName[] = $whatever.
  19. This is exactly the point of my previous post. I asked you to tell me what you wanted, and you said "I want only the DEF." That's what you got. This code matches your original output: <?php $file = 'L 02/10/2012 - 15:50:56: Log file started (file "cstrike\addons\amxmodx\logs\ban_history.log") (game "cstrike") (amx "1.8.1.3746") L 02/10/2012 - 15:03:38: ABC <STEAM_ID_LAN> banned User1 <284.121.146.100> || Reason: "Reason 1" || Ban Length: 1 minute L 02/10/2012 - 15:17:24: Ban time is up for: User1 [284.121.146.100] L 02/10/2012 - 15:17:39: DEF <STEAM_ID_LAN> banned User2 <234.151.143.110> || Reason: "Reason 2" || Ban Length: 1 minute L 02/10/2012 - 15:18:39: Ban time is up for: User2 [234.151.143.110]'; preg_match_all('/(\w+)\s*<STEAM_ID_LAN>\s*banned\s*(.+?) \|\| Reason: "([^"]+)" \|\| Ban Length: (.+)/m', $file, $foo); echo '<pre>'; foreach ( $foo[1] as $k => $v ) { echo "{$v} - {$foo[2][$k]} - {$foo[3][$k]} - {$foo[4][$k]}\n"; } echo "</pre>';
  20. Oh, you're not using find properly. Find takes two arguments: find <where to look> <what to look for> You're looking for something more like: find /sync/www/html/ohx/products/ -name MEMNPWOHX*
  21. This is working for me: $output = shell_exec('find ~/Desktop/ -type f -exec grep "secure" /dev/null {} \;'); You should be able to simply copy and paste your command from inside shell_exec directly into a command line, and vice versa. Does it work if you try it directly?
  22. This is already PHP code. What's the problem?
  23. With this code, $foo[1] will be an array of the items you said you wanted: $file = 'L 02/10/2012 - 15:50:56: Log file started (file "cstrike\addons\amxmodx\logs\ban_history.log") (game "cstrike") (amx "1.8.1.3746") L 02/10/2012 - 15:03:38: ABC <STEAM_ID_LAN> banned User1 <284.121.146.100> || Reason: "Reason 1" || Ban Length: 1 minute L 02/10/2012 - 15:17:24: Ban time is up for: User1 [284.121.146.100] L 02/10/2012 - 15:17:39: DEF <STEAM_ID_LAN> banned User2 <234.151.143.110> || Reason: "Reason 2" || Ban Length: 1 minute L 02/10/2012 - 15:18:39: Ban time is up for: User2 [234.151.143.110]'; preg_match_all('/(\w+)\s*<STEAM_ID_LAN>\s*banned/', $file, $foo); echo "Banned: " . implode(", ", $foo[1]); //Banned: ABC, DEF Use file_get_contents to get a file off the hard drive into the $file variable -Dan
  24. Well...what's unique about that line? Regex is a difficult language, but it's not impossible. However, we're not going to write you something so you can come back and say "I tried that, and it pulled the lines I wanted, but also these 17 other kinds of lines that I don't want but never told you about." Tell us what's unique about that line, and you can have a regex that will match it
  25. If it's mysql, just use mysqldump.
×
×
  • 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.