Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9005503
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T01:09:43+00:00 2026-06-16T01:09:43+00:00

I have the form using php script, its working fine on other server however

  • 0

I have the form using php script, its working fine on other server however i got the problem on the live one. below i have mention the details:

the contact form send by using ajax call & php. its working on the two servers i have checked, one of them linked below
http://www.virtualmob.co.uk/products/test_landing_pages/UrbanSpot/contact.html

however the same form when i upload it on the live server its not working i dont know why?? 🙁 live linked below:
http://www.urban-spot.co.uk/contact.html

the php is installed on the server, kindly let me know if any thing necessary is switched off in the server, here is the php info link:

Here is the php code

<?php


// Change this with your blog name and email address
$the_blogname   = 'MobilityApp';
$the_myemail    = 'info@urban-spot.co.uk';


if(isset($_POST['email'])){
    error_reporting(0); 
    $errorC = false;

    $the_email      = $_POST['email'];
    $the_name       = $_POST['yourname'];
    $the_message    = $_POST['message'];

    $the_phone      = $_POST['phone'];
    $the_fax        = $_POST['fax'];
    $the_company    = $_POST['company'];
    $the_website    = $_POST['website'];

    # want to add aditional fields? just add them to the form in template_contact.php,
    # you dont have to edit this file

    //added fields that are not set explicit like the once above are combined and added before the actual message
    $already_used = array('email','yourname','message','phone','fax','company','website','myblogname','tempcode','temp_url','ajax');
    $attach = '';

    foreach ($_POST as $key => $field)
    {
        if(!in_array($key,$already_used))
        {
            $attach.= $key.": ".$field."<br /> \n";
        }
    }
    $attach.= "<br /> \n";

    if(!checkmymail($the_email))
    {
        $errorC = true;
        $the_emailclass = "error";
    }else{
        $the_emailclass = "valid";
        }

    if($the_message == "")
    {
        $errorC = true;
        $the_messageclass = "error";
    }else{
        $the_messageclass = "valid";
        }

    if($errorC == false)
    {   
        $to      =  $the_myemail;
        $subject = "New Message from " . $the_blogname;
        $header  = 'MIME-Version: 1.0' . "\r\n";
        $header .= 'Content-type: text/html; charset=utf-8' . "\r\n";
        $header .= 'From:'. $the_email  . " \r\n";

        $message1 = nl2br($the_message);

        if(!empty($the_name))       $the_name       = "Name:    $the_name <br/>";
        if(!empty($the_company))    $the_company    = "Company: $the_company <br/>";
        if(!empty($the_phone))      $the_phone      = "Phone:   $the_phone <br/>";
        if(!empty($the_fax))        $the_fax        = "Fax:     $the_fax <br/>";
        if(!empty($the_website))    $the_website    = "Website: $the_website <br/>";

        $message = "
        You have a new message! <br/>
        $the_name
        $the_company
        $the_phone
        $the_website

        $attach <br />

        Message: $message1 <br />";



        if(@mail($to,$subject,$message,$header)) $send = true; else $send = false;

        if(isset($_POST['ajax'])){

        if ($send)
        echo '<h3><img src="images/icon_check.png">&nbsp;&nbsp;Your message has been sent!</h3><div class="confirm">


              </div>';
        else
        echo '<h3>Oops!</h3><div class="confirm">
                <p class="texterror">Due to an unknown error, your form was not submitted, please resubmit it or try later.</p>
              </div>'; 

        }
    }

}


function checkmymail($mailadresse){
$email_flag=preg_match("!^\w[\w|\.|\-]+@\w[\w|\.|\-]+\.[a-zA-Z]   {2,4}$!",$mailadresse);
return $email_flag;
}

?> 

For refrence i am using below ajax call

 function tfuse_form1(){

var my_error;
var url = jQuery("input[name=temp_url]").attr('value');
jQuery(".ajax_form #send").bind("click", function(){

my_error = false;
jQuery(".ajax_form input, .ajax_form textarea, .ajax_form radio, .ajax_form select").each(function(i)
{
            var surrounding_element = jQuery(this);
            var value               = jQuery(this).attr("value"); 
            var check_for           = jQuery(this).attr("id");
            var required            = jQuery(this).hasClass("required"); 

            if(check_for == "email"){
                surrounding_element.removeClass("error valid");
                baseclases = surrounding_element.attr("class");
                if(!value.match(/^\w[\w|\.|\-]+@\w[\w|\.|\-]+\.[a-zA-Z]{2,4}$/)){
                    surrounding_element.attr("class",baseclases).addClass("error");
                    my_error = true;
                }else{
                    surrounding_element.attr("class",baseclases).addClass("valid"); 
                }
            }

            if(check_for == "name" || check_for == "message"){
                surrounding_element.removeClass("error valid");
                baseclases = surrounding_element.attr("class");

                if(value == "" || value == 'Name (required)' || value == 'Type your message' ){ 
                    surrounding_element.attr("class",baseclases).addClass("error");
                    my_error = true;
                }else{
                    surrounding_element.attr("class",baseclases).addClass("valid");
                }
            }

            if(required && check_for != "name" && check_for != "email" && check_for != "message"){
                surrounding_element.removeClass("error valid");
                baseclases = surrounding_element.attr("class");
                if(value == ""){                    
                    surrounding_element.attr("class",baseclases).addClass("error");
                    my_error = true;
                }else{
                    surrounding_element.attr("class",baseclases).addClass("valid"); 
                }
            }


            if(jQuery(".ajax_form input, .ajax_form textarea, .ajax_form radio, .ajax_form select").length  == i+1){
                    if(my_error == false){
                        jQuery(".ajax_form").slideUp(400);

                        var $datastring = "ajax=true";
                        jQuery(".ajax_form input, .ajax_form textarea, .ajax_form radio, .ajax_form select").each(function(i)
                        {
                            var $name = jQuery(this).attr('name');  
                            var $value = encodeURIComponent(jQuery(this).attr('value'));
                            $datastring = $datastring + "&" + $name + "=" + $value;
                        });


                        jQuery(".ajax_form #send").fadeOut(100);    

                        jQuery.ajax({
                           type: "POST",
                           url: "./sendmail.php",
                           data: $datastring,
                           success: function(response){
                               jQuery(".ajax_form").before("<div class='ajaxresponse'></div>");
                               jQuery(".ajaxresponse").html(response).slideDown(400); 
                               jQuery(".ajax_form #send").fadeIn(400);
                               jQuery(".ajax_form input, .ajax_form textarea, .ajax_form radio, .ajax_form select").val("");
                            }
                        });
                    } 
                }
        });
        return false;
});
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-16T01:09:44+00:00Added an answer on June 16, 2026 at 1:09 am

    The fact that it runs on some servers but not others leads me to think it isn’t the code that has a problem. You reference the phpinfo page for the problem server but have you compared it to the phpinfo page from one of the working servers? You could be running different versions of PHP. Also check the php.ini files from the working and non working servers to verify all the correct extensions are loaded.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

So i'm working on a php script which passes information to a server using
I have a HTML form which is using a simple PHP mail() script to
I have a form what jQuery sents for me using Ajax to php. For
I have a relatively simple question. Will using PHP guarantee that a form is
(Using MySQL and PHP) I have a search form that will allow my users
I have a PHP contact form on my website. I have been using it
I have a PHP script that is using get_dns_record to retrieve and display specific
I'm currently working with progress bars for form uploads using the PHP uploadprogress extension.
I have a script that validates a form (using jQuery Validate ) and then
I have this login script, but for some reason its not working. I checked

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.