Menu

calling a php file from an html

Help
RonHiler
2005-03-05
2012-12-07
  • RonHiler

    RonHiler - 2005-03-05

    I'm following some very basic code from a PHP book, but I'm stuck.  There are two files, an HTML and a PHP file.  Here they are:

    This is orderform.html
    <form action="processorder.php" method=post>
    <table border=0>
    <tr bgcolor=#cccccc>
        <td width=150>Item</td>
        <td width=15>Quantity</td>
    </tr>
    <tr>
        <td>Tires</td>
        <td align="center"><input type="text" name="tireqty" size="3" maxlength="3"></td>
    </tr>
    <tr>
        <td>Oil</td>
        <td align="center"><input type="text" name="oilqty" size="3" maxlength="3"></td>
    </tr>
    <tr>
        <td>Spark Plugs</td>
        <td align="center"><input type="text" name="sparkqty" size="3" maxlength="3"></td>
    </tr>
    <tr>
        <td colspan="2" align="center"><input type="submit" value="Submit Order"></td>
    </tr>
    </table>
    </form>

    and this is processorder.php
    <html>
    <head>
        <title>Bob's Auto Parts - Order Results</title>
    </head>
    <body>
    <h1>Bob's Auto Parts</h1>
    <h2>Order Results</h2>
    <?php
        echo '<p>Order processed.</p>';
    ?>
    </body>
    </html>

    When I open the former HTML File in the internal preview, it comes up just fine, but when I click on the button (which is supposed to call the PHP file) the preview says "The page cannot be displayed", and the source tab at the bottom reads: <html><body><h1><center>Process was terminated.</body></html>

    When I post this same two files to my webpage, they work fine. (Note that I cannot get the External Preview to work at all, so I have no idea what that would say).

    What am I doing wrong?  I presume I still have setup issues somewhere, since the files work fine in the outside world.  The two files reside in the same directory (D:\PHP Projects\PHPCVS).

    My local server path is "D:\PHP Projects" on port 80 and my external web server path is "http://127.0.0.0:80/", and I'm running WinXP Pro.

    Ron

     
    • RonHiler

      RonHiler - 2005-03-05

      After more experimentation the problem seems to be with all php scripts.  I can't even get this to work:

      <?php
      phpinfo();
      ?>

      that gives the same error message.  Any suggestions?

       
    • Urs Mäder

      Urs Mäder - 2005-03-05

      please try a path without blanks in path!! we are working to fix this bug. local and external preview points to the same server. not really useful... -:)

       
    • Urs Mäder

      Urs Mäder - 2005-03-05

      try this: -:)

      users with the bom-problem can download a developer-version from http://www.mswil.ch/dev-php/download/devphp2011a.exe
      for testings. i hope, this is fixed. may me later you can select in options to write files with or without boms

       
    • RonHiler

      RonHiler - 2005-03-05

      Okay, I removed the space from the project directory.  But still no luck.  In fact, now it's worse.

      Sigh.  Now I've lost my internal preview altogether, and I don't know why (probably not because of removing the space, I made lots of changes to the configuration, and at some point lost the internal preview, and can't get it back now)

      I am running:
      WinXP Pro SP2
      Apache version 1.3 (C:\Program Files\Apache Group\Apache)
      php version 4.3.10 (C:\php)
      Internet Explorer Version 6

      Apache, php, and IE seem to communicate fine (if I open IE and type http://localhost I get the Apache test page, and if I type http://localhost/phpinfo.php I get my php info (where the phpinfo.php file is just <?php phpinfo(); ?> and is stored in C:\Program Files\Apache Group\Apache\htdocs)).

      I have php.ini in C:\WINNT.  I have php4ts.dll and php5ts.dll in C:\WINNT\System

      in php-Dev I have:
      php-cgi.exe path set to C:\Program Files\Dev-php2\php\php-cgi.exe
      php.ini path set to C:\WINNT\php.ini
      Local server path set to D:\PHPProjects\PHPCVS\
      (on port 80)
      External web server path set to http://localhost

      So what do I have to do to set this up? (Guys, you REALLY need to set up some a step-by-step document on how to do this, because it is FAR from obvious.  If I can ever figure out how to do this myself, I'll volunteer to write something up for you :) ).

      Ron

       
    • Urs Mäder

      Urs Mäder - 2005-03-05

      you dont need!!!!!! an apache on your pc to local preview php files because dev-php has a builtin server. if you have a apache then it's possible to preview this with the external preview. you need to run the builtin webserver on a different port then the apache
      apache: port 80
      builtin: 8080 (by example)

      why you have set the php-cgi.exe to C:\Program Files...
      when you have a php in C:\php. Probably you have set in the C:\WINNT\php.ini the paths for the php in C:\php. this cannot really work...

      it's better to have a independent php installation for the builtin server with his own php.ini (by example in the php-cgi.exe path)

      install the newest version of devphp from
      http://www.mswil.ch/dev-php/download/devphp2011a.exe

      and you have not really eliminated all blanks in your paths!!!

       

Log in to post a comment.

MongoDB Logo MongoDB