gum1982 Posted November 11, 2009 Share Posted November 11, 2009 Hello ive got a problem ive got form with its action set to itself. <form id="formID" class="formular" method="post" action=""/> it then runs through validation and if their are no errors it the runs a header redirect. if($error == ''){ header('location: http://example.com/test.php); } } The problem im having is it doesnt pass through all the form variables to the next page like firstname lastname email etc. If i set the forms action to test.php it sends them all fine can someone please tell me a workaround when using a header redirect? Link to comment https://forums.phpfreaks.com/topic/181129-header-redirect/ Share on other sites More sharing options...
mrMarcus Posted November 11, 2009 Share Posted November 11, 2009 upon using a header() redirect, all posted variables will be lost. if you want to retain your posted vars, do not use a header() redirect. and do not close your <form /> like that. should be <form></form> Link to comment https://forums.phpfreaks.com/topic/181129-header-redirect/#findComment-955610 Share on other sites More sharing options...
gum1982 Posted November 11, 2009 Author Share Posted November 11, 2009 Nightmare i wish i had known that before. thanks is their no way around this like with maybe a session? Link to comment https://forums.phpfreaks.com/topic/181129-header-redirect/#findComment-955614 Share on other sites More sharing options...
mrMarcus Posted November 11, 2009 Share Posted November 11, 2009 sure, you can use sessions. just make sure to set them before the redirect. Link to comment https://forums.phpfreaks.com/topic/181129-header-redirect/#findComment-955617 Share on other sites More sharing options...
gum1982 Posted November 11, 2009 Author Share Posted November 11, 2009 ok thanks mrMarcus Link to comment https://forums.phpfreaks.com/topic/181129-header-redirect/#findComment-955619 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.