PHP code within mysql database content
Posted 13 August 2006 - 06:35 AM
Posted 13 August 2006 - 09:09 PM
*.*.php = variable_page.php
...the code is a bunch of lyrics...and there would be php variables mixed into that...so that the user can select what key the song would be shown in...thanks for your help
Posted 14 August 2006 - 06:17 AM
...i have a database with 3 columns...( TITLE - AUTHOR - LYRICS_AND_CHORDS )...
* EXAMPLE *...my first row has the following information...
...under TITLE - Beautiful Day
...under AUTHOR - U2
...under LYRICS_AND_CHORDS - <p>
A Bm D G D
A <br>The heart is a bloom, shoots up through the stony ground.</p>
...now if i put all this and then retrieve all these details and input them into variables on a php page, then everything works...but...if i do the following...
<?php $_1.' '.$_2 ?>
...when i retrieve this...<?php $_1.' '.$_2 ?> is written exactly as i had put it in...whereas $_1 and $_2 should of been replaced by given variables and then those variables should of been displayed...
...please tell me this makes some sense...
Posted 15 August 2006 - 04:13 AM
Posted 15 August 2006 - 06:01 AM
Your code must not have <? ?> <?php ?>
only php code like
$code="echo('Hello');"; eval($code); // Hello
So you have to use echo for all html and for php use it like you would without the tags and use eval
Posted 16 August 2006 - 05:18 AM
eval('?>' . $row['lyrics_and_chords'] . '<?php ');
...when i retrieve items from my database...thanks for your time...
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users