php-general Digest 2 Nov 2001 15:54:04 -0000 Issue 971

Topics (messages 73220 through 73272):

simple array tutorial wanted
        73220 by: Justin French
        73221 by: Liz Fulghum
        73222 by: Jack Dempsey
        73225 by: Justin French
        73233 by: Philip Olson

Re: Can you AUTO "Post/Submit" on a mixed HTML/PHP form
        73223 by: Jason G.
        73241 by: Arf

Re: Uncertainties about MySQL commands
        73224 by: Jason G.

year 2002 strtotime problem
        73226 by: John Clarke
        73227 by: Niklas Lampén
        73228 by: John Clarke
        73231 by: Niklas Lampén
        73234 by: John Clarke

Re: sending email to php script
        73229 by: Adrian D'Costa
        73230 by: David Robley
        73242 by: Chris Allen
        73245 by: Adrian D'Costa

Re: submitting form to a page with frames
        73232 by: Brent Rieck

mySQL problem
        73235 by: Niklas Lampén
        73239 by: Dimitris Kossikidis
        73240 by: Dimitris Kossikidis
        73247 by: Niklas Lampén
        73271 by: Jon Snell

PDF Generator
        73236 by: Krushna Kumar
        73237 by: Henrik Hansen

mysql:fixing gaps in id-key fields
        73238 by: Tom Churm

Re: Problem with date_format() in indirect MySQL query...
        73243 by: Ryan Fischer
        73244 by: Ryan Fischer

File to Download gets requestet twice
        73246 by: Stefan Rusterholz

Re: Asian fonts
        73248 by: speedboy

creating PDF file using PHP
        73249 by: Krushna Kumar
        73259 by: Henrik Hansen

comments
        73250 by: Nikola Karoviæ

PHP Highlighting Text Editors
        73251 by: TD - Sales International Holland B.V.
        73252 by: Thomas Buck
        73255 by: Stefan Rusterholz

Hotel booking/managment system?
        73253 by: Daniel Alsén

how to make IE show client side JavaScript output?
        73254 by: Moloko

Re: Problem with non us caracters and "strtr"
        73256 by: Rodrigo Peres
        73263 by: Stefan Rusterholz
        73268 by: Rodrigo Peres
        73272 by: pierre-yves

a big thank you
        73257 by: Scott

Redirect use back after execution
        73258 by: Daniel Harik
        73260 by: Henrik Hansen

Re: [PHP-DB] Re: Using A Query Results Multiple Times
        73261 by: Rick Emery

mysql table information
        73262 by: Justin French
        73267 by: Stefan Rusterholz

regular experssion help
        73264 by: Robert V. Zwink
        73270 by: Robert V. Zwink

Mail() not sending mail..
        73265 by: Paul Mullett

Sessions & Header PROBLEM again!
        73266 by: Alessandro BOSSI

select+uploading multiple files
        73269 by: fitiux

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]


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


Hi all,

I really want to get me head around arrays, becuase 
I KNOW there's a better way to do some of the stuff 
i'm doing right now.

I could mess with stuff for a few hours and probably 
get it, but i'd rather have a decent tutorial if 
anyone knows of one...


Thanks,

Justin French




http://www.onlamp.com/pub/a/php/2001/06/07/php_foundations.html




"Justin French" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Hi all,
>
> I really want to get me head around arrays, becuase
> I KNOW there's a better way to do some of the stuff
> i'm doing right now.
>
> I could mess with stuff for a few hours and probably
> get it, but i'd rather have a decent tutorial if
> anyone knows of one...
>
>
> Thanks,
>
> Justin French






http://www.php.net/manual/en/language.types.array.php

start with that

-----Original Message-----
From: Justin French [mailto:[EMAIL PROTECTED]]
Sent: Friday, November 02, 2001 12:33 AM
To: php
Subject: [PHP] simple array tutorial wanted


Hi all,

I really want to get me head around arrays, becuase 
I KNOW there's a better way to do some of the stuff 
i'm doing right now.

I could mess with stuff for a few hours and probably 
get it, but i'd rather have a decent tutorial if 
anyone knows of one...


Thanks,

Justin French

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]






Ummmm, I now how to use the manual, I was after a *tutorial*.

Liz posted a VERY good link/tutorial though --  many thanks!!!

Justin



Jack Dempsey wrote:
> 
> http://www.php.net/manual/en/language.types.array.php
> 
> start with that
> 
> -----Original Message-----
> From: Justin French [mailto:[EMAIL PROTECTED]]
> Sent: Friday, November 02, 2001 12:33 AM
> To: php
> Subject: [PHP] simple array tutorial wanted
> 
> Hi all,
> 
> I really want to get me head around arrays, becuase
> I KNOW there's a better way to do some of the stuff
> i'm doing right now.
> 
> I could mess with stuff for a few hours and probably
> get it, but i'd rather have a decent tutorial if
> anyone knows of one...
> 
> Thanks,
> 
> Justin French
> 
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]




Hi Justin,

That man page is pretty descriptive and contains many examples.  It's
sorta like a tutorial :)  If there is information you (or anyone) feels is
missing, please say so and it'll be looked into and perhaps added.

Regards,
Philip Olson



On Fri, 2 Nov 2001, Justin French wrote:

> Ummmm, I now how to use the manual, I was after a *tutorial*.
> 
> Liz posted a VERY good link/tutorial though --  many thanks!!!
> 
> Justin
> 
> 
> 
> Jack Dempsey wrote:
> > 
> > http://www.php.net/manual/en/language.types.array.php
> > 
> > start with that
> > 
> > -----Original Message-----
> > From: Justin French [mailto:[EMAIL PROTECTED]]
> > Sent: Friday, November 02, 2001 12:33 AM
> > To: php
> > Subject: [PHP] simple array tutorial wanted
> > 
> > Hi all,
> > 
> > I really want to get me head around arrays, becuase
> > I KNOW there's a better way to do some of the stuff
> > i'm doing right now.
> > 
> > I could mess with stuff for a few hours and probably
> > get it, but i'd rather have a decent tutorial if
> > anyone knows of one...
> > 
> > Thanks,
> > 
> > Justin French
> > 
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> > To contact the list administrators, e-mail: [EMAIL PROTECTED]
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
> 





Just a thought...

Check out crescent internet toolkit by Progress Software.  It has a control 
for VB that lets you post data to a script, rather than relying on an HTML 
form...

Can you just use a query string?  you may have to code your own urlencode() 
function in VB, but that may be an option.

Maybe you can invoke cURL from vb.  It's free, but I do not know if it has 
a Win32 version.

Hope it helps.
-Jason Garber
IonZoft.com


At 11:01 AM 11/1/2001 +0000, Arf wrote:
>Like the "heredoc" thanx for that...
>
>The way that I am using VB will not support the VBscript option
>unfortunately but a good suggestion.
>
>
>
>--
>PHP General Mailing List (http://www.php.net/)
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]
>To contact the list administrators, e-mail: [EMAIL PROTECTED]





I will give it a go and get back......






Regarding your mysql_insert_id() function:

I believe that it works on a connection by connection basis.  Therefore, if 
you execute an insert, and then call that function, you are guarenteed to 
have the correct ID.  Look up the LAST_INSERT_ID() function in the MySQL 
manual on www.mysql.com for more information.

-Jason Garber
IonZoft.com


