Welcome to TalkGraphics.com
Page 1 of 5 123 ... LastLast
Results 1 to 10 of 46

Thread: PHP, SHTML, etc

  1. #1
    Join Date
    Jul 2005
    Location
    Ocala, FL, USA
    Posts
    387

    Question PHP, SHTML, etc

    Ok....maybe its there and I just didn't see it.

    It appears that all the pages export with a .htm extension.
    Can you change individual page extensions so you export mostly htm but may have a page or two as .php, etc? Other WYSIWYG software I have used have a drop-down box on the page properties to assign this, along side the page name field. Did I just miss this option?
    -Samantha
    "Try to live your life so that you wouldn't be afraid to sell the family parrot to the town gossip." Will Rogers (1879 - 1935)

  2. #2
    Join Date
    Jul 2005
    Location
    Ocala, FL, USA
    Posts
    387

    Default Re: PHP, SHTML, etc

    I went back into the properties box again and even tried to change a page from advanced.htm to advanced.php but it comes out advanced.php.htm when the page exports and publishes.

    Is having the choice of file extension on the wish list?
    (php, shtml, asp, etc)
    Would be helpful when using certain scripts in the HEAD or placeholder areas.
    -Samantha
    "Try to live your life so that you wouldn't be afraid to sell the family parrot to the town gossip." Will Rogers (1879 - 1935)

  3. #3

    Default Re: PHP, SHTML, etc

    PHP is a scripting language designed for producing dynamic web pages, often with MySql database backends to serve the content dynamically to the page.
    You cannot create a HTML page in Web Designer and convert it to a PHP (for example) simply by changing the extension name.
    A php page source is entirely different to standard HTML.

    Web Designer hasn't been designed to create PHP scripted sites.

  4. #4
    Join Date
    Mar 2009
    Location
    Christie Downs South Australia
    Posts
    15

    Info Re: PHP, SHTML, etc

    Hi there,

    There is away around it, and that is to use the <? includes_once "";?> or <? required_once "";?> code, however, you do need to use the .php file extension on your pages, and to have the code or function on a seperate file eg: phpcode.php

    This way it will include the PHP function you want to use, without altering the HTM/HTML output.

    Simply just use the "Replace with HTML" in the Website properties - placeholder dialog box.

    To change from .htm file to .php extension simply open the export file with your pages that you want to export and manually change them via rename.

    Yes it's messy, but it works ....... If you would like a real challenge, try splitting the file up into a header, footer and content but be prepared for lots of headaches.

    Hope this helps
    DannyC

  5. #5
    Join Date
    Jul 2008
    Location
    Phoenix, AZ
    Posts
    267

    Default Re: PHP, SHTML, etc

    You can take any html page and change the extention to php and the file will display the same. The only difference is that the server will parse the file for any php. If nothing is found, just the html is displayed.

    php and html mix very well in a file. You can do it in XWD which is covered in another thread however you need to manually rename the file after saving it.
    Chris
    LotsMoreHosting.com

  6. #6
    Join Date
    Mar 2009
    Location
    Christie Downs South Australia
    Posts
    15

    Thumbs up Re: PHP, SHTML, etc

    Quote Originally Posted by ckh View Post
    You can take any html page and change the extention to php and the file will display the same. The only difference is that the server will parse the file for any php. If nothing is found, just the html is displayed.

    php and html mix very well in a file. You can do it in XWD which is covered in another thread however you need to manually rename the file after saving it.
    I just did a quick site, with the includes function .... it works fine

    http://www.d-zynzs.com/xwd2php/index.php ...... however I did notice that I had to use a php editor to change the file extension from htm to php.

  7. #7
    Join Date
    Jul 2008
    Location
    Phoenix, AZ
    Posts
    267

    Default Re: PHP, SHTML, etc

    If you are running Windows, you should just be able to rename the file without using a php editor. I do it all the time with the file explorer. highlight it, pause, then click it and you can rename it. If you click too fast, you may just open the file with the program associated with the extension. Alternatively, you can right click and select rename.

    If you are using a Mac, I have no idea.
    Chris
    LotsMoreHosting.com

  8. #8
    Join Date
    Sep 2000
    Location
    London, UK
    Posts
    1,436

    Default Re: PHP, SHTML, etc

    Some servers are set to parse all files with .htm or .html, looking for php scripts but obviously this is inefficient of only 1 page in 100 has any. So most servers will only parse for php if the suffix is .php.

    It would be a help if you can specify the suffix in XWD.
    Simon
    ------------------------------
    www.tlaconsultancy.co.uk
    www.bricksandbrass.co.uk

  9. #9
    Join Date
    Jul 2005
    Location
    Ocala, FL, USA
    Posts
    387

    Default Re: PHP, SHTML, etc

    A php page source is entirely different to standard HTML.
    Web Designer hasn't been designed to create PHP scripted sites.
    Yes I understand this fact.
    I am not suggesting that XWD does or should create php pages.

    There is away around it, and that is to use the <? includes_once "";?> or <? required_once "";?> code,

    This way it will include the PHP function you want to use, without altering the HTM/HTML output.
    Simply just use the "Replace with HTML" in the Website properties - placeholder dialog box.
    Yes I do this now.

    however, you do need to use the .php file extension on your pages, and to have the code or function on a seperate file eg: phpcode.php
    Yes exactly! This is exactly why I am asking for the ability to change the file extension. With other web builders, I can choose an extension to match my scripts. The pages are generated in html only and scripts work fine.

    You can take any html page and change the extention to php and the file will display the same. The only difference is that the server will parse the file for any php. If nothing is found, just the html is displayed.

    php and html mix very well in a file.
    Yes. I agree. Have done this for years to run specific includes. Works well.One example: a secure php form script uses includes but will only work with the .php extension. The rest of the page is standard html. The htaccess file is set to read these files just fine. I have this script running on 4 websites, all written in html, each has a .php file extension to work with the includes.

    Some servers are set to parse all files with .htm or .html, looking for php scripts but obviously this is inefficient of only 1 page in 100 has any. So most servers will only parse for php if the suffix is .php.

    It would be a help if you can specify the suffix in XWD.
    Yes. It would!!

    however I did notice that I had to use a php editor to change the file extension from htm to php.
    Exactly. XWD will not change the extension so every time it exports and publishes, it must be modified manually and uploaded manually to the site. This is truly redundant work. If you modify the page just once a week, over a year that is 52 edits to the .php extension and 52 manual uploads that could be simply avoided if the program allows assignment of file extension.

    The problem is magnified further because at this time, XWD updates all page every time it publishes. So each time, it would send the filename.htm file to the web instead of a filename.php. Now there is manual effort to remove the .htm version of the page since it is not needed or wanted.

    Manually editing the file extension is not difficult but add it up.
    Time really adds up for something that could be easy for the user to specify using a simple drop-down box with choice of page extension: htm (default), asp, php, shtml.
    The manual can simply state that all pages are written in html code. The choice of file extension is allowed for use of included scripts that require a specific file extension. Please consider this for the wish list. It would greatly extend the ability of XWD.
    -Samantha
    "Try to live your life so that you wouldn't be afraid to sell the family parrot to the town gossip." Will Rogers (1879 - 1935)

  10. #10
    Join Date
    Aug 2004
    Location
    Ukraine
    Posts
    3,904

    Default Re: PHP, SHTML, etc

    Are you aware that pages with php extension will not work in html preview, only online?
    John.

 

 

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
  •