+ Reply to Thread
Results 1 to 2 of 2

Thread: Saving Checkboxes

  1. #1
    edmund81 is offline x10Hosting Member edmund81 is an unknown quantity at this point
    Join Date
    Dec 2010
    Posts
    48

    Saving Checkboxes

    Hi,
    I'm completely new to anything that is not html but I'm wondering if in something like php I can get a checkbox to permanently save through reloads and different machines. My idea was just to have a page with only a checkbox on it, and then load that through and iframe in html. If anybody could give me the code for that checkbox page (complete if possible as I don't really know anything about that type of programming) I would be very grateful.
    Thank You

  2. #2
    misson is offline x10 Spammer misson is a jewel in the rough
    Join Date
    Mar 2008
    Location
    Libertatia
    Posts
    2,506

    Re: Saving Checkboxes

    I won't give you teh codez, but will tell you what you need to work with. There's good laziness (getting a computer to do your work) and bad laziness (getting a person to do your work); right now, you're exhibiting the latter.

    Data persistence is handled by things such as file systems and databases. A simple checkbox could be handled by storing the value in a file (you can generate a storable value using serialize, then unserialize it when retrieving), or you could use a basic DB such as SQLite or one based on Berkeley DB (via the DBA extension). A more full-fledged app would need a more complete database system, such as MySQL, PostgreSQL or SQL Server. For a tutorial on interfacing PHP and MySQL, try "Writing MySQL Scripts with PHP and PDO"; the same techniques can be easily adapted for other DBMSs that PDO has drivers for, such as SQLite and PostgreSQL. For more on why you should learn SQL, and where to do it, read the thread "Microsoft SQL Server (a rant)".

    Ideally, data persistance should be handled in a separate layer so as to reduce coupling as a part of separation of concerns. There are many data persistence patterns available, though not all are suitable in certain (or, for some patterns, any) circumstances. Given how new this is to you, you needn't study persistence layers immediately. However, once you have a handle on SQL, you should return to the topic, using your current project as a study case.
    Be sure to read all pages linked in this post; they have further information that should prove useful. When asking for help, make sure you follow Eric Raymond's and Jon Skeet's guidelines for prompt, accurate responses. Please answer any questions I ask; they're not rhetorical (probably). Any posted code is intended as illustrative example, rather than a solution to your problem to be copied without alteration. Study it to learn how to write your own solution.
    Misson, not Mission.

+ Reply to Thread

Similar Threads

  1. VB Cycling through an array of checkboxes
    By simonthecat in forum Programming Help
    Replies: 4
    Last Post: 12-08-2010, 09:46 PM
  2. Not saving FTP Accounts.
    By mike02x90 in forum Free Hosting
    Replies: 1
    Last Post: 06-30-2010, 05:15 PM
  3. Checkboxes and AJAX
    By playminigames in forum Programming Help
    Replies: 4
    Last Post: 10-28-2009, 05:09 PM
  4. Saving Claire
    By Zdroyd in forum Forum Games
    Replies: 16
    Last Post: 08-17-2008, 09:47 PM
  5. Computer I am saving up for
    By amr1991 in forum Off Topic
    Replies: 8
    Last Post: 04-29-2007, 06:32 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
x10hosting free hosting for the masses
dedicated servers