aldm Posted August 12, 2009 Share Posted August 12, 2009 Hi, I have Apache server installed on my computer and I'm learning PHP. I have a HTML form with following code: <html> <head> <title>Forma</title> </head> <body> <form action="F:\xampp\htdocs\phpinfo.php" method="POST"> <br>Unesite tekst: <br><input type="text" name="podatak" value=""> <br><input type="submit" name="submit" value="Posalji"> </form> </body> </html> Code of phpinfo.php file: <?php phpinfo(); ?> When I click on "Posalji" button, firefox gives me next alert: Firefox doesn't know how to open this address, because the protocol (f) isn't associated with any program. Has anyone idea how could I solve this problem? Thanks in advance Quote Link to comment https://forums.phpfreaks.com/topic/169951-solved-problem-with-htmlphp-form-on-apache/ Share on other sites More sharing options...
aldm Posted August 12, 2009 Author Share Posted August 12, 2009 When I change path ("F:\xampp\htdocs\phpinfo.php") to "phpinfo" and click on "Posalji" button, I get blank page. I also changed phpinfo.php file to: <?php echo 'Something'; ?> but with no result (still, there is a blank page when I click on button) Quote Link to comment https://forums.phpfreaks.com/topic/169951-solved-problem-with-htmlphp-form-on-apache/#findComment-896547 Share on other sites More sharing options...
wildteen88 Posted August 12, 2009 Share Posted August 12, 2009 F:\xampp\htdocs\phpinfo.php should be phpinfo.php All code HTML/PHP needs to be saved in F:\xampp\htdocs You go to http://localhost to run your HTML/PHP Quote Link to comment https://forums.phpfreaks.com/topic/169951-solved-problem-with-htmlphp-form-on-apache/#findComment-896549 Share on other sites More sharing options...
aldm Posted August 12, 2009 Author Share Posted August 12, 2009 I save both files (forma.html and phpinfo.php) in F:\xampp\htdocs and action is "phpinfo.php". When I type localhost/phpinfo.php in my browser, it works, but with click on button, it doesn't works. It shows me a blank page with adress: file:///F:/xampp/htdocs/phpinfo.php Quote Link to comment https://forums.phpfreaks.com/topic/169951-solved-problem-with-htmlphp-form-on-apache/#findComment-896581 Share on other sites More sharing options...
wildteen88 Posted August 12, 2009 Share Posted August 12, 2009 That because the form action needs to be <form action="phpinfo.php" method="POST"> Now to run your form open your browser and go to http://localhost/forma.html Do not double click your files from within Windows Explorer to open in your browser. You must go to http://localhost to run your html/php files. Quote Link to comment https://forums.phpfreaks.com/topic/169951-solved-problem-with-htmlphp-form-on-apache/#findComment-896601 Share on other sites More sharing options...
aldm Posted August 13, 2009 Author Share Posted August 13, 2009 it works now, thanks everyone for help Quote Link to comment https://forums.phpfreaks.com/topic/169951-solved-problem-with-htmlphp-form-on-apache/#findComment-897494 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.