I have a form in a php file:
<form method="post" id="form" action="<?php bloginfo('url'); ?>/results/">
<input type="text" name="height" placeholder="Enter height">
<input type="text" name="weight" placeholder="Enter weight">
<input type="submit" id="export">
</form>
That generates a random url when clicked (like mydomain.com/gLd3a) using jQuery
:
$("#export").click(function(){
url = $("#form").attr("action");
url = url.replace("/results/","/<?php echo $randomString ?>/");
$("#form").attr("action", url).submit();
});
But I'm trying to automatically make the generated url show content from a php template (results.php).
I tried to do that using the action="<?php bloginfo('url'); ?>/results/"
but /results/
is being replaced by the random string, therefore has no effect.
Is there any other way to assign that php to the generated url please?