お世話になります。
以下のphpファイルにCDN形式でbootstrapを当てようと考えています。
自分で試してみたところエラー表示されてしまいます。
ファイルの先頭に記述すると構文エラーになります。
どこに記述するべきなのでしょうか?
php
1<?php 2 3# 認証を要求したいページの先頭に以下を記述します。 4require_once '../lib/login.php'; 5 6<script src="//maxcdn.bootstrapcdn.com/bootstrap/3.2.0/js/bootstrap.min.js"></script> 7 8 9print "pro_list.php"; 10 11print_r($_POST); 12 13print_r($_SESSION); 14 15try 16{ 17 18//データベース接続 19$dsn='mysql:dbname=test;host=localhost;charset=utf8'; 20$user='root'; 21$password=''; 22$dbh=new PDO($dsn,$user,$password); 23$dbh->setAttribute(PDO::ATTR_ERRMODE,PDO::ERRMODE_EXCEPTION); 24 25 26 27 28 29 30 31 32//データベース選択 33$sql='SELECT * FROM fullcalendar_tasks WHERE 1'; 34$stmt=$dbh->prepare($sql); 35$stmt -> bindParam(':id', $id, PDO::PARAM_STR); 36$stmt->execute(); 37 38$dbh=null; 39 40 41 42 43 44print 'タスク管理'; 45 46 47print '<form method="post" action="pro_branch.php">'; 48 49echo "<table>\n"; 50echo "\t<tr><th>ID</th><th>タスク名</th><th>時間(分)</th></tr>\n"; 51while(true) 52{ 53 54//データを取ってくる処理(カラム名をキーとする連想配列で取得する) 55 56 $rec=$stmt->fetch(PDO::FETCH_ASSOC); 57 58 if($rec==false) 59 { 60 break; 61 } 62 echo "\t<tr>\n"; 63 64 echo "\t\t<td>{$rec['id']}</td>\n"; 65 echo "\t\t<td>{$rec['name']}</td>\n"; 66 echo "\t\t<td>{$rec['minute']}</td>\n"; 67print '<form method="post" action="pro_branch.php">'; 68echo "<input type='hidden' name='edit' value=" . $rec["id"] . ">"; 69echo "<td><input type=submit value=更新></td>"; 70echo "</form>"; 71print '<form method="post" action="pro_branch.php">'; 72echo "<input type=hidden name='delete' value=" . $rec["id"] . ">"; 73echo "<td><input type=submit value=削除></td>"; 74echo "</form>"; 75 76 77echo "\t</tr>\n"; 78 79 80 81 82 83 84 85 86 87 88 89 90 //print '<input type="radio" name="procode" value="'.$rec['id']. '">'; 91 //print $rec['id'].'---'; 92 //print '<input type="submit" name="edit" value="修正">'; 93 //print '<input type="submit" name="delete" value="削除">'; 94 //print $rec['name'].'円'; 95 //print '<input type="submit" name="edit" value="修正">'; 96 //print '<input type="submit" name="delete" value="削除">'; 97 //print $rec['minute'].'---'; 98 //print '<input type="submit" name="edit" value="修正">'; 99 //print '<input type="submit" name="delete" value="削除">'; 100 101 //print $rec[created'].'円'; 102 //print $rec['modified'].'---'; 103 //print $rec['delflg'].'円'; 104 //print $rec['user'].'---'; 105 106} 107 108print '<input type="submit" name="add" value="追加">'; 109 110print '<form action="../lib/logout.php" method="post">'; 111print '<input type="submit" value="ログアウト">'; 112print '</form>'; 113 114//print '<a href="../lib/logout.php"><button type = "button">ログアウト</button></a>'; 115 116 117print '</form>'; 118 119} 120catch (Exception $e) 121{ 122 print 'ただいま障害により大変ご迷惑をお掛けしております。'; 123 exit(); 124} 125 126?> 127<!DOCTYPE html> 128<html> 129<head> 130<meta charset="UTF-8"> 131<title>test</title> 132 133</head> 134<body> 135 136</body> 137</html> 138 139
よろしくお願いいたします。
回答3件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。