Jump to content

include.php, $ _GET, $ _POST and How to change the title to this topic


blad
 Share

Recommended Posts

It is an absurd thing but I don´t know how include php files in the modules (include x.php) or use $ _GET and $ _POST. I am creating a chat module and I am not familiar with the API yet. I have seen modules as an example and they don´t use include or post.Thank you.

The module:

The code has been deleted because it hurt my eyes
 
Edited by blad
Link to comment
Share on other sites

Include as normal...at the top of the class...e.g.

require_once(__DIR__ . '/NameOfYourPHPFILE.php');//am assuming this is a class as well

class BackendChat extends WireData implements Module {

//your class methods

}

For  $ _GET and $ _POST. See $input: http://processwire.com/api/variables/input/

In a module: $this->input->post; wire('input')->get should also work in a class I believe as well as a function. Otherwise, normal use is $input->post, $input->get, $input->cookie

Edited by kongondo
  • Like 2
Link to comment
Share on other sites

I don´t have permissions to change the title. You can put "Learning to use the forum search and don´t create useless topics".

 

Sure! Free beers and coffees for everyone. I like your avatar :) Walter White

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...