cancel
Showing results for 
Search instead for 
Did you mean: 

very basic php question - trying to get started

sheep
Newbie
Posts: 2
Registered: ‎06-04-2008

very basic php question - trying to get started

hello
have used php sucessfully on other host servers, but trying to do a bit of work for a friend and struggling to get my head round the cgi server issue for plus.net.....
we have a website on the web server, all works fine and dandy
I now want to add a very small piece of php code into a file
<?
include("headlines.html");
?>

have saved file as .php, but where do I put this now? 
I have FTP'd into the ccgi server, have changed file to chmod 755
do i have the file in both the web server and the ccgi server?
and most importantly, how do i call the script into play?
please help - something so simple is turning into my own private nightmare.......
2 REPLIES 2
jelv
Seasoned Hero
Posts: 26,785
Thanks: 971
Fixes: 10
Registered: ‎10-04-2007

Re: very basic php question - trying to get started

If a webpage includes php the entire webpage must be on the ccgi server.
jelv (a.k.a Spoon Whittler)
   Why I have left Plusnet (warning: long post!)   
Broadband: Andrews & Arnold Home::1 (FTTC 80/20)
Line rental: Pulse 8 Home Line Rental (£14.40/month)
Mobile: iD mobile (£4/month)
Prod_Man
Grafter
Posts: 287
Registered: ‎04-08-2007

Re: very basic php question - trying to get started

Step by step,
I assume you want a news type thing,
CCGI Document Root (docroot😞
/share/storage/xx/xx/username/news
Upload your index.php and headlines.html to the "news" directory in Document Root.
docroot/news/index.php

<?PHP
include("headlines.html");
?>

Upload your headlines.html into the SAME DIRECTORY, as the execution path is .
PHP will include from the same directory the script is executed from =>
docroot/news/
In a Shell Prompt (ssh username@ccgi.host.ext / Open up PuTTY and Connect)
...
username@cshellXX:~$ cd news
username@cshellXX:~$ chmod 755 index.php
...
Open your browser,
hit in http://ccgi.username.host.ext/news/index.php
It should work if you have done that because all in the same folder - the document root is easily accessible.
Let us know if you have any grief or success! Smiley
Jim,