Pages: [1]   Go Down
Send this topic | Print
Author Topic: newbie questions: can't get PHP to work  (Read 370 times)
billdietrich
Member
*
Offline Offline

Posts: 4


WWW
« on: December 07, 2008, 02:59:05 AM »

Hello,

I just started my free site on 110mb.  I replaced the default index page
with my own index.html page, which starts with:

<?php display("hello") ?>
<?php phpinfo() ?>
<?php include("password_protect.php"); ?>

<html lang="en-US">
<head>
and so on ...

I uploaded the password_protect.php file, which I got from elsewhere.

I set RWX permissions on the files, through filemanager.

I just can't get ANY life out of any of the PHP.  The HTML of
the index.html page displays just fine.  What is wrong ?

Thanks,

Bill
Logged
Piotr GRD
Honoured 110MB Member
Official 110mb Guru
*****
Offline Offline

Posts: 6668



WWW
« Reply #1 on: December 07, 2008, 03:00:57 AM »

Rename your index.html into index.php Wink
Logged

billdietrich
Member
*
Offline Offline

Posts: 4


WWW
« Reply #2 on: December 07, 2008, 03:11:53 AM »

Okay, thanks, that fixed it.

Funny that I wasn't able to these answers anywhere in the help or forums:
- use index.php instead of index.html
- don't need to set "X" permission on PHP files

Also noticed this quirk in filemanager:
- can't upload-and-replace-existing-file in one operation; have
to delete old file and then upload new version of it.

Thanks again !

Bill
Logged
M0ZZA
A Man In A Trance...
Loyal 110MB Member
*******
Offline Offline

Posts: 2542


So yeah, I would like to be a moderator.


WWW
« Reply #3 on: December 07, 2008, 04:01:39 AM »

Also - you dont need <?php on every line ?>  this would work :

Code:
<?php
display
("hello");
phpinfo();
include(
"password_protect.php");
?>

<html lang="en-US">
<head>

HOWEVER :

notice that I have ended each line with a semicolon - you must do that or you will get a error !
Logged

Pages: [1]   Go Up
Send this topic | Print
Jump to: