Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialChristian Kroul
9,849 PointsPHP and reusing code
<?php
$final[0]=array('base','india');
$final[1]=
array("id" => '?101', "img" => "img/building.jpg");
$final[2]=
array("id" => '?102','UK');
$final[3]=
array("id" => '?103','RUSSIA');
?>
<a href=<?php
echo $final[1]["id"];
?>
>
<img src="img/Hot-Dog.jpg">
</a>
<?php
if ($_Get == $final[2]["id"]) {
echo '<h1>AW</h1>';
}
?>
<a href=<?php
echo $final[2]["id"];
?>
>
<img style ="width: 30%;"
src="img/building.jpg">
</a>
This is my code it makes a new query with ?102 as the name, but it displays the same content i want each link to display something new, mayby a h1 tag for 102, and for 101 a paragraph tag. Any suggestions?
David Moore
14,324 PointsDavid Moore
14,324 PointsNot entirely clear what you're asking for here.