Re: php form and ssi



Henrik Carlqvist wrote:
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 same functionality - and more - can easily be added by using any of the web programming languages. And most sites do use some. Without it, you have only static text with no way to get input, etc.

How many sites can you point me to which are using no high level languages? How successful are they?

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


And they use NO high level languages? Must not be very successful.

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.


There are a huge number of reasons why they use IIS. And there are millions of sites out there using it. No, they can't (or won't) change to Apache. Maybe they're accessing SQL Server, for instance. Maybe they're accessing LDAP servers. A whole bunch of reasons. And the system they have is working fine.

And yes, in many cases, it would require rewriting the entire site - not just a few pages.

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<-----------------------------------------------


It's very easy. Code the entire page as a PHP page - as people have told you. Don't even use SSI. It works fine.

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.


When releasing an open source product, you should be testing on all major platforms.

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...


Gee, maybe you should have them change to Linux/Apache. After all, it shouldn't require any rewriting of their site.

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?


You need PHP on the site, anyway, to use your page. And you'll find some other technologies (i.e. VBScript) do not integrate well with PHP. You can do it - but it's not real easy.

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.


Only put out your part of the info. Leave the rest to the user.

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.


No problem. You'll just ignore the rest of the world instead, for your two customers.

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

You always have to rewrite pages when including other projects.

But I am not going to get into a whole lesson on templating, etc. It's way too much for a newsgroup.

What you need to do is concentrate on outputting your data, and don't format anything outside of your stuff. Then make it easy for the client to include in their pages.

Chances are they are going to need to create one or more pages, anyway. And if they can't do that, they won't be able to include your package anyway. And you're going to be spending all of your time providing free support to these people.

But that's fine with me. I'm not the one losing billable hours.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@xxxxxxxxxxxxx
==================
.


Quantcast