PDA

View Full Version : php.mail error



MariannaH
12-05-2008, 03:40 PM
Hi,

I need some help to find and fix some error on my site.

This error is a mystery to me!

When I click on the button "Place Order Via Email" or "Megrendelem Via Email" a blank page comes up and I don't receive the order.

I did some updating a few months ago, but everything seemed ok then, although I did not check this link then.

Here are those 2 pages from the site which have the 'broken links':

http://www.creativehealinginstitute.com/english/order.php
http://www.creativehealinginstitute.com/hungarian/order.php

The PayPal link works fine.

Today I uploaded the 2 original files - php.mail.php and order.php, but even the original files are not working and I don't understand why.

If the error is not on these 2 pages then where is it?

I would appreciate any help to fix this problem.

Warm regards,
Marianna

wildjokerdesign
12-05-2008, 04:07 PM
Well the error is most likely in phpmail.php. Is this on a WestHost account?

wildjokerdesign
12-05-2008, 04:16 PM
If you don't have a .htaccess file in the same directory that phpmail.php is in the create a file called .htaccess with a plain text editor (see my sig or use notepad) with this in it:

php_flag log_errors on
php_value error_log /var/www/html/php-error.log

That should create a file called php-error.log that you can read with a plain text editor and it well give us an idea of what the problem is.

If you already have a .htaccess file in the directory then open it up and add the above code somewhere towards the beginning of the file.

BTW: I figured out you are on WestHost so I know the above error logging well work. :)

wildjokerdesign
12-05-2008, 04:21 PM
Is this program from here: http://phpmailer.codeworxtech.com/index.php

If so have you perhaps upgraded your PHP version? There are a couple of versions of the above program and one is for php 4 and another is for php 5/6. Do you perhaps need to upgrade the program?

MariannaH
12-05-2008, 04:28 PM
Yes, it is.
I talked with tech support this afternoon and they suggested to write here.

Thanks,
Marianna

MariannaH
12-05-2008, 04:50 PM
I created the file .htaccess and I uploaded....what should I do next?

>Is this program from here: http://phpmailer.codeworxtech.com/index.php<

No, the best of my knowledge this is just coded into a page, no plugins.

This website was created in 2004 by someone who cannot reach anymore. I do the updatings and so far everything worked fine. I'm not a webmaster.

Thanks,
Marianna

wildjokerdesign
12-06-2008, 07:11 AM
Marianna,

Now that you have the .htaccess file uploaded you should test the form. After you do that and get the blank page, log into your account and check for the php-error.log file. Open it up and see what errors are listed if any.

MariannaH
12-06-2008, 08:35 AM
Hi,

I did it and I see many errors.

Can you help me how to read it?

For example here is the last line from php-error.log:

[06-Dec-2008 07:44:56] PHP Notice: Undefined variable: msg in /var/www/html/english/order.php on line 82


Now I found line 82 on var/www/html/english/order.php and here it is:

