Index and Variable errors - php

I'm a noob to php/mysql programming and I had this form working but when I got a new computer it won't work. The HTML is a form that send the results to the php page which kicks it into a WAMP mysql database. Like I said, I had this all working beautifully and I got a new machine, reinstalled WAMP, copied over the database and info, and now it gives me nothing but notices and if I add die(mysql_error()) to the end ot the $sql - ("SELECT..... like it was before, it gives me a cannot connect error.
<?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 -->
<img src="images/logo.png" alt="Kalen Electric and Machinery Inc Quality Control" class="logo"/>
</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&#58 </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&#58</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>
Errors it returns:
( ! ) 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

The answer is in the notice itself. The entry for q does not exist in your query string.
It's best to build error handling and input validation to ensure that the appropriate variable exists.
$q = (isset($_GET['q']) ? $_GET['q'] : null);
Since you are setting and referencing multiple variables, I would suggest you create a function that you can pass the corresponding variable. This not only checks for existence of the corresponding variable, but it also escapes the variable for use in your query.
<?php
function varExist($var){
return (isset($_GET[$var]) ? mysql_real_escape_string($_GET[$var]) : null);
}
$q = varExist('q');
...
?>
Please note that per the 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()
There is additional documentation pertaining to the suggested alternative, mysqli_real_escape_string(), that you may review.

Basically all of your variables are empty. Make sure to initialize them at the start of the code. This way you won't get undefined index warnings.
$q = '';
$cname = '';
...etc
Side Note
This is really REALLY dangerous. Never use $_Get when running sql. The user can perform sql injection attacks that way.
INSERT ... Values ('$_GET[cname]','$_GET[job]'
Much Much Better
$cname = mysql_real_escape_string($cname);
$job = mysql_real_escape_string($job);
Insert ... Values (' . $cname . ', ' . $job . '

Those are all notices, not errors. Most likely the new PHP installation has a stricter error reporting level and the previous computer just suppressed the same notices.
The notices themselves mean that the form has not yet been submitted or there's some other related problem why form data hasn't been sent.

Your variables ("q", "root", "sprocket" etc..) should be coming from another page, hence the $_GET call. Have you tried running the form first? If you are simply loading this page on it's on, the variables will not be populated.

In your case this might be the way to go: Set this in the very first line of your script:
// Report all errors except E_NOTICE
error_reporting(E_ALL ^ E_NOTICE);
This will simply NOT GIVE OUT those "error" messages. This is not a good way to code, but in this case it's the best quick & dirty solution.

Related

Undefined index: REQUEST_URI and HTTP_HOST

How can I get rid of this errors.
Line 8 : define('CURRENT_PAGE', basename($_SERVER['REQUEST_URI']));
Line 15: define('READ_PATH', $_SERVER['HTTP_HOST'].'/read.php?id=');
errors:
Undefined index: REQUEST_URI in ......... on line 8
Undefined index: HTTP_HOST in ....... on line 15
if you use CLI then u can check them for their existence but in the browser, HTTP_HOST will be available any time.
if (!empty($_SERVER['HTTP_HOST'])) {
define('CURRENT_PAGE', basename($_SERVER['HTTP_HOST']));
}
if (!empty($_SERVER['REQUEST_URI'])) {
define('CURRENT_PAGE', basename($_SERVER['REQUEST_URI']));
}

SFTP PHP 5.6 using phpseclib hangs

I'm trying a simple example
$sftp = new phpseclib\Net\SFTP(FTP_ADDRESS);
if (!$sftp->login(FTP_USER, FTP_PASS)) {
$logger->error("FTP credentials error");
$logger->error($sftp->getLastSFTPError());
} else {
$logger->log("Connection successful");
}
print_r($sftp->rawlist());
However the script just hangs and finally times out
( ! ) Fatal error: Maximum execution time of 30 seconds exceeded in C:\xampp\htdocs\XookCatalogFeed\lib\phpseclib\Net\SSH2.php on line 3186
Call Stack
# Time Memory Function Location
1 0.2015 152184 {main}( ) ..\index.php:0
2 0.2244 2275600 handle ( ) ..\index.php:95
3 0.2246 2276880 {closure:C:\xampp\htdocs\XookCatalogFeed\handlers\import.php:157-285}( ) ..\index.php:95
4 0.2254 2303944 phpseclib\Net\SFTP->login( ) ..\import.php:170
5 5.1277 4457272 phpseclib\Net\SFTP->_send_sftp_packet( ) ..\SFTP.php:444
6 5.1278 4457592 phpseclib\Net\SSH2->_send_channel_packet( ) ..\SFTP.php:2635
7 30.0009 4457760 phpseclib\Net\SSH2->_send_binary_packet( ) ..\SSH2.php:3332
I have tried a lot of stuff but nothing seems to work. I have done some debugging (step by step) it looks like the servers accepts thje credential but then the client just loops sending empty data at _send_binary_packet.
Here is the log: https://gist.github.com/vlopez/2a48d261ab7713dbc06d
Someone, please help.

Use of undefined constant sql - assumed 'sql'

I'm new to PHP and just doing a test site for practice. I've run across the following error:
Notice: Use of undefined constant sql - assumed 'sql' in F:\wamp\www\css\Index.php on line 33
Call Stack
# Time Memory Function Location
1 0.0003 671872 {main}( ) ..\Index.php:0
Warning: mysql_fetch_array() expects parameter 1 to be resource, boolean given in F:\wamp\www\css\Index.php on line 35
Call Stack
# Time Memory Function Location
1 0.0003 671872 {main}( ) ..\Index.php:0
2 1.0141 680104 mysql_fetch_array ( ) ..\Index.php:35
Here's a snip of the portion that it finds erroneous:
30 <?php
31
32 $sql="SELECT * FROM products ORDER BY name ASC";
33 $query=mysql_query(sql);
34
35 while ($row=mysql_fetch_array($query)) {
36
37 ?>
38 <tr>
39 <td><?php echo $row['SKU'] ?></td>
40 <td><?php echo $row['Product'] ?></td>
41 <td>Select Product</td>
42 </tr>
43 <?php
44 }
45 ?>
I've included the line numbers with the snip. The table that I'm trying to pull from is indeed "products," so I don't think that's the issue here. I've been scratching my head for the past hour or so trying to figure out where the issue is, but I can't figure it out. I guess I should take that as a warm welcome from Father PHP as an initiation rite of passage, huh?
Variables must begin with $
This is wrong-
$query=mysql_query(sql);
^^^ This must be $sql
This should work -
$query=mysql_query($sql);
^Added $
You forgot the $ on line 33:
$query=mysql_query(sql); // Note that you have here "sql", not "$sql".
Instead, you should use:
$query=mysql_query($sql);

php google weather error handling issue

I have a php script that interacts with the google weather api.Everything works ok, but if I test it with a false location like "blahblah" I get a slew of errors in the browser despite having some validation in my script. The php code is as follows:
<?php
function googleWeather($location){
$url = "http://www.google.com/ig/api?weather=" . urlencode($location);
$xml = simplexml_load_file($url);
$current_conditions = $xml->xpath("/xml_api_reply/weather/current_conditions");
$temp_c = $current_conditions[0]->temp_c['data'];
$temp_f = $current_conditions[0]->temp_f['data'];
$result = sprintf("Current temperature is %s° Celsius %s° Fahrenheit",$temp_c,$temp_f);
return $result;
}
$loc = "blahblah";
$goog = googleWeather($loc);
if($goog == false){
echo "An error occurred";
}
else{
echo $goog;
}
?>
The error that is rendered in the browser is as follows:
( ! ) Notice: Undefined offset: 0 in C:\wamp2\www\phpAcademy\GoogleWeatherApi\TMP5c2a1z4emd.php on line 11
Call Stack
# Time Memory Function Location
1 0.1086 370080 {main}( ) ..\TMP5c2a1z4emd.php:0
2 0.1086 370184 googleWeather( ) ..\TMP5c2a1z4emd.php:23
( ! ) Notice: Trying to get property of non-object in C:\wamp2\www\phpAcademy\GoogleWeatherApi\TMP5c2a1z4emd.php on line 11
Call Stack
# Time Memory Function Location
1 0.1086 370080 {main}( ) ..\TMP5c2a1z4emd.php:0
2 0.1086 370184 googleWeather( ) ..\TMP5c2a1z4emd.php:23
( ! ) Notice: Undefined offset: 0 in C:\wamp2\www\phpAcademy\GoogleWeatherApi\TMP5c2a1z4emd.php on line 12
Call Stack
# Time Memory Function Location
1 0.1086 370080 {main}( ) ..\TMP5c2a1z4emd.php:0
2 0.1086 370184 googleWeather( ) ..\TMP5c2a1z4emd.php:23
( ! ) Notice: Trying to get property of non-object in C:\wamp2\www\phpAcademy\GoogleWeatherApi\TMP5c2a1z4emd.php on line 12
Call Stack
# Time Memory Function Location
1 0.1086 370080 {main}( ) ..\TMP5c2a1z4emd.php:0
2 0.1086 370184 googleWeather( ) ..\TMP5c2a1z4emd.php:23
Google returns the following for an invalid location
<xml_api_reply version="1"><weather module_id="0" tab_id="0" mobile_row="0" mobile_zipped="1" row="0" section="0"><problem_cause data=""/></weather></xml_api_reply>
This xml doesnt have the element "current_conditions" inside "weather". Thats casusing the error.
Check if exists then proceed which can be done with some thing like
if($current_conditions){
// you code here
} else {
return false;
}
I replaced blahblah with real city and it started to work.
Probably you enter your city address with wrong syntax.
Try to change your location, for example Zurich
The errors are pretty self-explanatory, $current_conditions doesn't contain what you think it does:
$current_conditions = $xml->xpath("/xml_api_reply/weather/current_conditions");
$temp_c = $current_conditions[0]->temp_c['data'];
// ^^^ undefined index
$temp_f = $current_conditions[0]->temp_f['data'];
// ^^^ Trying to access property of non object
You are not validating the result of $current_conditions:
if (is_array($current_conditions) && isset($current_conditions[0]))
{
$temp_c = $current_conditions[0]->temp_c['data'];
$temp_f = $current_conditions[0]->temp_f['data'];
}
Furthermore, you may need to validate the existence of the object properties, as well as the existence of the data key in those properties:
if (is_array($current_conditions) && isset($current_conditions[0]))
{
$cur = $current_conditions[0];
if (isset($cur->temp_c) && isset($cur->temp_c['data']))
{
$temp_c = $cur->temp_c['data'];
}
if (isset($cur->temp_f) && isset($cur->temp_f['data']))
{
$temp_f = $cur->temp_f['data'];
}
}
This is quite verbose, but to be absolutely sure to avoid these notices - it's what you have to do. You can and should turn off error reporting once you go live with your application. Notices are meant to help you debug code, if you understand how they're being generated and can safely ignore them, it may be OK.
And, if you feel confident that you know the API will return FALSE for an invalid query, just check if $current_conditions === FALSE and you can skip all the extra validation.

How to change this complex function to a simple redirect

I have been making some changes to a wordpress ecommerce plugin and I've taken out a ton of functions to make it simpler for my needs. Now it won't redirect to the thankyou page after the purchase button is pressed because the function uses some variables that I got rid of like order_id, etc.
I've been working on this for a few hours now, and all I want it to do is redirect to thankyou.php on the click of the purchase button. (I know right now it uses ajax, and I wouldn't mind using it too) I don't need it to go to the processpayment function or anything like that. Really simple.
Here is the code and the functions that I'm working with:
Thanks so much!!!
Input element:
<div id="payment">
<div class="form-row">
<noscript><?php _e('Since your browser does not support JavaScript, or it is disabled, please ensure you click the <em>Update Totals</em> button before placing your order. You may be charged more than the amount stated above if you fail to do so.', 'jigoshop'); ?><br/><input type="submit" class="button-alt" name="update_totals" value="<?php _e('Update totals', 'jigoshop'); ?>" /></noscript>
<?php jigoshop::nonce_field('process_checkout')?>
<input type="submit" class="button-alt" name="place_order" id="place_order" value="<?php _e('Next Step', 'jigoshop'); ?>" />
<?php do_action( 'jigoshop_review_order_before_submit' ); ?>
<?php if (get_option('jigoshop_terms_page_id')>0) : ?>
<p class="form-row terms">
<label for="terms" class="checkbox"><?php _e('I accept the', 'jigoshop'); ?> <?php _e('terms & conditions', 'jigoshop'); ?></label>
<input type="checkbox" class="input-checkbox" name="terms" <?php if (isset($_POST['terms'])) echo 'checked="checked"'; ?> id="terms" />
</p>
<?php endif; ?>
<?php do_action( 'jigoshop_review_order_after_submit' ); ?>
</div>
</div>
checkout.class.php:
// Process Payment
$result = $available_gateways["cheque"]->process_payment( $order_id );
// Redirect to success/confirmation/payment page
if (is_ajax()) :
ob_clean();
echo json_encode($result);
exit;
else :
wp_safe_redirect( $result['redirect'] );
exit;
endif;
else :
// No payment was required for order
$order->payment_complete();
// Empty the Cart
jigoshop_cart::empty_cart();
// Redirect to success/confirmation/payment page
$checkout_redirect = apply_filters( 'jigoshop_get_checkout_redirect_page_id', get_option( 'jigoshop_thanks_page_id' ) );
if (is_ajax()) :
ob_clean();
echo json_encode( array( 'redirect' => get_permalink( $checkout_redirect ) ) );
exit;
else :
wp_safe_redirect( get_permalink( $checkout_redirect ) );
exit;
endif;
endif;
// Break out of loop
break;
process payment function:
function process_payment() {
// Remove cart
jigoshop_cart::empty_cart();
// Return thankyou redirect
$checkout_redirect = apply_filters( 'jigoshop_get_checkout_redirect_page_id', get_option( 'jigoshop_thanks_page_id' ) );
return array(
'result' => 'success',
'redirect' => add_query_arg('key', $order->order_key, add_query_arg('order', $order_id, get_permalink( $checkout_redirect )))
);
}
Here is the error details I'm getting from firebug:
After I turned debugging on, I got these errors:
Notice: Undefined index: aiosp_enabled in
/home2/findmyki/public_html/bolistylus/wp-content/plugins/all-in-one-seo-pack/all_in_one_seo_pack.php
on line 710
Notice: Undefined index: aiosp_enabled in
/home2/findmyki/public_html/bolistylus/wp-content/plugins/all-in-one-seo-pack/all_in_one_seo_pack.php
on line 710
Notice: Use of undefined constant PLUGIN_URL - assumed 'PLUGIN_URL' in
/home2/findmyki/public_html/bolistylus/wp-content/plugins/wp-google-fonts/google-fonts.php
on line 81
Notice: Use of undefined constant PLUGIN_PATH - assumed 'PLUGIN_PATH'
in
/home2/findmyki/public_html/bolistylus/wp-content/plugins/wp-google-fonts/google-fonts.php
on line 82
Notice: Undefined index: host in
/home2/findmyki/public_html/bolistylus/wp-content/plugins/jetpack/jetpack.php
on line 2306
Notice: Undefined index: shipping-first_name in
/home2/findmyki/public_html/bolistylus/wp-content/plugins/jigoshop/classes/jigoshop_checkout.class.php
on line 198
Notice: Undefined index: shipping-last_name in
/home2/findmyki/public_html/bolistylus/wp-content/plugins/jigoshop/classes/jigoshop_checkout.class.php
on line 199
Notice: Undefined index: shipping-company in
/home2/findmyki/public_html/bolistylus/wp-content/plugins/jigoshop/classes/jigoshop_checkout.class.php
on line 200
Notice: Undefined index: shipping-address in
/home2/findmyki/public_html/bolistylus/wp-content/plugins/jigoshop/classes/jigoshop_checkout.class.php
on line 201
Notice: Undefined index: shipping-address-2 in
/home2/findmyki/public_html/bolistylus/wp-content/plugins/jigoshop/classes/jigoshop_checkout.class.php
on line 202
Notice: Undefined index: shipping-city in
/home2/findmyki/public_html/bolistylus/wp-content/plugins/jigoshop/classes/jigoshop_checkout.class.php
on line 203
Notice: Undefined index: shipping-state in
/home2/findmyki/public_html/bolistylus/wp-content/plugins/jigoshop/classes/jigoshop_checkout.class.php
on line 204
Notice: Undefined index: shipping-postcode in
/home2/findmyki/public_html/bolistylus/wp-content/plugins/jigoshop/classes/jigoshop_checkout.class.php
on line 205
Notice: Undefined index: shipping-country in
/home2/findmyki/public_html/bolistylus/wp-content/plugins/jigoshop/classes/jigoshop_checkout.class.php
on line 206
IMPORTANT:
Notice: Undefined variable: user_id in
/home2/findmyki/public_html/bolistylus/wp-content/plugins/jigoshop/classes/jigoshop_checkout.class.php
on line 211
Notice: Undefined index: order_comments in
/home2/findmyki/public_html/bolistylus/wp-content/plugins/jigoshop/classes/jigoshop_checkout.class.php
on line 256
Notice: Undefined index: billing-company in
/home2/findmyki/public_html/bolistylus/wp-content/plugins/jigoshop/classes/jigoshop_checkout.class.php
on line 264
Notice: Undefined index: billing-address in
/home2/findmyki/public_html/bolistylus/wp-content/plugins/jigoshop/classes/jigoshop_checkout.class.php
on line 265
Notice: Undefined index: billing-address-2 in
/home2/findmyki/public_html/bolistylus/wp-content/plugins/jigoshop/classes/jigoshop_checkout.class.php
on line 266
Notice: Undefined index: billing-city in
/home2/findmyki/public_html/bolistylus/wp-content/plugins/jigoshop/classes/jigoshop_checkout.class.php
on line 267
Notice: Undefined index: billing-postcode in
/home2/findmyki/public_html/bolistylus/wp-content/plugins/jigoshop/classes/jigoshop_checkout.class.php
on line 268
Notice: Undefined index: billing-country in
/home2/findmyki/public_html/bolistylus/wp-content/plugins/jigoshop/classes/jigoshop_checkout.class.php
on line 269
Notice: Undefined index: billing-state in
/home2/findmyki/public_html/bolistylus/wp-content/plugins/jigoshop/classes/jigoshop_checkout.class.php
on line 270
Notice: Undefined index: billing-phone in
/home2/findmyki/public_html/bolistylus/wp-content/plugins/jigoshop/classes/jigoshop_checkout.class.php
on line 272
Notice: Undefined index: shipping_method in
/home2/findmyki/public_html/bolistylus/wp-content/plugins/jigoshop/classes/jigoshop_checkout.class.php
on line 282
Notice: Undefined index: payment_method in
/home2/findmyki/public_html/bolistylus/wp-content/plugins/jigoshop/classes/jigoshop_checkout.class.php
on line 283
Notice: Undefined index: aiosp_edit in
/home2/findmyki/public_html/bolistylus/wp-content/plugins/all-in-one-seo-pack/aioseop.class.php
on line 1105
Notice: Undefined index: nonce-aioseop-edit in
/home2/findmyki/public_html/bolistylus/wp-content/plugins/all-in-one-seo-pack/aioseop.class.php
on line 1106
IMPORTANT:
Notice: Undefined variable: user_id in
/home2/findmyki/public_html/bolistylus/wp-content/plugins/jigoshop/classes/jigoshop_checkout.class.php
on line 364
Notice: Undefined variable: available_gateways in
/home2/findmyki/public_html/bolistylus/wp-content/plugins/jigoshop/classes/jigoshop_checkout.class.php
on line 379
IMPORTANT:
Fatal error: Call to a member function process_payment() on a
non-object in
/home2/findmyki/public_html/bolistylus/wp-content/plugins/jigoshop/classes/jigoshop_checkout.class.php
on line 379
Notice: Undefined index: aiosp_enabled in
/home2/findmyki/public_html/bolistylus/wp-content/plugins/all-in-one-seo-pack/all_in_one_seo_pack.php
on line 710
Notice: Undefined index: aiosp_enabled in
/home2/findmyki/public_html/bolistylus/wp-content/plugins/all-in-one-seo-pack/all_in_one_seo_pack.php
on line 710
Notice: Use of undefined constant PLUGIN_URL - assumed 'PLUGIN_URL' in
/home2/findmyki/public_html/bolistylus/wp-content/plugins/wp-google-fonts/google-fonts.php
on line 81
Notice: Use of undefined constant PLUGIN_PATH - assumed 'PLUGIN_PATH'
in
/home2/findmyki/public_html/bolistylus/wp-content/plugins/wp-google-fonts/google-fonts.php
on line 82
Notice: Undefined index: host in
/home2/findmyki/public_html/bolistylus/wp-content/plugins/jetpack/jetpack.php
on line 2306
Notice: Undefined index: shipping-first_name in
/home2/findmyki/public_html/bolistylus/wp-content/plugins/jigoshop/classes/jigoshop_checkout.class.php
on line 198
Notice: Undefined index: shipping-last_name in
/home2/findmyki/public_html/bolistylus/wp-content/plugins/jigoshop/classes/jigoshop_checkout.class.php
on line 199
Notice: Undefined index: shipping-company in
/home2/findmyki/public_html/bolistylus/wp-content/plugins/jigoshop/classes/jigoshop_checkout.class.php
on line 200
Notice: Undefined index: shipping-address in
/home2/findmyki/public_html/bolistylus/wp-content/plugins/jigoshop/classes/jigoshop_checkout.class.php
on line 201
Notice: Undefined index: shipping-address-2 in
/home2/findmyki/public_html/bolistylus/wp-content/plugins/jigoshop/classes/jigoshop_checkout.class.php
on line 202
Notice: Undefined index: shipping-city in
/home2/findmyki/public_html/bolistylus/wp-content/plugins/jigoshop/classes/jigoshop_checkout.class.php
on line 203
Notice: Undefined index: shipping-state in
/home2/findmyki/public_html/bolistylus/wp-content/plugins/jigoshop/classes/jigoshop_checkout.class.php
on line 204
Notice: Undefined index: shipping-postcode in
/home2/findmyki/public_html/bolistylus/wp-content/plugins/jigoshop/classes/jigoshop_checkout.class.php
on line 205
Notice: Undefined index: shipping-country in
/home2/findmyki/public_html/bolistylus/wp-content/plugins/jigoshop/classes/jigoshop_checkout.class.php
on line 206
Notice: Undefined variable: user_id in
/home2/findmyki/public_html/bolistylus/wp-content/plugins/jigoshop/classes/jigoshop_checkout.class.php
on line 211
Notice: Undefined index: order_comments in
/home2/findmyki/public_html/bolistylus/wp-content/plugins/jigoshop/classes/jigoshop_checkout.class.php
on line 256
Notice: Undefined index: billing-company in
/home2/findmyki/public_html/bolistylus/wp-content/plugins/jigoshop/classes/jigoshop_checkout.class.php
on line 264
Notice: Undefined index: billing-address in
/home2/findmyki/public_html/bolistylus/wp-content/plugins/jigoshop/classes/jigoshop_checkout.class.php
on line 265
Notice: Undefined index: billing-address-2 in
/home2/findmyki/public_html/bolistylus/wp-content/plugins/jigoshop/classes/jigoshop_checkout.class.php
on line 266
Notice: Undefined index: billing-city in
/home2/findmyki/public_html/bolistylus/wp-content/plugins/jigoshop/classes/jigoshop_checkout.class.php
on line 267
Notice: Undefined index: billing-postcode in
/home2/findmyki/public_html/bolistylus/wp-content/plugins/jigoshop/classes/jigoshop_checkout.class.php
on line 268
Notice: Undefined index: billing-country in
/home2/findmyki/public_html/bolistylus/wp-content/plugins/jigoshop/classes/jigoshop_checkout.class.php
on line 269
Notice: Undefined index: billing-state in
/home2/findmyki/public_html/bolistylus/wp-content/plugins/jigoshop/classes/jigoshop_checkout.class.php
on line 270
Notice: Undefined index: billing-phone in
/home2/findmyki/public_html/bolistylus/wp-content/plugins/jigoshop/classes/jigoshop_checkout.class.php
on line 272
Notice: Undefined index: shipping_method in
/home2/findmyki/public_html/bolistylus/wp-content/plugins/jigoshop/classes/jigoshop_checkout.class.php
on line 282
Notice: Undefined index: payment_method in
/home2/findmyki/public_html/bolistylus/wp-content/plugins/jigoshop/classes/jigoshop_checkout.class.php
on line 283
Notice: Undefined index: aiosp_edit in
/home2/findmyki/public_html/bolistylus/wp-content/plugins/all-in-one-seo-pack/aioseop.class.php
on line 1105
Notice: Undefined index: nonce-aioseop-edit in
/home2/findmyki/public_html/bolistylus/wp-content/plugins/all-in-one-seo-pack/aioseop.class.php
on line 1106
Notice: Undefined variable: user_id in
/home2/findmyki/public_html/bolistylus/wp-content/plugins/jigoshop/classes/jigoshop_checkout.class.php
on line 364
Notice: Undefined variable: available_gateways in
/home2/findmyki/public_html/bolistylus/wp-content/plugins/jigoshop/classes/jigoshop_checkout.class.php
on line 379
IMPORTANT!!!!:
Fatal error: Call to a member function process_payment() on a
non-object in
/home2/findmyki/public_html/bolistylus/wp-content/plugins/jigoshop/classes/jigoshop_checkout.class.php
on line 379
Notice: Undefined index: aiosp_enabled in
/home2/findmyki/public_html/bolistylus/wp-content/plugins/all-in-one-seo-pack/all_in_one_seo_pack.php
on line 710
Notice: Undefined index: aiosp_enabled in
/home2/findmyki/public_html/bolistylus/wp-content/plugins/all-in-one-seo-pack/all_in_one_seo_pack.php
on line 710
Notice: Use of undefined constant PLUGIN_URL - assumed 'PLUGIN_URL' in
/home2/findmyki/public_html/bolistylus/wp-content/plugins/wp-google-fonts/google-fonts.php
on line 81
Notice: Use of undefined constant PLUGIN_PATH - assumed 'PLUGIN_PATH'
in
/home2/findmyki/public_html/bolistylus/wp-content/plugins/wp-google-fonts/google-fonts.php
on line 82
There should be some text or json string in the response tab, but it's empty. This could be a result of php error that is hidden because of php settings in your server is set to hide all error messages, which is good.
Turn the debugging on see http://codex.wordpress.org/Editing_wp-config.php#Debug and try again. There should be some text in the response tab.
Update turn debugging on:
Something does not look right here. Do you get these errors when you send the Ajax request?
Looking at these errors I can see you have fatal error which must have stopped the code execution.
Fatal error: Call to a member function process_payment() on a non-object in /home2/findmyki/public_html/bolistylus/wp-content/plugins/jigoshop/classes/jigoshop_checkout.class.php on line 379
You have modified the original file jigoshop_checkout.class.php so it is hard for me to find the exact lines for these errors. But "Notice: Undefined index: " means there is an array variable in that line does not have an index of...
The method 'process_payment' called once in this file
// Process Payment
$result = $available_gateways[$this->posted['payment_method']]->process_payment( $order_id );
$available_gateways is an array with objects of different payment methods. But there is no object for the payment method defined in $this->posted['payment_method']
Also, I can see there is another error message state that the variable $available_gateways does not exists/defined
Notice: Undefined variable: available_gateways in /home2/findmyki/public_html/bolistylus/wp-content/plugins/jigoshop/classes/jigoshop_checkout.class.php on line 379
This variable can only be defined when jigoshop_cart::needs_payment() return true
if (jigoshop_cart::needs_payment()) :
// Payment Method
$available_gateways = jigoshop_payment_gateways::get_available_payment_gateways();
if (!isset($available_gateways[$this->posted['payment_method']])) :
jigoshop::add_error( __('Invalid payment method.','jigoshop') );
else :
// Payment Method Field Validation
$available_gateways[$this->posted['payment_method']]->validate_fields();
endif;
endif;
<input type="button" value="Submit" onClick="location.href='thankyou.php';">
If you don't need it to do anything else try that. You may need to edit the href to go where you want it to go. It worked for me on my site.
Also you can always have the action of the form redirect to another page then that page redirects to thank you page after processing.
Just use header('Location: '); to redirect.

Categories