Bekijk de volledige versie : PHP script on asus
i have problem with php, i meka a php script under window
when i uploade it to asus and edit with nano i dont have in it php script
this is my script
<?php
if (File_Exists ("../data/192.168.1.21.in.txt")):
$vypis=0;
$vypis=file("../data/192.168.1.21.in.txt");
$riadok=1;
$mb=$vypis[$riadok]/1024;
echo round($mb, 2);
endif;
?>
but in asus see only this
1901
i have intall php-thttpd
And your output is ok if you just make a new script called test.php with the following code?
<?php phpinfo(); ?>
works fine
but cannot read data from filr 192.168.1.20.in.txt
under windows this script works without problem
so the problem is this
under windows test.php ->
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body>
<?
if (File_Exists ("book.dat")):
$vypis=0;
$vypis=file("book.dat");
$riadok=0;
$mb=$vypis[$riadok]/1024;
echo round($mb, 2);
endif;
?>
</body>
</html>
but in asus /opt/bin/nano get this ->
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body>
</body>
</html>
so in asus i dont have the php script
wath is wrong
<?php phpinfo(); ?> work fine
how can i read data from book.dat, and print it to screen
Probably you need to put 'php' behind the opening '<?', which you allways should anyway...
with <?php the result is ame
when i write the scrip manually (nano), i see only a blank webpage
very, very interesting
i write under windows this php script
<?php
phpinfo();
?>
uploade it to asus, but when i edit it with nano i see the all php infopage so not only the little php info script
when rewrite it manualy, the infopage is blank