Jump to content

php doesnt work with iis server?


scarezekiel

Recommended Posts

this is the errors

 

PHP Notice: Use of undefined constant view - assumed 'view' in C:\inetpub\wwwroot\ablenetcommy\index.php on line 139 PHP Notice: Undefined variable: view in C:\inetpub\wwwroot\ablenetcommy\index.php on line 142 PHP Warning: fopen(hitcounter.txt): failed to open stream: Permission denied in C:\inetpub\wwwroot\ablenetcommy\counter.php on line 5 PHP Warning: fputs() expects parameter 1 to be resource, boolean given in C:\inetpub\wwwroot\ablenetcommy\counter.php on line 6 PHP Warning: fclose() expects parameter 1 to be resource, boolean given in C:\inetpub\wwwroot\ablenetcommy\counter.php on line 7 PHP Notice: Undefined variable: view in C:\inetpub\wwwroot\ablenetcommy\index.php on line 146 PHP Notice: Undefined variable: view in C:\inetpub\wwwroot\ablenetcommy\index.php on line 149 PHP Notice: Undefined variable: view in C:\inetpub\wwwroot\ablenetcommy\index.php on line 152 PHP Notice: Undefined variable: view in C:\inetpub\wwwroot\ablenetcommy\index.php on line 155 PHP Notice: Undefined variable: view in C:\inetpub\wwwroot\ablenetcommy\index.php on line 158 PHP Notice: Undefined variable: view in C:\inetpub\wwwroot\ablenetcommy\index.php on line 161 PHP Notice: Undefined variable: view in C:\inetpub\wwwroot\ablenetcommy\index.php on line 164 PHP Notice: Undefined variable: view in C:\inetpub\wwwroot\ablenetcommy\index.php on line 167 PHP Notice: Undefined variable: view in C:\inetpub\wwwroot\ablenetcommy\index.php on line 170 PHP Notice: Undefined variable: view in C:\inetpub\wwwroot\ablenetcommy\index.php on line 173 PHP Notice: Undefined variable: view in C:\inetpub\wwwroot\ablenetcommy\index.php on line 176 PHP Notice: Undefined variable: view in C:\inetpub\wwwroot\ablenetcommy\index.php on line 179 PHP Notice: Undefined variable: view in C:\inetpub\wwwroot\ablenetcommy\index.php on line 182 PHP Notice: Undefined variable: view in C:\inetpub\wwwroot\ablenetcommy\index.php on line 185 PHP Notice: Undefined variable: view in C:\inetpub\wwwroot\ablenetcommy\index.php on line 188 PHP Notice: Undefined variable: view in C:\inetpub\wwwroot\ablenetcommy\index.php on line 191 PHP Notice: Undefined variable: view in C:\inetpub\wwwroot\ablenetcommy\index.php on line 194 PHP Notice: Undefined variable: view in C:\inetpub\wwwroot\ablenetcommy\index.php on line 197

 

 

and this is my index.php

 

 



<?session_start();?>
<?
include ('config.php'); 
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Ablenet Group</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link href="default.css" rel="stylesheet" type="text/css" />
<link rel="stylesheet" href="menu.css" type="text/css" media="screen" />
<style>
#menu li .drop {background:url("images/drop.gif") no-repeat right 8px; 
</style>
<style type="text/css">
a:focus {
outline: none;
}
a.trigger{
position: absolute;
background:#88bbd4 ;
text-decoration: none;
font-size: 11px;
font-family: tahoma;
color:#fff;
padding:5px 12px 6px 10px;
font-weight: bold;
z-index:2;
}
a.trigger.left {
left: 0;
border-top-right-radius: 5px;
-moz-border-radius-topright: 5px;
-webkit-border-top-right-radius: 5px;
-moz-border-radius-bottomright: 5px;
-webkit-border-bottom-right-radius: 5px;
border-bottom-right-radius: 5px;
}
a.trigger.right {
right: 0;
border-bottom-left-radius: 5px;
border-top-left-radius: 5px;
-moz-border-radius-bottomleft: 5px;
-moz-border-radius-topleft: 5px;
-webkit-border-bottom-left-radius: 5px;
-webkit-border-top-left-radius: 5px;
}
a.trigger:hover {
background-color:#59B;
}
a.active.trigger {
background:#666 ;
}
.panel {
font-size: 12px;
font-family: tahoma;
color:#CCC;
position: absolute;
display: none;
background: #000000;
width: 350px;
height: auto;
z-index:1;
}
.panel.left {
left: 0;
padding: 20px 30px 20px 50px;
border-top-right-radius: 15px;
-moz-border-radius-topright: 15px;
-webkit-border-top-right-radius: 15px;
-moz-border-radius-bottomright: 15px;
-webkit-border-bottom-right-radius: 15px;
border-bottom-right-radius: 15px;
}
.panel.right {
right: 0;
padding: 20px 100px 20px 30px;
border-bottom-left-radius: 15px;
border-top-left-radius: 15px;
-moz-border-radius-bottomleft: 15px;
-moz-border-radius-topleft: 15px;
-webkit-border-bottom-left-radius: 15px;
-webkit-border-top-left-radius: 15px;
}
.panel p {
font-size:11px;
font-family: tahoma;
color:#fff;
}
</style>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>
<script type="text/javascript" src="js/jquery.slidePanel.min.js"></script>
<script type="text/javascript">
$(document).ready(function(){
// default settings
// $('.panel').slidePanel();
// custom settings
$('#panel1').slidePanel({
	triggerName: '#trigger1',
	position: 'fixed',
	triggerTopPos: '80px',
	panelTopPos: '0px',


});
$('#panel2').slidePanel({
	triggerName: '#trigger2',
	position: 'fixed',
	triggerTopPos: '120px',
	panelTopPos: '10px'
});
$('#panel3').slidePanel({
	triggerName: '#trigger3',
	triggerTopPos: '220px',
	panelTopPos: '200px',
	ajax: true,
	ajaxSource: 'side.html'
});
});
</script>
</head>
<body>
<a href="#" id="trigger1" class="trigger right">Web <br>Package</a>
<div id="panel1" class="panel right">
<p><font color="red">Web Design & Maintenance</font><br><br> <p><font color="white">
    <p> <img src="images/indent.png" /> Standard Web Design Package<span>&nbsp <font color=red>RM1,488.00</font></span></a>    <span><a href="index.php?view=webdesign"><font color=red>Read more...</font></span></a></p>
