|
 |
|
[Help] มันไม่แทนค่าตัวแปร ID บน Url น่ะครับ พอจะจะ Generator QRCode |
|
 |
|
|
 |
 |
|
Quote:<?php
session_start() ;
if(!session_is_registered("kln")) {
// url=index.php
echo "<meta http-equiv='refresh' content='0;url=../login_info.php'>" ;
exit() ;
}
### จบการเช็ค ###
?>
<?php
$host="localhost";
$username="root";
$pass_word="125478";
$db="Project";
$Conn = mysql_connect( $host,$username,$pass_word) or die ("ติดต่อฐานข้อมูลไม่ได้");
mysql_query("SET NAMES utf8",$Conn);
mysql_select_db($db) or die("เลือกฐานข้อมูลไม่ได้");
$sql = "select * from data where student_id ='$student_id' and code ='$code' ";
$result = mysql_query($sql);
$dbarr = mysql_fetch_array($result) ;
?>
<head>
<?PHP echo "
<title>ระบบพิมพ์ข้อมูลคำปรึกษา </title>" ;
?>
<meta name="generator" content="Namo WebEditor(Trial)">
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<title></title>
</head>
<body>
<p>
</p>
<table width="80%" align="center" cellpadding="0" cellspacing="0">
<tr>
<td width="426">
<p align="center"><font size="2" face="MS Sans Serif"><b><img src="kln.jpg" width="109" height="135" border="0"><br>
</b></font></p>
</td>
<td width="426">
<p align="right"><font size="2" face="MS Sans Serif"><strong><?php echo $dbarr['day'] ; ?> </strong></font>/<font size="2" face="MS Sans Serif"><strong><?php echo $dbarr['month'] ; ?> </strong></font>/<font size="2" face="MS Sans Serif"><strong><?php echo $dbarr['year'] ; ?> </strong></font></p>
<p align="left"><b><font size="2" face="MS Sans Serif">ชื่อเล่น </font></b><font size="2" face="MS Sans Serif"><strong><?php echo $dbarr['nickname'] ; ?> </strong></font><font size="2" face="MS Sans Serif"><strong><br>
</strong><b>เลขประจำตัวนักเรียน </b></font><font size="2" face="MS Sans Serif"><strong><?php echo $dbarr['student_id'] ; ?> </strong></font><font size="2" face="MS Sans Serif"><strong><br>
</strong><b>นักเรียนชั้น </b></font><font size="2" face="MS Sans Serif"><strong><?php echo $dbarr['class'] ; ?> <br>
</strong></font></p>
</td>
</tr>
</table>
<table border="1" width="85%" align="center" cellspacing="0" bordercolordark="white" bordercolorlight="black">
<tr>
<td width="900" colspan="2" bgcolor="#0099FF">
<p align="center"><font size="2" face="MS Sans Serif" color="white">--- ข้อมูลคำปรึกษาที่ขอ ---</font></p>
</td>
</tr>
<tr>
<td width="241" height="26">
<p align="center"><b><font size="2" face="MS Sans Serif">ชื่อเล่น</font></b></p>
</td>
<td width="655" height="5">
<p align="center"><font size="2" face="MS Sans Serif"><?php echo $dbarr['nickname'] ; ?> </font></p>
</td>
</tr>
<tr>
<td width="241" height="26">
<p align="center"><b><font size="2" face="MS Sans Serif">เพศ</font></b></p>
</td>
<td width="655" height="5">
<p align="center"><font size="2" face="MS Sans Serif"> <?php echo $dbarr['sex'] ; ?> </font></p>
</td>
</tr>
<tr>
<td width="241" height="26">
<p align="center"><b><font size="2" face="MS Sans Serif">อายุ</font></b></p>
</td>
<td width="655" height="5">
<p align="center"><font size="2" face="MS Sans Serif"><?php echo $dbarr['age'] ; ?> </font></p>
</td>
</tr>
<tr>
<td width="241" height="26">
<p align="center"><b><font size="2" face="MS Sans Serif">สาเหตุที่จะขอคำปรึกษา</font></b></p>
</td>
<td width="655" height="5">
<p align="center"><font size="2" face="MS Sans Serif"><?php echo $dbarr['subj_head'] ; ?> </font></p>
</td>
</tr>
<tr>
<td width="241" height="26">
<p align="center"><b><font size="2" face="MS Sans Serif">ปัญหาที่พบ</font></b></p>
</td>
<td width="655" height="5">
<p align="center"><font size="2" face="MS Sans Serif"><?php echo $dbarr['subj_punha'] ; ?> </font></p>
</td>
</tr>
<tr>
<td width="241" height="26">
<p align="center"><b><font size="2" face="MS Sans Serif">ผลที่เกิดจากปัญหา</font></b></p>
</td>
<td width="655" height="5">
<p align="center"><font size="2" face="MS Sans Serif"><?php echo $dbarr['subj_pon'] ; ?> </font></p>
</td>
</tr>
<tr>
<td width="241" height="26">
<p align="center"><b><font size="2" face="MS Sans Serif">โค๊ตฉบับเต็ม</font></b></p>
</td>
<td width="655" height="5">
<p align="center"><font size="2" face="MS Sans Serif"> <?php echo $dbarr['student_id'] ; ?> - <?php echo $dbarr['code'] ; ?> </font></p>
</td>
</tr>
<tr>
<td width="241" height="26">
<p align="center"><font size="2" face="Microsoft Sans Serif"><b>คำปรึกษาที่ได้รับ</b></font></p>
</td>
<td width="655" height="5">
<p align="center"><font size="2" face="MS Sans Serif"> <?php echo $dbarr['coun_say'] ; ?> </font></p>
</td>
</tr>
<tr>
<td width="241" height="5">
<p align="center"><b><font size="2" face="MS Sans Serif">ผู้ให้คำปรึกษา</font></b></p>
</td>
<td width="655" height="25">
<p align="center"><font size="2" face="MS Sans Serif"><?php echo $dbarr['coun_peo'] ; ?> <br>
</font></p>
</td>
</tr>
<tr>
<td width="241" height="5">
<p align="center"><b><font size="2" face="MS Sans Serif">โรคประจำตัว</font></b></p>
</td>
<td width="655" height="25">
<p align="center"><font size="2" face="MS Sans Serif"><?php echo $dbarr['rok'] ; ?> </font></p>
</td>
</tr>
<tr>
<td width="241" height="5">
<p align="center"><b><font size="2" face="MS Sans Serif">ความสามารถพิเศษ</font></b></p>
</td>
<td width="655" height="25">
<p align="center"><font size="2" face="MS Sans Serif"><?php echo $dbarr['spacial'] ; ?> </font></p>
</td>
</tr>
</table>
<table border="1" width="85%" align="center" cellspacing="0" bordercolordark="white" bordercolorlight="black">
<tr>
<td width="900" colspan="2" bgcolor="#0099FF">
<p align="center"><font size="2" face="MS Sans Serif" color="white">--- การเช็คข้อมูล ---</font></p>
</td>
</tr>
<tr>
<td width="241" height="26">
</td>
<td width="655" height="5">
</td>
</tr>
<tr>
<td width="241" height="5">
<p align="center"><font size="2" face="MS Sans Serif"><b>QR Code</b></font></p>
</td>
<td width="655" height="25">
<p align="center">
<?php
$student_id = $_GET['student_id'];
$PNG_TEMP_DIR = dirname(__FILE__).DIRECTORY_SEPARATOR.'temp'.DIRECTORY_SEPARATOR;
$PNG_WEB_DIR = 'temp/';
include "qrlib.php";
if (!file_exists($PNG_TEMP_DIR))
mkdir($PNG_TEMP_DIR);
$filename = $PNG_TEMP_DIR.'test.png';
$errorCorrectionLevel = 'M';
$matrixPointSize = 7;
if (isset($_REQUEST['data'])) {
if (trim($_REQUEST['data']) == '')
die('data cannot be empty! <a href="?">back</a>');
$filename = $PNG_TEMP_DIR.'test'.md5($_REQUEST['data'].'|'.$errorCorrectionLevel.'|'.$matrixPointSize).'.png';
QRcode::png($_REQUEST['data'], $filename, $errorCorrectionLevel, $matrixPointSize, 2);
} else {
echo '
';
QRcode::png('http://127.0.0.1/try/stu_chk.php?......................................................)', $filename, $errorCorrectionLevel, $matrixPointSize, 2);
}
echo '<img src="'.$PNG_WEB_DIR.basename($filename).'" />
';
echo '
</form>';
QRcode::png('http://127.0.0.1/try/stu_chk.php?student_id=......................................................)', << อยากแทน Student_id ตรงนี้่น่ะครับ
Tag : PHP

|
|
 |
 |
 |
 |
Date :
2012-11-17 16:59:56 |
By :
namkabz |
View :
969 |
Reply :
4 |
|
 |
 |
 |
 |
|
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ได้แล้วครับ ขอบคุณมากครับ
|
 |
 |
 |
 |
Date :
2012-11-19 18:13:44 |
By :
namkabz |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
Good Jobs
|
 |
 |
 |
 |
Date :
2012-11-20 08:46:57 |
By :
mr.win |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
|
|
|

|
Load balance : Server 02
|