Jump to content

How to pass a value from php to html?


shishirkotkar

Recommended Posts

I have a html file - Home.html

I have another php file - test.php

 

I am calling test.php on click of a submit button from Home.php

 

in test.php i am processing the input from Home.php

 

I want to send the processed results back to Home.php and present it as values in dropdown list.

 

How do i do that?

 

Link to comment
https://forums.phpfreaks.com/topic/198848-how-to-pass-a-value-from-php-to-html/
Share on other sites

There are two possible scenarios, don't know which you're interested in

First.

1. on home.php a form is being submitted to test.php

2. test.php does it's job, and saves processed data to session, then redirects to home.php

3. home.php reads data from session and uses it to echo dropdown list values

 

Second

1. home.php sends AJAX request to test.php

2. test.php does it's job and sends AJAX reply to home.php

3. home.php uses JavaScript to modify dropdown list accordingly.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.