project-nz Posted May 13, 2009 Share Posted May 13, 2009 hi hows it going my problem is: when ever i run the following code it runs the code inside the "action =" php statement at the same time isnt it supposed to run php code when i click on the submit button? im confused <body> <?php // pre full db include('PreDB.php'); $predb = new PreDB(); ?> <center> <form method = "post" action= '<?php include ("Listings.php"); $obj = new Listings("order1", $result); ?>' > <input type=text name="listname" /> <input type=submit value="Search"> </form> </center> </body> Link to comment https://forums.phpfreaks.com/topic/157925-form-action-call-php-class/ Share on other sites More sharing options...
PFMaBiSmAd Posted May 13, 2009 Share Posted May 13, 2009 Forms only exist in the browser. The action="..." parameter is the URL of the form processing code that the browser submits the form data to. You must put a URL in the action="..." parameter (an empty value refers to the same URL as the current page.) Link to comment https://forums.phpfreaks.com/topic/157925-form-action-call-php-class/#findComment-833030 Share on other sites More sharing options...
project-nz Posted May 13, 2009 Author Share Posted May 13, 2009 Forms only exist in the browser. The action="..." parameter is the URL of the form processing code that the browser submits the form data to. You must put a URL in the action="..." parameter (an empty value refers to the same URL as the current page.) thanks for the quick answer is there anyway around this, itll be less efficient if i have to call a .php file then within that php file call the class i wanted? Link to comment https://forums.phpfreaks.com/topic/157925-form-action-call-php-class/#findComment-833033 Share on other sites More sharing options...
PFMaBiSmAd Posted May 13, 2009 Share Posted May 13, 2009 is there anyway around this No. Browsers can only make http/https requests to web servers, that is the way it works - HTTP is a request/response standard of a client and a server. Ref: http://en.wikipedia.org/wiki/HTTP Link to comment https://forums.phpfreaks.com/topic/157925-form-action-call-php-class/#findComment-833036 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.