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

Re: [bang-phpug] problem with php5

Expand Messages
  • maq sood
    Please see the code below...... Its better to use method in form tag, isset will also work, as when click submit sub will be set.... The code you have written
    Message 1 of 10 , Apr 17, 2007
    • 0 Attachment
      Please see the code below......

      Its better to use method in form tag, isset will also work, as when click submit sub will be set....

      The code you have written will also work if you make changes to magic_quotes in php.ini






      Vishwanath B <vishwanath_cse@...> wrote: hi.... i know the following is a simple program but the problem i am facing is i am not able to see the output as hi....
      just when i click the button the page is getting refreshed...
      i am using php5.2.0,Apache2.0
      Operating System-WIndows XP
      i am thinking that there will be some problem in php.ini or httpd.conf file...but i am unable to know where i went wrong.....
      can anyone help me plz....
      <html>
      <head>
      <meta>
      <title>Untitled Document</title>
      </head>
      <?
      if(isset($_POST['sub']))
      {
      echo "hi";
      }
      ?>
      <body>
      <form name="frm" method="post">
      <input type="submit" name="sub" value="Click">
      </form>
      </body>
      </html>

      ---------------------------------
      Ahhh...imagining that irresistible "new car" smell?
      Check outnew cars at Yahoo! Autos.

      [Non-text portions of this message have been removed]






      ---------------------------------
      Ahhh...imagining that irresistible "new car" smell?
      Check outnew cars at Yahoo! Autos.

      [Non-text portions of this message have been removed]
    • Vishwanath B
      hi ... thanks for all who gave me information ragarding isset...i came to know the problem and i executed the script by assinging value to $sub but the problem
      Message 2 of 10 , Apr 17, 2007
      • 0 Attachment
        hi ...
        thanks for all who gave me information ragarding isset...i came to know the problem and i executed the script by assinging value to $sub but the problem is not with isset, but with submit button....
        i executed many php scripts but no where that submit button is working ....
        any help ragarding this plz......

        Ved Prakash <prakash.ved.v@...> wrote:
        Vishwanath, You are trying to check for a variable to be set ($sub) that
        would never get set. first try getting the value of sub from global variable
        $_REQUEST. assign it to $sub, and your code would work.

        Regards,

        Ved

        On 17 Apr 2007 07:37:48 -0700, Vishwanath B <vishwanath_cse@...>
        wrote:
        >
        > hi.... i know the following is a simple program but the problem i am
        > facing is i am not able to see the output as hi....
        > just when i click the button the page is getting refreshed...
        > i am using php5.2.0,Apache2.0
        > Operating System-WIndows XP
        > i am thinking that there will be some problem in php.ini or httpd.conffile...but i am unable to know where i went wrong.....
        > can anyone help me plz....
        > <html>
        > <head>
        > <meta>
        > <title>Untitled Document</title>
        > </head>
        > <?
        > if(isset($sub))
        > {
        > echo "hi";
        > }
        > ?>
        > <body>
        > <form name="frm">
        > <input type="submit" name="sub" value="Click">
        > </form>
        > </body>
        > </html>
        >
        > ---------------------------------
        > Ahhh...imagining that irresistible "new car" smell?
        > Check outnew cars at Yahoo! Autos.
        >
        > [Non-text portions of this message have been removed]
        >
        >
        >

        [Non-text portions of this message have been removed]






        ---------------------------------
        Ahhh...imagining that irresistible "new car" smell?
        Check outnew cars at Yahoo! Autos.

        [Non-text portions of this message have been removed]
      • binay4ever
        Untitled Document
        Message 3 of 10 , Apr 17, 2007
        • 0 Attachment
          <html>
          <head>
          <meta>
          <title>Untitled Document</title>
          </head>
          <?
          if(isset($_POST['sub']))
          {
          echo "hi";
          }
          ?>
          <body>
          <form action="<? echo $HTTP_SERVER_VARS['PHP_SELF']; ?>" method="post"
          width="225" align="center">
          <input type="submit" name="sub" value="Click" >
          </form>
          </body>
          </html>

          i think ur problems is solves
          u need action in forms and method is must be declare and Post is use






          --- In bang-phpug@yahoogroups.com, Vishwanath B <vishwanath_cse@...>
          wrote:
          >
          > hi.... i know the following is a simple program but the problem i am
          facing is i am not able to see the output as hi....
          > just when i click the button the page is getting refreshed...
          > i am using php5.2.0,Apache2.0
          > Operating System-WIndows XP
          > i am thinking that there will be some problem in php.ini or
          httpd.conf file...but i am unable to know where i went wrong.....
          > can anyone help me plz....
          > <html>
          > <head>
          > <meta>
          > <title>Untitled Document</title>
          > </head>
          > <?
          > if(isset($sub))
          > {
          > echo "hi";
          > }
          > ?>
          > <body>
          > <form name="frm">
          > <input type="submit" name="sub" value="Click">
          > </form>
          > </body>
          > </html>
          >
          >
          >
          > ---------------------------------
          > Ahhh...imagining that irresistible "new car" smell?
          > Check outnew cars at Yahoo! Autos.
          >
          > [Non-text portions of this message have been removed]
          >
        • Ved Prakash
          Vishwanath, Submit button on your form is working fine, your program flow is wrong. There are lots of tutorials on php for beginners, you can look into them
          Message 4 of 10 , Apr 18, 2007
          • 0 Attachment
            Vishwanath, Submit button on your form is working fine, your program flow is
            wrong. There are lots of tutorials on php for beginners, you can look into
            them for solutions for your problem.

            Regards.

            On 18 Apr 2007 00:06:29 -0700, Vishwanath B <vishwanath_cse@...>
            wrote:
            >
            > hi ...
            > thanks for all who gave me information ragarding isset...i came to know
            > the problem and i executed the script by assinging value to $sub but the
            > problem is not with isset, but with submit button....
            > i executed many php scripts but no where that submit button is working
            > ....
            > any help ragarding this plz......
            >
            > Ved Prakash <prakash.ved.v@... <prakash.ved.v%40gmail.com>> wrote:
            > Vishwanath, You are trying to check for a variable to be set ($sub) that
            > would never get set. first try getting the value of sub from global
            > variable
            > $_REQUEST. assign it to $sub, and your code would work.
            >
            > Regards,
            >
            > Ved
            >
            > On 17 Apr 2007 07:37:48 -0700, Vishwanath B <vishwanath_cse@...<vishwanath_cse%40yahoo.com>
            > >
            > wrote:
            > >
            > > hi.... i know the following is a simple program but the problem i am
            > > facing is i am not able to see the output as hi....
            > > just when i click the button the page is getting refreshed...
            > > i am using php5.2.0,Apache2.0
            > > Operating System-WIndows XP
            > > i am thinking that there will be some problem in php.ini or
            > httpd.conffile...but i am unable to know where i went wrong.....
            > > can anyone help me plz....
            > > <html>
            > > <head>
            > > <meta>
            > > <title>Untitled Document</title>
            > > </head>
            > > <?
            > > if(isset($sub))
            > > {
            > > echo "hi";
            > > }
            > > ?>
            > > <body>
            > > <form name="frm">
            > > <input type="submit" name="sub" value="Click">
            > > </form>
            > > </body>
            > > </html>
            > >
            > > ---------------------------------
            > > Ahhh...imagining that irresistible "new car" smell?
            > > Check outnew cars at Yahoo! Autos.
            > >
            > > [Non-text portions of this message have been removed]
            > >
            > >
            > >
            >
            > [Non-text portions of this message have been removed]
            >
            > ---------------------------------
            > Ahhh...imagining that irresistible "new car" smell?
            > Check outnew cars at Yahoo! Autos.
            >
            > [Non-text portions of this message have been removed]
            >
            >
            >


            [Non-text portions of this message have been removed]
          • Vijay Kansal
            hi for this u have to set register_globals = on in php.ini or otherwise use $_POST[ sub ] i think it will solve ur problem Vishwanath B
            Message 5 of 10 , Apr 18, 2007
            • 0 Attachment
              hi

              for this u have to set register_globals = on in php.ini or otherwise use $_POST['sub']

              i think it will solve ur problem


              Vishwanath B <vishwanath_cse@...> wrote: hi.... i know the following is a simple program but the problem i am facing is i am not able to see the output as hi....
              just when i click the button the page is getting refreshed...
              i am using php5.2.0,Apache2.0
              Operating System-WIndows XP
              i am thinking that there will be some problem in php.ini or httpd.conf file...but i am unable to know where i went wrong.....
              can anyone help me plz....
              <html>
              <head>
              <meta>
              <title>Untitled Document</title>
              </head>
              <?
              if(isset($sub))
              {
              echo "hi";
              }
              ?>
              <body>
              <form name="frm">
              <input type="submit" name="sub" value="Click">
              </form>
              </body>
              </html>

              ---------------------------------
              Ahhh...imagining that irresistible "new car" smell?
              Check outnew cars at Yahoo! Autos.

              [Non-text portions of this message have been removed]






              ---------------------------------
              Ahhh...imagining that irresistible "new car" smell?
              Check outnew cars at Yahoo! Autos.

              [Non-text portions of this message have been removed]
            Your message has been successfully submitted and would be delivered to recipients shortly.