SunQuest
 
           PHP Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsProgrammingPHP Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
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  
Old September 25th, 2003, 11:12 AM
nestorvaldez nestorvaldez is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Nov 2002
Posts: 40 nestorvaldez User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 9 m 21 sec
Reputation Power: 6
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

Reply With Quote
  #2  
Old September 25th, 2003, 05:09 PM
laidbak laidbak is offline
you know how we do
Dev Articles Novice (500 - 999 posts)
 
Join Date: Jun 2002
Location: In Tha IE -- San Bernardino COUNTY
Posts: 788 laidbak User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 h 4 m 2 sec
Reputation Power: 7
Send a message via ICQ to laidbak Send a message via AIM to laidbak Send a message via MSN to laidbak Send a message via Yahoo to laidbak
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.

Reply With Quote
  #3  
Old October 7th, 2003, 07:15 PM
mwichmann4 mwichmann4 is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Oct 2003
Posts: 80 mwichmann4 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 52 m 45 sec
Reputation Power: 5
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.

Reply With Quote
  #4  
Old October 8th, 2003, 12:34 AM
laidbak laidbak is offline
you know how we do
Dev Articles Novice (500 - 999 posts)
 
Join Date: Jun 2002
Location: In Tha IE -- San Bernardino COUNTY
Posts: 788 laidbak User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 h 4 m 2 sec
Reputation Power: 7
Send a message via ICQ to laidbak Send a message via AIM to laidbak Send a message via MSN to laidbak Send a message via Yahoo to laidbak
PHP Code:
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
I highly advise against this advice as you should not ignore notices for the simple fact that they are notices. Notices are there to help you. Although notices are not exactly the same as errors, notices alert you to issues that could easily become errors as your code becomes more complex. It will save the programmer time and money in the long run by not avoiding these.

Reminds me of Visual Basic "On Error Resume Next"

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsProgrammingPHP Development > Passing Variable PHP


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 5 hosted by Hostway