I want to perform an jquery request to php and then I want php to return a value that is an html which is going to be attached on the original page.
The code for jquery is something like this:
$.get("phpfile.php",{'variable':variable},function(response){
$("paragraph_to_display_response").html(response);
I want php to return as response an html file which is actually an upload file form. Can I do that?Php code should look something like this:
$variable=$_GET['variable'];
//perform some checks with variable
echo ???//How can I echo an html file?
Thank you!
Your HTML should have a container for the Response f.E:
Your javascript should look like this:
You also have to trigger the request above by adding a click event to some element in your HTML.
Your PHP should simply just return the HTML you need.
phpfile.php