Dealing with invalid query strings

I have created a mysql/php site with master and product detail pages. The product details are filtered via a url query string
e.g. domain/proddetail.php?productID=38
This all works fine except for the case when a product is deleted and the productID is no longer valid. Because Google continues to index these pages vsitors then get a page displaying no data .
How do I gracefully deal with these invalid productIDs? Preferbly I want to redirect to a error404 page so that Gogle delists but simply displaying a product not found notice would be better than nothing.
Thanks

In your proddetail.php page, test the recordset rowcount - if it is zero, redirect to your 404 page.

Similar Messages

  • Link with a query string

    I am having problems when placing a link to an .asp page with
    a query string in it. Here is the link:
    http://www.destaco.com/new_products.asp?loc=<%=Request.QueryString("loc")%>&lang=<%=Reques t.QueryString("lang")%>
    The developer I'm working with says that this link is not
    working for him. Any ideas? I did try replacing the " with ' around
    loc and lang, but that didn't seem to work. Any insights would be
    greatly appreciated. Thanks.

    You can't put asp code like that within Flash. If you have
    those same
    variables in Flash you can do this:
    on (release) {
    //Goto Webpage Behavior
    getURL("
    http://www.destaco.com/new_products.asp?loc"+loc+"&lang="+lang+",
    "_parent");
    //End Behavior
    Do you have those variables in Flash? Or, are you trying to
    pull them from
    the asp page?
    Dan Mode
    --> Adobe Community Expert
    *Flash Helps*
    http://www.smithmediafusion.com/blog/?cat=11
    *THE online Radio*
    http://www.tornadostream.com
    *Must Read*
    http://www.smithmediafusion.com/blog
    "Jim Switzer" <[email protected]> wrote in
    message
    news:eaq712$q83$[email protected]..
    > I'm putting this link on a button. Is that what you were
    asking? Here's
    > the
    > code on the button:
    >
    > on (release) {
    > //Goto Webpage Behavior
    >
    > getURL("
    http://www.destaco.com/new_products.asp?loc=<%=Request.QueryString('loc
    >
    ')%>&lang=<%=Request.QueryString('lang')%>",
    "_parent");
    > //End Behavior
    > }
    >
    > Let me know if that helps clarify this, or if you need
    more info. Thanks.
    >

  • Can you append a link to a form with a query string to popular a form field?

    I'm trying to do this with Form Central but having no luck getting an answer. Is Acrobat Pro the answer?
    Thanks for your help
    Wayne

    Hi Irosenth
    That looks a great solution. However, I'm a newbie here and can't see that Adobe Pro gives an option to save a form as a .fdf or .xfdf.
    BTW the headline should say POPULATE not popular (whatever that is).
    What I would like to do is send an email to every recipient with a link to a form appended with a query string that automatically completes the ID field. At this point I only have Adobe Pro and FormCentral. Should I be looking elsewhere. (I did try to phone Adobe UK yesterday but was on hold for 1hr 4mins before I had to continue with the rest of my life).
    Thanks for your help & time.
    Wayne

  • Why won't adobe deal with my query?

    why won't adobe deal with my query?

    What is your query?? We are not mind readers, just users of software like you.

  • Need Help With Java Query String

    I'm new to Java and I'm passing data via a URL to another page(I'm not using a form). I have been succesfull in decoding the string to return the name value below:
    <SCRIPT LANGUAGE="JavaScript">
    function decodeSearchString() {
    var nameValue = new Array();
    var searchStr = unescape(location.search.substring(1));
    if (searchStr) {
    var formElement = searchStr.split("&");
    var tmpArray = new Array();
    for (k = 0; k < formElement.length; k++) {
    tmpArray = formElement[k].split("=");
    nameValue[tmpArray[0]] = tmpArray[1];
    return nameValue
    var srchData = decodeSearchString();
    </SCRIPT>
    However, now I need to add the value returned from the above srcipt to the Java script listed below:
    <SCRIPT Language="Javascript" SRC="#srchData.link#?open&pID=PAR"> </SCRIPT>
    This above script if working will add the HTML from the URL query to the page, but I keep getting a Java Error with this script. Please Help !

    I assume you are using a JSP page and not just solely doing Javascript. IF you are using JSP, then read on. Otherwise, I can revisit your script.
    To obtain the value of the query string, you would use a method call such as:
    String strQuery = request.getQueryString()
    Or, to get a single parameter off the query string, you can call:
    String strSearchData = request.getParameter("paramname");
    Or, if you want all the parameters and values instead of just one long string you can call:
    Enumeration enumParamNames = request.getParameterNames();
    You can use the above enumeration in combination with getParameter() to get the values.
    In order to build your script line and add the query string, you would then do something like this:
    <SCRIPT Language="Javascript" SRC="#<%=strSearchData%>.link#?open&pID=PAR"> </SCRIPT>
    Notice the <%= %> block in the above code.
    I hope that is what you were looking for. Your example is somewhat confusing so I may have answered wrong.
    Mike

  • CiscoIPPhoneExecute with URL query strings

    Has anyone successfully used the CiscoIPPhoneExecute xml object with URLs that contain query strings? Specifically, I'm wondering how to pass query string values that include spaces.
    I'm able to successfully execute a URL such as:
    http://<webaddress>/PushPage.asp?Field1=Value1&Field2=Value2
    However, when I try to execute a URL like:
    http://<webaddress>/PushPage.asp?Field1=Value with space&Field2=Value2
    The phone displays an error message that says "Not Available", and the url that is pushed never gets executed.
    I have tried representing spaces in the query string values using both the conventional "+" symbol, and I have also tried using "%20". Neither of these escape sequences seems to work.
    Thanks for any advice.
    -Mike

    Thanks for the response. As I stated above, I know that ampersand (&) must be escaped, and I am properly escaping that character in the XML packets. I'm not having any problems pushing URLs that contain ampersand.
    What I can't figure out is how to push URLs with *SPACES* included in the query string values. Please see the example URLs I posted in my original message, specifically the second URL. Again, I omitted the necessary ampersand escape sequence there for clarity.
    -Mike

  • GET Method with long query string

    Hi there,
    Not sure if this has already been answered. Sorry if it has!
    I have a Biztalk application which does a pass-through for all http requests. It is using WCF-WebHttp transport type with URL mapping of /*.
    It works fine except for GET method that has query string longer than 256 characters. It chokes with following exception:
    The adapter "WCF-WebHttp" raised an error message. Details "System.ArgumentOutOfRangeException: The value of promoted property cannot exceed 256 characters. Property "To" Namespace "http://schemas.microsoft.com/BizTalk/2006/01/Adapters/WCF-properties".
    My question is is there a workaround for this e.g. extend the string length limit? 

    Hi Karsten,
    Try giving the one part of URL in address box and other pass the arguments inside HTTP Method and URL Mapping dialog.
    Eg:
    Address (URI) : https://btstecheddemostorage.blob.core.windows.net
    <BtsHttpUrlMapping>
    <Operation Name="ListFiles"
    Method="GET" Url="/{mycontainer}?restype=container&amp;comp=list"
    /> </BtsHttpUrlMapping>
    Thank YOu,
    Tamil

  • IOS 6 on 4s - how to deal with invalid server?

    I've just downloaded the iOS 6 to my iPhone 4s, trying to log in but says that the certificate for the server is invalid. Says, may be trying to "access a site pretending to be "setup.icloud.com" If I choose to skip the step it says that iCloud, iMessage and FaceTime may not be completely installed.
    Do I skip the step?

    Alban CAT, a family owned and operated caterpillar dealer, streamlines diagnostics and repair operations with Panasonic Toughbook computers. Read the full case studyhere.Challenge: Alban CAT required a new mobile computing solution to address hardware device failure and unreliable wireless connectivity in the field.Solution: Alban CAT deployed the fully-rugged Toughbook 31 and semi-rugged Toughbook 53 laptops – featuring rugged durability, embedded mobile broadband and unique enterprise – grade functionality – to its field workforce throughout the region.Result: After deploying the Panasonic Toughbook solution, Alban CAT technicians streamlined diagnostics and repair operations, improved customer service times, enhanced employee and customer satisfaction, and greatly reduced device failure.To learn more, take a look at the case study...

  • Dealing with an empty string parameter

    I'd think this should be simple but is driving me nuts. I have a string parameter (lets call it Foo) that is being passed from my C# application to a CR subreport. For this parameter field I have a formula associated with "Display String" similar to this:
    if (IsNull({?Foo}) or (length({?Foo}) = 0)) then
        "Value is empty"
    else
        "Value is " + {?Foo}
    I can never get the "Value is empty" line to appear! I've tried lots of suggestions:
    1. trim and check result equal to '' (two single quotes)
    2. test if equal to "".
    3. Adding false to Suppress.
    It appears that if this parameter is the empty string CR simply does nothing with my formulas and the entire parameter field is skipped.
    If I pass "null" (or any other special string) instead of "" from my C# code and then change the above test to check for that value as shown below things work properly.
            if (IsNull({?Foo}) or ({?Foo} = "null") then
    However I really don't like testing for a special string as there is the remote possibility that it could be the actual value of the parameter.
    Any help most appreciated.
    Dick

    Not surprised and willing to bet there will be a simple answer to this!
    There is something most odd happening when the string value is empty.
    Let me answer your questions.
    1 - How are you setting your parameter value?
    Since I want to be able to pass parameters to the base report as well as its subreports I'm using this method:
            protected void setParameter(string parameterName, object value)
                ParameterFields fields = report.ParameterFields;
                for (int i = 0; i < fields.Count; i++)
                    if (fields<i>.Name.Equals(parameterName))
                        string reportName = fields<i>.ReportName;
                        if (string.IsNullOrEmpty(reportName))
                        {   // give to base report
                            report.SetParameterValue(parameterName, value);
                        else
                        {   // give to subreport
                            report.SetParameterValue(parameterName, value, reportName);
    2 - What OS and service pack are you on?
    Windows XP, SP 3. All updates from MS installed.
    My development environment is either of these two:
    a. VS 2008. Version 9.0.30729.1 SP. ,NET Framework 3.5 SP1
    b. VS 2010 Version 4.0.30319
    3 - What platform are you targeting?
    For now just running on my XP PC but have tested our app on XP, Win7, and Vista. 32 and 64-bit version of each.
    4 - Is this a win or web form application? Win app
    5 - What is the version of your CrystalDecisions.CrystalReports.Engine?
    Version: 12.2.0.290, Product Type: Full
    6 - What is the version of crpe32.dll do you have on your machine?
    I only have one instance of this file in this directory:
         C:\Program Files\Business Objects\BusinessObjects Enterprise 12.0\win32_x86
    7 - Did you have one of our betas on this machine? No
    Edited by: dcowan on Dec 7, 2010 2:10 AM
    I needed to finish this so I'm closing it.
    In my C# code I placed the following:
                        if (string.IsNullOrEmpty(value))
                            value = "!_Empty_!";
    and in the CR formula I used:
           (IsNull({?CoBrandName}) or ({?CoBrandName} = "!_Empty_!"))
    Everything is now working just as I want. Not an ideal solution but I gave up.

  • HTTP Query String

    We use mod_plsql to create webpages. One annoying charactersitic of this framework is having to explicitly define all Query String parameters that a procedure could possibly accept.
    We have some jquery stuff we're developing that retrieves data from oracle using PL/SQL procedures over http (mostly XML formated, but we're also lookg at JSON). We have 1 tool we're exavluating that does this, but fails, and we don't know why...I think it's because it is sending some query string parameters that are undocumented and we're not getting any notice to what might be missing/sent.
    So, my question is, is there a way to tell what query string parameters are being passed to a procedure? Assuming it is failing by sending undefined parameters of course...

    oBean wrote:
    We use mod_plsql to create webpages. One annoying charactersitic of this framework is having to explicitly define all Query String parameters that a procedure could possibly accept.Why not use the 2 parameter call interface instead?
    You add an exclamation mark to the URL call to the procedure. E.g.
    instead of
    http://my-server.mydomain.com/orcl/scott.myproc?name=John&code=123
    the call is changed to the following:
    http://my-server.mydomain.com/orcl/!scott.myproc?name=John&code=123
    This instructs mod_plsql to pass the query string as name-value arrays. The signature of procedure SCOTT.MyProc will thus no longer look like this
    create or replace procedure MyProc( name vachar2, code number ) is ...
    But as follows:
    create or replace procedure MyProc( name_array owa_util.vc_arr, value_array owa_util.vc_arr ) is
    The procedure can now deal with variable query strings from the web browser.

  • How to get the original query string in an event receiver when dialogs are enabled

    I have scenario where I am adding a document to a document library which has an external data column on it. My goal for this column is to have it automatically populated with an appropriate value based on original query string to the page. The general
    idea is that I am on a custom page that has various webparts on it including a view of my document library that is context sensative based on the query string, and I want to use that context sensitivity not just to filter the list but also when adding documents.
    I have been searching around for solutions to this problem all day and have gotten this far:
    I have an event receiver attached to my document library that handles the ItemAdded event syncronously (as such I have the new list item available to me). In that event receiver I am able to set the column values as required. Where I am stuck is on getting
    the value from the query string that I need to actually set as the column value.
    Based on:
    http://social.technet.microsoft.com/Forums/en-US/sharepoint2010programming/thread/8cfcb299-9a55-4139-86ec-0b53b2922a54 and several similar articles/posts I have been able to get the original source Url with the query string I want via the following
    code in my event receiver:
    private HttpContext context;
    public EventReceiver1()
    context = HttpContext.Current;
    public override void ItemAdded(SPItemEventProperties properties)
    var originalQueryString = context.Request.QueryString["Source"];
    // Parse the query string and use the value ...
    The problem is that this solution breaks down if the dialogs are turned on under the advanced settings for the list. The reason the solution fails is because the "Source" query string parameter goes away and is replaced by "IsDlg" set to a value of "1".
    Does anyone know how to get past this hurdle? Any help would be greatly appreciated.

    Hi Stuart,
    The reason I'm looking for "Source" in the query string is because that is something I found to be reliable when the Dialogs are turned off. I've dug around pretty deep in the Request object to see if anything had the data I was looking for and unfortunately
    it doesn't appear to be there. The
    context.Request.QUeryString.ToString()
    returns a rather simple one of:
    List=%7b43ECDCB0-8440-4652-B067-AA20481779D7%7d&RootFolder=&IsDlg=1
    and the
    context.Request.UrlReferrer.Query.ToString()
    has the same value.
    I suspect this is due to the dual step process that takes place in adding an item to a document library where the first modal popup (which I suspect likely has the information I need) gives you the opportunity to browse to your file and then the second
    dialog (maybe this is getting brought up as a result of another request which is now referring back to the original request that brought up the first dialog?) where you edit your properties.
    Thanks for the try though, if you've got anything else I'd love to hear it.

  • How to pass multiple query string values using the same parameter in Query String (URL) Filter Web Part

    Hi,
    I want to pass multiple query string values using the same parameter in Query String (URL) Filter Web Part like mentioned below:
    http://server/pages/Default.aspx?Title=Arup&Title=Ratan
    But it always return those items whose "Title" value is "Arup". It is not returned any items whose "Title" is "Ratan".
    I have followed the
    http://office.microsoft.com/en-us/sharepointserver/HA102509991033.aspx#1
    Please suggest me.
    Thanks | Arup
    THanks! Arup R(MCTS)
    SucCeSS DoEs NOT MatTer.

    Hi DH, sorry for not being clear.
    It works when I create the connection from that web part that you want to be connected with the Query String Filter Web part. So let's say you created a web part page. Then you could connect a parameterized Excel Workbook to an Excel Web Access Web Part
    (or a Performance Point Dashboard etc.) and you insert it into your page and add
    a Query String Filter Web Part . Then you can connect them by editing the Query String Filter Web Part but also by editing the Excel Web Access Web Part. And only when I created from the latter it worked
    with multiple values for one parameter. If you have any more questions let me know. See you, Ingo

  • XSl formula for pulling values based on parameters or query strings

    Hello,
    I have a custom list in SharePoint
    List Column/Fields (any time a new item is created these are the fields that need values)
    Machine = ID2
    SpecLabel = text string value
    SpecValue = text string value
    Using DataFormWebPart
    I Filter values by Machine by creating a parameter with a query string as its source.
    And pull the values
    <xsl:value-of select="@SpecLabel" />
    <xsl:value-of select="@SpecValue" />
    On the browser I add the parameter to the URL sting to filter each machine ID.
    ?=Machine=1
    Back in the XSL i use the same parameter to pull the value of the string as my header title.
    <xsl:value-of select="$paramMachine"/>
    Problem
    I need a formula that will pull just the the SpecValue data for a specific item.
    Example: I have thee items below and I need to just pull the “SpecValue” for the Built Year which is 2014.
    Machine = 1
    SpecLabel = Speed
    SpecValue = 10
    Machine = 1
    SpecLabel = Color
    SpecValue = Red
    Machine = 1
    SpecLabel = Built YearSpecValue = 2014
    Any Suggestion? 

    Hi,
    According to your post, my understanding is that you wanted to the formula to filter a list item.
    You can create the formula similar like below.
    <xsl:variable name="Rows" select="/dsQueryResponse/Rows/Row[@City = 'Abington']"/>
    More reference:
    http://sympmarc.com/2011/08/15/compound-filtering-in-data-view-web-parts-dvwps-with-sharepoint-designer/
    http://blog.jussipalo.com/2012/01/sharepoint-filter-data-form-web-part.html
    Thanks & Regards,
    Jason
    Jason Guo
    TechNet Community Support

  • Example to use Query String in Oracle Access Manager Policy.

    Hi All,
    Can any one please tell me what is the use of Query String and Query String Variable in OAM Policy?
    If possible please explain with a sample example.
    Thanks in Advance.
    Siva Pokuri.

    Query string is used to protect URL with complete query string.
    Ex: in case you want to protect http://hi.com/first.html?uid=abc&pqr=123 URL then you will specify query string as uid=abc&pqr=123.
    In case you want to protect a URL with one of the query parameter as xyz and you do not care of other query parameters, then query string variables are used.
    Ex: in case you want to protect http://hi.com/first.html?uid=abc&pqr=123 and http://hi.com/first.html?uid=abc&pqr=456 both with same policy then you will create a policy to protect first.html and in query string variables you will specify uid=abc.
    Let me know if you have any problems in understanding this.
    Thanks
    Kiran Thakkar

  • How can I use today's date as default value in query string filter web part in SharePoint

    I have a query string filter on my web part page. I am trying to figure out how I can set it's default value to Today? I can't find anything online...

    Hi,
    Per my understanding, you might want to set a default value to the Query String Filter Web Part.
    It would not be able to set default value to the Query String Filter Web Part with the OOTB features available.
    By default, with a Query String Filter Web Part in the current page, we can filter other web part in the same page by adding parameters and values in the address bar
    of browser.
    If setting the “Query String Parameter Name” of a Query String Filter Web Part as “t”, then we can filter the corresponding connected web part by inputting such an
    URL into the address bar:
    http://sharepoint/SitePages/Page1.aspx?t=value1
    Suppose you want to filter the list view with a value dynamically when user opens this page, as a workaround, we can generate an URL with the parameters needed when
    page loaded, then redirect user to this URL afterwards. This can be achieved using JavaScript.
    About how to redirect user to other page with an URL:
    http://www.tizag.com/javascriptT/javascriptredirect.php
    How to get today’s date using JavaScript:
    http://www.w3schools.com/js/js_dates.asp
    Best regards      
    Patrick Liang
    TechNet Community Support

Maybe you are looking for

  • Passing comma "," to a report parameter using URL reporting

    I have a simple report, which contains a string parameter.  Everything work fine, except when I pass a string with "," in the parameter value. I tryed the following url and both of them does not work, I also modify the report to display the pass-in p

  • Spool filename that contains spaces

    Hi Folks, Does anyone know a technique for creating spool files that contain spaces in the path name? I have a script that I want to pass in a directory path as a parameter. The script then uses this directory as the path for dynamically created scri

  • Everytime I try to copy and paste, Firefox stops responding. Why?

    Ever since I updated to the latest version of Firefox, if I try to copy and paste anything, Firefox stops responding. If I try to paste in another program such as Skype or AIM, that program stops responding too. What can I do to stop this?

  • Powershell New-object Command not reconized am i missing a module?

    I want to configure high trusted app for app dev in SharePoint, end to do so i need first to insert some commands in the powershell editor like :     $publicCertPath = "C:\Certs\HighTrustSampleCert.cer"      $certificate = New-Object System.Security.

  • Sleep problems with a MacBookPro6,2 with OSX 10.6.7

    Hi everybody, I'm yet another pal with sleep problems on my MacBookPro6,2 (Core i5 mid 2010). After a few hours of activity it refuses to sleep. It just wakes instantly, with the same info on the kernel.log as many other are seeing on theirs: ==> /va