Jump to content

Jabop

Members
  • Posts

    452
  • Joined

  • Last visited

    Never

About Jabop

  • Birthday 11/25/1987

Profile Information

  • Gender
    Male
  • Location
    San Francisco

Jabop's Achievements

Member

Member (2/5)

0

Reputation

  1. Oni-kun, if allow_url_fopen was not set to true, it would have thrown another error message explicitly stating such. I found out why it wasn't working. Some sites are finicky when it comes to user agents, so I set this at the beginning of my script: <?php ini_set('user_agent', 'Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.0.16) Gecko/2009121601 Ubuntu/9.04 (jaunty) Firefox/3.0.16'); ?>
  2. Code: <?php // www.digg.com print_r(get_headers('http://www.digg.com', 1)); // digg.com print_r(get_headers('http://digg.com', 1)); ?> Response: Warning: get_headers(http://www.digg.com) [function.get-headers]: failed to open stream: HTTP request failed! in /home/jacob/workspace/tester.php on line 3 Warning: get_headers(http://www.digg.com) [function.get-headers]: failed to open stream: HTTP request failed! in /home/jacob/workspace/tester.php on line 6 Any idea why this isn't working?
  3. <?php $link=mysqli_connect(SERVER, USERNAME, PASSWORD, DB, '3306'); $res=mysqli_query($link, "SELECT name FROM products_wrappers WHERE name LIKE 'ProductName% Pro Complete"); while($result=mysqli_fetch_array($res)) { echo $result[0]; } echo '<br />'; $res=mysql_query("SELECT name FROM products_wrappers WHERE name LIKE 'ProductName% Pro Complete'"); while($result=mysql_fetch_array($res)) { echo $result[0]; } ?> This code returns: ProductName� Pro Complete ProductName™ Pro Complete Why does mysqli return an invalid character, while mysql returns the valid ™ (trademark) character?
  4. <?php $string='asdfasdfasdfasdfadfasdfasdfadfadfadfasdfadfadfasdfadfadfsdfsdfsdfafasdsdfsdfsdfsdfdf'; if (strlen($string)>130) { echo substr($string, 0, 130) . ' read more omg click here'; } else { echo $string; } ?>
  5. u culd do $_SESSION['temporary_variable'] = $_SESSION['take']; $_SESSION['take'] = $_SESSION['temporary_variable'] + 2; $_SESSION['take'] = $_SESSION['take'] - 1; pretty easy noob
  6. eMonk <?php $array=shuffle($array); foreach($array as $key=>$value) { echo $value; } ?>
  7. That wouldn't work for what you need - hold on.
  8. You'd start like this. <?php $Username=mysqli_real_escape_string($_GET['user']); $Query=mysqli_query("SELECT * FROM users WHERE Username='$Username' LIMIT 1"); // blah ?>
  9. Check my code again, I edited it. Make sure you're passing the right file.
  10. Right click the page, click 'View Source,' and copy the text. Paste that into your document and there you go.
  11. <?php $image_list = file_get_contents('file.txt'); $image_list = explode("\n", $image_list); echo $image_list[mt_rand(0, count($image_list))]; ?>
  12. Read: http://www.phpfreaks.com/forums/index.php/topic,37442.0.html
×
×
  • 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.