Jump to content

Recommended Posts

Posted

Hi

 

I am making a script using the following

 

http://www.killersites.com/community/index.php?/topic/3064-basic-php-system-view-edit-add-delete-records-with-mysqli/

 

all works perfect, just got one little issue, on the view-paginated.php page I am trying to make a website a link that opens in a new tab

 

The line of code is below

echo '<td>' . $row[5] . '</a></td>';

How would I make that a link as tried a few things and don't seem to work

Posted

What data does "$row[5]" contain? One way or another, you need a link that opens up a new tab:

<a href="your-link.html" target="_blank">Link Text</a>

If $row[5] contains a website URL, for example, "http://google.com", you would do something like this:

echo '<td><a href="' . $row[5] . '" target="_blank">' . $row[5] . '</a></td>';

which would result in:

<a href="http://google.com" target="_blank">http://google.com</a>
Posted

Hi Ben

 

Thank you for the reply

 

Yeah I soon thought after of doing it the way you mentioned

echo '<td><a href="' . $row[5] . '" target="_blank">' . $row[5] . '</a></td>';

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...