unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_

help me…
I have problem with search database code that i generate from http://www.twebman.com/

Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in /home/u767797060/public_html/display.php on line 32

[php]

<?php if (($_SERVER['HTTP_REFERER']=="http://".$_SERVER['HTTP_HOST'].$_SERVER['PHP_SELF']) &&(!empty($_POST))){ extract($_POST);} if ($Submit){ $db = mysql_connect("xxxx.xxxxxxx.com","xxxxxxx","xxxxxxxx"); mysql_select_db ("u767797060_badar") or die ("Sorry, database Problems. Please try again."); $result = mysql_query ("SELECT * FROM Badar WHERE KP = '$KP'") or die ("Sorry no results. Please try again."); $numrs = mysql_num_rows($result); if ($numrs ==0){ print ("Your search yielded 0 results. Try again.");} if ($numrs !=0){ print ("

Here are your results: $numrs records.


"); print ""; while ($line = mysql_fetch_assoc($result)) { $TableLine = $line["KP"]; $TableLine1 = $line["Nama"]; $TableLine2 = $line["TelefonRumah"]; $TableLine1 = $line["TelefonBimbit"]; $TableLine2 = $line["Email"]; $TableLine1 = $line["Agama"]; $TableLine2 = $line["Alamat"]; $TableLine2 = $line["Poskod"]; $TableLine1 = $line["Warganegara"]; $TableLine2 = $line["Pekerjaan"]; $TableLine2 = $line["Lainlain"]; // Add lines here with more field and variable names print ""; // Add table cells and/or rows to show more fields. } print ""; print "

$TableLine

$TableLine1

$TableLine2


Back To Top | Search Again

";} mysql_close($db);} if (!$Submit){ print ("\">Enter search term:
");

print ("<input type=“Submit” name=“Submit” value=“Go”>");}
?>

[/php]

Try this for line 32. I’m not programming in an editor, so my syntax can be bad also.

[php]print ("<form method=“POST” action="" . $_SERVER[‘PHP_SELF’] . “”>Enter search term: <input name=“KP” size=“40” maxlength=“255”>
");[/php]

Looks ok

This however, I’m not sure how this looks really…
[php] $TableLine = $line[“KP”];
$TableLine1 = $line[“Nama”];
$TableLine2 = $line[“TelefonRumah”];
$TableLine1 = $line[“TelefonBimbit”];
$TableLine2 = $line[“Email”];
$TableLine1 = $line[“Agama”];
$TableLine2 = $line[“Alamat”];
$TableLine2 = $line[“Poskod”];
$TableLine1 = $line[“Warganegara”];
$TableLine2 = $line[“Pekerjaan”];
$TableLine2 = $line[“Lainlain”];[/php]

What are you doing here? These lines will just reassign values to the same two variables a bunch of times… Are you intending to push the values to an array?

Sponsor our Newsletter | Privacy Policy | Terms of Service