Raised This Month: $ Target: $400
 0% 

Run PHP code inside plugin.


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
4ever16
Veteran Member
Join Date: Apr 2015
Old 05-08-2018 , 18:33   Run PHP code inside plugin.
Reply With Quote #1

Im wondering if its possible to run a php code inside a plugin. Without opening motd.

For example if someone connects to the server a php code will run.

HTML code? Withou opening motd.
4ever16 is offline
fvRate
Junior Member
Join Date: May 2018
Old 05-08-2018 , 19:08   Re: Run PHP code inside plugin.
Reply With Quote #2

I don't know if that's possible, but it sounds suspicious.
What does the code do?
fvRate is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 05-08-2018 , 21:27   Re: Run PHP code inside plugin.
Reply With Quote #3

No. A plugin is not a web server. Explain what you are trying to do.
__________________
fysiks is offline
Airkish
AlliedModders Donor
Join Date: Apr 2016
Location: Lithuania
Old 05-09-2018 , 02:10   Re: Run PHP code inside plugin.
Reply With Quote #4

You can't run PHP code through plugin, that's for sure.
HTML code will run but you are limited to 1536 characters iirc.

Best solution is to place your .php file in your web server and in MOTD paste URL.

Last edited by Airkish; 05-09-2018 at 02:10.
Airkish is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 05-09-2018 , 21:13   Re: Run PHP code inside plugin.
Reply With Quote #5

Quote:
Originally Posted by Airkish View Post
HTML code will run but you are limited to 1536 characters iirc.
HTML doesn't run in the plugin. It runs in the built-in browser.
__________________
fysiks is offline
Airkish
AlliedModders Donor
Join Date: Apr 2016
Location: Lithuania
Old 05-10-2018 , 08:47   Re: Run PHP code inside plugin.
Reply With Quote #6

Quote:
Originally Posted by fysiks View Post
HTML doesn't run in the plugin. It runs in the built-in browser.
Yeah, that's what I meant but I worded incorrectly
Airkish is offline
jimaway
Heeeere's Jimmy!
Join Date: Jan 2009
Location: Estonia
Old 05-09-2018 , 05:10   Re: Run PHP code inside plugin.
Reply With Quote #7

HTTP GET/POST query on the php script address should do the trick. assuming you want to run the script on your webserver and not on the HLDS
jimaway is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 05-10-2018 , 19:29   Re: Run PHP code inside plugin.
Reply With Quote #8

I would love it if it were possible to somehow internally link events in the MOTD to a plugin. I have a use case for this. But unfortunately, it can't .
__________________

Last edited by fysiks; 05-10-2018 at 19:30.
fysiks is offline
Black Rose
Veteran Member
Join Date: Feb 2011
Location: Stockholm, Sweden
Old 05-11-2018 , 12:17   Re: Run PHP code inside plugin.
Reply With Quote #9

Quote:
Originally Posted by fysiks View Post
I would love it if it were possible to somehow internally link events in the MOTD to a plugin. I have a use case for this. But unfortunately, it can't .
What do you mean by events? You can send commands/information to HLDS from MOTD through javascript and/or PHP and rcon.
__________________

Last edited by Black Rose; 05-11-2018 at 12:17.
Black Rose is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 05-12-2018 , 02:36   Re: Run PHP code inside plugin.
Reply With Quote #10

Quote:
Originally Posted by Black Rose View Post
What do you mean by events? You can send commands/information to HLDS from MOTD through javascript and/or PHP and rcon.
Clicking a link or pressing a button would be an event. I know how to do it via RCON but it would be nice to do it purely internal to the server.
__________________
fysiks is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 04:41.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode