Why isn't my php script working?

Mstrlouis

New member
I am designing a database with a search feature for music and I am trying to get the title of a song on a search results page to display the lyrics to the song when the title is clicked.

This is a bit of the script I am using. Please any suggestions would be helpful.

<?php
...
$id = $_GET['id'];
...
...
print '<p class="sansserif"><b>Song title : </b> <a href="search.php?id=<? echo $lyrics; ?>">'.$title.'</a><br />';
...
?>
 
You have a problem with your PHP code and HTML structure. You can replace your code with this one:


<? $id = $_GET['id']; ?>

<p class="sansserif">
<b>Song title :</b>
<a href="search.php?id=<? echo $lyrics; ?>"><? echo $title ?></a>
</p>

This style does not only improve readability of your code but will also will enable you to edit your code and layout inside editors such as Dreamweaver and Zend IDE.

Hope that helps and good luck with your project.
 
Back
Top