This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class Introduce { | |
private $arraylist = array(); | |
public function regist($num) { | |
$this->arraylist[] = $num; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><title>form1</title></head><body><form action="form0302.php" method="post"> 番号:<br /> <input type="text" name="index" size="30" ><br /> 名前:<br /> <input type="text" name="name" size="30" ><br /> 自己紹介文:<br /> <input type="text" name="introduce" size="30" ><br /> <input type="submit" value="登録する" ><br/><table border='1'><tr><th>id</th><th>名前</th><th>自己紹介</th></tr><?phprequire_once 'Introduct0332.php';if (isset($_POST["index"]) && isset($_POST["name"]) && isset($_POST["introduce"])){ $x=$_POST['index']; $y=$_POST['name']; $z=$_POST['introduce']; $object=new Introduct(); $object->regist_file($x,$y,$z); $object->showAll(); $size= sizeof(file("file.csv")); echo "<tr>"; for($i = 0; $i < count($array); ++$i ){ $elem = nl2br(mb_convert_encoding($array[$i], 'UTF-8')); $elem = $elem === "" ? " " : $elem; echo("<td>".$elem."</td>"); } echo "</tr>";} ?></body></html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class Introduct { | |
public function regist_file($x,$y,$z){ | |
$fp = fopen("file.csv", "a"); | |
fwrite($fp, "$x,"); | |
fwrite($fp, "$y,"); | |
fwrite($fp, "$z \n"); | |
fclose($fp ); |