Page 1 of 1

how to call a PHP script?

Posted: Thu Nov 25, 2021 2:33 pm
by Marcos.exe
I already have a server with a database, and I know some PHP.
I was already doing some things with HTML, and I started to learn JS.
But as the basic language, and it makes building a page a lot easier, so I'm thinking about leaving JS aside for now.
But, the problem is that I don't know how to run a PHP script without the <form>.
It seems to me that HTTPSRequest does this, but I still can't figure out how.
Can someone help me?

Translated by google translator.
My language is Brazilian Portuguese. Sorry if I wasn't clear.
Anything, I repeat the question in another way.
Thanks in advance!

Re: how to call a PHP script?

Posted: Sun Dec 05, 2021 4:00 am
by percy_b
Hi,
Hopefully, someone can correct me if I'm wrong on this, but I believe what you need is as follows:

Code: Select all

  Procedure HttpGetEvent(Success, Result$, UserData)
    If Success
      Debug Result$
    Else
      Debug "HTTPRequest(): Error"
    EndIf
  EndProcedure
  
  ; Get the content of this file, and display it in the debug window
  ;
  HTTPRequest(#PB_HTTP_Post, "my_program.php", "my_param=my_value", @HttpGetEvent())

Re: how to call a PHP script?

Posted: Sun Dec 05, 2021 2:16 pm
by loulou2522
Yes then formular is good, but take care bexause with post request and according to Browser the length of the request including the url is limited. I don't know the exact limit but it vary from 2048 ko to 4096 ko

Re: how to call a PHP script?

Posted: Thu Dec 09, 2021 10:18 pm
by William Van Hoecke
loulou2522 wrote: Sun Dec 05, 2021 2:16 pm Yes then formular is good, but take care bexause with post request and according to Browser the length of the request including the url is limited. I don't know the exact limit but it vary from 2048 ko to 4096 ko
with Httprequest of type '#PB_HTTP_Post' key=value pair variables are embedded (just like in a <FORM> </FORM> html page. There is no limit (I think)
with Httprequest of type '#PB_HTTP_Get' key=value pair variables are appended to the URL and are limited to 2K bytes (and very visible).