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

License Issue - service type user
Hi,

I would like to understand the following issue regarding sap license.
I wish to

IIS on 2003 anon access disabled issue
I have an IIS server that belongs to a domain, and anonymous access is turned off for all my sites.

Greek characters in php
Hi,

I'm making a script and I m using for first time greek characters.
I started to write

Filename and Line Number Custom Error
I have a class, with a method that accepts 2 parameters. I would like to output error messages.

Adding delete feature to my forum
Hello I am currently trying to add a delete feature to my forum. I believe I have everything built r

mr8m - reverse document
Friends,

I'm trying to reverse a document held by MIRO, but it reports the message balan

Contact Form Not Working When I Add Validation Codes
So I built my first working PHP "Contact Us" like form. But, I have been trying to now mak

PECL uploadprogress for php5.2
Hey, I just installed PHP5 via .htaccess on my 1and1 Shared Hosting Account.

How would I exac

selectbox+database connection retrive problem
Code: [Select]
<tr>
<th align="left" scope="c

Problem with Subscreen
Dear Experts ,
I am facing a problem with the subscreens. My senario is as follows :

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