I am going to give this shit 1 last shot.
I would appreciate it if people stop giving me fuckin manual pages. I can't understand them if it hasn't become obvious by now.
I have so far been posting basic versions of what I am trying to do. To gain away any misunderstanding, I am gonna post my real code.
You guys seem to know whats going on. So I don't think it will be a strain for your to read (I thought this maybe before which is why I made it basic).
$fp = fopen('/opt/index.html', 'r+');
fwrite($fp, '<?php
session_start();
$id = "'.mysql_real_escape_string($_POST['id']).'";');
fclose ($fp);
This inserts into the following index.html:
testusr', 'testpw') or exit("SERVER ERROR");
mysql_select_db('testdb', $link);
$query = "SELECT * FROM products WHERE id = '$id'";
...
...
...
I am trying to make the outcome:
<?php
session_start();
$id = "21";
$link = mysql_connect('testusr', 'testpw') or exit("SERVER ERROR");
mysql_select_db('testdb', $link);
$query = "SELECT * FROM products WHERE id = '$id'";
...
...
...
Instead, I get:
<?php
session_start();
$id = "21";
testusr', 'testpw') or exit("SERVER ERROR");
mysql_select_db('testdb', $link);
$query = "SELECT * FROM products WHERE id = '$id'";
...
...
...
See how fwrite is eating into the code.
I need this to stop. This is what all of this is about.
So, I am trying to line break to get it going to the next line. But I can't! Its driving me nuts!