Welcome to TalkGraphics.com
Results 1 to 10 of 10
  1. #1
    Join Date
    Jan 2011
    Location
    Geneva, Switzerland
    Posts
    64

    Default WP7: Embed PHP code for calendar

    Hi,
    I need to embed a calendar to one of my pages in order to offer reservations for an object.
    The calendar works in PHP and uses MySQL in the background to store the data.

    How can I embed this in my page? I guess it's via a placeholder, but should I specify anything specific in order to have it correctly display. It uses PHP and Ajax.
    Is this possible?

    Should I just publish the page and then edit it myself in Dreamweaver and add the code manually? Which means I will have to do this each time I publish the page?
    A placehorlder would at least publish the code as well.

    Thanks for any hints on acheiving such a thing.
    Steve

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

    Default Re: WP7: Embed PHP code for calendar

    You should be ok with adding code via code placeholder. You may also need to specify the page file extension in the page filename field ( mypage.php ). Other requirements depend on the actual script you use. But whatever they are, most likely, it all can be done with placeholders.
    John.

  3. #3
    Join Date
    Jan 2011
    Location
    Geneva, Switzerland
    Posts
    64

    Default Re: WP7: Embed PHP code for calendar

    Cool thanks.
    I just checked and it says HTML code only.
    Will the usual PHP tags be interpreted? If the code is embedded as a .htm file, it might not work. Did you try this?

    My problem is that the PHP code is in the placeholder.
    The page filaneme extension is the full page itself, which contains the php placeholder.
    I guess I'm missing something.
    With a test of Hello world, the PHP is clearly not interpreted.
    Last edited by sjordi; 25 March 2011 at 02:13 PM.

  4. #4
    Join Date
    Nov 2000
    Location
    Red Boiling Springs TN USA
    Posts
    19,208

    Default Re: WP7: Embed PHP code for calendar

    You can place your php code in the same text box used for HTML.

    Please see the attached image. The php code will display the current date and time when the page is exported as date.php rather than date.htm and of course your machine or web host must have PHP running.
    Attached Thumbnails Attached Thumbnails Click image for larger version. 

Name:	php-in-placeholder.png 
Views:	113 
Size:	27.3 KB 
ID:	80652  
    Last edited by Soquili; 25 March 2011 at 02:34 PM. Reason: changed image to one showing WD7P
    Soquili
    a.k.a. Bill Taylor
    Bill is no longer with us. He died on 10 Dec 2012. We remember him always.
    My TG Album
    Last XaReg update

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

    Default Re: WP7: Embed PHP code for calendar

    Quote Originally Posted by sjordi View Post
    I just checked and it says HTML code only.
    What says it?
    Will the usual PHP tags be interpreted?
    Yes, if it's a PHP file and your server is able to do it.
    I guess I'm missing something.
    To find out, we need your xar file.
    John.

  6. #6
    Join Date
    Jan 2011
    Location
    Geneva, Switzerland
    Posts
    64

    Default Re: WP7: Embed PHP code for calendar

    Soquili, covoxer,

    it works. Pretty cool.
    One last question, for the palceholder, I actually add a rectangle that has no colors and then add some code to it.
    Is this the right thing to do or is there any other kind of placeholder for code?

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

    Default Re: WP7: Embed PHP code for calendar

    The rectangle can have any color or size. Just to make it easy to work with it. It is not exported as a visible element of the page as long as it has placeholder code applied.
    John.

  8. #8
    Join Date
    Jan 2011
    Location
    Geneva, Switzerland
    Posts
    64

    Default Re: WP7: Embed PHP code for calendar

    Ah ok then,
    I first thought that it would define the place and size where my PHP code would take place.
    Thanks. I'll explore this over the week-end.

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

    Default Re: WP7: Embed PHP code for calendar

    If you use a body code, then yes, the position and size of the placeholder object are meaningful. The placeholder code is exported withing the <div> element that is positioned and has a size set according to the position and size of the placeholder object in the document. You can use it with your code.
    John.

  10. #10
    Join Date
    Jan 2011
    Location
    Geneva, Switzerland
    Posts
    64

    Default Re: WP7: Embed PHP code for calendar

    Great,
    that's what I assumed. I thought it was a DIV section. Cool.
    Thanks a lot

 

 

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
  •