navigation
a webmaster learning community
     Home    Register     Search      Help      Login    
Sponsors

Shopping Cart Software
Ecommerce software integrated into Frontpage, Dreamweaver and Golive templates. No monthly fees and available in ASP and PHP versions.

Website Templates
We also have a wide selection of Dreamweaver, Expression Web and Frontpage templates as well as webmaster tools and CSS layouts.

Frontpage website templates
Creative Website Templates for FrontPage, Dreamweaver, Flash, SwishMax

Search Forums
 

Advanced search
Recent Posts

 Todays Posts
 Most Active posts
 Posts since last visit
 My Recent Posts
 Mark posts read

 

Getting ID Tutorial with custom confirmation page?

 
View related threads: (in this forum | in all forums)

Logged in as: Guest
Users viewing this topic: none
Printable Version 

All Forums >> Web Development >> ASP and Database >> Getting ID Tutorial with custom confirmation page?
Page: [1]
 
R Clark

 

Posts: 161
From: USA
Status: offline

 
Getting ID Tutorial with custom confirmation page? - 4/12/2002 13:03:05   
I went through the 'Getting the ID of last added record' tutorial and it worked great. What I would like to do now is use it with my custom confirmation page and I'm not proficient enough with the code to relate the two.

The following is the altered code from the tutorial (adding the 'Record ID "&1NewID&"...);

FP_FormConfirmation "text/html; charset=windows-1252",_
"Form Confirmation",_
"Record ID "&lNewId&" - Thank you for submitting the following information:",_
"rout_track_entry.asp",_
"Return to the form."

How would it work if I have a custom confirmation page? Instead of the code above, I have the following;

Response.Redirect "Confirmation_Test.asp"

Thanks
R Clark


Edited by - R Clark on 04/12/2002 13:04:06
Spooky

 

Posts: 26606
Joined: 11/11/1998
From: Middle Earth
Status: offline

 
RE: Getting ID Tutorial with custom confirmation page? - 4/12/2002 22:33:01   
If the code is all on the same page, then this should work :

Response.Redirect "Confirmation_Test.asp?ID="&1NewID

The page "Confirmation_Test.asp" will need to ask for the ID from a querystring("ID")


§þððk¥
Database / DRW Q & A
VP-ASP Shopping cart
Spooky Login

(in reply to R Clark)
R Clark

 

Posts: 161
From: USA
Status: offline

 
RE: Getting ID Tutorial with custom confirmation page? - 4/15/2002 12:16:45   
OK, I took a shot at it. Here are the last few lines of the page that I altered;

fp_rs.Update
1NewId = fp_rs(0)
FP_DumpError strErrorUrl, "Cannot update the database"

fp_rs.Close
fp_conn.Close

Response.Redirect "Confirmation_Test.asp?ID="&1NewID

End If
End If

%>


This causes the following error when trying to view this page;
FYI - Line 44 is --> 1NewId = fp_rs(0)


HTTP 500.100 - Internal Server Error - ASP error
Internet Information Services

--------------------------------------------------------------------------------

Technical Information (for support personnel)

Error Type:
Microsoft VBScript compilation (0x800A0400)
Expected statement
/tponly/pages/rout_track_entry_copy1.asp, line 44


So...I went to the MSDN site and looked up this error and it says 'Variable is undefined' and talks about the use of the 'Option Explicit' statement (?).
It says I need to declare a variable so I took a shot at that too and put the following (not sure if I was doing it right);

fp_rs.Update
Dim 1NewId
1NewId = fp_rs(0)
FP_DumpError strErrorUrl, "Cannot update the database"

I now get this error;

HTTP 500.100 - Internal Server Error - ASP error
Internet Information Services

--------------------------------------------------------------------------------

Technical Information (for support personnel)

Error Type:
Microsoft VBScript compilation (0x800A03F2)
Expected identifier
/tponly/pages/rout_track_entry_copy1.asp, line 44, column 4


Soo...I go back to the MSDN site and it looks like it describes the identifier just like the next line after the Dim? Written like this, but the line below is line 45 so my error is the Dim?;

1NewId = fp_rs(0)

I think I might be getting off the track and I haven't even gotten down to the 'Response.Write' line.

I hate to think what will happen then.

Are you tired of me yet?

DON'T ANSWER THAT!

Thanks, as always

R Clark


 

Edited by - R Clark on 04/15/2002 12:18:43

(in reply to R Clark)
R Clark

 

Posts: 161
From: USA
Status: offline

 
RE: Getting ID Tutorial with custom confirmation page? - 4/15/2002 14:18:21   
I'm on to something...

I had a number 1 (1NewId) as the first character rather than an alphabetical character (NewId) for the variable and it seems that you can't do that in VBscript.

I changed it and I don't get the error now.

More to come

R Clark

(in reply to R Clark)
R Clark

 

Posts: 161
From: USA
Status: offline

 
RE: Getting ID Tutorial with custom confirmation page? - 4/15/2002 15:17:12   
This is what finally worked;

fp_rs.Update
dim NewId
NewId=fp_rs(0)
FP_DumpError strErrorUrl, "Cannot update the database"

fp_rs.Close
fp_conn.Close

Response.Redirect "rout_track_detail.asp?ID="&NewID

It works like a charm!

Small potatoes for most I suppose but it was a good lesson for me.
You gotta start somewhere I guess.

Thanks for starting me off Spooky!

R Clark

(in reply to R Clark)
R Clark

 

Posts: 161
From: USA
Status: offline

 
RE: Getting ID Tutorial with custom confirmation page? - 4/16/2002 11:42:41   
Spooky,
If I may trouble you for another suggestion (hoping not to wear out my welcome! )?
Now that I've got the entry form working and populating another page with the new record and ID, I'd like to do the same thing with an update page.
I've got this redirection in a SQL update page that I use to update records.
A hyperlink on a DB results page takes you to a form and populates it. I then send the form to this SQL page to perform the update. I use the redirection below in the head of the sql update page to go back to a specific page after the update is completed. I'd like to use your 'getting ID' scenario to populate the confirmation_test.asp page, indicated in the statement below, to show the newly updated record. It doesn't work exactly like the scenario in your tutorial because it doesn't have all the code at the top of the page that contains the fp_rs.Update so I haven't been able to relate to it. Plus, I guess we're not trying to get the new record of the DB but we're trying to get the newly updated record. How can I call up the specific ID that I am updating? When I use the scenario in example 1, I get exactly what I want but I get all records in the DB, not just my specific record that I just updated. I've tried a few other ways but those have just led to scripting errors in the SQL update page. I'm thinking that when I am accessing this page initially, my update form is in the process of passing the specific ID to the SQL update page as a matter of the whole process so I should be able to manipulate it, correct? I just haven't been able to figure out how to grab it and deposit it into this redirect statement. I tried something like example 2 (didn't feel right but thought what the heck), I get scripting errors (HTTP 500.100 object expected). I know I have to dynamically get and place the ID in there but can't put my finger on how to do it. I've been at w3schools and others taking tutorials on VBscript but haven't been able to figure it out yet. The tutorials deal mostly with VBscript only, not the HTML / VBscript combination. I thought you might be able to give me another head start.

