[SOLVED] Redirect after save on popup mode |
8/20/2013 12:35:54 PM |
PHPRunner General questions | |
S
stiven author
Hello,
|
|
C
|
copper21 8/20/2013 |
You can try |
S
|
stiven author 8/20/2013 |
it is the same situation but it did not work for me. |
C
|
copper21 8/20/2013 |
Ok, |
S
|
stiven author 8/20/2013 |
that didn't work either. :/
|
C
|
cgphp 8/20/2013 |
$_SESSION["user_id"]=$data["id"]; |
C
|
copper21 8/20/2013 |
Okay, here is what I did. Much of what I did came from this post... http://www.asprunner.com/forums/topic/17019-open-javascript-popup-window-then-automatically-close-it-after-saving-it/ Thank FunkDaddy for it. |
C
|
cgphp 8/20/2013 |
Because you want to redirect after the record has been added, you can send a raw HTTP header: $_SESSION["user_id"]=$data["id"]; |
S
|
stiven author 8/20/2013 |
Thanks for the update, but it isn't working the modal popup closes but it won't redirect or reload the previous page. here is the code.
Because you want to redirect after the record has been added, you can send a raw HTTP header: $_SESSION["user_id"]=$data["id"]; |
C
|
cgphp 8/20/2013 |
Sorry Stivens, I was not considering it is an AJAX call. Please, post the code of the script of your modal popup dialog. |
S
|
stiven author 8/20/2013 |
no problem <img src='https://asprunner.com/forums/file.php?topicimage=1&fieldname=reply&id=71820&image=1&table=forumreplies' class='bbc_emoticon' alt=':)' /> thanks for your help
|
C
|
cgphp 8/20/2013 |
Update the AddLog function as follow: function AddLog(id)
|
S
|
stiven author 8/21/2013 |
Thanks Christian this works great this is how the function ended up.
Update the AddLog function as follow: function AddLog(id)
|
C
|
cgphp 8/21/2013 |
Are you using a different function for the second case? |
S
|
stiven author 8/21/2013 |
No, I am using the same function for both cases I can show you how I call them in both cases.
Are you using a different function for the second case? |
C
|
cgphp 8/21/2013 |
You can add a parameter for the redirection url as follows: function AddLog(url,id,w,h,url_redirection)
|
S
|
stiven author 8/21/2013 |
Thanks Cristian, You can add a parameter for the redirection url as follows: function AddLog(url,id,w,h,url_redirection)
|
C
|
cgphp 8/21/2013 |
function AddLog(url,id,w,h,url_redirection)
AddLog(\'ies_case_log_add.php?cid='.$_GET['cid'].'\',\''.$_GET['cid'].'\',\'560\',\'400\',\'ies_case_log_list.php?cid=\')
AddLog('ies_case_log_list.php?cid={$show_key1}','{$show_key1}','800','600','') |
S
|
stiven author 8/21/2013 |
This is great!!! Thank you so much for your help this worked!!! <img src='https://asprunner.com/forums/file.php?topicimage=1&fieldname=reply&id=71838&image=1&table=forumreplies' class='bbc_emoticon' alt=':)' /> function AddLog(url,id,w,h,url_redirection)
AddLog(\'ies_case_log_add.php?cid='.$_GET['cid'].'\',\''.$_GET['cid'].'\',\'560\',\'400\',\'ies_case_log_list.php?cid=\')
AddLog('ies_case_log_list.php?cid={$show_key1}','{$show_key1}','800','600','') |