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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T16:54:53+00:00 2026-05-24T16:54:53+00:00

I am building a really simple groupon like script for learning purposes now in

  • 0

I am building a really simple groupon like script for learning purposes now in holidays. What I posted below is the code that shows a deal and you have the option to buy it. When you click on buy, you are moved to checkout.php that displays also some info about the requested product.
deal.php

$dealid = (int)$_GET["id"];

$query = "SELECT * FROM products WHERE id = $dealid LIMIT 1";
$row = mysql_fetch_array(mysql_query($query));

echo $row['name'];
echo '<br>';
echo '<a href="checkout.php?id='. $row['id'] .'">buy</a>';

checkout.php

$dealid = (int)$_GET["id"];

$query = "SELECT * FROM products WHERE id = $dealid LIMIT 1";
$row = mysql_fetch_array(mysql_query($query));

echo $row['name'];

What I want to learn is if what I posted is a good way to do this. I guess not. My goal is to pass some data from deal to checkout through a link or a button like image and I don’t want to pass for example the title from the url.

What I have in mind is this http://www.groupon.com/st-johns/ where when you click the buy image you proceed to the next step that contains info of the requested to buy deal.

Thank you.

  • 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-24T16:54:53+00:00Added an answer on May 24, 2026 at 4:54 pm

    Store the information in a $_SESSION variable.

    session_start();
    $_SESSION['zipCode'] = "01879";
    
    //zipCode now available on all pages that call session_start()
    

    This allows you to store information for the life of the user’s session. When the session is destroyed (user navigates away, closes browser, etc.), the information is no longer there. Alternatively, you can use cookies to store this information long-term.

    Addition

    These methods are also more secure than storing the information on the page, as users can modify the DOM elements on the page using a DOM inspector, which most browsers now have. The most secure method is using sessions, as cookie information can also be changed, but is relatively safe if you validate the information there first.

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

Sidebar

Related Questions

I'm building some software that needs a scheduling input, and I'd really like to
I am building a interstitial page, using <div> and JavaScript, really simple script but
To clarify, here's the situation: I'm building a really simple CMS that will become
I'm building a really simple CMS for a bilingual website. The website would have
I have been building IMO a really cool RIA. But its now close to
I'm in the middle of building a simple iPhone calendar app, & I really
I am building a simple photo gallery application which shows images in a listbox.
I'm sure that there's a really simple solution to this that will make me
I'm building an events app that is very simple, it has a title and
I am building an AJAX powered website which uses the Really Simple History (RSH)

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.