Dreamweaver MX forms/PHP scripts

bella

Namaste
I'm having difficulty understanding how PHP scripts work. Can anyone give me the basic steps... I've downloaded a script, & created a form, now what?
thanks
:rolleyes:
 
php is enabled on the server. Do you think perl is better to use, that is also on the server.
 
it depends what you want to do. PHP is an embedded scripting language, whereas perl is a programming language you can use to output HTML. I've never used Perl, but I've used PHP extensively and found it a powerful tool.

To access a php script, with a form for instance. set the action of the form to the name of the script, add any input names/values and then go to the form in your browser like this:
http://123.456.78.90/path/to/form.html
where 123.456.78.90 is the IP address of your server, and /path/to/form is the location of the form page from the webserver's DocumentRoot.
 
I'm a big fan of PHP. It's pretty simple to use. I've had some experience with Pearl, and in most cases, it would be overkill for smaller web projects.

I use PHP all the time now.

Here's a how to create your first PHP script.

1) Open a text document.
2) Type the following code:

Code:
<html>
<head>
<title>My First PHP Script</title>
</head>

<body>

<?php

echo "Hello World!";

?>

</body>
</html>

3) Save it as Page.php
4) Upload it to the server (which has php services running)
5) Call the page from your browser.
www.domain.com/path/to/file/page.php

** By simply saving it as a .php file it tells the server software to let the php engine pars the page.

** In this case, we just had it print the words "hello world" but we could have had the script do something more intelligent.

** Most of the code above is straight HTML. The only PHP was between the "<?php" AND "?>" tags.

** You can put multiple php tags, so you could have a page that's half html and half php.

** Ideally you'd use PHP to either write HTML or talk to your database, then write HTML based on what it finds.

Go to wwwPHP.net to learn everything you could ever want to know about php.
 
Perl is CGI, PHP is another type of scripting. Check OReilly sources on the Web to learn the basics about both. I'm struggling with PHP at the moment, I'm sure I'll end in liking it. And I better do, PHP is the future.
 
Back
Top