SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Member djrob's Avatar
    Join Date
    Sep 2000
    Location
    Melbourne
    Posts
    10
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I am trying to set up periodic updating of a database-generated html page using SQL and PHP ( See your tutorial 10 on PHP and SQL - lesson 5)
    Unfortunately, although 'generateindex.php' runs OK, the HTML page at the end does not contain the data from the database, and instead prints out some of the PHP code - Any ideas ???
    ( My server is using PHP3 )

  2. #2
    Serial Publisher silver trophy aspen's Avatar
    Join Date
    Aug 1999
    Location
    East Lansing, MI USA
    Posts
    12,939
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    an html page will never parse any php code inside it.

    So, if you have php code inside an html page then that will be sent to the browser, if you want it processed as php you need to name it .php not .html

    Whats probably happening is your php generating page is generating some html along with some php (even though it runs fine) and that is what is causing you some problems.

    Chris

  3. #3
    SitePoint Member djrob's Avatar
    Join Date
    Sep 2000
    Location
    Melbourne
    Posts
    10
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Sorry if I did not make myself clear the first time.
    'Generate.php' was a browser-called page that generated the html page dynamically from another dynamic php page.
    What was happening was that I was not calling the 'parent' php page as a URL address, and thus (I think!) the server was not interpreting the php before creating the html 'daughter' page.
    I have that fixed now - thanks.

  4. #4
    SitePoint Wizard edshuck's Avatar
    Join Date
    Jul 2000
    Posts
    1,198
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    hi

    since some of the code is coming out on the browser, i would, in my unscientific manner, put in a few signposts in the form of

    echo("1");

    and step the number 2, 3, 4, etc.

    and identify exactly where the php code is coming from and look very closely at that area. ie. if they are between 3 and 4 on your page.

    you have a problem right there. it is probably something simple.

    this may not make the code do what you want but it will clean up the extra output.

    peace ed

    oh, don;t forget to scrub the 1,2,3 etc.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •