Jump to content

[SOLVED] Form Not processing


ambo

Recommended Posts

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

?>

Link to comment
https://forums.phpfreaks.com/topic/147470-solved-form-not-processing/
Share on other sites

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.

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";

?>

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.