Don’t know exactly what you are trying to accomplish using custom script.You can do this effectively in WP way using either shortcodes,page templates,plugin.
Well if you don’t want to do it that way and want to just place scripts in the active theme base directory.One way i suggest:
Let’s say we have two php files aform.php
(Actual form page) and add-calories.php
(Form action page) in the active theme base directory.
You can rename them to page-aform.php
and page-add-calories.php
and create two pages with same names aform
and add-calories
. Then these scripts are available at http://example.com/aform
and http://example.com/add-calories
(be sure to change form action to req url).
You can check more about template hierarchy here.What ever we place in the theme directory goes through this cycle.
If you don’t want to do it that way and want to have http://example.com/aform.php
then place the php script file at the root directory of WP installation (Remember if you do this way, file you won’t have access to WP functions)