php-general Digest 18 May 2002 13:00:44 -0000 Issue 1352

Topics (messages 98197 through 98250):

HTTP_ACCEPT_LANGUAGE
        98197 by: Gerard Samuel
        98199 by: Miguel Cruz

Re: Alter table and add cell at a time.
        98198 by: Miguel Cruz

Re: Q:Anybody using PHP directly on Mac-OSX???
        98200 by: Justin French

mktime()
        98201 by: Josh Edwards
        98202 by: Rasmus Lerdorf

character conversion problem
        98203 by: darcy w.christ
        98209 by: Tom Rogers

Feelin' dumb...
        98204 by: Jason Soza
        98205 by: Jule
        98206 by: Richard Baskett
        98207 by: Jule
        98208 by: Jason Soza
        98210 by: Craig Vincent
        98211 by: Richard Baskett
        98212 by: Tom Rogers
        98213 by: Jason Soza
        98214 by: Craig Vincent
        98215 by: Jason Soza
        98216 by: Richard Baskett
        98217 by: Jason Soza
        98219 by: Jason Soza
        98221 by: Richard Baskett
        98222 by: Jason Soza
        98223 by: Richard Baskett
        98224 by: Craig Vincent
        98225 by: Craig Vincent
        98226 by: Richard Baskett

Re: ob_start() and ob_gzhandler
        98218 by: Jason Wong

Re: Strange behavior with imap, php and apache
        98220 by: Jason Wong

virtual coin toss 55%
        98227 by: Randy Johnson
        98228 by: Richard Baskett
        98229 by: Jason Wong

When did $_SERVER become the preferred syntax?
        98230 by: Brad Hubbard
        98231 by: Jason Wong
        98234 by: Richard Baskett
        98235 by: Brad Hubbard

Upgraded, now sessions aren't working.  Please help :)
        98232 by: Stephen Bolinger
        98233 by: Richard Baskett

parsing CSV, updating MySQL table
        98236 by: Justin French

Re: $answers[answer$n]
        98237 by: Michael Virnstein

Re: PHP+MySQL -> Excel ?
        98238 by: savaidis

Bulletin Boards
        98239 by: Richard Baskett
        98241 by: Liam MacKenzie

blank screen on parse errors after creating php.ini on linux
        98240 by: andy
        98242 by: Jason Wong

PHP,Apache disabled FTP?
        98243 by: r
        98245 by: Craig Vincent
        98246 by: Dan Hardiker
        98248 by: r

Any Ideas "@" becomes "_Xy"
        98244 by: Henry

need help on a ereg stmt. validating website adress
        98247 by: andy

Re: Newbie - create image error URGENT
        98249 by: Henry

Bundled php mysql library vs mysql extension
        98250 by: Pentothal

Administrivia:

To subscribe to the digest, e-mail:
        [EMAIL PROTECTED]

To unsubscribe from the digest, e-mail:
        [EMAIL PROTECTED]

To post to the list, e-mail:
        [EMAIL PROTECTED]


----------------------------------------------------------------------
--- Begin Message ---
Im looking to know how to handle it.
HTTP_ACCEPT_LANGUAGE = en-us, en;q=0.75, th;q=0.50, yi;q=0.25
What are the 'q' values for?

Thanks...

--- End Message ---
--- Begin Message ---
On Fri, 17 May 2002, Gerard Samuel wrote:
> Im looking to know how to handle it.
> HTTP_ACCEPT_LANGUAGE = en-us, en;q=0.75, th;q=0.50, yi;q=0.25
> What are the 'q' values for?

How much they'd like to receive one of those other languages. The closer
the number is to 1, the more excited they are about it.

miguel

--- End Message ---
--- Begin Message ---
update table set answer3=5 where id=2;

miguel

On Fri, 17 May 2002, Jule wrote:
> a question:
> 
> if i have this:
> 
> for ($n = 1; $n <= $quiz[number_answers]; $n++) {
>       $table = $qcode."_answers";
>       $value = $answers["answer".$n];
>       $value2 = "answer".$n;
> 
>       $query_alter_table = "ALTER TABLE $table ADD $value2 TEXT NOT NULL";
>       $query_add_answers = "INSERT INTO $table ($value2) VALUES('$value')";
>       if (mysql_db_query($database_glob, $query_alter_table, $link_glob)) {
>               if (mysql_db_query($database_glob, $query_add_answers, $link_glob)) {
>                       echo "Answer $n: $value has successfully been added to the 
>Quiz<br>\n";
>               } else {
>                       echo mysql_error() ." 1<br>";
>               }
>       } else {
>               echo mysql_error()." 2<br>";
>       }
> }
> 
> How do I get the $value to be in the same row as the preceding one?
> now it comes like this:
> +----+---------+---------+---------+---------+
> 
> | id | answer1 | answer2 | answer3 | answer4 |
> 
> +----+---------+---------+---------+---------+
> 
> |  1 | answer1 |         |         |         |
> |  2 |         | answer2 |         |         |
> |  3 |         |         | answer3 |         |
> |  4 |         |         |         | answer4 |
> 
> +----+---------+---------+---------+---------+
> 
> so it's like this?
> +----+---------+---------+---------+---------+
> 
> | id | answer1 | answer2 | answer3 | answer4 |
> 
> +----+---------+---------+---------+---------+
> 
> |  1 | answer1 | answer2 | answer3 | answer4 |
> 
> +----+---------+---------+---------+---------+
> 
> thanks,
> 
> Jule
> 
> On Friday 17 May 2002 19:17, you wrote:
> > Hello,
> >
> > Try using "NOT NULL".  As weird as MySQL can be, don't think it is that
> > NUTty.  =)
> >
> > Harrison
> >
> > ----- Original Message -----
> > From: "Jule" <[EMAIL PROTECTED]>
> > To: <[EMAIL PROTECTED]>
> > Sent: Friday, May 17, 2002 7:00 PM
> > Subject: "ALTER TABLE $table ADD $value2 TEXT NUT NULL"
> >
> >
> > Hey i'm getting this error:
> >
> > You have an error in your SQL syntax near 'NUT NULL' at line 1
> >
> > when i run this query,
> >
> > "ALTER TABLE $table ADD $value2 TEXT NUT NULL"
> >
> > from the documentation i understood that this was the correct notation.
> >
> > any ideas?
> > thanks
> > Jule
> > --
> >
> > |\/\__________________________/\/|
> > |   Jule Slootbeek |
> > |   [EMAIL PROTECTED] |
> > |   http://blindtheory.cjb.net |
> > |   __________________________ |
> > |/\/       \/\|
> >
> > ---------------------------------------------------------------------
> > Before posting, please check:
> >    http://www.mysql.com/manual.php   (the manual)
> >    http://lists.mysql.com/           (the list archive)
> >
> > To request this thread, e-mail <[EMAIL PROTECTED]>
> > To unsubscribe, e-mail
> > <[EMAIL PROTECTED]>
> > Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
> >
> >
> >
> >
> >
> > ---------------------------------------------------------------------
> > Before posting, please check:
> >    http://www.mysql.com/manual.php   (the manual)
> >    http://lists.mysql.com/           (the list archive)
> >
> > To request this thread, e-mail <[EMAIL PROTECTED]>
> > To unsubscribe, e-mail
> > <[EMAIL PROTECTED]> Trouble
> > unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
> 
> --
> 
> |\/\__________________________/\/|
> |   Jule Slootbeek             |
> |   [EMAIL PROTECTED]      |
> |   http://blindtheory.cjb.net         |
> |   __________________________         |
> |/\/                        \/\|
> 
> -------------------------------------------------------
> 
> 

--- End Message ---
--- Begin Message ---
I haven't jumped ship to OSX yet (still on OS9), but I believe it's not far
away...  However, I don't know if I'd put my test server on the same box...
time will tell, but I prefer having my old clunker P133 box under the desk
running the same OS / Apache version / PHP version / MySQL version as but
ISP... it makes migrating from the test environment to the live environment
sooooo easy.

If you can't get everything running on OSX, seriously look at an old Pentium
with either a windows or unix based OS.

As far as local testing, I have file-sharing set-up between the mac and the
unix box, so I save my files directly into the doc root (no FTP :)) and
command-tab across to my browser and hit reload.

