You do want slashes, and not backslashes. What matters here isn't the path conventions of your native platform. HTML is supposted to be immune to such things. What matters is the conventions of URIs, and those use slashes. IE will clean up this bad HTML for you and guess at what you actualy meant to say, Netscape won't. (I consider this somthing netscape does right. It's arguable that IE does it right, and NS gets it wrong. In any case, the correct answer is to use slashes.)
Also, backslashes have special meaning in double-quotes -- they make the next character be interpreted as "special". (They escape into a magical world. The two-character sequence is thus caled an escape sequence.) Try print "\Admin" from the command-line; you'll notice that it prints Admin, not \Admin. If you were using warnings (and why aren't you, and strict too?), you'd get a "Unrecognized escape \A passed through", because it doesn't recognize "\A" as a valid escape, and assumes you meant A.
Use "\\Admin" ("\\" is an escape sequence for a plain backslash), or '\Admin' (backslashes aren't special (most of the time) in single quotes).
This is explained in perlop, under "quotelike operators".
Warning: Unless otherwise stated, code is untested. Do not use without understanding. Code is posted in the hopes it is useful, but without warranty. All copyrights are relinquished into the public domain unless otherwise stated. I am not an angel. I am capable of error, and err on a fairly regular basis. If I made a mistake, please let me know (such as by replying to this node).
| [reply] [d/l] |
Thanks for your help! I've sorted it out now. The initial problem wasn't actually in the redirection script but the form itself! I had it all in backslashes.Cheers
r_mehmed
novice
| [reply] |
Actually, what you want is to redirect to the absolute URI (see http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.30). So that would mean that you will need something that looks like "http://www.somehost.com/path/to/Admin/"...Basically it should be everything that would otherwise be typed into the browser's location bar.
| [reply] |
It's also likely you'll need the full path (should always include that just in case anyway).
My code doesn't have bugs, it just develops random features.
Flame ~ Lead Programmer: GMS | GMS | [reply] |
print $q->redirect( "/Admin" );
Make sure the case is correct, too. | [reply] [d/l] |