Extracting output from a PHP file to a HTML file

Posted on 2004-11-29
Last Modified: 2008-02-20

I have a PHP script that searches for a keyword within a HTML file and returns a 'colour', e.g. colour="#00CC00". Currently, I have this running from within the HTML file that I wish to return this data to. Instead, I would like to 'call' and extract data from this PHP file to the HTML file?

Question by:eveodonnell
    1 Comment

    Accepted Solution

    Technology for this is like that:
      1. An client is requesting your php file;
      2. Your php interpretor pharse the php file, which contains steps like this:
         2.1 Search for something in a specified HTML file
         2.2 Modify the HTML file (fopen, fwrite, fclose)
         2.3 Modify the header of current content page to the modified HTML file - this is tricky, don't use any output in steps above, because you won't be abble to modify header
     3. Your web server will return the modified HTML page

    Featured Post

    IT, Stop Being Called Into Every Meeting

    Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

    Join & Write a Comment

    Things That Drive Us Nuts Have you noticed the use of the reCaptcha feature at EE and other web sites?  It wants you to read and retype something that looks like this.Insanity!  It's not EE's fault - that's just the way reCaptcha works.  But it is …
    Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult to…
    The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
    The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…

    754 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    16 Experts available now in Live!

    Get 1:1 Help Now