473,396 Members | 2,108 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,396 software developers and data experts.

Images not diplayed...

Helllo,

I'm trying to set up a web page where users can upload their pictures.
I wrote a python script witch allows users to preview the pictures
posted to the database. Problem is that under Mozilla Firefox, the
images are not displayed.

This is the script I wrote:
#!/usr/bin/python2.3

print 'Content-Type: text/html\n\n'
import blakHtml, sys, cgi, urllib
sys.stderr = sys.stdout
prevSt=cgi.FieldStorage()
1 if not prevSt.has_key('nbOfPic'):
2 print 'blah blah!'
3 else:
4 nbOfPic2=prevSt['nbOfPic'].value

5prevPg=blakHtml.HTMLDocument()
6 header=prevPg.htmlHeader('Picture Preview')
7 beginTable=prevPg.tableTag()
8 p=0

9 nbOfLine=0
10 addLine=' '
11 for picLinked in range(int(nbOfPic2)):
12 p=p+1
13 exec("""if not prevSt.has_key('pin_nb_%s'):
14 pass
15 else:
16 addLine=addLine +'<img border="0" src="
'+prevSt['pin_nb_%s'].value+'" 17 width="204" height="152">
'+prevSt['pin_nb_%s'].value
18 nbOfLine=nbOfLine+1
19 if nbOfLine==5:
20 nbOfLine=0
21 addLine=addLine+'<br>' """)%(p,p,p)
22 print header+addLine+prevPg.htmlFooter()

line 6 generates the web page title
the loop check for non-null cgi values and creates the corresponding
<img> tag

Link to webpage http://pythonboard.homelinux.com/cgi-bin/howManyPics.py

Thanks!
Jul 18 '05 #1
0 907

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

Similar topics

7
by: Wayne | last post by:
I have a script that uses filesystemobject that reads files from a given path, in my case images. It is running on a server that is 2000 adv svr w/ all current patches. The script prior to some...
11
by: Penelope Baker | last post by:
Greetings: I cannot seem to get IE 6.0 to pre-cache my rollover images. Every time the user rolls over a link, it rereads it from the server, even though it is well into the cache by that time....
2
by: Julie | last post by:
Hi, I'm trying to change images on a website without reloading the whole page and use the following code to preload the images: var preloadFlag = false; function preloadImages() { if...
3
by: Simon | last post by:
This problem has been driving me mad for months.... Seen a few posts on forums about it but no answers... No mention on MSDN etc. XP Pro SP1, VS.NET (c#) .Net framework 1.1, IIS 5.1. In a...
4
by: Bernie Raffe | last post by:
When I change the 'cookieless' flag in the WebConfig file to true, everything works fine on my local PC, but the images fail to appear when using the remote server. I specify my images...
4
by: mwood | last post by:
I have a website for a radio station that uses an access database. I need to be able to pull the image of the dj currently on the air based on the time their show is on. So it will have to call the...
4
toxicpaint
by: toxicpaint | last post by:
Hi, can anyone give me a hand. I'm currently displaying 4 random images at the top of a page. I did this using an array of 35 pictures and then writing them to page. The problem I have is that in...
5
by: remon87 | last post by:
I need some help. I have javasript that creates the submenu but it works if I have a text with css. I need it to do the same with a roll over images. so when I click on the image the submenu...
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: 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: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
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
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
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...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.