?
Solved

check if variable is set

Posted on 2004-09-21
4
Medium Priority
?
211 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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Have you ever needed to get an ASP script to wait for a while? I have, just to let something else happen. Or in my case, to allow other stuff to happen while I was murdering my MySQL database with an update. The Original Issue This was written…
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…
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…
Suggested Courses

762 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