Page 1 of 1

Cannot use php to process html form on localhost windows

PostPosted: 14. July 2004 19:14
by duihou
I'm pretty new to PHP, Apache and the like... however, I'm using the SAMS PHP, Apache and MySQL book to try my hand. When using

form action="listing9.2.php" method="POST"

to allow simple html form to send info, upon clicking SEND , instead of going to the relevant display on the php page, it is completely blank. Nothing at all. I cannot find any error messages or anything. I've copied and pasted the code from the CD, removing the line numbers and keeping the html angle brackets, so cannot be a typo. I've also tried various other , similar scripts, all result in a blank display on the php page.

The only clue I think I have is that in the STATUS section of XAMPP it says SMTP service is disabled... could this be the culprit, or is it some setting deep inside Apache HTTPD or the PHP.INI ?

Any help / ideas most gratefully appreciated.

p.s other php scripts not relating to html input forms,etc, work fine.

PostPosted: 16. July 2004 14:23
by free69
You may get some hints from the below scripts, which shows that html code must be outside off php scripts.
Code: Select all
eval(load_class("product", "ps_product"));
$ps_product = new ps_product;
<!-- Body starts here -->
<?php echo $vendor_store_desc; ?>
<!-- Body ends here -->
        <!-- Welcome notice --> <?php
  if ($perm->check("admin,storeadmin,demo")) {
echo "<BR>";
?> <!-- Begin Navigation -->
          <TD BGCOLOR="#000000" ALIGN="center">
            <TABLE WIDTH="150" BORDER="0" CELLSPACING="0" CELLPADDING="2" BGCOLOR="#663399">
              <TR VALIGN="TOP" ALIGN="CENTER">
                <TD><FONT COLOR="#FFFFFF">Featured Items</FONT></TD>

PostPosted: 20. July 2004 03:40
by the4man
Actually I ran into this problem today so hopefully I can help. You need to make sure that your test files you are creating and saving (or using from your CD) are residing in the htdocs folder (located in the apache folder) in a unique folder (create a "sams" folder here or something like that for testing purposes). Then when you try and access these files, do it from a new browser window and type the location of the file using localhost: http://localhost/sams/yourtestfile.php (for example). If you just click on the files that are on the CD, I think it won't work. Even if you copy them into the apache/htdocs/sams folder and click on them there, they won't work. So try accessing them from a new browser window and see if that doesn't fix it.

And if none of this works, I apologize, as I am new to all of this myself.