At 09:22 PM 11/1/2001 +0100, TD - Sales International Holland B.V. wrote:
>Hey list, i'm new to php so bare with me...
>
>got some questions on mysql commands. I'd like to know how the
>mysql_insert_id() function works exactly.
>First of all how reliable is it? What happens this happens:
>Table: (ID int unsigned primary key auto_increment, Stuff text, MoreStuff
>text)
>(my script)
>insert into table values(NULL, "bla", "bla")
>(some other application)
>insert into table values(NULL, "bleh", "bleh")
>(my script)
>$id = mysql_insert_id
>
>it's not likely that this will happen, but if the site is very/extremely
>crowded it could be that there's an insert right after mine but before me
>callind mysql_insert_id. As you might guess I'd like to know which ID will be
>returned, the one my script created or the one from the other application?
>
>Also what happens if my table is like this:
>Table: (Stuff text, ID int unsigned primary key auto_increment, OtherStuff
>text)
>Thus having the ID on column 2 instead of 1
>or like this
>Table: (Bla int unsigned primary key auto_increment, Stuff text, Otherstuff
>text)
>Thus the ID not having the name ID
>Or like this
>Table: (bla int unsigned primary key auto_increment, id int unsigned primary
>key auto_increment, stuff text, otherstuff text)
>Thus having 2 auto_increment columns where the 2nd one is called ID (lower
>case).
>
>I'm really uncertain about that and couldn't find it back in the manual....
>does it only read the first column? does this column have to be named ID,
>what if ID is another column? what if there is more than 1 auto_increment
>column in the table? what happens if some(one)/(thing) else inserts before
>calling mysql_insert_id.
>
>One more question (pure curiosity this one) the return value from
>mysql_query... is that ever gonna be higher than 1? I assume it can be if the
>insert affects more than 1 line right? Also my book says that the return
>value is TRUE or FALSE for every command except for an INSERT in which case
>it would be 0 on failure and higher on succes. I think that's crap? I'm
>guessing it will also return a number for UPDATE's and REPLACE's is that
>correct? Are there others?
>
>OK just one more thing, this is for the people from troutworks if they're
>monitoring this list. I think the translation of the PHP Bible is
>crap!!!!!!!!! Please complain about it at the translator. The guy/girl
>managed to translate (quotes) " to (comma's) , and there are a lot of other
>wrongly translated things in there, luckily the examples in there got me on
>the right path again over and over showing that the translation was incorrect
>but it's just confusing like hell. The number of mistakes is unbelievable
>(and i'm NOT talking about spelling errors, I'm talking about messy stuff
>like calling quotes comma's) and I'm 100% certain it was NOT translated by a
>programmer
>
>regards
>
>--
>PHP General Mailing List (http://www.php.net/)
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]
>To contact the list administrators, e-mail: [EMAIL PROTECTED]





I have this problem with Php 4.0.5 on both  Win ME and Linus boxes, where my
year 2002 dates are converted back to 2001 when formating with 'strtotime'.

First I post the following variables from an html page to a php page

$date1='12/12/2001'
$date2='15/01/2002'

I then use date("D M j Y", strtotime($date1);  and date("D M j Y",
strtotime($date2));
to store them in an array for screen display.

As the users have the abilty to selected different dates I need to check
that 1 is before the other.
To do this I have a script timediff() that I pass the two dates to in the
above format.

All works fine until the year 2002 is selected. This is part of the
timediff() code with dispay statements and the result.

         function timediff($date1,$date2) {

           echo 'date1= '."$date1".' ';        // displays  'Wed December 12
2001'   ....... correct
           echo 'date2= '."$date2".' ';       //  displays   'Tue January 15
2002'       ...........correct, all fine so far

            $dd1=date("Ymd", strtotime($date1));
            $dd2=date("Ymd", strtotime($date2));

           echo 'date1= '.$dd1.'<br>';    // displays  '20011212'   .......
correct
           echo 'date2= '.$dd2.' <br>';   //  displays '20010115
...........WRONG
        }

    It seem that by applying strtotime a 2nd time might cause this problem,
as the first application was fine.

    I have tested all possible combinations of strtotime but the year 2002
always goes back to 2001
Have also tried just 'strtotime($date1)' but same problem again.

Any help or comments would be greatly appreciated as I thought I had
finished a booking program any now find this!!

Thanks in anticipation


John Clarke






Funny, I quickly tried this:

<?
$date1 = "12/12/2001";
$date2 = "15/01/2002";

$date1 = date("D M j Y", strtotime($date1));
$date2 = date("D M j Y", strtotime($date2));

print $date1."<br>";
print $date2."<br>";

print date("Y-m-d", strtotime($date1))."<br>";
print date("Y-m-d", strtotime($date2))."<br>";
?>

And the result was this:
"
Wed Dec 12 2001
Sat Mar 1 2003
2001-12-12
2003-03-01
"


Niklas


-----Original Message-----
From: John Clarke [mailto:[EMAIL PROTECTED]] 
Sent: 2. marraskuuta 2001 8:17
To: [EMAIL PROTECTED]
Subject: [PHP] year 2002 strtotime problem


I have this problem with Php 4.0.5 on both  Win ME and Linus boxes,
where my year 2002 dates are converted back to 2001 when formating with
'strtotime'.

First I post the following variables from an html page to a php page

$date1='12/12/2001'
$date2='15/01/2002'

I then use date("D M j Y", strtotime($date1);  and date("D M j Y",
strtotime($date2)); to store them in an array for screen display.

As the users have the abilty to selected different dates I need to check
that 1 is before the other. To do this I have a script timediff() that I
pass the two dates to in the above format.

All works fine until the year 2002 is selected. This is part of the
timediff() code with dispay statements and the result.

         function timediff($date1,$date2) {

           echo 'date1= '."$date1".' ';        // displays  'Wed
December 12
2001'   ....... correct
           echo 'date2= '."$date2".' ';       //  displays   'Tue
January 15
2002'       ...........correct, all fine so far

            $dd1=date("Ymd", strtotime($date1));
            $dd2=date("Ymd", strtotime($date2));

           echo 'date1= '.$dd1.'<br>';    // displays  '20011212'
.......
correct
           echo 'date2= '.$dd2.' <br>';   //  displays '20010115
...........WRONG
        }

    It seem that by applying strtotime a 2nd time might cause this
problem, as the first application was fine.

    I have tested all possible combinations of strtotime but the year
2002 always goes back to 2001 Have also tried just 'strtotime($date1)'
but same problem again.

Any help or comments would be greatly appreciated as I thought I had
finished a booking program any now find this!!

Thanks in anticipation


John Clarke



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED] To
contact the list administrators, e-mail: [EMAIL PROTECTED]





Even more funny...

I cut and pasted your code and I got;

Wed Dec 12 2001
Sat Mar 1 2003
2001-12-12
2001-03-01

What version of Php and OS are you using??

John

"Niklas lampén" <[EMAIL PROTECTED]> wrote in message
000301c16369$6817a320$ba93c5c3@Niklas">news:000301c16369$6817a320$ba93c5c3@Niklas...
> Funny, I quickly tried this:
>
> <?
> $date1 = "12/12/2001";
> $date2 = "15/01/2002";
>
> $date1 = date("D M j Y", strtotime($date1));
> $date2 = date("D M j Y", strtotime($date2));
>
> print $date1."<br>";
> print $date2."<br>";
>
> print date("Y-m-d", strtotime($date1))."<br>";
> print date("Y-m-d", strtotime($date2))."<br>";
> ?>
>
> And the result was this:
> "
> Wed Dec 12 2001
> Sat Mar 1 2003
> 2001-12-12
> 2003-03-01
> "
>
>
> Niklas
>
>
> -----Original Message-----
> From: John Clarke [mailto:[EMAIL PROTECTED]]
> Sent: 2. marraskuuta 2001 8:17
> To: [EMAIL PROTECTED]
> Subject: [PHP] year 2002 strtotime problem
>
>
> I have this problem with Php 4.0.5 on both  Win ME and Linus boxes,
> where my year 2002 dates are converted back to 2001 when formating with
> 'strtotime'.
>
> First I post the following variables from an html page to a php page
>
> $date1='12/12/2001'
> $date2='15/01/2002'
>
> I then use date("D M j Y", strtotime($date1);  and date("D M j Y",
> strtotime($date2)); to store them in an array for screen display.
>
> As the users have the abilty to selected different dates I need to check
> that 1 is before the other. To do this I have a script timediff() that I
> pass the two dates to in the above format.
>
> All works fine until the year 2002 is selected. This is part of the
> timediff() code with dispay statements and the result.
>
>          function timediff($date1,$date2) {
>
>            echo 'date1= '."$date1".' ';        // displays  'Wed
> December 12
> 2001'   ....... correct
>            echo 'date2= '."$date2".' ';       //  displays   'Tue
> January 15
> 2002'       ...........correct, all fine so far
>
>             $dd1=date("Ymd", strtotime($date1));
>             $dd2=date("Ymd", strtotime($date2));
>
>            echo 'date1= '.$dd1.'<br>';    // displays  '20011212'
> .......
> correct
>            echo 'date2= '.$dd2.' <br>';   //  displays '20010115
> ...........WRONG
>         }
>
>     It seem that by applying strtotime a 2nd time might cause this
> problem, as the first application was fine.
>
>     I have tested all possible combinations of strtotime but the year
> 2002 always goes back to 2001 Have also tried just 'strtotime($date1)'
> but same problem again.
>
> Any help or comments would be greatly appreciated as I thought I had
> finished a booking program any now find this!!
>
> Thanks in anticipation
>
>
> John Clarke
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED] To
> contact the list administrators, e-mail: [EMAIL PROTECTED]
>






Great. :)

I've got PHP 4.0.6 on linux. You?

I think you should break the dates manually, it would be the most sure
way to do it.


Niklas


-----Original Message-----
From: John Clarke [mailto:[EMAIL PROTECTED]] 
Sent: 2. marraskuuta 2001 9:11
To: [EMAIL PROTECTED]
Subject: Re: [PHP] year 2002 strtotime problem


Even more funny...

I cut and pasted your code and I got;

Wed Dec 12 2001
Sat Mar 1 2003
2001-12-12
2001-03-01

What version of Php and OS are you using??

John

"Niklas lampén" <[EMAIL PROTECTED]> wrote in message
000301c16369$6817a320$ba93c5c3@Niklas">news:000301c16369$6817a320$ba93c5c3@Niklas...
> Funny, I quickly tried this:
>
> <?
> $date1 = "12/12/2001";
> $date2 = "15/01/2002";
>
> $date1 = date("D M j Y", strtotime($date1));
> $date2 = date("D M j Y", strtotime($date2));
>
> print $date1."<br>";
> print $date2."<br>";
>
> print date("Y-m-d", strtotime($date1))."<br>";
> print date("Y-m-d", strtotime($date2))."<br>";
> ?>
>
> And the result was this:
> "
> Wed Dec 12 2001
> Sat Mar 1 2003
> 2001-12-12
> 2003-03-01
> "
>
>
> Niklas
>
>
> -----Original Message-----
> From: John Clarke [mailto:[EMAIL PROTECTED]]
> Sent: 2. marraskuuta 2001 8:17
> To: [EMAIL PROTECTED]
> Subject: [PHP] year 2002 strtotime problem
>
>
> I have this problem with Php 4.0.5 on both  Win ME and Linus boxes, 
> where my year 2002 dates are converted back to 2001 when formating 
> with 'strtotime'.
>
> First I post the following variables from an html page to a php page
>
> $date1='12/12/2001'
> $date2='15/01/2002'
>
> I then use date("D M j Y", strtotime($date1);  and date("D M j Y", 
> strtotime($date2)); to store them in an array for screen display.
>
> As the users have the abilty to selected different dates I need to 
> check that 1 is before the other. To do this I have a script 
> timediff() that I pass the two dates to in the above format.
>
> All works fine until the year 2002 is selected. This is part of the
> timediff() code with dispay statements and the result.
>
>          function timediff($date1,$date2) {
>
>            echo 'date1= '."$date1".' ';        // displays  'Wed
> December 12
> 2001'   ....... correct
>            echo 'date2= '."$date2".' ';       //  displays   'Tue
> January 15
> 2002'       ...........correct, all fine so far
>
>             $dd1=date("Ymd", strtotime($date1));
>             $dd2=date("Ymd", strtotime($date2));
>
>            echo 'date1= '.$dd1.'<br>';    // displays  '20011212'
> .......
> correct
>            echo 'date2= '.$dd2.' <br>';   //  displays '20010115
> ...........WRONG
>         }
>
>     It seem that by applying strtotime a 2nd time might cause this 
> problem, as the first application was fine.
>
>     I have tested all possible combinations of strtotime but the year 
> 2002 always goes back to 2001 Have also tried just 'strtotime($date1)'

> but same problem again.
>
> Any help or comments would be greatly appreciated as I thought I had 
> finished a booking program any now find this!!
>
> Thanks in anticipation
>
>
> John Clarke
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED] To 
> contact the list administrators, e-mail: [EMAIL PROTECTED]
>



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED] To
contact the list administrators, e-mail: [EMAIL PROTECTED]