I'm pretty sure you won't be able to hit "preview in browser" because PHP
has to be parsed by the server (http://localhost/dir/dir/file.php), rather
than as a file (file:///path/to/file.php).


Good luck,

Justin




on 18/05/02 3:03 AM, Marcus James Christian ([EMAIL PROTECTED])
wrote:

> Hello,
> 
> I love PHP but I haven't gotten deep into it because of the issue of
> needed to upload it to my hosts server to test it.
> 
> I'd love to get REALLY good with PHP, advanced shopping cart stuff, DB
> etc.  but I just know the way my mind works and unless its a simple one
> click to test it on my desktop,  well you know.
> 
> So, anybody out there have PHP installed on their local home desktop Mac
> OSX box able to test by a quick "preview in browser" from say an app
> like BBedit?
> 
> -Marcus
> 
> --
> ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
> |||||||||
> 
> Marcus Unlimited
> http://marcusunlimited.com
> Multimedia Internet Design and Education
> ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
> |||||||||
> 
> --------------------------------------
> | Limited Time Offer!
> | Download the Recordings of Chromaticus
> | FREE! @ http://ampcast.com/chromaticus
> | Complete song files and Sci-Fi Loops for
> | programs like Reason, Flash, Premiere
> | Logic, Cubase, Recycle, Acid, FruityLoops,
> | and many, many, more!!!
> 
> 

--- End Message ---
--- Begin Message ---
    After reading the manual Istill can't convert this
09/May/2002 to a timestamp.

Any Pointers


--- End Message ---
--- Begin Message ---
A couple of ways to do it:

strtotime('09 May 2002');

mktime(12,0,0,5,9,2002);


On Sat, 18 May 2002, Josh Edwards wrote:

>     After reading the manual Istill can't convert this
> 09/May/2002 to a timestamp.
>
> Any Pointers
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>

--- End Message ---
--- Begin Message ---
hi,

   i'm in a bit of a bind and i'm hoping someone can help me.  i'm 
working on a project in which some data was saved into a postgresql 
database.  It was copied from quark express and entered through a php 
interface.  Unfortunately some of the records have a strange character 
encoding.  For example, apostrophes were converted to %u2019.  All the 
charactes seenm to begin with %u and have 4 numbers after that.  i've 
seen this kind of thing in word documents.  i don't know what it is, but 
i think it's the extended ascii character set.  Anyway, i'm not sure 
what to do about it.  i would like to find a way to convert this to 
simple ascii permanently or else find a way for it to display correctly 
in html and i'm hoping to do this in php.  i would also like to find a 
way to prevent this from creeping into the system.  i'm sorry i don't 
understand the problem well enough, and i'm sorry if i'm using the wrong 
words to describe this problem.  Anyway i really appreciate the help.


~darcy w. christ
1000camels in a courtyard

--- End Message ---
--- Begin Message ---
Hi
That looks like UTF-8 encoding and I think you will need the iconv 
extension installed to convert it easily.
Tom



At 12:56 PM 18/05/2002, darcy w.christ wrote:
>hi,
>
>   i'm in a bit of a bind and i'm hoping someone can help me.  i'm working 
> on a project in which some data was saved into a postgresql database.  It 
> was copied from quark express and entered through a php 
> interface.  Unfortunately some of the records have a strange character 
> encoding.  For example, apostrophes were converted to %u2019.  All the 
> charactes seenm to begin with %u and have 4 numbers after that.  i've 
> seen this kind of thing in word documents.  i don't know what it is, but 
> i think it's the extended ascii character set.  Anyway, i'm not sure what 
> to do about it.  i would like to find a way to convert this to simple 
> ascii permanently or else find a way for it to display correctly in html 
> and i'm hoping to do this in php.  i would also like to find a way to 
> prevent this from creeping into the system.  i'm sorry i don't understand 
> the problem well enough, and i'm sorry if i'm using the wrong words to 
> describe this problem.  Anyway i really appreciate the help.
>
>
>~darcy w. christ
>1000camels in a courtyard
>
>
>--
>PHP General Mailing List (http://www.php.net/)
>To unsubscribe, visit: http://www.php.net/unsub.php
>

--- End Message ---
--- Begin Message ---
Okay, I'm apologizing right now for this, but I hope it's at least
tolerable. I have this:

for ($i=1; $i<=$num_pages; $i++) {
        // print stuff here
        }

For each loop, I want to add 20 to $i, so after the first iteration, I have
21, then 41, 61, etc. I've tried $i+20, $i + 20, I've tried looking in the
manual, but I assume this is some C-type function, and I'm not familiar with
C!

Any helpers?

Jason Soza

--- End Message ---
--- Begin Message ---
try,

for ($i=1; $i<=$num_pages; $i = $i + 20) {
}


or try,

$i = 1;
while ($i<=$num_pages) {
        //text here
        $i = $i + 20;
}

I got those little problems too all the time..
and the boards/lists always help.
Jule

On Friday 17 May 2002 23:19, you wrote:
> Okay, I'm apologizing right now for this, but I hope it's at least
> tolerable. I have this:
>
> for ($i=1; $i<=$num_pages; $i++) {
>       // print stuff here
>       }
>
> For each loop, I want to add 20 to $i, so after the first iteration, I have
> 21, then 41, 61, etc. I've tried $i+20, $i + 20, I've tried looking in the
> manual, but I assume this is some C-type function, and I'm not familiar
> with C!
>
> Any helpers?
>
> Jason Soza

--

|\/\__________________________/\/|
|   Jule Slootbeek               |
|   [EMAIL PROTECTED]        |
|   http://blindtheory.cjb.net   |
|   __________________________   |
|/\/                          \/\|

-------------------------------------------------------

-- 
|\/\__________________________/\/|
|   Jule Slootbeek               |
|   [EMAIL PROTECTED]        |
|   http://blindtheory.cjb.net   |
|   __________________________   |
|/\/                          \/\|
--- End Message ---
--- Begin Message ---
Hmm... Wouldnąt you just do this?:

for ($i=1; $i<=$num_pages; $i+20) {
  // print stuff here
}

Rick

"The vision must be followed by the venture. It is not enough to stare up
the steps - we must step up the stairs." - Vance Havner

> From: "Jason Soza" <[EMAIL PROTECTED]>
> Date: Fri, 17 May 2002 19:19:28 -0800
> To: <[EMAIL PROTECTED]>
> Subject: [PHP] Feelin' dumb...
> 
> Okay, I'm apologizing right now for this, but I hope it's at least
> tolerable. I have this:
> 
> for ($i=1; $i<=$num_pages; $i++) {
> // print stuff here
> }
> 
> For each loop, I want to add 20 to $i, so after the first iteration, I have
> 21, then 41, 61, etc. I've tried $i+20, $i + 20, I've tried looking in the
> manual, but I assume this is some C-type function, and I'm not familiar with
> C!
> 
> Any helpers?
> 
> Jason Soza
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 

--- End Message ---
--- Begin Message ---
would that work?

isn't $i++; abbr. for $i = $i + 1;

so now the $i + 20; doens't declare anything.

just like $i += $b; is abbr. $i = $i + $b;

Jule.


On Friday 17 May 2002 23:14, you wrote:
> Hmm... Wouldnąt you just do this?:
>
> for ($i=1; $i<=$num_pages; $i+20) {
>   // print stuff here
> }
>
> Rick
>
> "The vision must be followed by the venture. It is not enough to stare up
> the steps - we must step up the stairs." - Vance Havner
>
> > From: "Jason Soza" <[EMAIL PROTECTED]>
> > Date: Fri, 17 May 2002 19:19:28 -0800
> > To: <[EMAIL PROTECTED]>
> > Subject: [PHP] Feelin' dumb...
> >
> > Okay, I'm apologizing right now for this, but I hope it's at least
> > tolerable. I have this:
> >
> > for ($i=1; $i<=$num_pages; $i++) {
> > // print stuff here
> > }
> >
> > For each loop, I want to add 20 to $i, so after the first iteration, I
> > have 21, then 41, 61, etc. I've tried $i+20, $i + 20, I've tried looking
> > in the manual, but I assume this is some C-type function, and I'm not
> > familiar with C!
> >
> > Any helpers?
> >
> > Jason Soza
> >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php

-- 
|\/\__________________________/\/|
|   Jule Slootbeek               |
|   [EMAIL PROTECTED]        |
|   http://blindtheory.cjb.net   |
|   __________________________   |
|/\/                          \/\|
--- End Message ---
--- Begin Message ---
Well, I tried that but the page doesn't finish loading... I.e. a script that
normally doesn't take more than a second to load just sits there. With $i++,
everything's fine - with $i+20, the browser says it's loading, but all I
have is a white screen for about 30 seconds... Then it times out.

-----Original Message-----
From: Richard Baskett [mailto:[EMAIL PROTECTED]]
Sent: Friday, May 17, 2002 7:15 PM
To: Jason Soza; PHP General
Subject: Re: [PHP] Feelin' dumb...


Hmm... Wouldnąt you just do this?:

for ($i=1; $i<=$num_pages; $i+20) {
  // print stuff here
}

Rick

"The vision must be followed by the venture. It is not enough to stare up
the steps - we must step up the stairs." - Vance Havner

> From: "Jason Soza" <[EMAIL PROTECTED]>
> Date: Fri, 17 May 2002 19:19:28 -0800
> To: <[EMAIL PROTECTED]>
> Subject: [PHP] Feelin' dumb...
>
> Okay, I'm apologizing right now for this, but I hope it's at least
> tolerable. I have this:
>
> for ($i=1; $i<=$num_pages; $i++) {
> // print stuff here
> }
>
> For each loop, I want to add 20 to $i, so after the first iteration, I
have
> 21, then 41, 61, etc. I've tried $i+20, $i + 20, I've tried looking in the
> manual, but I assume this is some C-type function, and I'm not familiar
with
> C!
>
> Any helpers?
>
> Jason Soza
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

--- End Message ---
--- Begin Message ---
> For each loop, I want to add 20 to $i, so after the first
> iteration, I have
> 21, then 41, 61, etc. I've tried $i+20, $i + 20, I've tried looking in the
> manual, but I assume this is some C-type function, and I'm not
> familiar with
> C!

Well this is a bit of a detour from the other suggestions however since you
haven't gotten a successful solution yet how about

for ($i=1; $i<=$num_pages; $i++) {
        $number = ($i * 20) + 1;
        // print stuff here
        }

The results would be $number = 21 on first run, then 41, then 61 etc (which
I believe is what you are looking for).  Note the parenthesis in the $number
line are not needed however I typically code with them as it makes it easier
to understand the code with less though =)

Sincerely,

Craig Vincent


--- End Message ---
--- Begin Message ---
I apologize :)  yes you need to do this:

for ($i=1; $i<=$num_pages; $i=$i+20) {
  echo "$i - is i<br />";
}

Make sure $num_pages is set though.. If not it wont work you'll just get a
blank white page.  Yes I did some testing *hehe*  It worked beautifully when
$num_pages is set though..

Rick

"The human mind is not capable of grasping the Universe. We are like a
little child entering a huge library. The walls are covered to the ceilings
with books in many different tongues. The child knows that someone must have
written these books. It does not know who or how. It does not understand the
languages in which they are written. But the child notes a definite plan in
the arrangement of the books---a mysterious order which it does not
comprehend, but only dimly suspects." - Albert Einstein

> From: Jule <[EMAIL PROTECTED]>
> Date: Fri, 17 May 2002 23:23:25 -0400
> To: Richard Baskett <[EMAIL PROTECTED]>, [EMAIL PROTECTED]
> Subject: Re: [PHP] Feelin' dumb...
> 
> for ($i=1; $i<=$num_pages; $i+20) {
>>   // print stuff here
>> }

--- End Message ---
--- Begin Message ---
Hi
What you need is
for ($i=1; $i<=$num_pages; $i+=20) {
   // print stuff here
}

Tom

At 01:19 PM 18/05/2002, Jason Soza wrote:
>Okay, I'm apologizing right now for this, but I hope it's at least
>tolerable. I have this:
>
>for ($i=1; $i<=$num_pages; $i++) {
>         // print stuff here
>         }
>
>For each loop, I want to add 20 to $i, so after the first iteration, I have
>21, then 41, 61, etc. I've tried $i+20, $i + 20, I've tried looking in the
>manual, but I assume this is some C-type function, and I'm not familiar with
>C!
>
>Any helpers?
>
>Jason Soza
>
>
>--
>PHP General Mailing List (http://www.php.net/)
>To unsubscribe, visit: http://www.php.net/unsub.php

--- End Message ---
--- Begin Message ---
Thanks Craig, that worked!

I wonder why the other suggestions weren't working. They seemed logical
enough, I even tried variations of your suggestion, first I tried:

for ($i=1; $i<=$num_pages; $number = $i + 20) {}

That wasn't working, still was getting the 30 second timeout. Then I tried:

for ($i=1; $i<=$num_pages;) { $number = $i + 20; }

Since the manual says any of the expressions can be left blank. That still
executed beyond the 30 seconds and timed out.

Anyways, your suggestion is MUCH faster! Thanks for everyone's help -

Jason

-----Original Message-----
From: Craig Vincent [mailto:[EMAIL PROTECTED]]
Sent: Friday, May 17, 2002 7:36 PM
To: Jason Soza; [EMAIL PROTECTED]
Subject: RE: [PHP] Feelin' dumb...


> For each loop, I want to add 20 to $i, so after the first
> iteration, I have
> 21, then 41, 61, etc. I've tried $i+20, $i + 20, I've tried looking in the
> manual, but I assume this is some C-type function, and I'm not
> familiar with
> C!

Well this is a bit of a detour from the other suggestions however since you
haven't gotten a successful solution yet how about

for ($i=1; $i<=$num_pages; $i++) {
        $number = ($i * 20) + 1;
        // print stuff here
        }

The results would be $number = 21 on first run, then 41, then 61 etc (which
I believe is what you are looking for).  Note the parenthesis in the $number
line are not needed however I typically code with them as it makes it easier
to understand the code with less though =)

Sincerely,

Craig Vincent



--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

--- End Message ---
--- Begin Message ---
> I wonder why the other suggestions weren't working. They seemed logical
> enough, I even tried variations of your suggestion, first I tried:
>
> for ($i=1; $i<=$num_pages; $number = $i + 20) {}
> for ($i=1; $i<=$num_pages;) { $number = $i + 20; }

The problem with these two statements was that the loop would be indefinate.
Without the third option $i is never incremented (unless you manually
increment it from within the loop).  So with your examples $i would always
be 1 and would therefore always be <= $num_pages unless $num_pages was zero
or negative.

Sincerely,

Craig Vincent


--- End Message ---
--- Begin Message ---
Makes sense. Thanks!

Now... I have this little problem:
if ($num_pages >= 2) {
        for ($i=1; $i<=$num_pages; $i++) {
        $number = ($i * 20) + 1;
        $page = $i+1;
        printf("| <a href=\"test.php?page=%s\">Page %s</a> | ", $number, $page);
        }
}

I want $page to be $i + 1, but when I do $page = $i+1;, $i somehow gets
evaluated into the for() loop and an additional iteration is completed. So
basically if I do it this way, I get I'll get 1, 21, 41, when really only 1
and 21 are valid. If I put in $page = $i++; it works correctly, but $i is 1
when I want it to be two. If I take out $page = and put in $i where $page is
in the printf() statement, I get the extra iteration again. Any ideas?

-----Original Message-----
From: Craig Vincent [mailto:[EMAIL PROTECTED]]
Sent: Friday, May 17, 2002 7:56 PM
To: Jason Soza; [EMAIL PROTECTED]
Subject: RE: [PHP] Feelin' dumb...


> I wonder why the other suggestions weren't working. They seemed logical
> enough, I even tried variations of your suggestion, first I tried:
>
> for ($i=1; $i<=$num_pages; $number = $i + 20) {}
> for ($i=1; $i<=$num_pages;) { $number = $i + 20; }

The problem with these two statements was that the loop would be indefinate.
Without the third option $i is never incremented (unless you manually
increment it from within the loop).  So with your examples $i would always
be 1 and would therefore always be <= $num_pages unless $num_pages was zero
or negative.

Sincerely,

Craig Vincent



--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

--- End Message ---
--- Begin Message ---
What do you want the output to look like?  I did this:

$num_pages =120;

if ($num_pages >= 2) {
    for ($i=1; $i<=$num_pages; $i+=20) {
     $page = $i+1;
    printf("| <a href=\"test.php?page=%s\">Page %s</a> | ", $number, $page);
    }
}

And got this:

| Page 2 | | Page 22 | | Page 42 | | Page 62 | | Page 82 | | Page 102 |

Rick

"If a man is called to be a streetsweeper, he should sweep streets even as
Michelangelo painted, or Beethoven composed music, or Shakespeare composed
poetry. He should sweep streets so well that all the hosts of heaven and
earth will pause to say, "Here lived a great streetsweeper who did his job
well." - Dr. Martin Luther King, Jr.

> From: "Jason Soza" <[EMAIL PROTECTED]>
> Date: Fri, 17 May 2002 20:09:55 -0800
> To: <[EMAIL PROTECTED]>
> Subject: RE: [PHP] Feelin' dumb...
> 
> Makes sense. Thanks!
> 
> Now... I have this little problem:
> if ($num_pages >= 2) {
> for ($i=1; $i<=$num_pages; $i++) {
> $number = ($i * 20) + 1;
> $page = $i+1;
> printf("| <a href=\"test.php?page=%s\">Page %s</a> | ", $number, $page);
> }
> }
> 
> I want $page to be $i + 1, but when I do $page = $i+1;, $i somehow gets
> evaluated into the for() loop and an additional iteration is completed. So
> basically if I do it this way, I get I'll get 1, 21, 41, when really only 1
> and 21 are valid. If I put in $page = $i++; it works correctly, but $i is 1
> when I want it to be two. If I take out $page = and put in $i where $page is
> in the printf() statement, I get the extra iteration again. Any ideas?
> 
> -----Original Message-----
> From: Craig Vincent [mailto:[EMAIL PROTECTED]]
> Sent: Friday, May 17, 2002 7:56 PM
> To: Jason Soza; [EMAIL PROTECTED]
> Subject: RE: [PHP] Feelin' dumb...
> 
> 
>> I wonder why the other suggestions weren't working. They seemed logical
>> enough, I even tried variations of your suggestion, first I tried:
>> 
>> for ($i=1; $i<=$num_pages; $number = $i + 20) {}
>> for ($i=1; $i<=$num_pages;) { $number = $i + 20; }
> 
> The problem with these two statements was that the loop would be indefinate.
> Without the third option $i is never incremented (unless you manually
> increment it from within the loop).  So with your examples $i would always
> be 1 and would therefore always be <= $num_pages unless $num_pages was zero
> or negative.
> 
> Sincerely,
> 
> Craig Vincent
> 
> 
> 
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 

--- End Message ---
--- Begin Message ---
When I use that, here:

        if ($num_pages >= 2) {
                    for ($i=1; $i<=$num_pages; $i+=20) {
                        echo "$i";
                        }
        }

I get 1, or whatever I set $i= in the first expression. No other iterations.
When I use Craig's way, it works - kinda. Based on what I'm using this code
in, I should get two iterations. I'm counting the number of rows from my DB,
dividing it by 20, that's the number of pages I have - currently I have 22
records, so 2 pages. Here's what I use for that:

                    $sql = mysql_query("SELECT * FROM table");
                    $num_rows = mysql_num_rows($sql);
                    $num_pages = ceil($num_rows/20);

So why would I only get 1 iteration? 22/20 = 1.2 rounded up to 2. This
satisfies the if ($num_pages >= 2) statement and initiates the loop. $i
starts as 1, then should loop once more. If I set $i=0, I echo 0. What
gives?

I may not be able to answer anymore tonight, have to DJ for 4 hours
beginning in about 35 minutes, so I need to get ready for that, but
certainly anymore ideas would be great. Thanks!

-----Original Message-----
From: Tom Rogers [mailto:[EMAIL PROTECTED]]
Sent: Friday, May 17, 2002 7:40 PM
To: [EMAIL PROTECTED]
Subject: Re: [PHP] Feelin' dumb...


Hi
What you need is
for ($i=1; $i<=$num_pages; $i+=20) {
   // print stuff here
}

Tom

At 01:19 PM 18/05/2002, Jason Soza wrote:
>Okay, I'm apologizing right now for this, but I hope it's at least
>tolerable. I have this:
>
>for ($i=1; $i<=$num_pages; $i++) {
>         // print stuff here
>         }
>
>For each loop, I want to add 20 to $i, so after the first iteration, I have
>21, then 41, 61, etc. I've tried $i+20, $i + 20, I've tried looking in the
>manual, but I assume this is some C-type function, and I'm not familiar
with
>C!
>
>Any helpers?
>
>Jason Soza
>
>
>--
>PHP General Mailing List (http://www.php.net/)
>To unsubscribe, visit: http://www.php.net/unsub.php


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

--- End Message ---
--- Begin Message ---
I think I figured this out -

Since I only have 2 pages, the first iteration of the loop sets $i greater
than than the number of pages, i.e. $i becomes 21, which is greater than 2,
so the second iteration stops there. Am I seeing this right?

So Craig's way worked because $i was left alone in the for() expressions and
only modified in the statement, therefore on the second iteration, $i was 2
and thus it satisfied the second expression and iterated once more.

I *think* I'm understanding this correctly, though if others see it
differently, please let me know!

-----Original Message-----
From: Jason Soza [mailto:[EMAIL PROTECTED]]
Sent: Friday, May 17, 2002 8:24 PM
To: [EMAIL PROTECTED]
Subject: RE: [PHP] Feelin' dumb...


When I use that, here:

        if ($num_pages >= 2) {
                    for ($i=1; $i<=$num_pages; $i+=20) {
                        echo "$i";
                        }
        }

I get 1, or whatever I set $i= in the first expression. No other iterations.
When I use Craig's way, it works - kinda. Based on what I'm using this code
in, I should get two iterations. I'm counting the number of rows from my DB,
dividing it by 20, that's the number of pages I have - currently I have 22
records, so 2 pages. Here's what I use for that:

                    $sql = mysql_query("SELECT * FROM table");
                    $num_rows = mysql_num_rows($sql);
                    $num_pages = ceil($num_rows/20);

So why would I only get 1 iteration? 22/20 = 1.2 rounded up to 2. This
satisfies the if ($num_pages >= 2) statement and initiates the loop. $i
starts as 1, then should loop once more. If I set $i=0, I echo 0. What
gives?

I may not be able to answer anymore tonight, have to DJ for 4 hours
beginning in about 35 minutes, so I need to get ready for that, but
certainly anymore ideas would be great. Thanks!

-----Original Message-----
From: Tom Rogers [mailto:[EMAIL PROTECTED]]
Sent: Friday, May 17, 2002 7:40 PM
To: [EMAIL PROTECTED]
Subject: Re: [PHP] Feelin' dumb...


Hi
What you need is
for ($i=1; $i<=$num_pages; $i+=20) {
   // print stuff here
}

Tom

At 01:19 PM 18/05/2002, Jason Soza wrote:
>Okay, I'm apologizing right now for this, but I hope it's at least
>tolerable. I have this:
>
>for ($i=1; $i<=$num_pages; $i++) {
>         // print stuff here
>         }
>
>For each loop, I want to add 20 to $i, so after the first iteration, I have
>21, then 41, 61, etc. I've tried $i+20, $i + 20, I've tried looking in the
>manual, but I assume this is some C-type function, and I'm not familiar
with
>C!
>
>Any helpers?
>
>Jason Soza
>
>
>--
>PHP General Mailing List (http://www.php.net/)
>To unsubscribe, visit: http://www.php.net/unsub.php


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

--- End Message ---
--- Begin Message ---
That means $num_pages is equal to 2 so yes the if statement is true and it
goes onto the the for loop.  Now where you are having problems is on the
second expression in the for loop.. This expression is basically saying "Do
this for loop while $I is less than or equal to 2.  The third expression
tells the for loop what to do after each iteration which means after the
first iteration $I is now 21 so it will stop the for loop since it does not
pass the second expression check in the for loop.. Since $I is not less than
or equal to 2 since $I is equal to 21 now.

Im not sure where the 20 comes in so if you clarify what it is for then
maybe we can figure out where it needs to go :)  If you just want the loop
to go through twice then you would set it to:

if ($num_pages >= 2) {
  for ($i=1; $i<=$num_pages; $i++) {
    echo "$I<br />";
  }
}

Rick

"May the BEST of your past be the WORST of your future" - Unknown

> From: "Jason Soza" <[EMAIL PROTECTED]>
> Date: Fri, 17 May 2002 20:23:53 -0800
> To: <[EMAIL PROTECTED]>
> Subject: RE: [PHP] Feelin' dumb...
> 
> When I use that, here:
> 
> if ($num_pages >= 2) {
>    for ($i=1; $i<=$num_pages; $i+=20) {
> echo "$i";
> }
> }
> 
> I get 1, or whatever I set $i= in the first expression. No other iterations.
> When I use Craig's way, it works - kinda. Based on what I'm using this code
> in, I should get two iterations. I'm counting the number of rows from my DB,
> dividing it by 20, that's the number of pages I have - currently I have 22
> records, so 2 pages. Here's what I use for that:
> 
>    $sql = mysql_query("SELECT * FROM table");
>    $num_rows = mysql_num_rows($sql);
>    $num_pages = ceil($num_rows/20);
> 
> So why would I only get 1 iteration? 22/20 = 1.2 rounded up to 2. This
> satisfies the if ($num_pages >= 2) statement and initiates the loop. $i
> starts as 1, then should loop once more. If I set $i=0, I echo 0. What
> gives?
> 
> I may not be able to answer anymore tonight, have to DJ for 4 hours
> beginning in about 35 minutes, so I need to get ready for that, but
> certainly anymore ideas would be great. Thanks!
> 
> -----Original Message-----
> From: Tom Rogers [mailto:[EMAIL PROTECTED]]
> Sent: Friday, May 17, 2002 7:40 PM
> To: [EMAIL PROTECTED]
> Subject: Re: [PHP] Feelin' dumb...
> 
> 
> Hi
> What you need is
> for ($i=1; $i<=$num_pages; $i+=20) {
>  // print stuff here
> }
> 
> Tom
> 
> At 01:19 PM 18/05/2002, Jason Soza wrote:
>> Okay, I'm apologizing right now for this, but I hope it's at least
>> tolerable. I have this:
>> 
>> for ($i=1; $i<=$num_pages; $i++) {
>>         // print stuff here
>>         }
>> 
>> For each loop, I want to add 20 to $i, so after the first iteration, I have
>> 21, then 41, 61, etc. I've tried $i+20, $i + 20, I've tried looking in the
>> manual, but I assume this is some C-type function, and I'm not familiar
> with
>> C!
>> 
>> Any helpers?
>> 
>> Jason Soza
>> 
>> 
>> --
>> PHP General Mailing List (http://www.php.net/)
>> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 

--- End Message ---
--- Begin Message ---
The 20 is inserted into a MySQL LIMIT query. Page 1 = LIMIT 1,20 to get the
first 20 records from 1, then Page 2 = LIMIT 21,20 to get the next 20, etc.

I think I see the error here.

                    if ($num_pages >= 2) {
                            for ($i=1; $i<=$num_pages; $i++) {
                            $number = ($i * 20) + 1;
                            printf("| <a href=\"test.php?page=%s\">Page %s</a> | ", 
$number,
$i);
                                }
                        }

Is ALMOST right... Except that the I need the first iteration to return 1.
In this case, it returns 21, so the next iteration is 41. Follow me? I need
1, 21, not 21, 41. Almost there I think, unfortunately, I need to jet. I'll
be thinkin' on this one while DJing, definitely!

Thanks again for everyone's help.

-----Original Message-----
From: Richard Baskett [mailto:[EMAIL PROTECTED]]
Sent: Friday, May 17, 2002 8:30 PM
To: Jason Soza; PHP General
Subject: Re: [PHP] Feelin' dumb...


That means $num_pages is equal to 2 so yes the if statement is true and it
goes onto the the for loop.  Now where you are having problems is on the
second expression in the for loop.. This expression is basically saying "Do
this for loop while $I is less than or equal to 2.  The third expression
tells the for loop what to do after each iteration which means after the
first iteration $I is now 21 so it will stop the for loop since it does not
pass the second expression check in the for loop.. Since $I is not less than
or equal to 2 since $I is equal to 21 now.

Im not sure where the 20 comes in so if you clarify what it is for then
maybe we can figure out where it needs to go :)  If you just want the loop
to go through twice then you would set it to:

if ($num_pages >= 2) {
  for ($i=1; $i<=$num_pages; $i++) {
    echo "$I<br />";
  }
}

Rick

"May the BEST of your past be the WORST of your future" - Unknown

> From: "Jason Soza" <[EMAIL PROTECTED]>
> Date: Fri, 17 May 2002 20:23:53 -0800
> To: <[EMAIL PROTECTED]>
> Subject: RE: [PHP] Feelin' dumb...
>
> When I use that, here:
>
> if ($num_pages >= 2) {
>    for ($i=1; $i<=$num_pages; $i+=20) {
> echo "$i";
> }
> }
>
> I get 1, or whatever I set $i= in the first expression. No other
iterations.
> When I use Craig's way, it works - kinda. Based on what I'm using this
code
> in, I should get two iterations. I'm counting the number of rows from my
DB,
> dividing it by 20, that's the number of pages I have - currently I have 22
> records, so 2 pages. Here's what I use for that:
>
>    $sql = mysql_query("SELECT * FROM table");
>    $num_rows = mysql_num_rows($sql);
>    $num_pages = ceil($num_rows/20);
>
> So why would I only get 1 iteration? 22/20 = 1.2 rounded up to 2. This
> satisfies the if ($num_pages >= 2) statement and initiates the loop. $i
> starts as 1, then should loop once more. If I set $i=0, I echo 0. What
> gives?
>
> I may not be able to answer anymore tonight, have to DJ for 4 hours
> beginning in about 35 minutes, so I need to get ready for that, but
> certainly anymore ideas would be great. Thanks!
>
> -----Original Message-----
> From: Tom Rogers [mailto:[EMAIL PROTECTED]]
> Sent: Friday, May 17, 2002 7:40 PM
> To: [EMAIL PROTECTED]
> Subject: Re: [PHP] Feelin' dumb...
>
>
> Hi
> What you need is
> for ($i=1; $i<=$num_pages; $i+=20) {
>  // print stuff here
> }
>
> Tom
>
> At 01:19 PM 18/05/2002, Jason Soza wrote:
>> Okay, I'm apologizing right now for this, but I hope it's at least
>> tolerable. I have this:
>>
>> for ($i=1; $i<=$num_pages; $i++) {
>>         // print stuff here
>>         }
>>
>> For each loop, I want to add 20 to $i, so after the first iteration, I
have
>> 21, then 41, 61, etc. I've tried $i+20, $i + 20, I've tried looking in
the
>> manual, but I assume this is some C-type function, and I'm not familiar
> with
>> C!
>>
>> Any helpers?
>>
>> Jason Soza
>>
>>
>> --
>> PHP General Mailing List (http://www.php.net/)
>> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>

--- End Message ---
--- Begin Message ---
Easy one!  Hopefully you havent "jetted" yet :)

Just cut the $number = line to below the printf line and there you have it!

Rick

"How wonderful it is that nobody need wait a single moment to improve the
world." - Anne Frank

> From: "Jason Soza" <[EMAIL PROTECTED]>
> Date: Fri, 17 May 2002 20:44:30 -0800
> To: "Richard Baskett" <[EMAIL PROTECTED]>, "PHP General"
> <[EMAIL PROTECTED]>
> Subject: RE: [PHP] Feelin' dumb...
> 
> The 20 is inserted into a MySQL LIMIT query. Page 1 = LIMIT 1,20 to get the
> first 20 records from 1, then Page 2 = LIMIT 21,20 to get the next 20, etc.
> 
> I think I see the error here.
> 
>    if ($num_pages >= 2) {
>    for ($i=1; $i<=$num_pages; $i++) {
>    $number = ($i * 20) + 1;
>    printf("| <a href=\"test.php?page=%s\">Page %s</a> | ", $number,
> $i);
> }
> }
> 
> Is ALMOST right... Except that the I need the first iteration to return 1.
> In this case, it returns 21, so the next iteration is 41. Follow me? I need
> 1, 21, not 21, 41. Almost there I think, unfortunately, I need to jet. I'll
> be thinkin' on this one while DJing, definitely!
> 
> Thanks again for everyone's help.
> 
> -----Original Message-----
> From: Richard Baskett [mailto:[EMAIL PROTECTED]]
> Sent: Friday, May 17, 2002 8:30 PM
> To: Jason Soza; PHP General
> Subject: Re: [PHP] Feelin' dumb...
> 
> 
> That means $num_pages is equal to 2 so yes the if statement is true and it
> goes onto the the for loop.  Now where you are having problems is on the
> second expression in the for loop.. This expression is basically saying "Do
> this for loop while $I is less than or equal to 2.  The third expression
> tells the for loop what to do after each iteration which means after the
> first iteration $I is now 21 so it will stop the for loop since it does not
> pass the second expression check in the for loop.. Since $I is not less than
> or equal to 2 since $I is equal to 21 now.
> 
> Im not sure where the 20 comes in so if you clarify what it is for then
> maybe we can figure out where it needs to go :)  If you just want the loop
> to go through twice then you would set it to:
> 
> if ($num_pages >= 2) {
> for ($i=1; $i<=$num_pages; $i++) {
>   echo "$I<br />";
> }
> }
> 
> Rick
> 
> "May the BEST of your past be the WORST of your future" - Unknown
> 
>> From: "Jason Soza" <[EMAIL PROTECTED]>
>> Date: Fri, 17 May 2002 20:23:53 -0800
>> To: <[EMAIL PROTECTED]>
>> Subject: RE: [PHP] Feelin' dumb...
>> 
>> When I use that, here:
>> 
>> if ($num_pages >= 2) {
>>    for ($i=1; $i<=$num_pages; $i+=20) {
>> echo "$i";
>> }
>> }
>> 
>> I get 1, or whatever I set $i= in the first expression. No other
> iterations.
>> When I use Craig's way, it works - kinda. Based on what I'm using this
> code
>> in, I should get two iterations. I'm counting the number of rows from my
> DB,
>> dividing it by 20, that's the number of pages I have - currently I have 22
>> records, so 2 pages. Here's what I use for that:
>> 
>>    $sql = mysql_query("SELECT * FROM table");
>>    $num_rows = mysql_num_rows($sql);
>>    $num_pages = ceil($num_rows/20);
>> 
>> So why would I only get 1 iteration? 22/20 = 1.2 rounded up to 2. This
>> satisfies the if ($num_pages >= 2) statement and initiates the loop. $i
>> starts as 1, then should loop once more. If I set $i=0, I echo 0. What
>> gives?
>> 
>> I may not be able to answer anymore tonight, have to DJ for 4 hours
>> beginning in about 35 minutes, so I need to get ready for that, but
>> certainly anymore ideas would be great. Thanks!
>> 
>> -----Original Message-----
>> From: Tom Rogers [mailto:[EMAIL PROTECTED]]
>> Sent: Friday, May 17, 2002 7:40 PM
>> To: [EMAIL PROTECTED]
>> Subject: Re: [PHP] Feelin' dumb...
>> 
>> 
>> Hi
>> What you need is
>> for ($i=1; $i<=$num_pages; $i+=20) {
>>  // print stuff here
>> }
>> 
>> Tom
>> 
>> At 01:19 PM 18/05/2002, Jason Soza wrote:
>>> Okay, I'm apologizing right now for this, but I hope it's at least
>>> tolerable. I have this:
>>> 
>>> for ($i=1; $i<=$num_pages; $i++) {
>>>         // print stuff here
>>>         }
>>> 
>>> For each loop, I want to add 20 to $i, so after the first iteration, I
> have
>>> 21, then 41, 61, etc. I've tried $i+20, $i + 20, I've tried looking in
> the
>>> manual, but I assume this is some C-type function, and I'm not familiar
>> with
>>> C!
>>> 
>>> Any helpers?
>>> 
>>> Jason Soza
>>> 
>>> 
>>> --
>>> PHP General Mailing List (http://www.php.net/)
>>> To unsubscribe, visit: http://www.php.net/unsub.php
>> 
>> 
>> --
>> PHP General Mailing List (http://www.php.net/)
>> To unsubscribe, visit: http://www.php.net/unsub.php
>> 
>> 
>> --
>> PHP General Mailing List (http://www.php.net/)
>> To unsubscribe, visit: http://www.php.net/unsub.php
>> 
> 
> 
> 

--- End Message ---
--- Begin Message ---
> I think I figured this out -
>
> Since I only have 2 pages, the first iteration of the loop sets $i greater
> than than the number of pages, i.e. $i becomes 21, which is
> greater than 2,
> so the second iteration stops there. Am I seeing this right?
>
> So Craig's way worked because $i was left alone in the for()
> expressions and
> only modified in the statement, therefore on the second
> iteration, $i was 2
> and thus it satisfied the second expression and iterated once more.
>
> I *think* I'm understanding this correctly, though if others see it
> differently, please let me know!

Yup....that's what I figured you were doing which was why I saw a problem
with the for loops having $i being incremented by more than one (ex. $i +
20).  In order for that to have worked more effectively you would have
needed to multiple $num_pages by 20 as well before the for loop was called
which was redundant....and probably would have caused problems with getting
the proper results from the database depending on how you coded it.

Sincerely,

Craig Vincent


--- End Message ---
--- Begin Message ---
> I think I see the error here.
>
>                   if ($num_pages >= 2) {
>                           for ($i=1; $i<=$num_pages; $i++) {
>                           $number = ($i * 20) + 1;
>                           printf("| <a
> href=\"test.php?page=%s\">Page %s</a> | ", $number,
> $i);
>                               }
>                       }
>
> Is ALMOST right... Except that the I need the first iteration to return 1.
> In this case, it returns 21, so the next iteration is 41. Follow
> me? I need
> 1, 21, not 21, 41. Almost there I think, unfortunately, I need to
> jet. I'll
> be thinkin' on this one while DJing, definitely!

Easy fix =)  Put the $number = ($i * 20) + 1;  at the end of your for loop
so it is the last thing done prior to starting a new loop.

Sincerely,

Craig Vincent


--- End Message ---
--- Begin Message ---
Ok Im feeling dumb also now *hehe*  What I said about putting the $number
line below the printf line.. Donąt listen to me :)  Now that I know what you
want.. I know there is cleaner and better code, but it works :)

if ($num_pages >= 2) {
  for ($i=1; $i<=$num_pages; $i++) {
    $j = ($i==1) ? $i : $j+20;
    echo "| <a href=\"test.php?page=$j\">Page $i</a> | ";
  }
}

Rick

Be kind. Everyone you meet is fighting a hard battle - John Watson

> From: "Jason Soza" <[EMAIL PROTECTED]>
> Date: Fri, 17 May 2002 20:44:30 -0800
> To: "Richard Baskett" <[EMAIL PROTECTED]>, "PHP General"
> <[EMAIL PROTECTED]>
> Subject: RE: [PHP] Feelin' dumb...
> 
> The 20 is inserted into a MySQL LIMIT query. Page 1 = LIMIT 1,20 to get the
> first 20 records from 1, then Page 2 = LIMIT 21,20 to get the next 20, etc.
> 
> I think I see the error here.
> 
>    if ($num_pages >= 2) {
>    for ($i=1; $i<=$num_pages; $i++) {
>    $number = ($i * 20) + 1;
>    printf("| <a href=\"test.php?page=%s\">Page %s</a> | ", $number,
> $i);
> }
> }
> 
> Is ALMOST right... Except that the I need the first iteration to return 1.
> In this case, it returns 21, so the next iteration is 41. Follow me? I need
> 1, 21, not 21, 41. Almost there I think, unfortunately, I need to jet. I'll
> be thinkin' on this one while DJing, definitely!
> 
> Thanks again for everyone's help.
> 
> -----Original Message-----
> From: Richard Baskett [mailto:[EMAIL PROTECTED]]
> Sent: Friday, May 17, 2002 8:30 PM
> To: Jason Soza; PHP General
> Subject: Re: [PHP] Feelin' dumb...
> 
> 
> That means $num_pages is equal to 2 so yes the if statement is true and it
> goes onto the the for loop.  Now where you are having problems is on the
> second expression in the for loop.. This expression is basically saying "Do
> this for loop while $I is less than or equal to 2.  The third expression
> tells the for loop what to do after each iteration which means after the
> first iteration $I is now 21 so it will stop the for loop since it does not
> pass the second expression check in the for loop.. Since $I is not less than
> or equal to 2 since $I is equal to 21 now.
> 
> Im not sure where the 20 comes in so if you clarify what it is for then
> maybe we can figure out where it needs to go :)  If you just want the loop
> to go through twice then you would set it to:
> 
> if ($num_pages >= 2) {
> for ($i=1; $i<=$num_pages; $i++) {
>   echo "$I<br />";
> }
> }
> 
> Rick
> 
> "May the BEST of your past be the WORST of your future" - Unknown
> 
>> From: "Jason Soza" <[EMAIL PROTECTED]>
>> Date: Fri, 17 May 2002 20:23:53 -0800
>> To: <[EMAIL PROTECTED]>
>> Subject: RE: [PHP] Feelin' dumb...
>> 
>> When I use that, here:
>> 
>> if ($num_pages >= 2) {
>>    for ($i=1; $i<=$num_pages; $i+=20) {
>> echo "$i";
>> }
>> }
>> 
>> I get 1, or whatever I set $i= in the first expression. No other
> iterations.
>> When I use Craig's way, it works - kinda. Based on what I'm using this
> code
>> in, I should get two iterations. I'm counting the number of rows from my
> DB,
>> dividing it by 20, that's the number of pages I have - currently I have 22
>> records, so 2 pages. Here's what I use for that:
>> 
>>    $sql = mysql_query("SELECT * FROM table");
>>    $num_rows = mysql_num_rows($sql);
>>    $num_pages = ceil($num_rows/20);
>> 
>> So why would I only get 1 iteration? 22/20 = 1.2 rounded up to 2. This
>> satisfies the if ($num_pages >= 2) statement and initiates the loop. $i
>> starts as 1, then should loop once more. If I set $i=0, I echo 0. What
>> gives?
>> 
>> I may not be able to answer anymore tonight, have to DJ for 4 hours
>> beginning in about 35 minutes, so I need to get ready for that, but
>> certainly anymore ideas would be great. Thanks!
>> 
>> -----Original Message-----
>> From: Tom Rogers [mailto:[EMAIL PROTECTED]]
>> Sent: Friday, May 17, 2002 7:40 PM
>> To: [EMAIL PROTECTED]
>> Subject: Re: [PHP] Feelin' dumb...
>> 
>> 
>> Hi
>> What you need is
>> for ($i=1; $i<=$num_pages; $i+=20) {
>>  // print stuff here
>> }
>> 
>> Tom
>> 
>> At 01:19 PM 18/05/2002, Jason Soza wrote:
>>> Okay, I'm apologizing right now for this, but I hope it's at least
>>> tolerable. I have this:
>>> 
>>> for ($i=1; $i<=$num_pages; $i++) {
>>>         // print stuff here
>>>         }
>>> 
>>> For each loop, I want to add 20 to $i, so after the first iteration, I
> have
>>> 21, then 41, 61, etc. I've tried $i+20, $i + 20, I've tried looking in
> the
>>> manual, but I assume this is some C-type function, and I'm not familiar
>> with
>>> C!
>>> 
>>> Any helpers?
>>> 
>>> Jason Soza
>>> 
>>> 
>>> --
>>> PHP General Mailing List (http://www.php.net/)
>>> To unsubscribe, visit: http://www.php.net/unsub.php
>> 
>> 
>> --
>> PHP General Mailing List (http://www.php.net/)
>> To unsubscribe, visit: http://www.php.net/unsub.php
>> 
>> 
>> --
>> PHP General Mailing List (http://www.php.net/)
>> To unsubscribe, visit: http://www.php.net/unsub.php
>> 
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 

--- End Message ---
--- Begin Message ---
On Saturday 18 May 2002 02:48, Jason Soza wrote:

> Either way, is there any way to tell if my output is really being
> compressed by ob_gzhandler?

If you have NN4.X use view source, if the source is empty then compression is 
active.

If you're using some form of un*x then:

  lynx --mime_header http://www.domain.com/page.php

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.com.hk
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *

/*
If only God would give me some clear sign!  Like making a large deposit
in my name at a Swiss Bank.
- Woody Allen
*/

--- End Message ---
--- Begin Message ---
On Saturday 18 May 2002 02:39, Sergio Tirado wrote:
> I just installed Red Hat 7.3 with Apache and PHP. I ran a simple script
> to test the imap_open function and it doesn't work when using the
> values for servers on my subnet.
>
> http://www.gym.itesm.mx/imap.php
>
> However, if the mailbox I request to open is on another server outside, it
> does work.
>
> The strange thing is that a friend of mine has the same script running on
> his server (http://pollux.icon.net.mx/~antonio/imap.php) and he can read
> a mailbox from my subnet as well as any other.
>
> When I run the script on my server and try to access a local mailbox I
> get the following error:
>
> Warning: Couldn't open stream {www.gym.itesm.mx:143}INBOX in
> /home/campus/html/imap.php on line 5
>
> I just don't know what could be wrong. Help is appreciated.

On the machine running the webserver, try:

  telnet host.of.imap.server 143

That will verify whether the two can connect. Do you have any weird firewall 
rules between the two?

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.com.hk
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *

/*
Quality Control, n.:
        The process of testing one out of every 1,000 units coming off
        a production line to make sure that at least one out of 100 works.
*/

--- End Message ---
--- Begin Message ---
I was surfing the internet today and found a site that offered a coin toss game in 
PHP.    The site claimed that it used the latest and most random computer algorithms 
to do the Coin Toss.

In the next line it said that you (the player) would win 45% of the time.

I would like opinions how somebody could offer a 50/50 coin toss game and gurantee a 
45%   win  ratio for the player

The idea of game programming is appealing,  but I have no idea how you would gurantee 
that the player wins 45% of the time and the operators win 55% of the time.


Thanks in advance

Randy




--- End Message ---
--- Begin Message ---
I want to say right from the beginning that there is a better way of doing
this, but this will work :)

Just keep track of what the user has thrown so far and do a check on it.. So
that if it's less than 45% change the flip to what the user picked.. If that
will put it over 45% then make it opposite what the user picked..  This will
let the user win very close to 45% every single time.

Or you could do a weight scale.. To make the average user win 45% of the
time instead each user.. So:

Grab a random number between 1 and 100;

If ($number >=1 && $number <=45) $user = 'Wins!' // num between 1 and 45
If ($number >=46 && $number <=100) $user = 'Loses!' // num between 46-100

So basically the user has a 45% chance of winning while the operator has a
55% chance :)

I know there are better ways, but this will give you an idea :)

Rick

"We do not have to visit a mad house to find disordered minds; our planet is
the mental institution of the universe." - Unknown

> From: "Randy Johnson" <[EMAIL PROTECTED]>
> Date: Fri, 12 Apr 2002 01:07:53 -0400
> To: <[EMAIL PROTECTED]>
> Subject: [PHP] virtual coin toss 55%
> 
> I was surfing the internet today and found a site that offered a coin toss
> game in PHP.    The site claimed that it used the latest and most random
> computer algorithms to do the Coin Toss.
> 
> In the next line it said that you (the player) would win 45% of the time.
> 
> I would like opinions how somebody could offer a 50/50 coin toss game and
> gurantee a 45%   win  ratio for the player
> 
> The idea of game programming is appealing,  but I have no idea how you would
> gurantee that the player wins 45% of the time and the operators win 55% of the
> time.
> 
> 
> Thanks in advance
> 
> Randy
> 
> 
> 
> 
> 

--- End Message ---
--- Begin Message ---
On Friday 12 April 2002 13:07, Randy Johnson wrote:
> I was surfing the internet today and found a site that offered a coin toss
> game in PHP.    The site claimed that it used the latest and most random
> computer algorithms to do the Coin Toss.
>
> In the next line it said that you (the player) would win 45% of the time.
>
> I would like opinions how somebody could offer a 50/50 coin toss game and
> gurantee a 45%   win  ratio for the player
>
> The idea of game programming is appealing,  but I have no idea how you
> would gurantee that the player wins 45% of the time and the operators win
> 55% of the time.

As with most gambling, the odds are rigged in favour of the house. What they 
are saying is every $1 you give them they give you back 90 cents ?!? Sounds 
like a good deal to me ;-)

