SitePoint Sponsor

User Tag List

Results 1 to 6 of 6
  1. #1
    SitePoint Member
    Join Date
    Jun 2012
    Posts
    3
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Database Driven Website

    Dear All,

    I want to know how website will be made/languages used with following requirements :

    I am roughly 1000 Page Static Website. Each page contains 1 main heading, sub heading, content and 2-3 photos per page

    along with the main template of the website. I had made it by making 1000 static pages and its hectic to maintain. I want a

    website which should be like this :

    1. I want to place all 1000 articles in txt OR doc OR rtf ... OR any format... in 1 folder.
    2. 2000-3000 Photos in another folder. (2-3 Photos per page)
    3. Now when anyone clicks any of the thousand links in main template, a PHP code or any server side language code should

    pick up an article from txt file and images from 'photos folder' and make a page which includes article ,images placed at

    proper place.

    Now how can i do it ? What languages will be involved ? How it will be made ? Kindly help me out !

  2. #2
    SitePoint Wizard wonshikee's Avatar
    Join Date
    Jan 2007
    Posts
    1,223
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)
    You're asking too broad a question, you'd be better off using WordPress, Joomla, or Drupal and building a simple CMS with it.

  3. #3
    SitePoint Member
    Join Date
    Jun 2012
    Posts
    6
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    create a mysql or sqlite database.
    if your website is php enabled and has access to mysql, I suggest you use this option, if not sqlite is built into php and you could use that.
    1. create a database. Go into your mysql link on your server, there you will find options to create a database (DB from now).
    2. Create DB following the instructions on your site.
    3. create a table to hold your information such as:-
    titlename
    description
    author
    time created
    article
    image
    ect
    in mysql :-
    create a seperate file to control your settings eg:- username. password ect
    in sqlite
    create the same.
    sqlite example:-
    set up a new folder called sqlite.
    open a new file.
    name it "config.php"
    enter:-
    <?php
    $sh = "sqlite/sh";
    $db = @sqlite_open($sh, 0666, $error);
    ?>
    now create a table:-
    <?php
    include "config.php";
    $sq = "CREATE TABLE article (
    id INTEGER PRIMARY KEY,
    titlename VARCHAR,
    author VARCHAR,
    description VARCHAR,
    imagefile VARCHAR,
    imagedescription VARCHAR,
    article TEXT,
    tm DATE DEFAULT '0000-00-00 00:00:00')";
    $result = sqlite_query($db, $sq);
    if (!$result) die("Could not create table it's somebody else's fault");
    ?>
    now you can insert data, select data and organise your site.. BEAUTIFUL PHP (THANK_YOU GOD RAMUS)
    mysql would be very similar. Look-up a tutorial on the subject. W3schools has a very clear, easy to follow mysql tut. hope u get it right.

  4. #4
    SitePoint Member
    Join Date
    Jun 2012
    Posts
    3
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thankyou for your answer. I am a simple web designer thats why it is a bit diificult to grasp an idea. Well, i am restructuring my question . Kindly tell that your answer is applicable to this question. Thanks

    1. Is there a way that i make a template and leave blank the content area and photos area. When user click on any link eg XYZ then any script/code ( javascript/PHP........) grabs the content from txt file and photos from photos folder and combine in a new page mywebsite.com/xyz.html or mywebsite.com/xyz.php. In this way i will not need to make thousand pages manually.
    2. If this is possible then will google add such pages in search engine ?


    Quote Originally Posted by Tunein View Post
    create a mysql or sqlite database.
    if your website is php enabled and has access to mysql, I suggest you use this option, if not sqlite is built into php and you could use that.
    1. create a database. Go into your mysql link on your server, there you will find options to create a database (DB from now).
    2. Create DB following the instructions on your site.
    3. create a table to hold your information such as:-
    titlename
    description
    author
    time created
    article
    image
    ect
    in mysql :-
    create a seperate file to control your settings eg:- username. password ect
    in sqlite
    create the same.
    sqlite example:-
    set up a new folder called sqlite.
    open a new file.
    name it "config.php"
    enter:-
    <?php
    $sh = "sqlite/sh";
    $db = @sqlite_open($sh, 0666, $error);
    ?>
    now create a table:-
    <?php
    include "config.php";
    $sq = "CREATE TABLE article (
    id INTEGER PRIMARY KEY,
    titlename VARCHAR,
    author VARCHAR,
    description VARCHAR,
    imagefile VARCHAR,
    imagedescription VARCHAR,
    article TEXT,
    tm DATE DEFAULT '0000-00-00 00:00:00')";
    $result = sqlite_query($db, $sq);
    if (!$result) die("Could not create table it's somebody else's fault");
    ?>
    now you can insert data, select data and organise your site.. BEAUTIFUL PHP (THANK_YOU GOD RAMUS)
    mysql would be very similar. Look-up a tutorial on the subject. W3schools has a very clear, easy to follow mysql tut. hope u get it right.

  5. #5
    SitePoint Mentor bronze trophy
    John_Betong's Avatar
    Join Date
    Aug 2005
    Location
    City of Angels
    Posts
    1,889
    Mentioned
    74 Post(s)
    Tagged
    6 Thread(s)
    @chintoo123,

    Can you supply a link to your site.
    Learn how to be ready for The New Move to Discourse

    How to make Make Money Now with a *NEW* look

    Be sure to congratulate Wolfshade on earning Member of the Month for August 2014

  6. #6
    SitePoint Member
    Join Date
    Jun 2012
    Posts
    3
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I have sent website address in pivate message


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
  •