Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

In this Discussion

populate array from text.txt and add contents to ajax.functions.js file

edited April 2010 in How do I?
Here is my problem. I need to populate an array in PHP from a file server side. Then I need to add lines from that array to the ajax.functions.js file so that I can display the lines about the image as an overlay. Here is the basic script I was thinking of using for reading the text.txt file into an array in PHP.

As you can see at the prototype gallery @ what I really need is the ability to add the correct verbiage from text.txt to lines 1071 and 1091 of the ajax.functions.js file.

Thanks for your help!


  • After consulting I discovered a much easier way of doing this.

    Because the gallery software uses AJAX, all I have to do is request a file from the server using AJAX and post the results in the JS file CLIENT SIDE. The page doesn't even need to be refreshed!!

    So, problem solved.

    1) load normal gallery
    2) user clicks on image
    3) AJAX requests data from a PHP file that returns my data in xmlhttp.responseText
    4) Because the data is requested via the server asynchronously I don't have to wait for the info to be returned before I get to view my image. Yay!
Sign In or Register to comment.