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

  • Home
  • SEARCH
  • 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 7070349
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T05:33:20+00:00 2026-05-28T05:33:20+00:00

It is coded as php and it is running on my localhost but not

  • 0

It is coded as php and it is running on my localhost but not on the actual server 😐
The recaptcha Image does not appear as it runs through the server. SO instead of no Image it gives me this statement: INVALID ERROR: INVALID REFERER

the code is for SIGN_UP.php

<form name="form1" method="post" action="signup_ac.php">
<?php
require_once('recaptchalib.php');
$publickey = "6LcM0csSAAAAADwL24ky6_v0ZBO1l1ZzMqRVsJ7W"; // you got this from the signup page
echo recaptcha_get_html($publickey);
?>
<table width="600" height="347" border="0" cellpadding="0" cellspacing="4">
<tr>
  <td width="191" height="30" bgcolor="#DDDDDD">E-mail</td>
  <td width="25" bgcolor="#DDDDDD" align="center">:</td>
  <td width="368" bgcolor="#DDDDDD"><input name="email_add" type="text" id="email_add" onBlur="MM_validateForm('email_add','','RisEmail','password','','R','contact_name','','R','company_name','','R','phone_num','','R','date_created','','R','time_created','','R','address','','R');return document.MM_returnValue" size="50"></td>
</tr>
<tr>
<td height="30" bgcolor="#DDDDDD">Password</td>
<td bgcolor="#DDDDDD" align="center">:</td>
<td bgcolor="#DDDDDD"><input name="password" type="text" id="password" size="50"></td>
</tr>
<tr>
<td height="31" bgcolor="#DDDDDD">Your Name</td>
<td bgcolor="#DDDDDD" align="center">:</td>
<td bgcolor="#DDDDDD"><input name="contact_name" type = "text" id="contact_name" size="50"></td>
</tr>
<tr>
<td height="31" bgcolor="#DDDDDD" onfocus="MM_validateForm('email_add','','RisEmail','password','','R','phone_num','','R');return document.MM_returnValue">Company Name</td>
<td bgcolor="#DDDDDD" align="center">:</td>
<td bgcolor="#DDDDDD"><input name="company_name" type="text" id="company_name" size="50"></td>
</tr>
<tr>
<td height="31" bgcolor="#DDDDDD">Address</td>
<td bgcolor="#DDDDDD" align="center">:</td>
<td bgcolor="#DDDDDD"><textarea name="address" cols="50" rows="5" id="address"></textarea></td>
</tr>
<td height="35" bgcolor="#DDDDDD">Phone Number</td>
<td bgcolor="#DDDDDD" align="center">:</td>
<td bgcolor="#DDDDDD"><input name="phone_num" type="text" id="phone_num" size="50"></td>
</tr>
<td height="31" bgcolor="#DDDDDD">Fax</td>
<td bgcolor="#DDDDDD" align="center">:</td>
<td bgcolor="#DDDDDD"><input name="fax" type="text" id="fax" size="50"></td>
</tr>
<td height="36" bgcolor="#DDDDDD">Date Created</td>
<td bgcolor="#DDDDDD" align="center">:</td>
<td bgcolor="#DDDDDD"><input name="date_created" type="text" id="date_created" size="50"></td>
</tr>
<td height="29" bgcolor="#DDDDDD"><p>Time Created</p>
  <p> (hh : mm)am/pm</p></td>
<td bgcolor="#DDDDDD" align="center">:</td>
<td bgcolor="#DDDDDD"><input name="time_created" type="text" id="time_created" size="50"></td>
</tr>

<tr>
<td height="31">&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;
  <div align="right">
    <input type="reset" name="Reset" value="Reset">
    <input type="submit" name="Submit" value="Submit" />
  </div></td>
</tr>
</table>
</form>

