944,200 Members | Top Members by Rank

Ad:
  • PHP Discussion Thread
  • Marked Solved
  • Views: 2328
  • PHP RSS
May 9th, 2006
0

Running VERY BASIC PHP script ???

Expand Post »
I'm rather new at PHP.

I'm trying to run a script, but every time I do so, I'm not quite getting the output I should be getting.

I'm using this my Dreamweaver at home & working on the simple examples from this website http://www.php.net/manual/en/tutorial.forms.php

I've typed in:

index.html file

PHP Syntax (Toggle Plain Text)
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  2. <html xmlns="http://www.w3.org/1999/xhtml">
  3. <head>
  4. <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
  5. <title>Untitled Document</title>
  6. </head>
  7.  
  8. <body>
  9.  
  10. <form action="action.php" method="post">
  11. <p>Your name: <input type="text" name="name" /></p>
  12. <p>Your age: <input type="text" name="age" /></p>
  13. <p><input type="submit" /></p>
  14. </form>
  15.  
  16. </body>
  17. </html>

action.php

PHP Syntax (Toggle Plain Text)
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  2. <html xmlns="http://www.w3.org/1999/xhtml">
  3. <head>
  4. <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
  5. <title>Untitled Document</title>
  6. </head>
  7.  
  8. <body>
  9.  
  10. Hi <?php echo $_POST['name']; ?>.
  11. You are <?php echo $_POST['age']; ?> years old.
  12.  
  13. </body>
  14. </html>

Every time I run "index.html", although I can see the "form" & after typing "name" and "age", as soon as I press the "Submit Query" button, I get a pop-up message (as if it's opening a file "action.php" & when I say "Open", I get another pop-up message saying:

"Invalid Menu handle"

RATHER THAN the output, which I think I should be getting:

a message SIMILAR to "Hi Joe. You are 22 years old." (as it can be seen from the example given on the PHP website).
Reputation Points: 10
Solved Threads: 0
Junior Poster in Training
j4mes_bond25 is offline Offline
90 posts
since Jan 2006
May 9th, 2006
0

Re: Running VERY BASIC PHP script ???

It sounds very much like you do not have PHP installed on your machine, or if you are using a hosting account, that they do not have PHP installed.

If you are developing and have installed PHP locally then there is a problem with your installation.
Reputation Points: 16
Solved Threads: 7
Junior Poster
Lafinboy is offline Offline
166 posts
since Jul 2004
May 10th, 2006
0

Re: Running VERY BASIC PHP script ???

Quote originally posted by Lafinboy ...
It sounds very much like you do not have PHP installed on your machine, or if you are using a hosting account, that they do not have PHP installed.

If you are developing and have installed PHP locally then there is a problem with your installation.

I've downloaded a program called "XAMPP" (as you can see in the attached image), from the link seen on PHP's official website.

I downloaded it from: http://www.apachefriends.org/en/xampp-windows.html

Basically, this application is a combination of "MySQL", "PHP", "Apache" & "FireZilla ftp" (as it can be seen from the attached image).

In the attached image, you can notice that:

>> next to "MySQL", it says "Running"
>> next to FireZilla", it says "Running"
>> next to Apache, it DOES NOT say running

BUT in the message area (white spaced), it DOES say "Apache service started", so does it not mean the Apache is ALREADY RUNNING or does the missing "Running" means it's NOT connected ???

Does it get connected easily OR do we have to wait & try AGAIN & AGAIN to get connected to Apache ???
Attached Thumbnails
Click image for larger version

Name:	php-sql-apache.gif
Views:	36
Size:	48.2 KB
ID:	1972  
Reputation Points: 10
Solved Threads: 0
Junior Poster in Training
j4mes_bond25 is offline Offline
90 posts
since Jan 2006

This thread is solved

Either the thread starter or a moderator has marked this thread as solved. You can most likely trust the responses and answers given. There is most likely no reason for any further responses to be posted here. If you have a related question, please start a new thread in this forum instead.

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in PHP Forum Timeline: help with finding right code
Next Thread in PHP Forum Timeline: finding page size





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC