August 18th, 2000, 04:56 PM
-
How can i creat Index.php3?id=pictures&page=2
and so on heres the current code
<?
if ($id == "news") {
include("news.php3");
} elseif($id== "pictures") {
include("pics.php3");
}?>
[This message has been edited by Luqman (edited August 18, 2000).]
August 18th, 2000, 07:51 PM
-
Shouldn't that be
index.php3?id=pictures&page=2
Kelv 
------------------
------------------------
Kelv (29359814)
http://www.lohost.com
Low cost high uptime
for your sites.
August 18th, 2000, 10:37 PM
-
your question doesnt make any sense to me... let me try and help though... I would set up a file like this:
$arr_request = array();
if (count($HTTP_GET_VARS)) {
while (list($key, $value) = each ($HTTP_GET_VARS)) {
$arr_request[$key] = $value;
}
}
if (count($HTTP_POST_VARS)) {
while (list($Key, $value) = each ($HTTP_POST_VARS)) {
$arr_request[$key] = $value;
}
}
call it common.inc or something. Include it on your index.php3 file right in the beginning. Then later on in the script, instead of saying if($id == news) say if($arr_request['id'] == 'news') or whatever. Basically, instead of referring to your querried variables as $id or $page, you need a script like that so the browser passes the url to an array. You can always refer to the array as $arr_request['var']
hope this helps
for more explaination, just email me or something orbit3d@orbit3d.com.
cya
sam
August 19th, 2000, 03:12 AM
-
Luqman - we really do need a bit more info of you - chiller2 is correct that your query string syntax is wrong it should be index.php3?id=pictures&page=2 - otherwise id will have a value of 'pictures?page=2' or nothing at all.
Otherwise your code is fine.
rpgswap.com - sorry but your code while good - just slows things down in this situation, you end up with an ASP like routine of having to request the variable, past of the beauty of PHP is the fact that you can test for a post/url variable purely by <?if($var)?> - why make it more complex?
Do not get me wrong I use a similar routine for checking form vars on long forms - but mainly as an aid to myself. see http://www.firepages.com.au/howfor/post_var.htm
------------------
Simon Wheeler
FirePages -DHTML/PHP/MySQL
[This message has been edited by firepages (edited August 19, 2000).]
August 19th, 2000, 03:23 AM
-
<<
<?
if ($id == "news") {
include("news.php3");
} elseif($id== "pictures") {
include("pics.php3");
}?>
>>
What you are doing is right.but what is "page=2"?.
Do you mean 'page 2 of news' or 'page 2 of pics' ?.
------------------
SR -
webshiju.com
www.jobxyz.com-IT Career Portal
ezipindia.com--WebStudio
"The fear of the LORD is the beginning of knowledge..."