**Then SIGNUP_AC.php CODE to PRocess the code which is suppose to run after the SUGNUP.php is submitted. and then verify the user through Email that they provided during registeration:**
<?

  require_once('recaptchalib.php');
  $privatekey = "your_private_key";
  $resp = recaptcha_check_answer ($privatekey,
                                $_SERVER["REMOTE_ADDR"],
                                $_POST["recaptcha_challenge_field"],
                                $_POST["recaptcha_response_field"]);

  if (!$resp->is_valid) {
    // What happens when the CAPTCHA was entered incorrectly
    die ("The reCAPTCHA wasn't entered correctly. Go back and try it again." .
         "(reCAPTCHA said: " . $resp->error . ")");
  } else {
    // Your code here to handle a successful verification

            $host="localhost"; // Host name 
            $username="root"; // Mysql username 
            $password=""; // Mysql password 
            $db_name="purchase_try"; // Database name 
            //$tbl_name="temp_members_db"; // Table name 

            // Connect to server and select database.
            mysql_connect("$host", "$username", "$password")or die("cannot connect"); 
            mysql_select_db("$db_name")or die("cannot select DB");

            // table name 
            //$tbl_name= "temp_members_db";

            // Random confirmation code 
            //$confirm_code = md5(uniqid(rand()));

// values sent from form 
$email_add      =   $_POST['email_add'];
$password       =   $_POST['password'];
$contact_name   =   $_POST['contact_name'];
$company_name   =   $_POST['company_name'];
$address        =   $_POST['address'];
$phone_num      =   $_POST['phone_num'];
$fax            =   $_POST['fax'];
$date_created   =   $_POST['date_created'];
$time_created   =   $_POST['time_created'];         

            // Insert data into database 
            $sql="INSERT INTO temp_members_db(confirm_code,
                                                 email_add,
                                                 password, 
                                                 company_name,
                                                 contact_name, 
                                                 address,
                                                 phone_num,
                                                 fax_num,
                                                 date_created,
                                                 time_created)
                                                            VALUES('".$confirm_code."',
                                                                    '".$email_add."', 
                                                                     '".$password."',
                                                                     '".$company_name."', 
                                                                     '".$contact_name."'
                                                                     '".$address."',
                                                                     '".$phone_num."',
                                                                     '".$fax."',
                                                                     '".$date_created."',
                                                                      '".$time_created."')";

            $result =   mysql_query($sql);

            if($result){
            echo "Successful";

            }

            else {
            echo "ERROR";
            }

            // close connection 
            mysql_close();

            // if suceesfully inserted data into database, send confirmation link to email 
            if($result){

            // ---------------- SEND MAIL FORM ----------------

            // send e-mail to ...
            $to =   $email_add;

            // Your subject
            $subject    =   "Your confirmation link here";

            // From
            $header =   "from: your name <noreply@testing>";

            // Your message

            $message    =   "Your Comfirmation link \r\n";
            $message    .=  "Click on this link to activate your account \r\n";
            $message    .=  "http://www.yourweb.com/confirmation.php?passkey=$confirm_code";

            // send email
            $sentmail = mail($to,$subject,$message,$header);

            }

            // if not found 
            else {
            echo "Not found your email in our database";
            }

            // if your email succesfully sent
            if($sentmail){
            header('location: register_confirm_mssg.php');
            }
            else {
            header('location: email_notsent.php');
            }

  }


?>
  • 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-05-28T05:33:21+00:00Added an answer on May 28, 2026 at 5:33 am

    Generally that error occurs as, when you are getting the pair of keys from google api, you specify the domain name there. In that, to use those keys in your local system, you will enter domain as “localhost”. But, these pair of keys will not work when you deploy that application in any server.

    So, for the application to work in the remote host, you should get the pair of keys from google api with the domain name, where you are going to deploy your application. And use them in your application.

    Hope it helps in some way.

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

Sidebar

Related Questions

This question is coded in pseudo-PHP, but I really don't mind what language I
I am running following PHP code to interact with a MS Access database. $odbc_con
Iam running WAMP server and just enabled php_memcache extension and have tried the code
As a web developer looking to move from hand-coded PHP sites to framework-based sites,
I have a web page coded in PHP. This page is for posting a
My PHP code below shows an image on browser as its original size 300x300.
I'm working on a PHP contact form, but I can't get it to work.
I have a copy of a code running on the production server, and I
I'm running eclipse 3.5 (Galileo) with the PHP development tools (PDT) plug in. I
I have created a basic flash socket server in PHP, it all works fine

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.