Advertisement
Guest User

Untitled

a guest
Jul 14th, 2017
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.28 KB | None | 0 0
  1. <html>
  2. <head>
  3. <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
  4. <?
  5. require 'config.php';
  6. session_start();
  7.  
  8. // Check if user is logged in using the session variable
  9. if ( $_SESSION['logged_in'] != 1 ) {
  10. $_SESSION['message'] = "You must log in before viewing your profile page!";
  11. header("location: error.php");
  12. }
  13. else {
  14. // Makes it easier to read
  15.  
  16. $id = $_SESSION['id'];
  17. $name = $_SESSION['name'];
  18. $email = $_SESSION['email'];
  19. $active = $_SESSION['active'];
  20. $hash = $_SESSION['hash'];
  21. }
  22.  
  23.  
  24. ?>
  25.  
  26.  
  27. <script type="text/javascript">
  28. function getState(val) {
  29. $.ajax({
  30. type: "POST",
  31. url: "demo_ajax.php",
  32. data:'country_id='+val,
  33. success: function(data){
  34. $("#region").html(data);
  35. }
  36. });
  37. }
  38.  
  39. $(document).ready(function(){
  40. $("#submit").click(function(){
  41.  
  42. var size=$("#size").val();
  43. var industry=$("#industry").val();
  44. var country=$("#country").val();
  45. var region=$("#region").val();
  46. var url=$("#website").val();
  47. var fb=$("#fb").val();
  48. var lkdn=$("#lkdn").val();
  49.  
  50. $.ajax({
  51. type:"post",
  52. url:"process2.php",
  53. data:"size="+size+"&industry="+industry+"&country="+country+"&region="+region+"&url="+url+"&fb="+fb+"&lkdn="+lkdn,
  54. success:function(data){
  55. $("#theform").hide();
  56. $("#info").html(data);
  57. //$("#partone").css();
  58. $("#partone").show();
  59.  
  60. alert("Hello");
  61. }
  62. });
  63. });
  64. });
  65.  
  66.  
  67.  
  68.  
  69. </script>
  70. <?php include 'js/js.html'; ?>
  71. <?php include 'css/css.html'; ?>
  72.  
  73. </head>
  74.  
  75. <body class="w3-blue r_login_corp_body">
  76. <div id="info" style="color:white"></div>
  77. <div class="r_login_corp_body"></div>
  78.  
  79. <div class="w3-content w3-white r_siu r_centered_div">
  80. <header class="w3-camo-black w3-container">
  81. <div class="w3-container ">
  82. <span class="w3-xlarge r_caption">eRecruiter</span> <span class="large">Corporate Login</span>
  83. </div>
  84.  
  85. <div class="w3-black">
  86. <a href="javascript:void(0)" onclick="selectForm('register');">
  87. <div class="w3-half tablink w3-hover-text-yellow w3-padding w3-center w3-padding-16">Register</div>
  88. </a>
  89. </div>
  90. </header>
  91.  
  92. <!-- Register -->
  93. <div id="register" role="form" class="r_form_elements">
  94. <form name="formone" class="form" autocomplete="off">
  95. <div id="profed" class="w3-container w3-padding-16">
  96. <div class="alert alert-error"></div>
  97.  
  98. <label>Company Industry</label>
  99. <input class="w3-input" name="industry" id="industry" type="text" placeholder="Your Industry" >
  100.  
  101. <label>Company Size</label>
  102. <input class="w3-input" name="size" id="size" type="integer" placeholder="Your Company Size" >
  103.  
  104. <label >Country:</label>
  105. <select name="country" id="country" class="demoInputBox" onChange="getState(this.value);" >
  106. <option value="">Select Country</option>
  107. <?php
  108. $sql1="SELECT * FROM pentagonal_country";
  109. $results=$mysqli->query($sql1);
  110. while($rs=$results->fetch_assoc()) {
  111. ?>
  112. <option value="<?php echo $rs["country_code"]; ?>"><?php echo $rs["country_name"]; ?></option>
  113. <?php
  114. }
  115. ?>
  116. </select>
  117.  
  118. <label>State:</label>
  119. <select id="region" name="region" onKeyup="checkform()">
  120. <option value="">Select State</option>
  121. </select>
  122.  
  123. <label>Website</label>
  124. <input class="w3-input" name="website" id="website" type="url" placeholder="Your Website-Address" >
  125.  
  126. <label>Facebook</label>
  127. <input class="w3-input" name="fb" id="fb" type="url" placeholder="https://facebook.com/" >
  128.  
  129. <label>Linkedin</label>
  130. <input class="w3-input" name="lkdn" id="lkdn" type="url" placeholder="https://linkedin.com/in/">
  131. </div>
  132. <div class="w3-row">
  133. <button type="submit" id="submit" class="w3-button w3-black w3-half w3-hover-yellow" >Add</button>
  134. <button class="w3-button w3-black w3-half w3-hover-pale-yellow">Forgot Password</button>
  135.  
  136. </div>
  137. </form>
  138. </div>
  139. <!-- Register -->
  140. <div id="partone" style="display:none">
  141. <form>
  142. name : <input type="text" name="name" id="name">
  143. </br>
  144. message : <input type="text" name="message" id="message">
  145. </br>
  146.  
  147. </br>
  148. name : <input type="text" name="url" id="url">
  149. </br>
  150. message : <input type="text" name="fb" id="fb">
  151. </br>
  152. name : <input type="text" name="lkdn" id="lkdn">
  153. </br>
  154.  
  155. </br> </br>
  156. Send;
  157.  
  158. </form>
  159. </div>
  160. </div>
  161.  
  162.  
  163. </body>
  164. </html>
  165.  
  166. <?php
  167. $servername = "localhost";
  168. $username = "root";
  169. $password = "";
  170. $dbname = "remotejobs";
  171.  
  172. session_start();
  173.  
  174. // Check if user is logged in using the session variable
  175. if ( $_SESSION['logged_in'] != 1 ) {
  176. $_SESSION['message'] = "You must log in before viewing your profile page!";
  177. header("location: error.php");
  178. }
  179. else {
  180. // Makes it easier to read
  181.  
  182. $id = $_SESSION['id'];
  183. $name = $_SESSION['name'];
  184. $email = $_SESSION['email'];
  185. $active = $_SESSION['active'];
  186. $hash = $_SESSION['hash'];
  187. }
  188.  
  189. // Create connection
  190. $conn = mysqli_connect($servername, $username, $password, $dbname);
  191. // Check connection
  192. if (!$conn) {
  193. die("Connection failed: " . mysqli_connect_error());
  194. }
  195.  
  196. $industry=$_POST["industry"];
  197. $size=$_POST["size"];
  198. $country=$_POST["country"];
  199. $region=$_POST["region"];
  200. $website=$_POST["url"];
  201. $fb=$_POST["fb"];
  202. $lkdn=$_POST["lkdn"];
  203. $usrid=$id;
  204.  
  205. $sql = "INSERT INTO corp_user_profile (id, industry, size, nation, region, url, facebook, linkedin)
  206. VALUES ('$usrid', '$industry','$size', '$country', '$region', '$website', '$fb', '$lkdn')";
  207.  
  208.  
  209. if (mysqli_query($conn, $sql)) {
  210. echo "New record created successfully";
  211. } else {
  212. echo "Error: " . $sql . "<br>" . mysqli_error($conn);
  213. }
  214.  
  215. mysqli_close($conn);
  216. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement