Re: php form and ssi



Jerry Stuckle <jstucklex@xxxxxxxxxxxxx> wrote:
That's two sites more than I know who use SSI for PHP. Why do they need
to use SSI, anyway?

IMHO SSI is a very convenient way to add extra functionality to an
existing web. Of course no site "needs" to use SSI. It would be fully
possible to reencode an entire site using another technology.

The two current sites both existed long before phpoi existed and they were
built using the current technology with SSI.

You'll lose a lot more customers by ruling out IIS users than those
using SSI. The latter can change very easily

Why would any site need to use IIS, anyway? Of course it would be fully
possible to change web server to apache. Such a change would not need any
reencoding and would in most cases be even easier than reencoding the
site from SSI to php.

But if you care su much for IIS and don't care at all about SSI, what
about the following solution:

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

/* This if and else is to pass form data from .shtml to .php on apache */
if(isset($_POST["my_parent"]))
{
$my_parent = $_POST["my_parent"];
unset($_POST["my_parent"]);
if (function_exists(virtual))
{
virtual($my_parent);
return;
}
}
else if(!isset($my_parent))
{
$my_parent = $_SERVER["REQUEST_URI"];
}


/* Here we take care of the data from the form */
if(isset($_POST["The_Button"]))
{
printf("The button was pressed\n");
}

/* This is the form */
printf("<form method=\"post\" action=\"%s\">\n", $_SERVER["PHP_SELF"]);
printf("<input type=\"hidden\" name=\"my_parent\" value=\"%s\">\n",
$my_parent);

?>

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

I have no IIS server to test this on so I can't say for sure that it
works, but the intention is to at least be backwords compatible with IIS
even though IIS users will lose the SSI functionality. I would really
prefer a solution where SSI also worked with IIS though.

You can't have everything.

Ok, if so I will simply have to sacrifice SSI functionality on IIS.

Ouch, I just found that one of my current users is using phpoi on IIS with
SSI... So at least one of my users will find it hard to get forms working
with SSI even with the solution above...

First of all, I wouldn't have an entire site in flash. I would use it
where appropriate, however. And if your page "looks completely
different", no, I wouldn't include it. But that's YOUR problem - you
should be flexible enough that I can included it in the rest of my site
and transparently. I can do that with a lot of other packages. Why not
yours?

So how do you "include other packages transparently" without the use of
SSI? Yes, you can do include("the_file.php") if your current site is built
with php. But what if your site is built with another technology?

And what about MY problem of making my generated pages look exactly like
the other pages on an unknown future site? I can see no other solution to
that problem than "transparently including" the package. To me
"transparently including" means no requirement of reencoding the current
page to be completely written in php. As I see it the quick and easy way
for "transparently including" equals SSI.

Then don't worry about .shtml and don't use virtual(). Use what
everyone else uses.

Sorry, to sacrifice all my current users because "everyone else is using
php on IIS" does not sound like a real world solution to me.

And your project will never become popular. The vast majority of your
potential users will look at that and run the other way - quickly.

And soon, someone else will come out with a project which really meets
the users needs, and they will become the popular one. Yours will be
all but forgotten.

But that's ok with me - it's not my project.

Then please let me know how to "include packages transparently" without a
requirement of changing web server or reencoding current pages.

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