close ad
Install the LAtest Updates to Work with CC 2017 and CC 2018
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

redirect insert page to newly created detail page

Thread began 8/04/2014 6:35 pm by Mark | Last modified 8/08/2014 2:02 pm by Jason Byrnes | 1004 views | 11 replies |

Mark

redirect insert page to newly created detail page

How do I code the redirect on my insert page to go to the details page of the record I just created?

Sign in to reply to this post

Jason ByrnesWebAssist

If you are using the latest version of Data Bridge, use [Insert_ID] to refer to the inserted ID.

so set the redirect URL to:

page.php?id=[Insert_ID]

the code will automatically replace [Insert_ID] with the ID of the inserted record.

Sign in to reply to this post

Mark

For some reason, that's not working. It's coming back with an ID of "0". Is it because I have data going to two separate tables? Here is the code (in the private message - which Ray helped me set up).

Sign in to reply to this post

Jason ByrnesWebAssist

In the FAQs table, is the ID column set to auto increment?
the ID column will need to be an auto increment column for the redirect to work properly.

Sign in to reply to this post

Mark

No, its not. It's set to get the same ID as the "toys" table since they need to be locked. Ray had me delete the re-direct from the toys table since the FAQ insert came after it. How can I make this work?

Sign in to reply to this post

Jason ByrnesWebAssist

ok, so the actual question here is: how to use 2 insert behaviors and set the redirect in the second one to use the session created by the first.


that you need to hand code, the session created by the first insert is named WADA_Insert_toys. so edit the redirect:

$WA_redirectURL = "../pages/halloween2.php?productID=[Insert_ID]";



to:

$WA_redirectURL = "../pages/halloween2.php?productID=".$_SESSION['WADA_Insert_toys'].";
Sign in to reply to this post

Mark

Thanks Jason, but there seems to be a slight problem with that code. The page won't display now. I think it has either one too many or one too few quote marks in it.

Sign in to reply to this post

Jason ByrnesWebAssist

sorry, you're right, there is a missing quote, it should be:

$WA_redirectURL = "../pages/halloween2.php?productID=".$_SESSION['WADA_Insert_toys']."';
Sign in to reply to this post

Mark

Something still isn't right. I think the single and double quotes aren't matching.

OK, I got it. The single quote at the end of the string needed to be double.

Sign in to reply to this post

Jason ByrnesWebAssist

ghaa, i need more coffee. . . or maybe a better shift key. it should be a double quote at the end:


$WA_redirectURL = "../pages/halloween2.php?productID=".$_SESSION['WADA_Insert_toys']."";
Sign in to reply to this post
loading

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...