Jump to content

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

?>

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.