Welcome to TalkGraphics.com
Results 1 to 9 of 9

Thread: PHP

  1. #1
    Join Date
    Feb 2012
    Posts
    8

    Default PHP

    Apparently I need to save some files as PHP but cannot see a way adding the code ;

    <?php
    session_start();
    ?>

    to the very first line of the HTM file which is generated, also I have tried renaming the page to index.php but it still exports as index.htm


    Any Ideas anybody ?

  2. #2
    Join Date
    Apr 2010
    Location
    Kildare, Ireland
    Posts
    906

    Default Re: PHP

    You need to put the code in a placeholder and give it special name <html> -> http://www.talkgraphics.com/showthre...anced-features
    XT-CMS - a self-hosted CMS for Xara Designers - Xara + CMS Demo with blog & ecommerce shopping cart system.

  3. #3
    Join Date
    Feb 2012
    Posts
    8

    Default Re: PHP

    Hi Tom,

    when I read the placeholder help it said placeholders can only be between HEAD or BODY, I need to have that PHP code in the first line i have been told ?

  4. #4
    Join Date
    Apr 2010
    Location
    Kildare, Ireland
    Posts
    906

    Default Re: PHP

    Yep, just put your code in HTML code (body) and apply that special name to the placeholder, it will put the placeholder code at the top before anything else.
    XT-CMS - a self-hosted CMS for Xara Designers - Xara + CMS Demo with blog & ecommerce shopping cart system.

  5. #5
    Join Date
    Mar 2009
    Location
    England
    Posts
    2,044

    Default Re: PHP

    Hi JudgeyK

    Try naming your first page "thiswillbemyfoldername.htm" and your second page "index.php"

  6. #6
    Join Date
    Jun 2010
    Posts
    695

    Default Re: PHP

    I'd suggest leaving the first page as it is so it will export as index.htm, then manually name the next page index.php.

    Then once you're site is published manually delete the empty index.htm page from your web server.

  7. #7
    Join Date
    Mar 2009
    Location
    England
    Posts
    2,044

    Default Re: PHP

    I've used that method before without any issues (so far) is there anything I should watch out for ?

  8. #8
    Join Date
    Dec 2000
    Location
    Hautes Pyrénées, France
    Posts
    5,083

    Default Re: PHP

    Quote Originally Posted by PeteS View Post
    I'd suggest leaving the first page as it is so it will export as index.htm, then manually name the next page index.php.

    Then once you're site is published manually delete the empty index.htm page from your web server.
    I would have thought this is quite dangerous as you risk re-uploading the blank index.htm to your server if by any twist of fate you make an unintended edit to that page (page length, unintended text box, easily done when the mouse is clicking away). If your server's default page priority is index.htm(l) before index.php or index.shtml (which I believe is the common default config) you're going to be in trouble, especially if it is a site for somebody else.

    I call my first page "site.htm". That way my assets folder is "site_htm_files" and then my second page on the site is "index.php".

    As Drwyd asks, is there a reason this is not a good idea?
    If someone tried to make me dig my own grave I would say No.
    They're going to kill me anyway and I'd love to die the way I lived:
    Avoiding Manual Labour.

  9. #9
    Join Date
    Jun 2010
    Posts
    695

    Default Re: PHP

    Drwyd, Frank, you're both quite right, thanks. I can't remember the reason I was thinking of last night why I didn't think it was such a good idea, but indeed naming the page something other than index will be better more consistently across different web servers (as per Frank explaination).

 

 

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •