473,387 Members | 1,812 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Using an as a link

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="http://www.somepage.com">
<img src="someimage.jpg">
</a>

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

<?php

// 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" />';
break;

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

default:
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="http://www.somepage.com"><img
src="someimage.jpg"></a>';
break;

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

Regards

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

Feb 12 '06 #1
1 1157
Denebola wrote:
Now the code above does what I want it to do but if I add the line
below i get a parse error:


Did you add the line before the default case?
JW
Feb 12 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: john_williams_800 | last post by:
Hi; I am just starting to use the DOM to do some more advanced javascripting so please be patient with my question if it is an ignorant question. I would like to use the DOM to dynamically...
3
by: Random Person | last post by:
Does anyone know how to use VBA to relink tables between two MS Access databases? We have two databases, one with VBA code and the other with data tables. The tables are referenced by linked...
22
by: Bradley | last post by:
Has anyone else noticed this problem? I converted the back-end to A2000 and the performance problem was fixed. We supply a 97 and 2000 version of our software so we kept the backend in A97 to make...
1
by: Daveyk0 | last post by:
Hello there, I have a front end database that I have recently made very many changes to to allow off-line use. I keep copies of the databases on my hard drive and link to them rather than the...
3
by: Andreas | last post by:
Hi! I'm currently developing a DLL that makes use of C++ and .net (mixed) using Visual Studio 2003. Now, as I wanted to move to the new Visual Studio 2005, I converted this project into the...
5
by: Tom | last post by:
Hi, I am working on a project where I want to simultaneously launch a link using my own registered protocol and simultaneously send an AJAX request to the server. Now the way I have come up...
7
by: ApexData | last post by:
Hello I currently Link the FE/BE using the LinkTables Option and the Linked Table Manager. Any time I need to move the BE to another location, I have to go through this process over again. I...
1
by: bsprogs | last post by:
I am currnetly programming a file hosting website in PHP and I am slowly integrating AJAX into the website. Here is my problem: The user uploads the file. The server processes the file and...
12
by: prashant | last post by:
hi, i am trying to create an xml tag ref to hold link.php?id=1; or link.php?id=2 and so on. I want the links for all the fields(id) in the databse so that when i call them in my html page for...
8
by: =?Utf-8?B?Q2hyaXMgSGFsY3Jvdw==?= | last post by:
Hi there I've successfully added some .NET validation controls to a page (using <asp:RequiredFieldValidator ...), however when I try to set the 'display' property to 'dynamic', my page then...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.