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 9003937
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T00:47:07+00:00 2026-06-16T00:47:07+00:00

I have a website. If some one posts an inquiry it goes to the

  • 0

I have a website. If some one posts an inquiry it goes to the thank you page
http://www.legasy.com/thankyou/ the URL will be like that. When I am analyzing the webmaster tools its showing more thank yous than inquirys.

After filling form fields validating and inserting that values into the table. It will go to thank you page. But if some one types the url it should not go to thank you page. What I can do for this?

Bellow is my code

HTML

<form>
 <table>
    <tr><td>Name</td> 
        <td><input type="text" name="buyer_name" id="buyer_name"  size="31" value="" /></td>
     </tr>
    <tr> <td>Email</td> 
         <td><input type="text" name="buyer_email" id="buyer_email"  size="31" value="" /></td>
    </tr>
    <tr> <td>Contact No</td>
         <td>   <input type="text" name="buyer_mobile" id="buyer_mobile" size="31" value=""/></td>
    </tr>
    <tr>                                        
         <td colspan="2" style="text-align:center;">
            <div id="post_enquiry"><img src="./images/for_more_det_click.gif" onclick="postBuyerEnquiry();" style="cursor:pointer;"/></div>
          </td>
    </tr>
 </table>
</form>

Javascript

<script type="text/javascript" src="../scripts/jquery.min.js"></script>
<script type="text/javascript" language="javascript">

function postBuyerEnquiry()
{

    var nametxt = document.getElementById('buyer_name').value;
    var emailtxt = document.getElementById('buyer_email').value;
    var phonetxt = document.getElementById('buyer_mobile').value;
    output ="text";

  if(nametxt=='')
  {
      alert("Please Enter Your Name");
      return false; 
  } 
  else if(emailtxt=='')
  {
      alert("Please Enter Your Mail Id");
      return false;
  }

     else if(phonetxt=='')
     {
          alert("Please Enter Phone Number");
          return false; 
     }
    process = 'loadEvent';
        output = 'text';
      url = "test4.php";        
    $.get(
            url,
            {'act':'SBQF', 
             'name':nametxt, 
             'email':emailtxt,
             'phone':phonetxt,
            },
            function(responseText)
            {
                 window.location.href = '/legasy.com/thankyou/';
            },
            "html"
        );

}

PHP

<?php
if ( !empty($_POST['act']) )
{
    $act        =   formatstring($_POST['act']);
}

switch( $act )
{
    case "SBQF":

         $strName         = $_GET['name'];
         $strEmail        = $_GET['email'];
         $strPhone        = $_GET['phone'];
             //Inserting values into the database   
         exit;  
     break;
}
?>

or

If anyone type the URL (www.legasy.com/thankyou/) it want to go to the error page

  • 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-16T00:47:08+00:00Added an answer on June 16, 2026 at 12:47 am

    Wrap everything else inside else

    else { // Give this here
        process = 'loadEvent';
            output = 'text';
          url = "test4.php";        
        $.get(
                url,
                {'act':'SBQF', 
                 'name':nametxt, 
                 'email':emailtxt,
                 'phone':phonetxt,
                },
                function(responseText)
                {
                     window.location.href = '/legasy.com/thankyou/';
                },
                "html"
            );
        return false;
    }
    

    At any time, this gets executed. Also, give a return false; in the end of the else part too!

    Access Denied stuff

    If you want the users not access the www.legasy.com/thankyou/ page directly, you can set a session. The moment you do success thing, you can set a session this way.

    session_start();
    if (condition on success)
        $_SESSION["thankyou"] = true;
    

    In the www.legasy.com/thankyou/ page,

    session_start();
    if (!isset($_SESSION["thankyou"]) && $_SESSION["thankyou"] != true)
    {
        header('Location: /error/');
        die();
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have this website http://wedessertmore.com that has some forms popup when you click on
I have a website where an ajax call will get some Json data from
I have a website in c#, in the first page I have some listbox,
I've seen some similar posts, but nothing quite like this... I have a website
I have one page website, on homepage(Layout/default.ctp) I have 2 forms, subscribe and contact
I have 2 websites, and I wish to show some posts from one on
i have a website page that contains only data of which one field gives
on my website www.beatmushroom.com which is running on the blogger platfrom I have small
I have a Facebook application, a Facebook page and a website. When someone adds
I have a website that i did some time ago now they request some

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.