IIS
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsSystem AdministrationIIS

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old September 16th, 2005, 02:56 PM
tripwater tripwater is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Apr 2003
Posts: 59 tripwater User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 4 h 38 m 36 sec
Reputation Power: 6
Need Help with file extensions

Hello. I was working with Apache, PHP and MYSQL. I had to make adjustments in the Apache config file and add some file extensions to allow php code in .html files. I have a few index.html pages that need to do a little bit of PHP code and now that I am using IIS and MYSQL and PHP, I am not sure how to set this up.

I assume this can be done. If so, where can I find the IIS config file and where should I make the changes?

Thank you for any helo with this.

Reply With Quote
  #2  
Old September 16th, 2005, 03:49 PM
Veamon's Avatar
Veamon Veamon is offline
Blowing up trees with my mind.
Dev Shed Frequenter (2500 - 2999 posts)
 
Join Date: Feb 2005
Location: Neverland Ranch, minus the touching.
Posts: 2,745 Veamon User rank is General (90000 - 100000 Reputation Level)Veamon User rank is General (90000 - 100000 Reputation Level)Veamon User rank is General (90000 - 100000 Reputation Level)Veamon User rank is General (90000 - 100000 Reputation Level)Veamon User rank is General (90000 - 100000 Reputation Level)Veamon User rank is General (90000 - 100000 Reputation Level)Veamon User rank is General (90000 - 100000 Reputation Level)Veamon User rank is General (90000 - 100000 Reputation Level)Veamon User rank is General (90000 - 100000 Reputation Level)Veamon User rank is General (90000 - 100000 Reputation Level)Veamon User rank is General (90000 - 100000 Reputation Level)Veamon User rank is General (90000 - 100000 Reputation Level)Veamon User rank is General (90000 - 100000 Reputation Level)Veamon User rank is General (90000 - 100000 Reputation Level)Veamon User rank is General (90000 - 100000 Reputation Level)Veamon User rank is General (90000 - 100000 Reputation Level)  Folding Points: 131452 Folding Title: Super Ultimate Folder - Level 1Folding Points: 131452 Folding Title: Super Ultimate Folder - Level 1Folding Points: 131452 Folding Title: Super Ultimate Folder - Level 1Folding Points: 131452 Folding Title: Super Ultimate Folder - Level 1Folding Points: 131452 Folding Title: Super Ultimate Folder - Level 1Folding Points: 131452 Folding Title: Super Ultimate Folder - Level 1
Time spent in forums: 3 Weeks 4 Days 5 h 19 m 13 sec
Reputation Power: 929
__________________

Raid1 in XP Pro

My open source projects:
------------------------
Blobber - Add images as blobs to SQL Server
------------------------

Reply With Quote
  #3  
Old September 16th, 2005, 03:57 PM
tripwater tripwater is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Apr 2003
Posts: 59 tripwater User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 4 h 38 m 36 sec
Reputation Power: 6
I appreciate the link, but I have already done this. PHP works. I can open index.php and it display fine. What I need, is to be able to execute php code in index.html. In APache config file you could add extensions that would allow this. I need to be able to do this with IIS. Can I not do this? Or do I just need to change all my index.html pages to index.php?

If that link you posted was supposed to tell me how to do this, I have done all those things and it still does not work.

Thanks

Reply With Quote
  #4  
Old September 16th, 2005, 04:14 PM
Veamon's Avatar
Veamon Veamon is offline
Blowing up trees with my mind.
Dev Shed Frequenter (2500 - 2999 posts)
 
Join Date: Feb 2005
Location: Neverland Ranch, minus the touching.
Posts: 2,745 Veamon User rank is General (90000 - 100000 Reputation Level)Veamon User rank is General (90000 - 100000 Reputation Level)Veamon User rank is General (90000 - 100000 Reputation Level)Veamon User rank is General (90000 - 100000 Reputation Level)Veamon User rank is General (90000 - 100000 Reputation Level)Veamon User rank is General (90000 - 100000 Reputation Level)Veamon User rank is General (90000 - 100000 Reputation Level)Veamon User rank is General (90000 - 100000 Reputation Level)Veamon User rank is General (90000 - 100000 Reputation Level)Veamon User rank is General (90000 - 100000 Reputation Level)Veamon User rank is General (90000 - 100000 Reputation Level)Veamon User rank is General (90000 - 100000 Reputation Level)Veamon User rank is General (90000 - 100000 Reputation Level)Veamon User rank is General (90000 - 100000 Reputation Level)Veamon User rank is General (90000 - 100000 Reputation Level)Veamon User rank is General (90000 - 100000 Reputation Level)  Folding Points: 131452 Folding Title: Super Ultimate Folder - Level 1Folding Points: 131452 Folding Title: Super Ultimate Folder - Level 1Folding Points: 131452 Folding Title: Super Ultimate Folder - Level 1Folding Points: 131452 Folding Title: Super Ultimate Folder - Level 1Folding Points: 131452 Folding Title: Super Ultimate Folder - Level 1Folding Points: 131452 Folding Title: Super Ultimate Folder - Level 1
Time spent in forums: 3 Weeks 4 Days 5 h 19 m 13 sec
Reputation Power: 929
I'm about 99% sure it has to have a .php extension for it to work. Shouldnt be difficult though, just rename them all to .php and update your links.

