Home  |  Forums  |  914 Info  |  Blogs
 
914World.com - The fastest growing online 914 community!
 
Porsche, and the Porsche crest are registered trademarks of Dr. Ing. h.c. F. Porsche AG. This site is not affiliated with Porsche in any way.
Its only purpose is to provide an online forum for car enthusiasts. All other trademarks are property of their respective owners.
 

Welcome Guest ( Log In | Register )

> OT: PHP Question, Opening a dynamic page in a new window
ThinAir
post Apr 6 2005, 01:54 PM
Post #1


Best friends
****

Group: Members
Posts: 2,543
Joined: 4-February 03
From: Flagstaff, AZ
Member No.: 231
Region Association: Southwest Region



I want to create a dynamic web page that opens in a new window of a particular size. I understand about using the form action with a php page as the action so that it processes what I pass to it, but I'm wondering how to get the result to open in it's own window.

Seems like I remember some behaviour similar to this here at the club with the pop-up that tells you when you have a new PM, so I'm wondering if any of you guru's can tell me how to approach this. I'll be eternally grateful!
User is offlineProfile CardPM
Go to the top of the page
+Quote Post
 
Reply to this topicStart new topic
Replies(1 - 7)
thomasotten
post Apr 6 2005, 02:42 PM
Post #2


Senior Member
***

Group: Members
Posts: 1,547
Joined: 16-November 03
From: San Antonio, Texas
Member No.: 1,349



It seems like you might have to use javascript to open the new php file.
User is online!Profile CardPM
Go to the top of the page
+Quote Post
Rand
post Apr 6 2005, 03:02 PM
Post #3


Cross Member
*****

Group: Members
Posts: 7,409
Joined: 8-February 05
From: OR
Member No.: 3,573
Region Association: None



The Javascript method is like this:

window.open('pagename.php','title','width=640,height=480');

Give us more info if there's a reason you can't use Javascript.
User is offlineProfile CardPM
Go to the top of the page
+Quote Post
ThinAir
post Apr 6 2005, 03:53 PM
Post #4


Best friends
****

Group: Members
Posts: 2,543
Joined: 4-February 03
From: Flagstaff, AZ
Member No.: 231
Region Association: Southwest Region



I need to pass the page information from the calling page. I've got several forms on the calling page, each with a button so that I can pass which button was selected. I'm not aware of a way to pass a value to the php page using the window.open() function.

I'm modify this page so that there is a button by each item for folks to bid on that item. The php page creates a form that they fill out with their bid and then mails it to me.
http://www.musnaz.org/auction2005

This post has been edited by ErnieDV: Apr 6 2005, 03:56 PM
User is offlineProfile CardPM
Go to the top of the page
+Quote Post
Rand
post Apr 6 2005, 04:35 PM
Post #5


Cross Member
*****

Group: Members
Posts: 7,409
Joined: 8-February 05
From: OR
Member No.: 3,573
Region Association: None



In my example, pagename.php is the url. Just expand on that with querystring variables to pass info. You can read the querystring from your dynamic page the same way you would read info coming from a form...
pagename.php?a=whatever
User is offlineProfile CardPM
Go to the top of the page
+Quote Post
Rand
post Apr 6 2005, 04:39 PM
Post #6


Cross Member
*****

Group: Members
Posts: 7,409
Joined: 8-February 05
From: OR
Member No.: 3,573
Region Association: None



If you don't need to control the size of the popup window, you can bypass javascript and just make a url with the querystring variables and put a target='_blank' in the A tag.
User is offlineProfile CardPM
Go to the top of the page
+Quote Post
ThinAir
post Apr 6 2005, 05:14 PM
Post #7


Best friends
****

Group: Members
Posts: 2,543
Joined: 4-February 03
From: Flagstaff, AZ
Member No.: 231
Region Association: Southwest Region



I think I've got it figured out. If I use this Javascript:
window.open('pagename.php?id=2','title','width=640,height=480');

Then I can have the pagename.php grab the value from the url by evaluating $_GET[id] and generating the response page based upon the submitted value.

I've never worked with Get as a form method so it had not occured to me that I could simulate this. This solution is actually easier because I don't need forms in my calling page - I can just use links that call the Javascript.

Thanks, Randy for the inspiration!
User is offlineProfile CardPM
Go to the top of the page
+Quote Post
ThinAir
post Apr 11 2005, 10:07 AM
Post #8


Best friends
****

Group: Members
Posts: 2,543
Joined: 4-February 03
From: Flagstaff, AZ
Member No.: 231
Region Association: Southwest Region



Thanks to the assistance from you guys, my project went live this morning. You can check it out at http://www.musnaz.org/auction2005/

The auction that I put together is open to anyone so if you see something you like, feel free to bid! You'll be benefiting a club member by helping to underwrite my employment!
User is offlineProfile CardPM
Go to the top of the page
+Quote Post

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



- Lo-Fi Version Time is now: 15th June 2024 - 02:42 PM