Open link in same window

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
Effect
Forum Newbie
Posts: 5
Joined: Fri Sep 18, 2009 11:33 am

Open link in same window

Post by Effect »

So I am wondering how can I open a link in same window?

For example if I am having a website with link.

Code: Select all

<a href="item.php">Something</a>
How can I make it to open the link under it, without it opening it to a new window?
lipun4u
Forum Commoner
Posts: 82
Joined: Wed Jul 01, 2009 3:35 am
Location: Mumbai
Contact:

Re: Open link in same window

Post by lipun4u »

Effect wrote:So I am wondering how can I open a link in same window?

For example if I am having a website with link.

Code: Select all

<a href="item.php">Something</a>
How can I make it to open the link under it, without it opening it to a new window?
Use the target="_top" attribute

Code: Select all

 
<a href="item.php" target="_top" >Something</a>
Effect
Forum Newbie
Posts: 5
Joined: Fri Sep 18, 2009 11:33 am

Re: Open link in same window

Post by Effect »

lipun4u wrote:
Effect wrote:So I am wondering how can I open a link in same window?

For example if I am having a website with link.

Code: Select all

<a href="item.php">Something</a>
How can I make it to open the link under it, without it opening it to a new window?
Use the target="_top" attribute

Code: Select all

 
<a href="item.php" target="_top" >Something</a>
That does the same thing for me as the _self does.
User avatar
John Cartwright
Site Admin
Posts: 11470
Joined: Tue Dec 23, 2003 2:10 am
Location: Toronto
Contact:

Re: Open link in same window

Post by John Cartwright »

How can I make it to open the link under it, without it opening it to a new window?
I think you'll need to explain what you are after again.
User avatar
ProXy_
Forum Newbie
Posts: 1
Joined: Sat Oct 03, 2009 5:40 pm
Location: Michigan
Contact:

Re: Open link in same window

Post by ProXy_ »

You could also try:

Code: Select all

 
<a href="item.php" target="_parent" >Something</a>
 
this works for me in Firefox & internet explorer.
if this however doesn't solve your problem.
Try using javascript.
Post Reply