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 6 of 6
  1. #1
    New to the CF scene
    Join Date
    Mar 2007
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question What is this code for?

    Hi! Everyone,

    I'm an artist developing my Online portfolio http://bluepen-graphics.com am starting to learn how to convert my html web page to php.

    I want to ask info about "?do=newthread&f=6" from "http://www.codingforums.com/newthread.php?do=newthread&f=6"

    My question is how this code work "?do=newthread&f=6" what it is for?

    Thank you in advance for the info that you can give.

    -bluecode (PHP noob)

  • #2
    New Coder
    Join Date
    Mar 2007
    Location
    Northern Ireland
    Posts
    40
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Those are called get variables and can be accessed using $_GET['name'].

    In the example you gave the two get variables would be $_GET['do'] (with the value of newthread) and $_GET['f'] (with a value of 6).

    This basically allows you to pass information easily between pages. You can use it in links like in this example:

    Code:
    <a href="test_page.php?action=dosomething">Click me</a>
    And can be accessed and used like this:

    PHP Code:
    if(isset($_GET['action'])){
         if(
    $_GET['action'] == "dosomething"){
              
    // do something
        
    }


    You can also use it in headers and form actions (See below):

    Code:
    <form action="blah.php?test=something" method="post">
    and

    PHP Code:
    header("location: test.php?blah=something"); 
    Hope that helps

  • #3
    New to the CF scene
    Join Date
    Mar 2007
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Wow! Thank you so much jmitch18 for enlighten my thinking for this code.

    Really helped me... So clear and easy to understand... 2 thumbs up!

    Thanks again...

  • #4
    New to the CF scene
    Join Date
    Mar 2007
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Hi! Jmitch18,

    one more question, correct me if am wrong. here's the call link example to a site.

    "http://blabla.com/?a=details&lid=3376"

    are this link omitted the index.php that supposedly to

    "http://blabla.com/index.php?a=details&lid=3376"


    Thank you again.

    bluecode

  • #5
    Regular Coder
    Join Date
    Oct 2005
    Location
    Surrey, England
    Posts
    286
    Thanks
    2
    Thanked 2 Times in 2 Posts
    yup you can miss off the index.php if its a root directory
    Daniel Warner
    - - - - - - - - - -
    GuitarMart.co.uk - Free Online Classified Advertisement for Guitarists in the United Kingdom. Free Ads with a Free Photo.

  • #6
    Regular Coder the-dream's Avatar
    Join Date
    Mar 2007
    Location
    Northamptonshire, UK
    Posts
    477
    Thanks
    8
    Thanked 4 Times in 4 Posts
    Hi just for reference i made a tutorial for that its free:
    http://phpguy.wordpress.com/2007/03/25/url-id-content/


  •  

    Posting Permissions

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