•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the PHP section within the Web Development category of DaniWeb, a massive community of 456,521 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,802 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our PHP advertiser: Lunarpages PHP Web Hosting
Views: 1437 | Replies: 11
![]() |
•
•
Join Date: Oct 2007
Posts: 6
Reputation:
Rep Power: 0
Solved Threads: 0
Hi all.
I have an application were a user fitt (outside the game) a "ship" and after the full fitt he can save that in a doc file.
In that file we'll see 4 fields with vari lines in each of them (not the same fitt for all the ships).
I want to create a form where you paste the entire content of the file and submit. That will be placed in mysql database. There is a page were the users can search a ship and he will see all the fittings availble for the ship he selected on a webpage.
Can anyone help me get this thing going ?
Would be much apriciated if someone could help me.
Example of the file:
Item 1 Low Slot
Item 2 Low Slot
Item 3 Low Slot
Item 1 Med Slot
Item 2 Med Slot
Item 3 Med Slot
Item 4 Med Slot
Item 1 High Slot
Item 2 High Slot
Item 3 High Slot
Item 4 High Slot
Item 5 High Slot
Item 1 Rig Slot
Item 2 Rig Slot
I have an application were a user fitt (outside the game) a "ship" and after the full fitt he can save that in a doc file.
In that file we'll see 4 fields with vari lines in each of them (not the same fitt for all the ships).
I want to create a form where you paste the entire content of the file and submit. That will be placed in mysql database. There is a page were the users can search a ship and he will see all the fittings availble for the ship he selected on a webpage.
Can anyone help me get this thing going ?
Would be much apriciated if someone could help me.
Example of the file:
Item 1 Low Slot
Item 2 Low Slot
Item 3 Low Slot
Item 1 Med Slot
Item 2 Med Slot
Item 3 Med Slot
Item 4 Med Slot
Item 1 High Slot
Item 2 High Slot
Item 3 High Slot
Item 4 High Slot
Item 5 High Slot
Item 1 Rig Slot
Item 2 Rig Slot
•
•
Join Date: Jun 2007
Location: Valley Center, Kansas
Posts: 643
Reputation:
Rep Power: 3
Solved Threads: 72
•
•
Join Date: Oct 2007
Posts: 6
Reputation:
Rep Power: 0
Solved Threads: 0
Hi Keith
Fitt is for "Fitting".
I play a game were we have ships and need to br fitted with some equipment.
We have a 3party tool that give us the possibility to "test" some fittings (when you drag the modules into the shipp it gives the stats of battle and ship endurance).
After fitting you can copy the fitting and paste were ever you want.
I would like to make a page so the members of my corp can share some info.
1 - They would paste the info in some kind of form and when submited it drops the info in a mysql;
2 - In a search page they will get a result according to their needs.
Fitt is for "Fitting".
I play a game were we have ships and need to br fitted with some equipment.
We have a 3party tool that give us the possibility to "test" some fittings (when you drag the modules into the shipp it gives the stats of battle and ship endurance).
After fitting you can copy the fitting and paste were ever you want.
I would like to make a page so the members of my corp can share some info.
1 - They would paste the info in some kind of form and when submited it drops the info in a mysql;
2 - In a search page they will get a result according to their needs.
•
•
Join Date: Jun 2007
Location: Valley Center, Kansas
Posts: 643
Reputation:
Rep Power: 3
Solved Threads: 72
•
•
Join Date: Oct 2007
Posts: 6
Reputation:
Rep Power: 0
Solved Threads: 0
Medium Armor Repairer II
Reactor Control Unit II
Power Diagnostic System II
Adaptive Nano Plating II
Reactor Control Unit II
Cap Recharger II
Cap Recharger II
Cap Recharger II
Medium Nosferatu II
Medium Nosferatu II
Medium Nosferatu II
Medium Nosferatu II
Anti-Thermic Pump II
Anti-Kinetic Pump II
_____________________
This is one example of a fitting created in the program. This is what I'v got to copy/paste.
The first 5 lines represent the low-slot of the ship, the next 3 the mid-slot, the other 4 are the high-slot and the last 2 are the rig-slot.
The number of lines per slot are diferent from ship to ship.
The user should copy the file (like the one above) and paste it to a form, he also need to give a name to the fitting (on another field).
The field of the table should be something like:
ID;
Ship; (this one the real name of the ship from the game)
Fitting;
Date; (optional)
Reactor Control Unit II
Power Diagnostic System II
Adaptive Nano Plating II
Reactor Control Unit II
Cap Recharger II
Cap Recharger II
Cap Recharger II
Medium Nosferatu II
Medium Nosferatu II
Medium Nosferatu II
Medium Nosferatu II
Anti-Thermic Pump II
Anti-Kinetic Pump II
_____________________
This is one example of a fitting created in the program. This is what I'v got to copy/paste.
The first 5 lines represent the low-slot of the ship, the next 3 the mid-slot, the other 4 are the high-slot and the last 2 are the rig-slot.
The number of lines per slot are diferent from ship to ship.
The user should copy the file (like the one above) and paste it to a form, he also need to give a name to the fitting (on another field).
The field of the table should be something like:
ID;
Ship; (this one the real name of the ship from the game)
Fitting;
Date; (optional)
•
•
Join Date: Oct 2007
Posts: 6
Reputation:
Rep Power: 0
Solved Threads: 0
•
•
•
•
All this is, is basic parsing of information and separating it into their relevant fields. What don't you get?
I know that is just parsing. The problem is that the text don't have fixed fields.
The text change from fitting to fitting, ex:
Fitting 1:
Medium Armor Repairer II
Reactor Control Unit II
Power Diagnostic System II
Cap Recharger II
Cap Recharger II
Medium Nosferatu II
Medium Nosferatu II
Medium Nosferatu II
[empty rig slot]
Fitting 2:
Medium Armor Repairer II
1600mm Reinforced Titanium Plates I
Energized Basic Adaptive Nano Plating
Magnetic Field Stabilizer II
Partial Power Plant Manager: Capacity Power Relay
Type-D Power Core Modification: Capacitor Power Relay
Heavy Capacitor Booster II
Sensor Booster II
Magnetic Scattering Amplifier II
100MN Afterburner II
[empty high slot]
Neutron Blaster Cannon II
Neutron Blaster Cannon II
Neutron Blaster Cannon II
Neutron Blaster Cannon II
Neutron Blaster Cannon II
[empty rig slot]
[empty rig slot]
As you can see I have here 2 diferent fittings for 2 diferent ships. How can I parse this?
•
•
Join Date: Jul 2004
Location: North East Indiana
Posts: 491
Reputation:
Rep Power: 5
Solved Threads: 20
What you'd have to do is make sure the patterns exist for each input file (they don't have to be strict patterns, just a standard format) and then parse your files off of that. If you don't have any patterns to match, you've got a situation where you're trying to do human-level comprehension. That's way beyond the average PHP program.
www.uncreativelabs.net
Old computers are getting to be a lost art. Here at Uncreative Labs, we still enjoy using the old computers. Sometimes we want to see how far a particular system can go, other times we use a stock system to remind ourselves of what we once had.
Old computers are getting to be a lost art. Here at Uncreative Labs, we still enjoy using the old computers. Sometimes we want to see how far a particular system can go, other times we use a stock system to remind ourselves of what we once had.
•
•
Join Date: Jul 2004
Location: North East Indiana
Posts: 491
Reputation:
Rep Power: 5
Solved Threads: 20
Take a moment and look at what will always be the same in your file.
1. Are the "fittings" from a standard set?
2. Is each blank line guaranteed to be there?
2a. What about line endings? (Does an EOL mean end of item slot?)
3. Can "fittings" go in a different place on your "vessel" or are they one position only?
3a. If they can go multiple places, does the order of the list matter?
1. Are the "fittings" from a standard set?
2. Is each blank line guaranteed to be there?
2a. What about line endings? (Does an EOL mean end of item slot?)
3. Can "fittings" go in a different place on your "vessel" or are they one position only?
3a. If they can go multiple places, does the order of the list matter?
www.uncreativelabs.net
Old computers are getting to be a lost art. Here at Uncreative Labs, we still enjoy using the old computers. Sometimes we want to see how far a particular system can go, other times we use a stock system to remind ourselves of what we once had.
Old computers are getting to be a lost art. Here at Uncreative Labs, we still enjoy using the old computers. Sometimes we want to see how far a particular system can go, other times we use a stock system to remind ourselves of what we once had.
![]() |
•
•
•
•
•
•
•
•
DaniWeb PHP Marketplace
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
- How to insert PHP in HTML language? (PHP)
- Need Help With HTML! (Site Layout and Usability)
- HTML parsing (Java)
- Web Crawler (Java)
- how to get url links (C++)
- WebCrawler problem (Java)
- HTML problems (Windows NT / 2000 / XP / 2003)
- XHTML Complient parser? (HTML and CSS)
- embPerl or PHP (Perl)
Other Threads in the PHP Forum
- Previous Thread: Need Help with converting an ID to a Name
- Next Thread: preg_replace



Linear Mode