I have just started learning PHP and have downloaded and installed XAMPP and all initial tests have gone successfully. However I am working through a tutorial using "PHP and MySQL Web Development" and have set up a form which then executes(or should) some PHP code on a results page. If I test the live data in Dreamweaver the code executes correctly but when I use a browser it just regurgitates the PHP code (in firefox) and gives me nothing in Internet explorer. Any idea what I am doing wrong? Thanks yan
You have set up a form and it is for sure in html code. But how do you arrange the html code in php code?
Hi Bronto Yes there is a form which has an action pointing to the php file full html is as follows: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"><html><head><META http-equiv="Content-Type" content="text/html; charset=utf-8"></head><body> <div> <form action="http://processorder.php" method="post" target="_blank" onsubmit="return window.confirm("You are submitting information to an external page. \nAre you sure?""> <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>How did you find Bob's?</td> <td><select name="find"> <option value="a">I'm a regular customer</option> <option value="b">TV advertising</option> <option value="c">Phone directory</option> <option value="d">Word of mouth</option> </select> </td> </tr> <tr> <td colspan="2" align="center"><input type="submit" value="Submit Order"></td> </tr> </table> </form> </div> </body></html> This looks ok but when I submit the form I get the problem that all the browser returns is the php code. It seems wierd that it works within dreamweaver. Yan
This may be a dumb question but are you sure your php code is wrapped in php tags? <?php //Your php code ?> But then it should be if it works in dreamweaver. It sounds like maybe you have a configuration problem on the server.
Yes php seems to be properly enclosed in tags. Any pointers on where to start checking sever config. Having said that I have another page interacting with a mySql database and that seems to be ok so I am confused!
How are you acessing it via your browser? eg. C:\XAMPP\file.php is the wrong way, and should be called via: http://localhost/file.php BP