File open causes timeout when php script is called by ajax with jquery -


i'm writing code imageboard , users going able post textfiles load pages in css layer. have simple php script takes filename , parameters(for start of line , lines per page) through get, opens file passed, , displays section of file html:

http://pastebay.com/115710

i can confirm script works calling in browser , setting string in url.

i'm calling script ajax using jquery, binding function links textfiles in page that, when links clicked on, layer opens , (what want happen is) html returned php file dumped layer:

http://pastebay.com/115711

when use same ajax call using textfile call successful , can load contents of textfile layer.

when call php file ajax, following response when php file never opens textfile passed:

blockquote warning: file(http://localhost/kusabax/lit/src/nrd.txt) [function.file]: failed open stream: connection attempt failed because connected party did not respond after period of time, or established connection failed because connected host has failed respond. in c:\xampp\xampplite\htdocs\kusabax\textview.php on line 6 fatal error: maximum execution time of 60 seconds exceeded in c:\xampp\xampplite\htdocs\kusabax\textview.php on line 6

whatever problem is, it's trying open textfile - if use fopen() or file() result same, , without line script runs (except without, obviously, useful results.)

i should mention tried writing iframe #prevwin layer , having php script load iframe, , writing attributes src string (not using ajax @ all) - still got same timeout.

i think solved it.

having filename sent php script absolute url problem. edited javascript change url string relative url splitting href string , taking current folder , filename , building new url:

s = this.href; = s.split("/"); board = a[4]; src = a[a.length-1]; relhref="./"+board+"/src/"+src;  

and passing relhref ajax function.


Comments

Popular posts from this blog

c# - How to set Z index when using WPF DrawingContext? -

razor - Is this a bug in WebMatrix PageData? -

android - layout with fragment and framelayout replaced by another fragment and framelayout -