Click to See Complete Forum and Search --> : My file...
lukezweb
11-29-2003, 12:50 PM
How can i display several different pages in one file so in adminsettings.php
how can i set say 5 pages in there and depending on what
adminsettings.php?page=
the page=1
etc it dispalys that page?
anythign like that available in php?
how would i do it?
thanks,
luke
Take a look at this thread: http://forums.webdeveloper.com/showthread.php?s=&threadid=21442
lukezweb
11-29-2003, 02:00 PM
<?php
if (isset($_GET['p'])) {
$p = (strstr($_GET['p'], ".php")) ? $_GET['p'] : $_GET['p'].".php";
if (file_exists($p)) {
include $p;
}
}
else {
include "index.php";
}
?>
so how do i set what its to display for the certain extension and how do i set several?
Just use
$p = $_GET['p'];
and set it in the $_GET variable.
lukezweb
11-29-2003, 02:13 PM
Originally posted by pyro
Just use
$p = $_GET['p'];
and set it in the $_GET variable.
sorry havent done much pgp could you show me for example how i could do something like this:
setting
?action=banmember
displays the ban content
and
?action=newmember
displays the new member content
Try something like this:
$action = (isset($_GET['action'])) ? $_GET['action'] : "";
if ($action == "banmember") {
#ban member code
}
else if ($action == "newmember") {
#new member code
}
lukezweb
11-29-2003, 02:45 PM
Originally posted by pyro
Try something like this:
$action = (isset($_GET['action'])) ? $_GET['action'] : "";
if ($action == "banmember") {
#ban member code
}
else if ($action == "newmember") {
#new member code
}
thank you so much it works :)
i now have another question...
how can i set up a text database that contains username, password, location, job title, email, gender, age
and all the info can be inputted into a register page and edditted in a profile page for each user on it and finally called upon in a page Welcome &username form &location etc?/
if you can answer any of this i will be so happy :)
For something like this, I'd highly, highly recommend using a database. MySQL is my favorite...
lukezweb
11-29-2003, 02:57 PM
Originally posted by pyro
For something like this, I'd highly, highly recommend using a database. MySQL is my favorite...
3 questions?
1) What does it stand for?
2) Where can i find out how to make them?
3) What program do i need to amke them?
Thanks again!
1: Can't tell you. ;) Seriously. The SQL part stands for Structured Query Language, but even the offical site (http://www.mysql.com/) does not account for the "my" preface... It's one of life's great mysteries...
2: Take a look at http://www.devshed.com/Server_Side/MySQL
3: Your server just needs to support MySQL to use it, but phpMyAdmin (http://www.phpmyadmin.net/home_page/) helps make things a heckuva lot easier.
lukezweb
11-29-2003, 03:23 PM
Originally posted by pyro
1: Can't tell you. ;) Seriously. The SQL part stands for Structured Query Language, but even the offical site (http://www.mysql.com/) does not account for the "my" preface... It's one of life's great mysteries...
2: Take a look at http://www.devshed.com/Server_Side/MySQL
3: Your server just needs to support MySQL to use it, but phpMyAdmin (http://www.phpmyadmin.net/home_page/) helps make things a heckuva lot easier.
any good books on it?
I have this one (http://www.amazon.com/exec/obidos/tg/detail/-/0321127315/qid=1070143986/sr=1-1/ref=sr_1_1/103-0995862-3268645?v=glance&s=books). It's so-so...