Guest User

Untitled

a guest
Apr 14th, 2018
159
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 14.74 KB | None | 0 0
  1. </head>
  2.  
  3. <body>
  4. <!-- Home -->
  5. <div data-role="page" id="page1">
  6. <div data-theme="a" data-role="header">
  7. <a data-role="button" data-theme="d" href="login.html" data-icon="arrow-l" data-iconpos="left" class="ui-btn-left">
  8. Back
  9. </a>
  10. <a data-role="button" href="index.html" data-icon="home" data-iconpos="right" data-theme="d" class="ui-btn-right">
  11. Home
  12. </a>
  13. <h3>
  14. Login Process
  15. </h3>
  16. </div>
  17. <div data-role="content">
  18.  
  19. <?php
  20. // takes the variables from action script and assigns them php variables names
  21. $user = $_POST ['username'];
  22. $pass = $_POST ['password'];
  23.  
  24. // if there is a user name and password
  25. if ($user && $pass)
  26. {
  27. // connect to server
  28. mysql_connect("localhost", "", "") or die(mysql_error());
  29. //select database
  30. mysql_select_db("") or die(mysql_error());
  31.  
  32. //Create a query that selects all data from the PATIENT table where the username and password match
  33. $query = "SELECT * FROM Patient WHERE Username = '$user' AND Password = '$pass'";
  34.  
  35. //executes query on the database
  36. $result = mysql_query ($query) or die ("didn't query");
  37. //this selects the results as rows
  38.  
  39. $num = mysql_num_rows ($result);
  40. //if there is only 1 result returned than the data is ok
  41. if ($num == 1)
  42. {
  43. //sends back a data of "Success"
  44. echo "Successful Login";
  45. $row=mysql_fetch_array($result);
  46. $_SESSION['Name'] = $row['Name'];
  47. $_SESSION['Address'] = $row['Address'];
  48. }
  49. else
  50. {
  51. //sends back a message of "failed"
  52. echo "Unsuccessful Login";
  53. }
  54. }
  55.  
  56. ?>
  57. </div>
  58. </div>
  59. </body>
  60.  
  61. </html>
  62.  
  63. <?php
  64. // takes the variables from action script and assigns them php variables names
  65. $user = $_POST ['username'];
  66. $pass = $_POST ['password'];
  67. $error = '';
  68.  
  69. // if there is a user name and password
  70. if ($user && $pass)
  71. {
  72. // connect to server
  73. mysql_connect("localhost", "", "") or die(mysql_error());
  74. //select database
  75. mysql_select_db("") or die(mysql_error());
  76.  
  77. //Create a query that selects all data from the PATIENT table where the username and password match
  78. $query = "SELECT * FROM Patient WHERE Username = '$user' AND Password = '$pass'";
  79.  
  80. //executes query on the database
  81. $result = mysql_query ($query) or die ("didn't query");
  82. //this selects the results as rows
  83.  
  84. $num = mysql_num_rows ($result);
  85. //if there is only 1 result returned than the data is ok
  86. if ($num == 1)
  87. {
  88. header("Location: http://helios.hud.ac.uk/u101010/PHP/details1.php");
  89. }
  90. //sends back a data of "Success"
  91. $return_message = "Successful Login";
  92. $row=mysql_fetch_array($result);
  93. $_SESSION['Name'] = $row['Name'];
  94. $_SESSION['Address'] = $row['Address'];
  95. }
  96. else
  97. {
  98. //sends back a message of "failed"
  99. $return_message = echo "Unsuccessful Login";
  100. }
  101. }
  102. <html>
  103. <head>
  104. <meta charset="utf-8" />
  105. <meta name="viewport" content="width=device-width, initial-scale=1" />
  106. <meta name="apple-mobile-web-app-capable" content="yes" />
  107. <meta name="apple-mobile-web-app-status-bar-style" content="black" />
  108. <title>
  109. </title>
  110. <link rel="stylesheet" href="https://ajax.aspnetcdn.com/ajax/jquery.mobile/1.2.0/jquery.mobile-1.2.0.min.css" />
  111. <link rel="stylesheet" href="my.css" />
  112. <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js">
  113. </script>
  114. <script src="https://ajax.aspnetcdn.com/ajax/jquery.mobile/1.2.0/jquery.mobile-1.2.0.min.js">
  115. </script>
  116. <script src="my.js">
  117. </script>
  118. <!-- User-generated css -->
  119. <style>
  120. </style>
  121. <!-- User-generated js -->
  122. <script>
  123. try {
  124.  
  125. $(function() {
  126.  
  127. });
  128.  
  129. } catch (error) {
  130. console.error("Your javascript has an error: " + error);
  131. }
  132. </script>
  133.  
  134. ?>
  135. </head>
  136.  
  137. <body>
  138. <!-- Home -->
  139. <div data-role="page" id="page1">
  140. <div data-theme="a" data-role="header">
  141. <a data-role="button" data-theme="d" href="login.html" data-icon="arrow-l" data-iconpos="left" class="ui-btn-left">
  142. Back
  143. </a>
  144. <a data-role="button" href="index.html" data-icon="home" data-iconpos="right" data-theme="d" class="ui-btn-right">
  145. Home
  146. </a>
  147. <h3>
  148. Login Process
  149. </h3>
  150. </div>
  151. <div data-role="content">
  152.  
  153. <?php echo $return_message; ?>
  154.  
  155. </div>
  156. </div>
  157. </body>
  158.  
  159. </html>
  160.  
  161. <!DOCTYPE html>
  162. <?php
  163. session_start();
  164. ?>
  165. <html>
  166.  
  167. <head>
  168. <meta charset="utf-8" />
  169. <meta name="viewport" content="width=device-width, initial-scale=1" />
  170. <meta name="apple-mobile-web-app-capable" content="yes" />
  171. <meta name="apple-mobile-web-app-status-bar-style" content="black" />
  172. <title>
  173. </title>
  174. <link rel="stylesheet" href="https://ajax.aspnetcdn.com/ajax/jquery.mobile/1.2.0/jquery.mobile-1.2.0.min.css" />
  175. <link rel="stylesheet" href="my.css" />
  176. <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js">
  177. </script>
  178. <script src="https://ajax.aspnetcdn.com/ajax/jquery.mobile/1.2.0/jquery.mobile-1.2.0.min.js">
  179. </script>
  180. <script src="my.js">
  181. </script>
  182. <!-- User-generated css -->
  183. <style>
  184. </style>
  185. <!-- User-generated js -->
  186. <script>
  187. try {
  188.  
  189. $(function() {
  190.  
  191. });
  192.  
  193. } catch (error) {
  194. console.error("Your javascript has an error: " + error);
  195. }
  196. </script>
  197. </head>
  198.  
  199. <body>
  200. <!-- Home -->
  201. <div data-role="page" id="page1">
  202. <div data-theme="a" data-role="header">
  203. <a data-role="button" data-theme="c" href="menu.html" data-icon="arrow-l" data-iconpos="left" class="ui-btn-left">
  204. Main Menu
  205. </a>
  206. <h3>
  207. Your details
  208. </h3>
  209.  
  210.  
  211. </div>
  212. <div data-role="content">
  213. Name:
  214. <?php echo $_SESSION['Name'];?>
  215. <br /> Address:
  216. <?php echo $_SESSION['Address'];?>
  217.  
  218.  
  219.  
  220. </div>
  221. </body>
  222.  
  223. </html>
  224.  
  225. <!DOCTYPE html>
  226. <html>
  227.  
  228. <head>
  229. <meta charset="utf-8" />
  230. <meta name="viewport" content="width=device-width, initial-scale=1" />
  231. <meta name="apple-mobile-web-app-capable" content="yes" />
  232. <meta name="apple-mobile-web-app-status-bar-style" content="black" />
  233. <title>
  234. </title>
  235. <link rel="stylesheet" href="https://ajax.aspnetcdn.com/ajax/jquery.mobile/1.2.0/jquery.mobile-1.2.0.min.css" />
  236. <link rel="stylesheet" href="my.css" />
  237. <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js">
  238. </script>
  239. <script src="https://ajax.aspnetcdn.com/ajax/jquery.mobile/1.2.0/jquery.mobile-1.2.0.min.js">
  240. </script>
  241. <script src="my.js">
  242. </script>
  243. <!-- User-generated css -->
  244. <style>
  245. </style>
  246. <!-- User-generated js -->
  247. <script>
  248. try {
  249.  
  250. $(function() {
  251.  
  252. });
  253.  
  254. } catch (error) {
  255. console.error("Your javascript has an error: " + error);
  256. }
  257. </script>
  258. </head>
  259.  
  260. <body>
  261. <!-- Home -->
  262. <div data-role="page" id="page1">
  263. <div data-theme="a" data-role="header">
  264. <a data-role="button" data-theme="c" href="menu.html" data-icon="arrow-l" data-iconpos="left" class="ui-btn-left">
  265. Main Menu
  266. </a>
  267. <h3>
  268. Your details
  269. </h3>
  270. </div>
  271. <form name="form1" method="post" action="details1.php">
  272. <strong>Details</strong>
  273. <br />
  274. <br /> Name: <input type="text" name "Name" />
  275. <br /> Address: <input type="text" name="Address" />
  276. <br />
  277. <input type="submit" name="Submit" value="Book appointment" />
  278. <br />
  279. <input type="submit" name="Submit" value="Cancel appointment" />
  280. </form>
  281.  
  282. </div>
  283. </body>
  284.  
  285. </html>
  286.  
  287. <!DOCTYPE html>
  288. <html>
  289.  
  290. <head>
  291. <meta charset="utf-8" />
  292. <meta name="viewport" content="width=device-width, initial-scale=1" />
  293. <meta name="apple-mobile-web-app-capable" content="yes" />
  294. <meta name="apple-mobile-web-app-status-bar-style" content="black" />
  295. <title>
  296. </title>
  297. <link rel="stylesheet" href="https://ajax.aspnetcdn.com/ajax/jquery.mobile/1.2.0/jquery.mobile-1.2.0.min.css" />
  298. <link rel="stylesheet" href="my.css" />
  299. <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js">
  300. </script>
  301. <script src="https://ajax.aspnetcdn.com/ajax/jquery.mobile/1.2.0/jquery.mobile-1.2.0.min.js">
  302. </script>
  303. <script src="my.js">
  304. </script>
  305. <!-- User-generated css -->
  306. <style>
  307. </style>
  308. <!-- User-generated js -->
  309. <script>
  310. try {
  311.  
  312. $(function() {
  313.  
  314. });
  315.  
  316. } catch (error) {
  317. console.error("Your javascript has an error: " + error);
  318. }
  319. </script>
  320. </head>
  321.  
  322. <body>
  323. <!-- Home -->
  324. <div data-role="page" id="page1">
  325. <div data-theme="a" data-role="header">
  326. <a data-role="button" data-theme="d" href="login.html" data-icon="arrow-l" data-iconpos="left" class="ui-btn-left">
  327. Back
  328. </a>
  329. <a data-role="button" href="index.html" data-icon="home" data-iconpos="right" data-theme="d" class="ui-btn-right">
  330. Home
  331. </a>
  332. <h3>
  333. Login
  334. </h3>
  335. </div>
  336. <div data-role="content">
  337. <h4>
  338. Enter login details below:
  339. </h4>
  340.  
  341. <form name="form1" method="post" action="login.php">
  342. <strong>Patient Login </strong>
  343. <br />
  344. <br /> Username: <input name="username" type="text" id="username" />
  345. <br /> Password: <input name="password" type="password" id="password" />
  346. <br />
  347. <br />
  348. <br />
  349. <input type="submit" name="Submit" value="Login" />
  350. </form>
  351. <br />
  352. <div data-role="content">
  353. <h4>
  354. Please ensure your username and password are kept secure.
  355. </h4>
  356.  
  357. <br />
  358. </div>
  359. </div>
  360. </body>
  361.  
  362. </html>
  363.  
  364. if ($num == 1)
  365.  
  366. {
  367.  
  368. header("Location: http://www.example.com");
  369.  
  370. }
  371.  
  372. <?php
  373.  
  374. // takes the variables from action script and assigns them php variables names
  375. $user = $_POST ['username'];
  376. $pass = $_POST ['password'];
  377. $error = '';
  378.  
  379. // if there is a user name and password
  380. if ($user && $pass)
  381. {
  382. // connect to server
  383. mysql_connect("localhost", "", "") or die(mysql_error());
  384. //select database
  385. mysql_select_db("") or die(mysql_error());
  386.  
  387. //Create a query that selects all data from the PATIENT table where the username and password match
  388. $query = "SELECT * FROM Patient WHERE Username = '$user' AND Password = '$pass'";
  389.  
  390. //executes query on the database
  391. $result = mysql_query ($query) or die ("didn't query");
  392. //this selects the results as rows
  393.  
  394. $num = mysql_num_rows ($result);
  395. //if there is only 1 result returned than the data is ok
  396. if ($num == 1)
  397. {
  398. //sends back a data of "Success"
  399. header("Location: success.php");
  400.  
  401. }
  402. else
  403. {
  404. //sends back a message of "failed"
  405. $error = "Unsuccessful Login";
  406. }
  407. }
  408.  
  409. ?>
  410.  
  411. <html>
  412. <head>
  413. </head>
  414. <body>
  415. <!-- Home -->
  416. <div data-role="page" id="page1">
  417. <div data-theme="a" data-role="header">
  418. <a data-role="button" data-theme="d" href="login.html" data-icon="arrow-l" data-iconpos="left" class="ui-btn-left">
  419. Back
  420. </a>
  421. <a data-role="button" href="index.html" data-icon="home" data-iconpos="right" data-theme="d"class="ui-btn-right">
  422. Home
  423. </a>
  424. <h3>
  425. Login Process
  426. </h3>
  427. </div>
  428. <div data-role="content">
  429.  
  430.  
  431. <?php echo $error; ?>
  432.  
  433. </div>
  434. </div>
  435. </body>
  436. </html>`
  437.  
  438. header("Location: http://www.example.com");
  439. die();
  440.  
  441. header("Location: http://www.test.com");
  442.  
  443. <?php
  444. // takes the variables from action script and assigns them php variables names
  445. $user = $_POST ['username'];
  446. $pass = $_POST ['password'];
  447.  
  448. // if there is a user name and password
  449. if ($user && $pass)
  450. {
  451. // connect to server
  452. mysql_connect("localhost", "", "") or die(mysql_error());
  453. //select database
  454. mysql_select_db("") or die(mysql_error());
  455.  
  456. //Create a query that selects all data from the PATIENT table where the username and password match
  457. $query = "SELECT * FROM Patient WHERE Username = '$user' AND Password = '$pass'";
  458.  
  459. //executes query on the database
  460. $result = mysql_query ($query) or die ("didn't query");
  461. //this selects the results as rows
  462.  
  463. $num = mysql_num_rows ($result);
  464. //if there is only 1 result returned than the data is ok
  465. if ($num == 1)
  466. {
  467. //sends back a data of "Success"
  468. $return_message = "Successful Login";
  469. $row=mysql_fetch_array($result);
  470. $_SESSION['Name'] = $row['Name'];
  471. $_SESSION['Address'] = $row['Address'];
  472. }
  473. else
  474. {
  475. //sends back a message of "failed"
  476. $return_message = echo "Unsuccessful Login";
  477. }
  478. }
  479.  
  480. ?></head>
  481. <body>
  482. <!-- Home -->
  483. <div data-role="page" id="page1">
  484. <div data-theme="a" data-role="header">
  485. <a data-role="button" data-theme="d" href="login.html" data-icon="arrow-l" data-iconpos="left" class="ui-btn-left">
  486. Back
  487. </a>
  488. <a data-role="button" href="index.html" data-icon="home" data-iconpos="right" data-theme="d"class="ui-btn-right">
  489. Home
  490. </a>
  491. <h3>
  492. Login Process
  493. </h3>
  494. </div>
  495. <div data-role="content">
  496.  
  497. <?php echo $return_message; ?>
  498.  
  499. </div>
  500. </div>
  501. </body>
  502. </html>
  503.  
  504. <script type="text/javascript">window.location = 'PathToYourPage.extension'</script>
Add Comment
Please, Sign In to add comment