Reloading page from action script

Hi,

TO illustrate my question, I have 2 scripts, list.php and action.php.

list.php displays a form with a list, each list entry having a checkbox, and a 'remove' button. When the 'remove' button is clicked, the form is submitted to action.php, and the checked entries should be removed and list.php reloaded.

What is the syntax for simply reloading list.php in the window, from action.php?

Thanks,

Rich
RichardFoxAsked:
Who is Participating?
 
ThGCommented:
OR you can move the code in action.php inside list.php (at the top, you'll sort out the details..) and have  the form submit to himself.
0
 
aolXFTCommented:
check out www.php.net/include and www.php.net/readfile

I think that they are what you are looking for.
0
 
intrwrksCommented:
You can use javascript:

<?php

// code to remove the checked entries

echo "<html><head><title>Name of Company</title></head><body>";
echo "<script language=\"javascript\">window.location=\"list.php\";</script>";
echo "</body></html>";

?>
0
 
SqueebeeCommented:
That or you can use a header redirect:

header("Location: http://www.newdomain.com/list.php");
exit();
0
 
SqueebeeCommented:
Thg's approach is the method I use personally.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.