Posted by Toby Inkster on 01/31/46 11:44
Neredbojias wrote:
> "wes" <wesley@ispace.co.za> declaimed:
>
>> How do you dynamically create a web page. If i ask the user to enter a
>> name, then the html document must be created with the name that the
>> user entered as the name of the document.
>
> Do you mean the file name of the document or title of the document? If the
> latter, a little php makes it a cinch.
The former ain't much harder:
====================================================
<?php
# call this file "foo.php".
if (strlen($_SERVER['PATH_INFO']))
{
print "This is {$_SERVER['PATH_INFO']}";
exit;
}
elseif (strlen($_GET['name']))
{
header("Location: foo.php/{$_GET['name']}");
exit;
}
?>
<form action="foo.php" method="get">
<input name="name">
<input type="submit">
</form>
====================================================
and then visit foo.php.
--
Toby A Inkster BSc (Hons) ARCS
Contact Me ~ http://tobyinkster.co.uk/contact
[Back to original message]
|