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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T20:17:10+00:00 2026-06-10T20:17:10+00:00

I am creating a website that can offer us to use the transaction feature

  • 0

I am creating a website that can offer us to use the transaction feature given by Paypal.

Again for the website to work perfectly I am using sandbox account for my developing.

Now there are two parameters named return and cancel_return. when transaction is completed successfully paypal website redirect it to page mentioned in return parameter otherwise it returns in cancel_return parameter.but web page is not redirect .while clicking return link to webpage it showing error.

my code success.php

         <?php
             define("DB_HOST", "localhost");
             define("DB_USERNAME", "root");
              define("DB_PASSWORD", "");
             define("DB_DATABASE", "test");
            $connect = mysql_connect(DB_HOST, DB_USERNAME, DB_PASSWORD) or   
                 die("Database Connection Error");
            mysql_select_db(DB_DATABASE) or ("Database Selection Error");

             session_start();
             $uid = $_SESSION['uid'];
             $username=$_SESSION['username'];

              $item_no = $_GET['item_number'];
              $item_transaction = $_GET['tx'];
              $item_price = $_GET['amt'];
              $item_currency = $_GET['cc'];

           //Getting product details
$sql=mysql_query("select product,price,currency from products where pid='$item_no'");
   if($sql === FALSE) {
       die(mysql_error()); // TODO: better error handling
   }
   $row=mysql_fetch_array($sql);
       $price=$row['price'];
      $currency=$row['currency'];

        //Rechecking the product details
      if($item_price==$price && $item_currency==$currency)
     {

     $result = mysql_query("INSERT INTO sales(pid, uid, saledate,transactionid) 
     VALUES('$item_no', '$uid', NOW(),'$item_transaction')");
  if($result){
         echo "<h1>Welcome, $username</h1>";
        echo '<h1>Payment Successful</h1>';

       }else{
        echo "Payment Error";
      }
     }
      else
        {
      echo "Payment Failed";
            }
          ?>

It not saving into database and showing error as

  Undefined index: item_number in C:\wamp\www\mvc\view\success.php on line 13
  Undefined index: tx in C:\wamp\www\mvc\view\success.php on line 14
  Undefined index: amt in C:\wamp\www\mvc\view\success.php on line 15
  Undefined index: cc in C:\wamp\www\mvc\view\success.php on line 16

Thanks

  • 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-10T20:17:12+00:00Added an answer on June 10, 2026 at 8:17 pm

    This is a notice error.
    This means that some of your $_GET variables are not set.

    An example to get rid of this error message is to switch how you assign the variables… such as

    $item_no = isset($_GET['item_number']) ? $_GET['item_number'] : null;
    

    You can also disable notices by changing the variable error_reporting in php.ini but this is not recommended on a development machine

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

Sidebar

Related Questions

I am creating a script using Python Mechanize that can login to a website
i'm creating a shopping website that will sell computer parts using MVP and asp.net.
I am creating a website using ASP.NET that supports multiple languages. For that I
I'm trying to use domain driven design while creating a website that is publicly
So I am creating a website that basically allows user to sign up using
I am creating a website that is using a perl script, PHP, a MySQL
I am currently creating a website in php that has a database backend (can
I am creating a website that uses W3C Geolocation API and position.timestamp for timestamp.
I am creating a website that will be used by an accounting dept. to
I am creating a website that uses a fluid layout with artificial columns. I

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.