Jump to content

Archived

This topic is now archived and is closed to further replies.

oceans

[SOLVED] how can I get to open a new page on a new window

Recommended Posts

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]);

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

Can you please give me a working example

I am using the following to open a page.

header('location: View.php?ID='.$InputFromScreen[1]);

Share this post


Link to post
Share on other sites

Google "javascript popup".

 

 

a link example:

 

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

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

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'];

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

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
.
.
.
?>

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.