Thank you for being a valued part of the CNET community. As of December 1, 2020, the forums are in read-only format. In early 2021, CNET Forums will no longer be available. We are grateful for the participation and advice you have provided to one another over the years.

Thanks,

CNET Support

General discussion

insert record AND post form

Oct 23, 2006 2:03AM PDT

Hi,
I'm sure this is a common problem, I could not find anything relating to it in search here so...

I have a form, which I insert data into database, fine.

I then want to post the same form to paypal payment page.

I've got paypal set-up fine with hidden fields in the form etc. However, how can I make the insert into database and then post the form to paypal ? should I use onClick event to trigger insert and action to post to paypal ?

using asp vb

Any advise appreciated.

Discussion is locked

- Collapse -
Question about structure here...
Oct 23, 2006 3:10AM PDT

Are these both pages you wrote? If so then at the start of the paypal page do the insert into the database and then process the paypal request. Otherwise you may have to launch a web request to paypal from your server to send the data to paypal though this may get a little tricky as you'd have to be sure of how the request should be set up and what you get back on this.

Regards,
JB

- Collapse -
Question About Your Forms
Oct 26, 2006 6:39PM PDT

You might just be my saviour, I was about to ask a question about submitting forms to a database, I don't even know where to begin, can you give me some pointers?

- Collapse -
language
Oct 26, 2006 11:01PM PDT

Starting point would be to determine what language you are going to code in.

- Collapse -
3 parts to this...
Oct 27, 2006 3:55AM PDT

1) Web server -> Is this Apache on Linux, Microsoft's IIS, or something else that will be on the web server?
2) Language -> This could be PHP, ASP.Net in C#.Net or VB.Net, ASP in VBScript, or you could go old school with some CGI or C++ in ISAPI
3) Database -> MySQL, MS-SQL, or Oracle are a few examples of database software for the back-end.

That would be a bit of a starting point in terms of piecing this together though I imagine there are some places that may also have this set up for you to some extent.

- Collapse -
Right then ...
Oct 29, 2006 9:42PM PST

1. I've got Microsoft IIS on my Dell IIS server

2. I haven't really touched any of these languages, so the easier the better!

3. I've got MS SQL on my SQL server

Oh, and I've got Dreamweaver as my internet-stuff creator! (That is a technical term by the way!)

- Collapse -
Easy? Well...
Oct 30, 2006 12:01AM PST
PHP on IIS link that may help if you want to go down that road of using PHP and a SQL back-end.

Otherwise you could use ASP though it is a bit dated in some respects. I'm not sure if Dreamweaver would compile ASP.Net code so that is why I'd be hesitant on that route though you could get Visual Studio Express if you want to go that route.

Any of the languages will essentially perform the same function: Taking the data from the web server and put it into the database and all will require a bit of a learning curve of one form or another.

Regards,
JB
- Collapse -
Thanks!
Oct 30, 2006 12:04AM PST

Yeah, it's all a big learning curve for me!

Incidently, I've got MS SQL on my IIS, I realise this is a bit of a no-no, but not my doing!

The database is going to be small, less than a thousand rows, for the values from a survey.

All I want is a load of check boxes on a web page, click 'Submit' and Ta-da, by the magic of geekery the results are in a database that I can query till my heart's content!

- Collapse -
Well it depends...
Oct 30, 2006 12:11AM PST

IIS and SQL on the same machine can be a problem if you have a lot of traffic, e.g. millions of hits. If not then it probably won't be that bad.

Less than a thousand rows should be fine on one machine.

As a side note, you may want to think this through a bit more to prevent things like double entries, e.g. someone posts the same page twice, or incomplete results so that there may be some work in generating the HTML for the page as well as in the processing side. Another point is will you read the results out of the database directly or do you plan on having a page to get that? Just a few parting thoughts...

Regards,
JB

- Collapse -
Getting there, slowly (very slowly!) but surely!
Nov 1, 2006 7:29PM PST

Ok, really, thanks for all your help so far everyone! I'm new to all this, but its a great feeling to be learning new stuff!

I now have an ASP page linked to an MS Access database on my IIS Server (I think I'll leave the SQL bit out for now! One step at a time!) I can INSERT data into it with a submit button, which may seem small to some people, but after messing around with this for a week, made me literally jump for joy!

So now for something a little more technical if you will!?

I'm only testing at the mo, so forgive the strange naming conventions! If I have this radiogroup, how do I submit just the selected result to my db?

<form action="" method="post" name="form1">
<p><label></label>
<label>
<input type="radio" name="Yes or No" value="1">
1</label>
<br>
<label>
<input type="radio" name="Yes or No" value="2">
2</label>
<br>
<label>
<input type="radio" name="Yes or No" value="3">
3</label>
<br>
<label>
<input type="radio" name="Yes or No" value="4">
4</label>
<br>
<label>
<input type="radio" name="Yes or No" value="5">
5</label>
<br>
<br>
<input type="submit" name="Submit" value="Submit">
</p>
</form>

Thanks again people!

JBS

- Collapse -
Link to example....
Nov 1, 2006 11:41PM PST

"ASP101 Radio Button example" should give an example of what you want.

The key here is to read the data from either the query string, if the form does a get action, or the form, if the form is posted, within the request object.

Regards,
JB

- Collapse -
try dreamweaver to start, easy peasy.
Oct 29, 2006 2:35AM PST

Hi,
I've resolved my issue by just using two pages, one to collect the uaser/account info then the next to confirm the 'order' and upon submission POST to paypal. I wanted to do this all on one page (that was my original question here), but two is OK.

Regarding inserting form data into a database. I have alot of experience of this. I suggest the easiest way to start is ASP or PHP and use Access for the database or mySQL. (if ur not sure try ASP/Access first.

You could download a trial version of Dreamweaver 8 from Adobe.com to use as this supports setting up a database connection and draggy droppy method to relate text fields in forms to database table columns etc. very easy and effective.

If you hae ANY trouble post back and I will help if possible.

- Collapse -
Ok, lets complicate things!
Nov 8, 2006 9:59PM PST

Right, you guys are fantastic, thanks ever so much for your help, I now have my ASP page quite happily banging data into an MS Access database, chuffed to bits!

But the Access database sits on my IIS server where my ASP page sits.

How would I get it to insert data into a seperate (SQL) server?

- Collapse -
There's a few ways to do this...
Nov 9, 2006 12:42AM PST

The easiest is to look at setting up a Connection object that uses a connection string to select, insert or update data in a SQL database.

MSDN article showing one way to do this.

Another article if you want some more details.

Regards,
JB

- Collapse -
Pass data to another page while Inserting into a database
Mar 21, 2007 5:48AM PDT

hi,

as a follow up to a question asked earlier, i would like to know how to pass data from a textbox in form1 page1 to form1 page 2; while inserting the rest of the data into the database.

i noticed that before i activated insert record server behaviour, i could easily pass data from one page to another but immediately i used insert record, no data was passed.

i really need this to work. i have a long questionnaire that is broken into pages, i want to be able to pass a unique value per respondent so i can track his input.

thanks so much for ur assistance.

fyi: i'm using dreamweaver 8, access 2000

amino