Jump to content

Noob assistance - $php_self and an email form


Bildoz

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]
Link to comment
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].
Link to comment
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.
Link to comment
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.
Link to comment
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.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

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.