Note that there are some explanatory texts on larger screens.

plurals
  1. POGenerating html from php file but leave out the form on the page?
    primarykey
    data
    text
    <p>I am using file_put_contents, ob_get_contents to generate a static html page from the entire php page. there is a HTML form on the PHP page which will be generated in the html as well.</p> <p>the form has an ID of myForm.</p> <p>what i need to do is to generate the HTML as it is but leave out the "myForm". basically I don't want the form in the newly created HTML page.</p> <p>Here is what i use to generate the html page from my PHP page:</p> <pre><code>&lt;?php if ((isset($_POST["music1"])) &amp;&amp; (isset($_POST["music2"]))) { file_put_contents($options[$_POST['music1']].'+'.'and'.'+'.$options[$_POST['music2']].'.html', ob_get_contents()); } // end buffering and displaying page ob_end_flush(); ?&gt; </code></pre> <p>is there anyway to target the "myForm" ID while the html page is being created and opt it out?</p> <p><strong>EDIT:</strong> this question is not duplicated as far as i can see. I am not asking "how to use simple html dom parser"! that's why i specifically provided the code that I am using which is ob_get_clean. I am not sure if i am missing something?</p> <p>EDIT:</p> <p>This is what I have now and it doesn't work:</p> <pre><code> &lt;?php if ((isset($_POST["music1"])) &amp;&amp; (isset($_POST["music2"]))) { $foo = ' &lt;style&gt; #myForm { display: none; } &lt;/style&gt; &lt;/header&gt;'; $finalHTML = str_replace('&lt;/header&gt;', $foo, $currentHTML);file_put_contents($options[$_POST['music1']].'+'.'and'.'+'.$options[$_POST['music2']].'.html', ob_get_contents()); } // end buffering and displaying page ob_end_flush(); ?&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload