How to echo a hyperlink?

Ask about general coding issues or problems here.

Moderators: macek, egami, gesf

Post Reply
User avatar
egami
php-forum GURU
php-forum GURU
Posts: 2196
Joined: Wed Oct 06, 2010 11:19 am
Location: Happy Valley, UT

Re: How to echo a hyperlink?

Post by egami » Wed Sep 26, 2012 1:47 pm

Try this, may work out a bit better for you.

Code: Select all

<?php

if (isset($_POST['pc']))
{
  $pc = strip_tags($_POST['pc']);

  if ($pc == 0)
  {
    $pcText = '<a href="http://www.yahoo.com">Yahoo.com</a>';
  } else { 
    $pcText = '<a href="http://www.google.com">Google.com</a>';
  }

  echo "Website: $pcText <br/>\r\n";
} else { 
  echo "Sorry, PC wasn't selected. So please try again.<br/>\r\n";
}
 

Post Reply

Who is online

Users browsing this forum: No registered users and 15 guests