Register Register Member Login Member Login Member Login Forgot Password ??
PHP , ASP , ASP.NET, VB.NET, C#, Java , jQuery , Android , iOS , Windows Phone
 

Registered : 109,027

HOME > PHP > PHP Forum > [Help] มันไม่แทนค่าตัวแปร ID บน Url น่ะครับ พอจะจะ Generator QRCode



 

[Help] มันไม่แทนค่าตัวแปร ID บน Url น่ะครับ พอจะจะ Generator QRCode

 



Topic : 086859



โพสกระทู้ ( 28 )
บทความ ( 0 )



สถานะออฟไลน์




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>
&nbsp;</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">ชื่อเล่น &nbsp;&nbsp;&nbsp;&nbsp;</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>เลขประจำตัวนักเรียน &nbsp;</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>นักเรียนชั้น &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</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">&nbsp;<?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'] ; ?> &nbsp;- <?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">--- การเช็คข้อมูล&nbsp;---</font></p>
</td>
</tr>
<tr>
<td width="241" height="26">
&nbsp; </td>
<td width="655" height="5">
&nbsp; </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







Move To Hilight (Stock) 
Send To Friend.Bookmark.
Date : 2012-11-17 16:59:56 By : namkabz View : 915 Reply : 4
 

 

No. 1



โพสกระทู้ ( 74,058 )
บทความ ( 838 )

สมาชิกที่ใส่เสื้อไทยครีเอท

สถานะออฟไลน์
Twitter Facebook

Quote:
$student_id


น่าจะใช้ $_GET["student_id"];






แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2012-11-18 07:45:00 By : mr.win
 


 

No. 2



โพสกระทู้ ( 28 )
บทความ ( 0 )



สถานะออฟไลน์


Code
QRcode::png("http://127.0.0.1/try/stu_chk.php?student_id=$dbarr[student_id]", $filename, $errorCorrectionLevel, $matrixPointSize, 2);


ตรงสีแดงตอนกดสแกนมันขึ้นเป็น $dbarr[student_id] มาแทนอ่ะครับ
แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2012-11-19 18:09:20 By : namkabz
 

 

No. 3



โพสกระทู้ ( 28 )
บทความ ( 0 )



สถานะออฟไลน์


ได้แล้วครับ ขอบคุณมากครับ
แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2012-11-19 18:13:44 By : namkabz
 


 

No. 4



โพสกระทู้ ( 74,058 )
บทความ ( 838 )

สมาชิกที่ใส่เสื้อไทยครีเอท

สถานะออฟไลน์
Twitter Facebook

Good Jobs
แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2012-11-20 08:46:57 By : mr.win
 

   

ค้นหาข้อมูล


   
 

แสดงความคิดเห็น
Re : [Help] มันไม่แทนค่าตัวแปร ID บน Url น่ะครับ พอจะจะ Generator QRCode
 
 
รายละเอียด
 
ตัวหนา ตัวเอียง ตัวขีดเส้นใต้ ตัวมีขีดกลาง| ตัวเรืองแสง ตัวมีเงา ตัวอักษรวิ่ง| จัดย่อหน้าอิสระ จัดย่อหน้าชิดซ้าย จัดย่อหน้ากึ่งกลาง จัดย่อหน้าชิดขวา| เส้นขวาง| ขนาดตัวอักษร แบบตัวอักษร
ใส่แฟลช ใส่รูป ใส่ไฮเปอร์ลิ้งค์ ใส่อีเมล์ ใส่ลิ้งค์ FTP| ใส่แถวของตาราง ใส่คอลัมน์ตาราง| ตัวยก ตัวห้อย ตัวพิมพ์ดีด| ใส่โค้ด ใส่การอ้างถึงคำพูด| ใส่ลีสต์
smiley for :lol: smiley for :ken: smiley for :D smiley for :) smiley for ;) smiley for :eek: smiley for :geek: smiley for :roll: smiley for :erm: smiley for :cool: smiley for :blank: smiley for :idea: smiley for :ehh: smiley for :aargh: smiley for :evil:
Insert PHP Code
Insert ASP Code
Insert VB.NET Code Insert C#.NET Code Insert JavaScript Code Insert C#.NET Code
Insert Java Code
Insert Android Code
Insert Objective-C Code
Insert XML Code
Insert SQL Code
Insert Code
เพื่อความเรียบร้อยของข้อความ ควรจัดรูปแบบให้พอดีกับขนาดของหน้าจอ เพื่อง่ายต่อการอ่านและสบายตา และตรวจสอบภาษาไทยให้ถูกต้อง

อัพโหลดแทรกรูปภาพ

Notice

เพื่อความปลอดภัยของเว็บบอร์ด ไม่อนุญาติให้แทรก แท็ก [img]....[/img] โดยการอัพโหลดไฟล์รูปจากที่อื่น เช่นเว็บไซต์ ฟรีอัพโหลดต่าง ๆ
อัพโหลดแทรกรูปภาพ ให้ใช้บริการอัพโหลดไฟล์ของไทยครีเอท และตัดรูปภาพให้พอดีกับสกรีน เพื่อความโหลดเร็วและไฟล์ไม่ถูกลบทิ้ง

   
  เพื่อความปลอดภัยและการตรวจสอบ กระทู้ที่แทรกไฟล์อัพโหลดไฟล์จากที่อื่น อาจจะถูกลบทิ้ง
 
โดย
อีเมล์
บวกค่าให้ถูก
<= ตัวเลขฮินดูอารบิก เช่น 123 (หรือล็อกอินเข้าระบบสมาชิกเพื่อไม่ต้องกรอก)







Exchange: นำเข้าสินค้าจากจีน, Taobao, เฟอร์นิเจอร์, ของพรีเมี่ยม, ร่ม, ปากกา, power bank, แฟลชไดร์ฟ, กระบอกน้ำ

Load balance : Server 04
ThaiCreate.Com Logo
© www.ThaiCreate.Com. 2003-2024 All Rights Reserved.
ไทยครีเอทบริการ จัดทำดูแลแก้ไข Web Application ทุกรูปแบบ (PHP, .Net Application, VB.Net, C#)
[Conditions Privacy Statement] ติดต่อโฆษณา 081-987-6107 อัตราราคา คลิกที่นี่