Original
<meta HTTP-EQUIV='Refresh' CONTENT="0;URL=confirmation_test.asp">

example 1
<meta HTTP-EQUIV='Refresh' CONTENT="0;URL=confirmation_test.asp?ID=ID">

example 2
<meta HTTP-EQUIV='Refresh' CONTENT="0;URL=confirmation_test.asp?ID=<%=FP_FieldURL(fp_rs,"ID")%>">


Thanks
R Clark

(in reply to R Clark)
Spooky

 

Posts: 26606
Joined: 11/11/1998
From: Middle Earth
Status: offline

 
RE: Getting ID Tutorial with custom confirmation page? - 4/16/2002 17:16:19   
Try :
<meta HTTP-EQUIV='Refresh' CONTENT="0;URL=confirmation_test.asp?ID=<%=Request("ID")%>">

But firstly, go IE > tools > options > advanced > DONT show friendly http errors
This should give you the true error

§þððk¥
Database / DRW Q & A
VP-ASP Shopping cart
Spooky Login

(in reply to R Clark)
R Clark

 

Posts: 161
From: USA
Status: offline

 
RE: Getting ID Tutorial with custom confirmation page? - 4/16/2002 18:02:29   
Works perfectly! Thank you very much. I was dancing all around that, I tried request.write… as a guess.

