phpで$rowの値を別ページで行いたいと思っています。
現状は$rowの値が受け渡しすることができず
$issetでも出力されていない状態です。
値の受け渡しができないのは
なぜでしょうか?
php
11ページ 2<?php 3session_start(); 4$_SESSION = $_POST; 5?> 6<!DOCTYPE html> 7<html> 8<head> 9<meta charset="UTF-8"> 10<title>顧客管理*検索</title> 11 <form action="/phpkiso/DB/DB/updata.php" name="form1" method="post"> 12 <link rel="stylesheet" href="DB_color.css" class="e"> 13 <style type="text/css"> 14 <!-- 15 body {line-height: 130%;} 16 --> 17 </style> 18 <style type="text/css"> 19 <!-- 20 body{ 21 line-height : 170%; 22 } 23 or 24 p{ 25 line-height : 170%; 26 } 27 --> 28 </style> 29</head> 30<center>顧客管理情報ツール(入金金額*一覧)</center> 31<body background="back.gif" bgcolor="#ccc" class="a"> 32<br /> 33<body> 34<?php 35 $dsn = 'mysql:host=localhost;dbname=customer;charset=utf8'; 36 $user = 'root'; 37 $password = ''; 38 39 $dbh = new PDO($dsn, $user, $password); 40 $dbh->query('SET NAMES utf8'); 41 $sqlcmd = "SELECT * FROM `customer_Payment`"; 42 $statement = $dbh->prepare($sqlcmd); 43 $statement->execute(); 44 45if($statement->execute()){ 46 $row_count = $statement->rowCount(); 47 while($row = $statement->fetch()){ 48 $rows[] = $row;} 49}else{ 50 $errors['error'] = "検索失敗しました。"; 51} 52 53$dbh = null; 54?> 55<br /> 56<fieldset> 57 <!-- <?php foreach($rows as $row){ ;?> --> 58 <br /> 59 [名 前]<input type="text" value="<?php echo $row['name']; ?>" class="d-na"> 60 [カテゴリ]<input type="text" value="<?php print $row['abc']; ?>" class="d-na"> 61 [支払い月]<input type="text" value="<?php print $row['semina_month'];?> " class="d-year"> 62 [金 額]<input type="text" value="<?php print $row['payment'];?> " class="d-na"> 63 [有無]<input type="text" value="<?php print $row['ab'];?> " class="d-da"> 64 <input type="submit" onclick="/phpkiso/DB/DB/updata.php" value="変更" method="post"> 65 <input type="button" name="delate" value="削除"> 66<!-- <?php }?> --> 67</fieldset> 68<?php 69print(isset($row['name'])); 70?> 71<br /> 72<br /> 73<input type="button" onclick="location.href='./DB_top.php'" value="トップ戻る"> 74<!-- <input type="submit" value=変更 name="/phpkiso/DB/DB/updata.php"></td></tr> 75 --> 76</body> 77</html> 78 79
2ページ <?php session_start(); $_SESSION = $_POST; ?> <!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title>顧客管理*検索</title> <link rel="stylesheet" href="DB_color.css" class="e"> <style type="text/css"> <!-- body {line-height: 130%;} --> </style> <style type="text/css"> <!-- body{ line-height : 170%; } or p{ line-height : 170%; } --> </style> </head> <form action="../DB_top.php" method="post"> <center>顧客管理情報ツール(セミナー情報*検索)</center> <body background="back.gif" bgcolor="#ccc" class="a"> <br /> <?php $post = $post['code']; $post = $post['name']; $post = $post['abc']; $post = $post['semina_month']; $row = $post['payment']; print(isset($post['name'])); ?> <fieldset> <fieldset> <br /> <tr> <td>コ ー ド</td> <td><input type="text" value="<?php echo $post['code']; ?>" class="d-i"></td><br /> <td>名 前</td> <td><input type="text" value="<?php echo $post['name']; ?>" class="d-i"></td><br /> <td>カ テ ゴ リ</td> <td><input type="text" value="<?php echo $post['abc']; ?>" class="d-i"></td><br /> <td>支払 い月</td> <input type="text" value="<?php echo $post['semina_month']; ?>" class="d-i">月</td><br /> <td>金 額</td> <td><input type="text" value="<?php print $post['payment']; ?>" class="d-ad"></td><br /> <td>有 無</td> <td><input type="text" value="<?php echo $post['ad']; ?>" class="d-na"></td><br /></tr> </fieldset> </fieldset> <br /> <br /> <input type="button" onclick="location.href='../DB_top.php'" value="トップ戻る"> </body> </html>
php
1変更後1ページ 2 3<?php 4session_start(); 5?> 6<!DOCTYPE html> 7<html> 8<head> 9<meta charset="UTF-8"> 10<title>顧客管理*検索</title> 11 <form action="/phpkiso/DB/DB/updata.php" name="form1" method="post"> 12 <link rel="stylesheet" href="DB_color.css" class="e"> 13 <style type="text/css"> 14 <!-- 15 body {line-height: 130%;} 16 --> 17 </style> 18 <style type="text/css"> 19 <!-- 20 body{ 21 line-height : 170%; 22 } 23 or 24 p{ 25 line-height : 170%; 26 } 27 --> 28 </style> 29</head> 30<center>顧客管理情報ツール(入金金額*一覧)</center> 31<body background="back.gif" bgcolor="#ccc" class="a"> 32<br /> 33<body> 34<?php 35 $dsn = 'mysql:host=localhost;dbname=customer;charset=utf8'; 36 $user = 'root'; 37 $password = ''; 38 39 $dbh = new PDO($dsn, $user, $password); 40 $dbh->query('SET NAMES utf8'); 41 $sqlcmd = "SELECT * FROM `customer_Payment`"; 42 $statement = $dbh->prepare($sqlcmd); 43 $statement->execute(); 44 45if($statement->execute()){ 46 $row_count = $statement->rowCount(); 47 while($row = $statement->fetch()){ 48 $rows[] = $row;} 49 // $rowsをセッション'ROWS'に保存 50 $_SESSION['ROWS'] = $rows; 51}else{ 52 $errors['error'] = "検索失敗しました。"; 53} 54 55$dbh = null; 56?> 57<br /> 58<fieldset> 59 <!-- <?php foreach($rows as $row){ ;?> --> 60 <br /> 61 [名 前]<input type="text" value="<?php echo $row['name']; ?>" class="d-na" name="name"> 62 [カテゴリ]<input type="text" value="<?php print $row['abc']; ?>" class="d-na" name="abc"> 63 [支払い月]<input type="text" value="<?php print $row['semina_month'];?> " class="d-year" name="semina_month"> 64 [金 額]<input type="text" value="<?php print $row['payment'];?> " class="d-na" name="payment"> 65 [有無]<input type="text" value="<?php print $row['ab'];?> " class="d-da" name="ab"> 66 <input type="submit" onclick="/phpkiso/DB/DB/updata.php" value="変更" method="post"> 67 <input type="button" name="delate" value="削除"> 68<!-- <?php }?> --> 69</fieldset> 70<?php 71print(isset($row['name'])); 72?> 73<br /> 74<br /> 75<input type="button" onclick="location.href='./DB_top.php'" value="トップ戻る"> 76<!-- <input type="submit" value=変更 name="/phpkiso/DB/DB/updata.php"></td></tr> 77 --> 78</body> 79</html> 80
php
12ページめ 2 3 4<?php 5 session_start(); 6 $rows=$_SESSION['ROWS']; 7?> 8<!DOCTYPE html> 9<html> 10 <head> 11 <meta charset="UTF-8"> 12 <title>顧客管理*検索</title> 13 <link rel="stylesheet" href="DB_color.css" class="e"> 14 <style type="text/css"> 15 <!-- 16 body {line-height: 130%;} 17 --> 18 </style> 19 <style type="text/css"> 20 <!-- 21 body{ 22 line-height : 170%; 23 } 24 or 25 p{ 26 line-height : 170%; 27 } 28 --> 29 </style> 30</head> 31<form action="../DB_top.php" method="post"> 32 <center>顧客管理情報ツール(セミナー情報*検索)</center> 33 <body background="back.gif" bgcolor="#ccc" class="a"> 34 <br /> 35 <?php 36 37 print(isset($post['name'])); 38 39 40 ?> 41 <fieldset> 42 <fieldset> 43 <br /> 44 <tr> 45 <td>コ ー ド</td> 46 <td><input type="text" value="<?php echo $_SESSION['code']; ?>" class="d-i"></td><br /> 47 <td>名 前</td> 48 <td><input type="text" value="<?php echo $_SESSION['name']; ?>" class="d-i"></td><br /> 49 <td>カ テ ゴ リ</td> 50 <td><input type="text" value="<?php echo $_SESSION['abc']; ?>" class="d-i"></td><br /> 51 <td>支払 い月</td> 52 <input type="text" value="<?php echo $_SESSION['semina_month']; ?>" class="d-i">月</td><br /> 53 <td>金 額</td> 54 <td><input type="text" value="<?php print $_SESSION['payment']; ?>" class="d-ad"></td><br /> 55 <td>有 無</td> 56 <td><input type="text" value="<?php echo $_SESSION['ad']; ?>" class="d-na"></td><br /></tr> 57 </fieldset> 58 </fieldset> 59<br /> 60<br /> 61<input type="button" onclick="location.href='../DB_top.php'" value="トップ戻る"> 62</body> 63</html> 64
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2017/02/08 06:18