Reputation: 5
The page I refer to, with the anchor tag, should display what I write within it. For eg:
echo "<a href='".$question."'>$question</a>"
should display the text in $question
, as a text in the page that it links to.
How can i achieve this using php or html?
PS: I'm new to both php and stackoverflow! So any suggestions are welcome.
Upvotes: 0
Views: 89
Reputation: 43557
Pass data to URL as GET parameter:
<a href="example.com?q=<?php echo urlencode($question); ?>"></a>
In PHP:
if (isset($_GET['q'])) {
echo htmlspecialchars($_GET['q'], ENT_QUOTES);
}
Upvotes: 1