1. You can download many PHP editors that is freely available online. I recommend PHP Designer which can be downloaded from www.download.com
2. If you prefer you can also write using notepad and naming the file with *.php
3. Lets start using notepad to write a simple PHP script to test the following tasks.
4. Click on Start >> Programs >> Accessories >> Notepad
5. Write the following code
<?php
echo "Hello World";
?>
6. Save the file with the name helloworld.php. Remember to save it as helloworld.php since by default Notepad can save it as helloworld.php.txt.
Access to PHP
In order to get access to PHP server, you will need to run telnet from the labs. The IP address to telnet to is 10.1.1.200 or 192.168.68.42. You will need to upload your files from this telnet access.
A. Configuring your Linux account
1. From Start-Run, type telnet 10.1.1.200. Click OK button.
2. At the prompt, enter your Student ID (e.g aXXXXXXX or bXXXXXXX - case sensitive) as login name and welcome for password.
YOUR ID starts with lowercase.
3. Type passwd to set the password for your account. (Recommended so that you can have a unique password)
4. Type cd ..
5. Type ls -l, you will see a list of directories, ensure that you have your own directory based on your student id
6. Type chmod 755
7. Type mkdir public_html to create a new directory (folder) called public_html.
8. Type chmod 755 public_html (Set permissions for the user, the group, and the others to access public_html directory )
B. Uploading files to the Linux account
1. From Start-Run, type ftp 10.1.1.200. Click OK button. Enter your login name(student ID) and password.
2. Type cd public_html. (Change to public_html directory)
3. Type put path\(source file name) (destination file name).
E.g. put a:\tutorial1.html tutorial1.html.
(You can upload any the HTML files)
4. Omit destination file name if you want to use the same file name. E.g. put a:\tutorial1.html
5. Type bye to quit ftp.
6. Alternatively if you find it troublesome to use telnet, you can also use Netscape to FTP to your site
7. Simply start Internet Explorer with the following address,
ftp://
8. Drag the files you wish to upload onto the FTP window.
C. Using Web Browser to view HTML files in the Linux account
1. Launch Netscape/IE
2. In the location bar, type 10.1.1.200/~(your student ID)/(destination HTML file name).
E.g. 10.1.1.200/~a1234567/helloworld.php
3. You should be able to view your HTML file.
Access to MYSQL
1. You will need to start a telnet session before logging onto MYSQL>
2. Type the following command mysql -u

No comments:
Post a Comment