php-windows Digest 29 Jul 2004 18:44:59 -0000 Issue 2337
Topics (messages 24276 through 24282):
Re: php installation problem
24276 by: Oliver John V. Tibi
Re: [PHP-mysql]Problems with PHP5
24277 by: Brandon Thetford
form to php
24278 by: PHP MySQL
24279 by: Luis Moreira
24280 by: PHP MySQL
24281 by: PHP MySQL
24282 by: Mark Collin
Administrivia:
To subscribe to the digest, e-mail:
[EMAIL PROTECTED]
To unsubscribe from the digest, e-mail:
[EMAIL PROTECTED]
To post to the list, e-mail:
[EMAIL PROTECTED]
----------------------------------------------------------------------
--- Begin Message ---
Hi!
Please refer to the online installation procedures for using PHP with
Apache. Make sure that your Apache server is running as a 'service' (daemon)
by verifying its status under 'services.msc' snap-in for Microsoft
Management Console.
Have you ever tried accessing the file by NOT double-clicking on it? Try
firing up your favorite browser and go somewhere like 'http://localhost/' or
'http://127.0.0.1/' to see if Apache really is running. Also check where you
have saved your 'helloworld.php' (or something), make sure it's under the
DocumentRoot of Apache (by default, this will be under 'C:\Program
Files\Apache Group\Apache\htdocs'). If you're sure that PHP is installed
properly as per documentation, Apache is up and running, and your PHP file
is under the DocumentRoot, try visiting something like
'http://127.0.0.1/helloworld.php'.
HTH.
--
Running 'ojtibi' on '127.0.0.1' (BATCH_OPTIMISTIC mode).
"Live free() or die()."
"Php mysql" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Hello list,
> While installing php....after i have configured everything, i am not able
to get php running. While trying to run a test page consisting of the code:
> <?php
> echo "Hello!";
> php?>
>
> I get a dialog box saying that "You have chosen to download a file from
this location". Upon opening the file, i get the whole code and not just
"Hello".
>
> Please can you tell me what went wrong. I am using PHP 4.3.4, Apache
1.3.2. and Windows 2000.
>
> Also can u please tell me how do u know that php has been installed in my
PC. While double clicking php.exe, a window gets opened and nothing seems to
happen with it. We have to close it manually. Is it unusual or is it
supposed to be like that only. Please help.
>
> Thanks in advance,
> penjo
>
> Yahoo! India Matrimony: Find your life partneronline.
--- End Message ---
--- Begin Message ---
Same problem here. I noticed several other people had the same problem and
have been looking for hours to find the answer to the problem in here. Is
this ever answered?
--- End Message ---
--- Begin Message ---
hi list,
i have managed to successfully install php and i am now going through the manual and
trying a few of the examples given there. The examples i have tried till now are all
working except for one. The example about inputting in the form and then displaying it
through php is not working for me. But when i run it i get the entire code in
action.php instead.
The example i am referring to is:
form action="action.php" method="post"> <p>Your name: <input type="text" name="name"
/></p> <p>Your age: <input type="text" name="age" /></p> <p><input type="submit"
/></p></form
action.php:
Hi <?php echo $_POST['name']; ?>.You are <?php echo $_POST['age']; ?>
Please tell me whts wrong....
thanks in advance
penjo
Yahoo! India Matrimony: Find your life partneronline.
--- End Message ---
--- Begin Message ---
Is this the contebnt of the PHP file ?
Hi <?php echo $_POST['name']; ?>.You are <?php echo $_POST['age']; ?>
It can not start by the "Hi" word ...
Action.php should be something like
<?
$name = $_POST['name'];
$age = $_POST['age'];
echo "Hi $name. You are $age";
?>
PHP MySQL wrote:
hi list,
i have managed to successfully install php and i am now going through the manual and
trying a few of the examples given there. The examples i have tried till now are all
working except for one. The example about inputting in the form and then displaying it
through php is not working for me. But when i run it i get the entire code in
action.php instead.
The example i am referring to is:
form action="action.php" method="post"> <p>Your name: <input type="text" name="name" /></p> <p>Your age: <input type="text"
name="age" /></p> <p><input type="submit" /></p></form
action.php:
Hi <?php echo $_POST['name']; ?>.You are <?php echo $_POST['age']; ?>
Please tell me whts wrong....
thanks in advance
penjo
Yahoo! India Matrimony: Find your life partneronline.
--- End Message ---
--- Begin Message ---
hi,
1) The lines in the form are in the correct order.
2)i tried using HTTP_POST['age']; ?> , but it still displays the entire code.
Not quite sure wht u meant by "AUTOGLOBAL ON|OFF setting"..... If u meant
register_globals in php.ini file, then it is set to on.
3) Regarding action.php:
phpinfo();
?>
It still only displays the code.
I ran action.php by itself and looked at the info page and i couldnot any entries for
$HTTP_POST['name'] or $ _POST['name'] or
$HTTP_POST['age'] or $_POST['age']
Please help.
penjo
grgk2 <[EMAIL PROTECTED]> wrote:
Hi
1) Line " form action="action.php" method="post">
Your name: [input] type="text" name="name" />
Your age: [input] />
[input]
should read
"
Your name: [input] name="name" />
Your age: [input]
[input]
"
assuming that is correct
2) Try .You are $HTTP_POST['age']; ?>
REASON - php.ini - AUTOGLOBAL ON|OFF setting
3) If that doesn't work try
4) action.php:
phpinfo();
?>
Try to locate entries for $HTTP_POST['name'] or $ _POST['name'] or
$HTTP_POST['age'] or $_POST['age']
See if they carry any values.
REASON - php.ini - Other settings
And resubmit to the list with your results.
Best regards,
Grgk2
Yahoo! India Matrimony: Find your life partneronline.
--- End Message ---
--- Begin Message ---
hi,
Yes this is the contents of the file. I tried to use ur code but it still displays
the entire code and not just the line required.
Any idea wht is wrong.
thanks,
penjo
Luis Moreira <[EMAIL PROTECTED]> wrote:
Is this the contebnt of the PHP file ?
Hi .You are
It can not start by the "Hi" word ...
Action.php should be something like
$name = $_POST['name'];
$age = $_POST['age'];
echo "Hi $name. You are $age";
?>
PHP MySQL wrote:
>hi list,
>
> i have managed to successfully install php and i am now going through the manual and
> trying a few of the examples given there. The examples i have tried till now are all
> working except for one. The example about inputting in the form and then displaying
> it through php is not working for me. But when i run it i get the entire code in
> action.php instead.
>The example i am referring to is:
>
>form action="action.php" method="post">
Your name: [input]
Your age: [input]
[input]
>
>action.php:
>
>Hi .You are
>
>
>
>Please tell me whts wrong....
>
>thanks in advance
>
>penjo
>
>Yahoo! India Matrimony: Find your life partneronline.
>
>
--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Yahoo! India Matrimony: Find your life partneronline.
--- End Message ---
--- Begin Message ---
You haven't closed your form tag which is causing it to all go wrong.
Here is some working code for you:
<form action="action.php" method="post">
<p>Your name: <input type="text" name="name"></p>
<p>Your age: <input type="text" name="age"></p>
<p><input type="submit" /></p>
</form>
action.php:
<?php
//Check to see if user has clicked submit
if (isset($_POST['name']) && isset($_POST['age']))
{
//Check to see if user has entered data in both fields
if (!empty($_POST['name']) && !empty($_POST['age']))
{
//User has entered data in both fields so display result
?>
Hi <?php echo $_POST['name']; ?> .You are <?php echo $_POST['age'];
}
else
{
//User has not populated both fields so send a warning to user telling
them what to do
?>
<script language="javascript" type="text/javascript">
window.alert('You must complete both fields');
</script>
<?php
}
}
?>
You would probably find it easier to read if you format your HTML a
little, a little formatting goes a long way when it comes to debugging
HTML, especially if your using the devils own tables :P
"Php mysql" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]:
> hi list,
>
> i have managed to successfully install php and i am now going through
> the manual and trying a few of the examples given there. The examples i have
> tried till now are all working except for one. The example about inputting
> in the form and then displaying it through php is not working for me. But
> when i run it i get the entire code in action.php instead.
> The example i am referring to is:
>
> form action="action.php" method="post"> <p>Your name: <input type="text"
> name="name" /></p> <p>Your age: <input type="text" name="age" /></p>
> <p><input type="submit" /></p></form
>
> action.php:
>
> Hi <?php echo $_POST['name']; ?>.You are <?php echo $_POST['age']; ?>
>
>
>
> Please tell me whts wrong....
>
> thanks in advance
>
> penjo
>
> Yahoo! India Matrimony: Find your life partneronline.
--- End Message ---