Redirect a page

Results 1 to 3 of 3

Thread: Redirect a page

  1. #1
    csutton Guest

    Default Redirect a page

    Scenario is this:<BR>User selects an operation - EDIT or DELETE, they are then asked to login using their password, once the pass word has been checked they are redirected to the paget hey selected, that is either the EDIT page or the DELETE page. But it ain&#039t working, I keep getting the edit page.<BR><BR>Here is my code:<BR>Dim dbConnect, Classifieds, Query, Place<BR>ShowHeader "Login"<BR>On Error Resume Next<BR>set dbConnect= server.createobject("ADODB.Connection")<BR>dbConne ct.Open "DRIVER={Microsoft Access Driver (*.mdb)};DBQ=" & server.mappath("./classifieds.mdb")<BR>set Classifieds = Server.Createobject("ADODB.Recordset")<BR>Query="S ELECT item_id, password FROM items WHERE item_id=" & Request("itemid")<BR>Classifieds.Open Query,dbConnect<BR>If Classifieds("password") = Request("password") then<BR> If Request("Operation")=EDIT then<BR> Response.Redirect "editad.asp?itemid=" & Request("itemid")<BR> ElseIf Request("Operation")="DEL" Then <BR> Response.Redirect "delad.asp?itemid=" & Request("itemid")<BR> Else<BR> Response.Write("Internal Error. No valid Operation sent.&#060;p&#062;")<BR> End if<BR>Else<BR> Response.Write("Invalid password. Click Back to try again.&#060;p&#062;")<BR>End if<BR>If Err.Number &#060;&#062; O Then %&#062;<BR>There was an error in login.&#060;p&#062;<BR>Error #&#060;%=Err.Number %&#062;: &#060;%Err.Description%&#062;&#060;p&#062;<BR>&#06 0;%<BR>Classifieds.close<BR>set Classifieds = nothing<BR>dbConnect.close<BR>set dbConnect = nothing<BR> End if %&#062;<BR>&#060;% End if %&#062;

  2. #2
    TS Guest

    Default RE: Redirect a page

    You don&#039t have quotes around the word "EDIT", causing an error, and since there is "On Error Resume Next", the next statement is always executed.

  3. #3
    csutton Guest

    Default RE: Redirect a page

    I have put the quotes back and I get the following error:<BR><BR>Internal Error. No valid Operation sent.<BR>There was an error in login.<BR>Error #500: <BR><BR>Do I need to include "On Error Resume next" if so where??<BR><BR>Thanks <BR><BR>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts