View Full Version : Modules
n1tr0b
04-11-2009, 09:56 AM
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
borris83
04-11-2009, 11:05 AM
Can u elaborate what exactly you want to do?
n1tr0b
04-12-2009, 09:30 AM
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
borris83
04-12-2009, 11:45 AM
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....
n1tr0b
04-13-2009, 09:12 AM
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
borris83
04-13-2009, 11:29 AM
save the following code as index.php
<?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
Powered by vBulletin® Version 4.2.2 Copyright © 2021 vBulletin Solutions, Inc. All rights reserved.