[Pro] Replacing the opening <html> tag...

Hi I’mm trying to integrate an Ecommercetemplates generic shopping cart into my site. They provide the following instructions:

At the very top of the page find the opening tag and replace that with

<?php session_cache_limiter('none'); session_start(); ob_start(); ?>

…making sure there are no spaces or line breaks before those lines at the top of the code.

You will probably want to add a Doctype to the top of each page so add the Doctype line so the page looks something like this:

<?php session_cache_limiter('none'); session_start(); ob_start(); ?>

I’m at a loss on how to do this. Is it even possible? Crow bar didn’t work.

Can anyone provide me with some direction?

Thanks.

Regards,

Roy


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

Have you tried adding that line

<?php session_cache_limiter('none'); session_start(); ob_start(); ?>

Using Page>Html markup and sticking it in the before slot?

D


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

On 21 Nov 2013, 10:56 pm, DeltaDave wrote:

Have you tried adding that line


Using Page>Html markup and sticking it in the before slot?

D

Thanks Dave,

Page>Html markup allows me to enter the code at the top of the page, but I can’t replace the opening tag.

I can edit the code once the file has been uploaded to the server using an Html Editor, but this means that I will have to do this every time I make and changes to the site in Freeway.

Thanks again,

Roy


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

but I can’t replace the opening tag.

Not sure that you have to - that is why I suggested doing it that way.

Have you tried it?

D


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

On 22 Nov 2013, 9:09 pm, DeltaDave wrote:

but I can’t replace the opening tag.

Not sure that you have to - that is why I suggested doing it that way.

Have you tried it?

D

Yes, but when published there appears to be a conflict accessing the data base. Ecommercetemplates technical support is trying to find the problem, they have indicated that there are some coding conflicts and have made some headway. The strategy is to modifying the code on the server files to get things working properly, then try to input that code into Freeway (if possible).

Thanks again.

Roy


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

So do you have a working version that has a hand coded header?

Can we see it?

D


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

On 22 Nov 2013, 9:26 pm, DeltaDave wrote:

So do you have a working version that has a hand coded header?

Can we see it?

D

Hi Dave,

Here’s the test site: http://test.advancedbarefoot.com/

You will notice that you will receive an Error Code when clicking on the Store and Buy Now links (which are linked to the Shopping Cart product pages. This is the page that the Ecommercetemplates’ people are currently working on. They had it partially working for a bit, but the Freeway formatting got messed up.

In the Footer the Affiliate Program links to a Cart page (http://test.advancedbarefoot.com/Store/affiliate.html) that contains the code that I inserted at the top of the page with Page>Html Markup. On this page there also a Html box located between the header and footer that contains PHP code.

These pages should be .php not .html (I used the PHP Dynamic Page Titles to no effect). I’ve also modified the file name to .php in the Inspector without success.

Thanks.

Roy


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

On 22 Nov 2013, 9:26 pm, DeltaDave wrote:

So do you have a working version that has a hand coded header?

Can we see it?

D

Here’s a Cart Product page with edited code: http://test.advancedbarefoot.com/Cart/products2.php

The layout is still not right and the Freeway Welcome header formatting is off.

Thanks,

Roy


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

Here’s a Cart Product page with edited code:

I cant see that you are getting anything different from doing it by adding that one line of php code in Page>Html markup in the before slot - but of course I cant see the php in yours.

D


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

On 23 Nov 2013, 12:04 am, DeltaDave wrote:

Here’s a Cart Product page with edited code:

I cant see that you are getting anything different from doing it by adding that one line of php code in Page>Html markup in the before slot - but of course I cant see the php in yours.

D

Hi Dave,

I finally have sorted out the issue.

Using Page>Html markup, when I add the the following code before the Html:

<?php session_cache_limiter('none'); session_start(); ob_start(); ?>

I end up with this when I view the coded page:

<?php session_cache_limiter('none'); session_start(); ob_start(); ?>

html>

However, I need to close the space and end up with this:

<?php session_cache_limiter('none'); session_start(); ob_start(); ?>

html>

Do you have any suggestions?

Thanks.

Best regards,

Roy


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

Yes, I have duplicated this here. I made certain not to add a carriage return after the closing ?> and I still got the extra line-break. However, any issue with PHP and line-breaks in the head of the page always comes down to whitespace being output before the <?php rather than after the ?>. It doesn’t actually matter, in my experience, if you have extra space after the closing delimiter – that won’t trigger the “headers already sent” error that PHP is so famous for.

Walter

On Nov 25, 2013, at 6:28 PM, Roy Gardiner wrote:

On 23 Nov 2013, 12:04 am, DeltaDave wrote:

Here’s a Cart Product page with edited code:

I cant see that you are getting anything different from doing it by adding that one line of php code in Page>Html markup in the before slot - but of course I cant see the php in yours.

D

Hi Dave,

I finally have sorted out the issue.

Using Page>Html markup, when I add the the following code before the Html:

<?php session_cache_limiter('none'); session_start(); ob_start(); ?>

I end up with this when I view the coded page:

<?php session_cache_limiter('none'); session_start(); ob_start(); ?>

html>

However, I need to close the space and end up with this:

<?php session_cache_limiter('none'); session_start(); ob_start(); ?>

html>

Do you have any suggestions?

Thanks.

Best regards,

Roy


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

David, Walt, thanks for your input.

I can sort of get things working but still have some glitches. I should note that I’m really green at this and have no previous experience dealing with code.

As noted in my previous posts in this thread, to use the EcommerceTemplates shopping cart I need to make the page .php and add this code to the top of the page <?php session_cache_limiter('none'); session_start(); ob_start(); ?> (the “Session Code”).

I then insert additional Cart related code into the various pages as may be required.

To get things to work properly, I need to change the File Name from .html to .php using the Inspector. I’ve also tried using the PHP Dynamic Page Titles Action on a page with a .html File Name but it doesn’t register with the Session Code.

If I simply insert the Session Code using Page>HTML Markup at the top of page with a .php File Name, this code is viewable in a browser, but the Page Name at the top of the browser window is simply .php (the Pages’ file name is missing). Not what I want for obvious reasons. I’m assuming that this is a result of the spacing issue previously noted.

Given Walt’s input, I tried adding an additional immediately after the Session Code and this seemed to do the trick. Now all of the page names show at the top of the browser window. Strangely, when I do this the Session Code is not visible when viewing in a browser, only the “new” code is visible.

The other problem that I am still having with this fix is with the landing page “index file”.

When I name the landing page (“index.html”) in the Inspector and upload the site to the server, if I type http://test.advancedbarefoot.com or http://www.test.advancedbarefoot.com into a browser I’m able access the landing page.

However, when I name the landing page (“index.php”) in the Inspector and upload the site to the server, if I type http://test.advancedbarefoot.com or http://www.test.advancedbarefoot.com into a browser I get the following message: ERROR 403 – Forbidden

However, if I type http://test.advancedbarefoot.com/index.php or http://www.test.advancedbarefoot.com/index.php into a browser I’m able to access the landing page.

I’ve tried adding after the Session Code but get the same results.

Any ideas on how I can access the landing page in a browser if a person simply types in the .com URLs (without /index/php) with the ,php page name?

Thanks.

Roy


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

Make certain you are changing the File, not the Title field in the Inspector. The File field is directly below the Title in the interface. It does not matter one bit what the Title is – the server does not care about that at all. The File must end in .php (so you can have other extensions before php, but the last segment must be php – lower-case, just like that). If you click into the File field, use Select All (Command + A) to make sure you actually select the entire text.

Walter

On Nov 26, 2013, at 11:39 AM, Roy Gardiner wrote:

If I simply insert the Session Code using Page>HTML Markup at the top of page with a .php File Name, this code is viewable in a browser, but the Page Name at the top of the browser window is simply .php (the Pages’ file name is missing). Not what I want for obvious reasons. I’m assuming that this is a result of the spacing issue previously noted.


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

Make sure that the File name is set to index.php instead of index.html or whatever else you may have set it to at the moment.

Walter

On Nov 26, 2013, at 11:39 AM, Roy Gardiner wrote:

Any ideas on how I can access the landing page in a browser if a person simply types in the .com URLs (without /index/php) with the ,php page name?


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

Don’t do this. Bad idea.

Walter

On Nov 26, 2013, at 11:39 AM, Roy Gardiner wrote:

I’ve tried adding after the Session Code but get the same results.


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

File a support ticket with your hosting provider, ask them to ensure that the DirectoryIndex attribute in your httpd.conf file is set to allow index.php as a default index. I’m frankly surprised that this isn’t already set.

Walter

On Nov 26, 2013, at 11:39 AM, Roy Gardiner wrote:

However, when I name the landing page (“index.php”) in the Inspector and upload the site to the server, if I type http://test.advancedbarefoot.com or http://www.test.advancedbarefoot.cominto a browser I get the following message: ERROR 403 – Forbidden


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

That wasn’t what I proposed at all. Please take this out as it is broken.

Walter

On Nov 26, 2013, at 11:39 AM, Roy Gardiner wrote:

Given Walt’s input, I tried adding an additional immediately after the Session Code and this seemed to do the trick. Now all of the page names show at the top of the browser window. Strangely, when I do this the Session Code is not visible when viewing in a browser, only the “new” code is visible.


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

On 26 Nov 2013, 5:11 pm, waltd wrote:

File a support ticket with your hosting provider, ask them to ensure that the DirectoryIndex attribute in your httpd.conf file is set to allow index.php as a default index. I’m frankly surprised that this isn’t already set.

Walter

On Nov 26, 2013, at 11:39 AM, Roy Gardiner wrote:

However, when I name the landing page (“index.php”) in the Inspector and upload the site to the server, if I type http://test.advancedbarefoot.com or http://www.test.advancedbarefoot.cominto a browser I get the following message: ERROR 403 – Forbidden

Thanks Walt,

I’ll give them a call.

Best regards,

Roy


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

Walt,

Got things sorted out.

Thanks.

Best regards,

Roy


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

Got things sorted out.

Share the fix please - it may help others with a similar problem.

David


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options