Jump to content


Photo

Noob assistance - $php_self and an email form


  • Please log in to reply
5 replies to this topic

#1 Bildoz

Bildoz
  • New Members
  • Pip
  • Newbie
  • 3 posts

Posted 03 August 2006 - 08:00 PM

Hi folks! TIA for any help!

I recently inherited a website for a chairty and have some basics in php. We migrated to a new server and the email submission form for adopting a dog or cat stopped working.

I have spent some time trying to figure out what is wrong, and I think I got that. ( Now I can't see to figure out how to fix it. I am very noob in php and just starting to learn it. This seems like a simple problem but I keep getting stumped. Please let me  know if I left some data off. I have been reading google and tutorials and coding since 6 am, so sorry for any mispellings.

Here is my problem area:

Undefined variable : PHP_SELF (line 25)
Undefined variable : op (line 1485)


My code is attached.

Thanks again for any assistance that can be offered!

-Bildoz



[attachment deleted by admin]

#2 Caesar

Caesar
  • Members
  • PipPipPip
  • Advanced Member
  • 1,025 posts

Posted 03 August 2006 - 08:13 PM

What version of PHP are you running on your server?

Replace $PHP_SELF with $_SERVER[PHP_SELF].

Also...I suspect this script relies on register_globals to be turned on. So, in lines 1485 and 1493 (Or there abouts) replace $op to $_POST[op].
PHP Ninja

#3 Caesar

Caesar
  • Members
  • PipPipPip
  • Advanced Member
  • 1,025 posts

Posted 03 August 2006 - 08:15 PM

That should get rid of the first errors...but you're going to have to change a lot of your variables in your conditional statements.
PHP Ninja

#4 Bildoz

Bildoz
  • New Members
  • Pip
  • Newbie
  • 3 posts

Posted 03 August 2006 - 08:32 PM

What I think is going on was that the new server uses an up to date version of PHP and the old one did not. This form was made years ago.

I am going to try those fixes now, I will let you know!

Thanks for the quick replies! You guys rock.

#5 Caesar

Caesar
  • Members
  • PipPipPip
  • Advanced Member
  • 1,025 posts

Posted 03 August 2006 - 08:48 PM

Well I can also tell in your code that it is relying on register_globals to be turned "On" which isn't generally a good idea. And your new server has them turned off...so a lot of your code needs to be modified now. So on variables that are defined via a form that has been posted....you need to specify this.

Eg:

$op = $_POST[op];

...before you can use the $op variable. And you have a ton in your script.
PHP Ninja

#6 Bildoz

Bildoz
  • New Members
  • Pip
  • Newbie
  • 3 posts

Posted 03 August 2006 - 09:02 PM

I think you are right on.

The small fixes didn't do it, I stii get errors on the "op" lines.

I will go ahead and make an html form until I can get this figured out.

Thanks a lot for your help. I see that I am just hitting the tippiest top tip of the iceberg.






0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users