Forum Moderators: open

Message Too Old, No Replies

Popup Post Redirect Opener & Post Data

Use Popup form to redirect Opener Page & Post Form info to the new page

         

Sherif

7:41 pm on Jun 10, 2011 (gmt 0)

10+ Year Member



Dear All....

I searched all possible sources to find a solution to my problem and I can't find a solution to it.

I have (Page1)- Contains a form that posts information to a new page (Page2) [popup]

(Page2) contains a preview of the values entered from (Page1) and a submit button to insert the value to the database..

when the user submits the form, it is dealt locally (php self) where the page basically refers to itself and deals with the insert process.

Basically, after the data is inserted, I would like to do the following:

1. Define a "Location" variable, and an "Identification" variable to post to the opener page.

2. Redirect the opener page to another page [Page3], and receive the popup variables to it.

3. close the popup page, and focus on the opener page.


I found this command:
window.opener.document.forms['form-name'].submit()
but the problem with it is that i cannot change the location of the opener page.


It must be noted, that the location of which we want to redirect the opener page to checks to see if a certain variable is set (PHP Language: $_POST['variable1']) if this variable is not set, the page automatically redirects to another page.. so to access this page, the $_POST['variable1'] must be set so that the page can fully open.

Therefore, basically, i want javascript to change location of the opener window, and concurrently post a variable to it so that we can access the page. [basically speaking, set the target of a form to be the opener window, and the location to be a certain page where the data will be posted to]

How can that be done?


Thanks a lot for the support in advance.

Sincerely,
Sherif

Sherif

11:12 pm on Jun 13, 2011 (gmt 0)

10+ Year Member



Dear All,

I noticed that I was complicating the situation for my self for no specific reason.

I ended up using the following in javascript segment of the popup page:
window.opener.location.href="url of redirect page"

To solve the validation issue of the page, I declared a PHP session variable in the popup page for the validation process that happens in the Main window, as a result, everything now is working smoothly..

Issue solved.


Thanks for everyones effort.


Sincerely,
Sherif