Advertisement

07.10.2008 at 02:06AM PDT, ID: 23553037
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

7.6

HTTP Error 405 - The HTTP verb used to access this page is not allowed. PHP & XML File

Asked by emzi19 in PHP for Windows, Extensible Markup Language (XML), PHP and Databases

Tags:

Hi,

I am trying to generate an XML file from a html form. I have some code from a tutorial, but i get the following error > HTTP Error 405 - The HTTP verb used to access this page is not allowed.

Code snippet attached.

Start Free Trial
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
49:
50:
51:
52:
53:
54:
55:
56:
57:
58:
59:
60:
61:
62:
63:
64:
65:
66:
67:
68:
69:
70:
71:
72:
73:
74:
75:
76:
77:
78:
79:
80:
81:
82:
83:
84:
85:
86:
87:
88:
89:
90:
91:
92:
93:
94:
95:
96:
97:
98:
99:
100:
101:
102:
103:
104:
105:
106:
107:
108:
109:
110:
111:
112:
113:
114:
115:
116:
117:
118:
119:
<form method="POST" action="generatexml.php">
 
<input type="hidden" name="create_employee" value="true">
 
<table>           
 
  <tr>
 
    <td width="27%">Employee Name:</td>
 
    <td width="73%"><input type="text" name="empName" size="20"></td>
 
  </tr>
 
  <tr>
 
    <td width="27%">Employee Address</td>
 
    <td width="73%"><input type="text" name="empAddress" size="73"></td>
 
  </tr>
 
  <tr>
 
    <td width="27%">Employee SSN</td>
 
    <td width="73%"><input type="text" name="empSSN" size="20"></td>
 
  </tr>
 
  <tr>
 
    <td width="27%">Company Name</td>
 
    <td width="73%"><input type="text" name="empCompany" size="73"></td>
 
  </tr>
 
  <tr>
 
    <td width="27%">XML File Name</td>
 
    <td width="73%"><input type="text" name="xmlfileName" size="20"></td>
 
  </tr>
 
</table>
 
  <p align="center">
 
  <input type="submit" value="Submit" name="B1"></p>
 
</form>
 
 
 
 
 
 
 
<php? 
 
if(isset($_POST['create_employee'])){
 
        echo "This is my XML file";
 
        $xmlfileName = $_POST['xmlfileName'];
 
        $empName = $_POST['empName'];
 
        $empAddress = $_POST['empAddress'];
 
        $empSSN = $_POST['empSSN'];
 
        $empCompany = $_POST['empCompany'];
 
        $xml_dec = "<?xml version=\"1.0\" encoding=\"UTF-8\" ?>";
 
        $rootELementStart = "<employee>";
 
        $rootElementEnd = "</employee>";
 
        $xml_doc=  $xml_dec;
 
        $xml_doc .=  $rootELementStart;
 
        $xml_doc .=  "<employeename>";
 
        $xml_doc .=  $empName;
 
        $xml_doc .=  "</employeename>";
 
        $xml_doc .=  "<employeeaddress>";
 
        $xml_doc .=  $empAddress;
 
        $xml_doc .=  "</employeeaddress>";
 
        $xml_doc .=  "<SSN>";
 
        $xml_doc .=  $empSSN;
 
        $xml_doc .=  "</SSN>";
 
        $xml_doc .=  "<company>";
 
        $xml_doc .=  $empCompany;
 
        $xml_doc .=  "</company>";
 
        $xml_doc .=  $rootElementEnd;
 
        $default_dir = "..upload\";
 
        $default_dir .=   $xmlfileName .".xml";
 
$fp = fopen($default_dir,'w');
 
            $write = fwrite($fp,$xml_doc); ?>
[+][-]07.10.2008 at 09:03AM PDT, ID: 21974766

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: PHP for Windows, Extensible Markup Language (XML), PHP and Databases
Tags: php, xml
Sign Up Now!
Solution Provided By: dnatal
Participating Experts: 1
Solution Grade: B
 
 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628