Using an as a link

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View
Now I am able to practice php on my pc, thanks to previous replies to a
post in this forum, here the first of many questions.

I want to be able to use an image as a link. So in html I would use:

<a href=" ">
<img src="someimage.jpg">

I have written the php code below (which I am proud of !!):


// Switch statement based off server time
switch (date('H i D'))
        case '22 33 Sat':
                print '<img src="michelle.jpg" border="2" height="170"
width="227" />';

        case '22 34 Sat':
                print '<img src="sunset.jpg" border="2" height="170"
width="227" />';

                print 'Cases not met';



Now the code above does what I want it to do but if I add the line
below i get a parse error:

        case '22 35 Sat':
                print '<a href=" "><img

So how do I create a link from the images in my code?


p.s. please excuse the unintentional line breaks in the above code but
they are not there in the actual code I have written.

Re: Using an as a link

Denebola wrote:
Quoted text here. Click to load it

Did you add the line before the default case?


Site Timeline