How can I get database data and place it in the a web page being displayed?

Posted on 2011-10-14
Last Modified: 2012-06-27
I have a desktop program (Windows C# .NET) that has a GUID stored in a Firebird database.  PayPal has an optional field that I want to fill when the user clicks a Buy Now button on a webpage on my site.  The PayPal page, my webpage that displays the Buy Now button and the C# program all reside on the same machine.    

How do I get the GUID into the PayPal webpage once it's displayed on the user's machine (where the Firebird database is located)?  

This is to encrypt a registration date that will be sent to me from PayPal so I can send the encrypted date (using the GUID) back to the user after he pays the registration fee.
Question by:rmmarsh
    LVL 15

    Expert Comment

    use the custom field paypal is providing. this also will cause the response to get this value back.
    fill this field with the value from the firebird database

    Author Comment

    Yes, that's the question:  HOW do I set the field?   This is the generated HTML on my webpage that I need to fill in os0...

    <td><input type="image" src="" border="0" name="submit" /><td style="font-size: smaller;">
    <input type="hidden" name="on0" value="GUID">&nbsp;&nbsp;&nbsp;&nbsp;Enter GUID:</td>
    <td><input type="text" name="os0" maxlength="100"></td>
    <td><img alt="" border="0" src="" width="1" height="1"></td>

    Open in new window

    How do I do that?
    LVL 18

    Expert Comment

    The GUID is in a database on the user's machine and you want to place it in your webpage?

    Sounds like you would want the user to click a button from inside your application (on the client's machine).  That button could pass the GUID to your webpage so you can place it in the field.

    Alternatively, you would want to give the user a way of accessing the GUID from inside your application so they can copy/paste or hand-key the GUID into the field.

    Or is your question much simpler... you already have the GUID available and are wanting to know how to place that value into <input type="text" name="os0" maxlength="100"> ?

    Author Comment

    Yes, it's the simpler question:  the GUID is in the program and is also stored in the Firebird database on the users machine.  When the user wants to renew his license, somehow I want to get the GUID from the program/database to the PayPal button field "os0".

    Or is your question much simpler... you already have the GUID available and are wanting to know how to place that value into <input type="text" name="os0" maxlength="100"> ?
    LVL 18

    Accepted Solution

    Based on your answer... I think what you are looking for is the first question, not the simpler one.  

    For the simpler one, by "already available" I meant that your webpage already knew what the value was but you needed to know how to insert it into the field value.

    But it seems you need to figure out how to get the value of the GUID *to* your webpage so that you can place it into the field, in which case I defer you back to the first two suggestions which is to provide a way for your application to pass the value to your webpage or for the user to pull up that value so they can key it in by hand.

    As far as I know, you cannot execute a program on the client's machine from your webpage.  Surely there are ways around this using ActiveX objects, etc., but... that leads to a whole other set of issues and technical expertise and a re-categorization of the question may be required.

    Since your client side application obviously has access to the database on the client's machine, let's presume you have a button in your application that launches the "Buy Now" webpage.  Your "Buy Now" button could simply open a webpage with the GUID as a parameter in the URL:

    That way the GUID is available to your webpage so that it can be placed into the form field.

    There are a variety of ways to do this...
    without knowing what language your webpage is written in (ASP, .Net, PHP, etc.), you can use javascript to get the value of the parameter and place it into the os0 field.

    Your example is missing the "form" tags, so I added them in the example attached.  open the file in your browser then add this to the URL;

    and "123" will magically appear in the GUID field.
    LVL 18

    Expert Comment

    Check this earlier EE answer for a user with a similar question about passing a value to PayPal's os0 field:

    Author Closing Comment

    Fantastic!  Exactly what I was looking for... thank you so much!

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Training Course: Adobe Dreamweaver CC 2015

    Adobe Dreamweaver Creative Cloud is used by web designers and front-end developers and allows you to visualize your site in real-time as you code. This course covers exam objectives for the Adobe Certified Associate (ACA) certification.

    Suggested Solutions

    Title # Comments Views Activity
    HTTP Header Question 10 76
    CSS alignment issue 2 32
    CSS and images 5 56
    Text Transformation using ActionScript 3 5 47
    Foreword (July, 2015) Since I first wrote this article, years ago, a great many more people have begun using the internet.  They are coming online from every part of the globe, learning, reading, shopping and spending money at an ever-increasing ra…
    Not sure what the best email signature size is? Are you worried about email signature image size? Follow this best practice guide.
    The viewer will learn the benefit of using external CSS files and the relationship between class and ID selectors. Create your external css file by saving it as style.css then set up your style tags: (CODE) Reference the nav tag and set your prop…
    The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

    759 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    7 Experts available now in Live!

    Get 1:1 Help Now