Loading ...
Sorry, an error occurred while loading the content.
 

Re: [phpResource] URL question parameters www.mydomain.com/index.php?id=2

Expand Messages
  • Safique Ahmed Faruque
    Hi, This variable $id you can get in your index.php page, if you make the global variable on in php.ini file. or you have to write $id = $_GET[ id ];
    Message 1 of 8 , Jul 23, 2008

      Hi,
      This variable $id you can get in your index.php page, if you make the global variable on in php.ini file.
      or you have to write

      $id = $_GET['id']; //(Recommended)

      or

      $id = $_REQUEST['id'];

      --Safique Ahmed Faruque
        Programmer
       IBCS-Primax Software Ltd
      #01717383729
      --- On Wed, 7/23/08, Marco Branco <marcobranco1975@...> wrote:
      From: Marco Branco <marcobranco1975@...>
      Subject: [phpResource] URL question parameters www.mydomain.com/index.php?id=2
      To:
      Date: Wednesday, July 23, 2008, 10:40 AM

      hi

      i have this link in a web page (www.mydomain. com/index. php?id=2).

      and in the index.php i have

      <?php
      (...)
      switch ($id)
      {
          case 1: echo('um - 1'); break;
          case 2: echo('dois - 2'); break;
          case 3: echo('tres - 3'); break;
         default: echo('defaulf - any');
      }
      (...)
      ?>

      I alwys get the last line of the switch:  default - any

      Why?

      thank's in advance


    • leqdangs
      Hello, To resolve this problem. i think you should declare variable id in javascrip. after you can call in PHP. var id;
      Message 2 of 8 , Jul 24, 2008
        Hello,

        To resolve this problem. i think you should declare variable id in
        javascrip. after you can call in PHP.

        <script language="javascript">
        var id;
        </script>
        <?php
        echo "<script> id = $_GET['id'];</script>";
        echo "<script> alert(id);</script>";
        ?>

        Good Luck


        --- In phpresource@yahoogroups.com, Safique Ahmed Faruque
        <provat34@...> wrote:
        >
        >
        > Hi,
        > This variable $id you can get in your index.php page, if you make
        the global variable on in php.ini file.
        > or you have to write
        >
        > $id = $_GET['id']; //(Recommended)
        >
        > or
        >
        > $id = $_REQUEST['id'];
        >
        > --Safique Ahmed Faruque
        >   Programmer
        >  IBCS-Primax Software Ltd
        > #01717383729
        > --- On Wed, 7/23/08, Marco Branco <marcobranco1975@...> wrote:
        > From: Marco Branco <marcobranco1975@...>
        > Subject: [phpResource] URL question parameters
        www.mydomain.com/index.php?id=2
        > To:
        > Date: Wednesday, July 23, 2008, 10:40 AM
        >
        >
        >
        >
        >
        >
        >
        >
        >
        >
        >
        >
        >
        >
        >
        > hi
        >
        >
        >
        > i have this link in a web page (www.mydomain. com/index. php?id=2).
        >
        >
        >
        > and in the index.php i have
        >
        >
        >
        > <?php
        >
        > (...)
        >
        > switch ($id)
        >
        > {
        >
        >     case 1: echo('um - 1'); break;
        >
        >     case 2: echo('dois - 2'); break;
        >
        >     case 3: echo('tres - 3'); break;
        >
        >    default: echo('defaulf - any');
        >
        > }
        >
        > (...)
        >
        > ?>
        >
        >
        >
        > I alwys get the last line of the switch:  default - any
        >
        >
        >
        > Why?
        >
        >
        >
        > thank's in advance
        >
      • Delwar Hossain
        Check the value you are passing to $id using: echo $id, Then decide in which direction you will have to go. Thank you
        Message 3 of 8 , Jul 30, 2008
          Check the value you are passing to $id using:
           
          echo $id,
           
          Then decide in which direction you will have to go.
           
          Thank you
           
           


          On Thu, Jul 24, 2008 at 10:02 AM, leqdangs <leqdangs@...> wrote:


          Hello,

          To resolve this problem. i think you should declare variable id in
          javascrip. after you can call in PHP.

          <script language="javascript">
          var id;
          </script>
          <?php
          echo "<script> id = $_GET['id'];</script>";
          echo "<script> alert(id);</script>";
          ?>

          Good Luck

          --- In phpresource@yahoogroups.com, Safique Ahmed Faruque

          <provat34@...> wrote:
          >
          >
          > Hi,
          > This variable $id you can get in your index.php page, if you make
          the global variable on in php.ini file.
          > or you have to write
          >
          > $id = $_GET['id']; //(Recommended)
          >
          > or
          >
          > $id = $_REQUEST['id'];
          >
          > --Safique Ahmed Faruque
          >   Programmer
          >  IBCS-Primax Software Ltd
          > #01717383729
          > --- On Wed, 7/23/08, Marco Branco <marcobranco1975@...> wrote:
          > From: Marco Branco <marcobranco1975@...>

          > Subject: [phpResource] URL question parameters
          www.mydomain.com/index.php?id=2
          > To:
          > Date: Wednesday, July 23, 2008, 10:40 AM
          >
          >
          >
          >
          >
          >
          >
          >
          >
          >
          >
          >
          >
          >
          >
          > hi
          >
          >
          >
          > i have this link in a web page (www.mydomain. com/index. php?id=2).
          >
          >
          >
          > and in the index.php i have
          >
          >
          >
          > <?php
          >
          > (...)
          >
          > switch ($id)
          >
          > {
          >
          >     case 1: echo('um - 1'); break;
          >
          >     case 2: echo('dois - 2'); break;
          >
          >     case 3: echo('tres - 3'); break;
          >
          >    default: echo('defaulf - any');
          >
          > }
          >
          > (...)
          >
          > ?>
          >
          >
          >
          > I alwys get the last line of the switch:  default - any
          >
          >
          >
          > Why?
          >
          >
          >
          > thank's in advance
          >


        • CJ ÿffffce
          echo var id = $_GET[ id ]; ; echo alert(id); ; ... From: Delwar Hossain Subject: Re: [phpResource]
          Message 4 of 8 , Jul 30, 2008

            echo "<script> var id = $_GET['id'];</script>";
            echo "<script> alert(id);</script>";


            --- On Wed, 7/30/08, Delwar Hossain <delwar1956@...> wrote:
            From: Delwar Hossain <delwar1956@...>
            Subject: Re: [phpResource] Re: URL question parameters www.mydomain.com/index.php?id=2
            To: phpresource@yahoogroups.com
            Date: Wednesday, July 30, 2008, 9:44 PM

            Check the value you are passing to $id using:
             
            echo $id,
             
            Then decide in which direction you will have to go.
             
            Thank you
             
             


            On Thu, Jul 24, 2008 at 10:02 AM, leqdangs <leqdangs@yahoo. com> wrote:


            Hello,

            To resolve this problem. i think you should declare variable id in
            javascrip. after you can call in PHP.

            <script language="javascript">
            var id;
            </script>
            <?php
            echo "<script> id = $_GET['id'];</script>";
            echo "<script> alert(id);</script>";
            ?>

            Good Luck

            --- In phpresource@ yahoogroups. com, Safique Ahmed Faruque

            <provat34@...> wrote:
            >
            >
            > Hi,
            > This variable $id you can get in your index.php page, if you make
            the global variable on in php.ini file.
            > or you have to write
            >
            > $id = $_GET['id']; //(Recommended)
            >
            > or
            >
            > $id = $_REQUEST['id'];
            >
            > --Safique Ahmed Faruque
            >   Programmer
            >  IBCS-Primax Software Ltd
            > #01717383729
            > --- On Wed, 7/23/08, Marco Branco <marcobranco1975@ ...> wrote:
            > From: Marco Branco <marcobranco1975@ ...>

            > Subject: [phpResource] URL question parameters
            www.mydomain. com/index. php?id=2
            > To:
            > Date: Wednesday, July 23, 2008, 10:40 AM
            >
            >
            >
            >
            >
            >
            >
            >
            >
            >
            >
            >
            >
            >
            >
            > hi
            >
            >
            >
            > i have this link in a web page (www.mydomain. com/index. php?id=2).
            >
            >
            >
            > and in the index.php i have
            >
            >
            >
            > <?php
            >
            > (...)
            >
            > switch ($id)
            >
            > {
            >
            >     case 1: echo('um - 1'); break;
            >
            >     case 2: echo('dois - 2'); break;
            >
            >     case 3: echo('tres - 3'); break;
            >
            >    default: echo('defaulf - any');
            >
            > }
            >
            > (...)
            >
            > ?>
            >
            >
            >
            > I alwys get the last line of the switch:  default - any
            >
            >
            >
            > Why?
            >
            >
            >
            > thank's in advance
            >



          • Safique Ahmed Faruque
            Hello,   I have tried and succeed after doing some changes. the changed portion is:    echo var id = .$_GET[ id ]. ; ; Thank you ...
            Message 5 of 8 , Jul 31, 2008
              Hello,
               
              I have tried and succeed after doing some changes.
              the changed portion is:
               
               echo "<script> var id = ".$_GET['id'].";</script>";
              Thank you


              --- On Wed, 7/30/08, CJ ÿffffce <cjxxi@...> wrote:
              From: CJ ÿffffce <cjxxi@...>
              Subject: Re: [phpResource] Re: URL question parameters www.mydomain.com/index.php?id=2
              To: phpresource@yahoogroups.com
              Date: Wednesday, July 30, 2008, 9:38 PM


              echo "<script> var id = $_GET['id'];</script>";
              echo "<script> alert(id);</script>";


              --- On Wed, 7/30/08, Delwar Hossain <delwar1956@gmail. com> wrote:
              From: Delwar Hossain <delwar1956@gmail. com>
              Subject: Re: [phpResource] Re: URL question parameters www.mydomain. com/index. php?id=2
              To: phpresource@ yahoogroups. com
              Date: Wednesday, July 30, 2008, 9:44 PM

              Check the value you are passing to $id using:
               
              echo $id,
               
              Then decide in which direction you will have to go.
               
              Thank you
               
               


              On Thu, Jul 24, 2008 at 10:02 AM, leqdangs <leqdangs@yahoo. com> wrote:

              Hello,

              To resolve this problem. i think you should declare variable id in
              javascrip. after you can call in PHP.

              <script language="javascrip t">
              var id;
              </script>
              <?php
              echo "<script> id = $_GET['id'];</script>";
              echo "<script> alert(id);</script>";
              ?>

              Good Luck

              --- In phpresource@ yahoogroups. com, Safique Ahmed Faruque
              <provat34@...> wrote:
              >
              >
              > Hi,
              > This variable $id you can get in your index.php page, if you make
              the global variable on in php.ini file.
              > or you have to write
              >
              > $id = $_GET['id']; //(Recommended)
              >
              > or
              >
              > $id = $_REQUEST['id' ];
              >
              > --Safique Ahmed Faruque
              >   Programmer
              >  IBCS-Primax Software Ltd
              > #01717383729
              > --- On Wed, 7/23/08, Marco Branco <marcobranco1975@ ...> wrote:
              > From: Marco Branco <marcobranco1975@ ....>

              > Subject: [phpResource] URL question parameters
              www.mydomain. com/index. php?id=2
              > To:
              > Date: Wednesday, July 23, 2008, 10:40 AM
              >
              >
              >
              >
              >
              >
              >
              >
              >
              >
              >
              >
              >
              >
              >
              > hi
              >
              >
              >
              > i have this link in a web page (www.mydomain. com/index. php?id=2).
              >
              >
              >
              > and in the index.php i have
              >
              >
              >
              > <?php
              >
              > (...)
              >
              > switch ($id)
              >
              > {
              >
              >     case 1: echo('um - 1'); break;
              >
              >     case 2: echo('dois - 2'); break;
              >
              >     case 3: echo('tres - 3'); break;
              >
              >    default: echo('defaulf - any');
              >
              > }
              >
              > (...)
              >
              > ?>
              >
              >
              >
              > I alwys get the last line of the switch:  default - any
              >
              >
              >
              > Why?
              >
              >
              >
              > thank's in advance
              >




            • group_mediator
              You do not require JS .. try extract ($_GET); before switch ($id) also, if you can change URL GET id= to something like aid= as it maybe
              Message 6 of 8 , Jul 31, 2008
                You do not require JS <Script>..

                try
                extract ($_GET);
                before
                switch ($id)

                also, if you can change URL GET "id=" to something like "aid=" as it
                maybe conflicting with $id variable previously used and use

                switch($aid)

                extract ($_GET) will put the value with the same name variable.



                --- In phpresource@yahoogroups.com, CJ �ffffce <cjxxi@...> wrote:
                >
                >
                > echo "<script> var id = $_GET['id'];</script>";
                > echo "<script> alert(id);</script>";
                >
                >
                > --- On Wed, 7/30/08, Delwar Hossain <delwar1956@...> wrote:
                > From: Delwar Hossain <delwar1956@...>
                > Subject: Re: [phpResource] Re: URL question parameters
                www.mydomain.com/index.php?id=2
                > To: phpresource@yahoogroups.com
                > Date: Wednesday, July 30, 2008, 9:44 PM
                >
                >
                >
                >
                >
                >
                >
                >
                >
                >
                >
                > Check the value you are passing to $id using:
                > �
                > echo $id,
                > �
                > Then decide in which direction you will have to go.
                > �
                > Thank you
                > �
                > �
                >
                >
                >
                > On Thu, Jul 24, 2008 at 10:02 AM, leqdangs <leqdangs@yahoo. com> wrote:
                >
                >
                >
                >
                >
                >
                >
                > Hello,
                >
                > To resolve this problem. i think you should declare variable id in
                > javascrip. after you can call in PHP.
                >
                > <script language="javascript">
                > var id;
                > </script>
                > <?php
                >
                > echo "<script> id = $_GET['id'];</script>";
                > echo "<script> alert(id);</script>";
                > ?>
                >
                > Good Luck
                >
                > --- In phpresource@ yahoogroups. com, Safique Ahmed Faruque
                >
                >
                > <provat34@> wrote:
                > >
                > >
                > > Hi,
                > > This variable $id you can get in your index.php page, if you make
                > the global variable on in php.ini file.
                > > or you have to write
                >
                > >
                > > $id = $_GET['id']; //(Recommended)
                > >
                > > or
                > >
                > > $id = $_REQUEST['id'];
                > >
                > > --Safique Ahmed Faruque
                > > � Programmer
                > > �IBCS-Primax Software Ltd
                >
                > > #01717383729
                > > --- On Wed, 7/23/08, Marco Branco <marcobranco1975@ ...> wrote:
                > > From: Marco Branco <marcobranco1975@ ...>
                >
                > > Subject: [phpResource] URL question parameters
                > www.mydomain. com/index. php?id=2
                > > To:
                > > Date: Wednesday, July 23, 2008, 10:40 AM
                >
                > >
                > >
                > >
                > >
                > >
                > >
                > >
                > >
                > >
                > >
                > >
                > >
                > >
                > >
                > >
                > > hi
                > >
                > >
                > >
                > > i have this link in a web page (www.mydomain. com/index. php?id=2).
                >
                > >
                > >
                > >
                > > and in the index.php i have
                > >
                > >
                > >
                > > <?php
                > >
                > > (...)
                > >
                > > switch ($id)
                > >
                > > {
                > >
                > > ��� case 1: echo('um - 1'); break;
                >
                > >
                > > ��� case 2: echo('dois - 2'); break;
                > >
                > > ��� case 3: echo('tres - 3'); break;
                > >
                > > �� default: echo('defaulf - any');
                > >
                > > }
                > >
                > > (...)
                >
                > >
                > > ?>
                > >
                > >
                > >
                > > I alwys get the last line of the switch:� default - any
                > >
                > >
                > >
                > > Why?
                > >
                > >
                > >
                > > thank's in advance
                > >
                >
              Your message has been successfully submitted and would be delivered to recipients shortly.