PHP Sessions and WebHelp

This forum is for all Flare issues related to the HTML5, WebHelp, WebHelp Plus, and Adobe Air Targets
Post Reply
Fiscal
Propeller Head
Posts: 98
Joined: Mon Jul 12, 2010 6:55 am

PHP Sessions and WebHelp

Post by Fiscal »

Ok, so i have these demos that are user guides to proprietary software that is controlled in house (being remade in mimic). I want to host these online on our website.

The way that i want to show these is actually in a webhelp window. So that i can have the TOC for all of the demos to the left, with just the demo on the right.

The only way to access these demos will be through a sessions controlled pages, so i would like to have the help file check for a session as well.

I know where and how to add my session check code to the default.htm file. But i also know that having the php code in that file requires me rename it to "default.php" or "default.html.php" or "default.php.htm".

When i rename the default.htm file the webhelp no longer works.

I have read the other post and it didn't say anything about changing the file name so i assumed this would be a different case.

Thanks,

Andrew
RamonS
Senior Propellus Maximus
Posts: 4293
Joined: Thu Feb 02, 2006 9:29 am
Location: The Electric City

Re: PHP Sessions and WebHelp

Post by RamonS »

There is another option. You can configure the web server to pull .htm and .html files through the PHP interpreter as well. You'll have a little bit of lower performance, but I think that for your case that is negligible. That way you can keep the file name as is and still embed PHP code.
All you'd need to do is add/edit this line in the httpd.conf:

Code: Select all

AddType application/x-httpd-php .php .htm .html
LTinker68
Master Propellus Maximus
Posts: 7247
Joined: Thu Feb 16, 2006 9:38 pm

Re: PHP Sessions and WebHelp

Post by LTinker68 »

Fiscal wrote:When i rename the default.htm file the webhelp no longer works.
Renaming it manually using Windows Explorer, or you changed the file name in the target?
Image

Lisa
Eagles may soar, but weasels aren't sucked into jet engines.
Warning! Loose nut behind the keyboard.
Fiscal
Propeller Head
Posts: 98
Joined: Mon Jul 12, 2010 6:55 am

Re: PHP Sessions and WebHelp

Post by Fiscal »

LTinker68 wrote:
Fiscal wrote:When i rename the default.htm file the webhelp no longer works.
Renaming it manually using Windows Explorer, or you changed the file name in the target?
I was renaming it in the Windows Explorer. I am using Apache to do all of this testing wise.


RamonS wrote:There is another option. You can configure the web server to pull .htm and .html files through the PHP interpreter as well. You'll have a little bit of lower performance, but I think that for your case that is negligible. That way you can keep the file name as is and still embed PHP code.
All you'd need to do is add/edit this line in the httpd.conf:

Code: Select all

AddType application/x-httpd-php .php .htm .html
I am not really familiar with the setup file for servers. Is there anywhere specific that this code should be placed?
LTinker68
Master Propellus Maximus
Posts: 7247
Joined: Thu Feb 16, 2006 9:38 pm

Re: PHP Sessions and WebHelp

Post by LTinker68 »

Fiscal wrote:
LTinker68 wrote:
Fiscal wrote:When i rename the default.htm file the webhelp no longer works.
Renaming it manually using Windows Explorer, or you changed the file name in the target?
I was renaming it in the Windows Explorer. I am using Apache to do all of this testing wise.
You could try setting the file name to default.php in the target and rebuilding and see if that helps. If it doesn't, then you can reset it to default.htm and follow up with RamonS's suggestion.
Image

Lisa
Eagles may soar, but weasels aren't sucked into jet engines.
Warning! Loose nut behind the keyboard.
RamonS
Senior Propellus Maximus
Posts: 4293
Joined: Thu Feb 02, 2006 9:29 am
Location: The Electric City

Re: PHP Sessions and WebHelp

Post by RamonS »

Fiscal wrote:
RamonS wrote:There is another option. You can configure the web server to pull .htm and .html files through the PHP interpreter as well. You'll have a little bit of lower performance, but I think that for your case that is negligible. That way you can keep the file name as is and still embed PHP code.
All you'd need to do is add/edit this line in the httpd.conf:

Code: Select all

AddType application/x-httpd-php .php .htm .html
I am not really familiar with the setup file for servers. Is there anywhere specific that this code should be placed?
Within the config file you already should have a line that looks like this:

Code: Select all

AddType application/x-httpd-php .php
because otherwise Apache wouldn't know that a .php file is to be sent to the PHP interpreter. You'd need to edit that line and restart the server process.
Fiscal
Propeller Head
Posts: 98
Joined: Mon Jul 12, 2010 6:55 am

Re: PHP Sessions and WebHelp

Post by Fiscal »

LTinker68 wrote:
Fiscal wrote:
I was renaming it in the Windows Explorer. I am using Apache to do all of this testing wise.
You could try setting the file name to default.php in the target and rebuilding and see if that helps. If it doesn't, then you can reset it to default.htm and follow up with RamonS's suggestion.
I have looked and i'm not quiet sure where you are talking about that i can change the file name.

If you are talking about : In the general tab, the label "Output File", (I have set this to "default.php", and after the project builds the file is still named "Default.htm")
LTinker68
Master Propellus Maximus
Posts: 7247
Joined: Thu Feb 16, 2006 9:38 pm

Re: PHP Sessions and WebHelp

Post by LTinker68 »

Hmmm, I thought you could override that, but I might be confusing it with another field in the target. That field is for changing the file extension of all the topic files, and that's probably not what you want. I suggest you look into RamonS's solution, then.
Image

Lisa
Eagles may soar, but weasels aren't sucked into jet engines.
Warning! Loose nut behind the keyboard.
Post Reply