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

Re: Passing variable to frame page

Expand Messages
  • Md. Tahmidul Islam
    Hello Mr. morshed alam, Yes .. it s possible to do. No Worries. Thanks Tahmid Munaz http://phpxperts.com ... page, and have all 3 pages in the frame pick up
    Message 1 of 4 , Dec 5, 2005
    • 0 Attachment
      Hello Mr. morshed alam,

      Yes .. it's possible to do.
      No Worries.



      Thanks

      Tahmid Munaz
      http://phpxperts.com


      --- In phpexperts@yahoogroups.com, morshed alam <morshed48bd@y...> wrote:
      >
      > Hi
      >
      > Is it possible to send a variable through a hyperlink, to a frames
      page, and have all 3 pages in the frame pick up the variable using the
      $_request[var] ?
      >
      > In other words, I click on a link that has ?id=2 lets say.. it goes to a
      > page called say index.asp the index page has a top, main, and a left.
      > how do i get each one of those to receive the variable, when i can
      only send
      > it to one page? or is it possible to send it to more than one page,
      but only
      > travel to one page? so the link looks like index.asp?id=<%=var%>
      >
      > Morshed.
      >
      >
      > ---------------------------------
      > Yahoo! DSL Something to write home about. Just $16.99/mo. or less
      >
    • lamy_ici
      hmnn... strange to see an ASP script in a PHP group, but in general your question applies to either variable through a hyperlink/link refers to QueryString, to
      Message 2 of 4 , Dec 5, 2005
      • 0 Attachment
        hmnn... strange to see an ASP script in a PHP group, but in general
        your question applies to either

        variable through a hyperlink/link refers to QueryString, to retrieve
        its value you can use the following code

        in PHP
        <?
        $variable = $_GET["variable"]
        ?>
        or
        <?
        $variable = $_REQUEST["variable"]
        ?>

        in ASP
        <%
        variable = Request.QueryString("variable")
        %>

        since you are using a FRAME tag you would have to write each SRC for
        the frames you created, appending the variable name and the value to
        the URL (see http://www.w3schools.com/tags/tag_frame.asp for FRAME tag
        properties)

        heres an example
        http://www.yourdomain.com/index.php?variable=variable

        in PHP
        <A HREF="index.php?variable<?=$variable;?>">Click here</A>
        or
        <A HREF="index.php?variable<? echo $variable; ?>">Click here</A>

        in ASP
        <A HREF="index.php?variable<%=variable%>">Click here</A>
        or
        <A HREF="index.php?variable<% Response.Write(variable) %>">Click here</A>

        you would have to URL encode it specially if youre using some special
        characters for the values to be read properly (for some browsers)

        in PHP
        <?
        $variable = urlencode($_GET["variable"]);
        ?>

        in ASP
        <%
        variable = Server.URLEncode(Request.QueryString("variable"))
        %>

        and be careful not to use HTML entities as variable name for it will
        be read as an actual entity instead of your desired name

        passing it to other pages should be done from the main frame, where
        your FRAME tag is, then retrieve it in those pages you specified as
        the URL for SRC of your FRAME

        --- In phpexperts@yahoogroups.com, morshed alam <morshed48bd@y...> wrote:
        >
        > Hi
        >
        > Is it possible to send a variable through a hyperlink, to a frames
        page, and have all 3 pages in the frame pick up the variable using the
        $_request[var] ?
        >
        > In other words, I click on a link that has ?id=2 lets say.. it goes to a
        > page called say index.asp the index page has a top, main, and a left.
        > how do i get each one of those to receive the variable, when i can
        only send
        > it to one page? or is it possible to send it to more than one page,
        but only
        > travel to one page? so the link looks like index.asp?id=<%=var%>
        >
        > Morshed.
        >
        >
        > ---------------------------------
        > Yahoo! DSL Something to write home about. Just $16.99/mo. or less
        >
      • morshed alam
        Dear lamy_ici Thank you vary much for your solution. I have solved my problem by your suggestion. Its working nice. Morshed lamy_ici
        Message 3 of 4 , Dec 5, 2005
        • 0 Attachment
          Dear lamy_ici
           
          Thank you vary much for your solution. I have solved my problem by your suggestion. Its working nice.
           
          Morshed


          lamy_ici <lamy_ici@...> wrote:
          hmnn... strange to see an ASP script in a PHP group, but in general
          your question applies to either

          variable through a hyperlink/link refers to QueryString, to retrieve
          its value you can use the following code

          in PHP
          <?
          $variable = $_GET["variable"]
          ?>
              or
          <?
          $variable = $_REQUEST["variable"]
          ?>

          in ASP
          <%
          variable = Request.QueryString("variable")
          %>

          since you are using a FRAME tag you would have to write each SRC for
          the frames you created, appending the variable name and the value to
          the URL (see http://www.w3schools.com/tags/tag_frame.asp for FRAME tag
          properties)

          heres an example
          http://www.yourdomain.com/index.php?variable=variable

          in PHP
          <A HREF="index.php?variable<?=$variable;?>">Click here</A>
              or
          <A HREF="index.php?variable<? echo $variable; ?>">Click here</A>

          in ASP
          <A HREF="index.php?variable<%=variable%>">Click here</A>
              or
          <A HREF="index.php?variable<% Response.Write(variable) %>">Click here</A>

          you would have to URL encode it specially if youre using some special
          characters for the values to be read properly (for some browsers)

          in PHP
          <?
          $variable = urlencode($_GET["variable"]);
          ?>

          in ASP
          <%
          variable = Server.URLEncode(Request.QueryString("variable"))
          %>

          and be careful not to use HTML entities as variable name for it will
          be read as an actual entity instead of your desired name

          passing it to other pages should be done from the main frame, where
          your FRAME tag is, then retrieve it in those pages you specified as
          the URL for SRC of your FRAME

          --- In phpexperts@yahoogroups.com, morshed alam <morshed48bd@y...> wrote:
          >
          > Hi
          >   
          >   Is it possible to send a variable through a hyperlink, to a frames
          page, and have all 3 pages in the frame pick up the variable using the
          $_request[var] ?
          >
          > In other words, I click on a link that has ?id=2 lets say.. it goes to a
          > page called  say index.asp the index page has a top, main, and a left.
          > how do i get each one of those to receive the variable, when i can
          only send
          > it to one page? or is it possible to send it to more than one page,
          but only
          > travel to one page? so the link looks like index.asp?id=<%=var%>
          >   
          >   Morshed.
          >
          >            
          > ---------------------------------
          >  Yahoo! DSL Something to write home about. Just $16.99/mo. or less
          >








          Visit phpXperts website at www.phpxperts.com



          Yahoo! Personals
          Single? There's someone we'd like you to meet.
          Lots of someones, actually. Try Yahoo! Personals

        Your message has been successfully submitted and would be delivered to recipients shortly.