473,386 Members | 1,819 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,386 software developers and data experts.

Dynamic Pictures

I'm creating a dynamic webpage and I'm trying to load .gif picture however issues arise when I put part of the file and directory in a saved variable. Here is working code that pulls the image:

$home = '<img id="'. $result1 .'" src="teams\pit.gif" style="Z-INDEX: 108; LEFT: 842px; POSITION: absolute; TOP: 226px"/>';

echo $home;

As you can see the image displays in the absolute position and thus works fine but its not dynamic. Here is what doesn't work:

$home = '<img id="'. $result1 .'" src="teams\'. $result1 .'.gif" style="Z-INDEX: 108; LEFT: 842px; POSITION: absolute; TOP: 226px"/>';

echo $home;

where $result1 is pulled from a database and is "pit"

I already have a banner on this page that dynamically loads that works fine however this is being stubborn.



UPDATE Working on the problem I've seemed to have narrowed it down to a problem with the \ followed immediately by the '. part.


Thanks,
Oliphaunt
Nov 3 '06 #1
1 1420
ronverdonk
4,258 Expert 4TB
You mixed up the single and double quote tags. I put all between double quotes and make attribute fields single quoted. That way you can store variables in the string withou concatenation.
[php]$home = "<img id='$result1' src='teams$result1.gif'
style='Z-INDEX: 108; LEFT: 842px; POSITION: absolute; TOP: 226px' />";[/php]

Ronald :cool:
Nov 3 '06 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Matthew Robinson | last post by:
i wrote a website for somebody, in php and mysql. The person i wrote it for wanted it to be as simple to administer as possible, so i set up phpmyadmin for the database, and showed him how to...
5
by: Robert J. O'Hara | last post by:
For some time I've made use of the max-width property in CSS to cause my pages to appear as a centered block against a contrasting background. This works well in new browsers (Mozilla, etc.) and...
1
by: E.U. | last post by:
Hi, I an using MS-Access in order to build a site. I have this item that can have upto 10 pictures (might have none) I want to design a dynamic table which has the ID of the item at the first...
3
by: dpfollmer | last post by:
I am currently designing a ASP.NET form for contacts which displays a picture depending on which contact is being viewed. This code works perfectly thus far, but I want to add an if-case for when...
6
by: Rich | last post by:
Hello, I want to simulate the dynamic thumbnail display of Windows Explorer (winxp) on a form or pannel container. If I place a picture box on my container form/pannel and dimension it to the...
0
by: Axel Schwenke | last post by:
Hi there! I want to solve the following problem: There is a webcam which takes pictures when someone walkes infront of the cam. The cam stores the images via ftp on a webserver. I now want...
0
by: J. Cliff Dyer | last post by:
On Thu, 2008-05-08 at 10:33 -0500, Victor Subervi wrote: Why are you dynamically creating getpic20.py? Obviously, in the real script, you probably have several of them: getpic1.py, getpic2.py,...
3
by: =?Utf-8?B?UiBSZXllcw==?= | last post by:
Hi! This discussion may help other programmers get a better idea of how to save uploaded images through a website. Why? Well currently, I save 3 versions of every uploaded image on my own...
1
anfetienne
by: anfetienne | last post by:
i have this code below that i made....it loads vars from txt file splits it then puts it into an array....once in an array it the brings the pics in from the array to create thumbnails and a larger...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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.