www.webdeveloper.com
Results 1 to 4 of 4

Thread: Can you paste PHP code into my database pages on mySQL?

  1. #1
    Join Date
    Feb 2012
    Location
    Sacramento, CA
    Posts
    64

    Can you paste PHP code into my database pages on mySQL?

    It looks like you can paste anything into those pages but the problem that I had before was the PHP script doesn't seem to work!? I'm talking about when I have a dynamic Web site and "pages" are being accessed from the database..

    Who knows??

  2. #2
    Join Date
    Aug 2004
    Location
    Ankh-Morpork
    Posts
    19,337
    At a guess, sounds like a job for eval(). However, as the creator of PHP is alleged to have said, "If eval() is the answer, you're probably asking the wrong question." (e.g.: why do you want to store PHP code in the DB, and what happens if some hacker manages to stick some nasty code into your DB?)
    "Please give us a simple answer, so that we don't have to think, because if we think, we might find answers that don't fit the way we want the world to be."
    ~ Terry Pratchett in Nation

    eBookworm.us

  3. #3
    Join Date
    Feb 2012
    Location
    Sacramento, CA
    Posts
    64
    So I suppose I should integrate my features or add-ons to my Web site in some other manner? Like for instance if I want to add form processing, a php calculator, etc..

  4. #4
    Join Date
    Aug 2004
    Location
    Ankh-Morpork
    Posts
    19,337
    Typically you use include files (often using one file per class definition if going object-oriented, otherwise perhaps loading function definitions and other procedural code) which you can require()/require_once() as needed.
    "Please give us a simple answer, so that we don't have to think, because if we think, we might find answers that don't fit the way we want the world to be."
    ~ Terry Pratchett in Nation

    eBookworm.us

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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



Recent Articles