how to call a PHP script?

Just starting out? Need help? Post your questions and find answers here.
Marcos.exe
Posts: 3
Joined: Mon Nov 08, 2021 2:39 pm

how to call a PHP script?

Post 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!
percy_b
Posts: 6
Joined: Fri Oct 16, 2020 4:09 pm

Re: how to call a PHP script?

Post 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())
loulou2522
Posts: 49
Joined: Wed Mar 18, 2015 5:52 am

Re: how to call a PHP script?

Post 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
User avatar
William Van Hoecke
Posts: 38
Joined: Tue Oct 22, 2019 12:09 pm

Re: how to call a PHP script?

Post 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).
Post Reply