| | |
Parse html
Please support our PHP advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
![]() |
•
•
Join Date: Oct 2007
Posts: 6
Reputation:
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: Oct 2007
Posts: 6
Reputation:
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: Oct 2007
Posts: 6
Reputation:
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:
Solved Threads: 0
•
•
•
•
All this is, is basic parsing of information and separating it into their relevant fields. What don't you get?
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
Posts: 494
Reputation:
Solved Threads: 21
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
Posts: 494
Reputation:
Solved Threads: 21
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.
![]() |
Similar Threads
- 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)
- 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
| Thread Tools | Search this Thread |
.htaccess alerts apache api archive array autocomplete beginner binary broken cakephp checkbox class cms code convert cron curl database dataentry date display duplicates dynamic echo email emptydisplayvalue error execute explodefunction file files firstoptioninphpdroplist folder form forms function functions google hack href htaccess html htmlspecialchars image include insert ip javasciptvalidation javascript joomla keywords limit link login mail matching menu methods mlm multiple mysql network object oop paypal pdf php problem query radio random recursion recursive redirect remote script search securephp server sessions shot sms source space sql subscription syntax system table tutorial tutorials update upload url validator variable video web youtube