I'm still running 4.0.5 because that is what my web host is running.
Methinks there may be a problem here.

In the meantime I've tried storing the dates in the array in the original
format in lieu of the fully converted format.
I then reformat the original from the array as required for each page
display or time difference calculation.
This works fine, so I might stick with it.
In hindsight, it is probaly the way I should have gone in the first place as
you pointed out. That way I can play with the date, month and year any way I
want.

Thanks for you input.

John


"Niklas lampén" <[EMAIL PROTECTED]> wrote in message
000401c1636f$fd37d960$ba93c5c3@Niklas">news:000401c1636f$fd37d960$ba93c5c3@Niklas...
Great. :)

I've got PHP 4.0.6 on linux. You?

I think you should break the dates manually, it would be the most sure
way to do it.


Niklas


-----Original Message-----
From: John Clarke [mailto:[EMAIL PROTECTED]]
Sent: 2. marraskuuta 2001 9:11
To: [EMAIL PROTECTED]
Subject: Re: [PHP] year 2002 strtotime problem


Even more funny...

I cut and pasted your code and I got;

Wed Dec 12 2001
Sat Mar 1 2003
2001-12-12
2001-03-01

What version of Php and OS are you using??

John

"Niklas lampén" <[EMAIL PROTECTED]> wrote in message
000301c16369$6817a320$ba93c5c3@Niklas">news:000301c16369$6817a320$ba93c5c3@Niklas...
> Funny, I quickly tried this:
>
> <?
> $date1 = "12/12/2001";
> $date2 = "15/01/2002";
>
> $date1 = date("D M j Y", strtotime($date1));
> $date2 = date("D M j Y", strtotime($date2));
>
> print $date1."<br>";
> print $date2."<br>";
>
> print date("Y-m-d", strtotime($date1))."<br>";
> print date("Y-m-d", strtotime($date2))."<br>";
> ?>
>
> And the result was this:
> "
> Wed Dec 12 2001
> Sat Mar 1 2003
> 2001-12-12
> 2003-03-01
> "
>
>
> Niklas
>
>
> -----Original Message-----
> From: John Clarke [mailto:[EMAIL PROTECTED]]
> Sent: 2. marraskuuta 2001 8:17
> To: [EMAIL PROTECTED]
> Subject: [PHP] year 2002 strtotime problem
>
>
> I have this problem with Php 4.0.5 on both  Win ME and Linus boxes,
> where my year 2002 dates are converted back to 2001 when formating
> with 'strtotime'.
>
> First I post the following variables from an html page to a php page
>
> $date1='12/12/2001'
> $date2='15/01/2002'
>
> I then use date("D M j Y", strtotime($date1);  and date("D M j Y",
> strtotime($date2)); to store them in an array for screen display.
>
> As the users have the abilty to selected different dates I need to
> check that 1 is before the other. To do this I have a script
> timediff() that I pass the two dates to in the above format.
>
> All works fine until the year 2002 is selected. This is part of the
> timediff() code with dispay statements and the result.
>
>          function timediff($date1,$date2) {
>
>            echo 'date1= '."$date1".' ';        // displays  'Wed
> December 12
> 2001'   ....... correct
>            echo 'date2= '."$date2".' ';       //  displays   'Tue
> January 15
> 2002'       ...........correct, all fine so far
>
>             $dd1=date("Ymd", strtotime($date1));
>             $dd2=date("Ymd", strtotime($date2));
>
>            echo 'date1= '.$dd1.'<br>';    // displays  '20011212'
> .......
> correct
>            echo 'date2= '.$dd2.' <br>';   //  displays '20010115
> ...........WRONG
>         }
>
>     It seem that by applying strtotime a 2nd time might cause this
> problem, as the first application was fine.
>
>     I have tested all possible combinations of strtotime but the year
> 2002 always goes back to 2001 Have also tried just 'strtotime($date1)'

> but same problem again.
>
> Any help or comments would be greatly appreciated as I thought I had
> finished a booking program any now find this!!
>
> Thanks in anticipation
>
>
> John Clarke
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED] To
> contact the list administrators, e-mail: [EMAIL PROTECTED]
>



--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED] To
contact the list administrators, e-mail: [EMAIL PROTECTED]







On Thu, 1 Nov 2001, Jason Murray wrote:

> > > You'll also need to compile php as a standalone, and put as 
> > > the first line of your php script
> > > 
> > > #!/path/to/php -q
> > 
> > What if we need both version??
> 
> There's nothing stopping you running both.

How do you compile it for both?

Adrian





On Fri,  2 Nov 2001 15:09, Adrian D'Costa wrote:
> On Thu, 1 Nov 2001, Jason Murray wrote:
> > > > You'll also need to compile php as a standalone, and put as
> > > > the first line of your php script
> > > >
> > > > #!/path/to/php -q
> > >
> > > What if we need both version??
> >
> > There's nothing stopping you running both.
>
> How do you compile it for both?
>
> Adrian

To do the cgi compile, use all the configure values you need EXCEPT 
anything apache related. The compile will produce an executable called, 
strangely, php.

I think there are a few lines in the docs about it somewhere in the 
compile section.
-- 
David Robley      Techno-JoaT, Web Maintainer, Mail List Admin, etc
CENTRE FOR INJURY STUDIES      Flinders University, SOUTH AUSTRALIA  

   "I think someone electrified the corridor," Tom said haltingly.




>    "I think someone electrified the corridor," Tom said haltingly.

^^^^^^

shouldnt that be "shockingly"?

:p





On Fri, 2 Nov 2001, David Robley wrote:

> > > > What if we need both version??
> > >
> > > There's nothing stopping you running both.
> >
> > How do you compile it for both?
> >
> > Adrian
> 
> To do the cgi compile, use all the configure values you need EXCEPT 
> anything apache related. The compile will produce an executable called, 
> strangely, php.

Will it work with apache then?

Adrian





Matt,
  It sounds like you have a process where the user does this:

  page1.php ->
   fills out and submits form ->
    page2.php which builds a frameset ->
     menu.php and editor.php as the frames, you want menu.php to
     know what the submitted form values were.

  If you've got sessions going cram them into the session, which would
be the easiest probably.  But if you don't, I'd suggest tacking the
variables on the end of the menu.php url something like this:

<frame src="menu.php?var1=<? print val1; ?>&...&varN=<? print valN; ?>" 
name="menuFrame">

  If the amnount of data is too large to do via a get (I can't remember
how much it is, several K at least), you'll have to use some alternative
method to pass them around, a temp file would work, or stuff them into a
database and pull them out again (making sure to pass how to find them
to menu.php).

--Brent
[EMAIL PROTECTED] -- www.spek.org

On Thu, 2001-11-01 at 15:08, Matt Fair wrote:
> I have 2 pages page1.php and page2.php.  I want to submit the form and 
> its values to page2.php.  page2.php has frames:
> <frameset rows="218,*">
> <frame src="menu.php" name="menuFrame">
> <frame src="editor.php" name="editorFrame">
> </frameset>
> How can I get the variables that were submitted from page1.php into the 
> menuFrame?  When I do this it doesn't get any php variables, but if I 
> take it out of the frame it works fine.
> Thanks in advance,
> Matt





I'm having a wierd problem with mySQL query.
 
$Query = "SELECT UCASE(Company), Icons, ID, LogoD FROM feComps....";
 
returns right amount of rows, but field Company is empty. 
 
$Query = "SELECT Company, Icons, ID, LogoD FROM feComps.....";
 
works fine.
 
 
First query works great when I run it in shell. What could cause this?
 
 
Niklas




Try this

$Query = "SELECT UCASE(Company) as company,  Icons, ID, LogoD FROM
feComps....";
List ( $company, $icons, etc ) = mysql_fetch_row( );




> -----Original Message-----
> From: Niklas Lamp&igr;n [mailto:[EMAIL PROTECTED]] 
> Sent: Friday, November 02, 2001 10:22 AM
> To: Php-General
> Subject: [PHP] mySQL problem
> 
> 
> I'm having a wierd problem with mySQL query.
>  
> $Query = "SELECT UCASE(Company), Icons, ID, LogoD FROM feComps....";
>  
> returns right amount of rows, but field Company is empty. 
>  
> $Query = "SELECT Company, Icons, ID, LogoD FROM feComps.....";
>  
> works fine.
>  
>  
> First query works great when I run it in shell. What could cause this?
>  
>  
> Niklas
> 





Try this

$Query = "SELECT UCASE(Company) as company,  Icons, ID, LogoD FROM
feComps....";
List ( $company, $icons, etc ) = mysql_fetch_row( );




> -----Original Message-----
> From: Niklas Lamp&igr;n [mailto:[EMAIL PROTECTED]] 
> Sent: Friday, November 02, 2001 10:22 AM
> To: Php-General
> Subject: [PHP] mySQL problem
> 
> 
> I'm having a wierd problem with mySQL query.
>  
> $Query = "SELECT UCASE(Company), Icons, ID, LogoD FROM feComps....";
>  
> returns right amount of rows, but field Company is empty. 
>  
> $Query = "SELECT Company, Icons, ID, LogoD FROM feComps.....";
>  
> works fine.
>  
>  
> First query works great when I run it in shell. What could cause this?
>  
>  
> Niklas
> 





"SELECT UCASE(Company) AS Company...." works great, thanks!


Niklas


-----Original Message-----
From: Dimitris Kossikidis [mailto:[EMAIL PROTECTED]] 
Sent: 2. marraskuuta 2001 11:11
To: 'Niklas Lamp¨¦n'
Cc: PHP General
Subject: RE: [PHP] mySQL problem


Try this

$Query = "SELECT UCASE(Company) as company,  Icons, ID, LogoD FROM
feComps...."; List ( $company, $icons, etc ) = mysql_fetch_row( );




> -----Original Message-----
> From: Niklas Lamp¦Én [mailto:[EMAIL PROTECTED]]
> Sent: Friday, November 02, 2001 10:22 AM
> To: Php-General
> Subject: [PHP] mySQL problem
> 
> 
> I'm having a wierd problem with mySQL query.
>  
> $Query = "SELECT UCASE(Company), Icons, ID, LogoD FROM feComps....";
>  
> returns right amount of rows, but field Company is empty.
>  
> $Query = "SELECT Company, Icons, ID, LogoD FROM feComps.....";
>  
> works fine.
>  
>  
> First query works great when I run it in shell. What could cause this?
>  
>  
> Niklas
> 






The issue here is that you aren't getting an index of "Company" from that
query.  It is probably stored under the index of "UCASE(Company)".  Try:

$Query = "SELECT UCASE(Company) as ucCompany, Icons, ID,...";

Then the ucCompany field will contain your capitalized company data.

Jon

-----Original Message-----
From: Niklas Lampén [mailto:[EMAIL PROTECTED]]
Sent: Friday, November 02, 2001 2:22 AM
To: Php-General
Subject: [PHP] mySQL problem


I'm having a wierd problem with mySQL query.

$Query = "SELECT UCASE(Company), Icons, ID, LogoD FROM feComps....";

returns right amount of rows, but field Company is empty.

$Query = "SELECT Company, Icons, ID, LogoD FROM feComps.....";

works fine.


First query works great when I run it in shell. What could cause this?


Niklas





Hi,

Can someone help me on how i could generate or create a pdf file an fill contents

Rgds
Krushna Kumar




[EMAIL PROTECTED] (Krushna Kumar) wrote:

 > Hi,
>
 > Can someone help me on how i could generate or create a pdf file an fill contents

php.net/pdf

I would recommend you to take a look at this lib for creating pdf's
it's way easier than doing it 'by hand' yourself.

http://sourceforge.net/projects/pc4p/

-- 
Henrik Hansen




hi,

it happens to me quite often that after testing a mysql table or after
deleting several rows that there are gaps in the numeration of my 'id
field' (key).

i always use the same field type for my 'id field:'
id int(255) unsigned NOT NULL auto_increment,

what is the best way to quickly correct the numeration in my id field,
so that gaps are removed and the numeration is correct again?

by 'gaps', i'm referring to when this auto_increment field has listings
like
1
2
3
7
8
9
13

i have an sql snippet like this:
ALTER TABLE mail_form2 ADD new_id INT UNSIGNED NOT NULL AUTO_INCREMENT,
ADD INDEX (new_id);

but this always creates the new key as the very last column in the
table.  also, i have to delete my original key first, or i get an
error-message. isn't there a fast & simple way to correct a key-index?

many thanks,

tom




Mark Roedel wrote:
> Perhaps a quick re-read of the date_format() section of
> http://www.mysql.com/doc/D/a/Date_and_time_functions.html
> is in order?  (Hint: the % characters mean something.)

Thank you very much!  That's odd ... in previous scripts I've written
there wasn't a need for the % character.  Just how long has this change
been intact, anyway?

--
 -Ryan :: ICQ - 595003 :: GigaBoard - http://www.gigaboard.net/






Mark Roedel wrote:
> Perhaps a quick re-read of the date_format() section of
> http://www.mysql.com/doc/D/a/Date_and_time_functions.html
> is in order?  (Hint: the % characters mean something.)

Thank you very much!  That's odd ... in previous scripts I've written
there wasn't a need for the % character.  Just how long has this change
been intact, anyway?

--
 -Ryan :: ICQ - 595003 :: GigaBoard - http://www.gigaboard.net/






I have a small but serious problem:

In a webproject of mine a user can select a link to get a compressed archive of files.
The system works in this order:
1 -User clicks the link "download all"
2 ->PHP generates the ZIP-compressed file and presents the user the next website with 
a link "File Archive"
3 -User clicks the link "File Archive"
4 ->PHP reads the file, deletes it and puts it to the browser

Now, where is the problem:
some browsers request the link in step 3 a first time and present the user then a 
dialog "Save file to" (or something similar) and after that dialog those browsers 
request the link a second time. But because PHP doesn't "know" that the browser hasn't 
really downloaded the file but only presented the user some dialog, it has the file 
already deleted. So the second time the browser downloads only my error message 
"Download-Link expired".

How can I do a workaround?
I tried to send a header that it is a .zip file. Didn't work.
I tried to send data without header at all. Didn't work.
I tried several other stupid things which all didn't work.

For some reasons I _have_ to delete the file after beeing downloaded. So I have to 
either find out if the browser only requested the header but not the file (so I can 
let it there and don't delete it) or I have to find a way that the browser request 
that thing only once (which is obviously possible because some IE Versions under 
Windows encountered no problems with that)

Has someone an Idea or a working work-around?

Any help would be appreciated...

Best regards
Stefan Rusterholz, [EMAIL PROTECTED]
----------------------------------
interaktion gmbh
Stefan Rusterholz
Zürichbergstrasse 17
8032 Zürich
----------------------------------
T. +41 1 253 19 55
F. +41 1 253 19 56
W3 www.interaktion.ch
----------------------------------




> Any idea how to use (install) asian fonts on an 
> english version of RH? I need them in the gd 
> library, to generate an image with chinese/japanese
> text.

Configure php with the following:

--with-gd=/tmp/www/gd-2.0.1
--with-freetype-dir=/usr/local/include/freetype2
--enable-gd-imgstrttf

Then just obtain some chinese/japanese true type fonts and use the
following script below and substitute arial.ttf for the asian font:

<?php
################################################
### draw an image for the header and print some stuff on it.
###############################################

## tell the browser what it is
header("Content-type: image/jpeg");

## draw a new image
$width = 600;
$height = 100;
$image = imagecreate($width, $height);

##make the background same as page
$backg = imagecolorallocate($image, 0, 51, 102);

##make the text white
$text = imagecolorallocate($image, 255, 255, 255);

imagefilledrectangle($image, 0, 0, $width, $height, $backg);

## now let's print some text to the image
imagettftext($image, 40, 0, 60, 75, $text,"/home/www/htdocs/arial.ttf",
"some guy");

## off it goes
imagejpeg($image);

## cleanup
imagedestroy($image);

?>






Hi,

Can someone help me on how i could generate or create a pdf file an fill contents, i 
heard i need a pdf library file installed, I am using windows98, PWS, how do i install 
the libraries.

Rgds
Krushna Kumar




[EMAIL PROTECTED] (Krushna Kumar) wrote:

 > Hi,
>
 > Can someone help me on how i could generate or create a pdf file an
 > fill contents, i heard i need a pdf library file installed, I am using
 > windows98, PWS, how do i install the libraries.

download a dll from phplib.com and enable it in php.ini as all other extentions.

-- 
Henrik Hansen




hi,
on my web site i have an option that user can add their comments about my
articles. I have table articles, and table comments. On table comments
column unique id (auto increment) and articleid. It displays them and sort
coments by unique id. When i delete eg. comment number 4, next comment is
eg.comment number 23. That new comment has unique id 23, but it is placed
instead id comment 4, so i get:

1 comment
2 comment
3 comment
23 comment
4 comment

is this wrong?

-----------------
volim popit, volim zagalamit











Hey there,

these are the editors given by you guys, thanks for the replies. If somebody 
could put this online on php.net it would be great. If you have anything to 
add please feel free to email me.

Windows

UltraEdit
ActiveState Komodo
EditPlus
HTML-Kit
Homesite




Linux/Unix

Nedit
(x)emacs
Visual SlickEdit
vim/gvim
ActiveState Komodo
Beaver
Cooledit
KWrite (included with KDE, PHP highlighting since KDE 2.2.1 maybe 2.2.0 also 
haven't used that version 2.1.2 doesn't support PHP)





There's vim/gvim for Windows and Mac.

Personally I use gvim 6 on Windows

Thomas.



>these are the editors given by you guys, thanks for the replies. If somebody
>could put this online on php.net it would be great. If you have anything to
>add please feel free to email me.
>
>Windows
>
>UltraEdit
>ActiveState Komodo
>EditPlus
>HTML-Kit
>Homesite
>
>
>
>
>Linux/Unix
>
>Nedit
>(x)emacs
>Visual SlickEdit
>vim/gvim
>ActiveState Komodo
>Beaver
>Cooledit
>KWrite (included with KDE, PHP highlighting since KDE 2.2.1 maybe 2.2.0 also
>haven't used that version 2.1.2 doesn't support PHP)
>
>--
>PHP General Mailing List (http://www.php.net/)
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]
>To contact the list administrators, e-mail: [EMAIL PROTECTED]






For UltraEdit I have edited the words file a bit and added PHP as language
so that it highlights PHP commands as well.
(I haven't included all commands, but a lot)

Just if someone is interested, he/she can send me an email with subject
"UltraEdit Wordfile" :-)

Stefan Rusterholz, [EMAIL PROTECTED]

----- Original Message -----
From: "TD - Sales International Holland B.V." <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, November 02, 2001 7:31 PM
Subject: [PHP] PHP Highlighting Text Editors


> Hey there,
>
> these are the editors given by you guys, thanks for the replies. If
somebody
> could put this online on php.net it would be great. If you have anything
to
> add please feel free to email me.
>
> Windows
>
> UltraEdit
> ActiveState Komodo
> EditPlus
> HTML-Kit
> Homesite
>
>
>
>
> Linux/Unix
>
> Nedit
> (x)emacs
> Visual SlickEdit
> vim/gvim
> ActiveState Komodo
> Beaver
> Cooledit
> KWrite (included with KDE, PHP highlighting since KDE 2.2.1 maybe 2.2.0
also
> haven't used that version 2.1.2 doesn't support PHP)
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>
>
>





Hi,

does anyone have the script that is supposed to be stored at
http://hrs.rics.ru/?

Or does anyone know of any other hotel booking system or a similar script in
php? I am mainly interested in the concept of the system. Database relations
and buildup.

Regards
# Daniel Alsén    | www.mindbash.com #
# [EMAIL PROTECTED]  | +46 704 86 14 92 #
# ICQ: 63006462   |                  #





interesting one here for y'all

 if you use client side JavaScript to write HTML to the browser, eg
<script language="JavaScript"
document.write ('<b>Hello world!</b>');
</script>
then look at the page source from IE, the page source will show you exactly
what I've typed above, whereas if you view the page source from Netscape
4.7, it shows this in the source:
<b>Hello world!</b>
(this is the way I ewould expect and want it work)

Unfortunately the (rather complex) script I'm writing does completely
different stuff in Netscrape so looking at the page source thru there to see
what's going on is hopeless - is there any way to make IE behave like NS in
this respect and actually show the correct JavaScript output, rather than
the JavaScript code itself??

Cannot believe that NS4.7 is actually better at doing something than IE!!!

--
Moloko
'When the going gets weird, the weird turn pro' - Dr Gonzo
GCM/CS/IT/MC d-- S++:- a-- C++ U--- P+ L !E W+++$ N+ K+ w+++$ M+ PS+++ PE-
PGP- t+ 5- X-- R* tv++ b+++ DI++++ D G e h-- r++ y++






I've tried the recode(), but I think I didn't uderstand it's functionality,
since nothing happens. can someone has an idea in how to convert for example
a string posted by a form in this format "são paulo" to this "sao paulo"??
Does anyone knows how Macintosh's browsers send this special caracteres to
PHP???

Thank's again

Rodrigo Peres




on 11/1/01 9:17 PM, Yasuo Ohgaki at [EMAIL PROTECTED] wrote:

> Rodrigo Peres wrote:
> 
>> Hi list,
>> 
>> I'm in a big trouble. I'm brazilian, so I've made a script to clean up the
>> special caracters from our language in order to not mess up my publisher,
>> but this script don't work in Macintosh (macos 9.1, IE 5, all in american
>> english).
>> 
>> This is my code
>> 
>> 
>> <?
>> function myclean(&$name) {
>> $name = strtolower(strtr($name,
>> "áéíóúàèìòùäëïöüâêîôûãçÁÉÍÓÚÀÈÌÒÙÄËÏÖÜÂÊÎÔÛÃÇ ",
>> "aeiouaeiouaeiouaeiouacAEIOUAEIOUAEIOUAEIOUAC"));
>> return $name;
>> }
>> $temp = myclean($name_actor);
>> echo($temp);
>> ?>
>> 
>> What happens is if i try for example to clean up "São Paulo" it prints "são
>> paulo". Why??
>> The "$name" will receive a string form a text field in a form. my html
>> charset is iso-8859-1
> 
> 
> I think you are better to use recode extension for this.
> Check out recode manual page.
> 
> --
> Yasuo Ohgaki
> 

