Jump to content

Archived

This topic is now archived and is closed to further replies.

Bildoz

Noob assistance - $php_self and an email form

Recommended Posts

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]

Share this post


Link to post
Share on other sites
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].

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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:

[code]$op = $_POST[op];[/code]

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

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.