Forum Moderators: coopster
which one of following do i use?
My local website files are outside of xampp directory
<form action="mail.php" method="post" id="contact">
<form action="http://localhost/mail.php" method="post" id="contact">
my question is can i place mail.php in any directory on my computer?
yes, but how?
no, y not?
Thank you.
my question is can i place mail.php in any directory on my computer?
There's a setting in the file httpd.conf that sets the directory to serve web pages. By default in a XAMPP Windows set up it is "c:/apachefriends/xampp/htdocs". Just find the line that has the DocumentRoot setting. So all your web pages must go in that directory.
Now you can easily change that to any directory you want and restart Apache and you should be good to go.
Tim
find the "hosts" file, usually in something like C:\WINNT\system32\drivers\etc and add an IP for each vbirtual host you want
127.0.0.2 mysite1.loc
127.0.0.3 mysite2.loc
127.0.0.4 testing
Then in your httpd.conf, at the very end in the virtual hosts section, add
<VirtualHost 127.0.0.2>
DocumentRoot C:/websites/mysite1/www
ServerName mysite1.loc
</VirtualHost>
The ".loc" TLD is arbitrary - you can leave it off, use .com or wahtever. I do it that way so it's clear to me from the URL when I'm looking at the local version and when I'm not.
The advantage is that you now go to [mysite1.loc...] to get to that site's home page.