Beste mensen
Ik heb een scriptje. Het enige wat het doet is een nieuwe php pagina aanmaken met naam bv test1.php. Dit werk perfect het enige wat ik niet kan is er code in meegeven--- de code dat dan in test1.php zou moeten komen
Ik had het geprobeerd me $somecontent = " "; Tussen de “” dan de php code. Dit werkt niet.
Kan er iemand mij helpen ?
<?php
$html_message ="dit script werkt maar ik wil hier een andere php pagina in weergeven";
?>
<?php
$filename = '1test.php';
$somecontent = "$html_message";
$fh = fopen("1test.php", "w");
if($fh==false)
die("unable to create file");
// Let's make sure the file exists and is writable first.
if (is_writable($filename)) {
// In our example we're opening $filename in append mode.
// The file pointer is at the bottom of the file hence
// that's where $somecontent will go when we fwrite() it.
if (!$handle = fopen($filename, 'a')) {
echo "Cannot open file ($filename)";
exit;
}
//test3 lijn
// Write $somecontent to our opened file.
if (fwrite($handle, $somecontent) === FALSE) {
echo "Cannot write to file ($filename)";
exit;
}
echo "ok, ik kan schrijven ($somecontent) to file ($filename) Ik zou graag dit laten werken als ze dan pagina1test openen alle code erin staat";
fclose($handle);
} else {
echo "The file $filename is not writable";
}
?>
3.289 views