Page 1 of 1

Javascript refresh parrent window

Posted: Sun Jul 06, 2003 5:21 pm
by php_wiz_kid
Hey everybody,
I have a question. Ok, when a user logs into my web site for the first time they have to activate their account before they can navigate through the site. Now to activate the account they have to click on a link that opens up a new window. Here they enter the activation code and press submit to send the MySQL query to delete their number out of the "need to activate account" table. Then they close the window and have to log out and log back in before they can navigate. What I want to do is when they press submit the parent web page will refresh so they don't have to manually refresh, or log and log back in. Thanks.

Posted: Sun Jul 06, 2003 6:16 pm
by qads
put this in the child window

you will need to put this AFTER the user has removed him self from the table.

Code: Select all

<body onload="window.opener.location.href='page.php')">
page.php = page where the parent window should go.

Posted: Sun Jul 06, 2003 6:25 pm
by php_wiz_kid
This should work, I was thinking something in onSubmit, could it work either way. Sorry, I don't program JS.

Posted: Sun Jul 06, 2003 6:36 pm
by qads
you could put it onclick but what if there was a error? 8O.

you can put this after making sure everything is ok. :)

Posted: Sun Jul 06, 2003 6:38 pm
by php_wiz_kid
If there was an error it's not like it matters. That's a good thought though.

Posted: Sun Jul 06, 2003 6:58 pm
by php_wiz_kid
That didn't work at all. Nothing even refreshes. Any other ideas?

Posted: Tue Jul 08, 2003 8:12 pm
by McCain83
Well, if you're just refershing, maybe

Code: Select all

<body onLoad="window.opener.location.reload()">
I think that's it, at least.