Im going to have to explain a little better, and I hope I dont cause confusion. The lack of single quotes would have probably worked if this was what I was doing, which is what in essence I thought I was, but I was wrong. Here's what I'm doing. I've got these files, that write to a txt file...so I've got the form which is called whatitis.php, and the file it refers to in the action of the form property called whatitis2.php, and the whatitis.txt.
I wanted to put variables in there, so that I didnt have to change the action all the time, and the txt all the time when I made a intro.php, and a intro2.php, a header.php, and a header2.php, so on and so forth. So I had some help with that. and the whatitis.php ended up looking like so.
<HTML>
<HEAD>
<TITLE></TITLE>
</HEAD>
<body>
<?php
//the txt files cannot contain numbers, ie 1header.txt does not work, so the name of this file can't have a number in it.
//requires var.php which has the variable Mypath in it
require("var.php");
//echos variable mypath from var.php to bring it in to the file
echo $Mypath;
//$_server['php_self'] calls the file path, and the file....the "([^\\]+).php" gets rid of all that garbage, and just gives it the files name.
$script = eregi("([^\\\/\/]+)\.php",$_SERVER['PHP_SELF'],$regs);
//asigns the name of this php file with the .txt extension to the $txt variable
$txt = $regs[1].'.txt';
//assigns the path to the txt file to $fullpath calling the following variables
$fullPath = $MyPath . $txt;
//asigns the actual file from the $fullpath to the $display1 variable
$display1 = file($fullPath);
$displaytext1 = implode("", $display1);
//strips /'s from don't and others for what's displayed in the textarea
$displaytext1 = stripslashes($displaytext1);
$script = eregi("([^\\\/\/]+)\.php",$_SERVER['PHP_SELF'],$regs);
//asigns a .php extension to the name of this file, and puts it in the variable $action
$action = $regs[1].'2.php';
//echo's the form...for some reason that's needed in order to use the $action variable
echo "<form action=\"$action\" method=\"post\" target=\"main\">";
?>
<CENTER>
<P ALIGN=CENTER>
<TABLE WIDTH="600" bordercolor="black" CELLPADDING="0" CELLSPACING="0" BORDER="0">
<TR>
<TD style="border-bottom-style: solid; border-bottom-width:1" style="border-right-style: solid; border-right-width: 1" style="border-top-style: solid; border-top-width:1" style="border-left-style: solid; border-left-width: 1" WIDTH="100%" BGCOLOR="#F1F1F1" VALIGN=center> <b>Whatitis:</b> A short sentence that explains what's below.</TD>
</TR>
<TR>
<TD WIDTH="100%" VALIGN=TOP><p>
<textarea name="whatitis" cols="75" rows="1" wrap><?php echo $displaytext1; ?></textarea>
</p></TD>
</TR>
</TABLE>
<p>
<input type="submit" name="Submit" value="Save Changes">
</p>
</form>
</body></html>
now I want to replace the
<b>Whatitis:</b>
in the title area with a variable that would be on my var.php file in the same directory as the whatitis.php. So, I thought I'd just do like so....and replace the
<b>Whatitis:</b>
with a
<?php echo $thetitle; ?>
and add a
require("var.php");
$thetitle = '$'.$regs[1].'title';
at the top, in the php section. all that does is display $whatitistitle in the title area of my form. Any suggestions?