Jump to content

sparkymom7

New Members
  • Posts

    3
  • Joined

  • Last visited

Posts posted by sparkymom7

  1. I will try to do my best to explain my situation. I have an HTML form that is using the following action 
    <form name= "transferform" method="POST" action="send.php"> 

     

    At one point this was working fine when I previewed it from any browser in Dreamweaver but now it isn't working. I had also tested it directly from the server and for some reason (unbeknownst to me) these are not working anymore. However, if I type in the path to Xampp which resides on Windows 7 server it works fine. AND if type in the path using browsers from Parallels Window 7 it also works fine.

     

    Does anyone have any clue why this might be happening? The code is fine because as you can see from the attached document I am receiving Thank you responses and emails 8 out of 14 tests.

     

    Thanks

     

     

    websrv-02/xampp/htdocs/transferform/transfer.html action="send.php" OS / Browser Results     Parallel windows/Firefox>websrv-02 path Thank you received and emails go out     Parallel windows/IE>websrv-02 path Thank you received and emails go out             Mac OSX/Dreamweaver>Preview=Safari send.php code opens up, path in browser = file:///Volumes/xampp/htdocs/transferform/send.php     Mac/Safari, type in path Thank you received and emails go out             Mac OSX/Dreamweaver>Preview=Firefox get msg to open file with Text Wrangler from: /Volumes/xampp/htdocs/transferform     Mac/Firefox, type in path Thank you received and emails go out             Mac OSX/Dweaver>Preview=googleChrome send.php code opens up, path in browser = file:///Volumes/xampp/htdocs/transferform/send.php     Mac/google Chrome, type in path Thank you received and emails go out             Mac OSX/Dweaver>preview=CanaryChrome Webpage is not found, path=file:///xampp/htdocs/transferform/transfer.html     Mac/Canary Chrome, type in path Thank you received and emails go out             websrv-02/ - select path = /xampp/htdocs/transferform/transfer/html and open with googleChrome send.php code opens up, path in browser = file:///Volumes/xampp/htdocs/transferform/send.php     Websrv-02 - open google chrome, type in path Thank you received and emails go out             websrv-02/ select path = xampp/htdocs/transferform/transfer/html and open with IE msg. Do you want to open or save this file?open=send.php code, save=send(php)     Websrv-02 - open IE and type in path Thank you received and emails go out    
  2. I am trying to setup an html file to automatically start playing from our local weather channel. Trust me I have tried everything from auto play=1 to autoplay=true in and out of quotes. I even had embedded source but to no avail, below is my latest code. Anyone have any thoughts on this one? Also, I am saving it to my Xampp/htdocs server and running it from there.

     

    Thanks in Advance

    <!doctype html>
    <html>
    <head>
    <meta charset="utf-8">
    <title>Local Weather</title>
    
    </head>
    <body>
    
    <object width="750" height="525" id="_49387396" data="http://wwwcache.wral.com/presentation/v2/flash/video/vp-wral.swf?v=20130502b?autoplay=1" type="application/x-shockwave-flash">
    
    <param name="movie" value="http://wwwcache.wral.com/presentation/v2/flash/video/vp-wral.swf?v=20130502b?autplay=1" />
    <param name="allowfullscreen" value="true" />
    <param name="allowscriptaccess" value="always" />
    
    <param name="flashvars" value="config={'url':'http://www.wral.com/weather/video/1076424/?version=fpconfig','plugins':{}}" />
    
    
    </object>
    
    </body>
    
    </html>
    
  3. Hi All,

     

    What originally seemed like a simple form has turned into my worst nightmare because I had no clue about PHP and minimal javascript knowledge.

    • I have created an HTML form with some Javascript and PHP. I am finally able to get the code to work by sending email behind the scenes to appropriate branches. I ended up using PHPMailer.
    • At this time I won't be pulling data from a database, the fields will filled in by user.
    • This will be an internal form, launched from Sharepoint through a different server.
    • I don't need to validate email addresses because I have them built in behind the scenes in my php code.  
    • Now I have to figure out the best way to validate so that when a user fills out the form there are no empty fields. I have tried several different ways to validate but my success rate is not good.

     

    Questions:

    1.) Does PHP validation go at the beginning of HTML code?

    2.) If so, how does one close it off? In other words does the closing ?> //closing PHP

         go at the bottom of HTML code just above </html>?

    3.) I do have a good working send.php that sends out an email with appropriate fields and content once form is submitted. I don't think validation should go within this code. Right?

     

    I need to validate the following required fields:

    • Text fields (stock #, serial #, description, Requested by, Customer Information
    • Requested Date Field (jScript Datepicker)
    • 2 drop down fields

    Attached is my code, like I said I have tried so many things. If I attempt to submit the form with blank fields I don't receive any errors. I end up receiving blank emails -

     

     

    Stock Number:
    Serial Number:
    Description:
    Requested By:
    Requested Date: Click to Select Date
    Customer Info:
    Requesting Branch:
    Shipping Branch:
     
    I hope someone can help me out.
    Thanks in Advance...
    <!doctype html>
    <html>
    <head>
    <meta charset="UTF-8">
    <title>Transfer Form</title>
    <link href="css/goods.css" rel="stylesheet" type="text/css">
    
    <script src="http://code.jquery.com/jquery-1.9.1.js"></script>
    <script src="http://code.jquery.com/ui/1.10.3/jquery-ui.js"></script>
    
    <script type="text/javascript">
    $(document).ready(function() {
        $('a').click(function() {
            $('#myTable tbody').append('<tr class="child"><td><input type="text" name="stockNumber" class="stocktext"  id="stockNumber" /></td><td><input type="text" name="serialNumber" class="serialtext" id="serialNumber" /></td><td><input type="text" name="description" class="descripttext" id="description"/></td></tr>');
        
    });
    });
    </script>
    
    <script>
      $(function() {
        $( "#datepicker" ).datepicker();
      });
      </script>
    </head>
    
    <body>
    
    <form name= "transfer" method="POST" action="send.php"> 
    
    <fieldset>
    <legend class="legend"> Transfer Form</legend>
    
    <p class="currentdate">Current Date: 
    <script type="text/javascript">
    <!--
    var currentTime = new Date()
    var month = currentTime.getMonth() + 1
    var day = currentTime.getDate()
    var year = currentTime.getFullYear()
    document.write(month + "/" + day + "/" + year)
    //-->
    </script></p>
    
    <p>
    <table class="table">
        <tr>
          <td><span class="requiredtable">*</span> <span class="fieldtext">Stock Number</span></td>
          <td><span class="requiredtable">*</span> <span class="fieldtext">Serial Number</span></td>
          <td class="descripttd"><span class="descriptiontxt"> Description</span></td>
        </tr>
      </table>
      
      <table id="myTable">
      <tbody>
        <tr>
          <TD> <input name="stockNumber" type="text" class="stocktext"  id="stockNumber" placeholder="Enter Stock Number" tabindex="1"  /></TD>
                
          <TD> <input type="text" name="serialNumber" class="serialtext" id="serialNumber" placeholder="Enter Serial Number" tabindex="2" /> </TD>
                
          <TD> <input type="text" name="description" class="descripttext" id="description" placeholder="Enter Description" tabindex="3" /> </TD>
        </tr>
      </tbody>
    </table> 
        
     <p><span class="required">*
        </span><span class="fieldtext">Requested by:
        </span>
        <input type="text" name="Requested_by" required id="Requested_by" size="50" maxlength="500" tabindex="4">
            
          <span class="requestdate"><span class="required">*</span> Requested Date:
    <input type="text" name="requestedDate" required id="datepicker" value="Click to Select Date" tabindex="5"></span>
      </p>
        
      <p><span class="required">*</span>
      <span class="fieldtext">Customer Info:</span>
            <input type="text" name="Cust Info" required id="Cust_Info" size="50" maxlength="500" tabindex="6">
      </p>
    
     <label for="RequestingBranch"> 
         <span class="required">*</span>
         <span class="fieldtext"> Requesting Branch:</span>
        </label>
        
    <select class="select" name="R_branch" id="R_branch">
    <option value="">Select One:
    <option value="R_boston">Boston
    <option value="R_Buffalo">Buffalo
    <option value="R_Cinncinatti">Cinncinatti
    <option value="R_columbia">Columbia
    <option value="R_Dallas">Dallas
    <option value="R_Fairfax">Fairfax
    <option value="R_Kansas City">Kansas City
    <option value="R_Los Angeles">Los Angeles
    <option value="R_Orlando">Orlando
    <option value="R_Raleigh">Raleigh
    <option value="R_Toledo">Toledo
    <option value="R_Topeka">Topeka
    </select>
     
        <label for="ShippingBranch">
         <span class="required">*</span>
         <span class="fieldtext"> Shipping Branch:</span>
        </label>
      
       <select class="select" name="S_branch" id="S_branch">
    <option value="">Select One:
    <option value="S_boston">Boston
    <option value="S_Buffalo">Buffalo
    <option value="S_Cinncinatti">Cinncinatti
    <option value="S_columbia">Columbia
    <option value="S_Dallas">Dallas
    <option value="S_Fairfax">Fairfax
    <option value="S_Kansas City">Kansas City
    <option value="S_Los Angeles">Los Angeles
    <option value="S_Orlando">Orlando
    <option value="S_Raleigh">Raleigh
    <option value="S_Toledo">Toledo
    <option value="S_Topeka">Topeka
      </select>
        <br> <br>
     <input name="submit" class="button" value="Submit Form" type="submit">
          
        <input name="resetbutton" type="reset" id="resetbutton" value="Clear"></p>
        
      </fieldset>
    </form>
    
    </body>
    </html>
    
    
    <?php 
    sleep(2)/
    require('../PHPMailer/class.phpmailer.php');
    
    $mail = new PHPMailer();
    
    $mail->IsSMTP();  // telling the class to use SMTP
    $mail->Host     = "ipaddress"; // SMTP server
    
    //Sanitize incoming data and store in variable
    
    $stockNumber =  trim(stripslashes(htmlspecialchars ($_POST['stockNumber'])));        
    $serialNumber =  trim(stripslashes(htmlspecialchars ($_POST['serialNumber'])));    
    $description =  trim(stripslashes(htmlspecialchars ($_POST['description'])));    
    $requestedBy = trim(stripslashes(htmlspecialchars ($_POST['requestedBy'])));
    $requestedDate =  trim(stripslashes(htmlspecialchars ($_POST['requestedDate'])));    
    $customerInfo =  trim(stripslashes(htmlspecialchars ($_POST['customerInfo'])));    
    $R_branch = trim(stripslashes(htmlspecialchars ($_POST['R_branch'])));
    $S_branch = trim(stripslashes(htmlspecialchars ($_POST['S_branch'])));
    
    $R_branch = ucfirst(substr($R_branch, 2));  // removes the R_ and capitalizes first letter of branch in final output to email
    $S_branch = ucfirst(substr($S_branch, 2));  // removes the S_ and capitalizes first letter of branch in final output to email
        
    // Array for the R_emails option from form
    $R_emails = array(
        'R_boston' => 'boston@test.com', 
        'R_buffalo' => 'buffalo@emailhere.com',
        'R_cinncinatti' => 'cinncinatti@email.com', 
        'R_columbia' => 'columbia@test.com',
        'R_dallas' => 'dallas@emailhere.com',  
        'R_fairfax' => 'fairfax@emailhere.com', 
        'R_kansas' => 'kansas@email.com', 
        'R_la' => 'la@emailhere.com',
        'R_orlando' => 'orlando@email.com', 
        'R_raleigh' => 'raleigh@emailhere.com',
        'R_toledo' => 'toledo@emailhere.com',
        'R_topeka' => 'topeka@emailhere.com', 
    );
    
    // get receiving email and turn in the the R_email variable
    $R_email = $R_email[ $_POST['R_branch'] ];    
    
    // Array for the S_emails option from form
    $S_emails = array(
        'S_boston' => 'boston@test.com', 
        'S_buffalo' => 'buffalo@emailhere.com',
        'S_cinncinatti' => 'cinncinatti@email.com', 
        'S_columbia' => 'columbia@test.com',
        'S_dallas' => 'dallas@emailhere.com',  
        'S_fairfax' => 'fairfax@emailhere.com', 
        'S_kansas' => 'kansas@email.com', 
        'S_la' => 'la@emailhere.com',
        'S_orlando' => 'orlando@email.com', 
        'S_raleigh' => 'raleigh@emailhere.com',
        'S_toledo' => 'toledo@emailhere.com',
        'S_topeka' => 'topeka@emailhere.com', 
            
    );
    
    // get receiving email and turn in the the S_email variable
    $S_email = $S_emails[ $_POST['S_branch'] ];    
    
    //Prepare information from form to be sent 
    $body = 'Stock Number: ' .$stockNumber . PHP_EOL;
    $body .= 'Serial Number: ' .$serialNumber . PHP_EOL;
    $body .= 'Description: ' .$description . PHP_EOL;
    $body .= 'Requested By: ' .$requestedBy . PHP_EOL;
    $body .= 'Requested Date: ' .$requestedDate . PHP_EOL;
    $body .= 'Customer Info: ' .$customerInfo . PHP_EOL;
    $body .= 'Requesting Branch: ' .$R_branch . PHP_EOL;
    $body .= 'Shipping Branch: ' .$S_branch . PHP_EOL;
     
    // Form data was successful so we will now send admin email and return message to the user
    $mail = new PHPMailer();
     
    $mail->IsSMTP();
    $mail->Host     = "ip address"; 
    
    $mail->From     = "sharepoint@company.com";
    $mail->FromName = "Excited";
    $mail->AddAddress($R_email, 'R_branch');  
    $mail->AddAddress($S_email, 'S_branch');  
    $mail->AddCC("user123@company.com");
     
    $mail->Subject  = "Transfer Form";
    $mail->Body     = $body;
    $mail->WordWrap = 50;
     
    if(!$mail->Send()) {
      echo 'Message was not sent.';
      echo 'Mailer error: ' . $mail->ErrorInfo;
    } else {
      echo 'Thank you, your request has been sent!';
    }
    	
    ?>
    

     

     

×
×
  • 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.