homepage Welcome to WebmasterWorld Guest from 54.234.147.84
register, free tools, login, search, subscribe, help, library, announcements, recent posts, open posts,
Pubcon Platinum Sponsor 2014
Home / Forums Index / Code, Content, and Presentation / HTML
Forum Library, Charter, Moderators: incrediBILL

HTML Forum

    
Meta redirect
still resending POST
mcibor




msg:3226959
 9:07 pm on Jan 21, 2007 (gmt 0)

Hi!

I've got a form
index.php:
<form name="bla" method="POST" action="index.php">
...

after hitting submit button I want to parse the data and redirect again (to disable refresh button)
I'm using
<meta http-equiv="refresh" content="0;url=http://example.com/index.php">

However this does not work as expected, yes, it redirects fine, but on hitting refresh button the POST is being still sent.

Do you know why?

I am now using javascript refresh instead and it's working fine, but I would still want to know why this redirect doesn't solve the problem with refreshing the form.

I am using Mozilla, but the same happens on IE, opera I haven't tested.

Regards
Michal

 

ericjust




msg:3242446
 7:36 pm on Feb 4, 2007 (gmt 0)

You should be able to use PHP to redirect the page from the server-side. You could make a page which you submit the form data to, have it parse the data, and then send you back to your original page.

<?php

// do stuff with $_POST data

header("Location: http://www.example.com/test.php"); // Redirect browser
exit;

?>

Example:

Page 1 with Form -> Submit to Page 2 -> Parse and send back to page 1

Hitting refresh should not resend form data.

See [php.net...]

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / HTML
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved