show the direct link into href


Posted on 16th Feb 2014 07:03 pm by admin

I want to display link on the page. i am fetching the data(URL) from database,actually before that i am checking if it is URL or not. if it is URL, let take an example google.com so it should take me directly on the Google's page after clicking on that link .

but now the problem is the path is something like this.

Quote mydomain/myfolder/mysubfolder/google.com
i want directly

Quote google.com
Here is my code

Code: [Select]if($row['which_mail'] == "decline")
{

if(!preg_match("/^[a-zA-Z]+[://]+[A-Za-z0-9-_]+\.+[A-Za-z0-9./%&=?-_]+$/i",$row['content']))
{

$ab = $row['content'];
echo $ab ;
// echo "<b>Last message for decline mail is</b>-".<a href='$ab'>".$row['content']."</a>.";

echo "<a href='$ab'>".$row['content']."</a>";

}else{
$decline =$row['content'];

echo "<b>Last message for decline mail is</b>- $decline";
}}

Can anyone look into my code and tell me how can i achieve that?

Thanks in advance.

No comments posted yet

Your Answer:

Login to answer
187 Like 19 Dislike
Previous forums Next forums
Other forums

rookie looking for help coding a CSS form with PHP
I'm trying to figure out how to add PHP code to my xhtml form so that it is a working form embedded

trim function issues
Hi guys, total noob here...

So I've been tinkering around with a html and am using php to em

problems with php variables in mysql query
i can't seem to get the following query to work.

select $q1c from $vote_rate where id = $re

unoconv doc convert to pdf code prob
PHP/5.3.1

Hi. I am trying to use this code to convert docs to .pdf utilizing unoconv. Howe

gmmktime or mktime
I live in the UK, i am within the GMT (with daylight saving time ie 1 hour difrence between summer a

question about n
I was looking at some of the things you could do with php and one of the things I have tried is n.<

shift numbers with paging
Hi

How would i be able to display 10 numbers 1 2 3 4 5 6 7 8 9 10
and when I click next

Different payment methods with different cross company requirements in F110
We are implementing SAP in a company in the shipping industry. They have the following requirement:<

Comparing Values
Hi
I'm reading data from a database and this seems to work OK.

Each system has an associat

Deleting pointers froms vector?
Hi. I have a vector filled with pointers and I want to delete the pointers. I could do a loop and do

Sign up to write
Sign up now if you have flare of writing..
Login   |   Register
Follow Us
Indyaspeak @ Facebook Indyaspeak @ Twitter Indyaspeak @ Pinterest RSS



Play Free Quiz and Win Cash