View Full Version : Switch Content Script with php

11-12-2006, 06:06 AM
1) Script Title: Switch Content Script
2) Script URL (on DD):http://www.dynamicdrive.com/dynamicindex17/switchcontent.htm
3) Describe problem:

Im trying to use the Switch Content Script with a php funcion in it.

I know why it doesnt work, but dont know how to make it work.

here is what I have. I want to be able to click to show the php echo

<h3 onClick="expandcontent(this, 'sc1')" style="cursor:hand; cursor:pointer"><span class="showstate"></span>Display more</h3>
<div id="sc1" class="switchcontent"><?php echo $PHPfile->options_list(true, true) ?></div>

anyone have any ideas

11-12-2006, 06:25 AM
Read the Rules (http://www.dynamicdrive.com/forums/rules.htm) before posting.

Warning: Please post all Dynamic Drive Script Related Questions here (http://www.dynamicdrive.com/forums/forumdisplay.php?f=2)

One it's moved...


11-13-2006, 04:27 AM
can you please move this DD scripts forum. THanks

11-13-2006, 06:17 AM
Add the ; in the php statement.

<?php echo $PHPfile->options_list(true, true); ?>

11-13-2006, 10:52 PM
I have put in the ; but still no change.

It puts the echo in from the time the page loads. I assume this is because php kinda ignores the html and does its own thing.

I can put some test text to have it show, and that works, but the php echo just stays there.