What's new

Help Patulong naman po dito sa error na ito

Status
Not open for further replies.

janehl1403

Honorary Poster
Joined
Aug 19, 2012
Posts
355
Reaction
86
Points
135
Age
35
Sir pa-help naman po dito:
nakahighligt po yung txtvalue at Sdata po:

ERROR:
Notice: Use of undefined constant txtvalue - assumed 'txtvalue' in D:\FILES\xampp-portable-lite-win32-1.8.1-VC9\xampp\htdocs\MFish\list.php on line 63

Notice: Undefined index: txtvalue in D:\FILES\xampp-portable-lite-win32-1.8.1-VC9\xampp\htdocs\MFish\list.php on line 63

Notice: Use of undefined constant Sdata - assumed 'Sdata' in D:\FILES\xampp-portable-lite-win32-1.8.1-VC9\xampp\htdocs\MFish\list.php on line 64

Notice: Undefined index: Sdata in D:\FILES\xampp-portable-lite-win32-1.8.1-VC9\xampp\htdocs\MFish\list.php on line 64


Code:

<html>
<head>
<title> List of Species</title>
<link href="style.css" type="text/css" rel="stylesheet">
<script language="javascript">
<!----
function openW(fish_id)
{
aPopUp= window.open('viewList.php?fish_id='+fish_id,'viewL ist','menubar=no,toolbar=no,location=no,directorie s=no,status=no,scrollbars=yes,resizable=yes,copyhi story=no,width=760,height=600')
aPopUp.focus()
}
-->
</script>
<style TYPE="text/css">
<!--
table {border-collapse: collapse;}
.odd {background-color:teal}
.even {background-color:teal}
//-->
</style>
</head>


<body class="blist">
<center>
<?php
include ("config.php");
$db = mysql_connect($dbhost,$dbuser,$dbpass);
if (!$db)
{
die('Unable to connect' . mysql_error());
}
?>
<form method='get' action='<?php $PHP_SELF ?>'>
<table border=2 cellpadding= 3 id='searcharea'>
<tr>
<td>Search by:<br/></td>
<td>
<select name = "Sdata" id="sel">
<option value="identification.sci_name">Scientific Name</option>
<option value="identification.en_name">Common Name</option>
<option value="identification.l_name">Local Name</option>
</select>
<input type= text id="opt" name="txtvalue" size=20 value=''></td>
<td align=left><input type=submit name=Ok value='Show List'></td>
</tr>
</table><br/>
</form>

<table border=1>
<tr id='listlabel'>
<td width=10px></td>
<td width=50px>Class</td>
<td width=50px>Order</td>
<td width=50px>Family</td>
<td width=100px>Scientific Name</td>
<td width=100px>Common Name</td>
<td width=100px>Local Name</td>
<td width=10px></td>
</tr>

<?php
$value1=$_GET[txtvalue];
$value2=$_GET[Sdata];
mysql_select_db($dbname,$db);
if (isset($_GET['start'])) {
$sql = "SELECT
identification.fish_id,
identification.division,
identification.order,
identification.family,
identification.sci_name,
identification.author,
identification.en_name,
identification.l_name,
division_list.division_name,
family_list.family_name,
order_list.order_name
FROM
identification
Inner Join family_list ON family_list.family_code = identification.family
Inner Join division_list ON division_list.division_code = identification.division
Inner Join order_list ON order_list.order_code = identification.order
WHERE
sci_name LIKE 'A%' ORDER BY identification.sci_name ASC";

} else {
$sql = "SELECT
identification.fish_id,
identification.division,
identification.order,
identification.family,
identification.sci_name,
identification.author,
identification.en_name,
identification.l_name,
division_list.division_name,
family_list.family_name,
order_list.order_name
FROM
identification
Inner Join family_list ON family_list.family_code = identification.family
Inner Join division_list ON division_list.division_code = identification.division
Inner Join order_list ON order_list.order_code = identification.order
WHERE
".$value2." LIKE '%".$value1."%' ORDER BY identification.fish_id ASC";
}
$result = mysql_query($sql,$db);

if($result){
$counter = 0;


while ($myrow = mysql_fetch_array($result)) {
$counter++;
(fmod ($counter,2))? $bg=odd: $bg=even;
printf("<tr class=$bg>
<td id='entry'>%s</td>
<td id='entry'>%s</td>
<td id='entry'>%s</td>
<td id='entry'>%s</td>
<td id='sci'>%s</td>
<td id='entry'>%s</td>
<td id='entry'>%s</td>
<td id='ent'><a href=\"javascript: openW('$myrow[fish_id]')\"><input type='image' name=mybutton src='images/view.png' title='view'/>
</a>
</td></tr>",$counter, $myrow[division_name], $myrow[order_name], $myrow[family_name], $myrow[sci_name], $myrow[en_name], $myrow[l_name]);
}

echo "</table>\n";
}
?>
</center>
</body>
</html>
 
hindi ako marunong ng php pero tingin ko.. ala ka yata nailagay na value ng data or text or di mo din dnclare as constant sya. yun po. yun tingin ko. :) if mali po. pasensya.. di ako mglng sa web base. ehhee
 
ewan ko nga po kung ano nangyari jan pero nagrun naman yan before,. ngayon na tinry ko ulit nagka-error na,. yung txtvalue at Sdata nasa form naman yan eh bali ginawan ko po sila ng variables for easy call,. Patulong naman jan,,.sumasakit na ulo ko,.:(
 
sir wawen./d po kasya,.nakacompressed file po 3Mb tapos ang limit po dito uploading is 2MB lang po,.pwede MF ko nalng??

D lang po pala yan yung error pati po sa ibang PHP file po,.Hindi ko po alam kung bakit nagka-error po ito,.
 
Ito na po link sir:
Nasa loob po yung database "MyDatabase.sql" po ang filename.
may database password po yan paki-delete nalng po,.TY

You do not have permission to view the full content of this post. Log in or register now.
 
inaassume mo kasi na everytime na magrrun yung script mo na yan, may value na malalagay sa variable na nag error. which is not acceptable sa debugger.
 
talagang mag uundefined po yan..kc wala pang value ang txtdata at sdata, pag ka run. may value lang yan dba pag click ng button?.. mas magandang gawin ay. e check mo kung nka defined ba using isset .. GET po yan ei.. makikita ang value s url kaya malalaman mo kung may txtdata at sdata var.
 
Status
Not open for further replies.

Similar threads

Back
Top