Parsing Techniques?

I am working on a little tool to make it easier to manage some Text-based account files by using the StringTokenizer class. Although, those files have to be built in a very specific way so the program can understand the data correctly. I figured out that surely, my parsing technique wasn't really user-friendly. Since then, I've been wondering what are the best Parsing Techniques that I should use. Taking the example of the Java Compiler, it can understand many code structures, and that's why I'd like to have my program use the best parsing techniques :)
If anyone can point me to:
-tutorials
-APIs
Or if anyone can teach me directly in this post,
I'd be very thankful :)

Here's an extra tip for you. I think you might be better off if you change from an INI-like file format to XML documents. That would enable you to add a degree of validation by creating an XML schema and implementing the existing Java XML parser technology into your product. You probably don't want to do something like that right away, but I'm just saying it's a good thing to consider it for the (near) future.
Example XML based on your example INI:
<account name="AccountName">
<password>password</password>
<level>admin</level>
<lang>en</lang>
<totalconnecttime>845</totalconnecttime>
</account>
<account name="AccountName2">
<password>password</password>
<level>guest</level>
<lang>fra</lang>
<totalconnecttime>157</totalconnecttime>
</account>
With an XML schema, you can specify things such as "totalconnecttime must be numeric" and "lang must be 2 or 3 characters length". By incorporating an existing, validating Java XML parser you have put relatively little effort into validating your files. Effectively, you make your files more reliable this way...