<p><img src="images/indent.png" /> Advance Web Design Package</p>
<p><img src="images/indent.png" /> Website Maintenance</p>
<p><img src="images/indent.png" /> Domain Name and Web Hosting Services</p></font><br>
<p><font color="red">For more information, please call</font> <font color="#CD919E">1800-22-1010 </font> <p>
<p><font color="red">or <a href="index.php?view=feedback" style="font-weight:bold; color: #CD919E; " onmouseover="this.style.color='#FFFFFF'"  onmouseout="this.style.color='#CD919E'">send us your enquiry. </a></font> <p>
</div>
<? include ("header/header.php"); ?>
<?




if(isset($_GET[view])) {
$view = $_GET[view];
}
if ($view == ''){
include (VIEWPAGE.'main.php'); 
include ("counter.php");
}
if ($view == 'home'){
include (VIEWPAGE.'main.php'); 
}
if ($view == 'servicesla'){
include (VIEWPAGE.'service_sla.php'); 
}
if ($view == 'servicecon'){
include (VIEWPAGE.'service_consulting.php'); 
}
if ($view == 'solutions'){
include (VIEWPAGE.'solution.php'); 
}
if ($view == 'fulfillment'){
include (VIEWPAGE.'fulfillment.php'); 
}
if ($view == 'about'){
include (VIEWPAGE.'aboutus.php'); 
}
if ($view == 'contact'){
include (VIEWPAGE.'contactus.php'); 
}
if ($view == 'career'){
include (VIEWPAGE.'career.php'); 
}
if ($view == 'rms'){
include (VIEWPAGE.'software_rms.php'); 
}
if ($view == 'erp'){
include (VIEWPAGE.'software_erp.php'); 
}
if ($view == 'cdms'){
include (VIEWPAGE.'software_cdms.php'); 
}
if ($view == 'tams'){
include (VIEWPAGE.'software_tams.php'); 
}
if ($view == 'csms'){
include (VIEWPAGE.'software_csms.php'); 
}
if ($view == 'feedback'){
include (VIEWPAGE.'feedback.php'); 
}
if ($view == 'captcha_code_file'){
include (VIEWPAGE.'captcha_code_file.php'); 
}
if ($view == 'submit'){
include (VIEWPAGE.'submit.php'); 
}
if ($view == 'thanks'){
include (VIEWPAGE.'thanks.php'); 
}
if ($view == 'webdesign'){
include (VIEWPAGE.'webdesign.php'); 
}
?>
<? include ("footer/footer.php"); ?>
</body>
</html>


Link to comment
Share on other sites

Well, first off the title is about running PHP on IIS and then in your first post you are talking about remote desktop-ing into a machine. I'm not sure what one has to do with the other.

 

I'm really not sure what you mean by remoting into your office server. I know what remote desktop is, but haven't a clue what it has to do with your problem (at least not with waht you have provided). Where are you running the server and where are you running the client? As for running PHP on IIS, yes you can do that and the based upon the errors you are reporting it is installed on the web server you are running on.

 

The problem is that your code is, well, crap. It is full of deprecated and poorly implemented logic. The problems you have in the code will be "overlooked" on some servers based upon their version and settings.

 

Some examples

<?session_start();?>

Don't use short tags (i.e. <? ?>), use the full PHP tags, <?php ?>. Also, you aren't even putting spaces between the opening and closing tags and the code contained in them.

 

if(isset($_GET[view])) {
$view = $_GET[view];
}

Unless you have defined a constant called view you should put named indexes in quotes'

if(isset($_GET['view'])) {
$view = $_GET['view'];
}

 

Then in all your if*() conditions you have something like

if ($view == 'home'){

But, unless $_GET['view'] was set the variable $view would never be defined, thus you are getting those errors on the if conditions.

 

So, to fix the majority of your errors

 

1. Use correct PHP open/closing tags

2. Use quotes around the named indexes of the arrays

3. Always set the value of view. Just set it to some logical value if the $_GET value wasn't set

$view = (isset($_GET['view'])) ? $_GET['view'] : false;

 

There was also an error on an included page, I'll let you figure that one out.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.