Jump to content

johnnys

Members
  • Posts

    42
  • Joined

  • Last visited

Posts posted by johnnys

  1. I moved the 

    $result = $result['isProcessed'] ? "yes" : "n/a";

     code you supplied to another part of the page and now it says 'y' in every field column, apart from the isProcessed filed where it says 'yes'

  2. Hi,

     

    I have a table row that outputs some info, works fine - however instead of it displaying a '1' i'd like it to display 'yes'. Or if the field is empty display a 'n/a'.

     

    Is there anything I can add to my code below to get it working?

    <tr>                                  
         <th>Is Processed?</th>
         <td>{$result['isProcessed']}</td>
    
     </tr>

    Thanks in advance :)

     

    J

  3. ah i give up!

     

    I can now see the rest of my email just fine thanks to your instructions :)

     

    but it always posts a 'yes' whether the checkbox is ticked or not?! never a 'no' when unchecked.

     

    I've also added a 'hidden' checkbox field to my html form, I've seen online this can also help return unchecked values.

     

    see code below - 

    <input type="hidden" id="wallbox" value="0" name="wallbox">  
    <input type="checkbox" id="wallbox" value="1" name="wallbox">

    thanks again

  4. I finally got it working :)

     

    Thank you..

     

    One last thing.. now when the email sends, it's leaving out everything after where i placed the code?

     

    See below

     

                    <tr>
                          <td>Wall Box Patch?:</td> 
                          <td>".$isWallboxPatchReqd = isset($_REQUEST['wallbox']) ? 'yes' : 'no';"</td>
                    </tr>
                    
                    <tr>
                          <td>Setup Request?:</td>  
                          <td>".$isSetupHelpReqd."</td>
                    </tr>
                    
                    <tr>
                          <td>Reason For Setup?:</td> 
                          <td>".$reason."</td>
                    </tr>
                 
                  </tbody>
    </table>
    <p> thank you for blah blah </p>

    So everything after the 'Wall Box Patch' field is missing (although the code works!)

     

    Any ideas?

  5. Hi,

     

    Yes apologies for starting another thread, I thought it worked and was solved but it actually didnt!

     

    I followed your steps, firstly I got the error below on my webpage when trying to send the form - below

    SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '0,

    Then remembering your advice, I changed my database field from tinyint to varchar and then the above message disappeared, but a new one appeared - below

    SQLSTATE[42S22]: Column not found: 1054 Unknown column 'yes' in 'field list'

    This is as far as I am now,

     

    Thanks

  6. Hi,

     

    I need some help with a table on my website.

     

    Apologies for my lack of knowledge, I'm quite new to php, and I have been researching this problem for days now. I'm not even sure if I'm doing this the correct way?

     

    My webform contains two fields (amongst others) - code below

    <div class="controls">  
                    <input type="checkbox" id="wallbox_needs_patched" value="1" name="wallbox_needs_patched">
                    Please tick this box if you would like blah blah.
                </div>  
    
    <div class="controls">  
                    <label class="control-label" for="reason">Reason Details</label>
                    Tell us your reason blah blah.
                </div>

    I also have this php code relating to the wallbox_needs_patched field - code below

            if(isset($_REQUEST['wallbox_needs_patched']) && $_REQUEST['wallbox_needs_patched']==1 ){
               $isWallboxPatchReqd=1; 
            }else{
                $isWallboxPatchReqd=0;
            }

    The table code that I send to the user also works well - code below

    <table>
                  <tbody>     
                              
                    <tr>
                          <td>Wall Box Patch?:</td> 
                          <td>".$isWallboxPatchReqd."</td>
                    </tr>
                    
                    <tr>
                          <td>Reason?:</td> 
                          <td>".$reason."</td>
                    </tr>
             
                  </tbody>
    </table>

    This successfully sends the form to the user, and if the checkbox is 'checked' for the wallbox field it sends a '1' in the form otherwise a '0' is sent.

     

    I have two questions, in the email that is sent to the user how do I send a 'Yes' and 'No' instead of a '1' or '0' respectively. Also, if the 'reason' field is left blank (not filled in by the user), how do I insert 'N/A' into the form which is sent to them instead of it showing a blank field.

     

    Thanks in advance, and again excuse my ignorance. Taking this project over from somebody else.

     

    J

     

  7. Hi all,

     

    I need some help with a checkbox I have on my web form.

     

    Basically I have a checkbox saying 'click here if you need blah blah' - this successfully sends a '1' value to my sql db if checked, and a '0' value if not checked.

     

    What I want to do is email this form data to the user, but instead of displaying in the email 'click here if you need blah blah = 1' , I would like 'click here if you need blah blah = Yes'

     

    Below is code of my html form

                  <label class="checkbox"> 
     
                    <input type="checkbox" id="wallbox" value="1" name="wallbox">
    
                    If yes, please tick the box and fill in the details below.
    
                  </label>

    Below id code from my php page which emails form to user

            if(isset($_REQUEST['wallbox']) && $_REQUEST['wallbox']==1 ){
    
               $wallboxReqd=1; 
    
            }else{
    
                $wallboxReqd=0;
    
            }

    My sql db has a field tinyint for wallboxReqd, does this need to be changed to a varchar along with the input type of my html form?

     

    Hope this makes sense,

     

    Thanks again advance to anybody that can help.

     

    J

     

  8. HI,

     

    Relatively new to php here but experience with html & css.

     

    I have recently taken over a project from somebody, and I'm trying to make some minor adjustments to a few areas (mostly aesthetic). The system as a whole works fine, and can read from/write to the databases, as well as send emails etc...

     

    However I am encountering an issue which has me stuck, I have a button on my site 'compose email to user', when clicked a table is pulled from a database (ip_requests) displayed within a tinymce editor, 2 columns, 10 rows, border etc.. however when I click 'send' the table does in fact send successfully but the formatting seems to be ignored. The email arrives, containing all the information, however no border, bold, or coloured table cells.

     

    It seems like there is a 'strip html' command somewhere.

     

    Below is a sample of the code that produces the table within the tinymce editor;

    $strHtmlOutput.= '
       
    <tbody>
    <tr>                                  
                   $strHtmlOutput.= '<tr>                                  
                                <th>Date of Request</th>
                                <td>
    '.$result['cdate'].'
                                </td>
                              </tr>
                             ';
      
      $strHtmlOutput.= '<tr>                                  
                                <th>Date Last Modified</th>
                                <td>
    '.$result['mdate'].'
                                </td>
                              </tr>
                             ';                                     
        }
        
        $strHtmlOutput.='</tbody>
    </table>';

    There is a lot more code in the page itself, however maybe  some whizz will be able to help me based on the above code only? Excuse my ignorance in this!

     

    I have lots of  'compose email to user' buttons on my sitem which allows me to send the data on screen to an individual via email, but they all do the same (strip email formatting). So this must be a global setting?

     

    Any help would be appreciated.

     

    Thanks in advance,

     

    J

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.