#1
  1. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2000
    Posts
    3
    Rep Power
    0
    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).]
  2. #2
  3. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2000
    Location
    Somewhere,in,UK
    Posts
    9
    Rep Power
    0
    Shouldn't that be
    index.php3?id=pictures&page=2

    Kelv


    ------------------
    ------------------------
    Kelv (29359814)
    http://www.lohost.com
    Low cost high uptime
    for your sites.
  4. #3
  5. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2000
    Posts
    51
    Rep Power
    15
    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
  6. #4
  7. Contributing User
    Devshed Novice (500 - 999 posts)

    Join Date
    Feb 2000
    Location
    Perth West Australia
    Posts
    757
    Rep Power
    15
    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).]
  8. #5
  9. .Net Developer
    Devshed Novice (500 - 999 posts)

    Join Date
    Feb 2000
    Location
    London
    Posts
    987
    Rep Power
    15

    <<
    <?
    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..."

Similar Threads

  1. Standard class/library for creating RSS Feeds?
    By Hero Zzyzzx in forum PHP Development
    Replies: 0
    Last Post: November 10th, 2003, 01:54 PM
  2. <FORM> creating unwanted space
    By davedutch in forum HTML Programming
    Replies: 3
    Last Post: July 29th, 2003, 04:10 AM
  3. Problem creating new users
    By mallenbaker in forum MySQL Help
    Replies: 9
    Last Post: July 12th, 2003, 09:47 AM
  4. problems about perl dbi installation...
    By lee_sv@yahoo.co in forum Perl Programming
    Replies: 0
    Last Post: July 9th, 2003, 02:01 PM
  5. Replies: 5
    Last Post: September 20th, 2002, 02:40 PM

IMN logo majestic logo threadwatch logo seochat tools logo