Amit Pal
Amit Pal

Reputation: 11062

How to open a webpage on the same tab after redirecting from a link

I am developing a website in which i need to open a HTML page and after a clicked by a user on a link. It will redirect at somewhere. But what i want to open an another link after this redirection within same tab.

For example : I am on my 4shared.com account and when i click on a link to download something. after successfully redirect of that download link. It will automatically open an another link with in same page.

Thanks in advance

Upvotes: 1

Views: 1697

Answers (1)

Eman yalpsid
Eman yalpsid

Reputation: 511

Use php.

Lets say that I click on a download link. It would most probably bring me to a download.php page. It could download the file and then use an if statement (excuse my bad syntax, I usually do bash and C):

<?php
// download code, or any other code
if (file is downloaded) {
header( 'Location: http://url.of.target' ) ;
} else {
// do nothing and continue downloading
}
?>

Upvotes: 1

Related Questions