-
1. Re: One Database connection for on line and off line - How?
Sudarshan Thiagarajan Apr 22, 2012 6:25 AM (in response to whatalotofrubbish)You don't have to struggle this hard. You must first define a site in Dreamweaver instead of editing files on a 'standalone' method. Once you do this, you'll be able to define a local and a remote testing servers separately. This should do the trick. Also, once your site is ready, you could just push the files to your remote server with the specs/ configuration needed for your site to work remotely on your server.
Start by Dreamweaver > Site > New Site
-
2. Re: One Database connection for on line and off line - How?
whatalotofrubbish Apr 22, 2012 9:43 AM (in response to Sudarshan Thiagarajan)The site is already defined in Dreamweaver, with over 100 pages and uploaded to site and working., including my home made cms.
I was just looking for an easy way to set up local and on line connection files for future use.
Thanks for your interest.
Howard
-
3. Re: One Database connection for on line and off line - How?
Rob Hecker2 Apr 24, 2012 7:31 AM (in response to whatalotofrubbish)Howard,
The method I use is to put the connection script in a file outside the web root. Although the file has the same name on both the local and remote servers, the details are specific to that particular connection. Then each page in the website has the following PHP script.
require_once '../outside_folder/.db.php';
This method is also more secure than including the connection details inside the web root. Also note that the file name begins with a period and ends with the php extension, both for added security.
-
4. Re: One Database connection for on line and off line - How?
whatalotofrubbish Apr 24, 2012 8:54 AM (in response to Rob Hecker2)That is a great solution which I will use!
I left the online connection in my connection file but commented out. A day later, after mixed use of on line and off line files, my system was trying to connect to the remote MySQL host instead of Local host if I tried Live View or to access a record set in the bindings column. Took some figuring out. I must have used the wrong comments. All fixed now.



