pull text from a database or file with html in it

Ask a Question related to Macromedia Dynamic HTML, Design and Development.

  1. #1

    Default pull text from a database or file with html in it

    Is it possible to pull html from a database a have the page dynamically

    eg
    <h3>hello</h3>
    <p>bbbbbbbbbbbbbbbbbbbbbbb</p>

    etc

    then when this file is pulled the page is built to the style sheet

    is it possible? How should i save a file if it is?

    I want to do this for a article archive i have made with static pages but i
    want the articles to look the same but have them stored in the database.



    Regards Mark

    quiero mas Guest

  2. Similar Questions and Discussions

    1. Using SPRY to pull from database and auto rotate
      I am trying to create an effect for a client site where their current news will be 'scrolled' with page by page transitions on the home page. I am...
    2. Is it possible to pull pages of html from database?
      I have a number of articles that I have applied a css sheet to. I have close to twenty articles. Each article has a couple of pictures - headings...
    3. Town (5) - how to pull this out of database/recordset?
      Hi. Access/VBScript/ASP I have a table of records. Each record has a "town" field. Some of the records are from the same town. How do I: ...
    4. Load Text from Text file with html links?
      Try http://opensource.brajeshwar.com/downloads/dynamictextscroll/ and just change it to your liking, it have html links as far as I can remember. ...
    5. database >> html file via FSO?
      I would appreciate some help on how to convert a database table into an html file via FSO and whether more seasoned asp programmers recommned this...
  3. #2

    Default Re: pull text from a database or file with html in it

    I would recommend looking into using PHP scripts to do it. You can store it as
    a text field. You should have no issues with the tags < and > , but the
    closing slash may require some special work. check out the forums and
    information on [url]http://php.net[/url]

    don Carlos Guest

  4. #3

    Default Re: pull text from a database or file with html in it

    Just store the content as text files (say, with .inc extensions), and then you
    can load them into the page based on the $_GET superglobal array.

    For example, you link to:

    index.php?page=about

    Then use somthing like what I attached to include the content. You may not be
    able to include just using the include function, as I can't remember how that
    works on plain text content, but it should just dump the content where you call
    it. If it doesn't work, just take a look at the file() function. It's really
    easy to use. Also keep in mind that there are security flaws in the above code,
    so you need to perform some validation on the provided include name to prevent
    people from including whatever they want.



    <?php

    if(array_key_exists('page', $_GET))
    {
    if(!@include('./content/'.$_GET['page'].'.php'))
    { die 'Content file ' . $_GET['page'] . '.inc not found.'; }
    }
    else
    {
    @include('./content/home.inc');
    }

    VVebbie Guest

Posting Permissions

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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139