Page 1 of 1

PHP beginner propblems

PostPosted: 15. July 2011 17:40
by gdavies6
Hi All

I'm new here and slowly, I mean slowly getting into PHP. The biggest issue I have is in configuring php to run on my computer. Anyway i managed to get xampp installed yesterday and it appears to get working.

I'm writing some very basic scripts at the moment. The problem I have is that every time a call the php file processorer.php, Firefox and ie open new tabs continually. I believe this to be a config issue. Has anyone experienced this behaviour before? If so how do you get around it?

Scripts I am using -

html calling script

Code: Select all

<html>

<head>
   <title>Bob's Auto Parts</title>
</head>

<body>


<form action="processorder.php" method="post">

   <table border="0">

      <tr bgcolor="#cccccc">
         <td width="150" align="center">Item</td>
         <td width="150" align="center">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>

</body>


</html>

Processorder.php file


Code: Select all

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


Thanks is advance for your replies!!!

Re: PHP beginner propblems

PostPosted: 16. July 2011 08:45
by Sharley
Perhaps it is a browser setting as I tried your code in the following browsers with no issues at all (the form when submitted opened the php response in the same tab):
SeaMonkey
Firefox (various versions)
IE
Iron
Opera (various versions)
Pale Moon (various versions)

BTW, the processorder.php file name in your html file code should be the same text case as the actual file name in the folder, although I did notice that in your case it did not make any difference one way or the other and so had no bearing on your issue.

Look in your browser's settings for tab behavior in particular the opening of new tabs next to the calling tab etc. and experiment with various settings - but remember to clear your browser's cached files from time to time to eliminate an older file being presented as this often happens at localhost development level.