Advertisement
Help Keep Boards Alive. Support us by going ad free today. See here: https://subscriptions.boards.ie/.
If we do not hit our goal we will be forced to close the site.

Current status: https://keepboardsalive.com/

Annual subs are best for most impact. If you are still undecided on going Ad Free - you can also donate using the Paypal Donate option. All contribution helps. Thank you.
https://www.boards.ie/group/1878-subscribers-forum

Private Group for paid up members of Boards.ie. Join the club.

PHP contact form not working on a diff server

  • 23-09-2009 10:14AM
    #1
    Closed Accounts Posts: 4,676 ✭✭✭


    I've just transferred a new website to company's server. It was first tested in my own server -> fully operational. Now on this new server my contact form just doesn't work - it's a pretty standard PHP form script I've used with success on numerous websites.

    I guess there must be something in the settings of the new server (Apache, PHP 5 installed) that interferes with the script. I can't change anything on the server myself but I can ask the server admin (if I know what it is).

    Any ideas please?

    ETA: I have PHP 5 on my server too so it's probably not a PHP 4 -> 5 thing...


Comments

  • Registered Users, Registered Users 2 Posts: 8,488 ✭✭✭Goodshape


    If you posted your code it might make it easier to figure out.

    At a guess, it could be your use of short tags?

    Are you using something like <?=$terms;?> instead of <?php echo $terms; ?> ?

    Servers aren't always set up to support the short method, unfortunately.


  • Closed Accounts Posts: 4,676 ✭✭✭strandroad


    Thanks for your help!

    It's a freeware script, I adapted values and styles but not PHP code itself:
    http://www.planetluc.com/en/scripts_contactform.php?countlink=contactform&url=%2Fdownloads%2Fcontact_1.5.php.zip

    I've never had problems with it before and I consider it a trusted tool.

    I wonder if there are any PHP sendmail settings the server admin should look at? PHP was only installed recently so maybe some configs were left out?

    BTW by not working I mean that after you submit the form the e-mail never comes.


  • Registered Users, Registered Users 2 Posts: 8,488 ✭✭✭Goodshape


    mhge wrote: »
    BTW by not working I mean that after you submit the form the e-mail never comes.
    Oh right, that's probably not a short-tag issue then.

    Ask you server admin to check that PHP mail() is enabled.


  • Registered Users, Registered Users 2 Posts: 9,579 ✭✭✭Webmonkey


    What's happening?

    By the way, it isn't using globals by any chance. Sure that everything is accessed via $_POST[] for example?


  • Closed Accounts Posts: 4,676 ✭✭✭strandroad


    I must admit that I know nearly nothing about PHP itself, I simply use and configure ready made scripts... :(

    The script seems to work, I can see a "thank you etc" message but then the e-mail never comes.
    Goodshape wrote: »
    Ask you server admin to check that PHP mail() is enabled.

    I will cheers Goodshape.


  • Advertisement
  • Registered Users, Registered Users 2 Posts: 9,579 ✭✭✭Webmonkey


    It's hard to know what is wrong. Any chance you could post the script? Is it a free one?


  • Closed Accounts Posts: 4,676 ✭✭✭strandroad


    Webmonkey wrote: »
    It's hard to know what is wrong. Any chance you could post the script? Is it a free one?

    Yes I posted the link above.


  • Registered Users, Registered Users 2 Posts: 9,579 ✭✭✭Webmonkey


    Start by a simple test script:

    [php]
    <?php
    mail('youremail@site.com, 'Test Email', 'Testing');
    ?>
    [/php]

    Execute this and see do you get an email. Check your spam folder - email is now coming from a different mail server.


  • Closed Accounts Posts: 4,676 ✭✭✭strandroad


    Thank you, I tried but no results and no e-mail!

    Luckily it turns out that the issue was caused by SMTP setting on the server and the script was OK.

    I really appreciate your help in finding this out. Cheers!!


  • Registered Users, Registered Users 2 Posts: 9,579 ✭✭✭Webmonkey


    Good stuff


  • Advertisement
Advertisement