#1

Hi,

How with http for example safe message? like write player /pm [name] [message]

I want to safe message, send to php file, what message and what name, in php file get and write into mysql file.
Reply
#2

up topic

I tried something but there is problem when sending to php, when text is with & or +, not all symbols are reading i gues i need decode something, i read need to send decoded querie, but how in sa-mp format http, to make decode or something, that in php i could retrieve any string?
Reply
#3

Correct me if I'm wrong here but wouldn't it much more efficient to store what you want into the mysql database from the script directly instead of sending the string to a php file which connects to a SQL database and stores the string?
Reply
#4

Honestly I don't mean any offense but you post these kind of threads every day or so. You should learn the basics and then try to do what you want to do. This is all basic php and mysql.

4D1L mentioned what you should do.
Reply
#5

Because that query not impose server, like imaginage playing 500 players, and you are saving /pm, there can by 20 sms/second or more, i have on 100 players issues, not of course just pm saving,money other things, queries too much they don't have time to complete..
Reply
#6

So.. Why do you save /pm in PHP? Why you don't write basically logs in a .txt or .log file ?
Reply
#7

But that file can by very huge
Reply
#8

ANOther question, how to connect to database in php file only one time? because if i always call to php file and always connect to database there will be a lot of connections..
Reply
#9

MySQL queries are also threaded, just like HTTP requests. This means it won't impact the server in terms of blocking the main thread.
Reply
#10

Quote:
Originally Posted by Dayrion
Посмотреть сообщение
So.. Why do you save /pm in PHP? Why you don't write basically logs in a .txt or .log file ?
/pm cannot be saved in PHP, what he wants to do is to send a HTTP request to a php file that basically inserts it into the database, rather than doing it in the script. I don't think this should be of too much workload on your server considering the fact that they are threaded (yeah, even though most queries are - you could always look whether or not your queries are efficient if you notice that they take a lot of time, in a lot of cases they are not.

I haven't really worked with the HTTP function and just searched it up now, but it does seem like it should be possible. Whether it's worth doing or not I don't know, you would also have to check if it's valid somehow - coming from the script (in case someone finds the page etc), but this is something I don't know too much about so I won't comment on this.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)