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
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.
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.
1 Attachment(s)
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. ;)
Re: WP7: Embed PHP code for calendar
Quote:
Originally Posted by
sjordi
I just checked and it says HTML code only.
What says it?
Quote:
Will the usual PHP tags be interpreted?
Yes, if it's a PHP file and your server is able to do it.
Quote:
I guess I'm missing something.
To find out, we need your xar file.
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?
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.
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.
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.
Re: WP7: Embed PHP code for calendar
Great,
that's what I assumed. I thought it was a DIV section. Cool.
Thanks a lot