Reputation: 1
I want to pass name in get variable. That name contain spaces. So is not working in php.
$facid=$row['Facultyname'];
echo "<a href=tutorials.php?$facid>" . $row['Facultyname']. "</a><p>";
Please help me if Faculty name =A.K. Sharma then it only send A.K.
Upvotes: 0
Views: 2056
Reputation: 14438
echo '<a href="tutorials.php?variable_name='.urlencode($row['Facultyname']).'">'
. $row['Facultyname']. '</a>';
EDIT: Set a variable name for the GET.
Upvotes: 2
Reputation: 11470
Looks like you're not actually setting a variable after the ?
, you're just pasting the value. Try:
$facid = $row['Facultyname'];
echo "<a href='tutorials.php?facid=". urlencode($facid) ."'>". $facid ."</a>";
Upvotes: 0