Author Topic: Netwebget$  (Read 224 times)

Offline MrPlow

  • Prof. Inline
  • *****
  • Posts: 1535
    • View Profile
Netwebget$
« on: 2019-Oct-31 »
For those that might experience this issue in v16

I notice strange block chars appearing in my highscore tables at the start and end of a netwebget$.
It must be unicode issue or something...

Below is my fix for the issue..

Code: GLBasic [Select]
scoretable$=NETWEBGET$("www.domain.com","/scoresxxxxxx.php",80,512,4000)

// cleanup string
LOCAL mstr$
FOR x = 1 TO LEN(scoretable$)
mstr$=MID$(scoretable$,x,1)
  IF ASC(mstr$)<32 OR ASC(mstr$)>96
      IF mstr$="|" THEN newscore$=newscore$+mstr$
  ELSE
      newscore$=newscore$+mstr$
  ENDIF
NEXT
 



« Last Edit: 2019-Oct-31 by MrPlow »
Comp:
Speccy-48k, Speccy-128k, Amigas, PCs

Offline erico

  • Community Developer
  • Prof. Inline
  • ******
  • Posts: 4228
    • View Profile
    • Portfolio
Re: Netwebget$
« Reply #1 on: 2019-Nov-01 »
Nice! That is something I should try to add to my games, but I suck with everything netwise.

Offline Moru

  • Administrator
  • Prof. Inline
  • *******
  • Posts: 1779
    • View Profile
    • Homepage
Re: Netwebget$
« Reply #2 on: 2019-Nov-01 »
Make sure you clean up the data on the server side also, or you will get funny people sending garbage to your server with javascript :-)