[web] Can any one mod this?

Started by
15 comments, last by Sander 17 years, 8 months ago
can any one mod this so it says the files header not the files name its self?

<?php 
   foreach( glob("*") as $f )
      echo "<ol><p><a href=\"$f\">$f</a></p>";
?>;

Edit by Fruny: added source block. [Edited by - Fruny on August 13, 2006 12:35:17 AM]
Advertisement
Quote:Original post by lordcorm
can any one mod this so it says the files header not the files name its self?
"<?php foreach(glob("*")as$f)echo"

    $f

    ";?>;"


Um, what?? O.o

Edit: The shock value is over. Your code doesn't look complete. What are you trying to accomplish? The above code needs to be expanded or your example needs to be more fulfilling in order to know what the heck you're doing. :)
what i need is a scripts that shows when i put a new file into a folder it shows the files header title not the files title and in order.
Thank you!
Next time try and use or [ source ] blocks...<br><br><pre><br>Here is some code!<br></pre><br><br><!--STARTSCRIPT--><!--source lang="cpp"--><div class="source"><pre><br>Here is some source!<br><br></pre></div><!--ENDSCRIPT-->
Quote:what i need is a scripts that shows when i put a new file into a folder it shows the files header title not the files title and in order.
Thank you!


What version of PHP are you using? What do you mean by file header title? The file name? The file type?

Sorting the order of the files can easily be done when you have built an array of the files in question; it's matter of knowing exactly what you need. Sorry, I just don't know what file header title is.
This is what i meen:
<head><title>Dark Legion</title></head>
So it says the Dark Legion and not the file name darklegion.html and i dont know what version of php it uses but sure it the latest.
Quote:This is what i meen:
<head><title>Dark Legion</title></head>
So it says the Dark Legion and not the file name darklegion.html and i dont know what version of php it uses but sure it the latest.


You have to close the code bracket like you close HTML tags (minus the space).

You want to read only HTML files and grab the contents between <title></title>?

To find out your PHP version:
<?phpphpinfo();?>
yes i want it to only grab the name in between the
<title>...</title>
command and make it show a link to it so i can make a thang on my home page that shows the new updated files.
Also make sure that it shows it in numbers 1,2,3,4,etc.......

A really lousy way of doing it would be to open the file as a text-file and search for <title> then read until </title> and put it in a variable. Search for reading files with PHP, it isn't too hard to do.
thats very very time consuming and php would be better to use!

This topic is closed to new replies.

Advertisement