Jump to content

Delight

New Members
  • Posts

    5
  • Joined

  • Last visited

    Never

Everything posted by Delight

  1. Delight

    all in one

    Here's a simple example: Place this code on the first line of your index.php: <?php if (empty($_GET['page'])) { $_GET['page'] = 'home'; } ?> Place this code in your content div: <?php if(is_numeric($_GET['page'])) // check if button ACTION is a number. { $page = $_GET['page']; $query="SELECT * FROM `table_in_database` WHERE `id` = '$page';"; $result = mysql_query($query); $inhoud = mysql_fetch_assoc($result); // MYSQL data to PHP echo $inhoud['info']; // Display your content } else // if not a number then load page from the PAGES folder. { $_GET['page']; include('pages/'.$_GET['page'].'.php'); // name and add .PHP to it // wich will result in a // filename in the PAGES // folder. } ?> Now, make a folder on the root called pages. In this folder are the files stashed like home.php, news.php , allyourfiles.php etc etc. These will be called from the content div. Your buttons (anywhere on your page) must have the following action: ?page=home Home is referring to your pages/home.php file. Or get the content out of a dabase: ?page=1 If anyone feels the need to add a more complicated one with security feel free to do so but i thought this might be a good way to start. Enjoy.
  2. Thanks all, I'll give this a try. To answer all the questions: I'm using php, phpmyadmin and mysql.
  3. Here's a solution I used in the past: <iframe src ="forum/index.php" name ="forum" width ="870px" height ="612" scrolling ="auto" align ="left" frameborder ="1"> </iframe> The forum folder is located in the root in this example.
  4. I have a website on domain_A. I like to have it connect to a database witch is on domain_B (differend provider and differend url). Is this possible?
  5. If it's an integer then you could do something like this: if ($price == '0.00') { echo 'Free'; } else { echo '£ '.$price; }
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.