oceans Posted December 4, 2008 Share Posted December 4, 2008 how can I get to open a new page on a new window i am using the following but it opens on the same window header('location: View.php?ID='.$InputFromScreen[1]); Quote Link to comment https://forums.phpfreaks.com/topic/135442-solved-how-can-i-get-to-open-a-new-page-on-a-new-window/ Share on other sites More sharing options...
corbin Posted December 4, 2008 Share Posted December 4, 2008 Only way you can do it automatically is javascript. A link could simply have target="<anything but the name of the current window>" as an attribute to open it in a different window. Quote Link to comment https://forums.phpfreaks.com/topic/135442-solved-how-can-i-get-to-open-a-new-page-on-a-new-window/#findComment-705613 Share on other sites More sharing options...
oceans Posted December 7, 2008 Author Share Posted December 7, 2008 Can you please give me a working example I am using the following to open a page. header('location: View.php?ID='.$InputFromScreen[1]); Quote Link to comment https://forums.phpfreaks.com/topic/135442-solved-how-can-i-get-to-open-a-new-page-on-a-new-window/#findComment-708550 Share on other sites More sharing options...
corbin Posted December 7, 2008 Share Posted December 7, 2008 Google "javascript popup". a link example: <a href="http://google.com/" target="_blank">Google</a> Quote Link to comment https://forums.phpfreaks.com/topic/135442-solved-how-can-i-get-to-open-a-new-page-on-a-new-window/#findComment-708781 Share on other sites More sharing options...
oceans Posted December 9, 2008 Author Share Posted December 9, 2008 Thank you, I have to mention, I am sending a value from a "php" variable (processed) in this page the to next page. Thus do you think Javascript will help me port this value as well to next page if I use it. Currently my pages works good, I just want the next page to be on its own with this ported value to be further worked on over there. Thanks. Quote Link to comment https://forums.phpfreaks.com/topic/135442-solved-how-can-i-get-to-open-a-new-page-on-a-new-window/#findComment-710117 Share on other sites More sharing options...
Maq Posted December 9, 2008 Share Posted December 9, 2008 Thank you, I have to mention, I am sending a value from a "php" variable (processed) in this page the to next page. Thus do you think Javascript will help me port this value as well to next page if I use it. Currently my pages works good, I just want the next page to be on its own with this ported value to be further worked on over there. Thanks. Have you done any research? Surely you have heard of the $_GET method, I mean you have a decent amount of posts... You have to tack it onto the end of the URL. $s = "hit"; ?> Google I already know the next question... You retrieve it on the next page by doing: $ported_var = $_GET['var1']; Quote Link to comment https://forums.phpfreaks.com/topic/135442-solved-how-can-i-get-to-open-a-new-page-on-a-new-window/#findComment-710148 Share on other sites More sharing options...
oceans Posted December 9, 2008 Author Share Posted December 9, 2008 Maq, You missunderstood me, presently I am using header('location: View.php?ID='.$InputFromScreen[1]); I placed this statement in a if condition, if somthing happens go there, if not stay in here. yes I grab the value as you mention, but this time I want the next page to open in a brand new window. Please advise. Quote Link to comment https://forums.phpfreaks.com/topic/135442-solved-how-can-i-get-to-open-a-new-page-on-a-new-window/#findComment-710221 Share on other sites More sharing options...
corbin Posted December 9, 2008 Share Posted December 9, 2008 Did you read this thread at all? >.< Quote Link to comment https://forums.phpfreaks.com/topic/135442-solved-how-can-i-get-to-open-a-new-page-on-a-new-window/#findComment-710279 Share on other sites More sharing options...
oceans Posted December 9, 2008 Author Share Posted December 9, 2008 I tried this, not working, but I think I am close, can you assist. the problem is getting javascript to send my php variable's value, if this is done, i am ok with your suggested java pop up <?PHP . . . ?> <script type="text/javascript"> window.open("http://localhost/Product/View.php?ID="</script> <?PHP echo $InputFromScreen[1]); ?> <script type="text/javascript">); //header('location: View.php?ID='.$InputFromScreen[1]); </script> <?PHP . . . ?> Quote Link to comment https://forums.phpfreaks.com/topic/135442-solved-how-can-i-get-to-open-a-new-page-on-a-new-window/#findComment-710289 Share on other sites More sharing options...
corbin Posted December 9, 2008 Share Posted December 9, 2008 I tried this, not working, but I think I am close, can you assist. the problem is getting javascript to send my php variable's value, if this is done, i am ok with your suggested java pop up <?PHP . . . ?> <script type="text/javascript"> window.open("http://localhost/Product/View.php?ID="</script> <?PHP echo $InputFromScreen[1]); ?> <script type="text/javascript">); //header('location: View.php?ID='.$InputFromScreen[1]); </script> <?PHP . . . ?> That code isn't valid. Write it like you would write normal JS, and then go back and add the PHP part. It will probably be easier that way. Quote Link to comment https://forums.phpfreaks.com/topic/135442-solved-how-can-i-get-to-open-a-new-page-on-a-new-window/#findComment-710867 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.