Destramic Posted January 2, 2007 Share Posted January 2, 2007 i have a form when you submit the form i want it go to add.php where all my querys for ever query insert.problem is when i use any one of these functions...it will not carry over the $_POST array so i have no value for the array.anyone know how i could solve this please?[code]if (!isset($_POST['submit'])){ // i could simply put the query here but wouldnt be benificial. header("Location: add.php?type=news"); //require_once $document_root . "cp/add.php?type=news";}[/code]thanks ricky Quote Link to comment https://forums.phpfreaks.com/topic/32561-solved-headers/ Share on other sites More sharing options...
wildteen88 Posted January 2, 2007 Share Posted January 2, 2007 change the action on the form to where you want the form to be submitted to rather than submitting to itself:[code]<form action="add.php" method="post">[/code] Quote Link to comment https://forums.phpfreaks.com/topic/32561-solved-headers/#findComment-151398 Share on other sites More sharing options...
Destramic Posted January 2, 2007 Author Share Posted January 2, 2007 bah sorry thats not possible it have to be $_SERVER['PHP_SELF'] as i have a form validation class that runs on the same page..here is the code if you wanna have a quick look...you may understand better:code: http://rafb.net/p/sbPyde45.htmlpage: http://82.45.55.177/cp/news_add.phpi need to be able to do a include or header location...thanks for your quick reply ricky Quote Link to comment https://forums.phpfreaks.com/topic/32561-solved-headers/#findComment-151453 Share on other sites More sharing options...
trq Posted January 2, 2007 Share Posted January 2, 2007 Your logic is a little scewed than forms are meant to post to the script that will process them. You could however place the values into a session array then call a header redirect. Quote Link to comment https://forums.phpfreaks.com/topic/32561-solved-headers/#findComment-151460 Share on other sites More sharing options...
Destramic Posted January 2, 2007 Author Share Posted January 2, 2007 k well maybe i should update my validation script... Quote Link to comment https://forums.phpfreaks.com/topic/32561-solved-headers/#findComment-151492 Share on other sites More sharing options...
wildteen88 Posted January 2, 2007 Share Posted January 2, 2007 Why don't you include your validation class in add.php instead? Quote Link to comment https://forums.phpfreaks.com/topic/32561-solved-headers/#findComment-151493 Share on other sites More sharing options...
Destramic Posted January 2, 2007 Author Share Posted January 2, 2007 good idea...thanks Quote Link to comment https://forums.phpfreaks.com/topic/32561-solved-headers/#findComment-151505 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.