ambo Posted March 1, 2009 Share Posted March 1, 2009 This is what i have in my process page im trying to have a page that i can have process forms based on name if this form is submited the do this But its not displaying the variable in the echo is there something im doing wrong im not getting a error??? <?php include("dbconnect.php"); include("../include/session.php"); function processforms(){ if(isset($_POST['Submitanswer'])){ $addforumanswer(); } } /** * procUpdateLevel - If the submitted username is correct, * their user level is updated according to the admin's * request. */ function addforumanswer(){ $a_name = $_POST['a_name']; $a_answer = $_POST['a_answer']; echo "$a_name <br> $a_answer"; } /* Initialize process */ $processforms ?> Quote Link to comment https://forums.phpfreaks.com/topic/147470-solved-form-not-processing/ Share on other sites More sharing options...
sillysillysilly Posted March 1, 2009 Share Posted March 1, 2009 I think the page has an error due to /* Initialize process */ $processforms you are saying something about a variable with completing it. /* Initialize process */ $processforms = "tom dick and harry"; but I think you mean for $processforms is to call the forms to process so you would do it without the $ in front. Quote Link to comment https://forums.phpfreaks.com/topic/147470-solved-form-not-processing/#findComment-774069 Share on other sites More sharing options...
ambo Posted March 1, 2009 Author Share Posted March 1, 2009 /* Initialize process */ $processforms = new processforms; So something like that??? cause this doesnt seem to do it Quote Link to comment https://forums.phpfreaks.com/topic/147470-solved-form-not-processing/#findComment-774072 Share on other sites More sharing options...
Mad Mick Posted March 1, 2009 Share Posted March 1, 2009 As your function has no return value it's just: processforms(); Quote Link to comment https://forums.phpfreaks.com/topic/147470-solved-form-not-processing/#findComment-774079 Share on other sites More sharing options...
ambo Posted March 1, 2009 Author Share Posted March 1, 2009 It Processes BUT It shows the data and at the end it says object with this code <?php include("dbconnect.php"); include("../include/session.php"); class Processforms { function Processforms(){ global $session; if(isset($_POST['Submitanswer'])){ $this->addforumanswer(); } } function addforumanswer(){ $a_name = $_POST['a_name']; echo "$a_name <br> $a_answer"; } }; /* Initialize process */ $processforms = new Processforms; echo "$processforms"; ?> Quote Link to comment https://forums.phpfreaks.com/topic/147470-solved-form-not-processing/#findComment-774089 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.