Solved

Reloading page from action script

Posted on 2003-11-12
5
233 Views
Last Modified: 2006-11-17
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
0
Comment
Question by:RichardFox
5 Comments
 
LVL 6

Expert Comment

by:aolXFT
ID: 9734527
check out www.php.net/include and www.php.net/readfile

I think that they are what you are looking for.
0
 
LVL 4

Expert Comment

by:intrwrks
ID: 9734666
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
 
LVL 17

Expert Comment

by:Squeebee
ID: 9736047
That or you can use a header redirect:

header("Location: http://www.newdomain.com/list.php");
exit();
0
 
LVL 14

Accepted Solution

by:
ThG earned 50 total points
ID: 9736342
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
 
LVL 17

Expert Comment

by:Squeebee
ID: 9736431
Thg's approach is the method I use personally.
0

Featured Post

Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Popularity Can Be Measured Sometimes we deal with questions of popularity, and we need a way to collect opinions from our clients.  This article shows a simple teaching example of how we might elect a favorite color by letting our clients vote for …
Developers of all skill levels should learn to use current best practices when developing websites. However many developers, new and old, fall into the trap of using deprecated features because this is what so many tutorials and books tell them to u…
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
The viewer will learn how to dynamically set the form action using jQuery.

803 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question