Author Topic: Im needing help with figuring out this undefined variable  (Read 229 times)

jojo1

  • Regular Member
  • **
  • Posts: 36
  • Karma: 0
    • View Profile
Im needing help with figuring out this undefined variable
« on: August 01, 2012, 08:11:10 AM »
I have made a contact form and it seems everything is working fine except that I when i file the form out and click add contact I get undefined variable for all the text box fill ins.
correct me if I'm wrong but when you add:
Code: [Select]
<tr><td>First Name&nbsp;</td><td><input type="text" name="fname" /></td></tr>
fname is the variable and therefore is defined. So when you go to php page and add:
Code: [Select]
$fname = $_post['fname'];
the variable fname has previously been defined so there shouldn't be a problem. Am I correct? I trying to figure out the root of the problem. It's saying the undefined variable is in my addcontacts.php .

jojo1

  • Regular Member
  • **
  • Posts: 36
  • Karma: 0
    • View Profile
Re: Im needing help with figuring out this undefined variable
« Reply #1 on: August 01, 2012, 08:48:14 AM »
Doh!! scratch everything. It's $_POST I had it as $_post. Well sat up looking at this until 2 am and woke up finally seeing it..Coffee and sleep is my friend.

wilson382

  • Expert PHP Helper
  • Senior Member
  • *****
  • Posts: 649
  • Karma: 27
  • PHP Helper
    • View Profile
Re: Im needing help with figuring out this undefined variable
« Reply #2 on: August 01, 2012, 08:49:09 AM »
Try using get instead of post
If help you, Click the [+] Karma to thanks me

wilson382

  • Expert PHP Helper
  • Senior Member
  • *****
  • Posts: 649
  • Karma: 27
  • PHP Helper
    • View Profile
Re: Im needing help with figuring out this undefined variable
« Reply #3 on: August 01, 2012, 09:14:20 AM »
ahh yeah $_POST is case sensitive so $_POST is not the same as $_post but i think you already figured that out lol
If help you, Click the [+] Karma to thanks me

jojo1

  • Regular Member
  • **
  • Posts: 36
  • Karma: 0
    • View Profile
Re: Im needing help with figuring out this undefined variable
« Reply #4 on: August 01, 2012, 01:06:06 PM »
lol yeah I figured that one out.. :P...took me 4 hours to figure it out.. I just wish my GUI editor would have picked up on it.. ugh!! well sleep and coffee help me get it...

jojo1

  • Regular Member
  • **
  • Posts: 36
  • Karma: 0
    • View Profile
Re: Im needing help with figuring out this undefined variable
« Reply #5 on: August 01, 2012, 01:09:00 PM »
One thing I can say though Wilson I am really loving this PHP. It's fun putting these scripts together. Even when I got a problem, once I figure it out it's cool to see these codes come together and work.

wilson382

  • Expert PHP Helper
  • Senior Member
  • *****
  • Posts: 649
  • Karma: 27
  • PHP Helper
    • View Profile
Re: Im needing help with figuring out this undefined variable
« Reply #6 on: August 01, 2012, 01:34:26 PM »
I can say you feel the same way i feel i'm programming LOL

i take it like a challenge and it's fun when you accomplish something
If help you, Click the [+] Karma to thanks me

jojo1

  • Regular Member
  • **
  • Posts: 36
  • Karma: 0
    • View Profile
Re: Im needing help with figuring out this undefined variable
« Reply #7 on: August 01, 2012, 07:14:08 PM »
Yes, I totally agree with you Wilson. I really enjoy figuring these problems out even though they can sometimes make you pull your hair out. Once I catch a good understanding of php I would like to try and make a chat site. Flash maybe. I am assuming all the coding for controlling the different parts like sending messages and controlling the A/V and admin/mods control are written in php. I know I probably got some time before I get to that point, but I am having a blast learning this.

wilson382

  • Expert PHP Helper
  • Senior Member
  • *****
  • Posts: 649
  • Karma: 27
  • PHP Helper
    • View Profile
Re: Im needing help with figuring out this undefined variable
« Reply #8 on: August 01, 2012, 07:59:17 PM »
good luck buddy.
If help you, Click the [+] Karma to thanks me

jojo1

  • Regular Member
  • **
  • Posts: 36
  • Karma: 0
    • View Profile
Re: Im needing help with figuring out this undefined variable
« Reply #9 on: August 03, 2012, 08:43:06 AM »
Thanks Wilson, Everything takes time. I will enjoy this learning experiance.