/    Sign up×
Community /Pin to ProfileBookmark

Get links from a file and open them in the browser.

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):

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

to post a comment
PHP

8 Comments(s)

Copy linkTweet thisAlerts:
@mrhooMay 03.2007 — It is possible, but it's a lot simpler with php.
Copy linkTweet thisAlerts:
@LethalityauthorMay 03.2007 — It is possible, but it's a lot simpler with php.[/QUOTE]

Could you show me how? ?
Copy linkTweet thisAlerts:
@LeeUMay 03.2007 — I'll move this to the PHP forum and you can continue it there.
Copy linkTweet thisAlerts:
@LethalityauthorMay 03.2007 — I'll move this to the PHP forum and you can continue it there.[/QUOTE]

Thank you ?.

Are there anyone able to give me any hints on what to do then?
Copy linkTweet thisAlerts:
@LethalityauthorMay 04.2007 — Anyone?
Copy linkTweet thisAlerts:
@bokehMay 04.2007 — 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.
Copy linkTweet thisAlerts:
@LethalityauthorMay 04.2007 — 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 ?
Copy linkTweet thisAlerts:
@bokehMay 04.2007 — use fopen to open the logfile. A while loop and fgets to read it line by line. preg_match to extract the referers.
×

Success!

Help @Lethality spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 6.17,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @nearjob,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,
)...