Register

If this is your first visit, please click the Sign Up now button to begin the process of creating your account so you can begin posting on our forums! The Sign Up process will only take up about a minute of two of your time.

Results 1 to 9 of 9
  1. #1
    Junior Member
    Join Date
    Mar 2014
    Posts
    8
    Member #
    38672

    Problem with PHP Contact Form

    I downloaded the code for a contact form. After finally getting the php to execute and display the captcha, I tried sending a message to one of my email addresses. A page appeared with a whole host of messages. After seeing all these fearful messages, I was astonished that I actually received the email! Needless to say, the "Thank you" never appeared. However, something has to be down to correct the problems noted in the messages or at least prevent the massages from coming up when a visitor to my Web site tries to use the contact form.

    Perhaps someone would send me a message in order to see these strange results. Here's is the contact page (not yet available through the menus);

    Contact us

    By the way, this is the first time I've done anything with php.

    Thanks so much.

    Ken

  2.  

  3. #2
    Senior Member Ronald Roe's Avatar
    Join Date
    Mar 2011
    Location
    Oklahoma City
    Posts
    3,141
    Member #
    27197
    Liked
    959 times
    Copy/Paste the PHP so we can see it.

    EDIT: I can't get past your dang CAPTCHA.
    Ron Roe
    Web Developer
    "If every app were designed using the same design template, oh wait...Bootstrap."

  4. #3
    Junior Member
    Join Date
    Mar 2014
    Posts
    8
    Member #
    38672
    There are six php files plus two javascript files, probably totally hundreds of lines of code. I can post the "error" messages:

    Warning: eregi() [function.eregi]: It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'UTC' for 'UTC/0.0/no DST' instead in /home/kmorgan/public_html/fgcontactform.php on line 548

    Deprecated: Function eregi() is deprecated in /home/kmorgan/public_html/fgcontactform.php on line 548

    Warning: date() [function.date]: It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'UTC' for 'UTC/0.0/no DST' instead in /home/kmorgan/public_html/class.phpmailer.php on line 1612

    Warning: date() [function.date]: It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'UTC' for 'UTC/0.0/no DST' instead in /home/kmorgan/public_html/class.phpmailer.php on line 1612

    Warning: date() [function.date]: It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'UTC' for 'UTC/0.0/no DST' instead in /home/kmorgan/public_html/class.phpmailer.php on line 1616

    Warning: date() [function.date]: It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'UTC' for 'UTC/0.0/no DST' instead in /home/kmorgan/public_html/class.phpmailer.php on line 1616

    Warning: split() [function.split]: It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'UTC' for 'UTC/0.0/no DST' instead in /home/kmorgan/public_html/class.phpmailer.php on line 470

    Deprecated: Function split() is deprecated in /home/kmorgan/public_html/class.phpmailer.php on line 470

    Warning: header() [function.header]: It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'UTC' for 'UTC/0.0/no DST' instead in /home/kmorgan/public_html/fgcontactform.php on line 143

    Warning: Cannot modify header information - headers already sent by (output started at /home/kmorgan/public_html/fgcontactform.php:548) in /home/kmorgan/public_html/fgcontactform.php on line 143

  5. #4
    Senior Member Ronald Roe's Avatar
    Join Date
    Mar 2011
    Location
    Oklahoma City
    Posts
    3,141
    Member #
    27197
    Liked
    959 times
    Someone a little better with PHP correct me if I'm wrong, but those look like just warnings. That would explain why you're still getting the email. Check your php.ini file if your server allows you access and make sure "display errors" is set to zero. If it is, run a search thru your scripts for "error_reporting" and ini_set("display_errors", 1) and delete it if it's found.
    Ron Roe
    Web Developer
    "If every app were designed using the same design template, oh wait...Bootstrap."

  6. #5
    Junior Member
    Join Date
    Mar 2014
    Posts
    8
    Member #
    38672
    Thanks, Ronald. I'll have to wait until tomorrow, but I'll get on that and then post what I find out.

  7. #6
    WDF Staff mlseim's Avatar
    Join Date
    Apr 2004
    Location
    Cottage Grove, Minnesota
    Posts
    7,686
    Member #
    5580
    Liked
    716 times
    What you're seeing are notices and warnings. The script still runs because those are not fatal.

    You need to post two scripts for us to see:

    1) fgcontactform.php
    2) class.phpmailer.php

    It looks like the scripts you found (and downloaded) are older scripts and PHP revisions have changed since. Those types of error messages can be supressed so they don't show, but the problems should be addressed anyhow, and they are easy to fix.

    Also, what major city is closest to you in your timezone? Defining your timezone is one of the things and I would need to know what timezone you reside.


  8. #7
    Junior Member
    Join Date
    Mar 2014
    Posts
    8
    Member #
    38672
    Thanks, mlseim. Your help is much appreciated!

    I agree: my personality is one that would like to correct the code to eliminate the warnings. What I don't understand and what I'm anxious to learn is how these warning messages can refer to "UTC." I use gedit to search all six php files. "UTC" occurs nowhere. Anyway, my time zone is Eastern, nearest big city Atlanta.

    I can't figure out how to upload the two files. The "Manage Attachments" button apparently doesn't allow php files. ???

    Ken

  9. #8
    WDF Staff mlseim's Avatar
    Join Date
    Apr 2004
    Location
    Cottage Grove, Minnesota
    Posts
    7,686
    Member #
    5580
    Liked
    716 times
    You copy and paste into Notepad and make it a .txt file, or copy directly into post and wrap with <code> .... </code> tags.

    You can PM (private message) me too. Give me your email address and I'll email you about sending me files to look at.

    What they're telling you to do ....
    Either set your default timezone using PHP config (done via your webhost configuration which is more advanced knowledge), or add this to the top of the PHP scripts ... it will define your timezone and those warnings should go away.

    <?php

    date_default_timezone_set
    ('America/New_York');




    These two errors are something else ...

    Deprecated: Function eregi() is deprecated ...
    Deprecated: Function split() is deprecated ...

    Deprecated means 'obsolete'. Those two commands are no longer supported, or will be eliminated from the next versions of PHP.

    I need to see those scripts in order to re-script the correct commands that do the same thing as these deprecated commands.


    This one ...
    Warning: Cannot modify header information - headers already sent

    It appears because of the errors displayed previous to it, or as a result of the server displaying errors on the web browser.
    Last edited by mlseim; Mar 13th, 2014 at 01:53 PM.


  10. #9
    Junior Member
    Join Date
    Mar 2014
    Posts
    8
    Member #
    38672
    Wife just called for dinner !!

    Here are the two files in one txt file.

    It uploaded somewhere, but after I selected the file from my directory, I couldn't drag it anywhere. It's called phpFiles.txt.

    If you can't find it, I'll be back in about an hour, and we can do the email route. Sorry.



Remove Ads

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
All times are GMT -6. The time now is 05:43 PM.
Powered by vBulletin® Version 4.2.3
Copyright © 2019 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: PurevB.com