Reply With Quote
  #5  
Old September 16th, 2005, 04:15 PM
Doug G Doug G is offline
Grumpier Old Moderator
Dev Shed God 12th Plane (10500 - 10999 posts)
 
Join Date: Jun 2003
Posts: 10,829 Doug G User rank is Major General (70000 - 90000 Reputation Level)Doug G User rank is Major General (70000 - 90000 Reputation Level)Doug G User rank is Major General (70000 - 90000 Reputation Level)Doug G User rank is Major General (70000 - 90000 Reputation Level)Doug G User rank is Major General (70000 - 90000 Reputation Level)Doug G User rank is Major General (70000 - 90000 Reputation Level)Doug G User rank is Major General (70000 - 90000 Reputation Level)Doug G User rank is Major General (70000 - 90000 Reputation Level)Doug G User rank is Major General (70000 - 90000 Reputation Level)Doug G User rank is Major General (70000 - 90000 Reputation Level)Doug G User rank is Major General (70000 - 90000 Reputation Level)Doug G User rank is Major General (70000 - 90000 Reputation Level)Doug G User rank is Major General (70000 - 90000 Reputation Level)Doug G User rank is Major General (70000 - 90000 Reputation Level) 
Time spent in forums: 1 Month 20 h 19 m 24 sec
Reputation Power: 765
On the mappings page make sure .html files map to c:\php\php.exe (or wherever your php executable is). But this will put quite an additional load on your web server since all html pages will run through the php interpreter before being output to the web browser.

I'd probably change the file extensions to .php instead.
__________________
======
Doug G
======
"Hide, hide witch! The good folk come to burn thee. Their keen enjoyment hid behind their gothic mask of duty." -Mark Clifton

Reply With Quote
  #6  
Old September 26th, 2005, 05:14 PM
tripwater tripwater is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Apr 2003
Posts: 59 tripwater User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 4 h 38 m 36 sec
Reputation Power: 6
OK, I renamed the index.html file to index.php and I still see php code when I execute the page. I can take the same code and paste it into a test page on another server running apache and it works fine.

I do have index.html as well as index.php added to the default documents in the IIS admin section. I tried adding php to the ISAPI filters list and pointed it to the php.exe and it has a red down arrow beside it and the status is "Not Loaded". I read some where to point this filter to the php4isapi.dll and I tried it as well with the same results.

At this point, I can load a php test page that shows phpinfo(). And it looks fine. But when I try to load my index page, I get html mixed with php code. Like I said, I can copy this exact code into a test file on an apache server and it works and looks fine.

Any ideas? I am at a loss here as to what to do next.

Thanks for any help.

Reply With Quote
  #7  
Old September 26th, 2005, 06:22 PM
Doug G Doug G is offline
Grumpier Old Moderator
Dev Shed God 12th Plane (10500 - 10999 posts)
 
Join Date: Jun 2003
Posts: 10,829 Doug G User rank is Major General (70000 - 90000 Reputation Level)Doug G User rank is Major General (70000 - 90000 Reputation Level)Doug G User rank is Major General (70000 - 90000 Reputation Level)Doug G User rank is Major General (70000 - 90000 Reputation Level)Doug G User rank is Major General (70000 - 90000 Reputation Level)Doug G User rank is Major General (70000 - 90000 Reputation Level)Doug G User rank is Major General (70000 - 90000 Reputation Level)Doug G User rank is Major General (70000 - 90000 Reputation Level)Doug G User rank is Major General (70000 - 90000 Reputation Level)Doug G User rank is Major General (70000 - 90000 Reputation Level)Doug G User rank is Major General (70000 - 90000 Reputation Level)Doug G User rank is Major General (70000 - 90000 Reputation Level)Doug G User rank is Major General (70000 - 90000 Reputation Level)Doug G User rank is Major General (70000 - 90000 Reputation Level) 
Time spent in forums: 1 Month 20 h 19 m 24 sec
Reputation Power: 765
Make sure the web server has script execute permissions on the files and folders. If you see the code in your browser that is a sign that the php code is not getting sent through the php parser for some reason.

Reply With Quote
  #8  
