RE: form to php

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Thanks for all ur replies....i have finally got it working. Thanks a lot "grgk2", i did exactly as u told me, i.e., executed the form like so: http://localhost /form.html. And it worked. I was earlier trying to access it by double clicking on it.
 
Once again, thanks for ur help.

grgk2 <grgk2@xxxxxxxx> wrote:

It?s not a bother, it?s the purpose of the list.

 

Yes. What I meant was that in order for the php script to be parsed it should be executed on a web server.

if your html form resides in a file named [form.html], it should be executed like so: http://localhost /form.html. if your web server has a different name just use the appropriate name?

 

My point being that you should not try to execute any php file just by double clicking on it J

 

If you have the following

1)       A web server installed on your machine

2)       Php installed correctly for that WS

 

Then the following script should yield result?

 

[Save as info.php]

<?

            Phpinfo();

?>

[Execute http://localhost/info.php]

 

Mail me the results?

 

 

-----Original Message-----
From: PHP MySQL [mailto:dailymails4me@xxxxxxxxxxx] 
Sent: Thursday, July 29, 2004 1:12 PM
To: grgk2@xxxxxxxx
Subject: RE:  form to php

 

1) i have tried with all the HTML structure and it is not displaying the part using the php code.


i.e., it is displaying "Hi $name. You are $age".


 


2)) Please tell me how ca i make sure iexecute the file through my localhost server (i.e. Apache so that php code will be treated as php code). Do u mean i have to run as "http://127.0.0.1/action.php";


 


Sorry for bothering u again and again.


thanks,


grgk2 <grgk2@xxxxxxxx> wrote:


Luis is very correct.

If you see all the source code that means the php code is not parsed as php
code.

1) Make sure you execute the file through you localhost server (i.e. Apache
so that php code will be treated as php code)

2) any html file should conform with the following skeleton structure








Any echoes you need to do should be within the element

As Luis stated this will do 

<?
$name = $_POST['name']; 
$age = $_POST['age'];
echo "Hi $name. You are $age";
?>

as well as this

<?
echo <<<MYPAGE





Hi $name. You are $age".




MYPAGE;
?>

Hoppe that does it...

-----Original Message-----
From: PHP MySQL [mailto:dailymails4me@xxxxxxxxxxx] 
Sent: Thursday, July 29, 2004 12:30 PM
To: php-windows@xxxxxxxxxxxxx
Subject: RE:  form to php

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 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.

Yahoo! India Matrimony: Find your life partner online.


Yahoo! India Matrimony: Find your life partneronline.

[Index of Archives]     [PHP Home]     [PHP Users]     [PHP Database Programming]     [PHP Install]     [Kernel Newbies]     [Yosemite Forum]     [PHP Books]

  Powered by Linux