Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 12 of 12
  1. #1
    Regular Coder
    Join Date
    Sep 2007
    Posts
    809
    Thanks
    5
    Thanked 2 Times in 2 Posts

    Database Entry Field

    Hi All,

    First off id just like to say im not sure if im posting in the right area here, so if im not i appologise.

    I currently have a website built simply using html/css, however i have div tags which i want to contain content. However the content needs to come from other users... such as the user has a database field to fill in and when they sumbit and FTP it (presumably) the content on the website changes to what they have submitted.

    Can anyone point me in the right direction

    Thanks in advance

  • #2
    Regular Coder
    Join Date
    Mar 2007
    Posts
    505
    Thanks
    1
    Thanked 19 Times in 19 Posts
    Then you are looking more at AJAX than ASP.

    If you would be willing to change your .html to .asp, then we could show you how to do this, otherwise you will probably need to change your DIVs to IFRAMEs and use AJAX, or just use a JS Timer to call AJAX to change the innerHTML of those DIVs.

    HTH!
    To say my fate is not tied to your fate is like saying, 'Your end of the boat is sinking.' -- Hugh Downs
    Please, if you found my post helpful, pay it forward. Go and help someone else today.

  • #3
    Regular Coder
    Join Date
    Sep 2007
    Posts
    809
    Thanks
    5
    Thanked 2 Times in 2 Posts
    As you may of realised i am new to this, but i read somewhere that it was possible with PHP and MYSQL, is this correct?

  • #4
    Senior Coder nikkiH's Avatar
    Join Date
    Jun 2005
    Location
    Near Chicago, IL, USA
    Posts
    1,973
    Thanks
    1
    Thanked 32 Times in 31 Posts
    You may wish to switch to a content management system instead of trying to "roll your own", so to speak. It's easy to mess up the scripts and leave them open to script attack and whatnot, plus you will likely want a way to control which users can modify which content.
    Here's a little comparison of the more popular CMS systems out there.
    http://tech.blorge.com/Structure:%20...mla-or-drupal/

    Most open source systems are free, pretty easy to install, and may even come with your hosting package.

    If this post contains any code, I may or may not have tested it. It's probably just example code, so no getting knickers in a bunch over a typo, OK? If it doesn't have basic error checking in it, such as object detection or checking if objects are null before using them, put that in there. I'm giving examples, not typing up your whole app for you. You run code at your own risk.
    Bored? Visit
    http://www.kaelisspace.com/

  • #5
    Regular Coder
    Join Date
    Mar 2007
    Posts
    505
    Thanks
    1
    Thanked 19 Times in 19 Posts
    Nikki is right about using a CMS, but you are also right, greens. This can be done with PHP and MySQL, but it can also be done with ASP/.Net.

    Try the CMS system first rather than trying to re-create the wheel. Once you feel more comfortable with that code, then you can try designing your own system.
    To say my fate is not tied to your fate is like saying, 'Your end of the boat is sinking.' -- Hugh Downs
    Please, if you found my post helpful, pay it forward. Go and help someone else today.

  • #6
    Regular Coder
    Join Date
    Sep 2007
    Posts
    809
    Thanks
    5
    Thanked 2 Times in 2 Posts
    Thanks for the link, ive read about CMS, they seem to be the easiest way to manage dynamic content. Although im just wondering how i go about fitting this CMS in with the html/css i have already produced. Do i just download one and then add my html/css to it?

    Sorry about the lack of knowledge guys

  • #7
    Regular Coder
    Join Date
    Mar 2007
    Posts
    505
    Thanks
    1
    Thanked 19 Times in 19 Posts
    Never apologize for not knowing - as long as you learn, that's all that matters!

    You will need to read the docs that come with the one you choose, as they are all different (but have similar methods).

    More than likely it will be a "plug-n-play" solution - tell your CMS where you want the data updated in your design and it will take care of the rest, with a little tweaking here and there.
    To say my fate is not tied to your fate is like saying, 'Your end of the boat is sinking.' -- Hugh Downs
    Please, if you found my post helpful, pay it forward. Go and help someone else today.

  • #8
    Regular Coder
    Join Date
    Sep 2007
    Posts
    809
    Thanks
    5
    Thanked 2 Times in 2 Posts
    Will CMS(s) work in conjunction with div tags, or will i have to recode the basis of my site. E.G. I have one div tag that is entitled NewsContent and inside this i want the latest news(as you might expect). So would this be achievable through the use of div tags.

  • #9
    Regular Coder
    Join Date
    Mar 2007
    Posts
    505
    Thanks
    1
    Thanked 19 Times in 19 Posts
    Yes, that would be achievable through CMS. It is based on simple JavaScript functions that edit the Document Object Model (or DOM).

    For Example: your code probably states:

    Code:
    <div id="NewsContent">News Goes Here</div>
    If I wanted to change that after-the-fact, then I would use

    Code:
    <div id="NewsContent">News Goes Here</div>
    
    <script language="javascript" type="text/javascript">
        window.onload(document.getElementById('NewsContent').innerHTML = 'This is the NEW News Content');
    </script>
    That's it... CMS uses the same basic techniques except they make this database-driven instead of hard-coding it.
    To say my fate is not tied to your fate is like saying, 'Your end of the boat is sinking.' -- Hugh Downs
    Please, if you found my post helpful, pay it forward. Go and help someone else today.

  • #10
    Senior Coder nikkiH's Avatar
    Join Date
    Jun 2005
    Location
    Near Chicago, IL, USA
    Posts
    1,973
    Thanks
    1
    Thanked 32 Times in 31 Posts
    Quote Originally Posted by greens85 View Post
    Will CMS(s) work in conjunction with div tags, or will i have to recode the basis of my site. E.G. I have one div tag that is entitled NewsContent and inside this i want the latest news(as you might expect). So would this be achievable through the use of div tags.
    It depends on which one you choose, but the ones I have played with have templates that control the look and feel of the site. You could use your existing content to model the template, plug in your static content, and go from there.
    This site lets you look at a ton of them to compare options (not all are free)
    http://www.cmsmatrix.org/
    It also has links to demos.

    If this post contains any code, I may or may not have tested it. It's probably just example code, so no getting knickers in a bunch over a typo, OK? If it doesn't have basic error checking in it, such as object detection or checking if objects are null before using them, put that in there. I'm giving examples, not typing up your whole app for you. You run code at your own risk.
    Bored? Visit
    http://www.kaelisspace.com/

  • #11
    Regular Coder
    Join Date
    Sep 2007
    Posts
    809
    Thanks
    5
    Thanked 2 Times in 2 Posts
    Hey again,

    I've found a tutorial on the net which i think is exactly what im looking to do, http://www.sitepoint.com/article/php-mysql-tutorial

    However this way the content would be entered by me and not by clients, does anyone if this method can be slightly modified in order to allow the client to enter the information.

    Thanks in advance

  • #12
    Regular Coder
    Join Date
    Mar 2007
    Posts
    505
    Thanks
    1
    Thanked 19 Times in 19 Posts
    Set up a *basic* CMS by creating a simple form that allows your clients to upload their data, including any images they may want to use.

    If you want more information on this, there are plenty of sites out there that give out this type of code.


    However, as this is starting to get into PHP, and not ASP, you need to create a new thread there to continue any questions that you may have on this topic.
    To say my fate is not tied to your fate is like saying, 'Your end of the boat is sinking.' -- Hugh Downs
    Please, if you found my post helpful, pay it forward. Go and help someone else today.


  •  

    Posting Permissions

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