473,394 Members | 1,742 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

Know in ASP that it is the first time calling.

Hello,
I want to know, wheter an asp (that call itself in "get" method, has passed
any parameter to itself).

i.e :
in the asp : test_asp.asp :
.....

<html>
<body>
<form action="test_asp.asp" method="get">
num : <input type="text" name="my_num" size="3"> <br>
<input type="submit" value="Submit">
</form>
<%
response.write("this is my input : " & Request.QueryString("my_num"))
' ... but I want the above will write the input also if it is empty = ""
' ... and also I want to check, whether it is the first time running the asp
(there is no queryString (count of it = 0))
' .... , so How can I do that ?
%>
</body>
</html>

....
Thanks :)
Jul 22 '05 #1
10 1577
CJM
w3schools.com
Jul 22 '05 #2
"Eitan" wrote in message news:ec*****************@TK2MSFTNGP09.phx.gbl...
: Hello,
: I want to know, wheter an asp (that call itself in "get" method, has
passed
: any parameter to itself).
:
: i.e :
: in the asp : test_asp.asp :
: ....
:
: <html>
: <body>
: <form action="test_asp.asp" method="get">
: num : <input type="text" name="my_num" size="3"> <br>
: <input type="submit" value="Submit">
: </form>
: <%
: response.write("this is my input : " & Request.QueryString("my_num"))
: ' ... but I want the above will write the input also if it is empty = ""
: ' ... and also I want to check, whether it is the first time running the
asp
: (there is no queryString (count of it = 0))
: ' .... , so How can I do that ?
: %>
: </body>
: </html>

How about name for that form? How can one write empty input? You can test
if it is the first time by setting a session variable and testing for it, a
hidden form element and posting and testing for that, etc.

--
Roland Hall
/* This information is distributed in the hope that it will be useful, but
without any warranty; without even the implied warranty of merchantability
or fitness for a particular purpose. */
Technet Script Center - http://www.microsoft.com/technet/scriptcenter/
WSH 5.6 Documentation - http://msdn.microsoft.com/downloads/list/webdev.asp
MSDN Library - http://msdn.microsoft.com/library/default.asp
Jul 22 '05 #3

Eitan wrote:
Hello,
I want to know, wheter an asp (that call itself in "get" method, has passed any parameter to itself).

i.e :
in the asp : test_asp.asp :
....

<html>
<body>
<form action="test_asp.asp" method="get">
num : <input type="text" name="my_num" size="3"> <br>
<input type="submit" value="Submit">
</form>
<%
response.write("this is my input : " & Request.QueryString("my_num"))
' ... but I want the above will write the input also if it is empty = "" ' ... and also I want to check, whether it is the first time running the asp (there is no queryString (count of it = 0))
' .... , so How can I do that ?
%>


Put a hidden field in the form. If that field has a value (of whatever
value you set it to in the form), you know the form got posted.
Why use GET in the first place, however?

Jul 22 '05 #4
....
How can I put a hidden field in the form.
Give me some sample code, please.

Thanks :)

<la**********@yahoo.com> wrote in message
news:11**********************@z14g2000cwz.googlegr oups.com...

Eitan wrote:
Hello,
I want to know, wheter an asp (that call itself in "get" method, has

passed
any parameter to itself).

i.e :
in the asp : test_asp.asp :
....

<html>
<body>
<form action="test_asp.asp" method="get">
num : <input type="text" name="my_num" size="3"> <br>
<input type="submit" value="Submit">
</form>
<%
response.write("this is my input : " & Request.QueryString("my_num"))
' ... but I want the above will write the input also if it is empty =

""
' ... and also I want to check, whether it is the first time running

the asp
(there is no queryString (count of it = 0))
' .... , so How can I do that ?
%>


Put a hidden field in the form. If that field has a value (of whatever
value you set it to in the form), you know the form got posted.
Why use GET in the first place, however?

Jul 22 '05 #5
Put something like <input type="hidden" name="postback" value="true"> in
your form

and on the script section of your file check for:

If Request.Form("postback") Then
'here goes your code if this page was posting to itself
End If

Regards
Sven

"Eitan" <no_spam_please@nospam_please.com> skrev i meddelandet
news:OV****************@TK2MSFTNGP15.phx.gbl...
...
How can I put a hidden field in the form.
Give me some sample code, please.

Thanks :)

<la**********@yahoo.com> wrote in message
news:11**********************@z14g2000cwz.googlegr oups.com...

Eitan wrote:
> Hello,
> I want to know, wheter an asp (that call itself in "get" method, has

passed
> any parameter to itself).
>
> i.e :
> in the asp : test_asp.asp :
> ....
>
> <html>
> <body>
> <form action="test_asp.asp" method="get">
> num : <input type="text" name="my_num" size="3"> <br>
> <input type="submit" value="Submit">
> </form>
> <%
> response.write("this is my input : " & Request.QueryString("my_num"))
> ' ... but I want the above will write the input also if it is empty =

""
> ' ... and also I want to check, whether it is the first time running

the asp
> (there is no queryString (count of it = 0))
> ' .... , so How can I do that ?
> %>


