Follow us on Twitter!
Few are those who can see with their own eyes and hear with their own hearts. - Albert Einstein
Wednesday, April 23, 2014
Navigation
Home
HellBoundHackers Main:
HellBoundHackers Find:
HellBoundHackers Information:
Learn
Communicate
Submit
Shop
Challenges
HellBoundHackers Exploit:
HellBoundHackers Programming:
HellBoundHackers Think:
HellBoundHackers Track:
HellBoundHackers Patch:
HellBoundHackers Other:
HellBoundHackers Need Help?
Other
Members Online
Total Online: 16
Guests Online: 16
Members Online: 0

Registered Members: 82876
Newest Member: bhl1986
Latest Articles
View Thread

HellBound Hackers | Computer General | Programming

Author

Help with php script!


Member

Your avatar

Posts:
Location:
Joined: 01.01.70
Rank:
Guest
Posted on 06-09-06 23:11
im trying to code a script that will load some url adresses from a file, all these adresses are index's, then open the url and read all the files and print the name, this is embadded in a webpage with content, but all it does is load a blank page with no wrrors...

Code
<?php
  $file = fopen("/warez/music/links.txt", "r");
  while(!feof($file))
  {
    $url = fgets($file);
    $dir = fopen($url);
 
    while (($track = readdir($dir)) !== false)
    {
      echo "Track: " . $track . "<br />";
    }
    fclose($dir);
  }
  fclose($file);
?>




thaks for any help




Edited by on 06-09-06 23:20
Author

RE: Help with php script!


Member

Your avatar

Posts:
Location:
Joined: 01.01.70
Rank:
Guest
Posted on 06-09-06 23:49
i will give you some help tomorrow hopefully (Y)


Author

RE: Help with php script!


Member

Your avatar

Posts:
Location:
Joined: 01.01.70
Rank:
Guest
Posted on 06-09-06 23:57
keiran420 wrote:
im trying to code a script that will load some url adresses from a file, all these adresses are index's, then open the url and read all the files and print the name, this is embadded in a webpage with content, but all it does is load a blank page with no wrrors...

Code
<?php
  $file = fopen("/warez/music/links.txt", "r");
  while(!feof($file))
  {
    $url = fgets($file);
    $dir = fopen($url);
 
    while (($track = readdir($dir)) !== false)
    {
      echo "Track: " . $track . "<br />";
    }
    fclose($dir);
  }
  fclose($file);
?>




thaks for any help


ok try this.. it might work might not.

<?php
$file = fopen("/warez/music/links.txt", "r");
while(!feof($file))
{
$url = fgets($file);
$dir = fopen($url);
$track = readdir($dir);
while ($track !== false)
{
echo "Track: " . $track . "<br />";
}
fclose($dir);
}
fclose($file);
?>


Author

RE: Help with php script!


Member

Your avatar

Posts:
Location:
Joined: 01.01.70
Rank:
Guest
Posted on 07-09-06 00:25
I think it's because of line 6. With fopen you always need 2 parameter on the line you miss the way you want to open the file ...

http://ca3.php.net/manual/en/function.fopen.php

Also when your developping script always set error_reporting at E_ALL so that you see all the error that happen ...

http://ca3.php.net/manual/en/function.error-reporting.php


Author

RE: Help with php script!


Member

Your avatar

Posts:
Location:
Joined: 01.01.70
Rank:
Guest
Posted on 07-09-06 01:35
oh yes Arto is right, you would want to have:

fopen($url, "r"Wink;

that should be the only error.


Author

RE: Help with php script!


Member

Your avatar

Posts:
Location:
Joined: 01.01.70
Rank:
Guest
Posted on 07-09-06 11:44
Cheers, but it looks like my code is crappyer yet...

i keep getting this now:
The connection was reset

and here is the code up to the first 2 lines of one of the directorys im trying to links tracks from
Code
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<html>
 <head>
  <title>Index of /mp3</title>
 </head>
 <body>
<h1>Index of /mp3</h1>
<pre><img src="/icons/blank.gif" alt="Icon "> <a href="?C=N;O=D">Name</a>                    <a href="?C=M;O=A">Last modified</a>      <a href="?C=S;O=A">Size</a>  <a href="?C=D;O=A">Description</a><hr><img src="/icons/back.gif" alt="[DIR]"> <a href="/">Parent Directory</a>                             -   

<img src="/icons/sound2.gif" alt="[SND]"> <a href="764hero_impossible-waste.mp3">764hero_impossible-w..></a> 23-Mar-2004 13:10  3.5M 
<img src="/icons/sound2.gif" alt="[SND]"> <a href="764hero_loaded-painted-red.mp3">764hero_loaded-paint..></a> 23-Mar-2004 13:10  5.6M




will i have to edit my code to filter all the crap away? i dunno

thanks for the help though :)


Author

RE: Help with php script!


Member

Your avatar

Posts:
Location:
Joined: 01.01.70
Rank:
Guest
Posted on 20-09-06 18:39
just use this code
Code

<?php
$pages="warez/music/links.txt";
$list = file ($pages);
foreach ($list as $track) {
 echo "Track: " .$track ."<br />";
}
?>








Edited by on 20-09-06 18:40
Author

RE: Help with php script!


Member

Your avatar

Posts:
Location:
Joined: 01.01.70
Rank:
Guest
Posted on 20-09-06 21:37
adlez wrote:
just use this code
Code

<?php
$pages="warez/music/links.txt";
$list = file ($pages);
foreach ($list as $track) {
 echo "Track: " .$track ."<br />";
}
?>





Also you can use this which is like.....

Code

<?php
$pages="warez/music/links.txt";
$list = file ($pages);
foreach ($list as $track) {
 echo "Track: {.$track} <br />";
}
?>





its easier to understand and include the variable, some like some dont