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 2 of 2
  1. #1
    New Coder
    Join Date
    Jan 2007
    Posts
    32
    Thanks
    0
    Thanked 0 Times in 0 Posts

    how to display the selected checkbox id?

    hi,
    Iam new to php.

    I created a list of check box,if i select a indvidual check box,then it must go to the indvidual pages on the basis of selection.

    Please help me how to code for this.

    thanking you.

  • #2
    New to the CF scene
    Join Date
    May 2007
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I am assuming you are familiar with php, and just have a problem with a form,

    PHP Code:
    if(isset($_GET['controlName'])) {
        echo 
    "You selected $_GET['controlName']";

    the function isset() returns a boolean value, based off of the existance of a variable, in this case the $_GET[] global variable, when the controls name is 'controlName'.

    For your page, I would set the action to a page which has code like this:

    PHP Code:
    if(isset('_GET['controlName']))
    {
       $url = $_GET['
    controlName'];
       if($url == '
    google')
       {
          header("Location: http://www.google.com");
       }
       if($url == '
    live)
       {
          
    header("Location: http://www.live.com");
       }

    }
    else
    {
       
    header("Location: backToMainPage");

    A switch statement would have been better in this case, but this is just an example.
    Last edited by LaRoza; 05-31-2007 at 05:13 PM.


  •  

    Posting Permissions

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