Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Deleting URL Parameters

New Here ,
Feb 25, 2009 Feb 25, 2009
Hey,
I have a number of drill-down pages that pass URL parameters to get the relevant detail for the previous page. The only trouble is this leads to a long URL path of parameters. Is there any way I can remove them as you drill down?
TOPICS
Server side applications
510
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Feb 25, 2009 Feb 25, 2009
kliq316 wrote:
> Hey,
> I have a number of drill-down pages that pass URL parameters to get the
> relevant detail for the previous page. The only trouble is this leads to a long
> URL path of parameters. Is there any way I can remove them as you drill down?

It will depend on how you have your links set up, but all you should need to do is to pass along only the query string parameters that you want to pass along, and not the entire query string. Please post a link to your page and someone might be able to suggest a better way to do this in your specific case.

A PHP example to only pass along a query string parameter named "ID":
<a href="detail.php?ID=<?php (isset($_GET['ID'])?$_GET['ID']:'') ?>" >View item</a>

The link code would be a little bit different depending on the source of the ID value, such as from a recordset or session variable, but the concept is the same.

--
Danilo Celic
| http://blog.extensioneering.com/
| WebAssist Extensioneer
| Adobe Community Expert
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Feb 25, 2009 Feb 25, 2009
kliq316 wrote:
> Hey,
> I have a number of drill-down pages that pass URL parameters to get the
> relevant detail for the previous page. The only trouble is this leads to a long
> URL path of parameters. Is there any way I can remove them as you drill down?

One other thing to consider, if it works, why does the length of the URL path really matter?

--
Danilo Celic
| http://blog.extensioneering.com/
| WebAssist Extensioneer
| Adobe Community Expert
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Feb 26, 2009 Feb 26, 2009
Here's the code: (I can't leave it as it is, as when i submit an update record to diverts to the summary page, still carrying the addressID, so if you click on another ID it doesn't work).

It's the lngAddressID that I don't want to carry over.

' append the query string to the redirect URL
Dim MM_editRedirectUrl
MM_editRedirectUrl = "address.asp"
If (Request.QueryString <> "") Then
If (InStr(1, MM_editRedirectUrl, "?", vbTextCompare) = 0) Then
MM_editRedirectUrl = MM_editRedirectUrl & "?" & Request.QueryString
Else
MM_editRedirectUrl = MM_editRedirectUrl & "&" & Request.QueryString
End If
End If
Response.Redirect(MM_editRedirectUrl)
End If
End If
%>
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Feb 26, 2009 Feb 26, 2009
LATEST
kliq316 wrote:
> Here's the code: (I can't leave it as it is, as when i submit an update record
> to diverts to the summary page, still carrying the addressID, so if you click
> on another ID it doesn't work).
>
> It's the lngAddressID that I don't want to carry over.

The code you supplied isn't being used in passing along the query string that you are trying to work around. However, by stating that you're using an update record, I believe that the built in Dreamweaver Update (and Insert) Server Behavior will pass along the query string of the current page. If you are using the Dreamweaver Update Server Behavior, then in the code, you will have something similar to the following:


' append the query string to the redirect URL
Dim MM_editRedirectUrl
MM_editRedirectUrl = "summary.asp"
If (Request.QueryString <> "") Then
If (InStr(1, MM_editRedirectUrl, "?", vbTextCompare) = 0) Then
MM_editRedirectUrl = MM_editRedirectUrl & "?" & Request.QueryString
Else
MM_editRedirectUrl = MM_editRedirectUrl & "&" & Request.QueryString
End If
End If
Response.Redirect(MM_editRedirectUrl)


If you comment out using a single quote at the beginning of the :
MM_editRedirectUrl = MM_editRedirectUrl & "?" & Request.QueryString
and:
MM_editRedirectUrl = MM_editRedirectUrl & "&" & Request.QueryString

Then that will cause the Query String to not be passed along. Making this edit may cause the Update Record to disappear from the Server Behaviors panel, so you'd have to remember to undo that change when you want to make edits to the Update Record settings (such as adding a new field to be updated) and then re-comment out those lines.

Or you can take a look at the opening tag of your form, it should look similar to:
<form action="<%=MM_editAction%>" method="POST" name="form1" id="form1">

Notice the action attribute, if you make the action empty: action="" the it may be that the query string won't be passed along after the Update occurs. Doing this will cause the Update record appear with a red exclamation mark. Making any edits to the Update Record will reapply the action value, so you'll need to remember to remove it after edits.

This second option may be a little better than the commenting out solution mentioned above as it only adds the exclamation mark rather than disappearing from the Server Behaviors panel entirely, but both will require attention if you ever make any edits to the Server Behavior.


PS: Make sure you read through ( and understand) all of the code that Dreamweaver applies to your page so that you can make modifications when you need to do something more (or different) than the stock code.




--
Danilo Celic
| http://blog.extensioneering.com/
| WebAssist Extensioneer
| Adobe Community Expert
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines