Web Hosting Forum | Lunarpages


*
Welcome, Guest. Please login or register.
Did you miss your activation email?



Login with username, password and session length
May 22, 2012, 08:40:11 PM

Pages: [1]   Go Down
  Print  
Author Topic: Add a database connection to website using Frontpage and PHP  (Read 1852 times)
lgm_mcb
Space Explorer
***
Offline Offline

Posts: 6


« on: November 16, 2007, 05:56:39 PM »

Hello,

I need help figuring out how to add a database connection to my website using Frontpage and PHP.  I tried usually only Frontpage and got an error.  I called the tech support and was told that I would have to write code in the Code view to connect to the database.  In trying to use PHP within the .htm file, nothing is happening.  I added the code, published the site with the newly added PHP code, and see nothing being added to the database.  Which means the code isn't working.  But I'm getting no errors.

What are the steps to adding a database connection?
Logged
Rick_E
Master Jedi
*****
Offline Offline

Posts: 1127


« Reply #1 on: November 16, 2007, 06:10:43 PM »

Hello,

PHP code won't normally execute in a file with .htm or .html extension. The page needs to be renamed with a .php extension.

The alternative is to tell the server to process all .htm and .html files with the PHP handler. Then you can execute PHP code in an .htm or .html file. To do this, use the file manager in cPanel to locate and edit the .htaccess file in the public_html folder on the server, adding this line to the end of the file:

Code:
AddHandler x-httpd-php .htm .html
Logged

All the best, Rick E

Search the Microsoft KB for error messages:
http://support.microsoft.com/search/default.aspx?catalog=LCID%3D1033&spid=919&adv=1

Microsoft groups have additional FrontPage assistance:
http://www.microsoft.com/communities
lgm_mcb
Space Explorer
***
Offline Offline

Posts: 6


« Reply #2 on: November 16, 2007, 10:50:34 PM »

I don't know where the public_html folder is.
Logged
Rick_E
Master Jedi
*****
Offline Offline

Posts: 1127


« Reply #3 on: November 17, 2007, 08:39:24 AM »

The public_html folder is the folder on the server holding your web site files. You won't see it in FrontPage. You will see the public_html folder using the File Manager in the LunarPages cPanel control panel.
Logged

All the best, Rick E

Search the Microsoft KB for error messages:
http://support.microsoft.com/search/default.aspx?catalog=LCID%3D1033&spid=919&adv=1

Microsoft groups have additional FrontPage assistance:
http://www.microsoft.com/communities
lgm_mcb
Space Explorer
***
Offline Offline

Posts: 6


« Reply #4 on: November 17, 2007, 09:51:11 AM »

I am looking within the File Manager(using the Control Panel) and I don't see public_html directory.
Logged
Rick_E
Master Jedi
*****
Offline Offline

Posts: 1127


« Reply #5 on: November 17, 2007, 06:59:16 PM »

If you are on a Windows server hosting account, your web folder may be named something else and you may not have an .htaccess file to work with.

If you're on a Linux hosting account you should see your public_html folder in the cPanel File Manager. Not being there I don't have any way of knowing why you're not.  Confused
« Last Edit: November 17, 2007, 07:00:49 PM by Rick_E » Logged

All the best, Rick E

Search the Microsoft KB for error messages:
http://support.microsoft.com/search/default.aspx?catalog=LCID%3D1033&spid=919&adv=1

Microsoft groups have additional FrontPage assistance:
http://www.microsoft.com/communities
drrichs
Spaceship Navigator
*****
Offline Offline

Posts: 78



« Reply #6 on: November 17, 2007, 09:21:18 PM »

It should be named the same on either server type.  Do you see anything when you click on the File Manger in Cpanel?
Logged

... when in doubt... go find out...
Pages: [1]   Go Up
  Print  
 
Jump to: