How can I have a textbox post as a clickable hyperlink?
I have a form I am working on that allows all users to enter a website url in an input textbox and then submit it (being then posted on the subsequent page).
What would I need to do to have it echo the url itself that if clicked will take anyone to the website?
here is the code that tells it how to post the information:
// Let's find out if we have taxonomy information to display
// Something to build our output in
$taxo_text = "";
// Variables to store each of our possible taxonomy lists
// This one checks for a tool website
$website_list = get_the_term_list( $post->ID, 'tool_website', '<strong>Tool Website:</strong> ', ', ', '' );
if ( '' != $website_list ) {
$taxo_text .= "$website_list<br />\n";
}
// Output taxonomy information if there was any
// NOTE: We won't even open a div if there's nothing to put inside it.
if ( '' != $taxo_tex开发者_开发问答t ) {
?>
<div class="entry-utility">
<?php
echo $taxo_text;
?>
</div>
<?
currently what this code does is make (essentially) a category listing. So the url will be posted, but when clicked it links to a page that shows all posts "categorized" within that name. So if one entered "tools" as the url, it would have a clickable hyperlink that says "tools" and when clicked would redirect to a new page that has a list of all submissions listed with the string "tools"
if that makes sense..
If I understand your question then assuming that the user types a URL in a textbox on the form called "poster_url" you then need to output a link with that URL like this:
<a href="<% echo $_POST['poster_url']%>">Poster's Website</a>
However, some validation should probably occur first since outputing something like this directly after a user enters it is considered unsafe.
精彩评论