Hi all.
I used to use php pretty regularly in my spare time, but that was years ago and it seems like I've lost all my pertinent knowledge, so I'm asking for some help here. Please. Pretty please.
I'm trying to make a php script that will speed up web page creation. The first page has several forms that pass data to the php script (name of the page, defining links, etc). I've remembered how to force php to insert HTML to a file, my current problem is that I need to insert some variables into the middle of the HTML repeatedly. ie: the file name occurs several times over the scope of the final webpage. I can't remember how to do this.
Do I end the php and start again every time I need to call a previously used variable? I'm lost. Here's my code:
<?php
$suite = $POST['suite'] ;
$quad = $POST['quad'] ;
$floor = $POST['floor'] ;
$unit1 = $POST['unit1'] ;
$unit2 = $POST['unit2'] ;
$unit3 = $POST['unit3'] ;
$unit4 = $POST['unit4'] ;
$unit5 = $POST['unit5'] ;
$filename = "$suite.html";
$fh = fopen($filename, 'w') or die("can't open file");
$input = '
<html>
<head>
<title>Paradise Village Office Park</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" >
<link rel="stylesheet" type="text/css" href="styles.css" >
</head>
<body>
<div id="doc" class="yui-t6">
<div id="hd">
<div id="header"><h1>
Paradise Village Office Park
<br/>
Plaza East Quadrant - Suite ';
//Here is where I want to include the '$suite' variable again before sending more html to the page
fwrite($fh, $input);
fclose($fh);
?>