blad

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

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

Share this post


Link to post
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

Share this post


Link to post
Share on other sites

I will erase this crap and start again . Thanks @kongondo

Share this post


Link to post
Share on other sites

:-)...maybe let's just change the title to something more descriptive, mark this as solved and maybe you can buy me coffee when am next in Spain?   :lol:  ;)

  • Like 1

Share this post


Link to post
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

Share this post


Link to post
Share on other sites

I don´t have permissions to change the title.....

Yes you do :-)...Just use the 'More reply options' when you are editing the first post you created and you'll get the full editor... But I can change it, no worries  :)

  • Like 1

Share this post


Link to post
Share on other sites

I've finally done something good today :). See you tomorrow

  • Like 1

Share this post


Link to post
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

  • Recently Browsing   0 members

    No registered users viewing this page.

  • Similar Content

    • By anttila
      Hi all.
      First of all, I want to thank you all who blessed us with this great CMS. I have done 20+ sites with this and I'm very happy. I love the API.
      In case anyone is interested in using Discord to chat and talk about ProcessWire, I made server for us. Discord is a free voice and text chat app designed specifically for gaming, but it's very good for our kind of communities too. Chatting is similar to IRC, voice is similar to TeamSpeak or Mumble, and there will be coming new features like video chatting. Also chance to use notifications when someone talking in a specific channel, but the server's default is only notified when mentioned.
      There can be multiple channels in one server; general, help, devtalk, security, specific languages. All can be public or accessed by only for a certain role.
      And if you're not there, let's say for five days, you can still search or read things what people have talked since you were there last time (if mod did not purge that channel). Windows and Mac clients are very good ones, but Linux is still in beta. And of course, there is webchat too.
      More information about Discord can be found here: https://discordapp.com/
      Of course, all the ProcessWire developers can get moderator access to the server. Forums are, of course, very good place to discuss things (and I have found many answers from here), but that is not real time and getting the answers you need can take a lot of time here. People want to get their answers faster, right now, so that’s why Discord can be a very good way to grow our community. Think about it.
      Invite link to server
    • By Beluga
      One of the greatest Finnish inventions, IRC, is still evolving. It even has a working group pushing things forward. I thought I would create a topic with curated open source tools to maybe inspire more people to join #processwire @ Freenode network. I have selected the tools on the basis that they seemed to be under active development. Awesome IRC is a nice list, but too detailed for this context and listing many unmaintained projects.
       
      Desktop clients (cross-platform)
      HexChat
      Irssi
      KVIrc
      Quassel (has the unique feature that one (or multiple) client(s) can attach to and detach from a central core)
      WeeChat
       
      Multi-protocol Swiss army knives
      Pidgin
      Smuxi
      Thunderbird
       
      Android clients
      HoloIRC
      qicr
       
      iOS clients
      Mutter
      Colloquy
       
      Web-based clients
      These should be quite interesting to the PW crowd as hosting web applications is your bread and butter
      Glowing Bear (web frontend for WeeChat)
      Kiwi IRC (currently being rewritten)
      The Lounge
      Quassel webserver
       
      Bouncers (don't lose chat history even though going offline)
      Firrre - get a free bouncer for free & open source community networks. See the guidelines: you need a 60-day old registered NickServ account and a Github.com account. See the Freenode guide to nickname registration.
      ircb
      ZNC
    • By clsource
      Hello,
      I created a simple telegram bot. What it does? it enables you to save your voice messages and send them later using emojis or keywords in your group chats. Just add @voxgrambot in your group chats and search all the public voice messages available using text or emojis.
      If you want to create a new voice message just send a private message to the bot with the command /new . If you want more info send the command /help.
      The bot was made using Python and https://python-telegram-bot.org
      The backend was made using ProcessWire 3.x and my Rest API helper.

       
      http://telegra.ph/Voxgram-Telegram-Bot-12-03