Old September 26th, 2005, 06:43 PM
tripwater tripwater is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Apr 2003
Posts: 59 tripwater User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 4 h 38 m 36 sec
Reputation Power: 6
Thanks for the reply. I have all my website sites in the wwwroot dir. THe same dir as the test.php file that executes the phpinfo() script correctly. Not sure what I should do differently here by what you are saying. Can you please elaborate as to why one file would execute php in the same dir as another but the other file does not?

THank you again

Reply With Quote
  #9  
Old September 27th, 2005, 11:31 PM
Doug G Doug G is offline
Grumpier Old Moderator
Dev Shed God 12th Plane (10500 - 10999 posts)
 
Join Date: Jun 2003
Posts: 10,829 Doug G User rank is Major General (70000 - 90000 Reputation Level)Doug G User rank is Major General (70000 - 90000 Reputation Level)Doug G User rank is Major General (70000 - 90000 Reputation Level)Doug G User rank is Major General (70000 - 90000 Reputation Level)Doug G User rank is Major General (70000 - 90000 Reputation Level)Doug G User rank is Major General (70000 - 90000 Reputation Level)Doug G User rank is Major General (70000 - 90000 Reputation Level)Doug G User rank is Major General (70000 - 90000 Reputation Level)Doug G User rank is Major General (70000 - 90000 Reputation Level)Doug G User rank is Major General (70000 - 90000 Reputation Level)Doug G User rank is Major General (70000 - 90000 Reputation Level)Doug G User rank is Major General (70000 - 90000 Reputation Level)Doug G User rank is Major General (70000 - 90000 Reputation Level)Doug G User rank is Major General (70000 - 90000 Reputation Level) 
Time spent in forums: 1 Month 20 h 19 m 24 sec
Reputation Power: 765
Maybe there is a problem in your php page code.

Reply With Quote
  #10  
Old September 28th, 2005, 07:25 AM
tripwater tripwater is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Apr 2003
Posts: 59 tripwater User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 4 h 38 m 36 sec
Reputation Power: 6
Yes, but like I said earlier, I can take this page that is showing the php code in the browser and copy it up to another server (running apache) and it works fine. SO it is not the code on the page.

Thanks for the reply.

Anyone else have any suggestions?

Reply With Quote
  #11  
Old September 28th, 2005, 08:29 AM
Veamon's Avatar
Veamon Veamon is offline
Blowing up trees with my mind.
Dev Shed Frequenter (2500 - 2999 posts)
 
Join Date: Feb 2005
Location: Neverland Ranch, minus the touching.
Posts: 2,745 Veamon User rank is General (90000 - 100000 Reputation Level)Veamon User rank is General (90000 - 100000 Reputation Level)Veamon User rank is General (90000 - 100000 Reputation Level)Veamon User rank is General (90000 - 100000 Reputation Level)Veamon User rank is General (90000 - 100000 Reputation Level)Veamon User rank is General (90000 - 100000 Reputation Level)Veamon User rank is General (90000 - 100000 Reputation Level)Veamon User rank is General (90000 - 100000 Reputation Level)Veamon User rank is General (90000 - 100000 Reputation Level)Veamon User rank is General (90000 - 100000 Reputation Level)Veamon User rank is General (90000 - 100000 Reputation Level)Veamon User rank is General (90000 - 100000 Reputation Level)Veamon User rank is General (90000 - 100000 Reputation Level)Veamon User rank is General (90000 - 100000 Reputation Level)Veamon User rank is General (90000 - 100000 Reputation Level)Veamon User rank is General (90000 - 100000 Reputation Level)  Folding Points: 131452 Folding Title: Super Ultimate Folder - Level 1Folding Points: 131452 Folding Title: Super Ultimate Folder - Level 1Folding Points: 131452 Folding Title: Super Ultimate Folder - Level 1Folding Points: 131452 Folding Title: Super Ultimate Folder - Level 1Folding Points: 131452 Folding Title: Super Ultimate Folder - Level 1Folding Points: 131452 Folding Title: Super Ultimate Folder - Level 1
Time spent in forums: 3 Weeks 4 Days 5 h 19 m 13 sec
Reputation Power: 929
Maybe theres something in the code that IIS doesnt recognize, but Apache does. Post it here with the error message and we'll look at it.

Reply With Quote
  #12  
Old September 28th, 2005, 08:57 AM
tripwater tripwater is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Apr 2003
Posts: 59 tripwater User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 4 h 38 m 36 sec
Reputation Power: 6
Ok, this page has no errors, it just shows a few fragments of php code, not even all of it...All this page is, is a login and if the user is logged in already, (I use sess vars to check) I forward them on to a different page using the page include.

When I view the page in the browser I see

"; echo $value;}?>

No errors at all and like I said earlier, I can call my test.php page that has an echo as well as phpinfo() in the same location on my server and it runs fine.


Code:
<?
session_start();