-- 






I have little experience with this kind of problem.
None of the Browsers I used under mac (IE 4 - 5 and sever NS 4.x) has sent
the data different than Windows Browsers. But avoid the meta-tag charset. I
had serious problems when the HTML-file where the form data came from had
that tag set (but I didn't spend a lot of time investigating it).

Anyway: why do you want to translate a ã to an a?
I made good experiences with storing original chars and using htmlentities()
(or otherway round if you don't have to edit that stuff)

Stefan Rusterholz, [EMAIL PROTECTED]
----------------------------------
interaktion gmbh
Stefan Rusterholz
Zürichbergstrasse 17
8032 Zürich
----------------------------------
T. +41 1 253 19 55
F. +41 1 253 19 56
W3 www.interaktion.ch
----------------------------------

----- Original Message -----
From: "Rodrigo Peres" <[EMAIL PROTECTED]>
To: "Yasuo Ohgaki" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Friday, November 02, 2001 2:51 PM
Subject: Re: [PHP] Re: Problem with non us caracters and "strtr"


> I've tried the recode(), but I think I didn't uderstand it's
functionality,
> since nothing happens. can someone has an idea in how to convert for
example
> a string posted by a form in this format "são paulo" to this "sao paulo"??
> Does anyone knows how Macintosh's browsers send this special caracteres to
> PHP???
>
> Thank's again
>
> Rodrigo Peres
>
>
>
>
> on 11/1/01 9:17 PM, Yasuo Ohgaki at [EMAIL PROTECTED] wrote:
>
> > Rodrigo Peres wrote:
> >
> >> Hi list,
> >>
> >> I'm in a big trouble. I'm brazilian, so I've made a script to clean up
the
> >> special caracters from our language in order to not mess up my
publisher,
> >> but this script don't work in Macintosh (macos 9.1, IE 5, all in
american
> >> english).
> >>
> >> This is my code
> >>
> >>
> >> <?
> >> function myclean(&$name) {
> >> $name = strtolower(strtr($name,
> >> "áéíóúàèìòùäëïöüâêîôûãçÁÉÍÓÚÀÈÌÒÙÄËÏÖÜÂÊÎÔÛÃÇ ",
> >> "aeiouaeiouaeiouaeiouacAEIOUAEIOUAEIOUAEIOUAC"));
> >> return $name;
> >> }
> >> $temp = myclean($name_actor);
> >> echo($temp);
> >> ?>
> >>
> >> What happens is if i try for example to clean up "São Paulo" it prints
"são
> >> paulo". Why??
> >> The "$name" will receive a string form a text field in a form. my html
> >> charset is iso-8859-1
> >
> >
> > I think you are better to use recode extension for this.
> > Check out recode manual page.
> >
> > --
> > Yasuo Ohgaki
> >
>
> --
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>
>
>





I need to transalte the chars because the system will create folder
automatically, base in the name entered in this fields, so if it contains
illegal chars....

Rodrigo



on 11/2/01 11:10 AM, Stefan Rusterholz at [EMAIL PROTECTED] wrote:

> I have little experience with this kind of problem.
> None of the Browsers I used under mac (IE 4 - 5 and sever NS 4.x) has sent
> the data different than Windows Browsers. But avoid the meta-tag charset. I
> had serious problems when the HTML-file where the form data came from had
> that tag set (but I didn't spend a lot of time investigating it).
> 
> Anyway: why do you want to translate a ã to an a?
> I made good experiences with storing original chars and using htmlentities()
> (or otherway round if you don't have to edit that stuff)
> 
> Stefan Rusterholz, [EMAIL PROTECTED]
> ----------------------------------
> interaktion gmbh
> Stefan Rusterholz
> Zürichbergstrasse 17
> 8032 Zürich
> ----------------------------------
> T. +41 1 253 19 55
> F. +41 1 253 19 56
> W3 www.interaktion.ch
> ----------------------------------
> 
> ----- Original Message -----
> From: "Rodrigo Peres" <[EMAIL PROTECTED]>
> To: "Yasuo Ohgaki" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
> Sent: Friday, November 02, 2001 2:51 PM
> Subject: Re: [PHP] Re: Problem with non us caracters and "strtr"
> 
> 
>> I've tried the recode(), but I think I didn't uderstand it's
> functionality,
>> since nothing happens. can someone has an idea in how to convert for
> example
>> a string posted by a form in this format "são paulo" to this "sao paulo"??
>> Does anyone knows how Macintosh's browsers send this special caracteres to
>> PHP???
>> 
>> Thank's again
>> 
>> Rodrigo Peres
>> 
>> 
>> 
>> 
>> on 11/1/01 9:17 PM, Yasuo Ohgaki at [EMAIL PROTECTED] wrote:
>> 
>>> Rodrigo Peres wrote:
>>> 
>>>> Hi list,
>>>> 
>>>> I'm in a big trouble. I'm brazilian, so I've made a script to clean up
> the
>>>> special caracters from our language in order to not mess up my
> publisher,
>>>> but this script don't work in Macintosh (macos 9.1, IE 5, all in
> american
>>>> english).
>>>> 
>>>> This is my code
>>>> 
>>>> 
>>>> <?
>>>> function myclean(&$name) {
>>>> $name = strtolower(strtr($name,
>>>> "áéíóúàèìòùäëïöüâêîôûãçÁÉÍÓÚÀÈÌÒÙÄËÏÖÜÂÊÎÔÛÃÇ ",
>>>> "aeiouaeiouaeiouaeiouacAEIOUAEIOUAEIOUAEIOUAC"));
>>>> return $name;
>>>> }
>>>> $temp = myclean($name_actor);
>>>> echo($temp);
>>>> ?>
>>>> 
>>>> What happens is if i try for example to clean up "São Paulo" it prints
> "são
>>>> paulo". Why??
>>>> The "$name" will receive a string form a text field in a form. my html
>>>> charset is iso-8859-1
>>> 
>>> 
>>> I think you are better to use recode extension for this.
>>> Check out recode manual page.
>>> 
>>> --
>>> Yasuo Ohgaki
>>> 
>> 
>> --
>> 
>> 
>> 
>> --
>> PHP General Mailing List (http://www.php.net/)
>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>> For additional commands, e-mail: [EMAIL PROTECTED]
>> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>> 
>> 
>> 
> 

-- 






Hello,

> can someone has an idea in how to convert for example
> > a string posted by a form in this format "são paulo" to this "sao
paulo"??

function remove_accents( $str ){
  if( strlen( $str ) == 0 )
    return $str;
  else
    $ret = strtr($str,
"ÀÁÂÃÄÅÇÈÉÊËÌÍÎÏÒÓÔÕÖÙÚÛÜÝàáâãäåçèéêëìíîïðòóôõöùúûüýÿ",
"AAAAAACEEEEIIIIOOOOOUUUUYaaaaaaceeeeiiiioooooouuuuyy");
    return $ret;
}

hope it helps,
py

----- Original Message -----
From: "Stefan Rusterholz" <[EMAIL PROTECTED]>
To: "Rodrigo Peres" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Friday, November 02, 2001 9:10 AM
Subject: Re: [PHP] Re: Problem with non us caracters and "strtr"


> I have little experience with this kind of problem.
> None of the Browsers I used under mac (IE 4 - 5 and sever NS 4.x) has sent
> the data different than Windows Browsers. But avoid the meta-tag charset.
I
> had serious problems when the HTML-file where the form data came from had
> that tag set (but I didn't spend a lot of time investigating it).
>
> Anyway: why do you want to translate a ã to an a?
> I made good experiences with storing original chars and using
htmlentities()
> (or otherway round if you don't have to edit that stuff)
>
> Stefan Rusterholz, [EMAIL PROTECTED]
> ----------------------------------
> interaktion gmbh
> Stefan Rusterholz
> Zürichbergstrasse 17
> 8032 Zürich
> ----------------------------------
> T. +41 1 253 19 55
> F. +41 1 253 19 56
> W3 www.interaktion.ch
> ----------------------------------
>
> ----- Original Message -----
> From: "Rodrigo Peres" <[EMAIL PROTECTED]>
> To: "Yasuo Ohgaki" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
> Sent: Friday, November 02, 2001 2:51 PM
> Subject: Re: [PHP] Re: Problem with non us caracters and "strtr"
>
>
> > I've tried the recode(), but I think I didn't uderstand it's
> functionality,
> > since nothing happens. can someone has an idea in how to convert for
> example
> > a string posted by a form in this format "são paulo" to this "sao
paulo"??
> > Does anyone knows how Macintosh's browsers send this special caracteres
to
> > PHP???
> >
> > Thank's again
> >
> > Rodrigo Peres
> >
> >
> >
> >
> > on 11/1/01 9:17 PM, Yasuo Ohgaki at [EMAIL PROTECTED] wrote:
> >
> > > Rodrigo Peres wrote:
> > >
> > >> Hi list,
> > >>
> > >> I'm in a big trouble. I'm brazilian, so I've made a script to clean
up
> the
> > >> special caracters from our language in order to not mess up my
> publisher,
> > >> but this script don't work in Macintosh (macos 9.1, IE 5, all in
> american
> > >> english).
> > >>
> > >> This is my code
> > >>
> > >>
> > >> <?
> > >> function myclean(&$name) {
> > >> $name = strtolower(strtr($name,
> > >> "áéíóúàèìòùäëïöüâêîôûãçÁÉÍÓÚÀÈÌÒÙÄËÏÖÜÂÊÎÔÛÃÇ ",
> > >> "aeiouaeiouaeiouaeiouacAEIOUAEIOUAEIOUAEIOUAC"));
> > >> return $name;
> > >> }
> > >> $temp = myclean($name_actor);
> > >> echo($temp);
> > >> ?>
> > >>
> > >> What happens is if i try for example to clean up "São Paulo" it
prints
> "são
> > >> paulo". Why??
> > >> The "$name" will receive a string form a text field in a form. my
html
> > >> charset is iso-8859-1
> > >
> > >
> > > I think you are better to use recode extension for this.
> > > Check out recode manual page.
> > >
> > > --
> > > Yasuo Ohgaki
> > >
> >
> > --
> >
> >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> > To contact the list administrators, e-mail: [EMAIL PROTECTED]
> >
> >
> >
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>





A big thank you to everyone with the help on the ftp module.  I was able 
to finish my project in a few days and my boss thinks I am a hero.  Of 
course he thinks I am using perl too.  :)

-Scott






Hello
I'm making vbulletin foru hack, that allows to rate members

my code is just 50 lines, I set link to my script from vBulletin page,
and after it has been clicked code executes, and then i want to return
user to the page where he clicked the link leading to my code, i was
wondering how can this be done, use REFERER and then header("Locatiom:
$REFERER";), will this work?


Thank you very much





[EMAIL PROTECTED] (Daniel Harik) wrote:

 > Hello
 > I'm making vbulletin foru hack, that allows to rate members
>
 > my code is just 50 lines, I set link to my script from vBulletin page,
 > and after it has been clicked code executes, and then i want to return
 > user to the page where he clicked the link leading to my code, i was
 > wondering how can this be done, use REFERER and then header("Locatiom:
 > $REFERER";), will this work?

the best thing to do is register the page the user came from, using
get or post variables, because some browers dont use referers
etc. then just use a header("Location: $theUrl"); where $theUrl is the
url the user came from.

-- 
Henrik Hansen




Easier solution:     mysql_data_seek (resource result_identifier, int
row_number)

Example:
$query = "SELECT * FROM mytable";
$result = mysql_query($query) or die("Error: ".mysql_error());
while ($row = mysql_fetch_row($result) )
{
   ...do some stuff...
}
mysql_data_seek($result, 0 );
while ($row = mysql_fetch_row($result) )
{
   ...do some other stuff...
}

Thus, you don't have to store it in an array.

-----Original Message-----
From: Chris Lee [mailto:[EMAIL PROTECTED]]
Sent: Thursday, November 01, 2001 7:20 PM
To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Subject: [PHP-DB] Re: Using A Query Results Multiple Times


just put it in a loop.

while($val = mysql_fetch_result($result))
  $array[] = $val;

foreach($count = 0; $count < count($array); $count++)
  echo $array[$count]['product_name'];
foreach($count = 0; $count < count($array); $count++)
  echo $array[$count]['product_name'];

php4 has foreach() its better, think of upgrading, there are numerous
reasons.

--

  Chris Lee
  [EMAIL PROTECTED]



"Adam Douglas" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]...
> I have an instance where I have to query my MySQL database and then
> use the multiple row results to create multiple pull down menus on a web
> page. My problem is how can I take the results of the query and use them
> more the once to create pull down menus? I've always used a while look to
> fetch each row of the results and have it create the pull down menu as it
> goes through each row. But doing it this way only stores one row of
results
> in a variable. Is there a way I can grab all the results from a query that
> would go into an array so I could use it multiple times? I've lookingere
> briefly for a function to MySQL that would allow me to do this but haven't
> found anything unless I misunderstand mysql_fetch_array function. At first
I
> thought I could loop through my while loop and have it put the results
from
> the query of each row in to a multidimensional array. But then how would I
> add to the array after the initial row?
>
> BTW, I'm using PHP 3.0.16.... so I can't use the added array functions
that
> PHP 4 has. I do plan on upgrading soon.
>



-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]






hi,

i was wondering if anyone has some sample code / links which could help
me generate HTML forms dynamically from the fields/types/lengths of
tables in a mySQL database.

ie, if i had a three column table with first (varchar 50), last (varchar
80) & bio (medium text) as the columns, it'd be great if i could use
this information about the *table* to build a html form.

in otherwords, I could generate an <INPUT> named "first" who's max
length was 50, annother called "last" with a maxlength of 80, and a
<TEXTAREA> named "bio" for the medium text, etc etc.


sorry i can't describe it any better!!


i guess programs like phpMyAdmin achieve this, but i'd rather see a
small code snippet and LEARN rather than dig through 1000's of lines of
phpMyAdmin code :)


thanks,

justin french




Take a look at that:
http://www.mysql.com/doc/S/H/SHOW.html
and
http://www.mysql.com/doc/D/E/DESCRIBE.html

I fear you have to parse necessary information out of a statment like this:
$result = mysql_query("DESCRIBE yourTable");
$tabelDesc = mysql_fetch_array($result);

I didn't spend any time checking it but I think it could work.
Good luck!

PS: if you make progress with that I was also interested in informations
about this kind of stuff - please send a mail :)

Stefan Rusterholz, [EMAIL PROTECTED]
----------------------------------
interaktion gmbh
Stefan Rusterholz
Zürichbergstrasse 17
8032 Zürich
----------------------------------
T. +41 1 253 19 55
F. +41 1 253 19 56
W3 www.interaktion.ch
----------------------------------
----- Original Message -----
From: "Justin French" <[EMAIL PROTECTED]>
To: "php" <[EMAIL PROTECTED]>
Sent: Friday, November 02, 2001 3:02 PM
Subject: [PHP] mysql table information


> hi,
>
> i was wondering if anyone has some sample code / links which could help
> me generate HTML forms dynamically from the fields/types/lengths of
> tables in a mySQL database.
>
> ie, if i had a three column table with first (varchar 50), last (varchar
> 80) & bio (medium text) as the columns, it'd be great if i could use
> this information about the *table* to build a html form.
>
> in otherwords, I could generate an <INPUT> named "first" who's max
> length was 50, annother called "last" with a maxlength of 80, and a
> <TEXTAREA> named "bio" for the medium text, etc etc.
>
>
> sorry i can't describe it any better!!
>
>
> i guess programs like phpMyAdmin achieve this, but i'd rather see a
> small code snippet and LEARN rather than dig through 1000's of lines of
> phpMyAdmin code :)
>
>
> thanks,
>
> justin french
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>
>
>





