|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Stay one step ahead of the competition. Evaluate and give feedback
on some of the hottest web development tools on the market today.
Make your opinion heard! Click
Here
|
|
#1
|
|||
|
|||
|
HTML FORMS and PHP
Hi,
I am trying to insert data from a form into an Oracle database, but i keep gettting errors saying undefined variable or index....I have even tried to get a simpler example to work, and I still get the same error, can someone tell me if there is something wrong with this code...this might help me to figure out my more complicated code... thanks sp <html> <head><title></title></head> <? if (submit== "click"){ echo "Hello, $UserName"; } else{ echo ' <html><body> <form method="post" action="hello.php"> Enter Your Name <input type="text" name="UserName"></input><br> <input type="submit" name="submit" value="click"></input> </form> </body></html> '; } ?> this is the error i keep getting Notice: Undefined variable: submit in E:Inetpubwwwrootallnorth_testadminhello.php on line 4 |
|
#2
|
||||
|
||||
|
RE: HTML FORMS and PHP
The mistake is not on this page. I'd like to see the code for hello.php.
And BTW this is in the wrong section. It belongs to php codeng. |
|
#3
|
|||
|
|||
|
RE: HTML FORMS and PHP
There's a $ missing... try with $submit or $_REQUEST["submit"]...
|
|
#4
|
|||
|
|||
|
RE: HTML FORMS and PHP
The problem is in the line that PHP said it was. The condition for the if statement tried to match a non-variable with a string.
if (submit== "click") s/b: if ($submit== "click") The $ (dollar sign) indicated a php variable. Since you are inside the <? and ?>, your variables must be php recognizable. Outside those delimiters, the browser will interpret the variable and then it should not have the $ sign in front of it as it's not a php variable, in that case. |
![]() |
| Viewing: Codewalkers Forums > Other Technologies > Client Side Things > HTML FORMS and PHP |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|
|
|
|