quick PHP help needed

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
stagnant filth
Forum Newbie
Posts: 3
Joined: Tue Aug 26, 2003 2:05 am

quick PHP help needed

Post by stagnant filth »

ok well ill admit that im very new to php and im just starting to learn. i have a problem that i hope one of you can solve for me. im having trouble passing information from a form in a html file to a separate php file.

what im dealing with now is something like this:
---the html file with the form ----

<html>
<head>
<title>Untitled Document</title>
</head>

<body>
<form method="post" action="calculate.php">
<input name="one" type="text">
<input type="submit" value="blah" name="submit">
</form>
</body>
</html>

----and this is calculate.php----

<?php
echo "$one";
?>



so what am i doing wrong?
User avatar
gite_ashish
Forum Contributor
Posts: 118
Joined: Sat Aug 31, 2002 11:38 am
Location: India

Post by gite_ashish »

check this:
Before Post Read: Concerning Passing Variables in PHP 4.2+
(viewtopic.php?t=511&start=0&postdays=0& ... 1c5400f616)
stagnant filth
Forum Newbie
Posts: 3
Joined: Tue Aug 26, 2003 2:05 am

Post by stagnant filth »

ahhh yes. as i said..complete newbie here. thanks a lot for the help. :)
User avatar
Orkan
Forum Commoner
Posts: 32
Joined: Sun Aug 24, 2003 9:07 am
Location: Ukraine
Contact:

Post by Orkan »

If you have problem with "Note: undefined variable..." - you need to check register_globals in your php.ini file. If the parameter is "off" you need to use $HTTP_POST_VARS[] array to get posted var:

Code: Select all

<?php
$var=$HTTP_POST_VARS["var"];
echo $var;
?>
This should work.
stagnant filth
Forum Newbie
Posts: 3
Joined: Tue Aug 26, 2003 2:05 am

Post by stagnant filth »

is there anyway to change the parameter to on ?
User avatar
Orkan
Forum Commoner
Posts: 32
Joined: Sun Aug 24, 2003 9:07 am
Location: Ukraine
Contact:

yeah!

Post by Orkan »

Just edit the php.ini file :)
If you have no access to it - then I don't know... :(
I'm a newbie too :)
Post Reply