0

hello~
i just join in this discussion ....er i am Chinese,so my English is poor
i search this problem in Google,but i can't find some useful information
some people said PHP version cause this problem...
i use PHP 5.3.3 but i saw PHP 5.2.1 books

<html>
<title>
test
</title>
<body>
<div align="center">注册表单
<form id="form1" name="form1" method="post" action="1.php">
用户:<input type="text" name=:"username" id="username" /><br>
密码:<input type="text" name=:"pass" id="pass" /><br>
邮件:<input type="text" name=:"email" id="email" /><br>
<input type="submit" name=:"button" id="button" value="提交" />
</form>
</div>
</body>
</html>
<?php
echo "注册的用户名: ".$_POST["username"]."<br>";
echo "注册的密码: ".$_POST["pass"]."<br>";
echo "注册的邮件: ".$_POST["email"]."<br>";
echo "表单按钮: ".$_POST["button"]."<br>";
?>

error:
Notice: Undefined index: in D:\Apache2.2\htdocs\1.php on line 7
注册的用户名:

Notice: Undefined index: in D:\Apache2.2\htdocs\1.php on line 8
注册的密码:

Notice: Undefined index: in D:\Apache2.2\htdocs\1.php on line 9
注册的邮件:

Notice: Undefined index: in D:\Apache2.2\htdocs\1.php on line 10
表单按钮:

thans your support:)

Edited by aiioef: n/a

5
Contributors
10
Replies
15
Views
6 Years
Discussion Span
Last Post by mohamedasif18
0

why are there ":" in every input-element?

<html>
<title>
test
</title>
<body>
<div align="center">????
<form id="form1" name="form1" method="post" action="1.php">
??:<input type="text" name="username" id="username" /><br>
??:<input type="text" name="pass" id="pass" /><br>
??:<input type="text" name="email" id="email" /><br>
<input type="submit" name="button" id="button" value="??" />
</form>
</div>
</body>
</html>

and the 1.php:

<?php if(isset($_POST['button'])) {
echo "??????: ".$_POST["username"]."<br>";
echo "?????: ".$_POST["pass"]."<br>";
echo "?????: ".$_POST["email"]."<br>";
echo "????: ".$_POST["button"]."<br>";
}
?>
0

error:

Notice: Undefined index: in D:\Apache2.2\htdocs\1.php on line 7
注册的用户名:

Notice: Undefined index: in D:\Apache2.2\htdocs\1.php on line 8
注册的密码:

Notice: Undefined index: in D:\Apache2.2\htdocs\1.php on line 9
注册的邮件:

Notice: Undefined index: in D:\Apache2.2\htdocs\1.php on line 10
表单按钮:

0

why are there ":" in every input-element?

<html>
<title>
test
</title>
<body>
<div align="center">????
<form id="form1" name="form1" method="post" action="1.php">
??:<input type="text" name="username" id="username" /><br>
??:<input type="text" name="pass" id="pass" /><br>
??:<input type="text" name="email" id="email" /><br>
<input type="submit" name="button" id="button" value="??" />
</form>
</div>
</body>
</html>

and the 1.php:

<?php if(isset($_POST['button'])) {
echo "??????: ".$_POST["username"]."<br>";
echo "?????: ".$_POST["pass"]."<br>";
echo "?????: ".$_POST["email"]."<br>";
echo "????: ".$_POST["button"]."<br>";
}
?>

just for a good look.....Does not work

0

I tested the solution i posted above and it worked...

= =....i dont know.. its doesn't work in my computer

0

What are you asking?

error:
Notice: Undefined index: in D:\Apache2.2\htdocs\1.php on line 7
注册的用户名:

Notice: Undefined index: in D:\Apache2.2\htdocs\1.php on line 8
注册的密码:

Notice: Undefined index: in D:\Apache2.2\htdocs\1.php on line 9
注册的邮件:

Notice: Undefined index: in D:\Apache2.2\htdocs\1.php on line 10
表单按钮:

0

Yes in the PHP Manual you will find everywhere

This feature has been DEPRECATED as of PHP 5.3.0. Relying on this feature is highly discouraged.

in functions for global Variables like $_GET, $_POST, $_SERVER

But I don't know any solutions for this problem, sorry

0

Please give suggestions, why i'm having Undefined index: amount error in line 11. thanks
<html>
<body>
<form action="conditionalproblem.php" method="POST">
Please Pay P80.
<input type="text" value = "" name="amount">
<INPUT TYPE="submit" value="PAY">
</form>
<?php

//CONDITIONAL STATEMENTS - PROBLEM SOLVING
if ($_POST <> null )
{
if ($_POST > 80)
{
$change = $_POST - 80;
echo "You're change is :<i>". $change." </i>";
}
else if ($_POST < 80)
{
$change = ($_POST - 80) * -1;
echo "Not enough. Please pay additional :<i>". $change." </i>";
}
else
{
echo "Thank you for giving exact amount.";
}
}
?>
</body>
</html>

0

Hi aiioef, Its not a big problem , Try this, <?php error_reporting(E_ALL ^ E_NOTICE); ?> include this code on every top of the php file. That's all

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.