Advertisement
Guest User

Untitled

a guest
Jun 20th, 2017
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 15.30 KB | None | 0 0
  1. ■board-input.php
  2. <?php require 'header.php'; ?>
  3. <style type="text/css">
  4. <!--
  5. html,body {
  6.     background-color: transparent;
  7.     scrollbar-arrow-color: #ffccff;
  8.     scrollbar-face-color: #ffcccc;
  9.     scrollbar-3dlight-color: #ffffff;
  10.     scrollbar-darkshadow-color: #ffcccc;
  11.     scrollbar-highlight-color: #ff9999;
  12.     scrollbar-shadow-color: #ff9999;
  13.     scrollbar-track-color: #ffffff;
  14. }
  15.  
  16. -->
  17.  
  18. p#submit_btn {
  19.     text-align: center;
  20.     font-family: "あずきフォント";
  21. }
  22.  
  23. .content {
  24.     /*  margin-left: 137px; */
  25.     margin-top: 0px;
  26.     font-size: 95%;
  27.     font-weight: bold;
  28.     font-family: "あずきフォント";
  29. /*  color: #6c2735; */
  30.     color: #f3b3e6;
  31. }
  32.  
  33. .form {
  34.     color: white;
  35.     background-color: #9FD6D2;
  36.     text-align: center;
  37.     /*  padding-left: 370px; */
  38.     padding-top: 5px;
  39.     padding-bottom: 5px;
  40.     font-weight: bold;
  41.     font-size: 95%;
  42.     width: 825px;
  43.     font-family: "あずきフォント";
  44. }
  45.  
  46. .textform {
  47.     margin-left: 68px;
  48. }
  49.  
  50. .textform_postalCode {
  51.     margin-left: 30px;
  52. }
  53.  
  54. .textstyle {
  55.     font-size: 95%;
  56. /*  color: #6c2735; */
  57.     color: #f7c2c2;
  58.     font-weight: bold;
  59.     font-family: "あずきフォント";
  60. }
  61.  
  62. .required {
  63.     font-size: 87%;
  64.     font-weight: normal;
  65.     color: red;
  66.     font-family: "あずきフォント";
  67. }
  68. .title_a{
  69.     color: #f7c2c2;
  70.     font-weight: bold;
  71.     font-family: "あずきフォント";
  72. }
  73.  
  74. #heading {
  75. /*  border-left: 10px solid #6c2735; */
  76. /*  border-bottom: medium solid #6c2735; */
  77.     border-left: 10px solid #6c2735;
  78.     border-bottom: medium solid #f7c2c2;
  79.     color: #f7c2c2;
  80. /*  color: #cc528b; */
  81.     font-family: "あずきフォント";
  82.     -ms-font-feature-settings: "normal";
  83. }
  84. /* 送信ボタン */
  85. input[type="submit"] {
  86.     padding: 10px 20px;
  87.     border: none;
  88.     /*  background: #9FD6D2; */
  89.     background: #f7c2c2;
  90.     color: #fff;
  91.     font-family: "あずきフォント";
  92. }
  93.  
  94. /* 送信ボタン - マウスオーバー時 */
  95. input[type="submit"]:hover {
  96.     /*  background: #54A9BD; */
  97.     background: #ff9b9f;
  98.     font-family: "あずきフォント";
  99. }
  100.  
  101. /* 送信ボタン - 押せないとき */
  102. input[type="submit"][disabled] {
  103.     background-color: #ccc;
  104.     cursor: default;
  105.     font-family: "あずきフォント";
  106. }
  107.  
  108. input.example,select {
  109.     width: 250px;
  110.     font-family: "あずきフォント";
  111. }
  112.  
  113. textarea {
  114.     width: 480px;
  115.     font-family: "あずきフォント";
  116. }
  117. .styled-select select {
  118.    background: transparent;
  119.    width: 268px;
  120.    padding: 5px;
  121.    font-size: 16px;
  122.    line-height: 1;
  123.    border: 0;
  124.    border-radius: 0;
  125.    height: 34px;
  126.    -webkit-appearance: none;
  127.    }
  128. /* select{ */
  129. /*  color: white; */
  130. /*  background-color: #f3b3e6; */
  131. /* } */
  132. /* カーソルをあてた時に変わる色 */
  133. input:focus,select:focus,textarea:focus {
  134.     background-color: #f7c2c2;
  135. /*  background-color: #f2dae8; */
  136.     font-family: "あずきフォント";
  137.     border:solid 1px #cc528b;
  138. }
  139. /*検索ボタン*/
  140. input[type="button"] {
  141.     background: #f7c2c2;
  142.     color: white;
  143.     /*   width: 55px; */
  144.     height: 30px;
  145.     border: 0;
  146.     line-height: 30px;
  147.     font-family: "あずきフォント";
  148. }
  149.  
  150. input[type="button"]:hover {
  151.     background: #ff9b9f;
  152.     height: 30px;
  153.     color: #fff;
  154.     border: 0;
  155.     cursor: pointer;
  156.     font-family: "あずきフォント";
  157. }
  158.  
  159. input[type="button"].disabled {
  160.     background: #f7c2c2;
  161.     cursor: default;
  162. }
  163.  
  164. input[type="button"].disabled:hover {
  165.     background: #f7c2c2;
  166.     font-family: "あずきフォント";
  167. }
  168. /* @font-face { */
  169. /* font-family: あずきフォント; */
  170. /* src: url(azuki.ttf) format("truetype"); */
  171. /*   url(azuki.woff) format("woff"); /* Modern Browsers */ */
  172. /* } */
  173. @font-face{
  174.     font-family: 'あずきフォント'; /* お好きな名前に */
  175.     src: url('azuki.eot'); /* IE9以上用 */
  176.     src: url('azuki.eot?#iefix') format('embedded-opentype'), /* IE8以前用 */
  177.         url('azuki.woff') format('woff'), /* モダンブラウザ用 */
  178.         url('azuki.ttf') format('truetype'); /* iOS, Android用 */
  179. }
  180. .stepBar {
  181.   position: relative;
  182.   list-style: none;
  183.   margin: 0 0 1em;
  184.   padding: 0;
  185.   text-align: center;
  186.   width: 100%;
  187.   overflow: hidden;
  188.   *zoom: 1;
  189.   font-family: "あずきフォント";
  190. }
  191. .stepBar .step {
  192.   position: relative;
  193.   float: left;
  194.   display: inline-block;
  195.   line-height: 40px;
  196.   padding: 0 40px 0 20px;
  197.   background-color: #eee;
  198.   -moz-box-sizing: border-box;
  199.   -webkit-box-sizing: border-box;
  200.   box-sizing: border-box;
  201. }
  202. .stepBar .step:before, .stepBar .step:after {
  203.   position: absolute;
  204.   left: -15px;
  205.   display: block;
  206.   content: '';
  207.   background-color: #eee;
  208.   border-left: 4px solid #FFF;
  209.   width: 20px;
  210.   height: 20px;
  211. }
  212. .stepBar .step:after {
  213.   top: 0;
  214.   -moz-transform: skew(30deg);
  215.   -ms-transform: skew(30deg);
  216.   -webkit-transform: skew(30deg);
  217.   transform: skew(30deg);
  218. }
  219. .stepBar .step:before {
  220.   bottom: 0;
  221.   -moz-transform: skew(-30deg);
  222.   -ms-transform: skew(-30deg);
  223.   -webkit-transform: skew(-30deg);
  224.   transform: skew(-30deg);
  225. }
  226. .stepBar .step:first-child {
  227.   -moz-border-radius-topleft: 4px;
  228.   -webkit-border-top-left-radius: 4px;
  229.   border-top-left-radius: 4px;
  230.   -moz-border-radius-bottomleft: 4px;
  231.   -webkit-border-bottom-left-radius: 4px;
  232.   border-bottom-left-radius: 4px;
  233. }
  234. .stepBar .step:first-child:before, .stepBar .step:first-child:after {
  235.   content: none;
  236. }
  237. .stepBar .step:last-child {
  238.   -moz-border-radius-topright: 4px;
  239.   -webkit-border-top-right-radius: 4px;
  240.   border-top-right-radius: 4px;
  241.   -moz-border-radius-bottomright: 4px;
  242.   -webkit-border-bottom-right-radius: 4px;
  243.   border-bottom-right-radius: 4px;
  244. }
  245. .stepBar .step.current {
  246.   color: #FFF;
  247.   background-color: #6c2735;
  248.  
  249.   font-family: "あずきフォント";
  250. }
  251. .stepBar:hover{
  252.   background-color:#DEC8B1';
  253. }
  254. .stepBar .step.current:before, .stepBar .step.current:after {
  255.   background-color: #6c2735;
  256.     onmouseover="style.background='#DEC8B1'";
  257.   onmouseout="style.background='#6c2735'";
  258.     font-family: "あずきフォント";
  259. }
  260. .stepBar.step2 .step {
  261.   width: 50%;
  262. }
  263. .stepBar.step3 .step {
  264.   width: 33.333%;
  265. }
  266. .stepBar.step4 .step {
  267.   width: 25%;
  268. }
  269. .stepBar.step5 .step {
  270.   width: 20%;
  271. }
  272. div.img-move a:hover {
  273.  position: relative;
  274.  top: -1px;
  275.  left: -1px;
  276. }
  277. div.img-move a:active {
  278.  position: relative;
  279.  top: 5px;
  280.  left: 5px;
  281. }
  282. .button,
  283. .button span {
  284.     position: relative;
  285.     display: inline-block;
  286. }
  287. .button span {
  288.     padding: .65em 4em;
  289.     background: -webkit-linear-gradient(#fe5f95 , #ff3f7f);
  290.     background: linear-gradient(#fe5f95 , #ff3f7f);
  291.     border: 1px solid #fe3276;
  292.     border-radius: 4px;
  293.     color: #fff;
  294.     text-decoration: none;
  295.     text-align: center;
  296.     -webkit-animation: 3s float ease-in-out infinite;
  297.     animation: 3s float ease-in-out infinite;
  298. }
  299. .button::after {
  300.     position: absolute;
  301.     bottom: -15px;
  302.     left: 50%;
  303.     z-index: -1;
  304.     content: '';
  305.     width: 100%;
  306.     height: 24px;
  307.     background-color: rgba(0,0,0,.1);
  308.     border-radius: 50%;
  309.     -webkit-transform: translateX(-50%);
  310.     transform: translateX(-50%);
  311.     -webkit-animation: 3s shadow ease-in-out infinite;
  312.     animation: 3s shadow ease-in-out infinite;
  313. }
  314. @-webkit-keyframes float {
  315.     50% {
  316.         -webkit-transform: translateY(-10px);
  317.     }
  318. }
  319. @keyframes float {
  320.     50% {
  321.         transform: translateY(-10px);
  322.     }
  323. }
  324. @-webkit-keyframes shadow {
  325.     50% {
  326.         width: 70%;
  327.         height: 18px;
  328.     }
  329. }
  330. @keyframes shadow {
  331.     50% {
  332.         width: 70%;
  333.         height: 18px;
  334.     }
  335. }
  336. </style>
  337. <h1 class="title_a">ひとこと掲示板</h1>
  338. <p class="textstyle">投稿するメッセージを入力してください。</p>
  339. <form action="board-output.php" method="post">
  340. <input type="text" name="message">
  341. <input type="submit" value="投稿">
  342. </form>
  343. <button onclick="history.back()">戻る</button>
  344.     <p class="textstyle">
  345.         <a href="board-output.php">ひとこと掲示板へ</a>
  346.     </p>
  347. <?php require 'footer.php'; ?>
  348.  
  349. ■board-output.php
  350. <?php
  351.  
  352. ?>
  353. <?php require 'header.php'; ?>
  354. <style type="text/css">
  355. <!--
  356. html,body {
  357.     background-color: transparent;
  358.     scrollbar-arrow-color: #ffccff;
  359.     scrollbar-face-color: #ffcccc;
  360.     scrollbar-3dlight-color: #ffffff;
  361.     scrollbar-darkshadow-color: #ffcccc;
  362.     scrollbar-highlight-color: #ff9999;
  363.     scrollbar-shadow-color: #ff9999;
  364.     scrollbar-track-color: #ffffff;
  365. }
  366.  
  367. -->
  368.  
  369. p#submit_btn {
  370.     text-align: center;
  371.     font-family: "あずきフォント";
  372. }
  373.  
  374. .content {
  375.     /*  margin-left: 137px; */
  376.     margin-top: 0px;
  377.     font-size: 95%;
  378.     font-weight: bold;
  379.     font-family: "あずきフォント";
  380. /*  color: #6c2735; */
  381.     color: #f3b3e6;
  382. }
  383.  
  384. .form {
  385.     color: white;
  386.     background-color: #9FD6D2;
  387.     text-align: center;
  388.     /*  padding-left: 370px; */
  389.     padding-top: 5px;
  390.     padding-bottom: 5px;
  391.     font-weight: bold;
  392.     font-size: 95%;
  393.     width: 825px;
  394.     font-family: "あずきフォント";
  395. }
  396.  
  397. .textform {
  398.     margin-left: 68px;
  399. }
  400.  
  401. .textform_postalCode {
  402.     margin-left: 30px;
  403. }
  404.  
  405. .textstyle {
  406.     font-size: 95%;
  407. /*  color: #6c2735; */
  408.     color: #f7c2c2;
  409.     font-weight: bold;
  410.     font-family: "あずきフォント";
  411. }
  412.  
  413. .required {
  414.     font-size: 87%;
  415.     font-weight: normal;
  416.     color: red;
  417.     font-family: "あずきフォント";
  418. }
  419. .title_a{
  420.     color: #f7c2c2;
  421.     font-weight: bold;
  422.     font-family: "あずきフォント";
  423. }
  424.  
  425. #heading {
  426. /*  border-left: 10px solid #6c2735; */
  427. /*  border-bottom: medium solid #6c2735; */
  428.     border-left: 10px solid #6c2735;
  429.     border-bottom: medium solid #f7c2c2;
  430.     color: #f7c2c2;
  431. /*  color: #cc528b; */
  432.     font-family: "あずきフォント";
  433.     -ms-font-feature-settings: "normal";
  434. }
  435. /* 送信ボタン */
  436. input[type="submit"] {
  437.     padding: 10px 20px;
  438.     border: none;
  439.     /*  background: #9FD6D2; */
  440.     background: #f7c2c2;
  441.     color: #fff;
  442.     font-family: "あずきフォント";
  443. }
  444.  
  445. /* 送信ボタン - マウスオーバー時 */
  446. input[type="submit"]:hover {
  447.     /*  background: #54A9BD; */
  448.     background: #ff9b9f;
  449.     font-family: "あずきフォント";
  450. }
  451.  
  452. /* 送信ボタン - 押せないとき */
  453. input[type="submit"][disabled] {
  454.     background-color: #ccc;
  455.     cursor: default;
  456.     font-family: "あずきフォント";
  457. }
  458.  
  459. input.example,select {
  460.     width: 250px;
  461.     font-family: "あずきフォント";
  462. }
  463.  
  464. textarea {
  465.     width: 480px;
  466.     font-family: "あずきフォント";
  467. }
  468. .styled-select select {
  469.    background: transparent;
  470.    width: 268px;
  471.    padding: 5px;
  472.    font-size: 16px;
  473.    line-height: 1;
  474.    border: 0;
  475.    border-radius: 0;
  476.    height: 34px;
  477.    -webkit-appearance: none;
  478.    }
  479. /* select{ */
  480. /*  color: white; */
  481. /*  background-color: #f3b3e6; */
  482. /* } */
  483. /* カーソルをあてた時に変わる色 */
  484. input:focus,select:focus,textarea:focus {
  485.     background-color: #f7c2c2;
  486. /*  background-color: #f2dae8; */
  487.     font-family: "あずきフォント";
  488.     border:solid 1px #cc528b;
  489. }
  490. /*検索ボタン*/
  491. input[type="button"] {
  492.     background: #f7c2c2;
  493.     color: white;
  494.     /*   width: 55px; */
  495.     height: 30px;
  496.     border: 0;
  497.     line-height: 30px;
  498.     font-family: "あずきフォント";
  499. }
  500.  
  501. input[type="button"]:hover {
  502.     background: #ff9b9f;
  503.     height: 30px;
  504.     color: #fff;
  505.     border: 0;
  506.     cursor: pointer;
  507.     font-family: "あずきフォント";
  508. }
  509.  
  510. input[type="button"].disabled {
  511.     background: #f7c2c2;
  512.     cursor: default;
  513. }
  514.  
  515. input[type="button"].disabled:hover {
  516.     background: #f7c2c2;
  517.     font-family: "あずきフォント";
  518. }
  519. /* @font-face { */
  520. /* font-family: あずきフォント; */
  521. /* src: url(azuki.ttf) format("truetype"); */
  522. /*   url(azuki.woff) format("woff"); /* Modern Browsers */ */
  523. /* } */
  524. @font-face{
  525.     font-family: 'あずきフォント'; /* お好きな名前に */
  526.     src: url('azuki.eot'); /* IE9以上用 */
  527.     src: url('azuki.eot?#iefix') format('embedded-opentype'), /* IE8以前用 */
  528.         url('azuki.woff') format('woff'), /* モダンブラウザ用 */
  529.         url('azuki.ttf') format('truetype'); /* iOS, Android用 */
  530. }
  531. .stepBar {
  532.   position: relative;
  533.   list-style: none;
  534.   margin: 0 0 1em;
  535.   padding: 0;
  536.   text-align: center;
  537.   width: 100%;
  538.   overflow: hidden;
  539.   *zoom: 1;
  540.   font-family: "あずきフォント";
  541. }
  542. .stepBar .step {
  543.   position: relative;
  544.   float: left;
  545.   display: inline-block;
  546.   line-height: 40px;
  547.   padding: 0 40px 0 20px;
  548.   background-color: #eee;
  549.   -moz-box-sizing: border-box;
  550.   -webkit-box-sizing: border-box;
  551.   box-sizing: border-box;
  552. }
  553. .stepBar .step:before, .stepBar .step:after {
  554.   position: absolute;
  555.   left: -15px;
  556.   display: block;
  557.   content: '';
  558.   background-color: #eee;
  559.   border-left: 4px solid #FFF;
  560.   width: 20px;
  561.   height: 20px;
  562. }
  563. .stepBar .step:after {
  564.   top: 0;
  565.   -moz-transform: skew(30deg);
  566.   -ms-transform: skew(30deg);
  567.   -webkit-transform: skew(30deg);
  568.   transform: skew(30deg);
  569. }
  570. .stepBar .step:before {
  571.   bottom: 0;
  572.   -moz-transform: skew(-30deg);
  573.   -ms-transform: skew(-30deg);
  574.   -webkit-transform: skew(-30deg);
  575.   transform: skew(-30deg);
  576. }
  577. .stepBar .step:first-child {
  578.   -moz-border-radius-topleft: 4px;
  579.   -webkit-border-top-left-radius: 4px;
  580.   border-top-left-radius: 4px;
  581.   -moz-border-radius-bottomleft: 4px;
  582.   -webkit-border-bottom-left-radius: 4px;
  583.   border-bottom-left-radius: 4px;
  584. }
  585. .stepBar .step:first-child:before, .stepBar .step:first-child:after {
  586.   content: none;
  587. }
  588. .stepBar .step:last-child {
  589.   -moz-border-radius-topright: 4px;
  590.   -webkit-border-top-right-radius: 4px;
  591.   border-top-right-radius: 4px;
  592.   -moz-border-radius-bottomright: 4px;
  593.   -webkit-border-bottom-right-radius: 4px;
  594.   border-bottom-right-radius: 4px;
  595. }
  596. .stepBar .step.current {
  597.   color: #FFF;
  598.   background-color: #6c2735;
  599.  
  600.   font-family: "あずきフォント";
  601. }
  602. .stepBar:hover{
  603.   background-color:#DEC8B1';
  604. }
  605. .stepBar .step.current:before, .stepBar .step.current:after {
  606.   background-color: #6c2735;
  607.     onmouseover="style.background='#DEC8B1'";
  608.   onmouseout="style.background='#6c2735'";
  609.     font-family: "あずきフォント";
  610. }
  611. .stepBar.step2 .step {
  612.   width: 50%;
  613. }
  614. .stepBar.step3 .step {
  615.   width: 33.333%;
  616. }
  617. .stepBar.step4 .step {
  618.   width: 25%;
  619. }
  620. .stepBar.step5 .step {
  621.   width: 20%;
  622. }
  623. div.img-move a:hover {
  624.  position: relative;
  625.  top: -1px;
  626.  left: -1px;
  627. }
  628. div.img-move a:active {
  629.  position: relative;
  630.  top: 5px;
  631.  left: 5px;
  632. }
  633. </style>
  634. <h1 class="title_a">ひとこと掲示板</h1>
  635. <?php
  636. // if (isset($_POST['message']) && $_SERVER['REQUEST_METHOD'] === 'POST'){
  637. $file = 'memo53.txt';
  638. // ファイルが存在する時だけファイルを読み込む
  639. if (file_exists($file)) {
  640. // file_get_contents(ファイル名)→ファイルの全体を読み込み、内容を文字列として返す
  641.     $board = json_decode(file_get_contents($file));
  642. }
  643.  
  644.  
  645. // $vMessage = array();
  646. // if(isset($_POST['message'])){
  647. // if(!($_POST['message']== null) && $_SERVER['REQUEST_METHOD'] === 'POST'){
  648. //  $board[] = $_POST['message'];
  649. //  }
  650.  
  651. // }
  652.  var_dump($board);
  653. // if(isset($_POST['command']) && $_POST['command']=='delete'){
  654. //  if (($key = array_search($_POST['id'], $board)) !== false) {
  655. //      unset($board[$key]);
  656. //  }
  657. //  var_dump($_POST['id']);
  658. //  var_dump($board);
  659. // }
  660.  
  661.  
  662. file_put_contents($file, json_encode($board));
  663. if(!$board == null){
  664. foreach ($board as $message){
  665.     echo '<form action="" method="post">';
  666.     echo '<p class="textstyle">',$message,'</p><input type="hidden" name="command" value="delete"><input type="hidden" name="id" value="',$message,'"><button type="submit" style="border: 1px solid #902342; color: #902342; background-color: #f2dae8;">
  667. 削除</button><hr>';
  668.     echo '</form>';
  669. }
  670. }
  671. // }
  672. ?>
  673.     <p class="textstyle">
  674.         <a href="board-input.php">投稿画面へ</a>
  675.     </p>
  676. <?php require 'footer.php';?>
  677. <?php
  678. // var_dump($board);
  679. // var_dump($_POST['message']);
  680. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement