แสดงกระทู้
|
หน้า: [1] 2 3 ... 22
|
1
|
พัฒนาเว็บไซต์ / Programming / Re: ช่วยดู code session หน่อยค่ะ
|
เมื่อ: 15 มีนาคม 2019, 07:51:41
|
session_start(); หลายที ไม่ขึ้น error เหรอครับ ลองลบออกให้เหลืออันเดียว แล้วก็ใช้ if($_SESSION["level"]=="0") เหมือนที่คุณ raimai บอกลองดูครับ ได้ไหม ถ้าไม่ได้ก็ลองแสดงค่า $_SESSION["level"] ออกมาดูครับ ค่าตรงกับเงื่อนไขหรือเปล่า if($_SESSION["$level"]=="0")
เป็น
if($_SESSION["level"]=="0")
รึเปล่า
ค่าออกมาเท่ากับ 0 ค่ะ แต่มันไม่วิ่งเข้าไปที่เงื่อนไข if($_SESSION["level"]=="0") if(mysqli_stmt_fetch($stmt)){ if(password_verify($password, $hashed_password)){ // Store data in session variables $_SESSION["loggedin"] = true; $_SESSION["id"] = $id; $_SESSION["email"] = $email; $_SESSION["level"] = $level;
//echo ("$level"); die(); if($_SESSION["level"]=="0"){ Header("location: admin_page.php"); } // Redirect user to dashboard page header("location: dashboard.php"); } else{ // Display an error message if password is not valid $password_err = "The password you entered was not valid."; } }
|
|
|
3
|
พัฒนาเว็บไซต์ / Programming / ช่วยดู code session หน่อยค่ะ
|
เมื่อ: 14 มีนาคม 2019, 16:04:52
|
ไม่แน่ใจว่าทำตรงไหนผิดคะ ถ้าค่าส่งมาเท่ากับ 0 แล้วมันไม่วิ่งไปที่หน้า admin_page.php คะ <?php // Initialize the session session_start(); // Check if the user is already logged in, if yes then redirect him to dashboard page // if(isset($_SESSION["loggedin"]) && $_SESSION["loggedin"] === true){ // header("location: welcome.php"); // exit; // } // Include config file require_once "inc/config.php"; // Define variables and initialize with empty values $email = $password = ""; $email_err = $password_err = ""; // Processing form data when form is submitted if($_SERVER["REQUEST_METHOD"] == "POST"){ // Check if email is empty if(empty(trim($_POST["email"]))){ $email_err = "Please enter email."; } else{ $email = trim($_POST["email"]); } // Check if password is empty if(empty(trim($_POST["password"]))){ $password_err = "Please enter your password."; } else{ $password = trim($_POST["password"]); } // Validate credentials if(empty($email_err) && empty($password_err)){ // Prepare a select statement $sql = "SELECT id, email, level, password FROM users WHERE email = ?"; if($stmt = mysqli_prepare($link, $sql)){ // Bind variables to the prepared statement as parameters mysqli_stmt_bind_param($stmt, "s", $param_email); // Set parameters $param_email = $email; // Attempt to execute the prepared statement if(mysqli_stmt_execute($stmt)){ // Store result mysqli_stmt_store_result($stmt); // Check if email exists, if yes then verify password if(mysqli_stmt_num_rows($stmt) == 1){ // Bind result variables mysqli_stmt_bind_result($stmt, $id, $email, $level, $hashed_password); if(mysqli_stmt_fetch($stmt)){ if(password_verify($password, $hashed_password)){ // Password is correct, so start a new session session_start(); // Store data in session variables $_SESSION["loggedin"] = true; $_SESSION["id"] = $id; $_SESSION["email"] = $email; $_SESSION["level"] = $level;
//echo ("$level"); die(); if($_SESSION["$level"]=="0"){ Header("location: admin_page.php"); } // Redirect user to dashboard page header("location: dashboard.php"); } else{ // Display an error message if password is not valid $password_err = "The password you entered was not valid."; } } } else{ // Display an error message if email doesn't exist $email_err = "No account found with that email."; } } else{ echo "Oops! Something went wrong. Please try again later."; } } // Close statement mysqli_stmt_close($stmt); } // Close connection mysqli_close($link); } ?>
|
|
|
6
|
พัฒนาเว็บไซต์ / Programming / ช่วยดูโค๊ดส่งเมลหน่อยคะ รายละเอียดมันไม่เข้า
|
เมื่อ: 15 พฤษภาคม 2018, 15:19:15
|
กำลังทำฟอร์มส่งข้อมูลคะส่งเมลได้แล้ว แต่พวกรายละเอียดมันไม่มีข้อมูล มีแต่ข้อมูลหัวข้อเมล ทำมาหลายวันแล้วไม่ได้สักที <?php if($_POST) { require('constant.php'); $user_name = filter_var($_POST["name"], FILTER_SANITIZE_STRING); $user_email = filter_var($_POST["email"], FILTER_SANITIZE_EMAIL); $subject = filter_var($_POST["subject"], FILTER_SANITIZE_STRING); $user_phone = filter_var($_POST["phone"], FILTER_SANITIZE_STRING); $content = filter_var($_POST["content"], FILTER_SANITIZE_STRING); if(empty($user_name)) { $empty[] = "<b>Name</b>"; } if(empty($user_email)) { $empty[] = "<b>Email</b>"; } if(empty($user_phone)) { $empty[] = "<b>Phone Number</b>"; } if(empty($subject)) { $empty[] = "<b>Subject</b>"; } if(empty($content)) { $empty[] = "<b>Comments</b>"; } if(!empty($empty)) { $output = json_encode(array('type'=>'error', 'text' => implode(", ",$empty) . ' Required!')); die($output); } if(!filter_var($user_email, FILTER_VALIDATE_EMAIL)){ //email validation $output = json_encode(array('type'=>'error', 'text' => '<b>'.$user_email.'</b> is an invalid Email, please correct it.')); die($output); } //reCAPTCHA validation if (isset($_POST['g-recaptcha-response'])) { require('component/recaptcha/src/autoload.php'); $recaptcha = new \ReCaptcha\ReCaptcha(SECRET_KEY, new \ReCaptcha\RequestMethod\SocketPost());
$resp = $recaptcha->verify($_POST['g-recaptcha-response'], $_SERVER['REMOTE_ADDR']);
if (!$resp->isSuccess()) { $output = json_encode(array('type'=>'error', 'text' => '<b>Captcha</b> Validation Required!')); die($output); } } $toEmail = "xxx@gmail.com"; $mailHeaders = "From: " . $user_name . "<" . $user_email . ">\r\n"; if (mail($toEmail, "Contact Mail", $content, $mailHeaders)) { $output = json_encode(array('type'=>'message', 'text' => 'Hi '.$user_name .', thank you for the comments. We will get back to you shortly.')); die($output); } else { $output = json_encode(array('type'=>'error', 'text' => 'Unable to send email, please contact'.SENDER_EMAIL)); die($output); } } ?>
|
|
|
7
|
พัฒนาเว็บไซต์ / Programming / ช่วยหน่อยคะ ค้นหาหน้า 2 กดไม่ได้
|
เมื่อ: 19 มิถุนายน 2017, 17:40:41
|
แก้ code ไม่ได้ไม่รู้ว่าเป็นที่อะไร ทำค้นหาจาก $searchemail ใช้ได้ปกติกดไปหน้าอื่นได้ แต่พอทำ ค้นหาจาก $searchname ข้อมูลมาปกติ แต่พอกดไป page ที่ 2 ข้อมูลมันมาหมดเลยค่ะไม่ได้กรองเฉพราะที่เราทำไว้ <?PHP include("../public_inc.php"); ?> <?PHP connectdb(); charSetThai(); loadControl(); $page = "menu3"; $searchname = $_GET["txtSearchIntell1"];
$searchemail = $_GET[urlencode("txtSearchIntell2")]; $pro=$_GET["pro"]; $Search_Requ = trim($requ["Select"]); if ($Search_Requ) { $sqlWhere = " AND (IntelligenceID = $Search_Requ) "; } else { $sqlWhere = ""; } if ($_SERVER['SCRIPT_NAME']) { $scriptnamePT = $_SERVER['SCRIPT_NAME']; } if ($_SERVER['QUERY_STRING']) { $scriptnamePT .= "?" . $_SERVER['QUERY_STRING']; $scriptnameQureyPT = "?" . $_SERVER['QUERY_STRING']; } $PageReferT = "expert.php" . $scriptnameQureyPT;
//mustLoginMember('th', $PageReferT);
//$activelogin = $_SESSION["activelogin"]; $sqlM = "SELECT * FROM mc_tblmember WHERE Email='$activelogin'"; $queM = mysql_query($sqlM); if ($queM) { $rwM = mysql_fetch_array($queM); $Referencenumber = convertToText(stripStr($rwM["Referencenumber"])); $FirstName = convertToText(stripStr($rwM["FirstName"])); $LastName = convertToText(stripStr($rwM["LastName"])); }
$sqlTopMenu_Rev1 = "SELECT * FROM mc_tblstatusstaticmenu"; $queTopMenu_Rev1 = mysql_query($sqlTopMenu_Rev1); if ($queTopMenu_Rev1) { while ($rwTopMenu_Rev1 = mysql_fetch_array($queTopMenu_Rev1)) { $StaticMenuID_Rev1 = convertToText(stripStr($rwTopMenu_Rev1["MenuID"])); $TopMenuTitleThai_Rev1[$StaticMenuID_Rev1] = convertToText(stripStr($rwTopMenu_Rev1["MenuTitleThai"])); $TopMenuTitleEng_Rev1[$StaticMenuID_Rev1] = convertToText(stripStr($rwTopMenu_Rev1["MenuTitleEng"])); $TopMenuOnlineStatus_Rev1[$StaticMenuID_Rev1] = convertToText(stripStr($rwTopMenu_Rev1["OnlineStatus"])); $TopMenuDescriptionThai_Rev1[$StaticMenuID_Rev1] = convertToText(stripStr($rwTopMenu_Rev1["DescriptionThai"])); $TopMenuDescriptionEng_Rev1[$StaticMenuID_Rev1] = convertToText(stripStr($rwTopMenu_Rev1["DescriptionEng"])); $TopMenuKeywordsThai_Rev1[$StaticMenuID_Rev1] = convertToText(stripStr($rwTopMenu_Rev1["KeywordsThai"])); $TopMenuKeywordsEng_Rev1[$StaticMenuID_Rev1] = convertToText(stripStr($rwTopMenu_Rev1["KeywordsEng"])); } } ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title> <?= $TopMenuTitleThai_Rev1[6] ?> </title> <meta http-equiv="Content-Type" content="text/html; charset=tis-620"> <meta name="Description" id="Description" content="<?=$TopMenuDescriptionThai_Rev1[6]?>" /> <meta name="keywords" content="<?=$TopMenuKeywordsThai_Rev1[6]?>"> <link rel="stylesheet" href="css/styles.css"> <link rel="stylesheet" type="text/css" href="../css/menu_intelligence.css"> <script src="http://code.jquery.com/jquery-latest.min.js" type="text/javascript"></script> <script src="css/script.js"></script> </head> <body style="margin:0px; padding:0px; text-align:center; background-color:#fafafa;"> <div class="wrapper"> <?PHP include("include_header.php"); ?> <table width="100%" bgcolor="#161616" border="0"> <tr> <td align="center"><?PHP include("include_menu.php"); ?></td> </tr> </table> <table width="1150px" border="0" cellspacing="0" cellpadding="0" align="center"> <tr> <td width="300px" style="padding-top:50px" align="left" valign="top"> <div style="width:250px"> <strong style="font-size:20px; color:#000; text-decoration:none"> ประเภทหน่วยงาน </strong> <ul style="padding:0px 0px 0px 10px"> <li style="list-style:circle; font-weight:bold; padding:5px"><a href="provider.php?pro=CB" style="font-size:12px; <? if($pro == 'CB'){ echo "color:#03C;"; }else{ echo "color:#000;"; } ?> text-decoration:none;">หน่วยรับรองระบบ (CB)</a></li> <li style="list-style:circle; font-weight:bold; padding:5px"><a href="provider.php?pro=IB" style="font-size:12px; <? if($pro == 'IB'){ echo "color:#03C;"; }else{ echo "color:#000;"; } ?> text-decoration:none;">หน่วยตรวจ (IB)</a></li> <li style="list-style:circle; font-weight:bold; padding:5px"><a href="provider.php?pro=CBSA" style="font-size:12px; <? if($pro == 'CBSA'){ echo "color:#03C;"; }else{ echo "color:#000;"; } ?> text-decoration:none;">หน่วยตรวจ (IB) มาตรฐานแรงงานไทย</a></li> <li style="list-style:circle; font-weight:bold; padding:5px"><a href="provider.php?pro=EX" style="font-size:12px; <? if($pro == 'EX'){ echo "color:#03C;"; }else{ echo "color:#000;"; } ?> text-decoration:none;">ห้องปฏิบัติการทดสอบ</a></li> <li style="list-style:circle; font-weight:bold; padding:5px"><a href="provider.php?pro=TS" style="font-size:12px; <? if($pro == 'TS'){ echo "color:#03C;"; }else{ echo "color:#000;"; } ?> text-decoration:none;">ห้องปฏิบัติการสอบเทียบ</a></li> </ul><br/> <?PHP include("../include_columnright_search_provider.php"); ?> </div> </td> <td align="left" style="padding-top:30px;" valign="top"><img src="../images/intelligence/header_provider.jpg" border="0"/><br/><br/> <table width="100%" cellspacing="0" cellpadding="0" class="contentContainer"> <tbody> <tr> <td class="textContainter"> เป็นการรวบรวมหน่วยงานที่เกี่ยวข้องด้านมาตรฐานและกฎระเบียบทางการค้าเชิงเทคนิค (ทั้งในประเทศและต่างประเทศ) โดยจัดทำเป็นฐานข้อมูล (Database)<br/><br/> </td> </tr> </tbody> </table> <table width="100%"> <?PHP $ProviderPage = 10; $currentPage = $_SERVER["PHP_SELF"]; $pageNum = 1; if (isset($_GET['page'])) { $pageNum = $_GET['page']; } $startRowQuery = ($pageNum - 1) * $ProviderPage; $condition = '1'; if($searchname != ''){ $condition .= " AND ProviderName Like '%{$searchname}%'" ;} if($searchemail != '') {$condition .= " AND Email Like '$searchemail' " ;} if($pro != ''){$condition .= " AND ProviderType Like '%{$pro}%'" ;} $sqlProvider = "SELECT * FROM mc_tblserviceprovider WHERE $condition"; $querylimit = sprintf("%s LIMIT %d, %d", $sqlProvider, $startRowQuery, $ProviderPage); //$querylimit = sprintf("%s LIMIT %d", $sql, $startRowQuery); $Query = mysql_query($querylimit); if (isset($_GET['totalRows'])) { $totalRows = $_GET['totalRows']; } else { $allQuery = mysql_query($sqlProvider); if ($allQuery) { $totalRows = mysql_num_rows($allQuery); } }
$totalPages = ceil($totalRows / $ProviderPage); $queProvider = mysql_query($querylimit); if ($queProvider) { while ($rwProvider = mysql_fetch_array($queProvider)) { $Provider_Name = convertToText(stripStr($rwProvider["ProviderName"])); $Provider_Contact = convertToText(stripStr($rwProvider["Contact"])); $Provider_Address = convertToText(stripStr($rwProvider["Address"])); $Provider_Telephone = convertToText(stripStr($rwProvider["Telephone"])); $Provider_Fax = convertToText(stripStr($rwProvider["Fax"])); $Provider_Email = convertToText(stripStr($rwProvider["Email"])); $Provider_Website = convertToText(stripStr($rwProvider["Website"])); ?> <tr bgcolor="#F3F3F3"> <td width='150px' style="background-color:#333; padding:5px 5px 5px 10px; color:#FFF"><strong>หน่วยรับรอง</strong></td> <td style="padding:5px 5px 5px 10px"><strong><?=$Provider_Name?></strong></td> </tr> <tr bgcolor="#F3F3F3"> <td width='150px' style="background-color:#333; padding:5px 5px 5px 10px; color:#FFF"><strong>ที่อยู่</strong></td> <td style="padding-left:10px"><?=$Provider_Address?></td> </tr> <tr bgcolor="#F3F3F3"> <td width='150px' style="background-color:#333; padding:5px 5px 5px 10px; color:#FFF"><strong>ชื่อผู้ติดต่อ</strong></td> <td style="padding-left:10px"><?=$Provider_Contact?></td> </tr> <tr bgcolor="#F3F3F3"> <td width='150px' style="background-color:#333; padding:5px 5px 5px 10px; color:#FFF"><strong>โทรศัพท์</strong></td> <td style="padding-left:10px"><?=$Provider_Telephone?></td> </tr> <tr bgcolor="#F3F3F3"> <td width='150px' style="background-color:#333; padding:5px 5px 5px 10px; color:#FFF"><strong>แฟกซ์</strong></td> <td style="padding-left:10px"><?=$Provider_Fax?></td> </tr> <tr bgcolor="#F3F3F3"> <td width='150px' style="background-color:#333; padding:5px 5px 5px 10px; color:#FFF"><strong>อีเมล์</strong></td> <td style="padding-left:10px"> <? if ($Provider_Email != "-"){ echo "<a href='mailto:".$Provider_Email."'>"; } ?> <?=$Provider_Email?> <? if ($Provider_Email != ""){ echo "</a>"; } ?> </td> </tr> <tr bgcolor="#F3F3F3"> <td width='150px' style="background-color:#333; padding:5px 5px 5px 10px; color:#FFF"><strong>เว็บไซต์</strong></td> <td style="padding-left:10px"> <? if ($Provider_Website != "-"){ //echo "<a href='http://".$Provider_Website."'>".$Provider_Website; echo "<a href='http://".$Provider_Website."'>"; } ?> <?=$Provider_Website?> <? if ($Provider_Website != ""){ echo "</a>"; } ?> </td> </tr> <tr><td colspan="2" height="10"></td></tr> <?PHP } } ?> </table> <br/> <br/> <br/> <div align="center" style="width:840px; word-wrap: break-word;"> <?PHP if ($totalPages > 1) { ?> <?PHP for ($count = 0; $count < $totalPages;) { $num = $count 1; if ($pageNum == $num) { echo "| <strong><span style="color: #183E8D;">$num</span></strong> "; } else { echo "| <a href="provider.php?page=$num&ProviderScope=$scope&ptype=$pro" style='text-decoration:none'><span style="color: #333333;">$num</span></a> "; // echo "| <a href="provider_search_list.php?page=$num&serviceprovider=$condition&pro=$pro" style='text-decoration:none'><span style="color: #333333;">$num</span></a> "; //echo "| <a href="provider.php?page=$num&ProviderScope=$scope&ptype=$ptype" style='text-decoration:none'><span style="color: #333333;">$num</span></a> "; } $count ; } //end count page echo "|"; ?> <?PHP } ?> </div> </td> </tr> </table> </div> <!--<div id="footer">Copyright 2014 © Management System Certification Institute (Thailand). All rights reserved.</div> <!-- BEGIN GOOGLE ANALYTICS CODE --> <script type="text/javascript"> var _gaq = _gaq || []; _gaq.push(['_setAccount', 'UA-16046740-2']); _gaq.push(['_trackPageview']); (function() { var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true; ga.src = ('https:' == document.location.protocol ? '[url]https://ssl[/url]' : 'http://www') '.google-analytics.com/ga.js'; var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s); })(); </script> <!-- END GOOGLE ANALYTICS CODE -->
</body> </html>
|
|
|
8
|
พัฒนาเว็บไซต์ / Programming / Re: insert ข้อมูลไม่ได้ ไม่มี error
|
เมื่อ: 17 กุมภาพันธ์ 2017, 16:12:05
|
เอิ่มมม พอดูโค้ด
ทำไมในวงเล็บ if(isset($_POST['btn-save']))
เขียนแบบนั้นละครับ = =
เข้าใจว่าให้รับค่ามาจากฟอร์มคะ มันต้องเป็นยังไง ><" ลองคิวรี่ที่ phpmyadmin แล้วถ้าตัด password ออกข้อมูลเข้า database เริ่มงงๆ
|
|
|
10
|
พัฒนาเว็บไซต์ / Programming / insert ข้อมูลไม่ได้ ไม่มี error
|
เมื่อ: 17 กุมภาพันธ์ 2017, 13:32:18
|
insert ข้อมูลไม่ได้ ไม่รู้ว่าเป็นที่อะไรคะ หาไม่เจอช่วยดูหน่อย string(136) "INSERT INTO employee(emp_name,emp_surname,emp_email,status,rule_id) VALUES('a1','a2','it@gmail.com','1234','1','2')" <?php session_start(); include_once '../inc/dbconnect.php';
if(!isset($_SESSION['empSession'])) { header("Location: index.php"); }
//echo "<pre>"; //print_r($_POST); //echo "</pre>";
$query = $MySQLi_CON->query("SELECT * FROM employee WHERE emp_id=".$_SESSION['empSession']); $userinfo=$query->fetch_array();
if(isset($_POST['btn-save'])) { // variables for input data $emp_name = $MySQLi_CON->real_escape_string(trim($_POST['emp_name'])); $esurname = $MySQLi_CON->real_escape_string(trim($_POST['emp_surname'])); $email = $MySQLi_CON->real_escape_string(trim($_POST['emp_email'])); $epassword = $MySQLi_CON->real_escape_string(trim($_POST['password'])); $status = $MySQLi_CON->real_escape_string(trim($_POST['status'])); $rule_id = $MySQLi_CON->real_escape_string(trim($_POST['rule_id'])); // sql query for inserting data into database $query = "INSERT INTO employee(emp_name,emp_surname,emp_email,status,rule_id) VALUES('$emp_name','$esurname','$email','$epassword','$status','$rule_id')"; mysql_query($query); mysql_close();
var_dump($query); /*echo "<pre>"; print_r($_POST); echo "</pre>";*/ } ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Welcome - <?php echo $userinfo['emp_email']; ?></title>
<!-- Bootstrap --> <link href="asset/css/bootstrap.min.css" rel="stylesheet">
<style> .content { margin-top: 80px; } </style>
</head> <body>
<!-- .nav menu start -->
<!-- .nav menu end -->
<tr> <td colspan="2" class="green"><? include ('menu_backend.php');?></td> </tr>
<div class="container"> <div class="content"> <h2>Add Employee</h2> <hr /> </div> <br>
</form> <br />
<div class="container">
<form method='post'> <!-- <form action="employee_add2.php" method="post"> --> <table class='table table-bordered'> <tr> <td>First Name</td> <td><input type='text' name='emp_name' class='form-control' required></td> </tr> <tr> <td>Last Name</td> <td><input type='text' name='emp_surname' class='form-control' ></td> </tr>
<tr> <td>Email</td> <td><input type='text' name='emp_email' class='form-control' ></td> </tr> <tr> <td>Password</td> <td><input type='password' name='password' class='form-control' ></td> </tr>
<tr> <td>Status</td> <td><input type='text' name='status' class='form-control' ></td> </tr>
<tr> <td>Rule</td> <td><input type='text' name='rule_id' class='form-control' ></td> </tr> <tr> <td colspan="2"> <button type="submit" class="btn btn-primary" name="btn-save"> <span class="glyphicon glyphicon-plus"></span> Add New </button> <a href="index.php" class="btn btn-large btn-success"><i class="glyphicon glyphicon-backward"></i> Back </a> </td> </tr> </table> </form> </div>
</div><center> </center> <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script> <script src="js/bootstrap.min.js"></script> </body> </html>
|
|
|
12
|
พัฒนาเว็บไซต์ / Programming / อยากดึงชื่อเวลาที่ login มาแสดง navbar ยังไงคะ
|
เมื่อ: 11 มิถุนายน 2016, 20:59:39
|
จะเช็คค่าเวลาที่ login แล้วให้แสดงชื่อที่เมนู dropdown ยังไงค่ะ <?php include ("checksession.php"); include ("DB.php");
$conn = Conn2DB(); $strSQL=" SELECT * FROM employee WHERE (create_by = '$sess_empid' OR emp_id = '$sess_empid') AND isworking = 'T' "; $cmdQuery = mysqli_query($conn,$strSQL); $num_rows = mysqli_num_rows($cmdQuery);
$cmdQuery1 = mysqli_query($conn,$strSQL); mysqli_num_rows($cmdQuery1) ?> <ul class="nav navbar-nav navbar-right"> <li class="dropdown"> <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">Dropdown <span class="caret"></span></a> <ul class="dropdown-menu"> <li><a href="#">Action</a></li> <li><a href="#">Another action</a></li> <li><a href="#">Something else here</a></li> <li role="separator" class="divider"></li> <li><a href="#">Separated link</a></li> </ul> </li> </ul>
|
|
|
15
|
พัฒนาเว็บไซต์ / Programming / ช่วยดูหน่อยค่ะ mysqli ไม่รู้ผิดตรงไหน
|
เมื่อ: 05 มิถุนายน 2016, 22:39:33
|
ไม่รู้ว่าผิดตรงไหนค่ะ ขึ้นแบบนี้หาไม่เจอ Notice: Undefined variable: strSQL2 in if($sess_level>1){ $strSql2 = "SELECT cases.work_by FROM cases WHERE cases.case_ID ='$case_ID' AND cases.work_by IS NULL "; $result2 = mysqli_query($conn,$strSQL2); $row2 = mysqli_fetch_array($conn, $result2); //echo "row=> ".$row; if($row2 == "") {?>
|
|
|
17
|
พัฒนาเว็บไซต์ / Programming / สอบถามเรื่อง mysqli_fetch_array() หน่อยค่ะ
|
เมื่อ: 02 มิถุนายน 2016, 22:42:21
|
พอดีเขียนโค๊ดแล้วเช็คดู มันผิดที่การใช้งาน fetch_array() คิดไม่ออกว่าผิดยังไงค่ะ error ที่เกิดขึ้น Notice: Undefined variable: bg in D:\xampp\htdocs\xxx\user_main.php on line 110 โค๊ดที่ผิด <?php $i=$pagelen*($page-1)+1;
while($fetchArray=mysqli_fetch_array($cmdQuery1)){ if($bg == "#FFFFFF") { $bg = "#E7E9EB"; } else { $bg = "#FFFFFF"; } ?>
|
|
|
|
|