AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   GET Sockets (https://forums.alliedmods.net/showthread.php?t=208725)

K1d0x 02-17-2013 01:00

GET Sockets
 
Hello to all, i have a problem, i try to sent a text with separator (space)

Quote:

GET xxx.org/live.php?p=not&v=10.1 table&f=dotnet HTTP/1.1^r^nHost:%s^r^nConnection: close^r^n^r^n
value of v can't be sent to address if contains spaces, exist an char like ^"context 2 or 3^" for sent full line? or is not possible?

PS: live.php saves informations from plugin in a database (MYSQL)
Thanks !

fysiks 02-17-2013 03:56

Re: GET Sockets
 
You have to encode it. A space is %20

K1d0x 02-17-2013 13:27

Re: GET Sockets
 
Does't work with %20 apper an error in console incorrectly format

Error:
String Formatted icorrectly - parameter 8 <total7>
Parameter error line 66 (where is get with %20 (space))

fysiks 02-17-2013 14:58

Re: GET Sockets
 
To get a % symbol to be put into the final string with any formatting function, you need to escape it: "%%".

K1d0x 02-17-2013 16:25

Re: GET Sockets
 
Like this?
Quote:

GET xxx.org/live.php?p=not&v=10.1%20%table&f=dotnet HTTP/1.1^r^nHost:%s^r^nConnection: close^r^n^r^n

fysiks 02-17-2013 16:51

Re: GET Sockets
 
I said "%%" not "%SomethingHere%". You would have already know that it wouldn't work if you actually tried it.

jimaway 02-17-2013 19:06

Re: GET Sockets
 
isnt the default escape char ^ ?

YamiKaitou 02-17-2013 20:15

Re: GET Sockets
 
Quote:

Originally Posted by jimaway (Post 1896493)
isnt the default escape char ^ ?

Yes, but % is not being used as an escape character, rather a format parameter. %% must be used so format can detect that it is the literal % character instead of a format parameter.

K1d0x 02-17-2013 21:06

Re: GET Sockets
 
Does't work, in page appear 10.1%table but in .sma is v=10.1%%table

YamiKaitou 02-17-2013 21:08

Re: GET Sockets
 
Print the message to your console and then show it to us


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

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