Welcome to TalkGraphics.com
Page 2 of 2 FirstFirst 12
Results 11 to 17 of 17
  1. #11
    Join Date
    Apr 2012
    Location
    SW England
    Posts
    17,746

    Default Re: using php with Xara

    Have a look at http://www.talkgraphics.com/showthre...fter-html-code.

    You only need include the PHP code from your offering:
    <?php
    echo “hello world”;
    ?>
    I also believe you have to change the page name to <page>.php.

    The last wrinkle I recall is every Xara site must have an index.htm or index.html page so index.php alone will not deliver.

    Others who use PHP extensions may be able to correct me and help you better.

    Acorn

    P.S. It always helps to start a new Thread and not add to the end of a stale one.

    P.P.S. As this is your first Post, welcome to TalkGraphics, even though you joined in March.
    Acorn - installed Xara software: Cloud+/Pro+ and most others back through time (to CC's Artworks). Contact for technical remediation/consultancy for your web designs.
    When we provide assistance, your responses are valuable as they benefit the community. TG Nuggets you might like. Report faults: Xara Cloud+/Pro+/Magix Legacy; Xara KB & Chat

  2. #12
    Join Date
    Feb 2014
    Location
    Toronto, Canada
    Posts
    792

    Default Re: using php with Xara

    Hi Tam, welcome to Talk Graphics, what are your interests in Xara software?

    Ciao

    Roly

  3. #13
    Join Date
    Nov 2013
    Location
    Hertfordshire, UK
    Posts
    1,488

    Default Re: using php with Xara

    Just a side note, you can use the name "<html>" to insert code above the initial html tag.

    Also, if you are new to web design (or code in general) then any PHP code you insert needs a PHP server to run the code. I use easy PHP to quickly setup an apache, PHP and mysql server on your local machine: http://www.easyphp.org/

    Xara doesn't have any PHP or database facilities unfortunately so I would recommend developing code outside of Xara in something like notepad++ which offers great support and plugins (not to mention free).

  4. #14

    Default Re: using php with Xara

    If you read through the links above, all the information is there, but to put it simply you have the following choices;
    * in xara, change names of pages to end with .php (this can work for all pages except the first one which could just be a dummy page)
    * make changes to your .htaccess file so that the .htm files get processed by php
    As you probably realise, changing filenames afterwards is futile and internal links won't work anyway.
    You wouldn't need all that HTML, as that would already be generated by xara, assuming you are inserting this code in a html placeholder it would already be in the body section

    Edit - oops, didn't see there was a page 2 already!

  5. #15
    Join Date
    May 2017
    Posts
    1

    Default Re: using php with Xara

    Hi ya camcap,

    This is what I did to finally get it to work

    1. I had to change the .htaccess file in my servers root directory, add the following:

    AddType application/x-httpd-php .htm .html

    Then I added a rectangle to the page I was working on in Xara 365.
    Then I clicked utilities/webproperties while the rectangle was selected
    Then I went to placeholder/replace with html BODY
    I added the code
    <?php
    echo “hello world”;
    ?>

    And it worked, I hope this helps you

    Cheers

  6. #16

    Default Re: using php with Xara

    I am also interested to learn more. Don't understand why there is no reply. Did you find a solution ? DId you try what was suggested by jamesd above ?

  7. #17

    Default Re: using php with Xara

    Since an index.htm file is required by WD, if the php script is to be inserted into the index page could you have the script on index.php with the desired page content on and have index.htm with only a redirect code on redirecting to index.php and that way all the links remain working to the home page? Or would that cause issues for search engines etc?

 

 

Tags for this Thread

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
  •