I have a some.php with some php processing which also has:
<form action="" method="post">
<input type="text" name="name" value="bleh" />
<input type="submit" name="submit" value="submit" />
</form>
I also have other.php with some jquery script:
<h1>form goes here</h1>
<script>
$("h1").replaceWith(" <?php include ('some.php'); ?> ");
</script>
The thing is... the replaceWith function is not working because apparently the include is replaced with the form with its spaces and line breaks which has in the some.php file. I tried trim before the include but it did not work.
How can I solve it if I want to keep the form in some.php with that format and line breaks (as opposed to making it one-liner)?