Using PHP variables

Page: 1

Author Post
Member
Registered: Oct 2012
Posts: 19
I use floatbox with static content, and it works fine.

But I don't know how to use variables in the floatbox.

I want to display users photos. And on mouseover a floatbox opens with infomations.

For static information, it's OK.

But I want is to display in the floatbox some informations (name, age, weight,...) about the user.

All this information is in a SQL DB and I can extract this info to PHP variables.

But I don't know how to put these PHP variables in the floatbox content.

Thanks for help.
Administrator
Registered: Aug 2008
Posts: 3382
Perhaps you want to bring in your content as type:ajax? The href target of the ajax fetch would be a server-side page that assembles the desired html content based on DB information. Client-side javascript does not have access to back-end databases. Only server-side code can talk to a server-side DB.
Member
Registered: Oct 2012
Posts: 19
Yes, it works with AJAX.

But the problem is that I must have an external file and initialize the framework.

Thanks.
Member
Registered: Aug 2012
Posts: 26
Michel_ wrote
All this information is in a SQL DB and I can extract this info to PHP variables.

But I don't know how to put these PHP variables in the floatbox content.


Simply write your PHP such that it creates the page source you need.

PHP is executed on the server and creates a document, which is then sent to the client just like a static HTML page. Floatbox is executed on the client. It doesn't care whether the content is static or was created dynamically.

Page: 1