Re: php form and ssi



Henrik Carlqvist <Henrik.Carlqvist@xxxxxxxxxxxx> wrote:
http://es2.php.net/virtual

Thanks for that tip! Maybe I can have action=\"$_SERVER["PHP_SELF"]\" and
put $_SERVER["REQUEST_URI"] in a hiden input variable.

I did some testing with the following:

the_form.php:
-8<-------------------------------------------
<?php

if(isset($_POST["The_Button"]))
{
printf("The button was pressed\n");
virtual($_POST["my_parent"]);
}
else
{
printf("<form method=\"post\" action=\"%s\">\n", $_SERVER["PHP_SELF"]);
printf("<input type=\"hidden\" name=\"my_parent\" value=\"%s\">\n",
$_SERVER["REQUEST_URI"]);

?>

<input type="Submit" name="The_Button" value="Press me">
</form>

<?php
}
?>
-8<-------------------------------------------

the_page.shtml:
-8<-------------------------------------------
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>SSI test</title>
</head>

<body>
<h1>SSI test</h1>
This page contains all the goodies we want to display close to the form.<hr>

<!--#include virtual="the_form.php"-->

</body>
</html>
-8<-------------------------------------------

When pointing the browser directly to the_form.php I end up with a
the_form.php calling itself recursively far to much. That could be
expected, obviously the "The_Button" variable is passed through the
virtual call to the php script in every step.

But this also happens when I point the browser to the_page.shtml.

the_form.php makes a virtual call to the_page.shtml which makes a virtual
call to the_form.php which makes a virtual call to the_page.shtml and so
on.

Obviously the_page.shtml was able to pass the form variable on to
the_form.php through the virtual call. It seems as if I am close to the
solution even though the current method isn't usable.

regards Henrik
--
The address in the header is only to prevent spam. My real address is:
hc3(at)poolhem.se Examples of addresses which go to spammers:
root@localhost postmaster@localhost

.


Quantcast