Jump to content

I_NEED_HELP

Members
  • Content Count

    107
  • Joined

  • Last visited

Community Reputation

0 Neutral

About I_NEED_HELP

  • Rank
    frequent

Contact Methods

  • MSN
    g_hadgraft@hotmail.com
  • ICQ
    0

Profile Information

  • Location
    U.K. (East Anglia)
  • Interests
    Linux, Music
  1. ok ive got this working. On my original command it appeared to be the -D that was causing it to fail retirval of all pages for some reason. now that is taken out it works fine and it is not really needed in this case anyway. Thanks for the help neddie.
  2. I have tried it with simpler options and it just does not follow the links on the page. i tried wget -r --no-parent http://www.somesite.co.uk/answers/ -d | more and that only retrieve the index page. The page has links on it that are just plain ordinary html links yet does not follow those links. ive tried using -d and sending out put to a logfile. The lines relating to one of the links i want it to follow are below: DEBUG output created by Wget 1.10.2 (Red Hat modified) on linux-gnu. Enqueuing http://www.somesite.co.uk/answers/ at depth 0 Queue count 1, maxcount 1. Dequeuing http://www.somesite.co.uk/answers/ at depth 0 Queue count 0, maxcount 1. --14:06:39-- http://www.somesite.co.uk/answers/ => `www.somesite.co.uk/answers/index.html' Resolving www.somesite.co.uk... 213.218.223.240 Caching www.somesite.co.uk => 213.218.223.240 Connecting to www.somesite.co.uk|213.218.223.240|:80... connected. Created socket 4. Releasing 0x09dc14a8 (new refcount 1). ---request begin--- GET /answers/ HTTP/1.0 User-Agent: Wget/1.10.2 (Red Hat modified) Accept: */* Host: www.somesite.co.uk Connection: Keep-Alive ---request end--- HTTP request sent, awaiting response... ---response begin--- HTTP/1.1 302 moved Date: Wed, 17 Jan 2007 14:06:39 GMT Server: Apache/2.0.52 (Red Hat) Location: index Connection: close Content-Type: text/plain ---response end--- 302 moved Location: index [following] Closed fd 4 --14:06:39-- http://www.somesite.co.uk/answers/index => `www.somesite.co.uk/answers/index' Found www.somesite.co.uk in host_name_addresses_map (0x9dc14a8) Connecting to www.somesite.co.uk|213.218.223.240|:80... connected. Created socket 4. Releasing 0x09dc14a8 (new refcount 1). ---request begin--- GET /answers/index HTTP/1.0 User-Agent: Wget/1.10.2 (Red Hat modified) Accept: */* Host: www.somesite.co.uk Connection: Keep-Alive ---request end--- HTTP request sent, awaiting response... ---response begin--- HTTP/1.1 302 moved Date: Wed, 17 Jan 2007 14:06:39 GMT Server: Apache/2.0.52 (Red Hat) Location: index Connection: close Content-Type: text/plain ---response end--- 302 moved Location: index [following] Closed fd 4 --14:06:39-- http://www.somesite.co.uk/answers/index => `www.somesite.co.uk/answers/index' Found www.somesite.co.uk in host_name_addresses_map (0x9dc14a8) Connecting to www.somesite.co.uk|213.218.223.240|:80... connected. Created socket 4. Releasing 0x09dc14a8 (new refcount 1). ---request begin--- GET /answers/index HTTP/1.0 User-Agent: Wget/1.10.2 (Red Hat modified) Accept: */* Host: www.somesite.co.uk Connection: Keep-Alive ---request end--- HTTP request sent, awaiting response... ---response begin--- HTTP/1.1 302 moved Date: Wed, 17 Jan 2007 14:06:39 GMT Server: Apache/2.0.52 (Red Hat) Location: index Connection: close Content-Type: text/plain ---response end--- 302 moved Location: index [following] Closed fd 4 --14:06:39-- http://www.somesite.co.uk/answers/index => `www.somesite.co.uk/answers/index' Found www.somesite.co.uk in host_name_addresses_map (0x9dc14a8) Connecting to www.somesite.co.uk|213.218.223.240|:80... connected. Created socket 4. Releasing 0x09dc14a8 (new refcount 1). ---request begin--- GET /answers/index HTTP/1.0 User-Agent: Wget/1.10.2 (Red Hat modified) Accept: */* Host: www.somesite.co.uk Connection: Keep-Alive ---request end--- HTTP request sent, awaiting response... ---response begin--- HTTP/1.1 302 moved Date: Wed, 17 Jan 2007 14:06:39 GMT Server: Apache/2.0.52 (Red Hat) Location: index Connection: close Content-Type: text/plain ---response end--- 302 moved Location: index [following] Closed fd 4 --14:06:39-- http://www.somesite.co.uk/answers/index => `www.somesite.co.uk/answers/index' Found www.somesite.co.uk in host_name_addresses_map (0x9dc14a8) Connecting to www.somesite.co.uk|213.218.223.240|:80... connected. Created socket 4. Releasing 0x09dc14a8 (new refcount 1). ---request begin--- GET /answers/index HTTP/1.0 User-Agent: Wget/1.10.2 (Red Hat modified) Accept: */* Host: www.somesite.co.uk Connection: Keep-Alive ---request end--- HTTP request sent, awaiting response... ---response begin--- HTTP/1.1 302 moved Date: Wed, 17 Jan 2007 14:06:39 GMT Server: Apache/2.0.52 (Red Hat) Location: index Connection: close Content-Type: text/plain ---response end--- 302 moved Location: index [following] Closed fd 4 --14:06:39-- http://www.somesite.co.uk/answers/index => `www.somesite.co.uk/answers/index' Found www.somesite.co.uk in host_name_addresses_map (0x9dc14a8) Connecting to www.somesite.co.uk|213.218.223.240|:80... connected. Created socket 4. Releasing 0x09dc14a8 (new refcount 1). ---request begin--- GET /answers/index HTTP/1.0 User-Agent: Wget/1.10.2 (Red Hat modified) Accept: */* Host: www.somesite.co.uk Connection: Keep-Alive ---request end--- HTTP request sent, awaiting response... ---response begin--- HTTP/1.1 302 moved Date: Wed, 17 Jan 2007 14:06:39 GMT Server: Apache/2.0.52 (Red Hat) Location: index Connection: close Content-Type: text/plain ---response end--- 302 moved Location: index [following] Closed fd 4 --14:06:39-- http://www.somesite.co.uk/answers/index => `www.somesite.co.uk/answers/index' Found www.somesite.co.uk in host_name_addresses_map (0x9dc14a8) Connecting to www.somesite.co.uk|213.218.223.240|:80... connected. Created socket 4. Releasing 0x09dc14a8 (new refcount 1). ---request begin--- GET /answers/index HTTP/1.0 User-Agent: Wget/1.10.2 (Red Hat modified) Accept: */* Host: www.somesite.co.uk Connection: Keep-Alive ---request end--- HTTP request sent, awaiting response... ---response begin--- HTTP/1.1 302 moved Date: Wed, 17 Jan 2007 14:06:39 GMT Server: Apache/2.0.52 (Red Hat) Location: index Connection: close Content-Type: text/plain ---response end--- 302 moved Location: index [following] Closed fd 4 --14:06:39-- http://www.somesite.co.uk/answers/index => `www.somesite.co.uk/answers/index' Found www.somesite.co.uk in host_name_addresses_map (0x9dc14a8) Connecting to www.somesite.co.uk|213.218.223.240|:80... connected. Created socket 4. Releasing 0x09dc14a8 (new refcount 1). ---request begin--- GET /answers/index HTTP/1.0 User-Agent: Wget/1.10.2 (Red Hat modified) Accept: */* Host: www.somesite.co.uk Connection: Keep-Alive ---request end--- HTTP request sent, awaiting response... ---response begin--- HTTP/1.1 302 moved Date: Wed, 17 Jan 2007 14:06:39 GMT Server: Apache/2.0.52 (Red Hat) Location: index Connection: close Content-Type: text/plain ---response end--- 302 moved Location: index [following] Closed fd 4 --14:06:39-- http://www.somesite.co.uk/answers/index => `www.somesite.co.uk/answers/index' Found www.somesite.co.uk in host_name_addresses_map (0x9dc14a8) Connecting to www.somesite.co.uk|213.218.223.240|:80... connected. Created socket 4. Releasing 0x09dc14a8 (new refcount 1). ---request begin--- GET /answers/index HTTP/1.0 User-Agent: Wget/1.10.2 (Red Hat modified) Accept: */* Host: www.somesite.co.uk Connection: Keep-Alive ---request end--- HTTP request sent, awaiting response... ---response begin--- HTTP/1.1 302 moved Date: Wed, 17 Jan 2007 14:06:39 GMT Server: Apache/2.0.52 (Red Hat) Location: index Connection: close Content-Type: text/plain ---response end--- 302 moved Location: index [following] Closed fd 4 --14:06:39-- http://www.somesite.co.uk/answers/index => `www.somesite.co.uk/answers/index' Found www.somesite.co.uk in host_name_addresses_map (0x9dc14a8) Connecting to www.somesite.co.uk|213.218.223.240|:80... connected. Created socket 4. Releasing 0x09dc14a8 (new refcount 1). ---request begin--- GET /answers/index HTTP/1.0 User-Agent: Wget/1.10.2 (Red Hat modified) Accept: */* Host: www.somesite.co.uk Connection: Keep-Alive ---request end--- HTTP request sent, awaiting response... ---response begin--- HTTP/1.1 302 moved Date: Wed, 17 Jan 2007 14:06:39 GMT Server: Apache/2.0.52 (Red Hat) Location: index Connection: close Content-Type: text/plain ---response end--- 302 moved Location: index [following] Closed fd 4 --14:06:39-- http://www.somesite.co.uk/answers/index => `www.somesite.co.uk/answers/index' Found www.somesite.co.uk in host_name_addresses_map (0x9dc14a8) Connecting to www.somesite.co.uk|213.218.223.240|:80... connected. Created socket 4. Releasing 0x09dc14a8 (new refcount 1). ---request begin--- GET /answers/index HTTP/1.0 User-Agent: Wget/1.10.2 (Red Hat modified) Accept: */* Host: www.somesite.co.uk Connection: Keep-Alive ---request end--- HTTP request sent, awaiting response... ---response begin--- HTTP/1.1 302 moved Date: Wed, 17 Jan 2007 14:06:39 GMT Server: Apache/2.0.52 (Red Hat) Location: index Connection: close Content-Type: text/plain ---response end--- 302 moved Location: index [following] Closed fd 4 --14:06:39-- http://www.somesite.co.uk/answers/index => `www.somesite.co.uk/answers/index' Found www.somesite.co.uk in host_name_addresses_map (0x9dc14a8) Connecting to www.somesite.co.uk|213.218.223.240|:80... connected. Created socket 4. Releasing 0x09dc14a8 (new refcount 1). ---request begin--- GET /answers/index HTTP/1.0 User-Agent: Wget/1.10.2 (Red Hat modified) Accept: */* Host: www.somesite.co.uk Connection: Keep-Alive ---request end--- HTTP request sent, awaiting response... ---response begin--- HTTP/1.1 302 moved Date: Wed, 17 Jan 2007 14:06:39 GMT Server: Apache/2.0.52 (Red Hat) Location: index Connection: close Content-Type: text/plain ---response end--- 302 moved Location: index [following] Closed fd 4 --14:06:39-- http://www.somesite.co.uk/answers/index => `www.somesite.co.uk/answers/index' Found www.somesite.co.uk in host_name_addresses_map (0x9dc14a8) Connecting to www.somesite.co.uk|213.218.223.240|:80... connected. Created socket 4. Releasing 0x09dc14a8 (new refcount 1). ---request begin--- GET /answers/index HTTP/1.0 User-Agent: Wget/1.10.2 (Red Hat modified) Accept: */* Host: www.somesite.co.uk Connection: Keep-Alive ---request end--- HTTP request sent, awaiting response... ---response begin--- HTTP/1.1 302 moved Date: Wed, 17 Jan 2007 14:06:39 GMT Server: Apache/2.0.52 (Red Hat) Location: index Connection: close Content-Type: text/plain ---response end--- 302 moved Location: index [following] Closed fd 4 --14:06:39-- http://www.somesite.co.uk/answers/index => `www.somesite.co.uk/answers/index' Found www.somesite.co.uk in host_name_addresses_map (0x9dc14a8) Connecting to www.somesite.co.uk|213.218.223.240|:80... connected. Created socket 4. Releasing 0x09dc14a8 (new refcount 1). ---request begin--- GET /answers/index HTTP/1.0 User-Agent: Wget/1.10.2 (Red Hat modified) Accept: */* Host: www.somesite.co.uk Connection: Keep-Alive ---request end--- HTTP request sent, awaiting response... ---response begin--- HTTP/1.1 302 moved Date: Wed, 17 Jan 2007 14:06:39 GMT Server: Apache/2.0.52 (Red Hat) Location: index Connection: close Content-Type: text/plain ---response end--- 302 moved Location: index [following] Closed fd 4 --14:06:39-- http://www.somesite.co.uk/answers/index => `www.somesite.co.uk/answers/index' Found www.somesite.co.uk in host_name_addresses_map (0x9dc14a8) Connecting to www.somesite.co.uk|213.218.223.240|:80... connected. Created socket 4. Releasing 0x09dc14a8 (new refcount 1). ---request begin--- GET /answers/index HTTP/1.0 User-Agent: Wget/1.10.2 (Red Hat modified) Accept: */* Host: www.somesite.co.uk Connection: Keep-Alive ---request end--- HTTP request sent, awaiting response... ---response begin--- HTTP/1.1 302 moved Date: Wed, 17 Jan 2007 14:06:39 GMT Server: Apache/2.0.52 (Red Hat) Location: index Connection: close Content-Type: text/plain ---response end--- 302 moved Location: index [following] Closed fd 4 --14:06:39-- http://www.somesite.co.uk/answers/index => `www.somesite.co.uk/answers/index' Found www.somesite.co.uk in host_name_addresses_map (0x9dc14a8) Connecting to www.somesite.co.uk|213.218.223.240|:80... connected. Created socket 4. Releasing 0x09dc14a8 (new refcount 1). ---request begin--- GET /answers/index HTTP/1.0 User-Agent: Wget/1.10.2 (Red Hat modified) Accept: */* Host: www.somesite.co.uk Connection: Keep-Alive ---request end--- HTTP request sent, awaiting response... ---response begin--- HTTP/1.1 302 moved Date: Wed, 17 Jan 2007 14:06:39 GMT Server: Apache/2.0.52 (Red Hat) Location: index Connection: close Content-Type: text/plain ---response end--- 302 moved Location: index [following] Closed fd 4 --14:06:39-- http://www.somesite.co.uk/answers/index => `www.somesite.co.uk/answers/index' Found www.somesite.co.uk in host_name_addresses_map (0x9dc14a8) Connecting to www.somesite.co.uk|213.218.223.240|:80... connected. Created socket 4. Releasing 0x09dc14a8 (new refcount 1). ---request begin--- GET /answers/index HTTP/1.0 User-Agent: Wget/1.10.2 (Red Hat modified) Accept: */* Host: www.somesite.co.uk Connection: Keep-Alive ---request end--- HTTP request sent, awaiting response... ---response begin--- HTTP/1.1 302 moved Date: Wed, 17 Jan 2007 14:06:39 GMT Server: Apache/2.0.52 (Red Hat) Location: index Connection: close Content-Type: text/plain ---response end--- 302 moved Location: index [following] Closed fd 4 --14:06:39-- http://www.somesite.co.uk/answers/index => `www.somesite.co.uk/answers/index' Found www.somesite.co.uk in host_name_addresses_map (0x9dc14a8) Connecting to www.somesite.co.uk|213.218.223.240|:80... connected. Created socket 4. Releasing 0x09dc14a8 (new refcount 1). ---request begin--- GET /answers/index HTTP/1.0 User-Agent: Wget/1.10.2 (Red Hat modified) Accept: */* Host: www.somesite.co.uk Connection: Keep-Alive ---request end--- HTTP request sent, awaiting response... ---response begin--- HTTP/1.1 302 moved Date: Wed, 17 Jan 2007 14:06:39 GMT Server: Apache/2.0.52 (Red Hat) Location: index Connection: close Content-Type: text/plain ---response end--- 302 moved Location: index [following] Closed fd 4 --14:06:39-- http://www.somesite.co.uk/answers/index => `www.somesite.co.uk/answers/index' Found www.somesite.co.uk in host_name_addresses_map (0x9dc14a8) Connecting to www.somesite.co.uk|213.218.223.240|:80... connected. Created socket 4. Releasing 0x09dc14a8 (new refcount 1). ---request begin--- GET /answers/index HTTP/1.0 User-Agent: Wget/1.10.2 (Red Hat modified) Accept: */* Host: www.somesite.co.uk Connection: Keep-Alive ---request end--- HTTP request sent, awaiting response... ---response begin--- HTTP/1.1 302 moved Date: Wed, 17 Jan 2007 14:06:39 GMT Server: Apache/2.0.52 (Red Hat) Location: index Connection: close Content-Type: text/plain ---response end--- 302 moved Location: index [following] Closed fd 4 --14:06:40-- http://www.somesite.co.uk/answers/index => `www.somesite.co.uk/answers/index' Found www.somesite.co.uk in host_name_addresses_map (0x9dc14a8) Connecting to www.somesite.co.uk|213.218.223.240|:80... connected. Created socket 4. Releasing 0x09dc14a8 (new refcount 1). ---request begin--- GET /answers/index HTTP/1.0 User-Agent: Wget/1.10.2 (Red Hat modified) Accept: */* Host: www.somesite.co.uk Connection: Keep-Alive ---request end--- HTTP request sent, awaiting response... ---response begin--- HTTP/1.1 302 moved Date: Wed, 17 Jan 2007 14:06:40 GMT Server: Apache/2.0.52 (Red Hat) Location: index Connection: close Content-Type: text/plain ---response end--- 302 moved Location: index [following] Closed fd 4 --14:06:40-- http://www.somesite.co.uk/answers/index => `www.somesite.co.uk/answers/index' Found www.somesite.co.uk in host_name_addresses_map (0x9dc14a8) Connecting to www.somesite.co.uk|213.218.223.240|:80... connected. Created socket 4. Releasing 0x09dc14a8 (new refcount 1). ---request begin--- GET /answers/index HTTP/1.0 User-Agent: Wget/1.10.2 (Red Hat modified) Accept: */* Host: www.somesite.co.uk Connection: Keep-Alive ---request end--- HTTP request sent, awaiting response... ---response begin--- HTTP/1.1 302 moved Date: Wed, 17 Jan 2007 14:06:40 GMT Server: Apache/2.0.52 (Red Hat) Location: index Connection: close Content-Type: text/plain ---response end--- 302 moved Location: index [following] Closed fd 4 20 redirections exceeded. FINISHED --14:06:40-- Downloaded: 0 bytes in 0 files Do these lines mean anything. i do not have any experience using wget before.
  3. I need some help using an application called interchange on my webserver. I have a url www.somewebsite.com/questions/*.html I want to index all files in that questions directory. I am using the following wget command. wget -r -l2 -A html -X cgi-bin -D www.somewebsite.co.uk/ -P /home/httpd/vhosts/somewebsite.co.uk/catalogs/somewebsite/swish_site/ http://www.somewebsite.co.uk/questions/ This only index the index page of this folder. It wil not follow the links on the page. What would be the appropriate command to use to index all pages from that folder. [moved from Software by spinynorman]
  4. Im looking to buy a hard drive based MP3 player, as my current mp3 player is on its last legs. It seems to get through a set of AAA battries in a day and thats nwith the mp3 player switched of. I might be leaving the thing on but the screen doesnt work so i cannot tell if i am or not. Im looking for a hard drive based player with at least 20 GB for under £200 GBP What is good so far it is a toss between an ipod or a creative zen touch, but as far as i can tell the zen touch i will not be able to use in linux, or maybe someone can tell me if i will be able to transfer files in linux. I want to be able to tranfer files in linux as it will mean only one reason to but into windows and that is EVE online so once if i get that working in linux that means bye bye windows. Also one last question, will the creative zen be able to play my m4a files bought of itunes. So in summary i want suggestions on hard drive mp3 players that can transfer files with linux
  5. Here in Europe i seem to remeber reading something about them having till july this year to open up there technologies. If they dont do it to the satisfaction of the mediator, they will be fined 5% of there gross profit, roughly 5 million dollars a day untill they do open up the technologies. Now thats got to hurt, even a company like microsoft. p.s. not sure if i got all the details right couldnt find the article.
  6. According to this article windows is wiping the floor with linux in the server market. But dont the majority of websites use apache as a server. And i know there is a windows version of apache but it is not recommended for deployable systems. What are your thoughts?
  7. Ok im sorry maybe i should have said a bit more in my post. So ill answer your questions one by one. I want to build it from scratch, i have had a look at some pre-built programs but they were not really what i was looking for, I want to build this to build my php skills as in my final year of uni i am more than likely going to do my final year project in php. I would probably put my php skills at intermediate to advanced. I was going to use php/mysql for this little project. I have one idea of a way to do this, howver i was just going to see if anyone could give me any recommendations. The way i was thinking of doing this is as so: I would place appointmentas on the hour and then find all appointments for that day and format them appropriatly, not sure how to do that yet. This seems a rather cumbersome way to do it so i was posting here to see if anyone might know of a library of functions that may do this slightly better. As a side note. Im not having a go at you adriano its something i have been noticing more and more. Its good to get recommendations for somethings, I always google first and whilst it is a great tool it sometimes is difficult to find exactly what you want so what is wrong with seeing if anyone can recomend a site for what you need. I may not of put my point accross very well, i often find it difficult to say what i mean on the internet. I do not mean to offend anyone.
  8. Wasnt entirely sure where to post this i wanted to ask some advice from anyone who knows php here which i suspect is quite a few here.nearly finished uni for the summer and decided over the summer i woyuld build myself an online portal to use as my start page. I decided to do this as i use so many computers scattered everywhere and also several different OS's. Doing this would save me creatingg my bookmarks time and time again and would allow me a common place to find out my data. On this start page i am going to have various things bookmarks to favourite sites, todo lists and also a run down of any appointments lectures etc, e.g calender software in any PIM software. So here comes my question, can anyone suggest the best way to do this.
  9. I did have a go with dosbox however it doesnt seem to load the game i just get a black screen, in the supported list this game it has a supported level of runable but the bar is low some im guessing support is not there for this game. I may go back and try. Update on the windows 95 i have now got windows 95 installed hjowever it does not detect my soundcard ive tried ionstalling windows 95 drivers and it still does not work. I know this is the wrong forum to ask as it is a linux forum and not windows but does anyone have any ideas
  10. I have been looking for the solution for this everywhere. I wanted to play a few old dos games and i have never been able to understand or get dosemu working so i thought id try installing windows 95 on a virtual machine and playing this one parrticular game in there. However my install cd is not bootable, and i have no floppy drive to create a windows 95 boot diskette. Therefore im asking how can i get this working as i want to play a few of my old games. I know vmware can emulate a floppy image however i cant find a floppy image of a boot disk anywhere.
  11. Hi i want to install do and windows 3.1 in a virtual machine to play an old game of mine. I no longer own the disks for them however i was able to download them. I created a virtual machine and then realised i have no floppy drive, the last time i used one was probably about three years ago. The only floppy drive i have lying around the house doesnt want to read any of my floppies The first DOS disk was already packaged as an image file which vmware quite happily read the rest of the disks however are just folders with all the required files on that disk. I need to know how i can create a floppy disk image preferably .flp however vmware also seems to accept .IMA files. I found dd if=/dev/fd0 of=/path/to/newfile.flp to create an image from a floppy but i want to create it from a directory. Any help.
  12. Hi im thinking about doing some kind of certification in linux as far as i can see where i am in the u.k. i have two choices RHCE, or LPI certification. I was wondering which one people could suggest at the moment i am leaning towards the lpi certification as it is not specific to a certain distro as far as im aware. Also what can i expect from the exam, ive been discussing it with some of my lecturers who are taking the LPI certificate and they say it is quite difficult. Just wanted your opinions, before i commit to a choice.
  13. Hi im having to code a java applet which is a simplified version of microsoft paint. I hjave managed to code the display and eventhandling needed and am not sure about how to go about actually getting it to then paint the shapes to the drawing area. I was wonmdering if someone could suggest a way to go about doing this i am not all that experienced at java and believe i am heading in the right direction however after reading many materials i am unsure on exactly how the paint function works this is the code i have currently: import java.applet.*; import java.awt.*; import javax.swing.*; import javax.swing.event.ChangeListener; import javax.swing.event.ChangeEvent; import java.awt.event.*; public class paint extends JApplet { private JLabel pointerLocation; private JPanel colorChooser,canvasArea,menuArea; private JSlider redSlider,greenSlider,blueSlider; private JButton lineButton,thickLineButton,circleButton,filledCircleButton,rectangleButton,fille dRectangleButton,eraserButton; private ImageIcon line,lineThick,circle,circleFilled,rect,rectFilled,eraser; private String shape; private int startx, starty, endx, endy, height, width; public Graphics g; public void init() { Container content = getContentPane(); //Create the three panels pointerLocation = new JLabel(); menuArea = new JPanel(new GridLayout(8,1)); canvasArea = new JPanel(); colorChooser = new JPanel(); ButtonHandler handler = new ButtonHandler(); //create buttons for left panel line = new ImageIcon("line.gif"); lineButton = new JButton(line); lineButton.addActionListener(handler); lineThick = new ImageIcon("thickLine.gif"); thickLineButton = new JButton(lineThick); thickLineButton.addActionListener(handler); circle = new ImageIcon("circle.gif"); circleButton = new JButton(circle); circleButton.addActionListener(handler); circleFilled = new ImageIcon("circlefilled.gif"); filledCircleButton = new JButton(circleFilled); filledCircleButton.addActionListener(handler); rect = new ImageIcon("rect.gif"); rectangleButton = new JButton(rect); rectangleButton.addActionListener(handler); rectFilled = new ImageIcon("rectFilled.gif"); filledRectangleButton = new JButton(rectFilled); filledRectangleButton.addActionListener(handler); eraser = new ImageIcon("eraser.gif"); eraserButton = new JButton(eraser); eraserButton.addActionListener(handler); //setup left panel menuArea.setPreferredSize (new Dimension (35,0)); menuArea.add(lineButton); menuArea.add(thickLineButton); menuArea.add(circleButton); menuArea.add(filledCircleButton); menuArea.add(rectangleButton); menuArea.add(filledRectangleButton); menuArea.add(eraserButton); //setup main canvas area MouseListener mouseListener = new MousePressListener(); addMouseListener(mouseListener); canvasArea.setBackground(Color.white); canvasArea.setPreferredSize (new Dimension (700,350)); //create layout content.setLayout (new BorderLayout()); content.add (canvasArea, BorderLayout.CENTER); content.add (menuArea, BorderLayout.WEST); ChangeListener listener = new ColorListener(); redSlider = new JSlider (0,100,100); redSlider.addChangeListener(listener); greenSlider = new JSlider (0,100,100); greenSlider.addChangeListener(listener); blueSlider = new JSlider (0,100,100); blueSlider.addChangeListener(listener); colorChooser.setLayout(new GridLayout(3,2)); colorChooser.add(new JLabel("Red",SwingConstants.RIGHT)); colorChooser.add(redSlider); colorChooser.add(new JLabel("Green",SwingConstants.RIGHT)); colorChooser.add(greenSlider); colorChooser.add(new JLabel("Blue",SwingConstants.RIGHT)); colorChooser.add(blueSlider); getContentPane().add (colorChooser, BorderLayout.SOUTH); getContentPane().add (pointerLocation, BorderLayout.NORTH); } //create event handler for slider bars to change backgorund color. class ColorListener implements ChangeListener { public void stateChanged (ChangeEvent event) { float red = 0.01F * redSlider.getValue(); float green = 0.01F * greenSlider.getValue(); float blue = 0.01F * blueSlider.getValue(); canvasArea.setBackground(new Color(red,green,blue)); canvasArea.repaint(); } } //create event handler for action buttons class ButtonHandler implements ActionListener { public void actionPerformed (ActionEvent event) { String shape = event.getActionCommand(); } } //create mouse handler for canvas class MousePressListener implements MouseListener { public void mousePressed (MouseEvent event) { int startx = event.getX(); int starty = event.getY(); } public void mouseReleased (MouseEvent event) { int endx = event.getX(); int endy = event.getY(); int width = event.getX() - startx; int height = event.getY() - starty; if (shape == "line") { g.drawLine(startx,starty,endx,endy); } if (shape == "lineThick") { } if (shape == "circle") { g.drawOval(startx,starty,width,height); } if (shape == "circleFilled") { g.fillOval(startx,starty,width,height); } if (shape == "rect") { g.drawRect(startx,starty,width,height); } if (shape == "rectFilled") { g.fillRect(startx,starty,width,height); } if (shape == "eraser") { g.drawOval(startx,starty,10,10); } } public void mouseClicked (MouseEvent event) {} public void mouseEntered (MouseEvent event) {} public void mouseExited (MouseEvent event) {} } } I know there must be someone on this forum whos good at java. Than ks for any help.
  14. im having a bit of trouble with an sql statement. Here is the problem i have two tables which share a common field. table 1 is called units and has two fields unitCode and unitName. table 2 is called courseUnits and 2 fields unitCode and couresCode. here is an sql dump of my table at the momment CODE CREATE TABLE `units` ( `unitCode` varchar(4) NOT NULL default '', `unitName` varchar(50) NOT NULL default '', PRIMARY KEY (`unitCode`) ) TYPE=MyISAM; -- -- Dumping data for table `units` -- INSERT INTO `units` VALUES ('B101', 'Proffesional Studies'); INSERT INTO `units` VALUES ('B202', 'Proffesional Studies 3'); INSERT INTO `units` VALUES ('B253', 'Network Configuration And Administration'); CODE CREATE TABLE `courseUnits` ( `courseCode` varchar(4) NOT NULL default '', `unitCode` varchar(4) NOT NULL default '', PRIMARY KEY (`courseCode`,`unitCode`) ) TYPE=MyISAM; -- -- Dumping data for table `courseUnits` -- INSERT INTO `courseUnits` VALUES ('CS', 'B101'); INSERT INTO `courseUnits` VALUES ('CS', 'B202'); INSERT INTO `courseUnits` VALUES ('CS', 'B253'); INSERT INTO `courseUnits` VALUES ('CTB', 'B101'); INSERT INTO `courseUnits` VALUES ('CTB', 'B202'); INSERT INTO `courseUnits` VALUES ('CTB', 'B251'); INSERT INTO `courseUnits` VALUES ('ITB', 'B101'); INSERT INTO `courseUnits` VALUES ('ITB', 'B253'); What i want the search to do is for example if i want to list all unitnames for the course CTB. I have the following sql statement. SELECT units.unitName, units.unitCode FROM units, courseUnits WHERE courseUnits.courseCode = CTB however this gives the error Unknown column 'CTB' in 'where clause' Can anyone tell me what is wrong with this sql statement. been looking at it four 3 hours. Once ive done this last bit my work will finally be done.
  15. Im creating a website for a uni project and need some help with forms. The website i am talking about can be found at www.housedarus.co.uk/ECE/admin/coursetest.php. The login is admin password =password. Heres the problem I need some kind of field to let users choose units that will belong to a course therefore i need a way for a user to select upto 36 units which will then be placed in a database. The question i put before you all is how should i let the users select these units. If yoyu look at the page above you can see i have tried using option field and increased its size and set it as multiple however although i choose multiple units only one unit is returned in the post field for the option box. Another way i could do it is to set lots off option fields however this is a bit cumbersome and not really open enough to allow you to select as many units as you want. Have a look at the site if this post is not very clear. basically how do i get option to return multiple options. This is the code for the page. <?php session_start(); //This script adds a user to the users table //Check if there is a current session if not send user to login page if ($_SESSION[valid] != "yes") { header("location: http://www.housedarus.co.uk/ECE/adminlogin.php"); exit; } $validUser = $_SESSION['user']; include '../includes/sql_connect.php'; //select course to place in option box in form $units = "SELECT unitName unitCode FROM units "; $result = @mysql_query($units,$connection) or die(mysql_error()); //create options for the forms course options while ($row = mysql_fetch_array($result)) { $unitName = $row['unitName']; $unitCode = $row['unitCode']; $select_block .= "<option value =\"$unitCode\">$unitName $unitCode</option>"; } include "../includes/header.php"; //Display navigation links echo "<P><CENTER> <A HREF=\"http://www.housedarus.co.uk/ECE/admin/administrators.php\" BORDER=\"0\"><IMG SRC=\"http://www.housedarus.co.uk/ECE/images/buttonsAdmin.png\" BORDER=\"0\"></A> <A HREF=\"http://www.housedarus.co.uk/ECE/admin/users.php\" BORDER=\"0\"><IMG SRC=\"http://www.housedarus.co.uk/ECE/images/buttonsUsers.png\" BORDER=\"0\"></A> <A HREF=\"http://www.housedarus.co.uk/ECE/admin/lecturers.php\" BORDER=\"0\"><IMG SRC=\"http://www.housedarus.co.uk/ECE/images/buttonsLecturers.png\" BORDER=\"0\"></A> <A HREF=\"http://www.housedarus.co.uk/ECE/admin/courses.php\" BORDER=\"0\"><IMG SRC=\"http://www.housedarus.co.uk/ECE/images/buttonsCourses.png\" BORDER=\"0\"></A> <A HREF=\"http://www.housedarus.co.uk/ECE/admin/units.php\" BORDER=\"0\"><IMG SRC=\"http://www.housedarus.co.uk/ECE/images/buttonsUnits.png\" BORDER=\"0\"></A> <A HREF=\"http://www.housedarus.co.uk/ECE/admin/cabinets.php\" BORDER=\"0\"><IMG SRC=\"http://www.housedarus.co.uk/ECE/images/buttonsCabinets.png\" BORDER=\"0\"></A></CENTER></P>"; //if a form has been submitted if ($_POST[submission] == "true") { //Check if details have been entered if not display message if (!$_POST[courseCode] || !$_POST[courseName]) { echo "You have not entered all the details required please try again"; } //insert into table if details are entered else { $courseCode = $_POST[courseCode]; $courseName = $_POST[courseName]; $query = "INSERT into courses values ('$courseCode', '$courseName')"; $result = @mysql_query($query,$connection) or die(mysql_error()); $count = "1"; echo "<TABLE ALIGN=\"CENTER\"><TR><TD BGCOLOR=\"E2D3EF\">"; echo "course $_POST[courseName] inserted into database courses with the following data:<BR>"; echo "courseCode = $_POST[courseCode]<br>"; echo "courseName $_POST[courseName]<BR>"; echo "Units Entered $_POST[units]"; echo "</TR></TD></TABLE>"; } } //if delete button pressed delete the user if ($_POST[deletehidden] == "true") { $delHemis = $_POST[delCourse]; $delete = "DELETE from courses WHERE courseCode='$delCourse'"; $result = @mysql_query($delete,$connection) or die (mysql_error()); echo "<TABLE ALIGN=\"CENTER\"><TR><TD BGCOLOR=\"E2D3EF\">"; echo "User $_POST[delCourse] deleted from database"; echo "</TR></TD></TABLE>"; } //if modify button pressed display modification form or run query if ($_POST[modifyTrue] == "true") { if ($_POST[commitmodify] == "true") { if ($_POST[courseName]) { $updateCourseName = "UPDATE courses SET courseName = '$_POST[courseName]' WHERE courseCode = '$_POST[courseCodeOld]'"; $courseNameResult = mysql_query($updateCourseName,$connection) or die (mysql_error()); } if ($_POST[courseCodeNew]) { $updateCourseCode = "UPDATE courses SET courseCode = '$_POST[courseCodeNew]' WHERE courseCode = '$_POST[courseCodeOld]'"; $courseCodeResult = mysql_query($updateCourseCode,$connection) or die (mysql_error()); } if ($courseNameResult || $courseCodeResult) { echo "<TABLE ALIGN=\"CENTER\"><TR><TD BGCOLOR=\"E2D3EF\">"; echo "The following details have been changed:<P><UL SHAPE=\"disc\""; if ($courseNameResult) { echo "<LI>The new courseName is $_POST[courseName]"; } if ($courseCodeResult) { echo "<LI>The new courseCode is $_POST[courseCodeNew]"; } echo "</P></UL>"; echo "</TR></TD></TABLE>"; } else { echo "<TABLE ALIGN=\"CENTER\"><TR><TD BGCOLOR=\"E2D3EF\">"; echo "You have not entered any new details"; echo "</TR></TD></TABLE>"; } } else { echo "<CENTER><P><TABLE> <TR BGCOLOR=\"9E84BE\"><TD>Course Code &nbsp</TD><TD>Course Name &nbsp</TD></TR> <TR BGCOLOR=\"E2D3EF\"><TD>$_POST[courseCode]</TD><TD>$_POST[courseName]</TD></TR></TABLE><P></CENTER>"; echo "<CENTER><form method=post action=\"$_SERVER[PHP_SELF]\"><FIELDSET><LEGEND> MODIFY COURSE</LEGEND> <input type=\"hidden\" name=\"modifyTrue\" value=\"true\"> <input type=\"hidden\" name=\"commitmodify\" value=\"true\"> <input type=\"hidden\" name=\"courseCodeOld\" value=\"$_POST[courseCode]\"> &nbsp<strong>Course Code:</strong> <input type=\"text\" name=\"courseCodeNew\" size=15 maxlength=6>&nbsp &nbsp<strong>Course Name:</strong> <input type=\"text\" name=\"courseName\" size=15 maxlength=25>&nbsp <BR> <input type=\"submit\" name=\"submit\" value=\"Modify Course\"></CENTER></FIELDSET> </FORM>"; } } //if form has not been submitted show form to enter details $courses = "SELECT courseCode, courseName FROM courses "; $coursesresult = @mysql_query($courses,$connection) or die(mysql_error()); $lineRow = "even"; //while a row exists add to table while ($row = mysql_fetch_array($coursesresult)) { $courseCode = $row['courseCode']; $courseName = $row['courseName']; //Create table rows if ($lineRow == "even") { $table_block .= "<TR BGCOLOR=\"E2D3EF\"><TD>$courseCode</TD><TD>$courseName</TD><TD> <form method=post action=\"$_SERVER[PHP_SELF]\"> <input type=\"hidden\" name=\"delCourse\" value=\"$courseCode\"> <input type=\"hidden\" name=\"deletehidden\" value=\"true\"> <input type=\"submit\" name=\"delete\" value=\"Delete\"> </form></TD> <TD><form method=post action=\"$_SERVER[PHP_SELF]\"> <input type=\"hidden\" name=\"modifyTrue\" value=\"true\"> <input type=\"hidden\" name=\"courseCode\" value=\"$courseCode\"> <input type=\"hidden\" name=\"courseName\" value=\"$courseName\"> <input type=\"submit\" name=\"modify\" value=\"Modify\"> </form></TD></TR>"; $lineRow = "odd"; } else { $table_block .= "<TR BGCOLOR=\"9E84BE\"><TD>$courseCode</TD><TD>$courseName</TD><TD> <form method=post action=\"$_SERVER[PHP_SELF]\"> <input type=\"hidden\" name=\"delCourse\" value=\"$courseCode\"> <input type=\"hidden\" name=\"deletehidden\" value=\"true\"> <input type=\"submit\" name=\"delete\" value=\"Delete\"> </form></TD> <TD><form method=post action=\"$_SERVER[PHP_SELF]\"> <input type=\"hidden\" name=\"modifyTrue\" value=\"true\"> <input type=\"hidden\" name=\"courseCode\" value=\"$courseCode\"> <input type=\"hidden\" name=\"courseName\" value=\"$courseName\"> <input type=\"submit\" name=\"modify\" value=\"Modify\"> </form></TD></TR>"; $lineRow = "even"; } } if ( !$_POST[modifyTrue] || ($_POST[modifyTrue] == "true" && $_POST[commitmodify] == "true" )) { echo "<CENTER><P> <form method=post action=\"$_SERVER[PHP_SELF]\"><FIELDSET><LEGEND>Add Course Information</LEGEND> $msg &nbsp<strong>Course Code:</strong> <input type=\"text\" name=\"courseCode\" size=5 maxlength=6>&nbsp &nbsp<strong>Course Name:</strong> <input type=\"text\" name=\"courseName\" size=15 maxlength=25>&nbsp<BR> Please Enter the units available on this Course:<BR>"; echo "<TABLE><TR><TD>"; echo " <select name=\"units\" SIZE=10 MULTIPLE> <OPTION SELECTED VALUE=\"\"> $select_block </select>"; echo "<TABLE><TR><TD>"; echo"</td></td></TABLE><input type=\"hidden\" name=\"submission\" value=\"true\"><BR> <input type=\"submit\" name=\"submit\" value=\"Submit New User\"></CENTER> </form><P>"; } echo "<TABLE align=\"center\"><TR BGCOLOR=\"9E84BE\"> <TD WIDTH =100>Course Code</TD><TD>CourseName</TD><TD></TD><TD></TD></TR>"; echo "$table_block"; echo "</TABLE>"; include "../includes/footer.php"; ?> The Proplem is solved now i needed to put the options into an array. [moved from Talk-Talk by spinynorman]
×
×
  • Create New...