- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我是 php/mysql 编程的新手,我可以使用此表单,但是当我得到一台新计算机时,它就无法使用了。 HTML 是一种将结果发送到将其踢入 WAMP mysql 数据库的 php 页面的表单。就像我说的,我让这一切工作得很好,我得到了一台新机器,重新安装了 WAMP,复制了数据库和信息,现在它只给我通知,如果我在末尾添加 die(mysql_error()) $sql - ("SELECT..... 就像以前一样,它给我一个无法连接的错误。
<?php
$q=$_GET["q"];
$con = mysql_connect("localhost","root","password");
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
mysql_select_db("kalen_qc", $con);
$sql = ("SELECT `id` FROM `users` WHERE `username` = ' " . $root . " ' and `password` = ' " . $password . " ' limit 1");
//Retrieve data from the sql Query String
$cname = $_GET["cname"];
$job = $_GET["job"];
$apptype = $_GET["apptype"];
$priority = $_GET["priority"];
$daterec = $_GET["daterec"];
$datereq = $_GET["datereq"];
$po = $_GET["po"];
$authby = $_GET["authby"];
$phone = $_GET["phone"];
$fax = $_GET["fax"];
$motorplantnumber = $_GET["motorplantnumber"];
$quoted = $_GET["quoted"];
$incomphoto = $_GET["incomphoto"];
$repvalue = $_GET["repvalue"];
$eyebolt = $_GET["eyebolt"];
$motorassem = $_GET["motorassem"];
$conduitbox = $_GET["conduitbox"];
$conboxpos = $_GET["conboxpos"];
$coupler = $_GET["coupler"];
$couplexten = $_GET["couplexten"];
$couplrecess = $_GET["couplrecess"];
$couplflush = $_GET["couplflush"];
$motorweight = $_GET["motorweight"];
$motorfreq = $_GET["motorfreq"];
$application = $_GET["application"];
$appdesc = $_GET["appdesc"];
$specinstruc = $_GET["specinstruc"];
$reasonserv = $_GET["reasonserv"];
$obviousdamage = $_GET["obviousdamage"];
$cussupplyprod = $_GET["cussupplyprod"];
// Escape User Input to help prevent SQL Injection
$cname = mysql_real_escape_string($cname);
$job = mysql_real_escape_string($job);
$apptype = mysql_real_escape_string($apptype);
$priority = mysql_real_escape_string($priority);
$daterec = mysql_real_escape_string($daterec);
$datereq = mysql_real_escape_string($datereq);
$po = mysql_real_escape_string($po);
$authby = mysql_real_escape_string($authby);
$phone = mysql_real_escape_string($phone);
$fax = mysql_real_escape_string($fax);
$motorplantnumber = mysql_real_escape_string($motorplantnumber);
$incomphoto = mysql_real_escape_string($incomphoto);
$repvalue = mysql_real_escape_string($repvalue);
$motorassem = mysql_real_escape_string($motorassem);
$conduitbox = mysql_real_escape_string($conduitbox);
$conboxpos = mysql_real_escape_string($conboxpos);
$coupler = mysql_real_escape_string($coupler);
$couplexten = mysql_real_escape_string($couplexten);
$couplrecess = mysql_real_escape_string($couplrecess);
$couplflush = mysql_real_escape_string($couplflush);
$motorweight = mysql_real_escape_string($motorweight);
$motorfreq = mysql_real_escape_string($motorfreq);
$application = mysql_real_escape_string($application);
$appdesc = mysql_real_escape_string($appdesc);
$specinstruc = mysql_real_escape_string($specinstruc);
$reasonserv = mysql_real_escape_string($reasonserv);
$obviousdamage = mysql_real_escape_string($obviousdamage);
$cussupplyprod = mysql_real_escape_string($cussupplyprod);
$sql="INSERT INTO motor_checkin (cname, job, apptype, priority, daterec, datereq, po, authby, phone, fax, motorplantnumber, quoted, incomphoto, repvalue, eyebolt, motorassem, conduitbox, conboxpos, coupler, couplexten, couplrecess, couplflush, motorweight, motorfreq, application, appdesc, specinstruc, reasonserv, obviousdamage, cussupplyprod)
VALUES
('$_GET[cname]','$_GET[job]','$_GET[apptype]','$_GET[priority]','$_GET[daterec]', '$_GET[datereq]','$_GET[po]','$_GET[authby]','$_GET[phone]','$_GET[fax]','$_GET[motorplantnumber]', '$_GET[quoted]','$_GET[incomphoto]','$_GET[repvalue]','$_GET[eyebolt]','$_GET[motorassem]','$_GET[conduitbox]','$_GET[conboxpos]','$_GET[coupler]','$_GET[couplexten]','$_GET[couplrecess]', '$_GET[couplflush]','$_GET[motorweight]','$_GET[motorfreq]','$_GET[application]','$_GET[appdesc]', '$_GET[specinstruc]','$_GET[reasonserv]','$_GET[obviousdamage]','$_GET[cussupplyprod]')";
if (!mysql_query($sql,$con));
{
die('Error: ' . mysql_error());
}
header("Location: /");
mysql_close($con);
?>
HTML
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<META http-equiv="Content-Typetext/html; charset=iso-8859-1">
<title>Kalen Electric Repair Packet</title>
<link rel="stylesheet" type="text/css" href="qcstyle.css" />
<link rel="icon" href="images/favicon.ico" />
<!-- This conditional is for IE8 and IE6 and earlier- 8 needs that display:table -->
<!--[if !IE 7]>
<style type="text/css">
#wrap {display:table;height:100%}
</style>
<![endif]-->
<script type="text/javascript">
function showUser(str)
{
if (str=="")
{
document.getElementById("txtHint").innerHTML="";
return;
}
if (window.XMLHttpRequest)
{// code for IE7+, Firefox, Chrome, Opera, Safari
xmlhttp=new XMLHttpRequest();
}
else
{// code for IE6, IE5
xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
}
xmlhttp.onreadystatechange=function()
{
if
(xmlhttp.readyState==4 && xmlhttp.status==200)
{
document.getElementById("txtHint").innerHTML=xmlhttp.responseText;
}
}
xmlhttp.open("GET","insert.php?q="+str,true);
xmlhttp.send();
}
function loadXMLDoc()
{
}
</script>
</head>
<body>
<div id="wrap"> <!-- This wrap div needs to encompass everything except the footer div at bottom -->
<div id="header">
<div id="logo"> <!-- this extra div is just centering the fixed width area of the header content -->
<a href="../index.html"><img src="images/logo.png" alt="Kalen Electric and Machinery Inc Quality Control" class="logo"/></a>
</div>
</div>
<div id="main">
<!-- Inside this main div we are floating the content to the left and the sidebar to the right -->
<div id="content">
<h1>Motor Check-In:</h1>
<form action="insert.php" method="post" id="horizontalForm">
<div class="box">
<fieldset>
<label>
<span>Customer:</span>
<select class="cname" name="cname"><option value="">Select One</option> <option value="GP Wauna">GP Wauna</option> <option value="GP Toledo">GP Toledo</option> <option value="GP Camas">Gp Camas</option></select>
</label>
<label>
<span>Job Number:</span>
<input class="job" type="integer" name="job" onClick="this.value=''"/>
</label>
<label>
<button type="button" onclick="loadXMLDoc()">New Job</button>
</label>
</fieldset>
<fieldset>
<label>
<span>Apparatus Type: </span>
<select class="apptype" name="apptype"> <option value="AC Motor">AC Motor</option> <option value="AC Motor 1ph">AC Motor 1ph</option> <option value="AC Motor/Gearhead">AC Motor/Gearhead</option>
<option value="AC Welder">AC Welder</option> <option value="AC Submersible">AC Submersible</option> <option value="Stator Only">Stator Only</option>
<option value="Service Call">Service Call</option> <option value="AC Generator">AC Generator</option></select>
</label>
<label>
<span>Priority:</span>
<select class="priority" name="priority"> <option value="P1">P1</option> <option value="P2">P2</option> <option value="P3">P3</option></select>
</label>
</fieldset>
<fieldset>
<label>
<span>Date Received:</span>
<input class="daterec" type="date" size="12" maxlength="10" name="daterec" onClick="this.value=''"/>
</label>
<label>
<span>Date Required:</span>
<input class="datereq" type="date" size="12" maxlength="10" name="datereq" onClick="this.value=''"/>
</label>
<label>
<span>PO#:</span>
<input class="po" type="text" size="12" maxlength="20" name="po" onClick="this.value=''"/>
</label>
<label>
<span>Authorized By:</span>
<input class="authby" type="text" size="12" maxlength="30" name="authby" onClick="this.value=''"/>
</label>
</fieldset>
<fieldset>
<label>
<span>Phone#:</span>
<input class="phone" type="text" size="12" maxlength="12" name="phone" onClick="this.value=''"/>
</label>
<label>
<span>Fax#:</span>
<input class="fax" type="text" size="12" maxlength="12" name="fax" onClick="this.value=''"/>
</label>
<label>
<span>Motor Plant#:</span>
<input class="motorplantnumber" type="text" size="12" maxlength="20" name="motorplantnumber" onClick="this.value=''"/>
</label>
<label>
<span>Quoted:</span>
<select class="quoted" name="quoted"> <option value="No">No</option> <option value="Yes">Yes</option></select>
</label>
</fieldset>
<fieldset>
<label>
<span>Incoming Photo As Received:</span>
<select class="incomphoto" name="incomphoto"> <option value="No">No</option> <option value="Yes">Yes</option></select>
</label>
<label>
<span>Replacement Value:</span>
<input class="repvalue" type="text" size="12" maxlength="7" name="repvalue" onClick="this.value=''"/>
</label>
<label>
<span>Eye-Bolt:</span>
<select class="eyebolt" name="eyebolt"> <option value="Good">Good</option> <option value="Bad">Bad</option> <option value="None">None</option></select>
</label>
</fieldset>
<fieldset>
<label>
<span>Motor Assembly:</span>
<select class="motorassem" name="motorassem"> <option value="F1">F1</option> <option value="F2">F2</option> <option value="Vertical">Vertical</option></select>
</label>
<label>
<span>Conduit Box:</span>
<select class="conduitbox" name="conduitbox"> <option value="Full">Full</option> <option value="Half">Half</option> <option value="None">None</option></select>
</label>
<label>
<span>Conduit Box Position:</span>
<select class="conboxpos" name="conboxpos"> <option value="3:00">3:00</option> <option value="6:00">6:00</option> <option value="9:00">9:00</option> <option value="12:00">12:00</option> </select>
</label>
</fieldset>
<fieldset>
<label>
<span>Coupler/Pulley:</span>
<select class="coupler" name="coupler"> <option value="Coupler">Coupler</option> <option value="Pulley">Pulley</option> <option value="None">None</option> </select>
</label>
<label>
<span>Extended:</span>
<input class="couplexten" type="text" size="12" maxlength="10" name="couplexten" onClick="this.value=''"/>
</label>
<label>
<span>Recessed:</span>
<input class="couplerecess" type="text" size="12" maxlength="10" name="couplrecess" onClick="this.value=''"/>
</label>
<label>
<span>Flush:</span>
<input class="couplflush" type="text" size="12" maxlength="10" name="couplflush" onClick="this.value=''"/>
</label>
</fieldset>
<fieldset>
<label>
<span>Motor Weight:</span>
<input class="motorweight" type="text" size="12" maxlength="10" name="motorweight" onClick="this.value=''"/>
</label>
<label>
<span>Motor On Frequency Drive:</span>
<select class="motorfreq" name="motorfreq"> <option value="Yes">Yes</option> <option value="No">No</option> </select>
</label>
</fieldset>
<fieldset>
<label>
<span>Application:</span>
<select class="application" name="application"> <option value="Direct Coupled">Direct Coupled</option> <option value="Belted">Belted</option> </select>
</label>
<label>
<span>Application Description:</span>
<input class="appdesc" type="text" size="12" maxlength="100" name="appdesc" onClick="this.value=''"/>
</label>
</fieldset>
<fieldset>
<label>
<span>Special Instructions:</span>
<input class="specinstruc" type="text" size="12" maxlength="255" name="specinstruc" onClick="this.value=''"/>
</label>
</fieldset>
<fieldset>
<label>
<span>Reason For Service:</span>
<input class="reasonserv" type="text" size="12" maxlength="255" name="reasonserv" onClick="this.value=''"/>
</label>
</fieldset>
<fieldset>
<label>
<span>Obvious Damaged or Missing Parts:</span>
<input class="obviousdamage" type="text" size="12" maxlength="255" name="obviousdamage" onClick="this.value=''"/>
</label>
</fieldset>
<fieldset>
<label>
<span>Customer Supplied Product:</span>
<input class="cussupplyprod" type="text" size="12" maxlength="255" name="cussupplyprod" onClick="this.value=''"/>
</label>
</fieldset>
<label>
<input type="submit" /><br />
</label>
</div>
</form>
</div>
</div>
</div> <!-- close the wrap div here -->
<div id="footer">
<div id="foot"> <!-- this extra div is just centering the fixed width area of the footer content -->
<div id="left">
<p>Kalen Electric and Machinery Inc.</p>
</div>
<div id="right">
<p>AC Induction - Version 1.0</p>
</div>
</div>
</div>
</body>
</html>
它返回的错误:
( ! ) Notice: Undefined index: q in C:\wamp\www\insert.php on line 2
Call Stack
# Time Memory Function Location
1 0.0006 744072 {main}( ) ..\insert.php:0
( ! ) Notice: Undefined variable: root in C:\wamp\www\insert.php on line 13
Call Stack
# Time Memory Function Location
1 0.0006 744072 {main}( ) ..\insert.php:0
( ! ) Notice: Undefined variable: sprocket in C:\wamp\www\insert.php on line 13
Call Stack
# Time Memory Function Location
1 0.0006 744072 {main}( ) ..\insert.php:0
( ! ) Notice: Undefined index: cname in C:\wamp\www\insert.php on line 16
Call Stack
# Time Memory Function Location
1 0.0006 744072 {main}( ) ..\insert.php:0
( ! ) Notice: Undefined index: job in C:\wamp\www\insert.php on line 17
Call Stack
# Time Memory Function Location
1 0.0006 744072 {main}( ) ..\insert.php:0
( ! ) Notice: Undefined index: apptype in C:\wamp\www\insert.php on line 18
Call Stack
# Time Memory Function Location
1 0.0006 744072 {main}( ) ..\insert.php:0
( ! ) Notice: Undefined index: priority in C:\wamp\www\insert.php on line 19
Call Stack
# Time Memory Function Location
1 0.0006 744072 {main}( ) ..\insert.php:0
( ! ) Notice: Undefined index: daterec in C:\wamp\www\insert.php on line 20
Call Stack
# Time Memory Function Location
1 0.0006 744072 {main}( ) ..\insert.php:0
( ! ) Notice: Undefined index: datereq in C:\wamp\www\insert.php on line 21
Call Stack
# Time Memory Function Location
1 0.0006 744072 {main}( ) ..\insert.php:0
( ! ) Notice: Undefined index: po in C:\wamp\www\insert.php on line 22
Call Stack
# Time Memory Function Location
1 0.0006 744072 {main}( ) ..\insert.php:0
( ! ) Notice: Undefined index: authby in C:\wamp\www\insert.php on line 23
Call Stack
# Time Memory Function Location
1 0.0006 744072 {main}( ) ..\insert.php:0
( ! ) Notice: Undefined index: phone in C:\wamp\www\insert.php on line 24
Call Stack
# Time Memory Function Location
1 0.0006 744072 {main}( ) ..\insert.php:0
( ! ) Notice: Undefined index: fax in C:\wamp\www\insert.php on line 25
Call Stack
# Time Memory Function Location
1 0.0006 744072 {main}( ) ..\insert.php:0
( ! ) Notice: Undefined index: motorplantnumber in C:\wamp\www\insert.php on line 26
Call Stack
# Time Memory Function Location
1 0.0006 744072 {main}( ) ..\insert.php:0
( ! ) Notice: Undefined index: quoted in C:\wamp\www\insert.php on line 27
Call Stack
# Time Memory Function Location
1 0.0006 744072 {main}( ) ..\insert.php:0
( ! ) Notice: Undefined index: incomphoto in C:\wamp\www\insert.php on line 28
Call Stack
# Time Memory Function Location
1 0.0006 744072 {main}( ) ..\insert.php:0
( ! ) Notice: Undefined index: repvalue in C:\wamp\www\insert.php on line 29
Call Stack
# Time Memory Function Location
1 0.0006 744072 {main}( ) ..\insert.php:0
( ! ) Notice: Undefined index: eyebolt in C:\wamp\www\insert.php on line 30
Call Stack
# Time Memory Function Location
1 0.0006 744072 {main}( ) ..\insert.php:0
( ! ) Notice: Undefined index: motorassem in C:\wamp\www\insert.php on line 31
Call Stack
# Time Memory Function Location
1 0.0006 744072 {main}( ) ..\insert.php:0
( ! ) Notice: Undefined index: conduitbox in C:\wamp\www\insert.php on line 32
Call Stack
# Time Memory Function Location
1 0.0006 744072 {main}( ) ..\insert.php:0
( ! ) Notice: Undefined index: conboxpos in C:\wamp\www\insert.php on line 33
Call Stack
# Time Memory Function Location
1 0.0006 744072 {main}( ) ..\insert.php:0
( ! ) Notice: Undefined index: coupler in C:\wamp\www\insert.php on line 34
Call Stack
# Time Memory Function Location
1 0.0006 744072 {main}( ) ..\insert.php:0
( ! ) Notice: Undefined index: couplexten in C:\wamp\www\insert.php on line 35
Call Stack
# Time Memory Function Location
1 0.0006 744072 {main}( ) ..\insert.php:0
( ! ) Notice: Undefined index: couplrecess in C:\wamp\www\insert.php on line 36
Call Stack
# Time Memory Function Location
1 0.0006 744072 {main}( ) ..\insert.php:0
( ! ) Notice: Undefined index: couplflush in C:\wamp\www\insert.php on line 37
Call Stack
# Time Memory Function Location
1 0.0006 744072 {main}( ) ..\insert.php:0
( ! ) Notice: Undefined index: motorweight in C:\wamp\www\insert.php on line 38
Call Stack
# Time Memory Function Location
1 0.0006 744072 {main}( ) ..\insert.php:0
( ! ) Notice: Undefined index: motorfreq in C:\wamp\www\insert.php on line 39
Call Stack
# Time Memory Function Location
1 0.0006 744072 {main}( ) ..\insert.php:0
( ! ) Notice: Undefined index: application in C:\wamp\www\insert.php on line 40
Call Stack
# Time Memory Function Location
1 0.0006 744072 {main}( ) ..\insert.php:0
( ! ) Notice: Undefined index: appdesc in C:\wamp\www\insert.php on line 41
Call Stack
# Time Memory Function Location
1 0.0006 744072 {main}( ) ..\insert.php:0
( ! ) Notice: Undefined index: specinstruc in C:\wamp\www\insert.php on line 42
Call Stack
# Time Memory Function Location
1 0.0006 744072 {main}( ) ..\insert.php:0
( ! ) Notice: Undefined index: reasonserv in C:\wamp\www\insert.php on line 43
Call Stack
# Time Memory Function Location
1 0.0006 744072 {main}( ) ..\insert.php:0
( ! ) Notice: Undefined index: obviousdamage in C:\wamp\www\insert.php on line 44
Call Stack
# Time Memory Function Location
1 0.0006 744072 {main}( ) ..\insert.php:0
( ! ) Notice: Undefined index: cussupplyprod in C:\wamp\www\insert.php on line 45
Call Stack
# Time Memory Function Location
1 0.0006 744072 {main}( ) ..\insert.php:0
( ! ) Notice: Undefined index: cname in C:\wamp\www\insert.php on line 85
Call Stack
# Time Memory Function Location
1 0.0006 744072 {main}( ) ..\insert.php:0
( ! ) Notice: Undefined index: job in C:\wamp\www\insert.php on line 85
Call Stack
# Time Memory Function Location
1 0.0006 744072 {main}( ) ..\insert.php:0
( ! ) Notice: Undefined index: apptype in C:\wamp\www\insert.php on line 85
Call Stack
# Time Memory Function Location
1 0.0006 744072 {main}( ) ..\insert.php:0
( ! ) Notice: Undefined index: priority in C:\wamp\www\insert.php on line 85
Call Stack
# Time Memory Function Location
1 0.0006 744072 {main}( ) ..\insert.php:0
( ! ) Notice: Undefined index: daterec in C:\wamp\www\insert.php on line 85
Call Stack
# Time Memory Function Location
1 0.0006 744072 {main}( ) ..\insert.php:0
( ! ) Notice: Undefined index: datereq in C:\wamp\www\insert.php on line 86
Call Stack
# Time Memory Function Location
1 0.0006 744072 {main}( ) ..\insert.php:0
( ! ) Notice: Undefined index: po in C:\wamp\www\insert.php on line 86
Call Stack
# Time Memory Function Location
1 0.0006 744072 {main}( ) ..\insert.php:0
( ! ) Notice: Undefined index: authby in C:\wamp\www\insert.php on line 86
Call Stack
# Time Memory Function Location
1 0.0006 744072 {main}( ) ..\insert.php:0
( ! ) Notice: Undefined index: phone in C:\wamp\www\insert.php on line 86
Call Stack
# Time Memory Function Location
1 0.0006 744072 {main}( ) ..\insert.php:0
( ! ) Notice: Undefined index: fax in C:\wamp\www\insert.php on line 86
Call Stack
# Time Memory Function Location
1 0.0006 744072 {main}( ) ..\insert.php:0
( ! ) Notice: Undefined index: motorplantnumber in C:\wamp\www\insert.php on line 86
Call Stack
# Time Memory Function Location
1 0.0006 744072 {main}( ) ..\insert.php:0
( ! ) Notice: Undefined index: quoted in C:\wamp\www\insert.php on line 87
Call Stack
# Time Memory Function Location
1 0.0006 744072 {main}( ) ..\insert.php:0
( ! ) Notice: Undefined index: incomphoto in C:\wamp\www\insert.php on line 87
Call Stack
# Time Memory Function Location
1 0.0006 744072 {main}( ) ..\insert.php:0
( ! ) Notice: Undefined index: repvalue in C:\wamp\www\insert.php on line 87
Call Stack
# Time Memory Function Location
1 0.0006 744072 {main}( ) ..\insert.php:0
( ! ) Notice: Undefined index: eyebolt in C:\wamp\www\insert.php on line 87
Call Stack
# Time Memory Function Location
1 0.0006 744072 {main}( ) ..\insert.php:0
( ! ) Notice: Undefined index: motorassem in C:\wamp\www\insert.php on line 87
Call Stack
# Time Memory Function Location
1 0.0006 744072 {main}( ) ..\insert.php:0
( ! ) Notice: Undefined index: conduitbox in C:\wamp\www\insert.php on line 88
Call Stack
# Time Memory Function Location
1 0.0006 744072 {main}( ) ..\insert.php:0
( ! ) Notice: Undefined index: conboxpos in C:\wamp\www\insert.php on line 88
Call Stack
# Time Memory Function Location
1 0.0006 744072 {main}( ) ..\insert.php:0
( ! ) Notice: Undefined index: coupler in C:\wamp\www\insert.php on line 88
Call Stack
# Time Memory Function Location
1 0.0006 744072 {main}( ) ..\insert.php:0
( ! ) Notice: Undefined index: couplexten in C:\wamp\www\insert.php on line 88
Call Stack
# Time Memory Function Location
1 0.0006 744072 {main}( ) ..\insert.php:0
( ! ) Notice: Undefined index: couplrecess in C:\wamp\www\insert.php on line 88
Call Stack
# Time Memory Function Location
1 0.0006 744072 {main}( ) ..\insert.php:0
( ! ) Notice: Undefined index: couplflush in C:\wamp\www\insert.php on line 89
Call Stack
# Time Memory Function Location
1 0.0006 744072 {main}( ) ..\insert.php:0
( ! ) Notice: Undefined index: motorweight in C:\wamp\www\insert.php on line 89
Call Stack
# Time Memory Function Location
1 0.0006 744072 {main}( ) ..\insert.php:0
( ! ) Notice: Undefined index: motorfreq in C:\wamp\www\insert.php on line 89
Call Stack
# Time Memory Function Location
1 0.0006 744072 {main}( ) ..\insert.php:0
( ! ) Notice: Undefined index: application in C:\wamp\www\insert.php on line 89
Call Stack
# Time Memory Function Location
1 0.0006 744072 {main}( ) ..\insert.php:0
( ! ) Notice: Undefined index: appdesc in C:\wamp\www\insert.php on line 89
Call Stack
# Time Memory Function Location
1 0.0006 744072 {main}( ) ..\insert.php:0
( ! ) Notice: Undefined index: specinstruc in C:\wamp\www\insert.php on line 90
Call Stack
# Time Memory Function Location
1 0.0006 744072 {main}( ) ..\insert.php:0
( ! ) Notice: Undefined index: reasonserv in C:\wamp\www\insert.php on line 90
Call Stack
# Time Memory Function Location
1 0.0006 744072 {main}( ) ..\insert.php:0
( ! ) Notice: Undefined index: obviousdamage in C:\wamp\www\insert.php on line 90
Call Stack
# Time Memory Function Location
1 0.0006 744072 {main}( ) ..\insert.php:0
( ! ) Notice: Undefined index: cussupplyprod in C:\wamp\www\insert.php on line 90
Call Stack
# Time Memory Function Location
1 0.0006 744072 {main}( ) ..\insert.php:0
最佳答案
答案就在通知本身。 q
的条目在您的查询字符串中不存在。
最好构建错误处理和输入验证以确保存在适当的变量。
$q = (isset($_GET['q']) ? $_GET['q'] : null);
由于您要设置和引用多个变量,我建议您创建一个可以传递相应变量的函数。这不仅会检查相应变量是否存在,还会对变量进行转义以在查询中使用。
<?php
function varExist($var){
return (isset($_GET[$var]) ? mysql_real_escape_string($_GET[$var]) : null);
}
$q = varExist('q');
...
?>
请注意,根据 documentation :
Use of this extension is discouraged. Instead, the MySQLi or PDO_MySQL extension should be used. See also MySQL: choosing an API guide and related FAQ for more information. Alternatives to this function include:
■mysqli_real_escape_string() ■PDO::quote()
还有与建议的替代方案相关的其他文档,mysqli_real_escape_string() ,您可以查看。
关于php - 索引和变量错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11233883/
我已经使用 vue-cli 两个星期了,直到今天一切正常。我在本地建立这个项目。 https://drive.google.com/open?id=0BwGw1zyyKjW7S3RYWXRaX24tQ
您好,我正在尝试使用 python 库 pytesseract 从图像中提取文本。请找到代码: from PIL import Image from pytesseract import image_
我的错误 /usr/bin/ld: errno: TLS definition in /lib/libc.so.6 section .tbss mismatches non-TLS reference
我已经训练了一个模型,我正在尝试使用 predict函数但它返回以下错误。 Error in contrasts<-(*tmp*, value = contr.funs[1 + isOF[nn]])
根据Microsoft DataConnectors的信息我想通过 this ODBC driver 创建一个从 PowerBi 到 PostgreSQL 的连接器使用直接查询。我重用了 Micros
我已经为 SoundManagement 创建了一个包,其中有一个扩展 MediaPlayer 的类。我希望全局控制这个变量。这是我的代码: package soundmanagement; impo
我在Heroku上部署了一个应用程序。我正在使用免费服务。 我经常收到以下错误消息。 PG::Error: ERROR: out of memory 如果刷新浏览器,就可以了。但是随后,它又随机发生
我正在运行 LAMP 服务器,这个 .htaccess 给我一个 500 错误。其作用是过滤关键字并重定向到相应的域名。 Options +FollowSymLinks RewriteEngine
我有两个驱动器 A 和 B。使用 python 脚本,我在“A”驱动器中创建一些文件,并运行 powerscript,该脚本以 1 秒的间隔将驱动器 A 中的所有文件复制到驱动器 B。 我在 powe
下面的函数一直返回这个错误信息。我认为可能是 double_precision 字段类型导致了这种情况,我尝试使用 CAST,但要么不是这样,要么我没有做对...帮助? 这是错误: ERROR: i
这个问题已经有答案了: Syntax error due to using a reserved word as a table or column name in MySQL (1 个回答) 已关闭
我的数据库有这个小问题。 我创建了一个表“articoli”,其中包含商品的品牌、型号和价格。 每篇文章都由一个 id (ID_ARTICOLO)` 定义,它是一个自动递增字段。 好吧,现在当我尝试插
我是新来的。我目前正在 DeVry 在线学习中级 C++ 编程。我们正在使用 C++ Primer Plus 这本书,到目前为止我一直做得很好。我的老师最近向我们扔了一个曲线球。我目前的任务是这样的:
这个问题在这里已经有了答案: What is an undefined reference/unresolved external symbol error and how do I fix it?
我的网站中有一段代码有问题;此错误仅发生在 Internet Explorer 7 中。 我没有在这里发布我所有的 HTML/CSS 标记,而是发布了网站的一个版本 here . 如您所见,我在列中有
如果尝试在 USB 设备上构建 node.js 应用程序时在我的树莓派上使用 npm 时遇到一些问题。 package.json 看起来像这样: { "name" : "node-todo",
在 Python 中,您有 None单例,在某些情况下表现得很奇怪: >>> a = None >>> type(a) >>> isinstance(a,None) Traceback (most
这是我的 build.gradle (Module:app) 文件: apply plugin: 'com.android.application' android { compileSdkV
我是 android 的新手,我的项目刚才编译和运行正常,但在我尝试实现抽屉导航后,它给了我这个错误 FAILURE: Build failed with an exception. What wen
谁能解释一下?我想我正在做一些非常愚蠢的事情,并且急切地等待着启蒙。 我得到这个输出: phpversion() == 7.2.25-1+0~20191128.32+debian8~1.gbp108
我是一名优秀的程序员,十分优秀!