Connecting Tech Pros Worldwide Help | Site Map

Can somone tell me how to mek this script?

  #1  
Old July 17th, 2005, 11:49 AM
adrianTNT
Guest
 
Posts: n/a
Hello, I am very new to php, I need a script, is probably simple for
the ones that know a bit of php:

I need the script to read links from a web page and return them as
variable names, for example to tell it to read file
http://www.adriantnt.com and the script returns (by "echo" i suppose)
variables like:

l1=http://www.adriantnt.com/news.html
l2=http://www.adriantnt.com/contact.html
l3=http://www.adriantnt.com/products.html

Can somone please tell me how this has to be made ?

Thank you.
-Adrian.

  #2  
Old July 17th, 2005, 11:49 AM
Tim Van Wassenhove
Guest
 
Posts: n/a

re: Can somone tell me how to mek this script?


On 2005-01-20, adrianTNT <adriantnt@adriantnt.com> wrote:[color=blue]
> Hello, I am very new to php, I need a script, is probably simple for
> the ones that know a bit of php:
>
> I need the script to read links from a web page and return them as
> variable names, for example to tell it to read file
> http://www.adriantnt.com and the script returns (by "echo" i suppose)
> variables like:
>
> l1=http://www.adriantnt.com/news.html
> l2=http://www.adriantnt.com/contact.html
> l3=http://www.adriantnt.com/products.html
>
> Can somone please tell me how this has to be made ?[/color]


So you got to lookup
- get file contents -> http://www.php.net/file_get_contents
- find all the a tags -> http://www.php.net/preg_match
- output the found href -> http://www.php.net/echo


--
Met vriendelijke groeten,
Tim Van Wassenhove <http://www.timvw.info>
Closed Thread