|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
|
|
SlickEdit: Code in over 40 languages across 7 platforms. SlickEdit’s unmatched power, speed, and flexibility allows even the most accomplished developers to write better code faster. Download a free trial today! |
|
#1
|
|||
|
|||
|
PHP problems
I'm new vith this programing.
How do you solve this problem? And if you need to see whole script please tell me. Notice: Undefined variable: name in G:\htdocs\Game Page\obrazec.php on line 2 Your name is . |
|
#2
|
||||
|
||||
|
perhaps a little bit of code relating to the problem would help?
Off the top of my head, make sure your variable names begin a dollar sign, ex $name |
|
#3
|
|||
|
|||
|
This is file that reads PHP file prom other file.
<html> <head> <title>PHP</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> </head> <body> <h1>Vnašanje podatkov</h1> <form action="obrazec.php" method="post"> Write your name: <input name="name"> <input type="submit"> </form> </body> </html> This is saved in a diferent File <? echo "Your name is $name."; ?> |
|
#4
|
||||
|
||||
|
The problem is that your PHP is set up with register_globals off, which means that you can't just use $name to get the value of a form field. In this case, you'll have to use $_POST["name"]. So youre code would need to look like this:
PHP Code:
__________________
Please don't PM me asking for solutions outside the scope of a thread. Keeping all responses in a thread stands to help others who come along later, which is after all what this forum's all about. |
|
#5
|
|||
|
|||
|
Or it could be that you are trying to see value of an undefined constant or variable.
For example you must be trying : if( $DO == NULL ) You must change it to : if( !isset( $DO )) OR if( empty( $DO )) Hope that helps.. |
|
#6
|
||||
|
||||
|
Note also that this error is just a notice, which means that it's not fatal. You can prevent the display of notices by changing the log level in your php.ini.
|
|
#7
|
|||
|
|||
|
Tnx it works
)) |
![]() |
| Viewing: Dev Articles Community Forums > Programming > PHP Development > PHP problems |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|