freelanceprogrammers.org Forum Index » PHP
Newbi PHPer Here
Joined: 22 Jan 2006
Posts: 1
Newbi PHPer Here
Hello everyone, I am newbie to PHP progamming and I am having some
trouble with a script I just wrote while learning php. I am running
this script on ISS server with PHP 4.4. I put the script below, but
also wanted to say hello to everyone. I am middle school technology
education teacher, an avid woodworker, webpage designer, and now php
programmer. I am hoping that someone can point out the issue with
this script, and I do have register_global in my php.ini file set to
off. I am getting a undefined varibale error on the $counter
variable. The script is below. Thanks everyone.
09 <?
10 $counter == 0;
11 if ($counter > 10) {
12 print $counter;
13 print "<br>";
14 }
15 ?>
Line # reference I think might help everyone
David Weeks
aka The Young Shop Teacher
Joined: 16 Jan 2006
Posts: 3
Newbi PHPer Here
hi,
i think
$counter == 0;
should be
$counter = 0;
to initialize $counter variable
teacherweeks <teacherweeks@...> wrote: Hello everyone, I am newbie to
PHP progamming and I am having some
trouble with a script I just wrote while learning php. I am running
this script on ISS server with PHP 4.4. I put the script below, but
also wanted to say hello to everyone. I am middle school technology
education teacher, an avid woodworker, webpage designer, and now php
programmer. I am hoping that someone can point out the issue with
this script, and I do have register_global in my php.ini file set to
off. I am getting a undefined varibale error on the $counter
variable. The script is below. Thanks everyone.
09 <?
10 $counter == 0;
11 if ($counter > 10) {
12 print $counter;
13 print "<br>";
14 }
15 ?>
Line # reference I think might help everyone
David Weeks
aka The Young Shop Teacher
PHP Data object relational mapping generator
http://www.metastorage.net/
SPONSORED LINKS
Programming languages
Object oriented programming Php developer
Computer security C programming language
Computer programming languages
---------------------------------
YAHOO! GROUPS LINKS
Visit your group "php-objects" on the web.
To unsubscribe from this group, send an email to:
php-objects-unsubscribe@yahoogroups.com
Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.
---------------------------------
for high quality perfumes, visit http://geocities.com/jary_n
---------------------------------
Yahoo! Photos – Showcase holiday pictures in hardcover
Photo Books. You design it and we’ll bind it!
[Non-text portions of this message have been removed]
Joined: 12 May 2005
Posts: 12
Newbi PHPer Here
"==" is a comparison operator, you want "=" which is an assignment
operator.
change $counter == 0; to $counter = 0;
Good luck.
Urb
At 11:59 PM 1/21/06, you wrote:
>Hello everyone, I am newbie to PHP progamming and I am having some
>trouble with a script I just wrote while learning php. I am running
>this script on ISS server with PHP 4.4. I put the script below, but
>also wanted to say hello to everyone. I am middle school technology
>education teacher, an avid woodworker, webpage designer, and now php
>programmer. I am hoping that someone can point out the issue with
>this script, and I do have register_global in my php.ini file set to
>off. I am getting a undefined varibale error on the $counter
>variable. The script is below. Thanks everyone.
>
>09 <?
>10 $counter == 0;
>11 if ($counter > 10) {
>12 print $counter;
>13 print "<br>";
>14 }
>15 ?>
>
>Line # reference I think might help everyone
>
>David Weeks
>aka The Young Shop Teacher
>
>
>
>
>
>
>
>PHP Data object relational mapping generator
>http://www.metastorage.net/
>Yahoo! Groups Links
>
>
>
>
Joined: 23 Jan 2006
Posts: 1
Newbi PHPer Here
09 <?
10 $counter == 0; // change with $counter = 0;
11 if ($counter > 10) { //return FALSE
12 print $counter; //never executed
13 print "<br>"; //never executed
14 }
15 ?>
try this one
<?php
$counter = 0;
if ($counter > 10) { //return FALSE
print $counter; //never executed
print "<br>"; //never executed
}else{
print "$counter < 10 <br>"; //executed
}
$counter = 20;
if ($counter > 10) { //return TRUE
print $counter; //executed
print "<br>"; //executed
}else{ print "$counter < 10 <br>"; // never executed
}
?>
Tiada kata indah, seindah kata ukhuwah
---------------------------------
What are the most popular cars? Find out at Yahoo! Autos
[Non-text portions of this message have been removed]
All times are GMT
Page 1 of 1
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Freelace Website Designer - Customer web design and software building.
Booking Calendar - reservation calendar script
Land Surveying - total station instruments and equipments
China Wholesale - Electronics Products
Character Studio - Tutorials and Help
Booking Calendar - reservation calendar script
Land Surveying - total station instruments and equipments
China Wholesale - Electronics Products
Character Studio - Tutorials and Help







