Cannot use php to process html form on localhost windows

Problems with the Windows version of XAMPP, questions, comments, and anything related.

Cannot use php to process html form on localhost windows

Postby duihou » 14. July 2004 19:14

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.
Duihou

p.s other php scripts not relating to html input forms,etc, work fine.
duihou
 
Posts: 1
Joined: 14. July 2004 18:59
Location: England

Postby free69 » 16. July 2004 14:23

You may get some hints from the below scripts, which shows that html code must be outside off php scripts.
Code: Select all
<?php
eval(load_class("product", "ps_product"));
$ps_product = new ps_product;
?>
<TABLE WIDTH="100%" CELLSPACING=0 CELLPADDING=0 BORDER=0>
<TR VALIGN=TOP><TD>
<!-- Body starts here -->
<?php echo $vendor_store_desc; ?>
<!-- Body ends here -->
</TD>
<TD WIDTH=10 VALIGN=TOP><TD>
    <TD WIDTH="150" ALIGN="CENTER">
      <TABLE WIDTH="100%" BORDER=0 CELLSPACING=0 CELLPADDING=1 BGCOLOR="#FFFFFF">
        <!-- Welcome notice --> <?php
  if ($perm->check("admin,storeadmin,demo")) {
?>
        <?php
echo "<BR>";
 }
?> <!-- Begin Navigation -->
        <TR>
          <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>
              </TR>
            </TABLE>
          </TD>
        </TR>
free69
 
Posts: 35
Joined: 02. June 2004 05:52

Postby the4man » 20. July 2004 03:40

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.
the4man
 
Posts: 3
Joined: 20. July 2004 02:53


Return to XAMPP for Windows

Who is online

Users browsing this forum: No registered users and 78 guests