select from radio button + enter username = open user profile

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • M.E.

    select from radio button + enter username = open user profile

    Hi

    I have 4 radio buttons. each button to determine which page to go to. But
    before page open user enters username in a text box. So when submitted, Page
    opens relevant to that user displaying selected page.

    I have no idea how to achieve this, and a good example would be greatly
    appreciated.


    Page 1: <radio button> >>>>>>>>>> this page to go to page1.php (this is a
    table of user records 1)
    Page 2: <radio button> >>>>>>>>>> this page to go to page2.php (this is a
    table of user records 2)
    Page 3 :<radio button> >>>>>>>>>> this page to go to page3.php (this is a
    table of user records) 3
    Page 4: <radio button> >>>>>>>>>> this page to go to page4.php (this is a
    table of user records 4)

    Enter Username: [text box] >>>>>>>> any user with their username

    [submit]


    Result should be :

    If User FAB5 selects radio button 1 >>>>>>>>>. to display FAB5's page1.php

    Thank you



  • marius ursache

    #2
    Re: select from radio button + enter username = open user profile

    M.E. wrote:
    [color=blue]
    > Result should be :
    >
    > If User FAB5 selects radio button 1 >>>>>>>>>. to display FAB5's page1.php
    >
    > Thank you[/color]

    Put the username box first, then the radio checkboxes. And for each
    checkbox, put a javascript with onClick=documen t.form.submit. (or something
    like this).

    Of course, you should check that the username is not empty. (can be done
    with javascript or with php).


    --
    marius


    Free your mind; the rest will follow.

    Comment

    • Pedro Graca

      #3
      Re: select from radio button + enter username = open user profile

      M.E. wrote:[color=blue]
      > I have 4 radio buttons. each button to determine which page to go to. But
      > before page open user enters username in a text box. So when submitted, Page
      > opens relevant to that user displaying selected page.
      >
      > I have no idea how to achieve this, and a good example would be greatly
      > appreciated.[/color]

      Submit the form to

      <?php
      $new_page = false;
      if (isset($_POST['radio1']))
      $new_page = '/page1.php?user= ' . $_POST['username'];
      // same thing for page2, page3, and page4
      if ($new_page) {
      header('Locatio n: ' . $full_url . $new_page);
      exit('Redirecte d <a href="' . $full_url . $new_page . '">here</a>.');
      }
      // error message
      ?>
      --
      --= my mail box only accepts =--
      --= Content-Type: text/plain =--
      --= Size below 10001 bytes =--

      Comment

      • M.E.

        #4
        Re: select from radio button + enter username = open user profile

        Thank you great help to me.


        "Pedro Graca" <hexkid@hotpop. com> wrote in message
        news:c279mc$1q5 qh4$1@ID-203069.news.uni-berlin.de...


        Comment

        Working...