BTW your clock is slow by a month or so.

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.com.hk
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *

/*
Gee, Toto, I don't think we're in Kansas anymore.
*/

--- End Message ---
--- Begin Message ---
What's the idea behind this syntax "$_SERVER" and when did it become the 
preferred method (are there docs on this)?

Cheers,
Brad
--- End Message ---
--- Begin Message ---
On Saturday 18 May 2002 13:47, Brad Hubbard wrote:
> What's the idea behind this syntax "$_SERVER" and when did it become the
> preferred method (are there docs on this)?

Read the changelogs for php 4.1.X and above. 
Search the archives.
Read the sample php.ini files included with the distributions.

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.com.hk
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *

/*
Where's th' DAFFY DUCK EXHIBIT??
*/

--- End Message ---
--- Begin Message ---
This page will tell you everything you need to know about the new global
arrays :)

http://www.php.net/manual/fi/reserved.variables.php

Rick

"Do all the good you can, By all the means you can, In all the ways you can,
In all the places you can, At all the times you can, To all the people you
can, As long as ever you can." - John Wesley

> From: Brad Hubbard <[EMAIL PROTECTED]>
> Organization: Congo Systems
> Reply-To: [EMAIL PROTECTED]
> Date: Sat, 18 May 2002 15:47:58 +1000
> To: [EMAIL PROTECTED]
> Subject: [PHP] When did $_SERVER become the preferred syntax?
> 
> What's the idea behind this syntax "$_SERVER" and when did it become the
> preferred method (are there docs on this)?
> 
> Cheers,
> Brad
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 

