DeveloperSide.NET Forums

DeveloperSide.NET => Anything else goes here => Topic started by: puppynewbie on December 26, 2007, 04:17:20 PM



Title: Can't Use $_POST variable - Why?
Post by: puppynewbie on December 26, 2007, 04:17:20 PM
Hi all:
I 've a  problem. I can't access the $_POST variable in a call to a php script? I am using Web Controller beta 0.999. I have the following code in a html file:

<FORM METHOD=POST ACTION="passing.php">
MyName:
<INPUT NAME="myname" TYPE="Text">
<INPUT TYPE=SUBMIT VALUE="Click here to Submit application">
</FORM>

In passing.php, it is like this.

<?php
$hisname=$_POST['myname'];
echo $hisname;
?>

Nothing came up.
Anybody got an answer. I can access the $_POST variable.

regards
Joe


Title: Re: Can't Use $_POST variable - Why?
Post by: admin on December 26, 2007, 06:24:33 PM
try... method="post"


Title: Re: Can't Use $_POST variable - Why?
Post by: puppynewbie on December 30, 2007, 07:27:50 PM
thanks but I tried this and the answer I got is:
Notice: Undefined variable: myname in C:\www\vhosts\localhost\passing.php on line 10

Here the code in passing.html:

<html>
<head>
  <title></title>
</head>
<body>
<form method="post" action="passing.php">
MyName:
<input name="myname" type="Text">
<input type="submit">
</form>
</body>
</html>

Here is the code for passing.php

<html>
<head>
  <title></title>
</head>
<body>

<?php
echo $myname;

?>
</body>
</html>


Title: Re: Can't Use $_POST variable - Why?
Post by: admin on December 31, 2007, 03:49:37 PM
echo $_POST['myname'];


Title: Re: Can't Use $_POST variable - Why?
Post by: puppynewbie on January 01, 2008, 02:47:20 AM
Still Can't. The version of Web Controller is v2.00. The message I got is

Notice: Undefined index: myname in C:\www\webroot\passing.php on line 10 Array PHP Notice: Undefined index: myname in C:\www\webroot\passing.php on line 10.

Is it a configuration error? But I did not change the php config file or anything like that.

Is there other ways to pass variables from a html to a php scripts?


Title: Re: Can't Use $_POST variable - Why?
Post by: admin on January 01, 2008, 08:20:26 PM
Code:
<html>
<head>
<title></title>
</head>
<body>
<form method="post" action="passing.php">
MyName:
<input name="myname" type="Text">
<input type="submit">
</form>
</body>
</html>

Code:
<html>
<head>
<title></title>
</head>
<body>
<?php
echo $_POST['myname'];
?>

</body>
</html>

Works fine for me.


Title: Re: Can't Use $_POST variable - Why?
Post by: puppynewbie on January 18, 2008, 03:06:32 AM
It's ok now. I uninstalled a few program. I adjusted setting in my firewall. Deleted Web Studio folder and reinstalled it again. Everything's ok now. Thanks