Results 1 to 6 of 6

Thread: Modules

  1. #1
    Join Date
    Apr 2009
    Location
    Mac OSX
    Posts
    14
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default Modules

    Im trying to figure out a php code

    [I would consider this as AJAX]
    like
    index.php?page=main
    index.php?page=downloads

    if u have ideas on mysql please write the code so i can insert it to phpmyadmin

  2. #2
    Join Date
    Mar 2009
    Location
    Chennai, India
    Posts
    77
    Thanks
    16
    Thanked 7 Times in 6 Posts

    Default

    Can u elaborate what exactly you want to do?

  3. #3
    Join Date
    Apr 2009
    Location
    Mac OSX
    Posts
    14
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default

    index.php contains an ajax code than when you put something in the parameter line [*.php?page=main] it gets the information from a MySQL table and prints it

  4. #4
    Join Date
    Mar 2009
    Location
    Chennai, India
    Posts
    77
    Thanks
    16
    Thanked 7 Times in 6 Posts

    Default

    when you have something like index.php?page=main, in the landing page, the value 'main' gets assigned to the variable $_GET['page']...

    that is, it automatically makes the following assignment:

    $_GET['page'] = 'main';

    Say, if the page is index.php?page=downloads, then

    $_GET['page'] would be 'downloads'...

    If something has to be pulled out from a mysql table using the value of $_GET['page'], then first there has to be a table already which has many rows and one particular field may correspond to the value of $_GET['page']...

    So, if you give me what type of data will be there in that field, the name of the table and name of the field and how you want to display it in the page, then I would construct a php code to query mysql and display results..

    But, if you want to insert some data using phpmyadmin, then you don't have to know the query, you can just use the graphical interface of phpmyadmin to insert data....

  5. #5
    Join Date
    Apr 2009
    Location
    Mac OSX
    Posts
    14
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default

    Can you post a sample script with a simple navigation of two pages

    index.php?page=main
    index.php?page=downloads

    Im still a beginner for PHP and learning more by questioning ang hands on
    you could include a MySQL sample and the table sample if you want it secure

  6. #6
    Join Date
    Mar 2009
    Location
    Chennai, India
    Posts
    77
    Thanks
    16
    Thanked 7 Times in 6 Posts

    Default

    save the following code as index.php

    Code:
    <?php
    if(isset($_GET['page']))
    {
     echo "<h1>" . $_GET['page']. "</h1>";
     echo "This is  the page for "  . $_GET['page'];
        
    }
    ?>
    Now, just type the url with anything after index.php?page=

    You can simpy create a table in phpmyadmin and you write php codes to query mysql db according to the value of $_GET['page']

    You can learn more from this link:
    http://www.w3schools.com/php/php_mysql_intro.asp

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
  •