Raised This Month: $ Target: $400
 0% 

CSS open php page with parameters, in motd?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
D.Moder
I uploaded 2 great gameplay plugins here
Join Date: Sep 2009
Location: Sin city
Old 03-29-2015 , 07:10   CSS open php page with parameters, in motd?
Reply With Quote #1

I wanna see if sourcemod can handle php+html,
I know php, and I want to show a php file which is somewhere in cstrike folder,
A file that's gonna show the end game statistics, and maybe best player in that round,
So I wanna see if I could also pass parameters to the php file as well...
Like: cstrike\end.php?mostkillsby=fatkid&key2=value 2
And show it in a motd.
To wrap it up: show local php file in motd.
__________________
Creator of COD-Life (Half COD, Half Life)
https://forums.alliedmods.net/showthread.php?t=261162
twitter: @D_Moder_61216
D.Moder is offline
friagram
Veteran Member
Join Date: Sep 2012
Location: Silicon Valley
Old 03-29-2015 , 07:29   Re: CSS open php page with parameters, in motd?
Reply With Quote #2

You need a webserver running php to proccess the page. Otherwise serving them text will render as text.
__________________
Profile - Plugins
Add me on steam if you are seeking sp/map/model commissions.

Last edited by friagram; 03-29-2015 at 07:29.
friagram is offline
KissLick
Veteran Member
Join Date: Nov 2012
Location: void
Old 03-29-2015 , 07:34   Re: CSS open php page with parameters, in motd?
Reply With Quote #3

To show some php file, you must run web server + php extension.
And ofc you cannot use your php file like a common file on game server, you must access that file through web server, so something like this http://www.example.com/myfile.php?somevariables

solution:
1) get some hosting (free or not, doesn't matter)
2) start web server on your machine (if you can)
KissLick is offline
D.Moder
I uploaded 2 great gameplay plugins here
Join Date: Sep 2009
Location: Sin city
Old 03-29-2015 , 08:44   Re: CSS open php page with parameters, in motd?
Reply With Quote #4

How about just creating a template html file, and load the file and replace some tags,
Like:
PHP Code:
<a>__PLAYER_NAME__ is the most badass player<a
And then just replace that string, then show it in motd?
Possible?
__________________
Creator of COD-Life (Half COD, Half Life)
https://forums.alliedmods.net/showthread.php?t=261162
twitter: @D_Moder_61216
D.Moder is offline
Otokiru
Senior Member
Join Date: Apr 2012
Old 03-30-2015 , 02:01   Re: CSS open php page with parameters, in motd?
Reply With Quote #5

you dont need php just to get query strings, u can just use javascript to retrieve query strings... like this
Otokiru is offline
D.Moder
I uploaded 2 great gameplay plugins here
Join Date: Sep 2009
Location: Sin city
Old 03-30-2015 , 03:19   Re: CSS open php page with parameters, in motd?
Reply With Quote #6

So motd pages support javascript?
__________________
Creator of COD-Life (Half COD, Half Life)
https://forums.alliedmods.net/showthread.php?t=261162
twitter: @D_Moder_61216
D.Moder is offline
friagram
Veteran Member
Join Date: Sep 2012
Location: Silicon Valley
Old 03-30-2015 , 06:22   Re: CSS open php page with parameters, in motd?
Reply With Quote #7

The steam browser supports most recent webkit/html5 things. Javascript works just fine. If you want to do any actual work with sqlserver or other such backends, you'll need to use a proper webserver though. There is no real disadvantage using a webserver... Even the motd panel supports proper caching. The only reason not to use a webserver is if you don't have one (you should have one for fastdl anyway). If you host multiple servers though, it makes it much easier to use a webserver and run everything through sql.
__________________
Profile - Plugins
Add me on steam if you are seeking sp/map/model commissions.
friagram 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 21:16.


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