Advertisement
MDTech-us_MAN

Untitled

Oct 25th, 2012
23
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Perl 9.70 KB | None | 0 0
  1. #!/usr/bin/perl
  2.  
  3. use strict;
  4. use warnings;
  5. use DBI;
  6. use CGI;
  7. use CGI::Carp qw(fatalsToBrowser warningsToBrowser);
  8.  
  9. my $cgi = CGI->new;
  10. my %FORM = $cgi->Vars;
  11.  
  12. print $cgi->header;
  13.  
  14. warningsToBrowser(1);
  15.  
  16. DBI->trace(15); # value can be between 0 and 15
  17. my $dsn = 'DBI:mysql:bcpadb:instance28854.db.xeround.com:18847';
  18. my $dbh = DBI->connect($dsn, 'maxwell175', 'qwertyuiop',
  19.                         { RaiseError => 1 })
  20.         || die "Could not connect to the database " . $DBI::errstr;
  21. my $LName = $FORM{'LName'};
  22. my $FName = $FORM{'FName'};
  23.  
  24. my $query = "SELECT * FROM people2 WHERE LName LIKE '$LName' AND FName LIKE '$FName'";
  25. my $query1 = $dbh->prepare($query);
  26.  
  27.  
  28. $query1->execute || die "Error executing 'select' query: " . $query1->errstr;
  29. #print "$query";
  30.  
  31. #try replaceing the while with this.  
  32. my $results = $query1->fetchrow_hashref();
  33.  
  34. #my $FName = $results->{FName}; --- Not needed because passed in args
  35. #my $LName = $results->{LName}; --- Same as above line
  36. my $AddrLine1 = $results->{AddrLine1};
  37. my $AddrLine2 = $results->{AddrLine2};
  38. my $City = $results->{City};
  39. my $Zip = $results->{Zip};
  40. my $WAddrLine1 = $results->{WAddrLine1};
  41. my $WAddrLine2 = $results->{WAddrLine2};
  42. my $WCity = $results->{WCity};
  43. my $WZip = $results->{WZip};
  44. my $HPhone = $results->{HPhone};
  45. my $MPhone = $results->{MPhone};
  46. my $WPhone = $results->{WPhone};
  47. my $Email = $results->{Email};
  48. my $Company = $results->{Company};
  49. my $Job_Title = $results->{Job_Title};
  50. #}
  51.  
  52.  
  53. print <<HTMLPAGE;
  54. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
  55. <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
  56. <head>
  57. <meta http-equiv='X-UA-Compatible' content='IE=EmulateIE7' />
  58. <title>BCPA page - MDTech</title>
  59.  
  60. <meta name="msvalidate.01" content="6698DB3266240D800A1DEFB2AEE5249D" />
  61. <meta name="msvalidate.01" content="BA291C2BB06D4C099CF9138D94C4C24B" />
  62. <meta name="google-site-verification" content="Mv8ukVrmYK4zMgdnRp4qYETNyRnPyRtaI-YEzYjDzV0" />
  63. <meta name="msvalidate.01" content="BA291C2BB06D4C099CF9138D94C4C24B" />
  64. <meta name="google-site-verification" content="Mv8ukVrmYK4zMgdnRp4qYETNyRnPyRtaI-YEzYjDzV0" />
  65. <!--[if IE 7]>
  66.       <style>
  67.       p {
  68.         line-height:18px;
  69.         padding-bottom:0px;
  70.       }
  71.       h1 {
  72.         font-size:20px;
  73.         font-weight:bold;
  74.         color:#272e34;
  75.         padding-bottom:0px;
  76.       }
  77.       h2 {
  78.         font-size:14px;
  79.         font-weight:bold;
  80.         color:#272e34;
  81.         padding-bottom:0px;
  82.       }
  83.     </style>
  84.   <![endif]-->
  85.   <meta name="google-site-verification" content="Mv8ukVrmYK4zMgdnRp4qYETNyRnPyRtaI-YEzYjDzV0" />
  86.   <meta name="msvalidate.01" content="BA291C2BB06D4C099CF9138D94C4C24B" />
  87.   <meta name="google-translate-customization" content="4870ff0762da6435-906b3721014154a0-g256d826ced58f04d-9"></meta>
  88.  
  89. <link rel='stylesheet' type='text/css' href='http://cdn1.editmysite.com/editor/libraries/fancybox/fancybox.css?1348176505'></script>
  90. <link rel='stylesheet' href='http://cdn1.editmysite.com/editor/images/common/common-v2.css?buildTime=1348176505' type='text/css' />
  91. <link rel='stylesheet' type='text/css' href='files/main_style.css?1348197132' title='wsite-theme-css' />
  92. <style type='text/css'>
  93. #wsite-content div.paragraph, #wsite-content p, #wsite-content .product-block .product-title, #wsite-content .product-description, .blog-sidebar div.paragraph, .blog-sidebar p, .wsite-form-field label, .wsite-form-field label {}
  94. #wsite-content h2, #wsite-content .product-long .product-title, #wsite-content .product-large .product-title, #wsite-content .product-small .product-title, .blog-sidebar h2 {}
  95. #wsite-title{}
  96. </style>
  97. <script type='text/javascript'><!--
  98. var STATIC_BASE = 'http://cdn1.editmysite.com/';
  99. var STYLE_PREFIX = 'wsite';
  100. //-->
  101. </script>
  102. <script type='text/javascript' src='https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js'></script>
  103. <script type='text/javascript' src='http://cdn1.editmysite.com/editor/libraries/jquery_effects.js?1348176505'></script>
  104. <script type='text/javascript' src='http://cdn1.editmysite.com/editor/libraries/fancybox/fancybox.min.js?1348176505'></script>
  105. <script type='text/javascript' src='http://cdn1.editmysite.com/editor/images/common/utilities-jq.js?1348176505'></script>
  106. <script type='text/javascript' src='http://cdn1.editmysite.com/editor/libraries/flyout_menus_jq.js?1348176505'></script>
  107. <script type='text/javascript'><!--
  108. var IS_ARCHIVE=1;
  109. (function(jQuery){
  110. function initFlyouts(){initPublishedFlyoutMenus([{"id":"732580610550224581","title":"Home","url":"index.html"},{"id":"791199019507589116","title":"Software","url":"software.html"},{"id":"185665631450527889","title":"Contact Us","url":"contact-us.html"},{"id":"655691623107481862","title":"Register","url":"register.html"},{"id":"120377591448869403","title":"Windows 8 HOW-TOs","url":"windows-8-how-tos.html"},{"id":"383720836856858449","title":"HTTPS Mirror INFO","url":"https-mirror-info.html"},{"id":"970940401954682759","title":"How to install ooVoo","url":"how-to-install-oovoo.html"},{"id":"925835062994562531","title":"Subscribe for MDTech.us Newsletter","url":"subscribe-for-mdtechus-newsletter.html"},{"id":"664166098389600041","title":"MDT Certificate Authority","url":"mdt-certificate-authority.html"},{"id":"939902576679924408","title":"Visitor Map","url":"visitor-map.html"},{"id":"517608385647474105","title":"Install Teamviewer","url":"install-teamviewer.html"}],'590082422623526219',"<li class='wsite-nav-more'><a href='#'>more...<\/a><\/li>",'',false)}
  111. if (jQuery) {
  112. if (jQuery.browser.msie) window.onload = initFlyouts;
  113. else jQuery(initFlyouts)
  114. }else{
  115. if (Prototype.Browser.IE) window.onload = initFlyouts;
  116. else document.observe('dom:loaded', initFlyouts);
  117. }
  118. })(window._W && _W.jQuery)
  119. //-->
  120. </script>
  121. </head>
  122. <body class='wsite-theme-light wsite-page-bcpa-page'>
  123. <div id="wrapper">
  124.     <div id="header">
  125.       <div id="sitename"><span id="wsite-title">MDTech</span></div>
  126.     </div>
  127.     <div id="navigation">
  128.       <div id="navigation"><ul><li id='pg732580610550224581'><a href='index.html'>Home</a></li><li id='pg791199019507589116'><a href='software.html'>Software</a></li></ul></div>
  129.     </div>
  130.     <div id="content-wrapper">
  131.       <div id="contents-body">
  132.         <div id="contents"><div id='wsite-content' class='wsite-not-footer'>
  133.         <h1>Edit your information and click &quot;Submit&quot;:</h1>
  134.         <form action="/BCPA/BCPA_form/PROC/done/" method="get">
  135.         First Name:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Last Name:<br />
  136.         <input type=text name="FName" value="$FName" style="height: 23px; width: 133px" readonly="readonly" />
  137.         <input type=text name="LName" value="$LName" style="height: 23px; width: 133px" readonly="readonly" /><br />
  138.         Email:
  139.         <br />
  140.         <input type="text" name="Email" value="$Email" style="height: 23px; width: 239px" />
  141.         <br /><br />
  142.         <h4>Your Address:</h4>
  143.         Address Line 1:<br />
  144.         <input type="text" name="AddrLine1" value="$AddrLine1" style="height: 23px; width: 239px" />
  145.         <br />Address Line 2:<br />
  146.         <input type="text" name="AddrLine2" value="$AddrLine2" style="height: 23px; width: 239px" />
  147.         <br />City:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Zip:<br />
  148.         <input type="text" name="City" value="$City" style="height: 23px; width: 125px" />&nbsp;&nbsp;&nbsp;
  149.         <input type="text" name="Zip" value="$Zip" style="height: 23px; width: 63px" /> (state not needed)
  150.         <br /><br /><br />
  151.         <h4>Work Info:</h4>
  152.         Company:<br />
  153.         <input type="text" name="Company" value="$Company" style="height: 23px; width: 125px" />
  154.         <br />
  155.         Job Title:<br />
  156.         <input type="text" name="Job_Title" value="$Job_Title" style="height: 23px; width: 156px" />
  157.         <br /><br />
  158.         <font size="2"><b>Work Address:</b></font><br /><br />
  159.         Address Line 1:<br />
  160.         <input type="text" name="AddrLine1" value="$WAddrLine1" style="height: 23px; width: 239px" />
  161.         <br />Address Line 2:<br />
  162.         <input type="text" name="AddrLine2" value="$WAddrLine2" style="height: 23px; width: 239px" />
  163.         <br />City:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Zip:<br />
  164.         <input type="text" name="City" value="$WCity" style="height: 23px; width: 125px" />&nbsp;&nbsp;&nbsp;
  165.         <input type="text" name="Zip" value="$WZip" style="height: 23px; width: 63px" /> (state not needed)
  166.         <br /><br />
  167.         <h4>Phone numbers:</h4>
  168.         Home Phone:<br /><input type="text" name="HPhone" value="$HPhone" style="height: 23px; width: 125px" /><br />
  169.         Mobile Phone:<br /><input type="text" name="MPhone" value="$MPhone" style="height: 23px; width: 125px" /><br />
  170.         Work Phone:<br /><input type="text" name="WPhone" value="$WPhone" style="height: 23px; width: 125px" /><br />
  171.         <br /><br />
  172.         <input type="button" action="submit" value="Submit" />
  173.         </form>
  174. </div>
  175.       </div>
  176.       <div id="contents-bottom"></div>
  177.      
  178.     </div>
  179.   </div>
  180.    
  181. <meta name="google-site-verification" content="Mv8ukVrmYK4zMgdnRp4qYETNyRnPyRtaI-YEzYjDzV0" />
  182. <meta name="msvalidate.01" content="BA291C2BB06D4C099CF9138D94C4C24B" />
  183.  
  184. </body>
  185. </html>
  186. HTMLPAGE
  187.  
  188. exit;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement