Help | Site Map
Connecting Tech Pros Worldwide
 
 
LinkBack Thread Tools
  #1  
Old July 19th, 2005, 09:20 AM
Aaron
Guest
 
Posts: n/a
Default Performance Question...

hello. i have the following in a form that submits to itself ...

<%
dim page, strurl, strurldesc
page = trim(request.servervariables("script_name"))
strurl = trim(request.form("strurl"))
strurldesc = trim(request.form("strurldesc"))

if request.totalbytes > 0 then
savelink strurl, session("uid"), strurldesc
%>
<script>
window.opener.navigate(window.opener.document.loca tion.href);
window.close();
</script>
<%
end if
%>

<form name="Form" action="<%=page%>" method="post">
<snip />
</form>

Is this 'alright', or is there a better method for submitting the form
to itself?

  #2  
Old July 19th, 2005, 09:20 AM
Aaron Bertrand - MVP
Guest
 
Posts: n/a
Default Re: Performance Question...

You can leave out the action altogether, and save the hassle of figuring out
the URL. A form without an action submits to itself...



"Aaron" <a@1.net> wrote in message
news:uWQmnBvnDHA.424@TK2MSFTNGP10.phx.gbl...[color=blue]
> hello. i have the following in a form that submits to itself ...
>
> <%
> dim page, strurl, strurldesc
> page = trim(request.servervariables("script_name"))
> strurl = trim(request.form("strurl"))
> strurldesc = trim(request.form("strurldesc"))
>
> if request.totalbytes > 0 then
> savelink strurl, session("uid"), strurldesc
> %>
> <script>
> window.opener.navigate(window.opener.document.loca tion.href);
> window.close();
> </script>
> <%
> end if
> %>
>
> <form name="Form" action="<%=page%>" method="post">
> <snip />
> </form>
>
> Is this 'alright', or is there a better method for submitting the form
> to itself?
>[/color]


  #3  
Old July 19th, 2005, 09:20 AM
Ray at
Guest
 
Posts: n/a
Default Re: Performance Question...

Just be aware of what happens if you're on the directory's default page when
you do this, ie. http://yoursite.com/ If there's no pagename in the url,
you'll get a 405 when you post.

Ray at work

"Aaron Bertrand - MVP" <aaron@TRASHaspfaq.com> wrote in message
news:uUkZ$evnDHA.2820@TK2MSFTNGP10.phx.gbl...[color=blue]
> You can leave out the action altogether, and save the hassle of figuring[/color]
out[color=blue]
> the URL. A form without an action submits to itself...
>
>
>
> "Aaron" <a@1.net> wrote in message
> news:uWQmnBvnDHA.424@TK2MSFTNGP10.phx.gbl...[color=green]
> > hello. i have the following in a form that submits to itself ...
> >
> > <%
> > dim page, strurl, strurldesc
> > page = trim(request.servervariables("script_name"))
> > strurl = trim(request.form("strurl"))
> > strurldesc = trim(request.form("strurldesc"))
> >
> > if request.totalbytes > 0 then
> > savelink strurl, session("uid"), strurldesc
> > %>[/color][/color]


  #4  
Old July 19th, 2005, 09:20 AM
Aaron Bertrand - MVP
Guest
 
Posts: n/a
Default Re: Performance Question...

> Just be aware of what happens if you're on the directory's default page
when[color=blue]
> you do this, ie. http://yoursite.com/ If there's no pagename in the url,
> you'll get a 405 when you post.[/color]

True, if you know your form is on the default page, you can just hardcode /
or even http://yoursite.com/ ... still without having to futz with all that
servervariable parsing.

A


 

Bookmarks

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over network members.
Post your question now . . .
It's fast and it's free

Popular Articles