Reputation:
I am trying to create a new line between product $id and $name but however I am getting an error, please could you help me.
echo "<a href='searchdetails2.php?vid=".$id."'>".<br />$name. "</a> ";
}
echo "<a href='searchdetails2.php?vid=".$id."'>".<br />$name. "</a> ";
}
Upvotes: 2
Views: 78
Reputation: 114
You Missed Quotations In
tags Always Written in Double Quotations In Php.
echo "<a href='searchdetails2.php?vid=".$id."'><br />".$name."</a> ";
Upvotes: 2
Reputation: 3547
you have missed up with the quotations
change it to this
echo "<a href='searchdetails2.php?vid=$id'><br />$name</a> ";
}
echo "<a href='searchdetails2.php?vid=$id'><br />$name</a> ";
}
Upvotes: 1
Reputation: 1063
You are concating a html element as a php constant. Any html should be surrounded with quotes lie this.
echo '<a href="searchdetails2.php?vid='.$id."'><br />'.$name.'</a>';
Upvotes: 0
Reputation: 26861
try with:
echo "<a href='searchdetails2.php?vid=".$id."'><br />".$name. "</a> ";
}
echo "<a href='searchdetails2.php?vid=".$id."'><br />".$name. "</a> ";
}
Upvotes: 2
Reputation: 4637
Your concat is wrong.you need to use like below
echo "<a href='searchdetails2.php?vid=".$id."'><br />".$name."</a> ";
Upvotes: 3