Forum Moderators: coopster

Message Too Old, No Replies

Opening a Page with PHP

form action

         

applealps

5:59 pm on Sep 5, 2005 (gmt 0)

10+ Year Member



I've been fiddling with a section of code which is part of a review system. Currently, depending on whether reviews are moderated or not, when the user successfully fills in the form a message is displayed using these pieces of code.


if ($moderate== 1) $message = $lang[submit_app];
else $message = $lang[submit];
$complete = 1;
}

$lang[submit_app] = "<br><b>Your review has been submitted for approval.</b>";
$lang[submit] = "<br><b>Your review has been posted!</b>";

Instead of showing either of the messages, I want a page to load up. (I want the user to return to viewing the reviews, so s/he can see their own comments)

I've been fiddling with the fopen function but no luck. I've thought about putting an onclick function on the send button, but I want to see if it's possible to do this using PHP first.

Any help is much appreciated
Apple

mcibor

9:14 pm on Sep 5, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



use or
header("Location: http://www.example.com/index.php");

or just do the checking in the same file you have your form

<?php if //check if submitted... etc
<form action="<?echo $_SERVER['PHP_MYSELF'];?>"...

Michal Cibor

applealps

10:04 pm on Sep 5, 2005 (gmt 0)

10+ Year Member



I've used header(location ...).

Thanks again!