If this is your first visit, please click the Sign Up now button to begin the process of creating your account so you can begin posting on our forums! The Sign Up process will only take up about a minute of two of your time.

Results 1 to 6 of 6
  1. #1
    Junior Member
    Join Date
    Feb 2012
    Member #
    Basically I want a User to be able to enter a code they have been given and when submitted it will bring them to a specific page. There will eventually be a hundred or so of these codes/pages.

    Not even sure where to start??


  3. #2
    WDF Staff mlseim's Avatar
    Join Date
    Apr 2004
    Cottage Grove, Minnesota
    Member #
    717 times
    It will involve PHP and MySQL (for the database).

    You won't really have "pages" ... your page will be a PHP script that renders
    the HTML and content depending on the code. You need to describe more about
    the users and what is going to happen. Do the users need to be registered, do
    they login? Can a code be used more than once? What will the website be used for?

    Step 1:
    Start by describing the purpose, the way it's supposed to work, who will be using it,
    how they will be using it (desktop PC, mobile app?).

    Step 2:
    Layout a logical scheme of the information you need to keep track of.

    Step 3:
    Tell us about steps 1 and 2 ... if what you're doing is secret,
    you'll have to hire a programmer to help you with the development of your site.
    If you can tell us the details, we can at least give you a good place to start,
    even if you have to hire someone, at least you'll know what to tell them.

  4. #3
    Junior Member
    Join Date
    Feb 2012
    Member #
    A customer will be given a code along with the product they bought. They will then go to the website and enter the code. Once entered it will display some textual information for them. I need to also display an error message if the code is incorrect. There will be repeated codes so they will be used more than once. it will be for a desktop pc not mobile at this time. I would like to just keep track of how many times the code is used.

  5. #4
    Senior Member Webzarus's Avatar
    Join Date
    May 2011
    South Carolina Coast
    Member #
    770 times
    Why enter the code ?

    If done properly, in a DB as suggested, emails can be generated from the DB and a link with the code embeded in it will be sent to the client, of course you'll need a form to fall back to in case there is a problem with clients email. Then they could enter the code manually.

    Yeah, you need a DB to do this right... Code ... Content ... All in the same table, then just a couple pages and a couple simple queries... Maybe a logging table to keep track of how many times a particular code has been viewed... From where... Etc.

    Depending on your hosting provider and what is available, it can be done in php or asp or

    Actually for what you're talking about... Maybe an hour or two's time for someone that knows what they are doing.

  6. #5
    Unpaid WDF Intern TheGAME1264's Avatar
    Join Date
    Dec 2002
    Not from USA
    Member #
    2783 times
    I'm thinking it's a redemption/coupon code, which could need to be tracked in aggregate.

    Again, as others have pointed out, you do this with a server-side programming language (ASP,, PHP, etc.) and your choice of database (MySQL, SQL Server, Access, etc.) You'll need a page to take the form entry and one to display the textual information.

    The other thing you'll need is some form of bot blocking, just to avoid people repeatedly trying to hack your form and get the codes...unless the benefit isn't worth anything financially.
    If I've helped you out in any way, please pay it forward. My wife and I are walking for Autism Speaks. Please donate, and thanks.

    If someone helped you out, be sure to "Like" their post and/or help them in kind. The "Like" link is on the bottom right of each post, beside the "Share" link.

    My stuff (well, some of it): My bowling alley site | Canadian Postal Code Info (beta)

  7. #6
    Senior Member Kayo's Avatar
    Join Date
    Dec 2006
    Brampton Ontario
    Member #
    39 times
    Here is a quick one I built

    Install Ruby and be sure that Rubygems was selected during the installation. Also install Postgres for the database (I know it's overkill, but I been having issues with SQLite, and I find Postgres is fairly well used in the Ruby world)

    Type the following into the console:
    gem install sinatra
    gem install data_mapper
    gem install dm-postgres-adapter
    In postgres (you code use the GUI interface, pgadmin) you have to create a database named sinatra_coupon_development

    Create a file called CouponApp.rb and past the following (enter in the correct password for postgres)
    require "rubygems"
    require "sinatra/base"
    require "data_mapper"
    DataMapper::setup(:default, "postgres://postgres:password@localhost/sinatra_coupon_development")
    class CouponCode
    include DataMapper::Resource
    property :id, Serial
    property :code, String
    property :body, Text
    class CouponApp < Sinatra::Base
    get '/entercode' do
    erb :enter
    post '/entercode' do
    @coupon = CouponCode.all( => "%#{params[:coupon]}").first
    if @coupon != nil
    erb :results
    erb :enter
    Create a folder called views and create a file named enter.erb
    <form method='post'>
    <label for='coupon'>Coupon:</label>
    <input class='test' name='coupon' type='text' /><br />
    <input class='button' type='submit' value='Send' />
    Create another file name results.erb
    <h2>You've entered the coupon "<%= @coupon.code %>"</h2>
    <p><%= @coupon.body %></p>
    Go into PGAdmin to create a coupon entry.

    back in the console, type
    Then got into your browser and type "localhost:4567/entercode" and you are done... ish.

    This would give you an idea why you need to go through to make an application like this. There are security vulnerabilities that need to be solved such as SQL injections. There is quite a bit you have to learn before you make an application that you are thinking of.

Remove Ads

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
All times are GMT -6. The time now is 12:44 AM.
Powered by vBulletin® Version 4.2.3
Copyright © 2019 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: