?
Solved

Very EASY question

Posted on 2000-03-21
3
Medium Priority
?
145 Views
Last Modified: 2013-12-25
I want to test a variable if it has got characters in it. Somehow this doesn't work. Can someone provide me with the correct code ?

if $form{$key}='' {
 print "allright";

  }
0
Comment
Question by:oostwijk
[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
3 Comments
 

Author Comment

by:oostwijk
ID: 2642244
I ment to say:

if $form{$key}="" {
 print "allright";
  }
0
 
LVL 16

Accepted Solution

by:
maneshr earned 100 total points
ID: 2642273
try this....

if ($form{$key}){ ## Key DOES have a value in it!!
  print "All right\n";
}else{
   print "Empty :-( \n";
}
0
 

Author Comment

by:oostwijk
ID: 2651343
Ok, that works fine...
0

Featured Post

Get 15 Days FREE Full-Featured Trial

Benefit from a mission critical IT monitoring with Monitis Premium or get it FREE for your entry level monitoring needs.
-Over 200,000 users
-More than 300,000 websites monitored
-Used in 197 countries
-Recommended by 98% of users

Question has a verified solution.

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

This tutorial will discuss the log-in process using WhizBase. In this article I assume you already know HTML. I will write the code using WhizBase Server Pages, so you need to know some basics in WBSP (you might look at some of my other articles abo…
Making a simple AJAX shopping cart Couple years ago I made my first shopping cart, I used iframe and JavaScript, it was very good at that time, there were no sessions or AJAX, I used cookies on clients machine. Today we have more advanced techno…
Learn the basics of while and for loops in Python.  while loops are used for testing while, or until, a condition is met: The structure of a while loop is as follows:     while <condition>:         do something         repeate: The break statement m…
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.
Suggested Courses

777 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