Is there a way to expand and collapse included PHP content?
Any code examples pls.
expand and collapse included PHP content?
Page 1 of 15 Replies - 318 Views - Last Post: 06 February 2012 - 12:25 PM
Topic Sponsor:
Replies To: expand and collapse included PHP content?
#2
Re: expand and collapse included PHP content?
Posted 06 February 2012 - 10:08 AM
What does that mean? Code is either executed or not.
#3
Re: expand and collapse included PHP content?
Posted 06 February 2012 - 11:34 AM
Code is either executed or not???
if i get you right,when i place the
if i get you right,when i place the
<?php include 'inc/xxxx.php';?>in the
<div>it does not hide , it just show it no matter what.
This post has been edited by decongh: 06 February 2012 - 11:36 AM
#4
Re: expand and collapse included PHP content?
Posted 06 February 2012 - 11:47 AM
Oh, I see. You think that PHP and HTML are processed in the same place and at the same time. They're not. You cannot place PHP code inside a div. Ever. PHP code is executed on the server before HTML is processed by the browser, which is on a different machine.
#5
Re: expand and collapse included PHP content?
Posted 06 February 2012 - 11:53 AM
Just to be clear, look at this:
What's happening here is that the interpreter sees a bunch of text before the <?php tag and it passes that along to the browser, otherwise completely ignoring it. Then it processes the PHP, which in this case sends the text "Hello world!" to the browser. Next, it sees the end of PHP tag "?>" so everything after that gets ignored and sent on to the browser. The end result is that the browser sees:
Note that there is no PHP there!
<div> <?php echo "Hello world!"; ?> </div>
What's happening here is that the interpreter sees a bunch of text before the <?php tag and it passes that along to the browser, otherwise completely ignoring it. Then it processes the PHP, which in this case sends the text "Hello world!" to the browser. Next, it sees the end of PHP tag "?>" so everything after that gets ignored and sent on to the browser. The end result is that the browser sees:
<div> Hello world! </div>
Note that there is no PHP there!
#6
Re: expand and collapse included PHP content?
Posted 06 February 2012 - 12:25 PM
I believe what you are talking about is expanding and collapsing content. This is something that is typically done with Javascript. Where the HTML comes from is irrelevant.
Page 1 of 1
|
|

New Topic/Question
Reply




MultiQuote





|