I am having trouble POSTing from a WAP script to a wml file with PHP in it. I feel like it is something wrong with the way I am using the header function.

The first of my .wml file that the data is POSTed to looks like:

                         <?php 
                         header("Content-type: text/vnd.wap.wml"); 
                         echo("<?xml version=\"1.0\"?>\n"); 
                         echo("<!DOCTYPE wml PUBLIC\"-//WAPFORUM//DTD WML                        1.1//EN\"\"http://www.wapforum.org/DTD/wml_1.1.xml\">\n"); 

                         ?> 
                         <wml> 

For reference, my httpd.conf looks like:

                         LoadModule php4_module c:/php/sapi/php4apache.dll 
                         AddType application/x-httpd-php .php4 
                         AddType application/x-httpd-php4 .php 
                         AddType application/x-httpd-php4 .wml 

                         #for the cgi binary (you can use that one compiled with force cgi redirect too) 
                         ScriptAlias /php4/ "C:/php/" 
                         Action application/x-httpd-php4 "/php4/php.exe" 

My srm.conf file looks like:

                         # WAP MIME Types 
                         AddType text/vnd.wap.wml .wml 
                         AddType image/vnd.wap.wbmp .wbmp 
                         AddType text/vnd.wap.wmlscript .wmls 
                         AddType application/vnd.wap.wmlc .wmlc 
                         AddType application/vnd.wap.wmlscriptc .wmlsc 




                         The error that Apache returns is: 
                         Error 405 Method Not Allowed. 

I have turned off short_open_tag in the php.ini file as suggested by documentation of the header() function on www.php.net

Please Please help! I have been working on this non-stop for 4 days, and exhausted as many resources as possible.

NOTE: I am running a Windows 98 machine

Thanks for your time!
Very worn out,
Jesse

    Everything looks good. Can you give more information....

    what is the file actually called. something.wml or something.php? It should be something.php with the appropiate header tags.

    what does your actual WML code look like. what all are you trying to do with it. Are you going past the space limitations on the page?

      Thank You so much for responding Matt! You have no idea how many dead ends I been to in trying to resolve the problem. Here is the scoop now:

      I had the file named "something.wml" but changed it to "something.php". I get an new error now. I am sorry, but for the life of me, I can't remember what it is. As for the space limitations ... I didn't know that there were any. What are they, and yes - I might quite possibly be exceeding the limitations. The purpose: I am trying to input food cost data from one page, and POST it to another ... then push that data into mysql.

      Here is the calling page code (food.wml):
      <?xml version="1.0"?>
      <!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.1//EN"
      "http://www.wapforum.org/DTD/wml_1.1.xml">
      <wml>
      <template>
      <do type="accept" label="back">
      <prev/>
      </do>
      </template>

      <card id="card1" title="Food Page">
      <do type="accept" label="Submit">
      <go href="food.php" method="post">

      <postfield name="id" value="$(ID)"/>
      <postfield name="date" value="$(DATE)"/>
      <postfield name="breakfast" value="$(BREAK)"/>
      <postfield name="lunch" value="$(LUNCH)"/>
      <postfield name="dinner" value="$(DINNER)"/>
      <postfield name="other" value="$(OTHER)"/>
      
      </go>

      </do>
      <p>

      ID: <input name="ID" size="3" format="N"/><br/>
      Date: <input name="DATE" size="10" format="
      N"/><br/>
      Breakfast: <input name="BREAK" size="6" format="N"/><br/>
      Lunch: <input name="LUNCH" size="6" format="
      N"/><br/>
      Dinner: <input name="DINNER" size="6" format="N"/><br/>
      Other: <input name="OTHER" size="6" format="
      N"/><br/>
      </p>
      </card>
      </wml>

      Here is the called page (test.php (was test.wml) ):

      <?php
      header("Content-type: text/vnd.wap.wml");
      echo("<?xml version=\'1.0\'?>\n");
      echo("<!DOCTYPE wml PUBLIC\"-//WAPFORUM//DTD WML 1.1//EN\"\"http://www.wapforum.org/DTD/wml_1.1.xml\">\n");

      /echo("<wml>\n");
      echo("<card id=\"card1\" title=\"test\">\n");
      echo("<p>"\n);
      echo("This is a test\n");
      echo($date);
      echo("</p>\n");p
      echo("</card>\n");
      echo("</wml>\n")
      /

      ?>

      <wml>
      <card id="card1" title="test">
      <p>
      This is a test
      <?php echo($date);?>
      </p>
      </card>
      </wml>

      Again, I thank you very much for looking at this. It has been really frustrating. I would have gotten to it sooner, but I couldn't access phpbuilder this afternoon.
      Thanks!
      Jess

        Matt,

        I just duplicated the error again when calling the "test.php" file. I get a "Internal Service Error (Error 500)" .

        I am still at a loss. I reduced the amount of input to only one field, and I still can't make that darn thing work.

        If you have any suggestions, the are more than welcomed.

        Thaks again,
        Jess

          The size limit is something along the lines of 1472 or 1492 bytes. it is really not very much. here is a basic post page and see if you can get anything from this to help you out....

          Spacing is really off but I beileve that this may help.

          <?
          header("Content-type: text/vnd.wap.wml");
          echo "<?xml version=\"1.0\"?>";
          echo "<!DOCTYPE wml PUBLIC \"-//WAPFORUM//DTD WML 1.1//EN\""." \"http://www.wapforum.org/DTD/wml_1.1.xml\">";
          print "<wml>\n";
          print "<card id=\"index\" title=\"WAP Login\" newcontext=\"true\">\n";
          print "<p>\n";

          print "<do type=\"accept\" label=\"Enter\">\n";
          print "<go href=\"/wap/inbox.phtml?username=$(username)&amp;passwd=$(passwd)&amp;time=$time\"/>\n";
          print "</do>\n";
          ?>
          Username: <input type="text" name="username"/><br/>
          Password: <input type="password" name="passwd"/><br/>

          </p>
          </card>
          </wml>

            Hey man,
            I really appreciate it. I got your code to work! I am not real clear on what kind of page it is posting the info to though (.phtml).

            Thanks again!
            Jess

              Write a Reply...