On Friday, April 12, 2002, at 08:23 AM, John P. Donaldson wrote:
> I have a form processor that displays a confirmation
> screen showing the submitted form values to the user
> after they submit the form. This confirmation
> screen's contents are generated by the script itself.
> However, I'd like to be able to redirect the results
> to any pre-existing webpage. For example, if the form
> had a field named "Name," I'd like to have the value
> of that displayed in an webpage after they submit it.
> I tried doing this by including the field name $Name
> in the webpage, having the form processor read this
> webpage in using fread, then printing it out from the
> script, but the page renders without the value of
> $Name. How can I do this?
Sounds like you want to do a str_replace(). The template system I use
works in this fashion -- I have a template HTML page, with certain
keywords of the form {{{NAVIGATION}}}, {{{STYLESHEET}}}, {{{FOOTER}}}},
etc. I have a class that I wrote which simply takes the values of the
variables in my page and swaps them in for the appropriate keyword --
thus, if my nav column was contained by a variable called
$navigation_column, then my class would do something like:
$template_page = "./includes/site_template.inc";
str_replace("{{{NAVIGATION}}}", $navigation_column, $template_page);
This is oversimplified and wouldn't really work (you need to read the
template page into a file handle, etc) but demonstrates the theory.
Erik
----
Erik Price
Web Developer Temp
Media Lab, H.H. Brown
[EMAIL PROTECTED]
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php