I hope someone has time to help with a regular expression?

I need a regex that will replace get variables, regardless of there location
in a URL, and if the get var does not exist I hope that it will create the
get var in the URL.  Some examples


$REQUEST_URI can look like this "value1":

filename.phtml?test=value1
filename.phtml?another=value&test=value1
filename.phtml
filename.phtml?another=value

The variable $test will either exist preceded by "?" "&" or not at all.

I would like to take a value pair, put it into a function with $REQUEST_URI
and the have a new $REQUEST_URI returned with either the value replaced or
added.

Replacing/adding "value2"

filename.phtml?test=value2
filename.phtml?another=value&test=value2
filename.phtml?test=value2
filename.phtml?another=value&test=value2

The variable located by matching ?test &test or adding it if it does not
exist, with a "?" or a "&"

I currently have a function:

replace_get_var_value($string, $var, $new_value){
        return eregi_replace("&$var=([a-z0-9\+]+)", "&$var=$new_value", $string);
}

But it won't work if the value does not exist, or if the value is the first
variable in the set within $REQUEST_URI.

Example ($REQUEST_URI that will not work with this function)
filename.phml?another=value
filename.phml?var=old_value
filename.phml

The only $REQUEST_URI that this will work with is
filename.phtml?another=value&var=old_value

I hope my description makes sense.  Thanks for any help!

