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

Compare user input to flat file data
Help...Am a complete newbie to programming so my code is prolly quite long. Am trying to verify a us

SQL query not working well
Hi,
I made a small table with 5 rows and want to make them an sql consult using rownum

Module pool selction screen parameters combination logic
Hi floks,
Am new to the module pool development ,Recently i have created one program based on

First root of a number
Hi,

I can't find any function in php to give me the first root of a number.
Is there any

Displaying Site Logo/Icon on a Title tag
really need some help out here. I want to insert a Logo/Icon just like the one close to the "PH

PHP doesn't send my mail
Hi all, I found this and used it to send mail. Simple contact form with some required fields. The va

Impact of movement type 412 E on MAP
Hi

Usage of movement type 412 E is causing huge change in MAP .

Is there any r

EU VAT Package 2010
Does any one know whether SAP will be developing new reporting functionality due the new VAT rules t

Get ID from Database when Posting with a HTML Form
I have a form I am submitting to a MySql database. Each product has an ID # attached to it that auto

re calling a function without including file
Hi,
i am new to programming in php, i was just checking the wordpress code and found out in the w

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