Put a hidden field in the form. If that field has a value (of whatever
value you set it to in the form), you know the form got posted.
Why use GET in the first place, however?


Jul 22 '05 #6

Sven Pernils wrote:
Put something like <input type="hidden" name="postback" value="true"> in your form

and on the script section of your file check for:

If Request.Form("postback") Then
'here goes your code if this page was posting to itself
End If


Eitan, also know that since you're using a GET, someone could spoof the
value of postback in the URL. You really should use a POST.

Jul 22 '05 #7
la**********@yahoo.com wrote:
Eitan, also know that since you're using a GET, someone could spoof
the value of postback in the URL. You really should use a POST.


Are you suggesting that POST cannot be spoofed?

--
Dave Anderson

Unsolicited commercial email will be read at a cost of $500 per message. Use
of this email address implies consent to these terms. Please do not contact
me directly or ask me to contact you directly for assistance. If your
question is worth asking, it's worth posting.
Jul 22 '05 #8
Well spoofing the post method is a lot harder as it can't be seen in the URL
Secondly, you can put a lot more data in the post method

Conclution, everything can be spoofed, if there's a reason to spoof

Sven Pernils

"Dave Anderson" <GT**********@spammotel.com> skrev i meddelandet
news:%2****************@TK2MSFTNGP11.phx.gbl...
la**********@yahoo.com wrote:
Eitan, also know that since you're using a GET, someone could spoof
the value of postback in the URL. You really should use a POST.


Are you suggesting that POST cannot be spoofed?

--
Dave Anderson

Unsolicited commercial email will be read at a cost of $500 per message.
Use
of this email address implies consent to these terms. Please do not
contact
me directly or ask me to contact you directly for assistance. If your
question is worth asking, it's worth posting.

Jul 22 '05 #9
"Sven Pernils" wrote in message
news:%2******************@TK2MSFTNGP12.phx.gbl...
: Well spoofing the post method is a lot harder as it can't be seen in the
URL
: Secondly, you can put a lot more data in the post method
:
: Conclution, everything can be spoofed, if there's a reason to spoof
:
: Sven Pernils

But you can have code to catch their attempts and redirect them.
http://kiddanger.com/lab/rejected.asp

If you post from my site, I respond with a message.
If you post this form from another site, I respond with a different message.

--
Roland Hall
/* This information is distributed in the hope that it will be useful, but
without any warranty; without even the implied warranty of merchantability
or fitness for a particular purpose. */
Technet Script Center - http://www.microsoft.com/technet/scriptcenter/
WSH 5.6 Documentation - http://msdn.microsoft.com/downloads/list/webdev.asp
MSDN Library - http://msdn.microsoft.com/library/default.asp
Jul 22 '05 #10
Sven Pernils wrote:
Well spoofing the post method is a lot harder as it can't be seen in
the URL Secondly, you can put a lot more data in the post method
Any application that depends on client-side security is already broken.

Conclution, everything can be spoofed, if there's a reason to spoof


Try spoofing a one-time pad sometime.
http://www.ciphersbyritter.com/GLOSS...PerfectSecrecy

--
Dave Anderson

Unsolicited commercial email will be read at a cost of $500 per message. Use
of this email address implies consent to these terms. Please do not contact
me directly or ask me to contact you directly for assistance. If your
question is worth asking, it's worth posting.
Jul 22 '05 #11

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

36
by: invni | last post by:
I have a nested while. How do I go from the inner while to the beginning of the outer while? Can this be done without using goto? while_1() { some codes here while_2() { if true go to the...
4
by: Steven Nagy | last post by:
Hi Have a problem that consistantly occurs in my applications where using a DataAdapter (OLEDB) and a dataset. Using a simple process of adding a row to the dataset table and then calling the...
161
by: KraftDiner | last post by:
I was under the assumption that everything in python was a refrence... so if I code this: lst = for i in lst: if i==2: i = 4 print lst I though the contents of lst would be modified.....
18
by: ben.carbery | last post by:
Hi, I have just written a simple program to get me started in C that calculates the number of days since your birthdate. One thing that confuses me about the program (even though it works) is...
37
by: jht5945 | last post by:
For example I wrote a function: function Func() { // do something } we can call it like: var obj = new Func(); // call it as a constructor or var result = Func(); // call it as...
12
by: semedao | last post by:
Hi all, someone know if I can use the IAsyncResult.IsCompleted Property of IAsyncResult that return from Socket.Beginxxx methods to determine if the Endxxx method already called perior or not ? I...
6
by: Doug Ferguson | last post by:
I am using a webservice client that was created from a WSDL file in .Net 1.1. The client ALWAYS works the first time I call it. The second call returns one of two exceptions. It either returns...
7
by: ArizonaJohn | last post by:
Hello, On my site, a user enters a value into a form, and if that value is not in my database, the code below is meant to give the user the message "The topic "value" has not been added. Add the...
3
by: hsachdevah | last post by:
Hi, I am creating a c# windows application. And I am calling a form on a menu item click which contains MS-ChartControl. My problem is that when this form opens for the first time, it take...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.