Click to See Complete Forum and Search --> : PHP / ASP Problem


izlik
05-15-2007, 06:49 PM
Hello.

The code bellow in the file "default.asp" is the code i use to direct people depending on what subdomain they acsess my server with, it's ASP code.

and here for my problem, if you visit http://www.rizzler.se you get to my main page. it's a PHP files "index.php" in that file i have the "uptime" code shown bellow,when people visit http://www.rizzler.se it is not displayed as in http://www.rizzler.se/index.php and i wonder why it is not ?

REDIRECT

<% session.LCID=1053 %>
<% Response.CacheControl = "no-cache" %>
<% Response.AddHeader "Pragma", "no-cache" %>
<% Response.Expires = -1 %>
<%

SiteNameURL = Request.ServerVariables("SERVER_NAME")

If SiteNameURL = "www.rizzler.se" Then
%><!-- #Include File="index.php" --><%
else

If SiteNameURL = "folding.rizzler.se" Then
%><!-- #Include File="folding/myfolding.html" --><%
else


End If
end if
%>


UPTIME

<?php
$uptime = time() - filemtime("c:pagefile.sys");
$days = $uptime / 3600 / 24;
$hours = ($days - floor($days)) * 24;
$minutes = ($hours - floor($hours)) * 60;
$seconds = ($minutes - floor($minutes)) * 60;
echo " Server Uptime: ".(int)$days." dagar ".(int)$hours." timmar ".(int)$minutes." minuter ".(int)$seconds." sekunder ....." ;
?>

dzysyak
05-15-2007, 07:23 PM
Jut open HTML source of your page and you will see :)

Sergiy,
PHP/MySQL/AJAX web site development (http://site4fast.com)

izlik
05-15-2007, 07:59 PM
Jut open HTML source of your page and you will see :)

Sergiy,
PHP/MySQL/AJAX web site development (http://site4fast.com)


how do you mean? =) im a litte slow :P

dzysyak
05-15-2007, 08:40 PM
ASP just includes php file as a text, but not run the php code ;) Actually not sure why are you using ASP foth this, when you can do that with PHP?

Sergiy,
PHP/MySQL/AJAX web site development (http://site4fast.com)

izlik
05-15-2007, 09:25 PM
how can i do it with PHP? can you make an example? im not used to PHP yet :(

dzysyak
05-16-2007, 06:17 AM
Something like that, if I have not missed something:



header("Cache-Control: no-cache, must-revalidate"); // HTTP/1.1
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); // Date in the past

if($_SERVER['HTTP_HOST']=='www.rizzler.se'){
include("index.php");
}

if($_SERVER['HTTP_HOST']=='folding.rizzler.se'){
include("folding/myfolding.html");
}