|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
|
|
Ajax Application Generator Generate database and reporting .NET Web apps in minutes. Quickly create visually stunning, feature-rich apps that are easy to customize and ready to deploy. Download Now!
|
|
#1
|
|||
|
|||
|
Passing Variable PHP
Hi everybody
I have a problem, I have a script to save the data of a Form in a MySql Table and when I Type the Information and Click Submit I give me this error: Notice: Undefined variable: codigo in c:\web\fernandez\agenda.php on line 45 ... and it is with each field.... Ex. codigo, name, email ,etc... I know that the name of the variable must be the same of the name of the form field. This is ok.. and I know that when you type the data and click submit, php get the value and change the variable like globlal variable,and thus it take the values and save it in the table. this is ok.. then it give me the error only in my pc but when I upload the files in the hosting and run the form, it run ok, perfectly.. I have WinXP, PHP 4.3.2, Apache 1.3.28 and it is the same of the hosting so, I think I have some setting in the apache, I need to change, but I dont know a lot of apache.. Please if some body can help me.. I need it quickly... thanks .. NVM |
|
#2
|
|||
|
|||
|
You have your error reporting set to the highest level on your PC. That is good... do not change it.
What you need to do is check your variables. For instance: if ( isset($_POST['name']) ) $name = $_POST['name']; if ( isset($name) ) { print $name; } If you code like that you will not get Notice errors and you will find you will be debugging a lot less. Believe me, it is worth your time.
__________________
__________________________________________________ _ Wil Moore III, MCP | Integrations Specialist | Senior Consultant Are You Listed...? | DigitallySmooth Inc. |
|
#3
|
|||
|
|||
|
One other tip
if the notices get to be a prob for you and your code is working correctly just place a @ sign in front of the offending line.
|
|
#4
|
|||
|
|||
|
PHP Code:
Reminds me of Visual Basic "On Error Resume Next" |
![]() |
| Viewing: Dev Articles Community Forums > Programming > PHP Development > Passing Variable PHP |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|