<?php include('http://localhost/mysite/cgi/connect.php'); ?>
With a live site site it may be something like:
<?php include('connect.php'); ?> WHERE connect.php is in the include folder which is specified in the php.ini file or .htaccess file.
Apart from that, on WAMP, you can use the file path to call the file to validate the form, etc. The path could be something like:
<form method="post" action="../cgi/myvalidation.php">
With a live site, the procedure would be to call a controller. Of course, calling the controller requires no need to use the .php file extension. The code could be something like:
<form method="post" action="../index.php/myvalidation"> WHERE myvalidation is a controller that loads view files which connect to the database.
The file which is calling the php controller file needs to connect to the database. Any other include files need to be included too, if necessary.