I'll give you a break for a while and do some more tutorials!

quote:
But firstly, go IE > tools > options > advanced > DONT show friendly http errors
This should give you the true error

Had that unchecked (doesn't show friendly http errors) already from an earlier suggestion on the MSDN site.

Thanks again!

R Clark

(in reply to R Clark)
Spooky

 

Posts: 26606
Joined: 11/11/1998
From: Middle Earth
Status: offline

 
RE: Getting ID Tutorial with custom confirmation page? - 4/16/2002 19:59:19   
Why it works, is that its looking for one of the request collection.
Form, querystring, cookie etc.

Because the user arrived at this page by using a url or form containing the "ID" variable you are able to request it.

The original format was trying to write it (assuming it was actually connected to a database - which I doubt it was)

Easy eh? :)


§þððk¥
Database / DRW Q & A
VP-ASP Shopping cart
Spooky Login

(in reply to R Clark)
R Clark

 

Posts: 161
From: USA
Status: offline

 
RE: Getting ID Tutorial with custom confirmation page? - 4/17/2002 9:13:28   
Pulling (writing) from a DB versus pulling (requesting) from a process going on? Sounds very useful!

Thanks again!
I am inspired to educate myself more about this stuff! Sometimes it seems like such a slow process with this stuff though (self teaching). Thank goodness for this site and your assistance!

I was reading that VBscript only works in IE not Netscape? How do you, as a Frontpage developer, handle Netscape when using VBscript for your scripting? I don't have to worry about that on my intranet because all users use IE but I can't help but think my site would bomb on Netscape. I'd install it on my machine for development purposes but that takes an act of God to accomplish in our corporate world!

Have a great day!

R Clark

 

(in reply to R Clark)
Spooky

 

Posts: 26606
Joined: 11/11/1998
From: Middle Earth
Status: offline

 
RE: Getting ID Tutorial with custom confirmation page? - 4/17/2002 16:40:21   
Only client side vbscript doesnt work on Netscape (with out a plugin) but what we are doing is server side. The output is only ever html to the client.

If we wish to do any client side scripting, javascript is the language of choice.

Heres a simple page to play with.

Page1.asp
<a href=page2.asp?KEY=1>Link to next page with number 1</a>
<a href=page2.asp?KEY=2>Link to next page with number 2</a><br>
<a href=page2.asp?KEY=3>Link to next page with number 3</a><br>
<a href=page2.asp?KEY=4>Link to next page with number 4</a><br>

Page2.asp

You sent a user from page 1 with the number <%=Request.querystring("KEY")%> in the link<br>
<a href=page1.asp>Go back</a>








§þððk¥
Database / DRW Q & A
VP-ASP Shopping cart
Spooky Login

(in reply to R Clark)
R Clark

 

Posts: 161
From: USA
Status: offline

 
RE: Getting ID Tutorial with custom confirmation page? - 4/17/2002 17:18:50   
AAAhh Yes. That makes sense! I did know that about results being HTML but just didn't put 2 and 2 together...brain f*#t.

Thanks for the examples, I will play around with them. I'm doing some drop down stuff with JavaScript, that is similar, to send people directly to a page with a query of the drop down...
for instance;

<select size="1" name="field" onchange="makeLinkTo(this);">
<option selected value="select_n_go_page.asp">Choose Search item from list</option>
<option value="results_page.asp?field=this">This</option>
<option value="results_page.asp?field=that">that</option>
<option value="results_page.asp?field=theotherthing">theotherthing</option>
</select>
Plus the javascript to make it work...



Didn't have a handle on any of this earlier today but after a few hours of forum search at OutFront and trial and error I've got it working now. I need to get coordinated with my use of JavaScript and VBscript and such!

Dang I love this stuff! (at least for now )


Thanks again

R Clark


Edited by - R Clark on 04/17/2002 17:19:55

(in reply to R Clark)
Page:   [1]

All Forums >> Web Development >> ASP and Database >> Getting ID Tutorial with custom confirmation page?
Page: [1]
Jump to: 1





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts