Php open new windows




















Do you just want a link that opens a POST-requested page in a new window one request? Or do you really want the page to open in a new window, and then a POST request to load in the same window two requests? It looks like one site can open another site in a new window, but it can't manipulate the other site once the window is open same-origin policy.

Is there some varying hidden form value on the page that you need to re-send in the POST request? If not, then perhaps the ideas in my answer below might work for you. Show 3 more comments. Active Oldest Votes. You can make a button that opens a POST-requested page in a new window. Improve this answer. Hi - just checking, does your second code snippet open example. The first example above sends one POST request to the example. If Javascript is enabled, the second example does exactly the same thing as the first example, but looks like a link instead of a button.

When Javascript is enabled, the link's href is ignored, only the onClick is used. The return false tells the browser to ignore the href. I understand a possible need for a server-side popup in that the content may need to be customized on-the-fly with server content. You'll need something on the client side to respond to a user a client. It has no content and is completely transparent in all ways. Inside of it you can create any type of HTML you wish. You create a visible box by changing the invisible boxes' content [via innerHTML].

Buttons or anything else can be part of that content. If you wish the buttons to interact with the user, have that interaction already existing on you page it's hard to do, otherwise and have you events call it. It is even possible to include javaScript in your AJAX update - a b it more skill required to execute it. You can make the box go away in your script by changing its contents innerHTML to nothing.

That all being said, if you're already using javaScript on the client side, unless the data only exists on the server, you don't want' to php it - you want to javascript it.

If this or any of the other replies solves your problem, please use it to mark the question closed. Posted Apr pm Member Killzone DeathMan May pm. Nice try men, but this is javascript! He means in PHP! I am an alert box! Posted Jun am ntechsolution. Viewed 4k times. Improve this question. It's ugly behavior and most browsers will block it anyway. Also that's what I call ugly code.

You can't set a header after you have already echoed content in the response body. HTTP works in two phases - headers then body. Echoing anything to the body automatically flushes the headers to output. Add a comment. Active Oldest Votes. As far as I know, PHP cant open a new window. What you can do is to have php print the relevant link in html which when clicked directs a user to the page where the pdf file will be viewed with the appropriate parameters passed by the get method.

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, learning, and sharing knowledge. You're trying to visit a URL that doesn't currently exist on the web. Most likely, a member posted a link a long time ago to a web page that has since been removed. It's also possible that there was a typo when posting the URL. We redirect you to this notice instead of stripping out the link to preserve the integrity of the post.

Hi folks, I want to open a pdf stored in the database in a new window using php server side script.



0コメント

  • 1000 / 1000