PHP file in Web Viewer

Hello Coders,
I hope everyone is doing well.

I have a very unique requirement this time.

I have a PHP file that has an HTML form. On Form Submit PHP code triggers and it generates some variables. After those variables are set we need to navigate to a given URL from the same PHP file for the next processing.

Since the file type is .php I am not sure how can I use it to work using the web viewer because when I attach it via assets and use block go to URL, it shows the actual code of the PHP but generally in any browser only HTML piece will be visible.

As long as you feed WebViewer with HTML, it is good to go. Serving PHP files requires a server which sends the HTML generated by running the PHP file.

PHP runs on server.
you can make api on server and onSubmit post data to api via html

1 Like

Yeah that’s what I did first. I have set all the necessary variables using the php hosted on my server but when i am navigating to url via web view, it says nothing is set and that’s correct because php and web view are on two different sides.

Why I’m keen on opening the url using we view is because user needs to pass some details using the form present at that url.

just a suggestion: what if the .html form was made in Kodular and you sent the parameters via post to the server where is the PHP page that uses its variables?

1 Like

Since it’s a third party service, let me check with them if they have simple api where we can create our own UI and pass necessary parameters.