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

php global variable
how can we create global variable so we can use its value in any form.. Please give example to

understanding functions and classes
Code: [Select]
class person {
var $name = "Jimmy Goe";

function get_nam

batch file not building to webapps folder
Hello. I just started running Vista :P and can't seem to get my projects deployed. I found out how

Polymorphism
Was wondering if someone could explain this a little better to me. I had always assumed that it had

user validation always displaying invalid ? please help
Hello,

I have 2 accounts and there is a field in mysql called validated it can be either &quo

php email checker
I am having alot of trouble finding info on how to do these email things. I need to do the following

Working with Global Variables
hi, I'm not really sure why the following code is returning a "Call to a member function getBan

MySQL Primary key gap
Alright, so I have a table with 26 entries in it (id, filename, caption) for my image randomiser (ht

login from external site
Hi my new experience begins, Now what i am trying to do is i make three pages, login.php logout.php

Remove Rows From Database ad
Hi All,

I have this:

Code: [Select]<?php
session_start();
include('../com

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