/*

		// First fetch the url
		String Url = netRead.readLine( );
		
		// Capture the hostname, resource name and the entity string
		// In this case, the entity stirng must be concatenated to the resource name
		String resName = null;	
		String hostName = null;
		
		// Hostname
		try { hostName = getHostName( Url ); } catch(Exception e)
		{      
			System.out.println("Error in URL"); 	
			writeToClient("ERROR");
			writeToClient("INVALID URL");
			writeToClient("\n~~~~~\n");
			return;
		}
		
		// Resource name
		try{ resName = getResourceName(Url, hostName); } catch(Exception e)
		{
			System.out.println("Error in filename extraction");
			writeToClient("ERROR");
			writeToClient("INVALID URL");
			writeToClient("\n~~~~~\n");
			return;
		}			

		// Determine Entity string
		int numOfFields = 0;	int totalLength = 0;  String justRead; 
		String entityString = new String();

		// So here, first we receive the number of input fields
		// Then a sequence of strings (lines) each representing alternately, the name of the form field, 
		// and the form element value

		try { numOfFields = Integer.parseInt( netRead.readLine() ); } catch(Exception e)
		{
			System.out.println("Error in form submission: invalid number of fields");
			writeToClient("ERROR");
			writeToClient("FORM ERROR");
			writeToClient("\n~~~~~\n");
			return;
		}	
		
		// Next we attempt to read those many values
		try
		{
			for( int readItems=0; readItems<numOfFields; readItems++)
			{
			// read the string
				justRead = netRead.readLine( );
				if( justRead.indexOf("~~~") != -1 ) break;
			// attach to the entity String
				entityString.concat( justRead);
				entityString.concat("=");

			//read the next string
				justRead = netRead.readLine( );
				entityString.concat(justRead);
				entityString.concat("&");
		
			}

			totalLength = entityString.length( );
		}
		catch(Exception e)
		{
			System.out.println("Error in form submission: invalid number of fields");
			writeToClient("ERROR");
			writeToClient("FORM ERROR");			
			writeToClient("\n~~~~~\n");
		}

		// create a new URL request object
		urlRequest = new URLRequest("POST", this, hostName, resName, Url, entityString);
		urlRequest.transact( );		
