form input question

Ask about general coding issues or problems here.

Moderators: macek, egami, gesf

Post Reply
ashz
New php-forum User
New php-forum User
Posts: 14
Joined: Thu Oct 31, 2002 7:40 am

form input question

Post by ashz » Thu Oct 31, 2002 7:46 am

Hi,

I wrote a program that the input is username and password:
<form action="c:\show.php" method="post">
<table border="0">
<tr><td>Username:</td><td><input type="text" name="Username"></td></tr>
<tr><td>Password:</td><td><input type="Password" name="Password"></td></tr>
</table>
<p>
<input type="submit" value="Login">
</form>

When I want to show the variable input using the following code:
<?php
print_r($HTTP_POST_VARS)
?>

I get an output of:
Array ( )

How can I see the variables content (Username, Password) since I need to work with them?

Thx.

ashz
New php-forum User
New php-forum User
Posts: 14
Joined: Thu Oct 31, 2002 7:40 am

php version

Post by ashz » Thu Oct 31, 2002 7:55 am

I am using the php4.2.3.

DoppyNL

Post by DoppyNL » Thu Oct 31, 2002 8:07 am

If you're using PHP 4.2.3 you can use $_POST instead of $HTTP_POST_VARS, the first is going to replace the last in the future.

When you get "Array( )" with print_r, that means that the array is empty, and (with this array) that no variables were posted to the page.
You did push the button did you?
And you did print the array on the page you are posting to?

Greetz Daan

ashz
New php-forum User
New php-forum User
Posts: 14
Joined: Thu Oct 31, 2002 7:40 am

Post by ashz » Thu Oct 31, 2002 8:18 am

I used $_POST instead and no results the array is still empty.

I push the button.

I using the script on my computer and when I run the html file in netscape I have now output and in IE5 i get a print of the php file.

DoppyNL

Post by DoppyNL » Thu Oct 31, 2002 8:24 am

When you get your complete php-script back (including the php-code) you should check the configuration of your server. Then it is not parsing the php-code as it should.

Greetz Daan

Post Reply

Who is online

Users browsing this forum: Baidu [Spider] and 11 guests