Click to See Complete Forum and Search --> : Get links from a file and open them in the browser.


Lethality
05-03-2007, 02:29 PM
I have a logfile on the server and I want to be able to open it with a javascript, go through all the links and open them in separate tabs in the browser. Is this possible?

The links are stored as an array like this (php stored):

Array
(
[0] => http://www.randomsite.domain
[1] => www.randomsite.domain
[2] => http://randomsite.domain
)

mrhoo
05-03-2007, 02:40 PM
It is possible, but it's a lot simpler with php.

Lethality
05-03-2007, 02:43 PM
It is possible, but it's a lot simpler with php.

Could you show me how? :P

LeeU
05-03-2007, 04:44 PM
I'll move this to the PHP forum and you can continue it there.

Lethality
05-03-2007, 05:14 PM
I'll move this to the PHP forum and you can continue it there.

Thank you :).

Are there anyone able to give me any hints on what to do then?

Lethality
05-04-2007, 09:29 AM
Anyone?

bokeh
05-04-2007, 09:47 AM
It's not possible to open a file on the server with Javascript. You can do it with PHP if you have permission. Doing so though is going to put a heavy load on the server so you would probably be better off storing the the information you require in a database.

Lethality
05-04-2007, 09:57 AM
That is no problem for me right now, the server can handle it. Right now I'm just trying to figure out how to do this, be it PHP, javascript or anything else. So if anyone have any suggestions I'd be glad :)

bokeh
05-04-2007, 06:39 PM
use fopen to open the logfile. A while loop and fgets to read it line by line. preg_match to extract the referers.