Jump to content

codelinx

Members
  • Posts

    27
  • Joined

  • Last visited

Everything posted by codelinx

  1. never got this working as of yet.... this has been scrapped because of other dependencies i cannot load on the server
  2. I added functions to call them when needed and passed them the variable they need to process.... Here is my changed code if anyone can help or make some suggestions on code structure, form changes, organization, and maybe some examples and or references would be great also. <?php $page = 'firewallsuccess.php'; //date for time stamp on page $date = date("l F j, o g:i:s a"); //variable error array $error = array(); //error data in the variable for each element $siperror = '<strong><b><font style="color:#FF0000">Source IP Address:</font></b></strong> Please fill out the source/destiantion IP address with proper number formatting.'; $diperror = '<strong><b><font style="color:#FF0000">Destination IP Address:</font></b></strong> Please fill out the source/destiantion IP address with proper number formatting.'; $sporterror = '<strong><b><font style="color:#FF0000">Source Port:</font></b></strong> Please fill out the source/destiantion port.'; $dporterror = '<strong><b><font style="color:#FF0000">Destination Port:</font></b></strong> Please fill out the source/destiantion port.'; $protocolerror = '<strong><b><font style="color:#FF0000">Protocol:</font></b></strong> Please selec a protocol(i.e. TCP...UDP).'; $protocolerrorshort = '<strong><b><font style="color:#FF0000">Protocol:</font></b></strong> Protocol too <strong><b><i><font style="color:#FF0000">short.</font></i></b></strong> Please fill out the protocol required(i.e. TCP...UDP).'; $protocolerrorlong = '<strong><b><font style="color:#FF0000">Protocol:</font></b></strong> Protocol too <strong><b><i><font style="color:#FF0000">long.</font></i></b></strong> Please fill out the protocol required(i.e. TCP...UDP).'; $sapperror = '<strong><b><font style="color:#FF0000">Source Application:</font></b></strong> Please fill out the source/destiantion application.'; $dapperror = '<strong><b><font style="color:#FF0000">Destination Application:</font></b></strong> Please fill out the source/destiantion application.'; $reasonerror = '<strong><b><font style="color:#FF0000">Description/Reason:</font></b></strong> Please fill out the reason/description box'; $emailerror = '<strong><b><font style="color:#FF0000">Email:</font></b></strong> Please fill out the username/email.'; $email_to = "test@email.com"; function submit($post){ if (isset($_POST['submit'])){ // pass POST to variables $fr_s_ip = $_POST['fr_s_ip']; $fr_d_ip = $_POST['fr_d_ip']; $fr_s_port = $_POST['fr_s_port']; $fr_d_port = $_POST['fr_d_port']; $fr_protocol = $_POST['fr_protocol']; //$fr_protocol_other = $_POST['fr_protocol_other']; $fr_s_app = $_POST['fr_s_app']; $fr_d_app = $_POST['fr_d_app']; $fr_reason = $_POST['fr_reason']; $fr_email = $_POST['fr_email']; // email vairable for: mail($to, $subject, $mail_body); // conditions for errors such as is empty or validation functions // Source IP Address validation with exception only for IPV4 validation // works in php >= 5.2.0: if (!filter_var($fr_s_ip, FILTER_VALIDATE_IP, FILTER_FLAG_IPV4)) // >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> if (!preg_match('/^(??:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])'.'\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]?|[0-9])$/',$fr_s_ip)){ $error[] = $siperror; } // Destination IP Address validation with exception only for IPV4 validation // works in php >= 5.2.0: if (!filter_var($fr_d_ip, FILTER_VALIDATE_IP, FILTER_FLAG_IPV4)){ // >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> // if (!preg_match("^[0-255]{1,3}/./[0-255]{1,3}/./+[0-255]{1,3}/./+[0-255]{1,3}$",$fr_s_ip) // if (!preg_match("^[0-255]+[\.]+[0-255]+[\.]+[0-255]+[\.]+[0-255]$",$fr_s_ip) // other sources: http://komunitasweb.com/2009/03/10-practical-php-regular-expression-recipes/ // pulled from: http://answers.oreilly.com/topic/318-how-to-match-ipv4-addresses-with-regular-expressions/ // ("^(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$") if (!preg_match('/^(??:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])'.'\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]?|[0-9])$/',$fr_d_ip)){ $error[] = $diperror; } // Source Port error //http://stackoverflow.com/questions/6726450/check-for-valid-hostport-combination if (empty($fr_s_port)){ $error[] = $sporterror; } // Destination Port error // http://stackoverflow.com/questions/6726450/check-for-valid-hostport-combination if (empty($fr_d_port)){ $error[] = $dporterror; } // protocol error //if (empty($fr_protocol)){ //$error[] = $protocolerror; //}elseif(strlen($fr_protocol)<2){ //$error[] = $protocolerrorshort; //}elseif(strlen($fr_protocol)>4){ //$error[] = $protocolerrorlong; //} //if (!isset($fr_protocol)){ if(empty($fr_protocol)){ $error[] = $protocolerror; } //} // source application error if (empty($fr_s_app)){ $error[] = $sapperror; } // destination application error if (empty($fr_d_app)){ $error[] = $dapperror; } //description error if (empty($fr_reason)){ $error[] = $reasonerror; } // email error // works in php >= 5.2.0: if (filter_var($fr_email, FILTER_VALIDATE_EMAIL) === FALSE){ if (!preg_match("^[_a-zA-Z0-9-]+(\.[\w-]+)*@[a-zA-Z0-9-]+(\.[a-zA-Z0-9-]+)*(\.[a-zA-Z]{2,3})$^", $fr_email)){ $error[] = $emailerror; //'Email: Please submit a valid email.'; } function mailset($fr_sd_ap){ if (isset($fr_sd_ap)){$subject = $fr_sd_ap;} // if (isset($fr_sd_ap)){$headers = "From: " . $fr_email;} $mail_body = "From: " . $fr_email . "\n"; $mail_body .= "\nSource IP Address: " . $fr_s_ip ; $mail_body .= "\nDestination IP Address: " . $fr_d_ip . "\n"; $mail_body .= "\nSource Port: " . $fr_s_port ; $mail_body .= "\nDestinationPort: " . $fr_d_port . "\n"; $mail_body .= "\nProtocol: " . $fr_protocol . "\n"; $mail_body .= "\nSource Application: " . $fr_s_app ; $mail_body .= "\nDestination Application: " . $fr_d_app . "\n"; $mail_body .= "\nDescription/Reason: " . $fr_reason . "\n"; $header = header("Location: " . $page); } } return $error; return $mail_body; } ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" lang="en" > <head> <title>Firewall Request Form</title> </head> <body> <h2>Firewall Request Form</h2> <form action="<?php submit();?>" method="POST"> <!-- This form is setup to allow the user to request changes to the firewall with requirements needed outlined in the form below. Fields needed are: Description, Source/Dest. port,Source/Dest. ip, Source/Dest. Application, Protocol (i.e. TCP, UDP, etc.), Username/Email --> <fieldset> <table width="800px"> <!-- IP ADDRESS--> <tr> <!-- This section has two parts that will be conjoined for Source and Destination IP address variables followed through to the message on the same row --> <!-- Source IP container--> <td valign="top" size="20%"> <label for="fr_s_ip" >Source IP Address: *</label> </td> <td valign="top"> <input type="text" id="fr_s_ip" maxlength="30" size="20" placeholder="i.e. Format: 0.0.0.0" value="<?php echo (isset($_POST['fr_s_ip'])) ? htmlentities($_POST["fr_s_ip"]) : ''; ?>"/> </td> <td> <span class="error" style="color:#FF0000"></span> </td> <!-- Source IP container--> <!-- Destination IP container--> <td valign="top" size="20%"> <label for="fr_d_ip" >Destination IP Address: *</label> </td> <td valign="top"> <input type="text" id="fr_d_ip" maxlength="30" size="20" placeholder="i.e. Format: 0.0.0.0" value="<?php if(isset($_POST['submit'])){echo (isset($_POST['fr_d_ip'])) ? htmlentities($_POST["fr_d_ip"]) : '';} ?>"/> </td> <td> <span class="error" style="color:#FF0000"></span> </td> <!-- Destination IP container--> </tr> <!--IP ADDRESS--> <!--PORTS--> <!-- Source Port container--> <tr> <td valign="top" size="20%"> <label for="fr_s_port">Source Port: *</label> </td> <td valign="top"> <input type="text" id="fr_s_port" maxlength="6" size="20" value="<?php echo (isset($_POST['fr_s_port'])) ? htmlentities($_POST["fr_s_port"]) : ''; ?>"/> </td> <td size="45%"> <span class="error" style="color:#FF0000"></span> </td> <!-- Source Port container--> <!-- Destination Port container--> <td valign="top" size="20%"> <label for="fr_d_port">Destination Port: *</label> </td> <td valign="top"> <input type="text" id="fr_d_port" maxlength="6" size="20" value="<?php echo (isset($_POST['fr_d_port'])) ? htmlentities($_POST["fr_d_port"]) : ''; ?>"/> </td> <td size="45%"> <span class="error" style="color:#FF0000"></span> </td> <!-- Destination Port container--> </tr> <!--PORTS--> <!--PROTOCOL--> <tr> <td valign="top" size="20%"> <label for="fr_protocol">Protocol: *</label> </td> <td valign="top"> <input type="text" id="fr_protocol" maxlength="20" size="20" value="<?php //echo (isset($_POST['fr_protocol'])) ? htmlentities($_POST["fr_protocol"]) : ''; ?>"/> </td> <td size="45%"> <span class="error" style="color:#FF0000"></span> </td> </tr> <!-- textbox for protocol end--> <!-- NOTE : WIP ******************************************************************* <tr> <td valign="top" size="20%"> <label for="fr_protocol">Protocol: *</label> </td> <td valign="top"> <select id="fr_protocol" > <option value="<?php //echo (isset($_POST['fr_protocol'])) ? htmlentities($_POST["fr_protocol"]) : ''; ?>" selected="Select" >Select<option/> <option value="<?php //echo (isset($_POST['submit'])) ? htmlentities($_POST["fr_protocol"]) : ''; ?>" >TCP<option/> <option value="<?php //echo (isset($_POST['fr_protocol'])) ? htmlentities($_POST["fr_protocol"]) : ''; ?>" >UDP<option/> <option value="<?php //echo (isset($_POST['fr_protocol'])) ? htmlentities($_POST["fr_protocol"]) : ''; ?>" >TCP/UDP<option/> <option value="<?php //echo (isset($_POST['fr_protocol'])) ? htmlentities($_POST["fr_protocol"]) : ''; ?>" >FTP<option/> <option value="<?php //echo (isset($_POST['fr_protocol'])) ? htmlentities($_POST["fr_protocol"]) : ''; ?>" >None<option/> <option onchange="showtextbox()" value="other" id="fr_protocol_other" >Other<option/> <select/> <input type="text" id="fr_protocol_otherfld" maxlength="4" size="9" style="display:none;" /> <script type="text/javascript" > function showtextbox(){ if (document.getElementById("fr_protocol_other").value === "other") { document.getElementById("fr_protocol_otherfld").style.display ="block"; } else { document.getElementById("fr_protocol_otherfld").style.display ="none'; } } </script> NOTE : WIP ******************************************************************* --> </td> <td size="45%"> <span class="error" style="color:#FF0000"></span> </td> </tr> <!--PROTOCOL--> <!--APPLICATION--> <!-- i.e. Source: Dealer \ Dest.: MDS --> <tr> <!-- Source App container--> <td valign="top" size="20%"> <label for="fr_s_app">Source Application: *</label> </td> <td valign="top"> <input type="text" id="fr_s_app" maxlength="30" size="20" placeholder="i.e. Dealer" value="<?php echo (isset($_POST['fr_s_app'])) ? htmlentities($_POST["fr_s_app"]) : ''; ?>"/> </td> <td size="45%"> <span class="error" style="color:#FF0000"></span> </td> <!-- Source App container--> <!-- Destination App container--> <td valign="top" size="20%"> <label for="fr_d_app">Destination Application: *</label> </td> <td valign="top"> <input type="text" id="fr_d_app" maxlength="30" size="20" placeholder="i.e. MDS" value="<?php echo (isset($_POST['fr_d_app'])) ? htmlentities($_POST["fr_d_app"]) : ''; ?>"/> </td> <td size="45%"> <span class="error" style="color:#FF0000"></span> </td> <!-- Destination App container--> </tr> <!--APPLICATION--> <!--DESCRIPTION/REASON--> <!-- NOTE: in the <textarea></textarea> tags there can be no line breaks or white space or refreshing the page or hitting the submit button will insert that into the text area and not produce a proper error message. --> <tr> <td valign="top" size="20%"> <label for="fr_reason">Description/Reason: *</label> </td> <td valign="top"> <textarea id="fr_reason" maxlength="1000" col="20" rows="8" placeholder="Describe the scenario..."><?php echo (isset($_POST['fr_reason'])) ? htmlentities($_POST["fr_reason"]) : ''; ?></textarea> </td> <td size="45%"> <span class="error" style="color:#FF0000"></span> </td> </tr> <!--DESCRIPTION/REASON--> <!--USERNAME/EMAIL--> <tr> <td valign="top" size="20%"> <label for="fr_email">Username/Email: *</label> </td> <td valign="top"> <input type="text" id="fr_email" maxlength="30" size="20" placeholder="test@otcmarkets.com" value="<?php echo (isset($_POST['fr_email'])) ? htmlentities($_POST["fr_email"]) : ''; ?>"/> </td> <td size="45%"> <span class="error" style="color:#FF0000"></span> </td> </tr> <!--USERNAME/EMAIL--> </table> </fieldset> <br /> <input type="submit" value="Email Firewall Request" id="submit" onsubmit="<?php $post = $_POST['submit']; submit(); mailset(); ?>" /> <input type="reset" value="Clear Form" id="reset"/> <br /><br /> <?php echo "\nToday is: $date"; ?> <br /> <br /> <tr> <td valign="top"> </td> </tr> </form> <br/> <?php //if the fields are empty prompt the user with "[All fields required]" if (empty($fr_s_ip) && empty($fr_d_ip) && empty($fr_s_port) && empty($fr_d_port) && empty($fr_protocol) && empty($fr_s_app) && empty($fr_d_app) && empty($fr_reason) && empty($fr_email)){ $fieldsrequired = '<strong><b><font style="color:#FF0000">All the fields with \'*\' are required.</font></b></strong><br />'; echo $fieldsrequired; } // if the error variable is not empty loop through the errors and display them if (!empty($error)){ foreach($error as $errorsoutput){ //html formatting plus the error message using the '.' (period symbol) echo $errorsoutput.'<br>'; } } if(!empty($error)){ if (isset($_POST['submit'])){//if mail() returns 1 or true print $success variable //mail function @mail($email_to,$subject,$mail_body); //produce success message //$success = '<i><u>Status: Your firewall request form has been submitted.</u></i>'; //echo $success; } } ?> </body> </html>
  3. i have the rest of the coding done, but i will give you this... so you can read some and learn on your own with testing. Change if (isset($_POST['user_input'])) { ... } To this: if (isset($_POST['submit'])) { ... }
  4. Okay i removed the reference to headers and placed in the last php {} <?php .... $header ?> I also removed the duplicate $header variable in the first <?php?> section. Next i left the variable $page = 'firewallsuccess.php'; on the first line in the php section before the html and form. I changed the last elsif(){} in the last php section to: if(!empty($error)){ if (isset($_POST['submit'])){//if mail() returns 1 or true print $success variable //mail function @mail($email_to,$subject,$mail_body); //produce success message //$success = '<i><u>Status: Your firewall request form has been submitted.</u></i>'; //echo $success; $header; }
  5. I updated my code for pages: <?php $page = 'firewallsuccess.php'; //date for time stamp on page $date = date("l F j, o g:i:s a"); //variable error array $error = array(); //error data in the variable for each element $siperror = '<strong><b><font style="color:#FF0000">Source IP Address:</font></b></strong> Please fill out the source/destiantion IP address with proper number formatting.'; $diperror = '<strong><b><font style="color:#FF0000">Destination IP Address:</font></b></strong> Please fill out the source/destiantion IP address with proper number formatting.'; $sporterror = '<strong><b><font style="color:#FF0000">Source Port:</font></b></strong> Please fill out the source/destiantion port.'; $dporterror = '<strong><b><font style="color:#FF0000">Destination Port:</font></b></strong> Please fill out the source/destiantion port.'; $protocolerror = '<strong><b><font style="color:#FF0000">Protocol:</font></b></strong> Please selec a protocol(i.e. TCP...UDP).'; $protocolerrorshort = '<strong><b><font style="color:#FF0000">Protocol:</font></b></strong> Protocol too <strong><b><i><font style="color:#FF0000">short.</font></i></b></strong> Please fill out the protocol required(i.e. TCP...UDP).'; $protocolerrorlong = '<strong><b><font style="color:#FF0000">Protocol:</font></b></strong> Protocol too <strong><b><i><font style="color:#FF0000">long.</font></i></b></strong> Please fill out the protocol required(i.e. TCP...UDP).'; $sapperror = '<strong><b><font style="color:#FF0000">Source Application:</font></b></strong> Please fill out the source/destiantion application.'; $dapperror = '<strong><b><font style="color:#FF0000">Destination Application:</font></b></strong> Please fill out the source/destiantion application.'; $reasonerror = '<strong><b><font style="color:#FF0000">Description/Reason:</font></b></strong> Please fill out the reason/description box'; $emailerror = '<strong><b><font style="color:#FF0000">Email:</font></b></strong> Please fill out the username/email.'; $email_to = "test@email.com"; if (isset($_POST['submit'])) { // pass POST to variables $fr_s_ip = $_POST['fr_s_ip']; $fr_d_ip = $_POST['fr_d_ip']; $fr_s_port = $_POST['fr_s_port']; $fr_d_port = $_POST['fr_d_port']; $fr_protocol = $_POST['fr_protocol']; //$fr_protocol_other = $_POST['fr_protocol_other']; $fr_s_app = $_POST['fr_s_app']; $fr_d_app = $_POST['fr_d_app']; $fr_reason = $_POST['fr_reason']; $fr_email = $_POST['fr_email']; // email vairable for: mail($to, $subject, $mail_body); // conditions for errors such as is empty or validation functions // Source IP Address validation with exception only for IPV4 validation // works in php >= 5.2.0: if (!filter_var($fr_s_ip, FILTER_VALIDATE_IP, FILTER_FLAG_IPV4)) // >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> if ( !preg_match( '/^(??:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])'.'\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]?|[0-9])$/',$fr_s_ip)) { $error[] = $siperror; } // Destination IP Address validation with exception only for IPV4 validation // works in php >= 5.2.0: if (!filter_var($fr_d_ip, FILTER_VALIDATE_IP, FILTER_FLAG_IPV4)){ // >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> //if (!preg_match("^[0-255]{1,3}/./[0-255]{1,3}/./+[0-255]{1,3}/./+[0-255]{1,3}$",$fr_s_ip) //if (!preg_match("^[0-255]+[\.]+[0-255]+[\.]+[0-255]+[\.]+[0-255]$",$fr_s_ip) // other sources: http://komunitasweb.com/2009/03/10-practical-php-regular-expression-recipes/ // pulled from: http://answers.oreilly.com/topic/318-how-to-match-ipv4-addresses-with-regular-expressions/ // ("^(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$") if (!preg_match('/^(??:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])'.'\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]?|[0-9])$/',$fr_d_ip)){ $error[] = $diperror; } // Source Port error //http://stackoverflow.com/questions/6726450/check-for-valid-hostport-combination if (empty($fr_s_port)){ $error[] = $sporterror; } // Destination Port error // http://stackoverflow.com/questions/6726450/check-for-valid-hostport-combination if (empty($fr_d_port)){ $error[] = $dporterror; } // protocol error //if (empty($fr_protocol)){ //$error[] = $protocolerror; //}elseif(strlen($fr_protocol)<2){ //$error[] = $protocolerrorshort; //}elseif(strlen($fr_protocol)>4){ //$error[] = $protocolerrorlong; //} //if (!isset($fr_protocol)){ if(empty($fr_protocol)){ $error[] = $protocolerror; } //} // source application error if (empty($fr_s_app)){ $error[] = $sapperror; } // destination application error if (empty($fr_d_app)){ $error[] = $dapperror; } //description error if (empty($fr_reason)){ $error[] = $reasonerror; } // email error // works in php >= 5.2.0: if (filter_var($fr_email, FILTER_VALIDATE_EMAIL) === FALSE){ if (!preg_match("^[_a-zA-Z0-9-]+(\.[\w-]+)*@[a-zA-Z0-9-]+(\.[a-zA-Z0-9-]+)*(\.[a-zA-Z]{2,3})$^", $fr_email)){ $error[] = $emailerror; //'Email: Please submit a valid email.'; } if (isset($fr_sd_ap)){$subject = $fr_sd_ap;} // if (isset($fr_sd_ap)){$headers = "From: " . $fr_email;} $mail_body = "From: " . $fr_email . "\n"; $mail_body .= "\nSource IP Address: " . $fr_s_ip ; $mail_body .= "\nDestination IP Address: " . $fr_d_ip . "\n"; $mail_body .= "\nSource Port: " . $fr_s_port ; $mail_body .= "\nDestinationPort: " . $fr_d_port . "\n"; $mail_body .= "\nProtocol: " . $fr_protocol . "\n"; $mail_body .= "\nSource Application: " . $fr_s_app ; $mail_body .= "\nDestination Application: " . $fr_d_app . "\n"; $mail_body .= "\nDescription/Reason: " . $fr_reason . "\n"; header("Location: " . $page); $header = header("Location: " . $page); } ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" lang="en" > <head> <title>Firewall Request Form</title> </head> <body> <h2>Firewall Request Form</h2> <form action="" method="POST"> <!-- This form is setup to allow the user to request changes to the firewall with requirements needed outlined in the form below. Fields needed are: Description, Source/Dest. port,Source/Dest. ip, Source/Dest. Application, Protocol (i.e. TCP, UDP, etc.), Username/Email --> <fieldset> <table width="800px"> <!-- IP ADDRESS--> <tr> <!-- This section has two parts that will be conjoined for Source and Destination IP address variables followed through to the message on the same row --> <!-- Source IP container--> <td valign="top" size="20%"> <label for="fr_s_ip" >Source IP Address: *</label> </td> <td valign="top"> <input type="text" id="fr_s_ip" maxlength="30" size="20" placeholder="i.e. Format: 0.0.0.0" value="<?php echo (isset($_POST['fr_s_ip'])) ? htmlentities($_POST["fr_s_ip"]) : ''; ?>"/> </td> <td> <span class="error" style="color:#FF0000"></span> </td> <!-- Source IP container--> <!-- Destination IP container--> <td valign="top" size="20%"> <label for="fr_d_ip" >Destination IP Address: *</label> </td> <td valign="top"> <input type="text" id="fr_d_ip" maxlength="30" size="20" placeholder="i.e. Format: 0.0.0.0" value="<?php if(isset($_POST['submit'])){echo (isset($_POST['fr_d_ip'])) ? htmlentities($_POST["fr_d_ip"]) : '';} ?>"/> </td> <td> <span class="error" style="color:#FF0000"></span> </td> <!-- Destination IP container--> </tr> <!--IP ADDRESS--> <!--PORTS--> <!-- Source Port container--> <tr> <td valign="top" size="20%"> <label for="fr_s_port">Source Port: *</label> </td> <td valign="top"> <input type="text" id="fr_s_port" maxlength="6" size="20" value="<?php echo (isset($_POST['fr_s_port'])) ? htmlentities($_POST["fr_s_port"]) : ''; ?>"/> </td> <td size="45%"> <span class="error" style="color:#FF0000"></span> </td> <!-- Source Port container--> <!-- Destination Port container--> <td valign="top" size="20%"> <label for="fr_d_port">Destination Port: *</label> </td> <td valign="top"> <input type="text" id="fr_d_port" maxlength="6" size="20" value="<?php echo (isset($_POST['fr_d_port'])) ? htmlentities($_POST["fr_d_port"]) : ''; ?>"/> </td> <td size="45%"> <span class="error" style="color:#FF0000"></span> </td> <!-- Destination Port container--> </tr> <!--PORTS--> <!--PROTOCOL--> <tr> <td valign="top" size="20%"> <label for="fr_protocol">Protocol: *</label> </td> <td valign="top"> <input type="text" id="fr_protocol" maxlength="20" size="20" value="<?php //echo (isset($_POST['fr_protocol'])) ? htmlentities($_POST["fr_protocol"]) : ''; ?>"/> </td> <td size="45%"> <span class="error" style="color:#FF0000"></span> </td> </tr> <!-- textbox for protocol end--> <!-- NOTE : WIP ******************************************************************* <tr> <td valign="top" size="20%"> <label for="fr_protocol">Protocol: *</label> </td> <td valign="top"> <select id="fr_protocol" > <option value="<?php //echo (isset($_POST['fr_protocol'])) ? htmlentities($_POST["fr_protocol"]) : ''; ?>" selected="Select" >Select<option/> <option value="<?php //echo (isset($_POST['submit'])) ? htmlentities($_POST["fr_protocol"]) : ''; ?>" >TCP<option/> <option value="<?php //echo (isset($_POST['fr_protocol'])) ? htmlentities($_POST["fr_protocol"]) : ''; ?>" >UDP<option/> <option value="<?php //echo (isset($_POST['fr_protocol'])) ? htmlentities($_POST["fr_protocol"]) : ''; ?>" >TCP/UDP<option/> <option value="<?php //echo (isset($_POST['fr_protocol'])) ? htmlentities($_POST["fr_protocol"]) : ''; ?>" >FTP<option/> <option value="<?php //echo (isset($_POST['fr_protocol'])) ? htmlentities($_POST["fr_protocol"]) : ''; ?>" >None<option/> <option onchange="showtextbox()" value="other" id="fr_protocol_other" >Other<option/> <select/> <input type="text" id="fr_protocol_otherfld" maxlength="4" size="9" style="display:none;" /> <script type="text/javascript" > function showtextbox(){ if (document.getElementById("fr_protocol_other").value === "other") { document.getElementById("fr_protocol_otherfld").style.display ="block"; } else { document.getElementById("fr_protocol_otherfld").style.display ="none'; } } </script> NOTE : WIP ******************************************************************* --> </td> <td size="45%"> <span class="error" style="color:#FF0000"></span> </td> </tr> <!--PROTOCOL--> <!--APPLICATION--> <!-- i.e. Source: Dealer \ Dest.: MDS --> <tr> <!-- Source App container--> <td valign="top" size="20%"> <label for="fr_s_app">Source Application: *</label> </td> <td valign="top"> <input type="text" id="fr_s_app" maxlength="30" size="20" placeholder="i.e. Dealer" value="<?php echo (isset($_POST['fr_s_app'])) ? htmlentities($_POST["fr_s_app"]) : ''; ?>"/> </td> <td size="45%"> <span class="error" style="color:#FF0000"></span> </td> <!-- Source App container--> <!-- Destination App container--> <td valign="top" size="20%"> <label for="fr_d_app">Destination Application: *</label> </td> <td valign="top"> <input type="text" id="fr_d_app" maxlength="30" size="20" placeholder="i.e. MDS" value="<?php echo (isset($_POST['fr_d_app'])) ? htmlentities($_POST["fr_d_app"]) : ''; ?>"/> </td> <td size="45%"> <span class="error" style="color:#FF0000"></span> </td> <!-- Destination App container--> </tr> <!--APPLICATION--> <!--DESCRIPTION/REASON--> <!-- NOTE: in the <textarea></textarea> tags there can be no line breaks or white space or refreshing the page or hitting the submit button will insert that into the text area and not produce a proper error message. --> <tr> <td valign="top" size="20%"> <label for="fr_reason">Description/Reason: *</label> </td> <td valign="top"> <textarea id="fr_reason" maxlength="1000" col="20" rows="8" placeholder="Describe the scenario..."><?php echo (isset($_POST['fr_reason'])) ? htmlentities($_POST["fr_reason"]) : ''; ?></textarea> </td> <td size="45%"> <span class="error" style="color:#FF0000"></span> </td> </tr> <!--DESCRIPTION/REASON--> <!--USERNAME/EMAIL--> <tr> <td valign="top" size="20%"> <label for="fr_email">Username/Email: *</label> </td> <td valign="top"> <input type="text" id="fr_email" maxlength="30" size="20" placeholder="test@otcmarkets.com" value="<?php echo (isset($_POST['fr_email'])) ? htmlentities($_POST["fr_email"]) : ''; ?>"/> </td> <td size="45%"> <span class="error" style="color:#FF0000"></span> </td> </tr> <!--USERNAME/EMAIL--> </table> </fieldset> <br /> <input type="submit" value="Email Firewall Request" id="submit" onsubmit="<?php //if (empty($error)){ //if (isset($_POST['submit'])){ //produce success message //$success = '<i><u>Status: Your firewall request form has been submitted.</u></i>'; //echo $success; //} //} ?>" /> <input type="reset" value="Clear Form" id="reset"/> <br /><br /> <?php echo "\nToday is: $date"; ?> <br /> <br /> <tr> <td valign="top"> </td> </tr> </form> <br/> <?php //if the fields are empty prompt the user with "[All fields required]" if (empty($fr_s_ip) && empty($fr_d_ip) && empty($fr_s_port) && empty($fr_d_port) && empty($fr_protocol) && empty($fr_s_app) && empty($fr_d_app) && empty($fr_reason) && empty($fr_email)){ $fieldsrequired = '<strong><b><font style="color:#FF0000">All the fields with \'*\' are required.</font></b></strong><br />'; echo $fieldsrequired; } // if the error variable is not empty loop through the errors and display them if (!empty($error)){ foreach($error as $errorsoutput){ //html formatting plus the error message using the '.' (period symbol) echo $errorsoutput.'<br>'; } }elseif(isset($_POST['submit'])){//if mail() returns 1 or true print $success variable //mail function @mail($email_to,$subject,$mail_body); //produce success message //$success = '<i><u>Status: Your firewall request form has been submitted.</u></i>'; //echo $success; $header; } ?> </body> </html> Success Page: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" lang="en" > <head> <title>Firewall Request Form</title> </head> <body> <h2></h2> <?php //$fwform = 'firewall.form.v2.php'; $success = '<i><u>Status: Your firewall request form has been submitted.</u></i>'; echo $success; ?> </body> </html> I now have 2 problems, which are bothersome, when the submit button is hit the form clears even if there are empty fields, when you are navigating to the page you are sometimes automatically directed to the success.php page, and the last problem is that i have tried running different edits, but this one does not error, it just doesn't work as intended.
  6. My problem i think is the organization of my code. This is my first webpage ever, but i think the problem lies in where I am placing variables, output, and if() statements. The flow control is not working correctly, which is giving me undesirable results.
  7. Thank you very much... all the links i found were dead... I am going to go through this now...
  8. The error i am getting is : Warning: Cannot modify header information - headers already sent by (output started at /var/www/html/test/firewall.form.v2.php:256) in/var/www/html/test/firewall.form.v2.php on line 351 I cannot figure out what variables to change, I am open to reading, but i did not find anything that fixed my issue in particular. This is the Code for both pages: (please dont mind all the comments.... ) <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" lang="en" > <head> <title>Firewall Request Form</title> </head> <body> <h2>Firewall Request Form</h2> <?php require_once('firewallsuccess.php'); //date for time stamp on page $date = date("l F j, o g:i:s a"); //variable error array $error = array(); //error data in the variable for each element $siperror = '<strong><b><font style="color:#FF0000">Source IP Address:</font></b></strong> Please fill out the source/destiantion IP address with proper number formatting.'; $diperror = '<strong><b><font style="color:#FF0000">Destination IP Address:</font></b></strong> Please fill out the source/destiantion IP address with proper number formatting.'; $sporterror = '<strong><b><font style="color:#FF0000">Source Port:</font></b></strong> Please fill out the source/destiantion port.'; $dporterror = '<strong><b><font style="color:#FF0000">Destination Port:</font></b></strong> Please fill out the source/destiantion port.'; $protocolerror = '<strong><b><font style="color:#FF0000">Protocol:</font></b></strong> Please selec a protocol(i.e. TCP...UDP).'; $protocolerrorshort = '<strong><b><font style="color:#FF0000">Protocol:</font></b></strong> Protocol too <strong><b><i><font style="color:#FF0000">short.</font></i></b></strong> Please fill out the protocol required(i.e. TCP...UDP).'; $protocolerrorlong = '<strong><b><font style="color:#FF0000">Protocol:</font></b></strong> Protocol too <strong><b><i><font style="color:#FF0000">long.</font></i></b></strong> Please fill out the protocol required(i.e. TCP...UDP).'; $sapperror = '<strong><b><font style="color:#FF0000">Source Application:</font></b></strong> Please fill out the source/destiantion application.'; $dapperror = '<strong><b><font style="color:#FF0000">Destination Application:</font></b></strong> Please fill out the source/destiantion application.'; $reasonerror = '<strong><b><font style="color:#FF0000">Description/Reason:</font></b></strong> Please fill out the reason/description box'; $emailerror = '<strong><b><font style="color:#FF0000">Email:</font></b></strong> Please fill out the username/email.'; $email_to = "test@email.com"; $page = 'firewallsuccess.php'; if (isset($_POST['submit'])) { // pass POST to variables $fr_s_ip = $_POST['fr_s_ip']; $fr_d_ip = $_POST['fr_d_ip']; $fr_s_port = $_POST['fr_s_port']; $fr_d_port = $_POST['fr_d_port']; $fr_protocol = $_POST['fr_protocol']; //$fr_protocol_other = $_POST['fr_protocol_other']; $fr_s_app = $_POST['fr_s_app']; $fr_d_app = $_POST['fr_d_app']; $fr_reason = $_POST['fr_reason']; $fr_email = $_POST['fr_email']; // email vairable for: mail($to, $subject, $mail_body); // conditions for errors such as is empty or validation functions // Source IP Address validation with exception only for IPV4 validation // works in php >= 5.2.0: if (!filter_var($fr_s_ip, FILTER_VALIDATE_IP, FILTER_FLAG_IPV4)) // >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> if ( !preg_match( '/^(??:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])'.'\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]?|[0-9])$/',$fr_s_ip)) { $error[] = $siperror; } // Destination IP Address validation with exception only for IPV4 validation // works in php >= 5.2.0: if (!filter_var($fr_d_ip, FILTER_VALIDATE_IP, FILTER_FLAG_IPV4)){ // >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> //if (!preg_match("^[0-255]{1,3}/./[0-255]{1,3}/./+[0-255]{1,3}/./+[0-255]{1,3}$",$fr_s_ip) //if (!preg_match("^[0-255]+[\.]+[0-255]+[\.]+[0-255]+[\.]+[0-255]$",$fr_s_ip) // other sources: http://komunitasweb.com/2009/03/10-practical-php-regular-expression-recipes/ // pulled from: http://answers.oreilly.com/topic/318-how-to-match-ipv4-addresses-with-regular-expressions/ // ("^(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$") if (!preg_match('/^(??:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])'.'\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]?|[0-9])$/',$fr_d_ip)){ $error[] = $diperror; } // Source Port error //http://stackoverflow.com/questions/6726450/check-for-valid-hostport-combination if (empty($fr_s_port)){ $error[] = $sporterror; } // Destination Port error // http://stackoverflow.com/questions/6726450/check-for-valid-hostport-combination if (empty($fr_d_port)){ $error[] = $dporterror; } // protocol error //if (empty($fr_protocol)){ //$error[] = $protocolerror; //}elseif(strlen($fr_protocol)<2){ //$error[] = $protocolerrorshort; //}elseif(strlen($fr_protocol)>4){ //$error[] = $protocolerrorlong; //} //if (!isset($fr_protocol)){ if(empty($fr_protocol)){ $error[] = $protocolerror; } //} // source application error if (empty($fr_s_app)){ $error[] = $sapperror; } // destination application error if (empty($fr_d_app)){ $error[] = $dapperror; } //description error if (empty($fr_reason)){ $error[] = $reasonerror; } // email error // works in php >= 5.2.0: if (filter_var($fr_email, FILTER_VALIDATE_EMAIL) === FALSE){ if (!preg_match("^[_a-zA-Z0-9-]+(\.[\w-]+)*@[a-zA-Z0-9-]+(\.[a-zA-Z0-9-]+)*(\.[a-zA-Z]{2,3})$^", $fr_email)){ $error[] = $emailerror; //'Email: Please submit a valid email.'; } if (isset($fr_sd_ap)){$subject = $fr_sd_ap;} // if (isset($fr_sd_ap)){$headers = "From: " . $fr_email;} $mail_body = "From: " . $fr_email . "\n"; $mail_body .= "\nSource IP Address: " . $fr_s_ip ; $mail_body .= "\nDestination IP Address: " . $fr_d_ip . "\n"; $mail_body .= "\nSource Port: " . $fr_s_port ; $mail_body .= "\nDestinationPort: " . $fr_d_port . "\n"; $mail_body .= "\nProtocol: " . $fr_protocol . "\n"; $mail_body .= "\nSource Application: " . $fr_s_app ; $mail_body .= "\nDestination Application: " . $fr_d_app . "\n"; $mail_body .= "\nDescription/Reason: " . $fr_reason . "\n"; } ?> <form action="" method="POST"> <!-- This form is setup to allow the user to request changes to the firewall with requirements needed outlined in the form below. Fields needed are: Description, Source/Dest. port,Source/Dest. ip, Source/Dest. Application, Protocol (i.e. TCP, UDP, etc.), Username/Email --> <fieldset> <table width="800px"> <!-- IP ADDRESS--> <tr> <!-- This section has two parts that will be conjoined for Source and Destination IP address variables followed through to the message on the same row --> <!-- Source IP container--> <td valign="top" size="20%"> <label for="fr_s_ip" >Source IP Address: *</label> </td> <td valign="top"> <input type="text" id="fr_s_ip" maxlength="30" size="20" placeholder="i.e. Format: 0.0.0.0" value="<?php echo (isset($_POST['fr_s_ip'])) ? htmlentities($_POST["fr_s_ip"]) : ''; ?>"/> </td> <td> <span class="error" style="color:#FF0000"></span> </td> <!-- Source IP container--> <!-- Destination IP container--> <td valign="top" size="20%"> <label for="fr_d_ip" >Destination IP Address: *</label> </td> <td valign="top"> <input type="text" id="fr_d_ip" maxlength="30" size="20" placeholder="i.e. Format: 0.0.0.0" value="<?php echo (isset($_POST['fr_d_ip'])) ? htmlentities($_POST["fr_d_ip"]) : ''; ?>"/> </td> <td> <span class="error" style="color:#FF0000"></span> </td> <!-- Destination IP container--> </tr> <!--IP ADDRESS--> <!--PORTS--> <!-- Source Port container--> <tr> <td valign="top" size="20%"> <label for="fr_s_port">Source Port: *</label> </td> <td valign="top"> <input type="text" id="fr_s_port" maxlength="6" size="20" value="<?php echo (isset($_POST['fr_s_port'])) ? htmlentities($_POST["fr_s_port"]) : ''; ?>"/> </td> <td size="45%"> <span class="error" style="color:#FF0000"></span> </td> <!-- Source Port container--> <!-- Destination Port container--> <td valign="top" size="20%"> <label for="fr_d_port">Destination Port: *</label> </td> <td valign="top"> <input type="text" id="fr_d_port" maxlength="6" size="20" value="<?php echo (isset($_POST['fr_d_port'])) ? htmlentities($_POST["fr_d_port"]) : ''; ?>"/> </td> <td size="45%"> <span class="error" style="color:#FF0000"></span> </td> <!-- Destination Port container--> </tr> <!--PORTS--> <!--PROTOCOL--> <tr> <td valign="top" size="20%"> <label for="fr_protocol">Protocol: *</label> </td> <td valign="top"> <input type="text" id="fr_protocol" maxlength="20" size="20" value="<?php //echo (isset($_POST['fr_protocol'])) ? htmlentities($_POST["fr_protocol"]) : ''; ?>"/> </td> <td size="45%"> <span class="error" style="color:#FF0000"></span> </td> </tr> <!-- textbox for protocol end--> <!-- NOTE : WIP ******************************************************************* <tr> <td valign="top" size="20%"> <label for="fr_protocol">Protocol: *</label> </td> <td valign="top"> <select id="fr_protocol" > <option value="<?php //echo (isset($_POST['fr_protocol'])) ? htmlentities($_POST["fr_protocol"]) : ''; ?>" selected="Select" >Select<option/> <option value="<?php //echo (isset($_POST['submit'])) ? htmlentities($_POST["fr_protocol"]) : ''; ?>" >TCP<option/> <option value="<?php //echo (isset($_POST['fr_protocol'])) ? htmlentities($_POST["fr_protocol"]) : ''; ?>" >UDP<option/> <option value="<?php //echo (isset($_POST['fr_protocol'])) ? htmlentities($_POST["fr_protocol"]) : ''; ?>" >TCP/UDP<option/> <option value="<?php //echo (isset($_POST['fr_protocol'])) ? htmlentities($_POST["fr_protocol"]) : ''; ?>" >FTP<option/> <option value="<?php //echo (isset($_POST['fr_protocol'])) ? htmlentities($_POST["fr_protocol"]) : ''; ?>" >None<option/> <option onchange="showtextbox()" value="other" id="fr_protocol_other" >Other<option/> <select/> <input type="text" id="fr_protocol_otherfld" maxlength="4" size="9" style="display:none;" /> <script type="text/javascript" > function showtextbox(){ if (document.getElementById("fr_protocol_other").value === "other") { document.getElementById("fr_protocol_otherfld").style.display ="block"; } else { document.getElementById("fr_protocol_otherfld").style.display ="none'; } } </script> NOTE : WIP ******************************************************************* --> </td> <td size="45%"> <span class="error" style="color:#FF0000"></span> </td> </tr> <!--PROTOCOL--> <!--APPLICATION--> <!-- i.e. Source: Dealer \ Dest.: MDS --> <tr> <!-- Source App container--> <td valign="top" size="20%"> <label for="fr_s_app">Source Application: *</label> </td> <td valign="top"> <input type="text" id="fr_s_app" maxlength="30" size="20" placeholder="i.e. Dealer" value="<?php echo (isset($_POST['fr_s_app'])) ? htmlentities($_POST["fr_s_app"]) : ''; ?>"/> </td> <td size="45%"> <span class="error" style="color:#FF0000"></span> </td> <!-- Source App container--> <!-- Destination App container--> <td valign="top" size="20%"> <label for="fr_d_app">Destination Application: *</label> </td> <td valign="top"> <input type="text" id="fr_d_app" maxlength="30" size="20" placeholder="i.e. MDS" value="<?php echo (isset($_POST['fr_d_app'])) ? htmlentities($_POST["fr_d_app"]) : ''; ?>"/> </td> <td size="45%"> <span class="error" style="color:#FF0000"></span> </td> <!-- Destination App container--> </tr> <!--APPLICATION--> <!--DESCRIPTION/REASON--> <!-- NOTE: in the <textarea></textarea> tags there can be no line breaks or white space or refreshing the page or hitting the submit button will insert that into the text area and not produce a proper error message. --> <tr> <td valign="top" size="20%"> <label for="fr_reason">Description/Reason: *</label> </td> <td valign="top"> <textarea id="fr_reason" maxlength="1000" col="20" rows="8" placeholder="Describe the scenario..."><?php echo (isset($_POST['fr_reason'])) ? htmlentities($_POST["fr_reason"]) : ''; ?></textarea> </td> <td size="45%"> <span class="error" style="color:#FF0000"></span> </td> </tr> <!--DESCRIPTION/REASON--> <!--USERNAME/EMAIL--> <tr> <td valign="top" size="20%"> <label for="fr_email">Username/Email: *</label> </td> <td valign="top"> <input type="text" id="fr_email" maxlength="30" size="20" placeholder="test@otcmarkets.com" value="<?php echo (isset($_POST['fr_email'])) ? htmlentities($_POST["fr_email"]) : ''; ?>"/> </td> <td size="45%"> <span class="error" style="color:#FF0000"></span> </td> </tr> <!--USERNAME/EMAIL--> </table> </fieldset> <br /> <input type="submit" value="Email Firewall Request" id="submit" onsubmit="<?php //if (empty($error)){ //if (isset($_POST['submit'])){ //produce success message //$success = '<i><u>Status: Your firewall request form has been submitted.</u></i>'; //echo $success; //} //} ?>" /> <input type="reset" value="Clear Form" id="reset"/> <br /><br /> <?php echo "\nToday is: $date"; ?> <br /> <br /> <tr> <td valign="top"> <?php //if the fields are empty prompt the user with "[All fields required]" if (empty($fr_s_ip) && empty($fr_d_ip) && empty($fr_s_port) && empty($fr_d_port) && empty($fr_protocol) && empty($fr_s_app) && empty($fr_d_app) && empty($fr_reason) && empty($fr_email)){ $fieldsrequired = '<strong><b><font style="color:#FF0000">All the fields with \'*\' are required.</font></b></strong><br />'; echo $fieldsrequired; } // if the error variable is not empty loop through the errors and display them if (!empty($error)){ foreach($error as $errorsoutput){ //html formatting plus the error message using the '.' (period symbol) echo $errorsoutput.'<br>'; } }else{ //mail function @mail($email_to,$subject,$mail_body); //if mail() returns 1 or true print $success variable if (@mail($email_to,$subject,$mail_body)){ //produce success message //$success = '<i><u>Status: Your firewall request form has been submitted.</u></i>'; //echo $success; header("Location: " . $page); } } if (isset($_POST['fr_protocol_other'])){ $status = 'visible'; }else{ $status = 'hidden'; } ?> </td> </tr> </form> <br/> </body> </html> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" lang="en" > <head> <title>Firewall Request Form</title> </head> <body> <h2></h2> <?php $fwform = 'firewall.form.v2.php'; $success = '<i><u>Status: Your firewall request form has been submitted.</u></i>'; echo $success; ob_clean(); ?> </body> </html> Thank you in advance for any suggestions.....
  9. i guess we are only about asking for help and not sharing or giving it ...
  10. can you post what you fixed maybe to help others?
  11. This is my final code: It has minimal commenting as i think it is pretty self explanatory. It is not perfect, but for my first page i think it was successful. I know i can add a lot more checks and proper coding or validation, but this works for now. Thanks for the help and this is to help anyone else possibly. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" lang="en" > <head> <title> Firewall Request Form</title> </head> <body> <h2>Firewall Request Form</h2> <?php //date for time stamp on page $date = date("l F j, o g:i:s a"); //variable error array $error = array(); //error data in the variable for each element $iperror = '<strong><b><font style="color:#FF0000">IP Address:</font></b></strong> Please fill out the source/destiantion IP address.'; $porterror = '<strong><b><font style="color:#FF0000">Port:</font></b></strong> Please fill out the source/destiantion port.'; $protocolerror = '<strong><b><font style="color:#FF0000">Protocol:</font></b></strong> Please fill out the protocol required(i.e. TCP...UDP).'; $protocolerrorshort = '<strong><b><font style="color:#FF0000">Protocol:</font></b></strong> Protocol too <strong><b><i><font style="color:#FF0000">short.</font></i></b></strong> Please fill out the protocol required(i.e. TCP...UDP).'; $protocolerrorlong = '<strong><b><font style="color:#FF0000">Protocol:</font></b></strong> Protocol too <strong><b><i><font style="color:#FF0000">long.</font></i></b></strong> Please fill out the protocol required(i.e. TCP...UDP).'; $apperror = '<strong><b><font style="color:#FF0000">Application:</font></b></strong> Please fill out the source/destiantion application.'; $reasonerror = '<strong><b><font style="color:#FF0000">Description/Reason:</font></b></strong> Please fill out the reason/description box'; $emailerror = '<strong><b><font style="color:#FF0000">Email:</font></b></strong> Please fill out the username/email.'; if (isset($_POST['submit'])) { //pass POST to variables $fr_sd_ip = $_POST['fr_sd_ip']; $fr_sd_port = $_POST['fr_sd_port']; $fr_protocol = $_POST['fr_protocol']; $fr_sd_app = $_POST['fr_sd_app']; $fr_reason = $_POST['fr_reason']; $fr_email = $_POST['fr_email']; //conditions for errors such as is empty or validation functions //IP Address validation with exception only for IPV4 validation if (!filter_var($fr_sd_ip, FILTER_VALIDATE_IP, FILTER_FLAG_IPV4)){ $error[] = $iperror; } //Ports error //http://stackoverflow.com/questions/6726450/check-for-valid-hostport-combination if (empty($fr_sd_port)){ $error[] = $porterror; } //protocol error if (empty($fr_protocol)){ $error[] = $protocolerror; }elseif(strlen($fr_protocol)<2){ $error[] = $protocolerrorshort; }elseif(strlen($fr_protocol)>4){ $error[] = $protocolerrorlong; } //application error if (empty($fr_sd_app)){ $error[] = $apperror; } //description error if (empty($fr_reason)){ $error[] = $reasonerror; } //email error if (filter_var($fr_email, FILTER_VALIDATE_EMAIL) === FALSE){ $error[] = $emailerror; //'Email: Please submit a valid email.'; } //mail($to, $subject, $mail_body); $email_to = "mailto@email.com"; if (isset($fr_sd_ap)){$subject = $fr_sd_ap;} //if (isset($fr_sd_ap)){$headers = "From: " . $fr_email;} $mail_body = "From: " . $fr_email . "\n"; $mail_body .= "\nIP Address: " . $fr_sd_ip . "\n"; $mail_body .= "\nPort: " . $fr_sd_port . "\n"; $mail_body .= "\nProtocol: " . $fr_protocol . "\n"; $mail_body .= "\nSource/Dest. Application: " . $fr_sd_app . "\n"; $mail_body .= "\nDescription/Reason: " . $fr_reason . "\n"; } ?> <form action="" method="POST"> <!-- This form is setup to allow the user to request changes to the firewall with requirements needed outlined in the form below. Fields needed are: Description, Source/Dest. port,Source/Dest. ip, Source/Dest. Application, Protocol (i.e. TCP, UDP, etc.), Username/Email --> <fieldset> <table width="525px"> <tr> <td valign="top" size="35%"> <label for="fr_sd_ip">Source/Dest. IP Address: *</label> </td> <td valign="top"> <input type="text" name="fr_sd_ip" maxlength="30" size="20" value="<?php echo (isset($_POST['fr_sd_ip'])) ? htmlentities($_POST["fr_sd_ip"]) : ''; ?>"/> </td> <td size="45%"> <span class="error" style="color:#FF0000"></span> </td> </tr> <tr> <td valign="top"> <label for="fr_sd_port">Source/Dest. Port: *</label> </td> <td valign="top"> <input type="text" name="fr_sd_port" maxlength="6" size="20" value="<?php echo (isset($_POST['fr_sd_port'])) ? htmlentities($_POST["fr_sd_port"]) : ''; ?>"/> </td> <td size="45%"> <span class="error" style="color:#FF0000"></span> </td> </tr> <tr> <td valign="top"> <label for="fr_protocol">Protocol: *</label> </td> <td valign="top"> <input type="text" name="fr_protocol" maxlength="4" size="20" value="<?php echo (isset($_POST['fr_protocol'])) ? htmlentities($_POST["fr_protocol"]) : ''; ?>"/> </td> <td size="45%"> <span class="error" style="color:#FF0000"></span> </td> </tr> <tr> <td valign="top"> <label for="fr_sd_app">Application: *</label> </td> <td valign="top"> <input type="text" name="fr_sd_app" maxlength="30" size="20" value="<?php echo (isset($_POST['fr_sd_app'])) ? htmlentities($_POST["fr_sd_app"]) : ''; ?>"/> </td> <td size="45%"> <span class="error" style="color:#FF0000"></span> </td> </tr> <tr> <td valign="top"> <label for="fr_reason">Description/Reason: *</label> </td> <td valign="top"> <textarea name="fr_reason" maxlength="500" col="20" rows="8" placeholder="Describe the scenario..."> <?php echo (isset($_POST['fr_reason'])) ? htmlentities($_POST["fr_reason"]) : ''; ?></textarea> </td> <td size="45%"> <span class="error" style="color:#FF0000"></span> </td> </tr> <tr> <td valign="top"> <label for="fr_email">Username/Email: *</label> </td> <td valign="top"> <input type="text" name="fr_email" maxlength="30" size="20" value="<?php echo (isset($_POST['fr_email'])) ? htmlentities($_POST["fr_email"]) : ''; ?>"/> </td> <td size="45%"> <span class="error" style="color:#FF0000"></span> </td> </tr> </table> </fieldset> <br /> <input type="submit" value="Email Firewall Request" name="submit" onsubmit="<?php if (empty($error)){ //produce success message $success = '<i><u>Status: Your firewall request form has been submitted.</u></i>'; echo $success;}?>"/> <input type="reset" value="Clear Form" name="reset"/> <br /><br /> <?php echo "\nToday is: $date"; ?> <br /> <br /> <tr> <td valign="top"> <?php //if the fields are empty prompt the user with "[All fields required]" if (empty($fr_sd_ip) && empty($fr_sd_port) && empty($fr_protocol) && empty($fr_sd_app) && empty($fr_reason) && empty($fr_email)){ $fieldsrequired = '<strong><b><font style="color:#FF0000">All the fields with \'*\' are required.</font></b></strong><br />'; echo $fieldsrequired; } // if the error variable is not empty loop through the errors and display them if (!empty($error)){ foreach($error as $errorsoutput){ //html formatting plus the error message using the '.' (period symbol) echo $errorsoutput.'<br>'; } }else{ //mail function @mail($email_to,$subject,$mail_body); //if mail() returns 1 or true print $success variable if (@mail($email_to,$subject,$mail_body)){ //produce success message $success = '<i><u>Status: Your firewall request form has been submitted.</u></i>'; echo $success;} } ?> </td> </tr> </form> <br/> </body> </html>
  12. Thanks i see what you mean, that is what i get for constantly renaming variables, though i need to setup geany on my linux box like notepad++ is on my windows.
  13. Going to add the mail function then ill post the code for everyone if they need this.
  14. Would be able to tell me what they were? Not where.... I am curious. Also i appreciate this a lot as this is my first web development ever in any language.
  15. you are saying i fixed them already or they still exist?
  16. This is the updated code: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" lang="en" > <head> <title> Firewall Request Form</title> </head> <body> <h2>Firewall Request Form</h2> <?php //date for time stamp on page $date = date("l F j, o g:i:s a"); //variable error array $error = array(); //error data in the variable for each element $iperror = "IP Address: Please fill out the source/destiantion IP address."; $porterror = "Port: Please fill out the source/destiantion port."; $protocolerror = "Protocol: Please fill out the protocol required(i.e. TCP...UDP)."; $apperror = "Application: Please fill out the source/destiantion application."; $reasonerror = "Description/Reason: Please fill out the reason/description box"; $emailerror = "Email: Please fill out the username/email."; if (isset($_POST['fr_sd_ip'], $_POST['fr_sd_port'],$_POST['fr_protocol'],$_POST['fr_sd_app'], $_POST['fr_reason'], $_POST['fr_email'])){ //pass POST to variables $fr_sd_ip = $_POST['fr_sd_ip']; $fr_sd_port = $_POST['fr_sd_port']; $fr_protocol = $_POST['fr_protocol']; $fr_sd_app = $_POST['fr_sd_app']; $fr_reason = $_POST['fr_reason']; $fr_email = $_POST['fr_email']; //if the fields are emptyprompt the user if (empty($fr_sd_ip) || empty($fr_sd_port) || empty($fr_protocol) || empty($fr_sd_app) || empty($fr_reason) || empty($fr_email)){ $fieldsrequired = '<strong><b><font style="color:#FF0000">All the fields with \'*\' are required.</font></b></strong>'; }else{ //check to see if any errors have been created //validate user input //creates an array of error variables and output /*$errormessage = array(); //if statements that will check each element of the form if(strlen($name) > 25){ $errormessage[] = 'Name is too long'; }else{ if($name = < 1){ echo "please enter a name." }*/ //Set the restrictions for each field so it may return a error //IP address if (!filter_var($fr_sd_ip, FILTER_VALIDATE_IP, FILTER_FLAG_IPV4)){ $error[] = $iperror; } //Ports //http://stackoverflow.com/questions/6726450/check-for-valid-hostport-combination if (!isset($fr_sd_port)){ $error[] = $porterror; } //protocol if (!isset($fr_protocol)){ $error[] = $protocolerror; } //application if (!isset($fr_sd_app)){ $error[] = $apperror; } //description if (!isset($fr_reason)){ $error[] = $reasonerror; } //$email_exp = "/^[A-Za-z0-9._%-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,4}$/"; $email_exp = "/^[A-Za-z0-9.-]+@[A-Za-z.-]+\.[A-Za-z]{2,4}$/"; //email /*if (!preg_match($email_exp, $fr_email)){ $error[] = $emailerror; }*/ if (filater_var($email, FILTER_VALIDATEEMAIL) === FALSE){ $error[] = $emailerror; //'Email: Please submit a valid email.'; } } } //loop to print error messages //check if the array is empty if it is continue if not loop & print errors if (!empty($error)){ foreach($error as $errorsoutput){ //html formatting plus the error message $errorsoutput; } }elseif(isset($_POST['submit'])){ //complete the registration //enter mail function to mail to the firewall request email //mail(); $success = 'Your firewall request form has been submitted.'; echo $success; } } ?> <form action="<?php echo htmlentities($_SERVER["PHP_SELF"]); ?>" method="POST"> <!-- This form is setup to allow the user to request changes to the firewall with requirements needed outlined in the form below. Fields needed are: Description, Source/Dest. port,Source/Dest. ip, Source/Dest. Application, Protocol (i.e. TCP, UDP, etc.), Username/Email --> <table width="525px"> <tr> <td valign="top" size="35%"> <label for="fr_sd_ip">Source/Dest. IP Address: *</label> </td> <td valign="top"> <input type="text" name="fr_sd_ip" maxlength="30" size="20" value="<?php echo htmlentities($_POST["fr_sd_ip"]) ?>"> </td> <td size="45%"> <span class="error" style="color:#FF0000"> <?php /*if (isset($_POST["fr_sd_ip"]) && $errorsoutput == $iperror){echo $errorsoutput;} */?></span> </td> </tr> <tr> <td valign="top"> <label for="fr_sd_port">Source/Dest. Port: *</label> </td> <td valign="top"> <input type="text" name="fr_sd_port" maxlength="30" size="20" value="<?php echo htmlentities($_POST["fr_sd_port"]) ?>"> </td> <td size="45%"> <span class="error" style="color:#FF0000"> <?php /*if (isset($_POST["fr_sd_port"]) && $errorsoutput == $porterror){echo $errorsoutput;}*/ ?></span> </td> </tr> <tr> <td valign="top"> <label for="fr_protocol">Protocol: *</label> </td> <td valign="top"> <input type="text" name="fr_protocol" maxlength="30" size="20" value="<?php echo htmlentities($_POST["fr_protocol"]) ?>"> </td> <td size="45%"> <span class="error" style="color:#FF0000"> <?php /*if (isset($_POST["fr_protocol"]) && $errorsoutput == $protocolerror){echo $errorsoutput;}*/ ?></span> </td> </tr> <tr> <td valign="top"> <label for="fr_sd_app">Application: *</label> </td> <td valign="top"> <input type="text" name="fr_sd_app" maxlength="30" size="20" value="<?php echo htmlentities($_POST["fr_sd_app"]) ?>"> </td> <td size="45%"> <span class="error" style="color:#FF0000"> <?php /*if (isset($_POST["fr_sd_app"]) && $errorsoutput == $apperror){echo $errorsoutput;}*/ ?></span> </td> </tr> <tr> <td valign="top"> <label for="fr_reason">Description/Reason: *</label> </td> <td valign="top"> <textarea name="fr_reason" maxlength="500" col="20" rows="8" placeholder="Describe the scenario..."> <?php echo htmlentities($_POST["fr_reason"]) ?></textarea> </td> <td size="45%"> <span class="error" style="color:#FF0000"> <?php /*if (isset($_POST["fr_reason"]) && $errorsoutput == $reasonerror){echo $errorsoutput;}*/ ?></span> </td> </tr> <tr> <td valign="top"> <label for="fr_email">Username/Email: *</label> </td> <td valign="top"> <input type="text" name="fr_email" maxlength="30" size="20" value="<?php echo htmlentities($_POST["fr_email"]) ?>"> </td> <td size="45%"> <span class="error" style="color:#FF0000"> <?php /*if (isset($_POST["fr_email"]) && $errorsoutput == $emailerror){echo $errorsoutput;}*/ ?></span> </td> </tr> </table> <input type="submit" value="Email Firewall Request"> <br /><br /> <?php echo "\nToday is: $date"; ?> <br /> <tr> <td valign="top"> <?php echo $fieldsrequired; if (isset($errorsoutput)){ echo $errorsoutput;} ?> </td> </tr> </form> </br> </body> </html> I receive no syntax, run time, or execution errors, but the output of the variable for reporting field validation is not working. The form allows me to press submit and it will keep the fields i have entered, but it will not check the fields using the validation i setup. Also it will not display the $errorsoutput variable output on the page.
  17. I kind of figured as much because I seen that it was catching an error from the $errorsoutput variable. I will also change that and allow for the errors to be printed in a central location due to the loop pushing the output like you stated. I will try this and then see what happens. Thanks for all the help so far. EDIT: I will post the changed code shortly.
  18. I tried changing the line in the form to this as an example : <tr> <td valign="top" size="35%"> <label for="fr_sd_ip">Source/Dest. IP Address: *</label> </td> <td valign="top"> <input type="text" name="fr_sd_ip" maxlength="30" size="20" value="<?php echo htmlentities($_POST["fr_sd_ip"]) ?>"> </td> <td size="45%"> <span class="error" style="color:#FF0000"> <?php if (isset($_POST["fr_sd_ip"]) && $errorsoutput == $iperror){echo $errorsoutput;} ?></span> </td> </tr> And when i type something in the 'Sour/Dest. IP Address: *' field i get the same errors like this: Notice: Undefined variable: errorsoutput in /var/www/html/test/form.validation.php on line 124...138...152...166...180...194 for every section in the form that references the $errorsoutput variable EDIT: if i remove this line <?php if (isset($_POST["fr_sd_ip"]) && $errorsoutput == $iperror){echo $errorsoutput;} ?> I receive no error messages when a field is blank and i press submit.
  19. Okay i guess ill get rid of them, but i did that as part of the sticky form i think. This is what i changed for validation after reading a little more: //IP address if (!filter_var($fr_sd_ip, FILTER_VALIDATE_IP, FILTER_FLAG_IPV4)){ $error[] = $iperror; } //Ports //http://stackoverflow.com/questions/6726450/check-for-valid-hostport-combination if (!isset($fr_sd_port)){ $error[] = $porterror; } //protocol if (!isset($fr_protocol)){ $error[] = $protocolerror; } //application if (!isset($fr_sd_app)){ $error[] = $apperror; } //description if (!isset($fr_reason)){ $error[] = $reasonerror; } //$email_exp = "/^[A-Za-z0-9._%-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,4}$/"; $email_exp = "/^[A-Za-z0-9.-]+@[A-Za-z.-]+\.[A-Za-z]{2,4}$/"; //email if (!preg_match($email_exp, $fr_email)){ $error[] = $emailerror; }
  20. yea i am going to do more specific validation, so that is why it looks like this for now. I had the || (or) but changed it and didnt change that back. the errors i am receiving from the code posted in post #4 was: Notice: Undefined variable: errorsoutput in/var/www/html/test/form.validation.phpon line 120 Notice: Undefined variable: errorsoutput in/var/www/html/test/form.validation.phpon line 133 Notice: Undefined variable: errorsoutput in/var/www/html/test/form.validation.phpon line 146 Notice: Undefined variable: errorsoutput in/var/www/html/test/form.validation.phpon line 159 Notice: Undefined variable: errorsoutput in/var/www/html/test/form.validation.phpon line 172 Notice: Undefined variable: errorsoutput in/var/www/html/test/form.validation.phpon line 185
  21. should you use print_r($some_var); ? [not hijacking just continuing for a possible better answer]
  22. Look here as well... http://dev.mysql.com/doc/refman/5.7/en/timestamp-initialization.html From: http://dev.mysql.com/doc/refman/5.7/en/date-and-time-literals.html "String and Numeric Literals in Date and Time Context. ... As a string in either 'YYYY-MM-DD HH:MM:SS' or 'YY-MM-DD HH:MM:SS' format. A “relaxed” syntax is permitted here, too: Any punctuation character may be used as the delimiter between date parts or time parts. For example,'2012-12-31 11:30:45', '2012^12^31 11+30+45', '2012/12/31 11*30*45', and '2012@12@31 11^30^45' are equivalent."
  23. try replacing: `date` timestamp( 14 ) NOT NULL with `date` timestamp NOT NULL or try `date` timestamp AS 'MM/DD/YYYY' NOT NULL (put in whatever you want... im not playing with SQL atm, but try those...)
  24. So this is my updated code if anyone can help me figure out what i can do to fix my field validation, why i get Undefined variables and how to solve this? <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" lang="en" > <head> <title> Firewall Request Form</title> </head> <body> <h2>Firewall Request Form</h2> <?php //date for time stamp on page $date = date("l F j, o g:i:s a"); //variable error array $error = array(); //error data in the variable for each element $iperror = "Please fill out the source/destiantion IP address."; $porterror = "Please fill out the source/destiantion port."; $protocolerror = "Please fill out the protocol required(i.e. TCP...UDP)."; $apperror = "Please fill out the source/destiantion application."; $reasonerror = "Please fill out the reason/description box"; $emailerror = "Please fill out the username/email."; if (isset($_POST['fr_sd_ip'], $_POST['fr_sd_port'],$_POST['fr_protocol'],$_POST['fr_sd_app'], $_POST['fr_reason'], $_POST['fr_email'])){ //pass POST to variables $fr_sd_ip = $_POST['fr_sd_ip']; $fr_sd_port = $_POST['fr_sd_port']; $fr_protocol = $_POST['fr_protocol']; $fr_sd_app = $_POST['fr_sd_app']; $fr_reason = $_POST['fr_reason']; $fr_email = $_POST['fr_email']; //if the fields are emptyprompt the user if (empty($fr_sd_ip) && empty($fr_sd_port) && empty($fr_protocol) && empty($fr_sd_app) && empty($fr_reason) && empty($fr_email)){ echo '<strong><b><font style="color:FF0000">All the fields with \'*\'are required.</font></b></strong>'; }else{ //check to see if any errors have been created //validate user input //creates an array of error variables and output /*$errormessage = array(); //if statements that will check each element of the form if(strlen($name) > 25){ $errormessage[] = 'Name is too long'; }else{ if($name = < 1){ echo "please enter a name." }*/ //Set the restrictions for each field so it may return a error //IP address if (!isset($fr_sd_ip)){ $error[] = $iperror; } //Ports if (!isset($fr_sd_port)){ $error[] = $porterror; } //protocol if (!isset($fr_protocol)){ $error[] = $protocolerror; } //application if (!isset($fr_sd_app)){ $error[] = $apperror; } //description if (!isset($fr_reason)){ $error[] = $reasonerror; } //email if (!isset($fr_email)){ $error[] = $emailerror; } /*} if (filater_var($email, FILTER_VALIDATEEMAIL) === FALSE){ $error[] = 'Please submit a valid email.'; }*/ } //loop to print error messages //check if the array is empty if it is continue if not loop & print errors if (!empty($error)){ //$errorsoutput = ''; foreach($error as $errorsoutput){ //html formatting plus the error message echo $errorsoutput; } }else{ //complete the registration //enter mail function to mail to the firewall request email //mail(); $success = 'Your firewall request form has been submitted.'; echo $success; } } ?> <form action="<?php echo htmlentities($_SERVER["PHP_SELF"]); ?>" method="POST"> <!-- This form is setup to allow the user to request changes to the firewall with requirements needed outlined in the form below. Fields needed are: Description, Source/Dest. port,Source/Dest. ip, Source/Dest. Application, Protocol (i.e. TCP, UDP, etc.), Username/Email --> <table width="525px"> <tr> <td valign="top" size="35%"> <label for="fr_sd_ip">Source/Dest. IP Address: *</label> </td> <td valign="top"> <input type="text" name="fr_sd_ip" maxlength="30" size="20" value="<?php echo htmlentities($_POST["fr_sd_ip"]) ?>"> </td> <td size="45%"> <span class="error" style="color:#FF0000"><?php echo $errorsoutput; ?></span> </td> </tr> <tr> <td valign="top"> <label for="fr_sd_port">Source/Dest. Port: *</label> </td> <td valign="top"> <input type="text" name="fr_sd_port" maxlength="30" size="20" value="<?php echo htmlentities($_POST["fr_sd_port"]) ?>"> </td> <td size="45%"> <span class="error" style="color:#FF0000"><?php echo $errorsoutput; ?></span> </td> </tr> <tr> <td valign="top"> <label for="fr_protocol">Protocol: *</label> </td> <td valign="top"> <input type="text" name="fr_protocol" maxlength="30" size="20" value="<?php echo htmlentities($_POST["fr_protocol"]) ?>"> </td> <td size="45%"> <span class="error" style="color:#FF0000"><?php echo $errorsoutput; ?></span> </td> </tr> <tr> <td valign="top"> <label for="fr_sd_app">Application: *</label> </td> <td valign="top"> <input type="text" name="fr_sd_app" maxlength="30" size="20" value="<?php echo htmlentities($_POST["fr_sd_app"]) ?>"> </td> <td size="45%"> <span class="error" style="color:#FF0000"><?php echo $errorsoutput; ?></span> </td> </tr> <tr> <td valign="top"> <label for="fr_reason">Description/Reason: *</label> </td> <td valign="top"> <textarea name="fr_reason" maxlength="500" col="20" rows="8" placeholder="Describe the scenario..."> <?php echo htmlentities($_POST["fr_reason"]) ?></textarea> </td> <td size="45%"> <span class="error" style="color:#FF0000"><?php echo $errorsoutput; ?></span> </td> </tr> <tr> <td valign="top"> <label for="fr_email">Username/Email: *</label> </td> <td valign="top"> <input type="text" name="fr_email" maxlength="30" size="20" value="<?php echo htmlentities($_POST["fr_email"]) ?>"> </td> <td size="45%"> <span class="error" style="color:#FF0000"><?php echo $errorsoutput; ?></span> </td> </tr> </table> <input type="submit" value="Email Firewall Request"> </form> </br> <?php echo "\r\nToday is: $date"; ?> </body> </html>
×
×
  • 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.