| Members: 21 |
| Language: English |
|
Group categories:
|
| More group info » |
|
? PHP is a scripting language that is embedded intoan HTML page. This means that you place your PHP code directly intoyour web page. It's also a server-side scripting language, so you willneed a web server to see any results of your PHP coding efforts.JavaScript is a client-side scripting language, so all of the code thatyou write in JavaScript is downloaded to the client's browser program,and the browser is responsible for interpreting and running the script.Anyone with enough knowledge can look at and rip off your code. PHP,being server-side, is interpreted and run on the web server. The clientrequests your PHP page, the web server takes the page, runs all of the PHP scriptin the page and outputs the result to the client. No PHP code is eversent to the browser. This does mean, however, that you always need toview your PHP code through a web server - simply opening the file offyvariour hard drive in Internet Explorer will not work. So how does the web server know what is PHP and what isn't? As you would have defined your JavaScript code within tags:
The final way of escaping from HTML is to use ASP style tags: <% but these have to be explicitly turned on in the php.ini file. As mentioned earlier, the first method is the preferred method. OK,so how does this work, exactly? Make sure that you've defined your PHPsite in Dreamweaver MX and create a new page, saving it as welcome.php- once you have that click on the Code Block button to insert a new PHPcode block:
Ifyou were in Design View, Dreamweaver will immediately switch to a splitDesign/Code view so that you can see your PHP code. You code shouldlook like: in-between the and ?> tags add the following code: echo 'Welcome to PHP'; Thissingle line statement simply sends the string Welcome to PHP to thebrowser, in the position that it appears within the HTML page. As youwould expect, running this page simply outputs the text Welcome to PHPwithin our browser window. This is all very exciting, but it'snot incredibly useful yet. In the next section we'll delve intovariables and start getting some more interesting stuff happening. FOR FULL ARTICLE ... CLICK HERE~!!
|
|
| Create a group - Google Groups - Google Home - Terms of Service - Privacy Policy |
| ©2009 Google |