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

Re: [phpXperts] Empty field becomes right-slash

Expand Messages
  • BobSharp
    Nope didn t work. It s a right(forward) slash, not a backslash that I m seeing. There are other required fields before these (Firstname and Surname) that
    Message 1 of 10 , Nov 24, 2010
    • 0 Attachment
      Nope     didn't work.  
       
      It's a right(forward) slash,  not a backslash that I'm seeing.
       
      There are other required fields before these 
      (Firstname and Surname)  that are ok when blank (because they are alphanumeric). 
       
      I agree that this says slashes are being added somewhere. 
      Could it be from the preg_match(.....) patterns  ?  
      Is there any other test for empty/blank  ?
       
       
       
       
       
       
       
       
       
       
       
       
       
       
       
      ----- Original Message -----
      Sent: Wednesday, November 24, 2010 4:43 AM
      Subject: Re: [phpXperts] Empty <Input> field becomes right-slash

       

      Hi,


      Following code may help- Put that top of all your codes.

      if ( get_magic_quotes_gpc() ) 
                      {
                          $_POST['qMail'] = stripslashes( $_POST['qMail'] );
                      }

      it checks is Magic_quotes_gpc on in the server conf. and then strip the slashes in the codes. magic_quotes_gpc add a backslash after a backslash ( \ ), a single-quote ( ' ), a double-quote ( " ) and a null character ( \0 ).
      In your case it found a Null character and added a backslash.

      Let us know, if that worked.


      Thanks.

      On Wed, Nov 24, 2010 at 8:03 AM, BobSharp <bobsharp@...> wrote:
       

      If I leave the email or date <input> fields blank,  they are (after validation) with a single right-slash in the box.          
      Any way to avoid this ?
       
      I'm using the $_POST[fieldname] data to fill the <input> fields.
      So,  if input was blank -  what is in the $_Post array element that gives the right-slash ?
       
       
      <input type="text" name="qMail" size="46" maxlength="255" tabindex="11" value=<?php echo $_POST['qMail']; ?>  />
       
      <input type="text" name="qDate" size="10" tabindex="13" value=<?php echo $_POST['qDate']; ?>  /> 

       
      if ( (!isset($_POST['qMail'])) || ($_POST['qMail'] == "") )
      {
          $qError .= "Email address must be given  <br />"; 
      }else{  ............; }
       

      if (!isset($_POST['qDate']) || ($_POST['qDate'] == "") )
      {
      //   field can be left blank  
      }
      elseif ( ..................;)
      { .................; 
      }
       
       
       




      --
      Best Regards
      Abdullah Al Jahid 

    • Anjan Bhowmik
      Perhaps u should replace this portion value= with this - value= I see that the value is not in
      Message 2 of 10 , Nov 24, 2010
      • 0 Attachment
        Perhaps u should replace this portion 

        value=<?php echo $_POST['qMail']; ?>

        with this -

        value="<?php echo $_POST['qMail']; ?>"

        I see that the value is not in "", it could be the source of the problem. give it a check.

        Thanks,
        Anjan

        On Wed, Nov 24, 2010 at 5:10 PM, BobSharp <bobsharp@...> wrote:
         

        Nope     didn't work.  
         
        It's a right(forward) slash,  not a backslash that I'm seeing.
         
        There are other required fields before these 
        (Firstname and Surname)  that are ok when blank (because they are alphanumeric). 
         
        I agree that this says slashes are being added somewhere. 
        Could it be from the preg_match(.....) patterns  ?  
        Is there any other test for empty/blank  ?
         
         
         
         
         
         
         
         
         
         
         
         
         
         
         
        ----- Original Message -----
        Sent: Wednesday, November 24, 2010 4:43 AM
        Subject: Re: [phpXperts] Empty <Input> field becomes right-slash

         

        Hi,


        Following code may help- Put that top of all your codes.

        if ( get_magic_quotes_gpc() ) 
                        {
                            $_POST['qMail'] = stripslashes( $_POST['qMail'] );
                        }

        it checks is Magic_quotes_gpc on in the server conf. and then strip the slashes in the codes. magic_quotes_gpc add a backslash after a backslash ( \ ), a single-quote ( ' ), a double-quote ( " ) and a null character ( \0 ).
        In your case it found a Null character and added a backslash.

        Let us know, if that worked.


        Thanks.

        On Wed, Nov 24, 2010 at 8:03 AM, BobSharp <bobsharp@...> wrote:
         

        If I leave the email or date <input> fields blank,  they are (after validation) with a single right-slash in the box.          
        Any way to avoid this ?
         
        I'm using the $_POST[fieldname] data to fill the <input> fields.
        So,  if input was blank -  what is in the $_Post array element that gives the right-slash ?
         
         
        <input type="text" name="qMail" size="46" maxlength="255" tabindex="11" value=<?php echo $_POST['qMail']; ?>  />
         
        <input type="text" name="qDate" size="10" tabindex="13" value=<?php echo $_POST['qDate']; ?>  /> 

         
        if ( (!isset($_POST['qMail'])) || ($_POST['qMail'] == "") )
        {
            $qError .= "Email address must be given  <br />"; 
        }else{  ............; }
         

        if (!isset($_POST['qDate']) || ($_POST['qDate'] == "") )
        {
        //   field can be left blank  
        }
        elseif ( ..................;)
        { .................; 
        }
         
         
         




        --
        Best Regards
        Abdullah Al Jahid 




        --
        Anjan Bhowmik
        Software & Web Development Department
        Ultra Soft
        Mobile : +8801670556419,+8801673636742
        Email : anjan011@...,info@...
      • BobSharp
        Didn t work either. I have put it up live on www.NeedleSharp.co.uk for you to see the problem Go to SERVICES, then QUOTATION. Email is a required field.
        Message 3 of 10 , Nov 25, 2010
        • 0 Attachment
          
          Didn't work either.
           
          I have put it up live on  www.NeedleSharp.co.uk  for you to see the problem
          Go to SERVICES,  then QUOTATION.
          Email is a required field.  Date is optional.
           
           
           
          ----- Original Message -----
          Sent: Wednesday, November 24, 2010 11:32 AM
          Subject: Re: [phpXperts] Empty <Input> field becomes right-slash

           

          Perhaps u should replace this portion 


          value=<?php echo $_POST['qMail']; ?>

          with this -

          value="<?php echo $_POST['qMail']; ?>"

          I see that the value is not in "", it could be the source of the problem. give it a check.

          Thanks,
          Anjan

          On Wed, Nov 24, 2010 at 5:10 PM, BobSharp <bobsharp@...> wrote:
           

          Nope     didn't work.  
           
          It's a right(forward) slash,  not a backslash that I'm seeing.
           
          There are other required fields before these 
          (Firstname and Surname)  that are ok when blank (because they are alphanumeric). 
           
          I agree that this says slashes are being added somewhere. 
          Could it be from the preg_match(.....) patterns  ?  
          Is there any other test for empty/blank  ?
           
           
           
           
           
           
           
           
           
           
           
           
           
           
           
          ----- Original Message -----
          Sent: Wednesday, November 24, 2010 4:43 AM
          Subject: Re: [phpXperts] Empty <Input> field becomes right-slash

           

          Hi,


          Following code may help- Put that top of all your codes.

          if ( get_magic_quotes_gpc() ) 
                          {
                              $_POST['qMail'] = stripslashes( $_POST['qMail'] );
                          }

          it checks is Magic_quotes_gpc on in the server conf. and then strip the slashes in the codes. magic_quotes_gpc add a backslash after a backslash ( \ ), a single-quote ( ' ), a double-quote ( " ) and a null character ( \0 ).
          In your case it found a Null character and added a backslash.

          Let us know, if that worked.


          Thanks.

          On Wed, Nov 24, 2010 at 8:03 AM, BobSharp <bobsharp@...> wrote:
           

          If I leave the email or date <input> fields blank,  they are (after validation) with a single right-slash in the box.          
          Any way to avoid this ?
           
          I'm using the $_POST[fieldname] data to fill the <input> fields.
          So,  if input was blank -  what is in the $_Post array element that gives the right-slash ?
           
           
          <input type="text" name="qMail" size="46" maxlength="255" tabindex="11" value=<?php echo $_POST['qMail']; ?>  />
           
          <input type="text" name="qDate" size="10" tabindex="13" value=<?php echo $_POST['qDate']; ?>  /> 

           
          if ( (!isset($_POST['qMail'])) || ($_POST['qMail'] == "") )
          {
              $qError .= "Email address must be given  <br />"; 
          }else{  ............; }
           

          if (!isset($_POST['qDate']) || ($_POST['qDate'] == "") )
          {
          //   field can be left blank  
          }
          elseif ( ..................;)
          { .................; 
          }
           
           
           




          --
          Best Regards
          Abdullah Al Jahid 




          --
          Anjan Bhowmik
          Software & Web Development Department
          Ultra Soft
          Mobile : +8801670556419,+8801673636742
          Email : anjan011@...,info@...

        • Anjan Bhowmik
          hello Bob! I can see that after the post the user is taken to: http://www.needlesharp.co.uk/quote_proc_2.php If
          Message 4 of 10 , Nov 25, 2010
          • 0 Attachment
            hello Bob!

            I can see that after the post the user is taken to: http://www.needlesharp.co.uk/quote_proc_2.php

            If u go directly to that page without making the post, u will see that these -

            First Name must be given
            Surname must be given
            Email address must be given

            also the email/date fields have the slash / set.

            These are showing EVEN without making a POST. So, be sure that that page is really processing the post from the quote.php page. 

            Thanks,
            Anjan

            On Thu, Nov 25, 2010 at 2:19 PM, BobSharp <bobsharp@...> wrote:
             

            

            Didn't work either.
             
            I have put it up live on  www.NeedleSharp.co.uk  for you to see the problem
            Go to SERVICES,  then QUOTATION.
            Email is a required field.  Date is optional.
             
             
             
            ----- Original Message -----
            Sent: Wednesday, November 24, 2010 11:32 AM
            Subject: Re: [phpXperts] Empty <Input> field becomes right-slash

             

            Perhaps u should replace this portion 

            value=<?php echo $_POST['qMail']; ?>

            with this -

            value="<?php echo $_POST['qMail']; ?>"

            I see that the value is not in "", it could be the source of the problem. give it a check.

            Thanks,
            Anjan

            On Wed, Nov 24, 2010 at 5:10 PM, BobSharp <bobsharp@...> wrote:
             

            Nope     didn't work.  
             
            It's a right(forward) slash,  not a backslash that I'm seeing.
             
            There are other required fields before these 
            (Firstname and Surname)  that are ok when blank (because they are alphanumeric). 
             
            I agree that this says slashes are being added somewhere. 
            Could it be from the preg_match(.....) patterns  ?  
            Is there any other test for empty/blank  ?
             
             
             
             
             
             
             
             
             
             
             
             
             
             
             
            ----- Original Message -----
            Sent: Wednesday, November 24, 2010 4:43 AM
            Subject: Re: [phpXperts] Empty <Input> field becomes right-slash

             

            Hi,


            Following code may help- Put that top of all your codes.

            if ( get_magic_quotes_gpc() ) 
                            {
                                $_POST['qMail'] = stripslashes( $_POST['qMail'] );
                            }

            it checks is Magic_quotes_gpc on in the server conf. and then strip the slashes in the codes. magic_quotes_gpc add a backslash after a backslash ( \ ), a single-quote ( ' ), a double-quote ( " ) and a null character ( \0 ).
            In your case it found a Null character and added a backslash.

            Let us know, if that worked.


            Thanks.

            On Wed, Nov 24, 2010 at 8:03 AM, BobSharp <bobsharp@...> wrote:
             

            If I leave the email or date <input> fields blank,  they are (after validation) with a single right-slash in the box.          
            Any way to avoid this ?
             
            I'm using the $_POST[fieldname] data to fill the <input> fields.
            So,  if input was blank -  what is in the $_Post array element that gives the right-slash ?
             
             
            <input type="text" name="qMail" size="46" maxlength="255" tabindex="11" value=<?php echo $_POST['qMail']; ?>  />
             
            <input type="text" name="qDate" size="10" tabindex="13" value=<?php echo $_POST['qDate']; ?>  /> 

             
            if ( (!isset($_POST['qMail'])) || ($_POST['qMail'] == "") )
            {
                $qError .= "Email address must be given  <br />"; 
            }else{  ............; }
             

            if (!isset($_POST['qDate']) || ($_POST['qDate'] == "") )
            {
            //   field can be left blank  
            }
            elseif ( ..................;)
            { .................; 
            }
             
             
             




            --
            Best Regards
            Abdullah Al Jahid 




            --
            Anjan Bhowmik
            Software & Web Development Department
            Ultra Soft
            Mobile : +8801670556419,+8801673636742
            Email : anjan011@...,info@...




            --
            Anjan Bhowmik
            Software & Web Development Department
            Ultra Soft
            Mobile : +8801670556419,+8801673636742
            Email : anjan011@...,info@...
          • BobSharp
            Hi Thanks for your help. Lots of experimenting and finally got it working ...
            Message 5 of 10 , Nov 25, 2010
            • 0 Attachment
              
              Hi
               
              Thanks for your help. 
               
              Lots of experimenting and finally got it working ...
               
              <input type="text" name="qDate" size="10" tabindex="12" value="<?php echo stripslashes($_POST['qDate']); ?>" />  <font size="-2"> dd/mm/yyyy</font>   
               
               
              Not at all sure why/how the slashes got in,   or why the stripslashes() didn't work on previous attempts. 
               
               
              cheers
               
                    Bob
               
               
                    www.NeedleSharp.co.uk       ( SERVICES  >  "QUOTATION" ) 
               
               
            • Joe Forsythe
              I m not finding a SERVICES link. There are a couple of issues. 1. We have never received complete code, so we can t properly debug it. 2. You weren t clear
              Message 6 of 10 , Nov 27, 2010
              • 0 Attachment
                I'm not finding a "SERVICES" link.

                There are a couple of issues.
                1. We have never received complete code, so we can't properly debug it.
                2. You weren't clear on the type of value you were being returned. "Right slash" is "/", but it's going to be highly likely that you meant a left slash: "\".

                Give us:
                1. Complete code.
                2. Sample input.
                3. Sample output.
                --
                Joe

                On Thu, Nov 25, 2010 at 2:19 AM, BobSharp <bobsharp@...> wrote:

                Didn't work either.
                 
                I have put it up live on  www.NeedleSharp.co.uk  for you to see the problem
                Go to SERVICES,  then QUOTATION.
                Email is a required field.  Date is optional.
              • BobSharp
                Sorry .... www.NeedleSharp.co.uk AboutUs Services Quotation All files attached unzip to a server (www) The errors are not occuring now,
                Message 7 of 10 , Nov 27, 2010
                • 1 Attachment
                • 1.1 MB
                Sorry ....  www.NeedleSharp.co.uk    AboutUs   >   Services   >   Quotation
                 
                All files attached    unzip to a server (www)
                 
                The errors are not occuring now,   but removing one or other of
                the "stripslashes($_POST[' '])" might show the problem again. 
                 
                It was definately a right-slash  /  that I was seeing.
                 
                It's probably obvious that I am an amateur at PHP/CSS/MySQL. 
                My aim was to collect the data into a file that could be turned
                into a .csv to import into a Contacts List or MySQL database
                table; rather than have it emailed to me, then cut-&-pasted into
                the database.
                 
                Any further tips or suggestions would be most welcome.
                 
                 
                best regards
                 
                      Bob Sharp
                 
                 
                ===============  =================  ================ 

                 

                I'm not finding a "SERVICES" link.

                 
                There are a couple of issues.
                1. We have never received complete code, so we can't properly debug it.
                2. You weren't clear on the type of value you were being returned. "Right slash" is "/", but it's going to be highly likely that you meant a left slash: "\".

                Give us:
                1. Complete code.
                2. Sample input.
                3. Sample output.
                --

                Joe

                On Thu, Nov 25, 2010 at 2:19 AM, BobSharp <bobsharp@...> wrote:

                Didn't work either.
                 
                I have put it up live on  www.NeedleSharp.co.uk  for you to see the problem
                Go to SERVICES,  then QUOTATION.
                Email is a required field.  Date is optional.

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