//here we unregister our sess vars if the user hit logout.
if (!empty($_GET["logout"]))
	{
	$HTTP_SESSION_VARS["group"] = '';
	$HTTP_SESSION_VARS["userid"] = '';


	session_destroy();

	session_unregister("group");
	session_unregister("userid");

	}




if (!empty($HTTP_SESSION_VARS["group"]) && !empty($HTTP_SESSION_VARS["userid"]))
	include ("main/access.php");



//we enter here if it is the first time logging in and no session vars have been set yet.
else
	{
	include("functions.php");


	$value =	"<html>
						<head>
						<title> MUMS Major Unit Management System </title>
						<META HTTP-EQUIV=\"Content-Type\" CONTENT=\"text/html; charset=iso-8859-1\">
						<link rel=\"stylesheet\" type=\"text/css\" href=\"main.css\">
						</HEAD>
						
						
						
						<SCRIPT LANGUAGE=\"JavaScript\">

					function TheFormCheck()
							{

								if (document.login.username.value == \"\" || document.login.password.value == \"\")
									{
									alert(\"You must fill in a UserName and Password to continue.\");
									document.login.username.focus();

									return false;
									}
								else
									return true;


							}


					</script>
					
					<SCRIPT LANGUAGE=\"JavaScript\">
									<!-- Original:  Tom Khoury (twaks@yahoo.com) -->
									<!-- This script and many more are available free online at -->
									<!-- The JavaScript Source!! http://javascript.internet.com -->
			
									<!-- Begin
									function placeFocus()
										{										
										if (document.forms.length > 0)
											{
											var field = document.forms[0];
											for (i = 0; i < field.length; i++)
												{
												if ((field.elements[i].type == \"text\") ||
													(field.elements[i].type == \"textarea\") ||
													(field.elements[i].type.toString().charAt(0) ==\"s\"))
													{
													document.forms[0].elements[i].focus();
													break;
													}
												}
											}
										}
			
									//  End -->							
								
								</script>
				<!--this is for our onfocus field colors-->
					<script type=\"text/javascript\" language=\"JavaScript\" src=\"main/code.js\"></script>
					
					
					<BODY topmargin=\"0\" marginwidth=\"0\" leftmargin=\"0\" hspace=\"0\"  bgcolor=\"#ffffff\" OnLoad=\"placeFocus();\">

				<form name=\"login\" action=\"main/access.php\" method=\"post\"  onSubmit=\"return TheFormCheck()\">
				<table border=0 width=275 align=center>
						<tr>
							<td colspan=2>
								To gain access into MUMS, you must provide a UserName and Password.
							</td>
						</tr>
						<tr>
							<td width=20%>
								UserName
							</td>
							<td>
								<input type=text name=username size=15 maxlength=15 value=\"\" onFocus=\"chgit(this)\" onBlur=\"chgback(this)\">
							</td>
						</tr>
						<tr>
							<td width=20%>
								Password
							</td>
							<td>
								<input type=password name=password size=15 maxlength=15 value=\"\" onFocus=\"chgit(this)\" onBlur=\"chgback(this)\">
							</td>
						</tr>
					</table>
					
					<table width=300 align=center>
						<tr>
							<td align=right>
								<input type=submit name=submit value=\"Login\">
							</td>
						</tr>
					</table></form>
					</body>
					</html>";


	echo $value;
	}



?>




Sorry about the formatting, my editor seems to add extra spaces...

Thanks for any help

Reply With Quote
  #13  
Old September 28th, 2005, 03:50 PM
Doug G Doug G is offline
Grumpier Old Moderator
Dev Shed God 12th Plane (10500 - 10999 posts)
 
Join Date: Jun 2003
Posts: 10,829 Doug G User rank is Major General (70000 - 90000 Reputation Level)Doug G User rank is Major General (70000 - 90000 Reputation Level)Doug G User rank is Major General (70000 - 90000 Reputation Level)Doug G User rank is Major General (70000 - 90000 Reputation Level)Doug G User rank is Major General (70000 - 90000 Reputation Level)Doug G User rank is Major General (70000 - 90000 Reputation Level)Doug G User rank is Major General (70000 - 90000 Reputation Level)Doug G User rank is Major General (70000 - 90000 Reputation Level)Doug G User rank is Major General (70000 - 90000 Reputation Level)Doug G User rank is Major General (70000 - 90000 Reputation Level)Doug G User rank is Major General (70000 - 90000 Reputation Level)Doug G User rank is Major General (70000 - 90000 Reputation Level)Doug G User rank is Major General (70000 - 90000 Reputation Level)Doug G User rank is Major General (70000 - 90000 Reputation Level) 
Time spent in forums: 1 Month 20 h 19 m 24 sec
Reputation Power: 765
Quote:
When I view the page in the browser I see

"; echo $value;}?>

This indicates there is a code problem, php thinks the lines you see are html code rather than php. A misplaced " or ; may cause this kind of problem.

Reply With Quote