Similar Messages

  • How to use parsing technique to access a particular value from a webpage

    hi,
    i'm in need of a coding to access a particular value from a webpage only by using its link. one of my friend said the we can do this by parsing technique. but i doesn't have knowledge about it. can any one help me?

    ksnagendran26 wrote:
    hi,
    i'm in need of a coding to access a particular value from a webpage only by using its link. one of my friend said the we can do this by parsing technique. but i doesn't have knowledge about it. can any one help me?I'm sorry could you explain in detail what do you mean by +"access a particular value from a webpage only by using its link"+?

  • Fastest Text Parsing Technique

    Hi all,
    I have a set of huge text files that I need to quickly parse and remove all the asteriks characters from. At the moment my simple program looks like this:
    import java.io.*;
    public class QuickParse
         public static void main(String[] args) throws Exception
              BufferedReader in = new BufferedReader(new FileReader(args[0]));
              PrintWriter out = new PrintWriter(new BufferedWriter(new FileWriter(args[1])));
              String str = "";
              while ((str = in.readLine()) != null)
                   out.write(str.replaceAll("\\*","") + "\r\n");
              in.close();
              out.close();
    }Is there a faster way of doing this? These files are well over a gig each. I'm aware that at the moment this program may well be leaving lots of String objects in memory, but I'm not sure what to do about it, or if this would slow the process down.
    Thanks for any help or ideas.

    I created a test file with 100k lines and total file size of about 10.6M. Each line looked like this:
    0*1000000000*2000000000*3000000000*4000000000*5000000000*6000000000*7000000000*8000000000*9000000000*
    I never know exactly how to test IO since the second time you read a file it is usally faster because part of the file is in memory. Anyway, I ran my test program 6 times changing the order of method invocation within each run. Here are my results:
    c:\java\temp>java QuickParse 1
    Replace : 2297
    Tokenize: 1859
    Movebyte: 1938
    c:\java\temp>java QuickParse 2
    Tokenize: 1000
    Movebyte: 1937
    Replace : 2219
    c:\java\temp>java QuickParse 3
    Movebyte: 1937
    Replace : 2281
    Tokenize: 1563
    c:\java\temp>java QuickParse 1
    Replace : 2297
    Tokenize: 1469
    Movebyte: 1922
    c:\java\temp>java QuickParse 2
    Tokenize: 1015
    Movebyte: 1906
    Replace : 2219
    c:\java\temp>java QuickParse 3
    Movebyte: 1906
    Replace : 2281
    Tokenize: 969
    Order of method execution didn't seem to matter. The results (from best to worst) was always:
    a) Tokenize
    b) Movebyte
    c) Replace
    Here is the code I executed:
    import java.io.*;
    import java.util.*;
    public class QuickParse
         public static void main(String[] args) throws Exception
    //          String input = "C:\\Java\\j2sdk1.4.2\\src\\javax\\swing\\JComponent.java";
              String input = "data100000";
              if (args[0].equals("1"))
                   replace(input, "output.replace");
                   tokenize(input, "output.tokenize");
                   movebyte(input, "output.movebyte");
              else if (args[0].equals("2"))
                   tokenize(input, "output.tokenize");
                   movebyte(input, "output.movebyte");
                   replace(input, "output.replace");
              else if (args[0].equals("3"))
                   movebyte(input, "output.movebyte");
                   replace(input, "output.replace");
                   tokenize(input, "output.tokenize");
         public static void replace(String input, String output) throws Exception
              long start = System.currentTimeMillis();
              BufferedReader in = new BufferedReader( new FileReader( input ) );
              BufferedWriter out = new BufferedWriter( new FileWriter( output ) );
              String str = "";
              while ((str = in.readLine()) != null)
                   out.write(str.replaceAll("\\*","") + "\r\n");
              in.close();
              out.close();
              System.out.println("Replace : " + (System.currentTimeMillis() - start) );
         public static void tokenize(String input, String output) throws Exception
              long start = System.currentTimeMillis();
              BufferedReader in = new BufferedReader( new FileReader( input ) );
              BufferedWriter out = new BufferedWriter( new FileWriter( output ) );
              String str = "";
              while ((str = in.readLine()) != null)
                   StringTokenizer st = new StringTokenizer(str, "*");
                   while (st.hasMoreTokens())
                        out.write(st.nextToken());
                   out.write("\r\n");
              in.close();
              out.close();
              System.out.println("Tokenize: " + (System.currentTimeMillis() - start) );
         public static void movebyte(String input, String output) throws Exception
              long start = System.currentTimeMillis();
              BufferedInputStream in = new BufferedInputStream( new FileInputStream( input ) );
              BufferedOutputStream out = new BufferedOutputStream( new FileOutputStream( output ) );
              byte[] buffer = new byte[4 * 1024];
              int bytes;
              while ( (bytes = in.read( buffer )) != -1 )
                   for (int i = 0; i < bytes; i++)
                        if (buffer[i] != (byte)'*')
                             out.write( buffer, i, 1 );
              in.close();
              out.close();
              System.out.println("Movebyte: " + (System.currentTimeMillis() - start) );
    }

  • Need to Parse XML Message from my Message Driven Bean

    Hi
    I am using Message Driven Beans for listening to a Queue .
    I am getting a Big XML file from my Queue in form of a TextMessage .
    Now my task is to read / parse the XML Message .
    Please tell me what is the appropiate parsing technique i need to use (Should i use SAX or DOM )
    Please share your ideas .
    Thank you .

    Generally you want to use SAX if the file is so big that loading it all in memory (as DOM does) will create memory problems.
    Read about these methods on the wiki page for [JAXP.|http://en.wikipedia.org/wiki/Java_API_for_XML_Processing]

  • XML serializing/deserializing versus parsing

    Hi all,
    This is not a strictly java question but after reading many discussions and creative solutions offered by different members of this forum, i feel that the right audience for my question are the folks in this very forum. Moderator, if you feel this question makes sense in a different forum, where it might get better responses feel free to move it.
    We are starting off on a new b2b web services project. Everyone in the group agreed that in order to appropriately serve the consumers in our space the best format to use is XML. We are java based and our first consumer is also java based, but we see in the future that our services will be consumed by other types of consumers as well. There seems to be a deep divide in how the xml structure should look like. There are two schools of thoughts. The first one (which is the popular one) is to have loosely typed tag names. Something like this
    <header>
    <map>
    <entry>
    <string>CUSTOMERNAME</string>
    <string>Mahesh</string>
    </entry>
    </map>
    </header>
    The idea being, we could dump regular marshalling/unmarshalling/parsing techniques in favor of a serializing/deserializing tool (Like XStream). The argument here is that we don't worry about a schema/parsing etc and always deal with some sort of generic collection. The other argument is that parsing is more heavier (in terms of performance) than serializing/deserializing.
    I believe that (i belong to the other less popular school of thought) any xml structure should have a real structure (strongly typed tag names). The problems i have with the proposed structure are
    1. They are not self describing, i.e. no wsdl
    2. They cant be parsed with a SAX parser (since there are no tag names, i dont think they can be parsed with a SAX parser, but if anyone here disagrees please correct me)
    3. Since regular parsing is out of the question, you cant predict how your consumers are using it.
    4. I think that the only place to use a serializing/deserializing technique is when you control both end points (producer and consumer).
    What i wanted to find out from the audience here is what they think of the pros/cons of the XML structure described above. Specifically in terms of
    1. Usablity
    2. Scalability
    3. Performance
    The generic structure is also being pitched as the 'next gen' way of defining and using XML. Is that true? Maybe i am just getting old and need to catch up.
    Any thoughts/comments are appreciated.

    user13698018 wrote:
    >
    What? Of course you can parse that "unstructured XML" with a SAX parser, why shouldn't you be able to do that? It's still XML after all.
    >
    You are right, it can be parsed. What i meant to say was i wont be able to extract information from it easily. For e.g. if i have to read the customer name what tag event will i look for? If i look for the event that fires off when i encounter tag name 'string' that will only give me the tag name and not the value. I have to come up with some sort of counter mechanism to disregard the first tag event and look at the second event. Is my assumption correct?Well, parsing the "freeform" XML with SAX requires a few tricks but can result in code that does pretty much the same thing.
    Since the information is exactly the same in both (except that one is a bit more verbose), I don't see any major differences in how it can be parsed.
    The only (seeming) difference is that for "strictly defined" XML you'll need to pre-define which tags/properties exist. But even that can be avoided by clever use of xs:any and allowing other namespaces (i.e. allow a mydata:favoriteColor tag inside your myStrictSchema:person tag).
    Once you do those, the two formats become even more equivalent: some of the advantages of having strictly-formed XML are lost (because you have to handle "unknown" tags again), while some of the disadvantages are lost as well (yeah! extensibility without modifying the core standard).
    In my (partially humble) opinion, the "free form XML" approach is often used when people are too lazy to investigate the wide variety of tools available via official XML techniques.
    >
    3. Since regular parsing is out of the question, you cant predict how your consumers are using it.
    >
    What i meant here was, if my consumers find regular parsing techniques difficult to parse they will resort to short cuts to extract the information (like regex to pull information) and that will make it difficult to predict how consumers are using the xml and hence make it difficult to plan for changes in the future. Am i over thinking here?That's always a possible problem and won't be avoided by any choice in data format. They will try it with "strict XML" and they will try it with "freeform XML". If you have some kind of consulting function, then you can try to communicate the dangers of this approach, but in the end you can hardly force people to "do it the right way".
    Which one would you use?I'd prefer the strictly specified one usually. But I don't know enough about the problem domain to give a qualified answer.

  • Choice between xquery and parsing methods

    I want to read from an xml source file. I have been working with parse techniques (JAXP )and Marshal/Unmarshal techniques(JAXB).
    Recently i came to know that we can query an xml document using xquery and
    xpath methods.
    Is the second method advantageous than the first one in terms of time and memory constraints ?

    Yes, xquery and xpath are always easy to work than parsing on your own.
    It provides already written methods for u, which u need not to write on your own to fetch the data.
    Hope this will help u.
    ......yogesh

  • Java mapping in PI 7.0

    Hi Gurus
    I wanted some inputs on Java mapping concept in SAP PI  7.0
    I do not have a java background but my current project requires me  to develop Java mappings in SAP PI 7.0 since the  XML structure in the incoming files from the application are very complex and the timelines very tight.
    Kindly let me know whats the best approach and how to go about it.
    A sample of java mapping or the procedure will be extremely helpful
    Also ly a pointer on what all to be as a prerequisite in Core java for the same
    Please help
    thanks in advance

    Hello,
    >>I do not have a java background but my current project requires me to develop Java mappings in SAP PI 7.0 since the XML structure in the incoming files from the application are very complex and the timelines very tight.
    We can also use graphical or XSLT mapping for this
    >>A sample of java mapping or the procedure will be extremely helpful
    Search SDN you will find many. Please not that the logic is same only the APIs are different
    Some blogs:
    /people/stefan.grube/blog/2006/10/23/testing-and-debugging-java-mapping-in-developer-studio
    https://weblogs.sdn.sap.com/pub/wlg/11170. [original link is broken] [original link is broken] [original link is broken]
    /people/venkataramanan.parameswaran/blog/2006/12/12/java-mapping-to-handle-flat-files-in-sap-xi
    And for PI7.1
    http://wiki.sdn.sap.com/wiki/display/XI/SampleJAVAMappingcodeusingPI7.1+API
    http://wiki.sdn.sap.com/wiki/display/XI/JavaMappingSample+Code
    >>Also ly a pointer on what all to be as a prerequisite in Core java for the same
    DOM and SAX parsing techniques need to be known
    Also operations on input and output stream is required
    Regards
    Suraj

  • Storing complex linked structures using XSU utility

    We have a requirement to store data with very complex linked structures in database. One utility we are analyzing is the XML SQL Utility (XSU).
    The original file is a binary encoded file and it has to be converted to XML for persisting. The files are really huge and complex.
    The main program is in C++, which decodes the binary file and this has to be interfaced with Java to use this utility.
    If anybody has used this tool for a similar requirement, please give your inputs regarding the performance issues when handling huge, complex data.
    Thanks and regards
    Manshi

    You can use XDK C++ interface to write a program. To be able to deal with large document, SAX will be a good parsing technique.
    There is no simple tools available as far as I know.

  • Need help with ICA files

    hello,
    i need to get access to these archives here:
    http://rzblx10.uni-regensburg.de/dbinfo … 28#ZEITUNG
    for that i need a winframe-client. i got here some help (in german):
    http://www.ulb.uni-bonn.de/ebibliothek/ … /index.htm
    i tried the wincenter.sh (with hd2u and netkit-rsh) script there and also tried to install the citrix ica-client, but i got nothing working.
    has anyone some experience with this stuff?
    thank you in advance,
    vlad

    What you try to do involves a lot of parsing, as others have explained already. Parsing data is a tedious and time consuming task normally, but Labview fortunately offers quite some functions to assist you. Unfortunately, however, one needs some experience to apply them. I assembled a VI (see attachment) which probably comes close to want you want.
    When you look into its code you will see some of the parsing techniques. Also notice that I tried to bring the string data from the original file into some other, more useful structure. I do not claim to always have chosen the optimum structure.
    Also I did not do any error checking. So I noticed at the end, that some of the data (although contained in the original file) are missing in the summary produced by my VI. The resaon seems to be an inconsistent use of delimiter characters in that file: mostly individual entries are delimited by a series of blank characters, but sometimes an entry is missing (eg. do some of the lines neither contain 'Pass' or 'Fail', but just another blank instead. Since I took a series of consecutive blanks as a delimiter, my counting of entries had to fail.
    Try to get a more consistently created raw-data file, e.g. one where tab characters are used as delimiters. Otherwise the parsing will be unnecessarily complicated.
    Good luck
    -Franz
    Attachments:
    MY FILES_TO NI_FORM.zip ‏58 KB

  • URGENT: What else is necessary for me and why?

    Hi All!
    I am desiging a socket based data transmission system, and our messages, Connection Logs, Application Configuration Data will be stored in xml format. I have also designed dtd for them.
    I NEED TO KNOW WHY AND WHICH OF (XSL, XSLT, XPATH, DOM, SAX, etc. ) SHOULD I USE TO PARSE THE XML DATA FOR JAVA APPLICATION. AND IS ALL THIS NECESSARY FOR THIS OR NOT?
    Plz specify one sentence for each!
    Thanks in Advance
    Kashif

    - XSL, XSLT: used for transforming XML in something else (XML, XHTML, text...)
    - XPATH: used for querying nodes content, XSL relies heavily on this
    - DOM: a parsing technique that will produce a hierarchy of objects (nodes) representing your XML doc,
    - SAX: a parsing technique that will raise events for each specific part (nodes) of your XML doc.

  • General web question

    Hi,
    I'm looking for the example code or package for web page index when displaying search result.
    One good example of this is the www.google.com. Whenever the search result more than 10 items, then the 'page index' will be provided to display the subsequece result.
    Is there anyone can recommend an example code which can be downloaded, please reply here.
    wikey

    Do a google search (hehe) on Information Retrieval (IR) and Information Extraction (IE), natural language parsing techniques... I have developed code for IE (kind of a super-ask-jeeves), but search engines use IR (here are 1000000 hits, i'm sure its in here somewhere), and I haven't really done much with it. Search engines use things like Wordnet to generate the query based on synonyms of the words you have entered, bring them back to their base using 'stemming', and then order the results according to the number and combination of query words found in each doc.
    That should get you started conceptually.

  • Exploring external file

    Hello,
    I wrote a servlet which receive a special header's attribute which is sent during communication with mobile device. This attribute is simply an URL address to xml file (http://wap.sonyericsson.com/UAprof/T630R601.xml for example).
    This xml file is usually situated in external repository. Now I need to read this xml file. I know parsing techniques, but I don't know how to get to this file (how to "open" it from my servlet). Sorry for my english.
    Edited by: skadam on Mar 12, 2009 9:27 AM

    solution here: http://www.cafeconleche.org/books/xmljava/chapters/ch05.html

  • New to JAVA mapping

    Hi All,
    I have been working in PI for sometime now. But i have never done JAVA mapping or writing modules in PI. Now i am in need of working on either of these. I have no idea on the topics mentioned above. I tried searching for docs and links on these and was successful in finding only example scenarios, which was not very clear.
    Can anyone give me details on these for a beginner please? I mean how to start with JAVA mapping and basics in it.
    Regards,
    Lavanya R

    Hi Lavanya,
    There are multiple blogs for Java Mapping,you can start following those links:
    Easy way to learn - Java Mapping using DOM - SAP PI 7.1+
    Beginners guide to Java mapping using DOM parser in SAP XI - Process Integration - SCN Wiki
    **************** - Understanding Java Mapping concepts
    You must be aware of the XML parsing techniques such as DOM and SAX parser.You may at first start parsing through JAVA program (if you are not that fluent in parsing)and then gradually try to implement into PI.You may find multiple documents for developing parsing program in JAVA tutorial sites like :
    Reading XML Data into a DOM (The Java&amp;trade; Tutorials &amp;gt; Java API for XML Processing (JAXP…
    Parsing an XML File Using SAX (The Java&amp;trade; Tutorials &amp;gt; Java API for XML Processing (JA…
    Regards,
    Suman

  • Options for XML parsing in WAS 6.20 ABAP and higher

    Hello Experts,
       What options are available to me for working with XML documents in SAP R/3 4.7? I am working on SAP WAS 6.20 ABAP and was wondering which tools/techniques I can use for parsing XML files?
       I am developing an ABAP program and primarily need to be able to parse XML documents. I need to be able to traverse up and down their data structures (trees/nodes/elements/etc.).
       In SAP R/3 4.6 I used to use the iXML library but it seems that there are many advanced and powerful features included in SAP WAS 6.20 ABAP and up.
       Could someone please give me a summary of and their opinions on some these "newer" options?
    Thanks,
    - Vik.

    Hi Vik,
       There are two ways you can parse/interpret XML documents in ABAP -
       1. iXML - Which you have already used in 46 release. It wasn't easy to use set of functions but still it was possible to parse documents using iXML library. In WAS 6.20 you can now use class CL_XML_DOCUMENT which is much more easier to use than iXML library. It is bilt on top of iXML using the same DOM model.
      2. XSLT - Useing XSLT_TOOLS or XSLT transaction you can create XSLT programs to transform XML to ABAP data objects and then work with ABAP data objects. In this case you have the option of using some other tool like XMLSPY to write the XSLT and then copy that to SAP.
    From your post it looks like you will probably have to traverse the tree in unpridictable way, probably DOM based parsing using CL_XML_DOCUMENT is more suitable for you.
    Cheers,
    Sanjeev

  • Parse error when trying to use form

    When i load the PHP,form page and thank you page im getting this error when i hit send.
    No email is sent from form.
    Parse error: syntax error, unexpected T_STRING in /home/owendaws/public_html/owendawsonpga/contactformprocess_original_db.php on line 38
    PHP page
    <?
    $fname = $HTTP_POST_VARS['textfield'];
    $lname = $HTTP_POST_VARS['textfield2'];
    $phone = $HTTP_POST_VARS['textfield3'];
    $email = $HTTP_POST_VARS['textfield4'];
    $address = $HTTP_POST_VARS['textfield5'];
    $state = $HTTP_POST_VARS['textfield6'];
    $zip = $HTTP_POST_VARS['textfield7'];
    $find = $HTTP_POST_VARS['select'];
    $goals = $HTTP_POST_VARS['select2'];
    $practice = $HTTP_POST_VARS['select3'];
    $learn = $HTTP_POST_VARS['select4'];
    $handicap = $HTTP_POST_VARS['select5'];
    $timeplaying = $HTTP_POST_VARS['select6'];
    $lesson = $HTTP_POST_VARS['select7'];
    $additional = $HTTP_POST_VARS['textfield8'];
    mail('[email protected]','Owen Dawson PGA Contact Form Submission',"First Name: $fname\nLast Name: $lname\nPhone Number: $phone\nEmail: $email\nAddress: $address\nState: $state\nZip Code: $zip\nHow did you find me? $find\nWhat are your goals? $goals\nHow much can you practice? $practice\nWhat would you like to learn? $learn\nWhat is your handicap? $handicap\nHow long have you been playing golf? $timeplaying\nHave you ever taken a lesson? $lesson\nAdditional Information: $additional\n",'From: [email protected]');
    header("Location: http://www.owendawsonpga.com/thankyouform.html");
    ?>
    form page
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml"><!-- InstanceBegin template="/Templates/PGATEMPLATE3.dwt" codeOutsideHTMLIsLocked="false" -->
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <!-- InstanceBeginEditable name="doctitle" -->
    <title>Golf Lessons in Baltimore Owen Dawson PGA, GOLF INSTRUCTION IN MARYLAND, GOLF LESSONS IN BALTIMORE</title>
    <meta name="Keywords" content="GOLF INSTRUCTION, GOLF LESSONS IN BALTIMORE, BALTIMORE, MARYLAND, GOLF INSTRUCTION BALTIMORE,SHORT GAME,BUNKER PLAY" />
    <meta name="Description" content="Golf Instruction in Baltimore Maryland" />
    <!-- InstanceEndEditable -->
    <link href="twoColFixRtHdr.css" rel="stylesheet" type="text/css" />
    <!--[if IE 5]>
    <style type="text/css">
    /* place css box model fixes for IE 5* in this conditional comment */
    .twoColFixRtHdr #sidebar1 { width: 220px; }
    </style>
    <![endif]--><!--[if IE]>
    <style type="text/css">
    /* place css fixes for all versions of IE in this conditional comment */
    .twoColFixRtHdr #sidebar1 { padding-top: 30px; }
    .twoColFixRtHdr #mainContent { zoom: 1; }
    /* the above proprietary zoom property gives IE the hasLayout it needs to avoid several bugs */
    </style>
    <![endif]-->
    <script src="SpryAssets/SpryMenuBar.js" type="text/javascript"></script>
    <link href="SpryAssets/SpryMenuBarHorizontal.css" rel="stylesheet" type="text/css" />
    <style type="text/css">
    <!--
    .style1 {
        font-size: small
    .style2 {
        font-family: "Comic Sans MS", Papyrus;
        font-size: small;
    .style6 {font-size: smaller; font-family: "Comic Sans MS", Papyrus; }
    .style7 {font-family: "Comic Sans MS", Papyrus}
    .style8 {
        color: #0000FF;
        font-family: Georgia, "Times New Roman", Times, serif;
    a:link {
        text-decoration: none;
        color: #000000;
        background-color: #EBEBEB;
    a:visited {
        text-decoration: none;
        color: #000000;
    a:hover {
        text-decoration: none;
        border-top-style: none;
        border-right-style: none;
        border-bottom-style: none;
        border-left-style: none;
        border-top-color: #001EF1;
        border-right-color: #001EF1;
        border-bottom-color: #001EF1;
        border-left-color: #001EF1;
        color: #000000;
        background-color: #EBEBEB;
    a:active {
        text-decoration: none;
    .style9 {font-family: Georgia, "Times New Roman", Times, serif}
    .style10 {font-family: Georgia, "Times New Roman", Times, serif; font-size: small; }
    .style11 {color: #000000}
    .style12 {
        font-family: Georgia, "Times New Roman", Times, serif;
        color: #FF0000;
        font-weight: bold;
    .style13 {color: #FF0000}
    -->
    </style>
    <!-- InstanceBeginEditable name="head" -->
    <script type="text/javascript">
    function submitForm(){
        var myform = document.getElementById('form1');
        var fname = document.getElementById('textfield');
        var lname = document.getElementById('textfield2');
        var phone = document.getElementById('textfield3');
        if (fname.value == ''){
            alert('First name is a required field.  Please enter your first name to continue.');
            fname.focus();
            return false;
        if (lname.value == ''){
            alert('Last name is a required field.  Please enter your last name to continue.');
            fname.focus();
            return false;
        if (phone.value == ''){
            alert('Phone number is a required field.  Please enter your preferred phone number to continue.');
            fname.focus();
            return false;
        myform.submit();
    function messageSent(){
        var status = document.getElementById('msg');
        status.innerHTML = 'Message sent successfully.';
    </script>
    <!-- InstanceEndEditable -->
    </head>
    <body class="twoColFixRtHdr">
    <div id="container">
      <div id="header">
        <h1><img src="photos/newpgabannerfinal3_2_10.png" width="739" height="210" /></h1>
        <!-- InstanceBeginEditable name="EditRegion4" -->
        <ul id="MenuBar1" class="MenuBarHorizontal">
          <li><a href="V1Login.html" class="style1">V1 Student Videos</a></li>
          <li><a href="Private_Lessons.html" class="style1">Private Lessons</a></li>
          <li><a href="Clinics.html" class="style1">Clinics</a></li>
          <li><a href="Gift_Certificates.html" class="style1">Gift Certificates</a></li>
          <li><a href="Instructional_Video.html" class="style1">Instructional Video</a></li>
          <li><a href="mailto:[email protected]" class="style1">Contact Owen</a></li>
        </ul>
        <!-- InstanceEndEditable -->
        <p align="center"> </p>
      <!-- end #header --></div>
      <div id="sidebar1">
        <p class="style12"><a href="newfor2010.html" class="style13">New V1 Swing Analysis Software for 2010</a></p>
        <p class="style7"><a href="contactformprocess_original_db.html">Instructional Form </a></p>
        <p class="style7"><span class="style9"><span class="style9"><a href="Sample_Lesson.html">Sample Lesson</a></span></span></p>
        <p class="style9"><a href="http://www.youtube.com/user/owenpga" target="_blank">Video tutorials</a></p>
        <p class="style9"><a href="http://owendawsonpga.blogspot.com" target="_blank">Instructional Blog</a></p>
        <p class="style7 style8"><a href="PGAPHOTOGALLERY/index.html" target="_blank" class="style9">Photo Gallery</a></p>
        <p class="style7 style8 style11"><a href="Instructional_Video.html">Intructional Video</a></p>
        <p class="style7 style8"> </p>
        <p class="style10">Testimonials</p>
        <p class="style6 style9">“I have been working with Owen Dawson for the past 7 years. During that time my swing has dramatically changed and improved. This has happened through Owen's drills and use of video. It is because of these techniques, that I understand how to hit good shots but just as importantly why I hit a shot poorly. I’m glad I’ve had the opportunity to work with Owen and would highly recommend him. ” <strong>Sam Young - Country Club of Maryland - 2009 Men's Club Champion </strong></p>
        <p class="style2">.............................................</p>
        <p class="style6 style9">“Owen does two things  particularly well, in my opinion.  First, he is a master of recording  technology, and it really helps me to see what I need correcting, and what the  new move needs to be.  Second, Owen knows what the best next step should be  in your own journey to a better swing.  I have taken one or two lessons  from Owen each year for the last three or four years – one relatively small  step at a time, and then worked on grooving that step.  In that period, my  index has dropped about 8 strokes, and in 2007 I won the Club’s “Most Improved  Player” award.  Kudos to Owen!”</p>
        <p class="style6 style9"><strong>Bill Smillie -CCofMD</strong></p>
        <h3 class="style2"><a href="Testimonials.html">Read other testimonials  </a></h3>
        <!-- end #sidebar1 -->
      </div>
      <!-- InstanceBeginEditable name="MAINCONTENT" -->
      <div id="mainContent">
          <form action="contactformprocess_original_db.php" method="post" enctype="multipart/form-data" name="form1" id="form1" target="ifr">
          <p class="style5">Name</p>
          <p>
            <label for="textfield"><span class="style5">First</span></label>
            <input type="text" name="textfield" id="textfield" />
            </p>
          <p>
            <label for="textfield2"><span class="style5">Last</span></label>
            <input type="text" name="textfield2" id="textfield2" />
          </p>
          <p><span class="style5">Phone number
              <label>
              <input type="text" name="textfield3" id="textfield3" />
              </label>
          </span></p>
          <p><span class="style5">Email</span>
            <label>
            <input type="text" name="textfield4" id="textfield4" />
            </label>
          </p>
          <p><span class="style5">Address
              <label>
              <input type="text" name="textfield5" id="textfield5" />
              </label>
          </span></p>
          <p><span class="style5">State</span>
            <label>
            <input type="text" name="textfield6" id="textfield6" />
            </label>
          </p>
          <p><span class="style5">Zip Code</span>
            <label>
            <input type="text" name="textfield7" id="textfield7" />
            </label>
          </p>
          <p><span class="style5">How did you find me?</span>
            <label for="select"></label>
            <select name="select" id="select">
              <option value="internet">Internet Search</option>
              <option value="friend referral">Friend Referral</option>
              <option value="ccmdsite">Country Club of MD website</option>
              <option value="other">Other</option>
            </select>
          </p>
          <p><span class="style5">What are your golfing goals?</span>            
            <select name="select2" id="select2">
              <option value="break 100">Break 100</option>
              <option value="break 90">Break 90</option>
              <option value="break 80">Break 80</option>
              <option value="stop slice">Stop Slicing the Ball</option>
              <option value="stop hook">Stop Hooking the Ball</option>
              <option value="Compete">Compete in local tournaments</option>
              <option value="More Consistant">Hit more consistant shots</option>
            </select>
          </p>
          <p><span class="style5">How much can you practice?</span>
            <label for="select3"></label>
            <select name="select3" id="select3">
              <option value="1 hour">1 hour</option>
              <option value="2 hours">2 hours</option>
              <option value="3 hours">3 hours </option>
              <option value="> 3 hours">More than 3 hours a week</option>
            </select>
          </p>
          <p><span class="style5">What would you like to learn?</span>
            <label for="select4"></label>
            <select name="select4" id="select4">
              <option value="full swing">Full Swing Mechanics Irons</option>
              <option value="driver swing">Full Swing Mechanics Driver</option>
              <option value="short pitches">Short Pitch Shots inside of 50 yards</option>
              <option value="bunker play">Bunker Play</option>
              <option value="chipping">Chipping</option>
              <option value="short shots">Short shots from rough</option>
            </select>
          </p>
          <p class="style5">What is your Handicap?<label for="select5"></label>
            <select name="select5" id="select5">
              <option value="scratch to 5">Scratch - 5 HDCP</option>
              <option value="6 to 10">6 - 10 HDCP</option>
              <option value="11 to 15">11 - 15 HDCP</option>
              <option value="15 to 20">15 - 20 HDCP</option>
              <option value="> 21">21 and Higher</option>
            </select>
          </p>
          <p class="style5">How long have you been playing?
            <label for="select6"></label>
            <select name="select6" id="select6">
              <option value="beginner">Beginner</option>
              <option value="2 to 5 years">2-5 yrs</option>
              <option value="6 to 10 years">6-10 yrs</option>
              <option value="11 to 15 years">11-15yrs</option>
              <option value="> 15 years">More than 15 years</option>
            </select>
          </p>
          <p class="style5">Have you ever had a lesson?
            <label for="select7"></label>
            <select name="select7" id="select7">
              <option value="yes">YES</option>
              <option value="no">NO</option>
            </select>
          </p>
          <p class="style5">Additional Information
            <label>
            <textarea name="textfield8" cols="40" id="textfield8"></textarea>
            </label>
          </p>
          <p class="style5">
            <label for="button"></label>
            <input type="submit" name="Submit" id="button" value="Submit"onclick="submitForm()" />
          </p>
          <p class="style5"> </p>
            <div id="msg" style="font: bold 12px arial"></div>
        </form>
        <p align="center" class="style8"><br />
        </p>
        <p class="style8"> </p>
        <p class="style8"> </p>
        <p class="style8 style12"><strong><br />
         </strong></p>
        <p align="left"> </p>
        <h1> </h1>
        <!-- end #mainContent -->
        </div>
      <!-- InstanceEndEditable -->
      <!-- This clearing element should immediately follow the #mainContent div in order to force the #container div to contain all child floats -->
      <br class="clearfloat" />
      <div id="footer">
        <p align="center"><a href="http://www.v1golf.com" target="_blank"><img src="photos/GAW.png" width="163" height="60" hspace="20" border="0" /><img src="photos/logo.png" width="80" height="76" hspace="40" border="0" /></a><a href="http://www.owendawsonphotography.com" target="_blank"><img src="photos/ody.png" width="199" height="59" border="0" /></a></p>
        <h2 align="center" class="style6">©Owen Dawson P.G.A. ™ All rights reserved</h2>
        <!-- end #footer -->
      </div>
    <!-- end #container --></div>
    <script type="text/javascript">
    <!--
    var MenuBar1 = new Spry.Widget.MenuBar("MenuBar1", {imgDown:"SpryAssets/SpryMenuBarDownHover.gif", imgRight:"SpryAssets/SpryMenuBarRightHover.gif"});
    //-->
    </script>
    </body>
    <!-- InstanceEnd --></html>
    thank you page
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <title>Untitled Document</title>
    </head>
    <body>
    Thank you for fill out my lesson form. I will be in touch with you shortly. Owen
    </body>
    </html>

    Your PHP script is not secured at all. I would recommend using Forms To Go (http://www.bebosoft.com/products/formstogo/overview) to create the PHP script.
    The unregistered version can be used for free. It will get you up and running in no time.
    In your HTML form,remove enctype="multipart/form-data" from this:
    <form action="contactformprocess_original_db.php" method="post" enctype="multipart/form-data" name="form1" id="form1" target="ifr">
    enctype="multipart/form-data" is only required if you have a file upload field in the form.

Maybe you are looking for

  • Having one iTunes music library for multiple computers via TimeCapsule

    Hi there, I'm just wondering how to best set-up my iTunes library. I want the library on my TimeCapsule wireless hard drive, and to be able to set this as the library for multiple computers at home. It's a waste of space to have duplicate libraries o

  • Acrobat 7.0

    Hello Folks, I am editing a file using Acrobat 7.0 pro and want to edit bookmarks. I want to "Set Destination" of a bookmark but unable to do so as the option "Set Destination" is missing when I right-click on the bookmark. Please suggest me the solu

  • In 10G presentation services is not able to view

    Hi Experts, I am trying to install OBI 10G in virtual windows XP machine in my windows 7 system and it was installed successfully but in Start--->All Programs--->Oracle Business Intelligence i am not able to find the Presentation services in services

  • Lower rez PDF's?

    I make photo proof sheet PDF's for clients using the Low Quality setting but would like to get even smaller, lesser quality PDF's. Can this be done easily? . The pictures are 36 mb Raw files, 50 plus per PDF which makes a somewhat large PDF file. Tha

  • About hide

    hi        some body pls tell me in interactive lise i want to use 2 filds with hide statement, how to use that one, and how to retrieve that content from that area, please explain with example. that is hide matnr werks.