-Rob Z.
http://www.zwink.net





Well, I think I found the solution.  I changed the regex a bit, and added a
condition.  This should work, but if anyone has a better idea please let me
know.


function replace_get_var_value($string, $var, $new_value){
         // substitute value
        $buffer = eregi_replace("([?|&]{1})$var=([a-z0-9\+]+)",
"\\1$var=$new_value", $string);
         // value not found then add it to the REQUEST_URI
        if($buffer==$string){
                if(strchr("?", $buffer)){
                        $buffer = $buffer."&$var=$new_value";
                }else{
                        $buffer = $buffer."?$var=$new_value";
                }
        }
        return $buffer;
}

echo replace_get_var_value($REQUEST_URI, "test", "value2");

Thanks!
Robert Zwink
http://www.zwink.net

-----Original Message-----
From: Robert V. Zwink [mailto:[EMAIL PROTECTED]]
Sent: Friday, November 02, 2001 9:15 AM
To: [EMAIL PROTECTED]
Subject: [PHP] regular experssion help


I hope someone has time to help with a regular expression?

I need a regex that will replace get variables, regardless of there location
in a URL, and if the get var does not exist I hope that it will create the
get var in the URL.  Some examples


$REQUEST_URI can look like this "value1":

filename.phtml?test=value1
filename.phtml?another=value&test=value1
filename.phtml
filename.phtml?another=value

The variable $test will either exist preceded by "?" "&" or not at all.

I would like to take a value pair, put it into a function with $REQUEST_URI
and the have a new $REQUEST_URI returned with either the value replaced or
added.

Replacing/adding "value2"

filename.phtml?test=value2
filename.phtml?another=value&test=value2
filename.phtml?test=value2
filename.phtml?another=value&test=value2

The variable located by matching ?test &test or adding it if it does not
exist, with a "?" or a "&"

I currently have a function:

replace_get_var_value($string, $var, $new_value){
        return eregi_replace("&$var=([a-z0-9\+]+)", "&$var=$new_value", $string);
}

But it won't work if the value does not exist, or if the value is the first
variable in the set within $REQUEST_URI.

Example ($REQUEST_URI that will not work with this function)
filename.phml?another=value
filename.phml?var=old_value
filename.phml

The only $REQUEST_URI that this will work with is
filename.phtml?another=value&var=old_value

I hope my description makes sense.  Thanks for any help!

-Rob Z.
http://www.zwink.net


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]





Hello,

Could be a simple problem, using PHP4 on a Linux/Unix Cobalt RaQ4 server.  I
have been using it fine, but the mail() function wont send mail, even with
the most basic content and lack of headers.

Can anyone offer any advise on what could be the problem, or any scripts I
can use to test the mail() function that will return nice errors to let me
know what's going wrong?

I have tried searching for help, but I have found nothing specific.

Aplogies for such a simple question(?) but I just cant get it to send mail!

Thanks.







Why in these 3 linked page the var "count"
does not go through the page if I have the browser sessions disabled???

Where is the mistake?

I see the session_id, changing at every page!

Someone can help me?
Many thank
Alessandro Bossi

---------------------------------
<?php /* First.php */
session_name(mysession);
session_start();
session_register ("count");

if (isset($submit)){
 header("Location: Seconda.php?".SID);
}else{
 $count++;
}

print "session_encode=>> ".session_encode()."<BR>";

?>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD><TITLE> First Page</TITLE></HEAD>
<BODY BGCOLOR="#A2BBAF">

<H4>First Page</H4>
Hello visitor, you have seen this page <?=$count; ?> times.<p>
count = <?= $HTTP_SESSION_VARS["count"] ?><BR>
<P>

<FORM METHOD=POST ACTION="<?= $PHP_SELF ?>">
<INPUT TYPE="hidden" NAME="count" value="<?=$count?>">
<INPUT TYPE="submit" name=submit value="Go to the SECOND page">
</FORM>

</BODY></HTML>
---------------------------------
<?php /* Second.php */

session_name(mysession);
session_start();
session_register('count');

if (isset($submit)){
 header("Location: Third.php?".SID);
}
print "session_encode=>> ".session_encode()."<BR>";

?>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD><TITLE>Second Page</TITLE></HEAD>
<BODY BGCOLOR="#A2BBAF">

<H4>Second Page</H4>
Hello visitor, you have seen this page <?=$count; ?> times.<p>
count = <?= $HTTP_SESSION_VARS["count"] ?>
<P>
<FORM METHOD=POST ACTION="<?= $PHP_SELF ?>">
<INPUT TYPE="submit" name=submit value="Go to the THIRD Page ">
</FORM>

</BODY>
</HTML>
---------------------------------
<?php /* Third.php */

session_name(mysession);
session_start();
session_register ("count");


if (isset($submit)){
  header("Location: First.php?".SID);
}
print "session_encode=>> ".session_encode()."<BR>";
?>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<TITLE>Third Page</TITLE>
</HEAD>

<BODY BGCOLOR="#A2BBAF">
<H4>Third Page</H4>
Hello visitor, you have seen this page <?=$count; ?> times.<p>
Count = <?= $HTTP_SESSION_VARS["count"] ?>
<P>

<FORM METHOD=POST ACTION="<?= $PHP_SELF ?>">
<INPUT TYPE="submit" name=submit value="Go to the FIRST Page ">
</FORM>

</BODY>
</HTML>





Hi everybody!

I'm new in the list.
I'll help anybody if I can  =)

by now I have a little trouble  ;-)

I have to create a php page where users can upload many files
the idea is that users could select many files by holding down
the shift key... with this I can avoid to put many input tags in my page.
When I use an <input type=file ....> and pass to the next page
a temporary file name ("/var/temp/phpGH65YT") is created.. 
but if I try to use another way to send the file name.. this temp file name is not 
created.
and I just get an "error: I cannot open the file name test.txt in 
/var/html/pages/test.php for reading"

an alternative is in fact of I know the file names that users must upload.
I could ask them for the path and then I'd show a list of files to upload
and users only will have to click on one button.



is it possible to make more easy the file uploading for users?
I mean... is it possible to upload many files without to choose one by one within a 
html page
with many input tags?
 
ooh yes.. I cannot use zipped files not even a ftp connection


best regards
from Chile.



PS:  I apology for my english... I hope that you can understand me   =)



Reply via email to