--- End Message ---
--- Begin Message ---
On Sat, 18 May 2002 15:47, Brad Hubbard did align ASCII characters thusly:
> What's the idea behind this syntax "$_SERVER" and when did it become the
> preferred method (are there docs on this)?

Thanks to all who replied. I understand this now.

Cheers,
Brad
--- End Message ---
--- Begin Message ---
Something catastrophic happened to my webserver and while I had the data of
the database and site content backed up, I'm having trouble getting it all
back up and working.

Prior to the server crash I was using Apache 1.3.2x (can't remember exactly)
and PHP 4.1.x (not sure on this one either, last time I upgraded was a few
months ago).  Everything was working perfectly.  I was using a lot of
start_session(), session_is_registered(), etc...session stuff.

Now I've compiled PHP 4.2.1 and tried both Apache 1.3.24 and Apache 2.0.36
and got them up and working (for the most part).  But everything that has
sessions in it is screwed.  Just hangs, no error, just hangs.  Is there
something I need to set in either php.ini or httpd.conf to get sessions
working again?

I've read that there are other, more preferred ways to do sessions now, and
I'm going to start porting to that, but right now I need to get the server
up.

Can anyone offer me some advice?  I've been doing this for years now and I
feel like I'm losing my mind...I must just be overlooking something.

Thanks.

--- End Message ---
--- Begin Message ---
Did you look at: 
http://www.php.net/manual/fi/reserved.variables.php#reserved.variables.sessi
on

That is the new way.. And within that block of text there is a couple other
links to other pages you might want to take a look at.

Cheers!

Rick

"The glory of friendship is not the outstretched hand, nor the kindly smile,
nor the joy of companionship; it is the spiritual inspiration that comes to
one when he discovers that someone else believes in him and is willing to
trust him with his friendship."  - Ralph Waldo Emerson

> From: "Stephen Bolinger" <[EMAIL PROTECTED]>
> Reply-To: <[EMAIL PROTECTED]>
> Date: Fri, 17 May 2002 23:41:01 -0700
> To: <[EMAIL PROTECTED]>
> Subject: [PHP] Upgraded, now sessions aren't working.  Please help :)
> 
> Something catastrophic happened to my webserver and while I had the data of
> the database and site content backed up, I'm having trouble getting it all
> back up and working.
> 
> Prior to the server crash I was using Apache 1.3.2x (can't remember exactly)
> and PHP 4.1.x (not sure on this one either, last time I upgraded was a few
> months ago).  Everything was working perfectly.  I was using a lot of
> start_session(), session_is_registered(), etc...session stuff.
> 
> Now I've compiled PHP 4.2.1 and tried both Apache 1.3.24 and Apache 2.0.36
> and got them up and working (for the most part).  But everything that has
> sessions in it is screwed.  Just hangs, no error, just hangs.  Is there
> something I need to set in either php.ini or httpd.conf to get sessions
> working again?
> 
> I've read that there are other, more preferred ways to do sessions now, and
> I'm going to start porting to that, but right now I need to get the server
> up.
> 
> Can anyone offer me some advice?  I've been doing this for years now and I
> feel like I'm losing my mind...I must just be overlooking something.
> 
> Thanks.
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 

--- End Message ---
--- Begin Message ---
Hi,

I have a client with an Excel file of products / prices / etc.  For
arguments sake, let's keep it simple:

id,title,description

if they were to export this as a CSV, then it could be used to update a
mysql table (for existing ID's), and to insert any new ID's.


So, I guess what I'm after is a group of functions which parse a CSV file,
and update a MySQL table to match... rather than messing around in a web
based GUI, the client could just upload a new CSV every couple of days.


I've checked out fgetcsv() etc, and I *think* i've got a picture of how the
code would look, but before I start, I figure a set of functions probably
already exists out there to do this... so why reinvent the wheel????

If anyone can point me to a URL, class, function, article, etc, I'd be
pretty happy :)


Justin French

--- End Message ---
--- Begin Message ---
answers$n. php tries to concate the constant answers with the variable
$n, but you forgot the concatenation operator ".".
i assume that answers should be a string and
is not a constant, therefore $answer["answers".$n] is right.
if answers is a constant use $answer[answers.$n];
but a better way of what you try to accomplish would be a array
using two dimensions:
$answer["answers"][$n]
$answer["question"][$n] ...etc
or if you only have "answers" as key use:
$answer[$n]

if you want to send form data as array, using more than one dimension,
do the following:

<input type="text" name="answers[answer][1]" value="">
<input type="text" name="answers[answer][2]" value="">
<input type="text" name="answers[answer][3]" value="">

or

<input type="text" name="answers[answer][]" value="">
<input type="text" name="answers[answer][]" value="">
<input type="text" name="answers[answer][]" value="">

Which is pretty much the same.
now on the processing page you can do:

ForEach($answers as $val) {
    Foreach ($val as $answer) {
        // do something with one of the answers
    }
}

Regards Michael

"Jule" <[EMAIL PROTECTED]> schrieb im Newsbeitrag
02051716404700.28871@localhost">news:02051716404700.28871@localhost...
Hey guys,
i'm getting this error whe i try to access this variable. $answers[answer$n]

Parse error: parse error, expecting `']'' in
/home/blindtheory/web/quiz/add_quiz/add_quiz_process_2.php on line 36

the variable $answer[answers$n] comes from a form on the preceding page in
which a number of answers has been entered. the number of answers is up to
the user and can vary from 2 to 15. not the $n comes from a for loop whcih
enteres the answers into a database since i do not know how many answers
each
user has used.

why am i getting this error?
and is there a way around it?
following is the for() loop in which this story takes place.

thanks
Jule

--SCRIPT--

for ($n = 1; $n <= $quiz[number_answers]; $n++) {
$table = "$quiz[code]_answers";
$value = "$answers[answer$n]";
$query_alter_table = "ALTER table $table ADD answer$n TEXT NUT NULL";
$query_add_answers = "INSERT INTO $table (answer$n) VALUES($value)";
if (mysql_db_query($database_glob, $query_alter_table, $link_glob) AND
(mysql_db_query($database_glob, $query_add_answer, $link_glob));
echo "Answer $n has successfully been added to the Quiz<br>\n";
} else {
echo mysql_error();
}
echo "Click here to continue";
}

--SCRIPT--

--
|\/\__________________________/\/|
|   Jule Slootbeek |
|   [EMAIL PROTECTED] |
|   http://blindtheory.cjb.net |
|   __________________________ |
|/\/       \/\|


--- End Message ---
--- Begin Message ---
I use the ODBC connection with no problem, I get about 1000 rows to Excel in
seconds.
First row contains the colums names.
But I wonder if there is a way to write back the data to MySQL database from
Excel.
(with ODBC connection, becouse with files I think is possible)


Makis


> -----Original Message-----
> From: Rasmus Lerdorf [mailto:[EMAIL PROTECTED]]
> Sent: Friday, May 17, 2002 7:54 PM
> To: Chris Boget
> Cc: [EMAIL PROTECTED]
> Subject: Re: [PHP] PHP+MySQL -> Excel ?
>
>
> No, this has nothing to do with PHP.  You can run MySQL on Windows or
> UNIX, doesn't matter, and set up a connection directly from Excel to
> MySQL.
>
> PHP can of course run anywhere you want and manipulate the data in MySQL
> which will then be reflected in Excel.
>
> -Rasmus
>
> On Fri, 17 May 2002, Chris Boget wrote:
>
> > > It is also possible to connect directly to MySQL from Excel
> via MyODBC.
> >
> > True, but only if you are running PHP on a windows platform, yes?
> >
> > Chris
> >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>

--- End Message ---
--- Begin Message ---
Has anybody used phpBB && Phorum?  And if so, which did you like better and
why?  And if you've used other systems.. Which did you like best and why?
Thanks! :)

Rick

"We should be taught not to wait for inspiration to start a thing.  Action
always generates inspiration.  Inspiration seldom generates action." - Frank
Tibolt

--- End Message ---
--- Begin Message ---
Phorum is nice and simple.
phpBB has more features, generally better.

Both are very good systems.  I'd recommend phpBB for a more 'fun' type of
site and phorum for a more serious atmosphere.  But both can be configured
accordingly.

Cheers,
Liam

----- Original Message -----
From: "Richard Baskett" <[EMAIL PROTECTED]>
To: "PHP General" <[EMAIL PROTECTED]>
Sent: Saturday, May 18, 2002 6:51 PM
Subject: [PHP] Bulletin Boards


Has anybody used phpBB && Phorum?  And if so, which did you like better and
why?  And if you've used other systems.. Which did you like best and why?
Thanks! :)

Rick

"We should be taught not to wait for inspiration to start a thing.  Action
always generates inspiration.  Inspiration seldom generates action." - Frank
Tibolt


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php





--- End Message ---
--- Begin Message ---
Hi there,

I did recently activat php.ini on suse7.2 (copyed the php.ini-recommended
inot the propper dir) to increase the time out.

Now I did experiance a serious problem. Working on my code, I did produce an
error. I did forget to include a ". The screen on my browser was blank after
I refreshed. This went through my whole application. So I figured out that I
do have a check for user_info on each of those site. And before the if
statement the php code was parsed ok.

I did remove the php.ini file.

Then suddenly the error msg came up, I fixed the error and I was ok.

Parse error: parse error, unexpected T_STRING in /include/user.php on line
208
Fatal error: Call to undefined function: get_userdata_2() in /index.php on
line 29

So whats wrong with my php.ini? It does return a blank screen on parse
erorrs.

Thanx for any help on that,

Andy


--- End Message ---
--- Begin Message ---
On Saturday 18 May 2002 17:27, andy wrote:
> Hi there,
>
> I did recently activat php.ini on suse7.2 (copyed the php.ini-recommended
> inot the propper dir) to increase the time out.
>
> Now I did experiance a serious problem. Working on my code, I did produce
> an error. I did forget to include a ". The screen on my browser was blank
> after I refreshed. This went through my whole application. So I figured out
> that I do have a check for user_info on each of those site. And before the
> if statement the php code was parsed ok.
>
> I did remove the php.ini file.
>
> Then suddenly the error msg came up, I fixed the error and I was ok.
>
> Parse error: parse error, unexpected T_STRING in /include/user.php on line
> 208
> Fatal error: Call to undefined function: get_userdata_2() in /index.php on
> line 29
>
> So whats wrong with my php.ini? It does return a blank screen on parse
> erorrs.

READ through the php.ini (the one copied from php.ini-recommended). It has 
comments on what option does what and whether the default was changed from 
the previous versions of php.

You want to look at the "Error handling and logging" group of settings and in 
particular the "display_errors" setting.

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.com.hk
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *

/*
Outside of a dog, a book is a man's best friend.  Inside a dog it's too
dark to read.
                -- Groucho Marx
*/

--- End Message ---
--- Begin Message ---
Hi Guys,
I'm a newbie so please forgive the question,
I have reciently setup apache and PHP and now FTP does not work!
I am running a win2k pro machine, is this because of PHP or APACHE or what?
am going crazy and have searched google like crap without any damn
answer...then went to microsoft.com searching...still no @#$#$#@ answer.

PLEASE PLEASE PLEASE HELLLLLPP.

-Ryan A.

--- End Message ---
--- Begin Message ---
> I'm a newbie so please forgive the question,
> I have reciently setup apache and PHP and now FTP does not work!
> I am running a win2k pro machine, is this because of PHP or
> APACHE or what?
> am going crazy and have searched google like crap without any damn
> answer...then went to microsoft.com searching...still no @#$#$#@ answer.

Unless you did something totally off the wall I seriously doubt Apache or
PHP are affecting your FTP server.  Perhaps you should check the
documentation at your FTP provider's site.  Perhaps it can assist you in
troubleshooting why the server isn't working.

Sincerely,

Craig Vincent


--- End Message ---
--- Begin Message ---
>> I have reciently setup apache and PHP and now FTP does not work! I am
>> running a win2k pro machine, is this because of PHP or
>> APACHE or what?
[..]
> Unless you did something totally off the wall I seriously doubt Apache
> or PHP are affecting your FTP server.

Unless your using IIS to serve your FTP ;) That would go belly up if youve
got another http processes running. More information about your setup is
required for us to help further.

-- 
Dan Hardiker [[EMAIL PROTECTED]]
ADAM Software & Systems Engineer


--- End Message ---
--- Begin Message ---
Hey,
Thank you for replying.
Nope am not using IIS, I just have a plain win2k machine that used to ftp
without any problems before.....now i cant even find ftp.dll but can find
ftp://ftp.exe
I am unable to connect to 5 sites owned by the company i work for but am
able to connect to them when i go to a cyber cafe.... I have tried stopping
apache ....no use...tried to go to the php.ini file and see if there is
anything about enableing FTP...none...going crazy.

Any help or ideas.....
-Ryan.


> Unless your using IIS to serve your FTP ;) That would go belly up if youve
> got another http processes running. More information about your setup is
> required for us to help further.
>
> --
> Dan Hardiker [[EMAIL PROTECTED]]
> ADAM Software & Systems Engineer
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>

--- End Message ---
--- Begin Message ---
Hi All,

I don't think this is a PHP specific issue but I want to use PHP to solve
it.

I'm using GetResponse to supply my autoresponders. They provide an
unsubscribe link at the bottom of the emails as follows:

http://GetResponse.com/k.cgi?a=blahblah&f=henry_Xyteacake.force9.co.uk

I subscribed using the email address [EMAIL PROTECTED]

They appear to have translated the "@" symbol to "_Xy".

Any guess why? Is there a PHP function that does this translation for me? Is
it some sort of standard?

Henry


--- End Message ---
--- Begin Message ---
Hi there,

I would like to validate a website adress. Unfortunatelly my eregi stmt does
not work:

 if (eregi("^@([0-9a-z][0-9a-z-\.]+)\.([a-z]{2,3}))", $website)){ // not a
link

I am getting the error msg:
Warning: REG_ERANGE in extend.inc on line 94

does anybody know whats wroong with that?

Thanx, Andy


--- End Message ---
--- Begin Message ---
Do you have GD Installed?

"Dani" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Hi everyone!
>
> I'm still learning PHP and MYSQL using windows98, MYSQL, PHP 4 in my
> local hard drive.
>
> I want to learn uploading image and resizing image in my local machine.
>
> when I execute this code:
>
> <?PHP
> //setup image
> $height = 200;
> $width = 200;
>
> $im = ImageCreate($width,$height);
> $white = ImageCreateAllocate ($im, 255, 255, 255);
> $black = ImageCreateAllocate ($im, 0, 0, 0);
>
> //Draw on image
> ImageFill($im, 0, 0, $black);
> ImageLine($im, 0, 0, $width, $height, $white);
> ImageString($im, 4, 50, 150, "Sales", $white);
>
> //output image
> Header ("Content-type: image/png");
> ImagePng ($im);
>
> //Clean up
> ImageDestroy($im);
>
> I get error message: "Fatal error: Call to undefined function:
> imagecreate() in D:\graphic_practise\index.php on line 15"
>
> What did I do wrong?
>
> any advice/ help is greatly appriciated.
>
> Thanks,
>
> Ardani
>
>
>


--- End Message ---
--- Begin Message ---
Which are the differences between the php bundled mysql
library and the external "standard" extension? Is the
bundled one faster? How much?


--- End Message ---

Reply via email to