Jump to content

Need Help ):


dragonsmistress

Recommended Posts

I'm having trouble with a script for my site.

I'm trying to pull a user's dragons from their scroll on the dragcave.net website.

But I want to specifically display either just the eggs or just the hatchlings. Let me know if I need to provide more info. Here is my script:

 

<?php
   $scrollname = $_POST['scrollname'];
   if (isset($_POST['submit'])) {
}
   $string = file_get_contents('http://dragcave.net/user/' . $scrollname);
   // Path builders for the regular expression and the HTML that follows
   $path = '/image/';
   $ext = '.gif';

   $pattern = "#$path(.*?)$ext(.*?)#";
   preg_match_all($pattern, $string, $matches);
   $list = $matches[1];
   $limit = count($list);
   for ($i = 0; $i < $limit; $i++) {
         echo "<img src=\"http://dragcave.net/image/$list[$i].gif\"><br />";
         echo 'Code: ' . $list[$i] . '<br>';
}
?>

Link to comment
https://forums.phpfreaks.com/topic/137869-need-help/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.