Login
Username:

Password:

Remember me



Lost Password?

Register now!

Sections

Who's Online
33 user(s) are online (12 user(s) are browsing Forums)

Members: 1
Guests: 32

Rigo, more...

Support us!

Recent OS4 Files
OS4Depot.net

Report message:*
 

Re: Shorten or Compress a String/URL

Subject: Re: Shorten or Compress a String/URL
by djrikki on 2015/11/7 0:20:46

Thanks all, objective achieved, yes I went the POST route, updated my PHP script to $_POST instead of $_GET, plus the Hollywood code below, if its any use to anyone else, go ahead and modify.

OpenConnection(1, "example.com", 80)

Local trans = SendData(1, "POST http://www.example.com/script.php HTTP/1.0\nContent-Type: application/x-www-form-urlencoded\nContent-Length: " .. 6 + 10 + StrLen(var1$) + StrLen(var2$) .. "\n\nvar1=" ..var1$ .. "&var2=" .. var2$)

Local gotline$, count, done
/* SKIP HTTP HEADER */
gotline$, count, done = ReceiveData(1, #RECEIVELINE)
While gotline$ <> "Content-Type: text/html"
gotline$, count, done = ReceiveData(1, #RECEIVELINE)
Wend
gotline$, count, done = ReceiveData(1, #RECEIVELINE)
gotline$, count, done = ReceiveData(1, #RECEIVELINE)
/* SKIP HTTP HEADER */

gotline$, count, done = ReceiveData(1, #RECEIVELINE)

While gotline$ <> ""
/* loop through lines */
gotline$, count, done = ReceiveData(1, #RECEIVELINE)
Wend

CloseConnection(1)

Powered by XOOPS 2.0 © 2001-2016 The XOOPS Project