june_c21 Posted November 1, 2007 Share Posted November 1, 2007 hi, this is my code $redirect = 'index1.htm'; header ("location: $redirect"); i want to redirect to new internet explorer when click on it. i wrote target="_blank" but it doesn't work. how to write the code? thanks Link to comment https://forums.phpfreaks.com/topic/75602-redirect/ Share on other sites More sharing options...
Guest Posted November 1, 2007 Share Posted November 1, 2007 I think what you want is an HTML hyperlink, which you don't need PHP for: <a href="index1.htm" target="_blank">click here</a> If for some reason you need PHP to open a new window--you could print javascript to the screen that opens a new window. Tell me if either is your intention and I'll try to build on a more specific response. Link to comment https://forums.phpfreaks.com/topic/75602-redirect/#findComment-382540 Share on other sites More sharing options...
june_c21 Posted November 1, 2007 Author Share Posted November 1, 2007 i wrote the file in php format. after user login correctly, it will redirect them to another page but the new page will be pop up. i try echo "<a href='index1.htm' target='_blank'></a>"; OR "<a href="index1.htm" target="_blank"></a>"; but it don't work. Link to comment https://forums.phpfreaks.com/topic/75602-redirect/#findComment-382545 Share on other sites More sharing options...
Guest Posted November 1, 2007 Share Posted November 1, 2007 Oh I see, then you can do this. On the login form, you can add the target attribute to the form itself: <form action="login.php" [b]target="_blank"[/b]> ... and on login.php, after logging the user in, you do as you did before: header('location: index1.htm'); exit; Link to comment https://forums.phpfreaks.com/topic/75602-redirect/#findComment-382548 Share on other sites More sharing options...
june_c21 Posted November 1, 2007 Author Share Posted November 1, 2007 thanks a lot. it's work! Link to comment https://forums.phpfreaks.com/topic/75602-redirect/#findComment-382553 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.