MyBB Community Forums

Full Version: PHP Introduction to Post ?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I want to make a PHP page where there would be two things :

A text Box
A Button

In the text box people would write something and when they press the button I would get the data from textbox in an E-mail or something and that data would be post in a thread from forum by that user.

Anyone has any idea of how to do this ?
a premium plugin exists (link) for above requirement
You just create a .php page,

Then put this:

define(THIS_SCRIPT, page.php);
require_once "./global.php";

if($mybb->input['action']=='send')
{
// Send mail...
}

// eval the templates....

Like that... Big Grin
Can you be more detalied pls ?
You are talking about a standard page with a form and some data collection code.

It is as simple as this:

define('IN_MYBB', 1);
require_once 'global.php';

if ($mybb-> request_method == 'post') {
// get input and post thread
}

// show form
And how do I choose in which thread it would post?
Every thread has a specific ID. It is stored in the databases column TID for every thread. Simply reference the tid of the thread you'd like to have the posts sent.
Thank you sir.
No problem. If you get stuck, post here and I will help if I can.

Also, I typed that code earlier on my phone and there was an error in it so I edited it a little.