Solved

Simple Count Loop URGENT

Posted on 2006-11-20
5
167 Views
Last Modified: 2010-03-05
I am trying to make this simple loop work, but it is not, needed fast, reason for large amount of points.  I want to count from  say 1 to 250 in increments of 1....Below code only spits out tgvz4263001 ....Thanks!

Desired results:
tgvz4263001
tgvz4263002
tgvz4263003
tgvz4263004
and so on........


$client = "0";

for ($client <= 250)
{

$e1=$cient1;
$client1=$e1 + 1;

$id = "tgvz426300$client1";

print <<"PrintTag";
<html><head><title>Reporter</title>
</head><body>
$id<br>
</body></html>
PrintTag

}
0
Comment
Question by:precision
  • 3
  • 2
5 Comments
 
LVL 84

Expert Comment

by:ozo
Comment Utility
for( 'tgvz4263001' .. 'tgvz4263004' ){
    print <<"PrintTag";
<html><head><title>Reporter</title>
</head><body>
$_<br>
</body></html>
PrintTag
}
0
 
LVL 84

Expert Comment

by:ozo
Comment Utility
$client = "0";
for ($client <= 250)
is the same as
for( 1 )
you may have meant
for( $client=0; $client <= 250; $client++ ){
or
for $client( 0..250 ){
or
while( $client <= 250 ){
  $e1=$client;
  $client=$e1 + 1;
0
 

Author Comment

by:precision
Comment Utility
But how do I get the variable change?
when it gets to "100" the variable should be
tgvz426300100
not tgvz426400

see tgvz426300 is fixed, the counter is $client

If that makes any sense....
0
 
LVL 84

Accepted Solution

by:
ozo earned 500 total points
Comment Utility
for $client( 1..250 ){
   $id = "tgvz426300$client";
0
 

Author Comment

by:precision
Comment Utility
YOU THE MAN!
0

Featured Post

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Sending email via Perl on Windows 3 124
perl rename 2 137
perl to convert excel to csv 3 148
problem with using the glob function 1 57
Email validation in proper way is  very important validation required in any web pages. This code is self explainable except that Regular Expression which I used for pattern matching. I originally published as a thread on my website : http://www…
Checking the Alert Log in AWS RDS Oracle can be a pain through their user interface.  I made a script to download the Alert Log, look for errors, and email me the trace files.  In this article I'll describe what I did and share my script.
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…

771 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now