<? if ( $msg == 1 ) { ?>


So the error msg says "Undefined variable" .....is there something wrong with this coding?
But this is how the original file was coded, I did not change anything in this coding and the order page was working before...?

I don't know what is the problem..

Thanks for your help!

Marianna
http://www.creativehealinginstitute.com/english/order.php

MariannaH
12-06-2008, 09:04 AM
Hi,

As I'm looking through the errors I see that most of them the same reaping errors, so there are not too many as I thought before.

I found that this is the reaping error in nav on different lines

<? if ( $subNavServices == 1 ) { ?>

and also in [06-Dec-2008 03:07:27] PHP Notice: Use of undefined constant TO - assumed 'TO' in /var/www/html/english/phpmail.php on line 15

if ($HTTP_POST_VARS[TO] == $val) {

...and what I sent in my previous mail.


Thanks again for your help!

Marianna
http://www.creativehealinginstitute.com/

wildjokerdesign
12-06-2008, 07:07 PM
We are looking for something more then a PHP Notice. The two messages you posted should not give a blank screen. It is more a sign of lazy coding. also we are looking for errors that involve phpmail.php since that is the actual file that is throwing the blank page.

I don't think you ever mentioned what version of PHP you have installed on the account. Can you check that out? You can find that in your Site Manager under Applications.

MariannaH
12-10-2008, 08:22 AM
Hello Shawn,

Here are the relevant errors from the error-code.php:


[06-Dec-2008 18:18:25] PHP Notice: Undefined variable: subNavEducation in /var/www/html/english/includes/nav.inc on line 37
[06-Dec-2008 18:18:25] PHP Notice: Undefined variable: msg in /var/www/html/english/order.php on line 82
[06-Dec-2008 18:18:45] PHP Notice: Use of undefined constant TO - assumed 'TO' in /var/www/html/phpmail.php on line 15
[06-Dec-2008 18:18:45] PHP Notice: Use of undefined constant TO - assumed 'TO' in /var/www/html/phpmail.php on line 15
[06-Dec-2008 18:18:45] PHP Notice: Use of undefined constant TO - assumed 'TO' in /var/www/html/phpmail.php on line 15
[06-Dec-2008 18:18:45] PHP Notice: Use of undefined constant TO - assumed 'TO' in /var/www/html/phpmail.php on line 15
[06-Dec-2008 18:18:45] PHP Notice: Undefined variable: TO in /var/www/html/phpmail.php on line 32
[06-Dec-2008 18:18:45] PHP Notice: Undefined variable: SUBJECT in /var/www/html/phpmail.php on line 32
[06-Dec-2008 18:18:46] PHP Notice: Undefined variable: CONFIRMATION in /var/www/html/phpmail.php on line 34
[06-Dec-2008 18:19:06] PHP Notice: Use of undefined constant TO - assumed 'TO' in /var/www/html/phpmail.php on line 15
[06-Dec-2008 18:19:06] PHP Notice: Use of undefined constant TO - assumed 'TO' in /var/www/html/phpmail.php on line 15
[06-Dec-2008 18:19:06] PHP Notice: Use of undefined constant TO - assumed 'TO' in /var/www/html/phpmail.php on line 15
[06-Dec-2008 18:19:06] PHP Notice: Use of undefined constant TO - assumed 'TO' in /var/www/html/phpmail.php on line 15
[06-Dec-2008 18:19:06] PHP Notice: Undefined variable: TO in /var/www/html/phpmail.php on line 32
[06-Dec-2008 18:19:06] PHP Notice: Undefined variable: SUBJECT in /var/www/html/phpmail.php on line 32
[06-Dec-2008 18:19:06] PHP Notice: Undefined variable: CONFIRMATION in /var/www/html/phpmail.php on line 34


I can copy the whole phpmail.php file, if you need that.

About the PHP version, this is what I found:

phpMyAdmin 2.9.2

This was installed by the person who created my site many years ago.
I did not install it.

Thanks,
Marianna

wildjokerdesign
12-11-2008, 06:22 AM
Don't copy the phpmail.php file here just attach it to your next post. In order for the forum to accept it you'll have to first zip it up or rename the file with a .txt extension.

phpMyAdmin 2.9.2 is not what I was looking for. In that same area in your Site Manager you should see below where you found that an installation of PHP. Is it version 4 or 5?

wildjokerdesign
12-11-2008, 07:44 AM
First off go to User CP > Attachments here on the forum and remove the attachment of phpmail.zip that you just attached to the post above! The file contains information you don't want folks to see. :)

You need to switch to a new program for your contact form. Try this one: http://www.dtheatre.com/scripts/formmail.php The very first variable in the script can be set to the email you want the contact form to send to. If you need help with this script I can help you get it set up.

wildjokerdesign
12-11-2008, 07:50 AM
BTW the script you where using is very old and very insecure! It has code in it that is not compatible with how PHP is set up now on a WestHost account. I am surprised you had not noticed the problem sooner. :)

MariannaH
12-11-2008, 07:53 AM
Hi Shawn,

I deleted that message.

I don't understand what is happened and why I need a new program, when everything worked fine until about a month ago.

I'll look into and see if I can do it....most likely I'll need some help with it.

Thanks,
Marianna

MariannaH
12-11-2008, 09:07 AM
Hi Shawn,

You are right, this website is old, but I want to keep it as simple as I can.

Well...it looks a bit difficult to me, this new program!

Before I make some changes, I have to ask you - is this the simplest way to fix this problem?

The reason why I'm asking is because I have to be able to be self reliant with my website updating.
I know some basic html, css and have a book on java script and I almost understand all the files in my site...I have to study the navigation part though :)

I'm not flooded with people who are ordering via this order form, so I'm thinking maybe the best way would be to eliminate the phpmail.php file all together and just rewrite that page using the e-mail address and the PayPal buttons only.

I'll appreciate any help from you.

Thanks,
Marianna

wildjokerdesign
12-11-2008, 01:39 PM
Marianna,

I would encourage you to dig in and look at the documentation on the program. It really is pretty simple and pretty basic PHP stuff. Since you are already using PHP on your site it would not hurt to start learning some of the basics. It is one of the easiest languages to learn. :)

You could just post your email address on that page, but then you would get tons of spam from posting it. Never post your email address on any site/page!

I would be happy do this for you if you want to give me access to your site but then that would defeat your goal to be self reliant. If you give it a try and ask questions here I think you can make work. ;)

MariannaH
12-29-2008, 12:51 PM
Hi Shawn,

I was away for the holiday, but now I'm back; refreshed and clear minded :)!
I took your advice and and I read the document, then took me 5 minutes to set it up...yes, it was veeeery simple!

Now my order page is up and running again; here it is if you want to check it out: http://www.creativehealinginstitute.com/english/order.php

Thank you so much for your help.

Have a wonderful happy, healthy and peaceful New Year!

Marianna

MariannaH
12-29-2008, 12:55 PM
One more thing:

I just wonder if the 'thank you' page should look like as my home page - with my header and footer or this is how it supposed to look?

Thanks,
Marianna

wildjokerdesign
12-30-2008, 07:03 AM
If you want to have a different response page to the submitted form you need to set the redirect. http://www.dtheatre.com/scripts/formmail_doc.php#redirect

MariannaH
12-30-2008, 07:37 AM
Thank you Shawn!

Marianna

MariannaH
12-30-2008, 08:08 AM
Hi Shawn,

Please help me with this.

I looked the php file, but I couldn't find the following code:


<input type=hidden name="redirect" value="http://your.host.com/to/ file.html">

This is where I have to put my own page, right?

But where is this line in the php file or do I have to put this whole code in?
If yes, then where should I put it?

Thanks,

Marianna

wildjokerdesign
12-30-2008, 04:16 PM
No you put that code in your order page where you made the form. I am not sure how you are editing the content of that page so not sure how to give you exact details. It would be done the same way you changed the target or src for that form to phpMail.php.

MariannaH
01-19-2009, 07:24 AM
Hi Shawn,

Sorry for the late reply!

I tried several different editing options but it did not work, so I just added the Hungarian text to the 'thank you' page.

Many thanks for your help!

Marianna
www.creativehealinginstitute.com
www.parrothope.org