[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now

x
?
Solved

check if variable is set

Posted on 2004-09-21
4
Medium Priority
?
213 Views
Last Modified: 2008-01-09
I'm working on something which I am sure is very simple to do in asp but as I'm a php person I'm a bit stuck.

I've got most of what I need but I have to get the script working so that a form's action is the existing page when the submit button is pressed.

In php I would use if (isset ($var)){ } but what is the equivalent in php?
0
Comment
Question by:richardwhit
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 3

Accepted Solution

by:
WhisperUK earned 375 total points
ID: 12110681
Forgive me if I'm misunderstanding you here but I assume that you mean the current page is "default.asp" & you're form is posting to "default.asp". If that's the case then try this.....

<%
  ' Check if variable has been set
  If isNull(request.form("var")) OR request.form("var") = ""  THEN
     ' Variable has not been set or is an empty string
  End If
%>

Hope that helps

0
 

Author Comment

by:richardwhit
ID: 12110706
Yep that looks like it might be what I'm looking for. Sorry my question wasn't very well worded, thats what staring at a computer screen for too long does to you!
0
 
LVL 3

Expert Comment

by:WhisperUK
ID: 12110718
lol - yep i know exactly what you mean
0
 
LVL 7

Expert Comment

by:kmorris1186
ID: 12112396
Here is somthing i like to do when i am posting to teh same site since all the vars will be null before you post...

submit = request.form("Submit")
Var1 = Request.form("Var1")

If Submit = "submit" then
     'then do all other code
end if
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I recently decide that I needed a way to make my pages scream on the net.   While searching around how I can accomplish this I stumbled across a great article that stated "minimize the server requests." I got to thinking, hey, I use more than one…
I was asked about the differences between classic ASP and ASP.NET, so let me put them down here, for reference: Let's make the introductions... Classic ASP was launched by Microsoft in 1998 and dynamically generate web pages upon user interact…
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…
Please read the paragraph below before following the instructions in the video — there are important caveats in the paragraph that I did not mention in the video. If your PaperPort 12 or PaperPort 14 is failing to start, or crashing, or hanging, …

650 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question