Redirect in Webspeed

Posted by Admin on 10-May-2007 07:51

Hi everyone,

I am new to Webspeed i have a question here how can we redirect from one page to another, i tried using RUN but it does not redirect it actually executes the page and hence the url does not changes. For eg in ASP we have response.redirect.

Thank You.

All Replies

Posted by Admin on 26-Jun-2007 07:18

You can redirect using an html meta tag. For example:

'' skip.

Posted by Admin on 02-Oct-2007 04:36

hello

you can do this with following statment :

code put in the process-web-request of Sample1.w (GET)

RUN run-web-object IN web-utilities-hdl (INPUT ("sample2.w") ).

the path to your .w files is from the broker root directory.

Posted by Admin on 06-Jan-2010 11:55

Hi there, im new with speedscript and im tring to figure out how to invoke o redirect to a diferent url from my speedScript code.

The sample you posted worked properly but it includes the url target on the same page that execute the code.

Im looking for a function to avoid javascript : document.location="nextStep.html?user=me";

I think output-http-headers could be usefull but i cannot understand how it works.

Do you know if there is alredy a function to perform this action?

Thank you in advance.

Best Regards!

Israel M.!

Posted by Admin on 06-Jan-2010 17:06

Try this one:

{&OUT} 'url=targetPage.html">'

Posted by Admin on 06-Jan-2010 17:10

I Found this way to redirect:

output-http-header ("Status":U, "302 Redirect":U).

output-http-header ("Location":U, "target.html":U).

output-http-header ("", "").

All them should be together and you must use them before print anything on screen so they can take effect.

If anyone knows about a diferent way to redirect pls let me know.

Best Regards!

Israel M,

Posted by Matt Baker on 06-Jan-2010 18:48

You are doing it correctly.  You would preferrably just use "{&out} skip." instead of outputting a blank header to output the required blank line after the headers.

Posted by Admin on 08-Jan-2010 11:02

I forgot to mention i am working under html frames.

i have investigated and i didn't found anything useful about redirecting under frames, i think it´s not posible at least with webspeed.

I mixed webSpeed And JavaScript to perform the redirection to be able to pass http vars.

"SpeedScript">

  /* If delete confirmed */

   IF GET-VALUE("delConfirmed") = "true" THEN DO:
  /* Here delete Statements */



"javaScript">
// Redirecting after perform an action.
location.href="myTargetPage.html?var1=1&var2=2&var3=3";


"SpeedScript">
 
  LEAVE. /*Stop Program Execution*/
  END.


  /* deletion routine finished */

I hope this code can be useful for someone that have the same trouble redirecting under html frames.

Thank's for your time & help.

Best Regards!

Israel M.

This thread is closed