Solved

Reloading page from action script

Posted on 2003-11-12
5
212 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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
Thg's approach is the method I use personally.
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

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 …
I imagine that there are some, like me, who require a way of getting currency exchange rates for implementation in web project from time to time, so I thought I would share a solution that I have developed for this purpose. It turns out that Yaho…
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.

762 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

Need Help in Real-Time?

Connect with top rated Experts

7 Experts available now in Live!

Get 1:1 Help Now