php-windows Digest 17 Feb 2004 19:08:58 -0000 Issue 2126

Topics (messages 22857 through 22872):

Re: using backslash \ in php
        22857 by: Duane Lakoduk
        22867 by: Svensson, B.A.T. (HKG)

Re: header-session problem
        22858 by: Sudeep Sarath
        22865 by: Svensson, B.A.T. (HKG)
        22868 by: Sudeep Sarath
        22869 by: Svensson, B.A.T. (HKG)

HELP CSV's
        22859 by: dwight ian
        22860 by: idrifter
        22861 by: Angelo Zanetti
        22862 by: Svensson, B.A.T. (HKG)
        22863 by: Svensson, B.A.T. (HKG)
        22864 by: Svensson, B.A.T. (HKG)
        22871 by: Svensson, B.A.T. (HKG)

Re: Convert time
        22866 by: Svensson, B.A.T. (HKG)

Easy install for PHP5
        22870 by: cyruss

ID drscsn... thanks
        22872 by: mike.voyager.unix-systems.net

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 ---
See: stripslashes() and addslashes() functions.


> -----Original Message-----
> From: Harpreet [mailto:[EMAIL PROTECTED]
> Sent: Monday, February 16, 2004 10:01 PM
> To: php-windows
> Subject: [PHP-WIN] using backslash \ in php
> 
> 
> I have a form with a textbox that allows a user to enter the 
> filepath. If i
> enter the file path as c:/ it works just fine.
> 
> If I type in c:\ on submit form it converts the \ to \\ and 
> on every submit
> the number of slashes double. How can I use the backslash as 
> I need the
> backslash for specifing the filepath. How can I stop it to replicate??
> 
> Help is appreciated.
> 
> Thanks,
> 
> Regards
> 

--- End Message ---
--- Begin Message ---
And what happends with the backslaches if some idiot (read: user)
makes this happens:

$dummy = stripslashes("http:\\www.microsoft.hell\");

(Bill's web browser's accepts this syntax)

-----Original Message-----
From: Duane Lakoduk
To: 'Harpreet'; 'php-windows'
Sent: 17-2-2004 5:38
Subject: RE: [PHP-WIN] using backslash \ in php

See: stripslashes() and addslashes() functions.


> -----Original Message-----
> From: Harpreet [mailto:[EMAIL PROTECTED]
> Sent: Monday, February 16, 2004 10:01 PM
> To: php-windows
> Subject: [PHP-WIN] using backslash \ in php
> 
> 
> I have a form with a textbox that allows a user to enter the 
> filepath. If i
> enter the file path as c:/ it works just fine.
> 
> If I type in c:\ on submit form it converts the \ to \\ and 
> on every submit
> the number of slashes double. How can I use the backslash as 
> I need the
> backslash for specifing the filepath. How can I stop it to replicate??
> 
> Help is appreciated.
> 
> Thanks,
> 
> Regards
> 

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

--- End Message ---
--- Begin Message ---
No solution yet for my session-header problem!!!!!!!!
 
 
SuDeEp

Sudeep Sarath <[EMAIL PROTECTED]> wrote:
Dear php-freaks,

My o/s is Windows 98 SE. I am using PWS as my web server and i use recent version of 
php (i guess php 4.3.4). I recently started working on PHP and came across this 
problem.
I have three pages. i.e page1.php, page2.php, page3.php.

Page1.php




 [input] 




Page2.php


session_start();
$_SESSION["check"]=$_POST["t1"];
header("Location: http://www.mypage.com/page3.php";);
?>

Page3.php
session_start();
echo $_SESSION["check"];
?>


So i want page3.php to display what i typed in the text field of page1.php.

But page3.php says undefined variable in $_SESSION........
That means session is lost when i redirect to page3.php from page2.php.

If i echo that SESSION in page2.php itself. It dispalys correctly. So i think that 
there is a problem with header and session. Please anyone tell me how to get over this.




Yahoo! India Insurance Special: Be informed on the best policies, services, tools and 
more.
Yahoo! India Insurance Special: Be informed on the best policies, services, tools and 
more.

--- End Message ---
--- Begin Message ---
Well, I think the call was clear:

Don't run php as a CGI app, or use Apache, or don't page forward. 

-----Original Message-----
From: Sudeep Sarath
To: [EMAIL PROTECTED]
Sent: 17-2-2004 6:11
Subject: Re: [PHP-WIN] header-session problem

No solution yet for my session-header problem!!!!!!!!
 
 
SuDeEp

Sudeep Sarath <[EMAIL PROTECTED]> wrote:
Dear php-freaks,

My o/s is Windows 98 SE. I am using PWS as my web server and i use
recent version of php (i guess php 4.3.4). I recently started working on
PHP and came across this problem.
I have three pages. i.e page1.php, page2.php, page3.php.

Page1.php




 [input] 




Page2.php


session_start();
$_SESSION["check"]=$_POST["t1"];
header("Location: http://www.mypage.com/page3.php";);
?>

Page3.php
session_start();
echo $_SESSION["check"];
?>


So i want page3.php to display what i typed in the text field of
page1.php.

But page3.php says undefined variable in $_SESSION........
That means session is lost when i redirect to page3.php from page2.php.

If i echo that SESSION in page2.php itself. It dispalys correctly. So i
think that there is a problem with header and session. Please anyone
tell me how to get over this.




Yahoo! India Insurance Special: Be informed on the best policies,
services, tools and more.
Yahoo! India Insurance Special: Be informed on the best policies,
services, tools and more.

--- End Message ---
--- Begin Message ---
So, in your opinion there is no solution to this problem other than switching over to 
Apache
 
SuDeEp

Yahoo! India Insurance Special: Be informed on the best policies, services, tools and 
more.

--- End Message ---
--- Begin Message ---
I gave three example solution, didn't I?

But I can make up some more if you want, but then I need to bill you.

On Tue, 2004-02-17 at 11:43, Sudeep Sarath wrote:
> So, in your opinion there is no solution to this problem other than
> switching over to Apache
>  
> SuDeEp
> 
> Yahoo! India Insurance Special: Be informed on the best policies,
> services, tools and more.

--- End Message ---
--- Begin Message ---
Good day to you All,
 
Hi Im working on a project where it is nessary to download the values of the tables in 
the database and 
format them in csv (comma separated values) files in order for them to be viewed in a 
spreadsheet 
application (ie Microsoft Excel).
 
The problem happens when the values in the tables includes commas and new line, it 
disrupts the csv file. 
What will I do?, Please help.

Lycos recommends Cheapflights for all your travel needs. Go to 
http://www.cheapflights.co.uk/?source=lycosgen


--- End Message ---
--- Begin Message ---
To get around the comma problem you can enclose your
fields in quotes:

"column 1 da,ta","colu,mn 2 data","column,3 data"

As far as the newline characters I don't know if its
feasible for your particular project but you could
strip the newline characters out with something like
this:

$new_string = str_replace("\n", "", $old_string);

If you still get little garbage square characters in
excell you may even have to specify "\r\n" instead of
just "\n".


If you do need those newline characters in excell
perhaps you could replace them with something obvious
like:

$new_string = str_replace("\n", "[FIX THIS]",
$old_string);

And then do a find replace on "[FIX THIS]" afterwards
in excell.

Theres probably a more elegant way to do it but I
don't know it ;)

--- dwight ian  <[EMAIL PROTECTED]> wrote:
> Good day to you All,
>  
> Hi Im working on a project where it is nessary to
> download the values of the tables in the database
> and 
> format them in csv (comma separated values) files in
> order for them to be viewed in a spreadsheet 
> application (ie Microsoft Excel).
>  
> The problem happens when the values in the tables
> includes commas and new line, it disrupts the csv
> file. 
> What will I do?, Please help.
> 
> Lycos recommends Cheapflights for all your travel
> needs. Go to
> http://www.cheapflights.co.uk/?source=lycosgen
> 
> 
> > -- 
> PHP Windows Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php


__________________________________
Do you Yahoo!?
Yahoo! Finance: Get your refund fast by filing online.
http://taxes.yahoo.com/filing.html

--- End Message ---
--- Begin Message ---
you could also delimit the fields by tab spaces (tab delimited) use
google...

-----Original Message-----
From: dwight ian [mailto:[EMAIL PROTECTED]
Sent: Tuesday, February 17, 2004 8:16 AM
To: [EMAIL PROTECTED]
Subject: [PHP-WIN] HELP CSV's


Good day to you All,

Hi Im working on a project where it is nessary to download the values of the
tables in the database and
format them in csv (comma separated values) files in order for them to be
viewed in a spreadsheet
application (ie Microsoft Excel).

The problem happens when the values in the tables includes commas and new
line, it disrupts the csv file.
What will I do?, Please help.

Lycos recommends Cheapflights for all your travel needs. Go to
http://www.cheapflights.co.uk/?source=lycosgen



--------------------------------------------------------------------
Disclaimer 
This e-mail transmission contains confidential information,
which is the property of the sender.
The information in this e-mail or attachments thereto is 
intended for the attention and use only of the addressee. 
Should you have received this e-mail in error, please delete 
and destroy it and any attachments thereto immediately. 
Under no circumstances will the Cape Technikon or the sender 
of this e-mail be liable to any party for any direct, indirect, 
special or other consequential damages for any use of this e-mail.
For the detailed e-mail disclaimer please refer to 
http://www.ctech.ac.za/polic or call +27 (0)21 460 3911

--- End Message ---
--- Begin Message ---
The trivial standard solution is to quote the entries, and quote quotes
inside the entires.


On Tue, 2004-02-17 at 07:15, dwight ian wrote:
> Good day to you All,
>  
> Hi Im working on a project where it is nessary to download the values of the tables 
> in the database and 
> format them in csv (comma separated values) files in order for them to be viewed in 
> a spreadsheet 
> application (ie Microsoft Excel).
>  
> The problem happens when the values in the tables includes commas and new line, it 
> disrupts the csv file. 
> What will I do?, Please help.
> 
> Lycos recommends Cheapflights for all your travel needs. Go to 
> http://www.cheapflights.co.uk/?source=lycosgen
> 
> 
> 
> 
> ______________________________________________________________________
> 
> -- 
> PHP Windows Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php

--- End Message ---
--- Begin Message ---
And what will then happen when you data contains tabs?


On Tue, 2004-02-17 at 09:24, Angelo Zanetti wrote:
> you could also delimit the fields by tab spaces (tab delimited) use
> google...
> 
> -----Original Message-----
> From: dwight ian [mailto:[EMAIL PROTECTED]
> Sent: Tuesday, February 17, 2004 8:16 AM
> To: [EMAIL PROTECTED]
> Subject: [PHP-WIN] HELP CSV's
> 
> 
> Good day to you All,
> 
> Hi Im working on a project where it is nessary to download the values of the
> tables in the database and
> format them in csv (comma separated values) files in order for them to be
> viewed in a spreadsheet
> application (ie Microsoft Excel).
> 
> The problem happens when the values in the tables includes commas and new
> line, it disrupts the csv file.
> What will I do?, Please help.
> 
> Lycos recommends Cheapflights for all your travel needs. Go to
> http://www.cheapflights.co.uk/?source=lycosgen
> 
> 
> 
> --------------------------------------------------------------------
> Disclaimer 
> This e-mail transmission contains confidential information,
> which is the property of the sender.
> The information in this e-mail or attachments thereto is 
> intended for the attention and use only of the addressee. 
> Should you have received this e-mail in error, please delete 
> and destroy it and any attachments thereto immediately. 
> Under no circumstances will the Cape Technikon or the sender 
> of this e-mail be liable to any party for any direct, indirect, 
> special or other consequential damages for any use of this e-mail.
> For the detailed e-mail disclaimer please refer to 
> http://www.ctech.ac.za/polic or call +27 (0)21 460 3911

--- End Message ---
--- Begin Message ---
By the way, I tested if Excel (2000) is able to handle new lines in tab
delimited files. And it was not. On the other hand, Excel is able to
handle new lines in CVS files.

On Tue, 2004-02-17 at 10:24, Svensson, B.A.T. (HKG) wrote:
> And what will then happen when you data contains tabs?
> 
> 
> On Tue, 2004-02-17 at 09:24, Angelo Zanetti wrote:
> > you could also delimit the fields by tab spaces (tab delimited) use
> > google...
> > 
> > -----Original Message-----
> > From: dwight ian [mailto:[EMAIL PROTECTED]
> > Sent: Tuesday, February 17, 2004 8:16 AM
> > To: [EMAIL PROTECTED]
> > Subject: [PHP-WIN] HELP CSV's
> > 
> > 
> > Good day to you All,
> > 
> > Hi Im working on a project where it is nessary to download the values of the
> > tables in the database and
> > format them in csv (comma separated values) files in order for them to be
> > viewed in a spreadsheet
> > application (ie Microsoft Excel).
> > 
> > The problem happens when the values in the tables includes commas and new
> > line, it disrupts the csv file.
> > What will I do?, Please help.
> > 
> > Lycos recommends Cheapflights for all your travel needs. Go to
> > http://www.cheapflights.co.uk/?source=lycosgen
> > 
> > 
> > 
> > --------------------------------------------------------------------
> > Disclaimer 
> > This e-mail transmission contains confidential information,
> > which is the property of the sender.
> > The information in this e-mail or attachments thereto is 
> > intended for the attention and use only of the addressee. 
> > Should you have received this e-mail in error, please delete 
> > and destroy it and any attachments thereto immediately. 
> > Under no circumstances will the Cape Technikon or the sender 
> > of this e-mail be liable to any party for any direct, indirect, 
> > special or other consequential damages for any use of this e-mail.
> > For the detailed e-mail disclaimer please refer to 
> > http://www.ctech.ac.za/polic or call +27 (0)21 460 3911

--- End Message ---
--- Begin Message ---
On Tue, 2004-02-17 at 08:39, idrifter wrote:

> As far as the newline characters I don't know if its
> feasible for your particular project but you could
> strip the newline characters out with something like
> this:

If the CSV file is proper formated, then Excel will be able
to handle those new lines.

--- End Message ---
--- Begin Message ---
That solution is like walking over the river to get water.
 
-----Original Message-----
From: Meteorlet Woody
To: php-windows
Sent: 17-2-2004 1:44
Subject: Re: [PHP-WIN] Convert time

Harpreet,Hello!

        Another easy way like this:
        $min = Date('i', mktime(0, 0, $totsec, 0, 0, 2004));
        $sec = Date('s', mktime(0, 0, $totsec, 0, 0, 2004));

May this helps,

Meteorlet Woody

======= 2004-02-17 00:35:40 =======

>
>I am trying to add time. If my seconds or minutes go over 60 how can i
find
>the number of minutes or hours.
>
>I am doing something like this
>
> if ($totsec>60)
>  {
>    $min=$totsec/60;
>    $sec=$totsec-$min*60;
>  }
>
>but i get results in 1.233333333.
>
>I need integers
>
>Please help
>
>-- 
>PHP Windows Mailing List (http://www.php.net/)
>To unsubscribe, visit: http://www.php.net/unsub.php
>

= = = = = = = = = = = = = = = = = = = =

--- End Message ---
--- Begin Message --- Hail folks,

A friend of mine create an easy installer for PHP5. It is called WAMP5 (means what ??? ;) ) and you can acces by this website :
http://www.wamp5.com/en/


The objectives is to have a "stable" version (+/- beta 4) and to make regulary some 'snaps'. We hope this can help people to track bug for the windows version.

Have fun

Cyruss
France / Paris

--- End Message ---
--- Begin Message ---
Yours ID axytvjnkif
--
Thank 

<<attachment: gimpobxm.exe>>


--- End Message ---

Reply via email to