Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 5 of 5
  1. #1
    New Coder
    Join Date
    Mar 2004
    Posts
    92
    Thanks
    0
    Thanked 0 Times in 0 Posts

    set a variable in the url?

    I'm trying to control the layout of my site with the url. Instead of setting the variables in the php page set them in the url and just call them in the .php page. Is this possible to do?

    I'm trying to peice together my dynamic database driven site. By doing this I want to keep the number of pages down to a minumum and do the necessary page updates in my database.

    -peace,
    Rich
    Last edited by DiarYofaMadmaN; 04-30-2004 at 07:18 AM.

  • #2
    Super Moderator
    Join Date
    May 2002
    Location
    Perth Australia
    Posts
    4,106
    Thanks
    11
    Thanked 101 Times in 99 Posts
    for sure ..

    with the url...
    ...domain.com/page.php?var1=this&var2=that

    PHP Code:
    page.php
    <?php
    echo $_GET['var1'] . '<br />' $_GET['var2'];
    ?>
    resistance is...

    MVC is the current buzz in web application architectures. It comes from event-driven desktop application design and doesn't fit into web application design very well. But luckily nobody really knows what MVC means, so we can call our presentation layer separation mechanism MVC and move on. (Rasmus Lerdorf)

  • #3
    New Coder
    Join Date
    Mar 2004
    Posts
    92
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Thanks!

  • #4
    New Coder
    Join Date
    May 2004
    Posts
    13
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Firepages, I was just wondering is a difference between $_REQUEST['var'] and $_GET['var']?

  • #5
    Super Moderator
    Join Date
    May 2002
    Location
    Perth Australia
    Posts
    4,106
    Thanks
    11
    Thanked 101 Times in 99 Posts
    well $_REQUEST contains of $_POST,$_GET & $_COOKIE variables , if you don't know where a variable is coming from (e.g GET or POST) then $_REQUEST will work regardless.
    resistance is...

    MVC is the current buzz in web application architectures. It comes from event-driven desktop application design and doesn't fit into web application design very well. But luckily nobody really knows what MVC means, so we can call our presentation layer separation mechanism MVC and move on. (Rasmus Lerdorf)


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •