Jump to content

xt3mp0r~

Members
  • Posts

    21
  • Joined

  • Last visited

    Never

About xt3mp0r~

  • Birthday 11/03/1990

Profile Information

  • Gender
    Male

xt3mp0r~'s Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. All values should be '1' to pass the if condition.. combination of count and array_unique worked great. Thank a lot.
  2. Is there any simple way to check if all values in an array are same with an simple if condition Something like if( ...some code...) { //yes, all values are same } else { //nope, all are not same } my PHP Version is 5.2.9-2 Any help would be appreciated. Basically, i want to check if values in an array are equals to 1.
  3. I just used preg_match along with an if condition to Perform a regular expression match. That nifty string within preg_match is the regex. Google for more.
  4. <?php $url = "http://www.test.com/hello.png"; if(preg_match("/^https?:\/\/(?:[a-z\-]+\.)+[a-z]{2,6}(?:\/[^\/#?]+)+\.(?:jpg|gif|png)$/",$url)) echo "Valid"; else echo "invalid"; ?>
  5. Maybe, try removing the DESC from the query. I'm not sure though.
  6. <?php $html = file_get_contents('http://siteurl.com'); preg_match_all("/member.php\?u=(.*?)'/",$html,$idz); print_r($idz[1]); ?> Alright, i just checked it myself. This should work now.
  7. <?php $html = file_get_contents('http://siteurl.com'); preg_match_all('/member.php?u=(.*?)\'/', $html, $idz); print_r($idz); ?> Try this, if it works.
  8. That probably means the SQL query you are using with mysql_query in below code isn't returning a valid MYSQL resource. $CheckLogin = mysql_query("SELECT * FROM Clients WHERE Username = '".$ClientUsername."' AND Password = '".$ClientPassword."'"); Check the query, and see if those variables used in the query are set before using them.
  9. Thanks for pointing that, ignace. Still quite new to php. I recommend your code.
  10. Adding below code in your script would never show any php errors to your users. Add it to your code when you are done debugging it. error_reporting(0);
  11. copy("http://site.com/example.pdf","example.pdf");
  12. 1. Make sure you validate inputs. 2. If you are dealing with databases, always use mysql_real_escape_string() function. This function properly scrubs your input so it doesn't include invalid characters. 3. Hide your php errors. 4. Make sure to md5 passwords or any vital information.. if you store it into db. 5. Use captcha, it prevents spammers. That's what came into my mind right now. Hope it helps you You can always google, there's a lot to study.
  13. Assuming you saved output from nmap to nmap.txt .. you can use below code to get the ip into $ip variable and then store it in mysql db, if you want. <?php $lines = file('nmap.txt'); foreach($lines as $line) { if(strpos($line,"Up") !== false) { preg_match('/Host: (.*?) ()/',$line,$ip); $ip = $ip[1]; echo $ip; } } ?>
  14. Easiest way would be to add following code at beginning of your code. set_time_limit(0);
  15. The error probably means that root has a password, but you are not supplying it, hence the (Using password: NO) :-)
×
×
  • 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.