SitePoint Sponsor

User Tag List

Results 1 to 6 of 6
  1. #1
    SitePoint Guru
    Join Date
    Jun 2001
    Location
    Australia
    Posts
    676
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    generating html from php pages

    I have a domain where i want to pull data from the mysql database and create a index.html file but im not sure how to do this?

    here is my code.

    PHP Code:
     
    $thetitle 
    "$articletitle";
     
    $story "<table width='100%' border='0' cellspacing='0' cellpadding='2'>
      <tr>
        <td><font size='4' face='Verdana'><b>
    $thetitle</b></font></td>
      </tr>
    </table>"
    ;
     
    // Write to html file. /www/virtual/www.domain.com/story 
    If anyone can help me that would be great.

  2. #2
    rajug.replace('Raju Gautam'); bronze trophy Raju Gautam's Avatar
    Join Date
    Oct 2006
    Location
    Kathmandu, Nepal
    Posts
    4,013
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You can use heredoc like this:
    PHP Code:
    $story = <<<EOD
    <table width="100%" border="0" cellspacing="0" cellpadding="2">
      <tr>
        <td><font size="4" face="Verdana"><b>
    $thetitle</b></font></td>
      </tr>
    </table>
    EOD; 
    Mistakes are proof that you are trying.....
    ------------------------------------------------------------------------
    PSD to HTML - SlicingArt.com | Personal Blog | ZCE - PHP 5

  3. #3
    SitePoint Guru
    Join Date
    Jun 2001
    Location
    Australia
    Posts
    676
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Rajug, i ment to right it to a specific file name, like story5.html or story643.html

    I

  4. #4
    SitePoint Guru
    Join Date
    Jun 2001
    Location
    Australia
    Posts
    676
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Rajug, i ment to right it to a specific file name, like story5.html or story643.html

    I know how to echo the file, but not upload it.

  5. #5
    SitePoint Guru
    Join Date
    Jun 2001
    Location
    Australia
    Posts
    676
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    If I wanted to use php I would, but I dont. Im trying to find a way to copy the $story information to 1 story55.html

  6. #6
    dooby dooby doo silver trophybronze trophy
    spikeZ's Avatar
    Join Date
    Aug 2004
    Location
    Manchester UK
    Posts
    13,807
    Mentioned
    158 Post(s)
    Tagged
    3 Thread(s)
    Dean, you need to look into fopen(), fwrite() and the other file handling functions.

    Read the manual pages and the user added functions, there are a few things on there that will get you started.
    Mike Swiffin - Community Team Advisor
    Only a woman can read between the lines of a one word answer.....


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
  •