hi i have this script in read.php
<html>
<form action="<? $PHP_SELF; ?>" method="post">
<input type="text" name="text1" size="40" maxlength="40" value="<? echo $text1?>">
<input type="submit" value="Search">
</form>
</html>
<?
if(!empty($text1)){
$filename = "text.txt";
// text.txt content is
// putra |aridana | student | traveling| bali
// anom |mahendra| student | coding, traveling| denpasar
// made | kartha | working | gaming| tabanan
// asti | dewi | student | shoping| surabaya
if(file_exists($filename)) {
$array = file($filename);
$findme=explode(" ",$text1);
$x=0;
foreach($array as $line)
{
$found=false;
for($j=0;$j<sizeof($findme);$j++)
{
if(strpos($line, $findme[$j]) !== false)
{
$found=true;
}
}
if ($found)
{
$prima=explode("|",$line);
echo "<br>";
for($i=0;$i<sizeof($prima);$i++)
{
if($i<=1){
echo "<a href=details.php?details=". $line.">". $prima[$i]."</a>";
}
}
echo $line; //check the contents of $line.
}
}
}
else {
echo "file does not exist";
}
}
?>
it only show one words in details.php but (i need show the whole data)
in echo $line; //check the contents of $line.
it's show that '$line' handle the data line by line.
any idea what is wrong in my code.
oh yea here's the details.php
<?
$line=array();
$line[]= $_GET['details'];
for($r=0;$r<=sizeof($line);$r++){
echo $line[$r];
}
?>
thanks