close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Redirect to product results after update

Thread began 11/23/2009 9:26 am by Joe Lowery | Last modified 11/24/2009 9:00 pm by Joe Lowery | 1907 views | 4 replies |

Joe Lowery

Redirect to product results after update

I'm trying to change the products update page so that it redirects to the last product result page after updating. I've gotten it to redirect to the results page that initially loads by changing line 166 to:

$WA_redirectURL = "Products_Results.php?Search=0";



What do I change the argument to so the redirect goes to the last results page displayed?

Best - Joe

Sign in to reply to this post

Jason ByrnesWebAssist

try leaving the Query string variable off:

php:
$WA_redirectURL = "Products_Results.php";




that should cause the DataBase Search behavior to use the previous search that is stored in a session variable.

Sign in to reply to this post

Joe Lowery

That appears to work if the client uses the search engine, but not if they are paging through the recordset (which is how it is being used now). Is there anyway to have the page redirect to the previous page under both scenarios?

Best - Joe

Sign in to reply to this post

Jason ByrnesWebAssist

the paging is controlled by querystring variables:
?pageNum_WADAProducts=1&totalRows_WADAProducts=12

These would need to be added to the update link on the results page:

php:
<input type="button" name="product_update" id="product_update" value="Update" class="ie_btn_small" onclick="window.location = 'Products_Update.php?ProductID=<?php echo(rawurlencode($row_WADAProducts['ProductID'])); ?><?php echo(isset($_GET['pageNum_WADAProducts'])?"&pageNum_WADAProducts=".$_GET['pageNum_WADAProducts']:""); ?><?php echo(isset($_GET['totalRows_WADAProducts'])?"&totalRows_WADAProducts=".$_GET['totalRows_WADAProducts']:""); ?>';" /><br />




to the forms action on the update page:

php:
 action="Products_Update.php?ProductID=<?php echo(rawurlencode($row_WADAProducts['ProductID'])); ?><?php echo(isset($_GET['pageNum_WADAProducts'])?"&pageNum_WADAProducts=".$_GET['pageNum_WADAProducts']:""); ?><?php echo(isset($_GET['totalRows_WADAProducts'])?"&totalRows_WADAProducts=".$_GET['totalRows_WADAProducts']:""); ?>"




and to the redirect:

php:
$WA_redirectURL = "Products_Results.php?ProductID=".((isset($_POST["WADAUpdateRecordID"]))?$_POST["WADAUpdateRecordID"]:"")  ."".((isset($_GET["pageNum_WADAProducts"]))?"&pageNum_WADAProducts=".$_GET["pageNum_WADAProducts"]:"")  ."".((isset($_GET["totalRows_WADAProducts"]))?"&totalRows_WADAProducts=".$_GET["totalRows_WADAProducts"]:"")  ."";
Sign in to reply to this post

Joe Lowery

Thanks for the code, Jason. I made all the changes you suggested but I think something is off. The URL string in the address bar I see after updating is:

Products_Results.php?ProductID=59&pageNum_WADAProducts=1&totalRows_WADAProducts=45



Note the two "&" character entities. I changed those to just "&" and it worked. Thanks again.

Best - Joe

Sign in to reply to this post

Joe Lowery

This post has been deleted.

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...