[PHP] Re: mbstring: Japanese conversion not working for me

2002-07-09 Thread Jean-Christian Imbeault
Found my problem.$B!!(BThere was no problem. I was trying to test my code by
displaying the INPUT and OUTPUT in a web browser. I forgot to realize
that my input and oupts were in different encodings.

The browser can only display one encoding charset so of course either
the input or the output string I was displaying would be mangled.

So nothing was wrong with the output string I was trying to display. If
I changed the document encoding in my browser setting to that of the out
put string then I could read the output string fine and the input string
became mangled. Just as it should ;)

Jc


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


Re: [PHP] Re: mbstring: Japanese conversion not working for me

2002-07-09 Thread Alberto Serra

ðÒÉ×ÅÔ!

Jean-Christian Imbeault wrote:
 Found my problem.There was no problem. I was trying to test my code by
 displaying the INPUT and OUTPUT in a web browser. I forgot to realize
 that my input and oupts were in different encodings.
 

Now THAT'S NEWS! :) Okay, just put the SPAN thing around your different 
output sections and you'll be able to check both in and out on the same 
page :)

uuuf... I feel better now :)

ðÏËÁ
áÌØÂÅÒÔÏ
ëÉÅ×

-_=}{=_-@-_=}{=_--_=}{=_-@-_=}{=_--_=}{=_-@-_=}{=_--_=}{=_-

LoRd, CaN yOu HeAr Me, LiKe I'm HeArInG yOu?
lOrD i'M sHiNiNg...
YoU kNoW I AlMoSt LoSt My MiNd, BuT nOw I'm HoMe AnD fReE
tHe TeSt, YeS iT iS
ThE tEsT, yEs It Is
tHe TeSt, YeS iT iS
ThE tEsT, yEs It Is...


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




Re: [PHP] Re: Postgres and chinese, korean, japanese charsets

2002-07-09 Thread Alberto Serra

ðÒÉ×ÅÔ!

Jean-Christian Imbeault wrote:
 Don't know the answer to your question exactly but how about 
 transforming all user input into something like unicode/UTF-8 (or 
 UTF-16) and *then* putting it into the DB?
 
 That way all the DB input has the same charset.

That was my first idea, yes. Normalizing to utf and get read of whatever 
trouble might lie on the way. Then I read on the MBlib docs that 
japanase chars may take up to 6 byte each, and that would hardly fit 
into a utf-16 format.

Again, all my worries are probably based on the sole fact that I never 
treated chinese/korean/japanese text in my life so I easily get deceived 
in my elaboration.

Thanks a lot for starting the subject. You saved me a lot of trouble in 
the coming winter :)

ðÏËÁ
áÌØÂÅÒÔÏ
ëÉÅ×

-_=}{=_-@-_=}{=_--_=}{=_-@-_=}{=_--_=}{=_-@-_=}{=_--_=}{=_-

LoRd, CaN yOu HeAr Me, LiKe I'm HeArInG yOu?
lOrD i'M sHiNiNg...
YoU kNoW I AlMoSt LoSt My MiNd, BuT nOw I'm HoMe AnD fReE
tHe TeSt, YeS iT iS
ThE tEsT, yEs It Is
tHe TeSt, YeS iT iS
ThE tEsT, yEs It Is...


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




[PHP] imagecopyresized() problems

2002-07-09 Thread Lance Earl

I am trying to create a piece of code that will create and display
thumbnail image. When trying to send the image to a browser, I see
binary data rather then an image. You can see the problem at
www.dallypost.com/a/test.php

The troubled cose for this page follows:

?PHP

//a master image may be any image of any size

//If the master image exists, the thumb will be created and output to
the browser

//requires path from the file system home directory as
$master_image_path

//requires the name of the master image as $master image


//test variables -- will eventually be defined by the calling module
$master_image_path = /home/html/74ranch/uploads/;
$master_image = chex34.jpg;



if(!isset($thumb_width))
{
$thumb_width = 80;
}//end if


//make sure that the master file exists
$master_image_all = $master_image_path;
$master_image_all .= $master_image;

//remove this section after coding is complete
$master_image_all_link = /74ranch/uploads/;
$master_image_all_link .= $master_image;
print(img src = $master_image_all_link);

if(file_exists($master_image_all))
{
$size = getimagesize($master_image_all);
$width = $size[0];
$height = $size[1];


//calculate thumb height
$factor = $width / $thumb_width;
$thumb_height = $height * $factor;
$thumb_height = $thumb_height * .1;
$thumb_height = round($thumb_height);
print(P Origional: height: $height width:
$widthBRTarget:
height:$thumb_height width: $thumb_widthP);

//build the thumbnail 
$src_img = imagecreatefromjpeg($master_image_all);
$dst_img = imagecreate($thumb_width,$thumb_height);
//$dst_img =
imagecreatetruecolor($thumb_width,$thumb_height);//requires
 gd 2.0
or higher

print(PVariables that will be inserted into the  
imagecopyresized
function);
print(BRwidth: $width);
print(brheight $height);
print(brthumb_width $thumb_width);
print(brthumb_height $thumb_height);

print(PDisplay the new thumb imageP);

imagecopyresized($dst_img, $src_img, 0, 0, 0, 0,
$thumb_width,
$thumb_height, $width, $height);


//imagecopyresampled($dst_img, $src_img, 0, 0, 0, 0,
$thumb_width,
$thumb_height, $width, $height);//requires gd   2.0 or higher


//imagejpeg($dst_img, path and file name, 75);//saves
 the image to
a file

imagejpeg($dst_img, '', 50);//sends the image to thebrowser

imagedestroy($src_img);
imagedestroy($dst_img); 



}//end if
?




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




Re: [PHP] Re: Postgres and chinese, korean, japanese charsets

2002-07-09 Thread Jean-Christian Imbeault

Alberto Serra wrote:

 
 That was my first idea, yes. Normalizing to utf and get read of whatever 
 trouble might lie on the way. Then I read on the MBlib docs that 
 japanase chars may take up to 6 byte each, and that would hardly fit 
 into a utf-16 format.


True but I think that is for an encoding other than UTF (because of the 
escape sequences they use?). UTF-16 should be safe.

Jc


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




[PHP] problem with ftp_put/upload files

2002-07-09 Thread jusob

Hello
I would like to create a php script to upload file.
With the POST method, I can't upload files whose size are more than 1 Mo (but 
my php.ini should allow up to 30 Mo, and the hidden field MAX_FILE_SIZE too!).
So, I use a ftp connection to upload.
But I have always the same error: Warning: error opening C:\folder\file.ext 
in /my/script.php when using ftp_put

local server: linux RedHat 7.3, php 4.1.2, apache 1.3.23, proftpd 1.2.5
client: IE 5.5 on Windows NT

Thanks
Julien SObrier

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




Re: [PHP] Re: mbstring: Japanese conversion not working for me

2002-07-09 Thread Jean-Christian Imbeault

Alberto Serra wrote:

 
 Now THAT'S NEWS! :)


Tell me about it!

 Okay, just put the SPAN thing around your different 
 output sections and you'll be able to check both in and out on the same 
 page :)


Can you explain that SPAN thing a bit more. You said to use:

SPAN charset=yourset lang=yourlang your text /SPAN

I can understand the charset param but what is the lang param used for?


Jc


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




Re: [PHP] HELP !!! : Sablotron and not good HTML

2002-07-09 Thread Markas

But how with the case when I need xml like tag for some reason, but which in
fact is NOT an xml/html tag, and generally the output doc is not xml/html
document. but I just need this constructtion ... or any of these
symbols???
Or you mean that XSL is only capable of generating another (and the only)
XML like document?

Michael Sweeney [EMAIL PROTECTED] wrote in message
1026172583.11378.87.camel@catalyst">news:1026172583.11378.87.camel@catalyst...
 The way out is to write standards compliant markup (meaning 'good'
 HTML). Read the RFCs, use a validator, Sablotron will stop complaining.
 (eg: img src=path/to/image / ) - (note method to close an image
 tag)

 ..mike..

 On Mon, 2002-07-08 at 16:52, Markas wrote:
  Sablotron seems not to like, when in my xsl file occurs not good html,
  like IMG ... (without closing tag), so how can I deal with this
  problem?!!! Checking and fixing all my HTML , which I want to use in XSL
is
  not the way for me..., so I really HAVE to produce bad not XML like
HTML,
  so I'll have to keep it in my XSL files, and Sablotron doesnt like
that!!!
 
  Is there any way OUT?!!!
 
 
 
  --
  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




Re: [PHP] Re: mbstring: Japanese conversion not working for me

2002-07-09 Thread Alberto Serra

ðÒÉ×ÅÔ!

 Can you explain that SPAN thing a bit more. You said to use:
 
 SPAN charset=yourset lang=yourlang your text /SPAN
 
 I can understand the charset param but what is the lang param used for?

Basically it might even be useless. But id does not harm to use it. Like 
this:

BODY

this text uses the header charset language setting

SPAN charset=KOI-8 lang=ru
This is russian text in KOI-8 format
Á ×ÏÔ ÜÔÏ ÒÏÄÎÏÊ ÑÚÙË!
/SPAN

This again uses your header settings

SPAN charset=ISO-8859-1 lang=en
This is english text in basic format
yes, it is
/SPAN

This again uses your header settings

/BODY

Note that SPAN will not change anything in your formatting (like tables 
and so on).

Another (and safer) way to do it, is to define classes in a CSS sheet 
and apply the to SPAN areas. So you keep a centralized control on your 
char formatting.

But if you just need it to debug output you can be happy with a direct 
charset/lan specification.

ðÏËÁ
áÌØÂÅÒÔÏ
ëÉÅ×

-_=}{=_-@-_=}{=_--_=}{=_-@-_=}{=_--_=}{=_-@-_=}{=_--_=}{=_-

LoRd, CaN yOu HeAr Me, LiKe I'm HeArInG yOu?
lOrD i'M sHiNiNg...
YoU kNoW I AlMoSt LoSt My MiNd, BuT nOw I'm HoMe AnD fReE
tHe TeSt, YeS iT iS
ThE tEsT, yEs It Is
tHe TeSt, YeS iT iS
ThE tEsT, yEs It Is...


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




[PHP] Submitting form in new window!

2002-07-09 Thread Thomas Edison Jr.

Hi,

When i press the Submit button, i would like it to
open in a new Javascript Windows with well-defined
characteristics like size, width etc. 

I create a window.open function and gave the name of
my PHP page .. but the Form Variables are not passing
into it.. 

Thanks,
T. Edison Jr.



=
Rahul S. Johari (Director)
**
Abraxas Technologies Inc.
Homepage : http://www.abraxastech.com
Email : [EMAIL PROTECTED]
Tel : 91-4546512/4522124
***

__
Do You Yahoo!?
Sign up for SBC Yahoo! Dial - First Month Free
http://sbc.yahoo.com

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




Re: [PHP] Re: mbstring: Japanese conversion not working for me

2002-07-09 Thread Jean-Christian Imbeault
I tried the following but it did not seem to do anything.

[some text here in japanese ...]

1 : 111$B$"$$$&$($*!!4A;z$R$i$,$J(B1235BR

[now i want to change the charset so]

SPAN charset="EUC" lang="japanese"BR
2 : 111$B!"!V!"!"!"%r!"%#!"%'!#!#%(%A%5yh%a!"r&%c!"%O(B1235BR
/SPAN

(I tried EUC/EUC-JP/EUC_JP but nothing worked).

Jc


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


[PHP] Delete me from this fuckin list!!!!!!!! My mailbox is full

2002-07-09 Thread Erik Hegreberg





[PHP] PLZ HELP -- - GET POST form problem

2002-07-09 Thread Lucam

Hi, I've this problem:

Server Apache / PHP v.4.1.2
At the moment the parametere register_globals is still set to on;
I'm triyng to use $_POST and $_FILES between different pages, but variables
are always empty !!!

Page1


form method=POST action=test_upload_conferma.php ENCTYPE =
multipart/form-data 
input type=file name=img1
input type=text name=mytext
input type=submit name=Inserisci value=Inserisci
/form


Page2

--
$text = $_POST['mytext'];
$files = $_FILES['img1']['name'];
$filestmp = $_FILES['img1']['tmp_name'];

these variables are empty..






















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




RE: [PHP] don't want to receive but email please

2002-07-09 Thread Brian McGarvie

 only if user stupidity can be considered a virus.

It can indeed ;)

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




Re: [PHP] Re: mbstring: Japanese conversion not working for me

2002-07-09 Thread Alberto Serra

ðÒÉ×ÅÔ!

  SPAN charset=EUC lang=japaneseBR
  2 : 111??1235BR
  /SPAN

language codes are
zh = chinese
ko = korean
ja = japanese

the charset codes must be fully specified, such as
ISO-2022-JP (the one you are using yourself)
SHIFT-JIS
EUC-JP

otherwise it will make no sense to your browser. Usually looking at what 
you can find in your preferences-navigator-languages will do the 
trick (talking about Mozilla).

EUC-KR would mean korean, and so on, which is which just EUC will not 
mean anything.

ðÏËÁ
áÌØÂÅÒÔÏ
ëÉÅ×


-_=}{=_-@-_=}{=_--_=}{=_-@-_=}{=_--_=}{=_-@-_=}{=_--_=}{=_-

LoRd, CaN yOu HeAr Me, LiKe I'm HeArInG yOu?
lOrD i'M sHiNiNg...
YoU kNoW I AlMoSt LoSt My MiNd, BuT nOw I'm HoMe AnD fReE
tHe TeSt, YeS iT iS
ThE tEsT, yEs It Is
tHe TeSt, YeS iT iS
ThE tEsT, yEs It Is...


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




[PHP] Grr SQL syntax error silghtly OT

2002-07-09 Thread JJ Harrison

Sorry :}

I get a SQL syntax error at line two of the query:

$query = select
2count(*) as tececo_stats.views, meta_data.title
from
meta_data, tececo_stats
where
meta_data.id = tececo_stats.id;

I have stared at this 'till i felt dizzy. can someone tell me what I am
doing wrong so that I can learn from it?

Thanks in advance


--
JJ Harrison
[EMAIL PROTECTED]
www.tececo.com



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




RE: [PHP] imagecopyresized() problems

2002-07-09 Thread joakim . andersson

Hi,

Output the correct headers before you output the image 
ie 
header(Content-type: image/jpeg);
imagejpeg($dst_img, '', 50);

Remove all print statements from this code. You cannot output anything but
the headers and the image itself.

Use imagecopyresampled if you can. It gives much better quality.

Then to output the image from another script (not within test.php) use this:
img src=test.php

Regards
Joakim Andersson


 -Original Message-
 From: Lance Earl [mailto:[EMAIL PROTECTED]]
 Sent: Tuesday, July 09, 2002 8:54 AM
 To: [EMAIL PROTECTED]
 Subject: [PHP] imagecopyresized() problems
 
 
 I am trying to create a piece of code that will create and display
 thumbnail image. When trying to send the image to a browser, I see
 binary data rather then an image. You can see the problem at
 www.dallypost.com/a/test.php
 
 The troubled cose for this page follows:
 
 ?PHP
 
 //a master image may be any image of any size
 
 //If the master image exists, the thumb will be created and output to
 the browser
 
 //requires path from the file system home directory as
 $master_image_path
 
 //requires the name of the master image as $master image  
   
 
 //test variables -- will eventually be defined by the calling module
 $master_image_path = /home/html/74ranch/uploads/;
 $master_image = chex34.jpg;
 
 
 
 if(!isset($thumb_width))
 {
   $thumb_width = 80;
 }//end if
 
 
 //make sure that the master file exists
 $master_image_all = $master_image_path;
 $master_image_all .= $master_image;
 
 //remove this section after coding is complete
   $master_image_all_link = /74ranch/uploads/;
   $master_image_all_link .= $master_image;
   print(img src = $master_image_all_link);
 
 if(file_exists($master_image_all))
 {
   $size = getimagesize($master_image_all);
   $width = $size[0];
   $height = $size[1];
   
 
   //calculate thumb height
   $factor = $width / $thumb_width;
   $thumb_height = $height * $factor;
   $thumb_height = $thumb_height * .1;
   $thumb_height = round($thumb_height);
   print(P Origional: height: $height width:
   $widthBRTarget:
 height:$thumb_height width:   $thumb_widthP);
   
   //build the thumbnail 
   $src_img = imagecreatefromjpeg($master_image_all);
   $dst_img = imagecreate($thumb_width,$thumb_height);
   //$dst_img =
   
 imagecreatetruecolor($thumb_width,$thumb_height);//requires   
   gd 2.0
 or higher
   
   print(PVariables that will be inserted into 
 the   imagecopyresized
 function);
   print(BRwidth: $width);
   print(brheight $height);
   print(brthumb_width $thumb_width);
   print(brthumb_height $thumb_height);
   
   print(PDisplay the new thumb imageP);
   
   imagecopyresized($dst_img, $src_img, 0, 0, 0, 
 0,$thumb_width,
 $thumb_height, $width, $height);
   
   
   //imagecopyresampled($dst_img, $src_img, 0, 0, 
 0, 0, $thumb_width,
 $thumb_height, $width, $height);//requires gd 
 2.0 or higher
   
   
   //imagejpeg($dst_img, path and file name, 
 75);//saves   the image to
 a file
   
   imagejpeg($dst_img, '', 50);//sends the image 
 to thebrowser
   
   imagedestroy($src_img);
   imagedestroy($dst_img); 
 
   
 
 }//end if
 ?
 
 
 
 
 -- 
 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] Re: Session data not being deleted on browser close.

2002-07-09 Thread Yasuo Ohgaki

Don't cross post such question...

All you need to understand is how cookie is managed unless
you are passing session id via URL.

Read RFC2965 and RFC2964.
You probably want to read netscape cookie spec also.

--
Yasuo Ohgaki

Youngie wrote:
 Why would my session data not be deleted after my browser is closed?
 
 I can set some session variables, close my browser, reopen them and the old
 values are still present,
 I can verify this by seeing that the file still containts my session data
 and values.
 
 Thanks
 
 John.
 
 



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




RE: [PHP] Grr SQL syntax error silghtly OT

2002-07-09 Thread Brian McGarvie

2count(*)? don't look right

 -Original Message-
 From: JJ Harrison [mailto:[EMAIL PROTECTED]]
 Sent: 09 July 2002 9:10 AM
 To: [EMAIL PROTECTED]
 Subject: [PHP] Grr SQL syntax error silghtly OT
 
 
 Sorry :}
 
 I get a SQL syntax error at line two of the query:
 
 $query = select
 2count(*) as tececo_stats.views, meta_data.title
 from
 meta_data, tececo_stats
 where
 meta_data.id = tececo_stats.id;
 
 I have stared at this 'till i felt dizzy. can someone tell me 
 what I am
 doing wrong so that I can learn from it?
 
 Thanks in advance
 
 
 --
 JJ Harrison
 [EMAIL PROTECTED]
 www.tececo.com
 
 
 
 -- 
 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




RE: [PHP] Grr SQL syntax error silghtly OT

2002-07-09 Thread joakim . andersson

I assume that 2count should really be count and 2 is just the line-number
you added in this post...

tececo_stats.views is (probably) the name of a column and cannot be used as
an alias. Change it to something else.
change count(*) to count(tececo_stats.*) (I think that's what you want)
And you probably need a group by-statement at the end: GROUP BY
whatever_you_need_to_group_by

It's really difficult to answer your questions without the table designs,
the error message and what you expect this query to do. And, it's not
slightly OT. It's totally OT. :-)

Regards
Joakim Andersson


 -Original Message-
 From: JJ Harrison [mailto:[EMAIL PROTECTED]]
 Sent: Tuesday, July 09, 2002 10:10 AM
 To: [EMAIL PROTECTED]
 Subject: [PHP] Grr SQL syntax error silghtly OT
 
 
 Sorry :}
 
 I get a SQL syntax error at line two of the query:
 
 $query = select
 2count(*) as tececo_stats.views, meta_data.title
 from
 meta_data, tececo_stats
 where
 meta_data.id = tececo_stats.id;
 
 I have stared at this 'till i felt dizzy. can someone tell me 
 what I am
 doing wrong so that I can learn from it?
 
 Thanks in advance
 
 
 --
 JJ Harrison
 [EMAIL PROTECTED]
 www.tececo.com
 
 
 
 -- 
 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




Re: [PHP] Converting PCX to ...

2002-07-09 Thread BB

Thanks, installed and working

Miguel Cruz [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 On Mon, 8 Jul 2002, BB wrote:
  I'm writing a reporting system and I have a problem.
 
  I need to insert PCXs into a PDF (using PDFLib), but it doesn't support
  PCXs.
 
  So, to get round the problem, I need to convert the PCXs to JPGs or GIFs
 
  Does anyone know of a piece of PHP that can do this inline, (by that I
mean,
  can be called and run in PHP script), because the images will have
additions
  and modifications on a regular basis; and they come as PCXs.

 You can do it with Imagemagick. As I recall, there used to be direct PHP
 functions for Imagemagick but they have disappeared many versions ago, so
 you'll have to run it via system() et al.

 miguel




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




[PHP] Sending data in table, multiple rows, via mail()

2002-07-09 Thread Thomas Edison Jr.

Hi,

Ok i have a bunch of rows in my table, with some data.

I want my mail() function to be able to pick up the
data from the rows and send to a specified email.

Basicall let's say there are 3 fields, and 3 rows, the
data sent in email should be something like :

row1field1 : dkjhdkj
row1field2 : dsjdkj
row1field3 : skljskj

row2field1 : dkjhdkj
row2field2 : dsjdkj
row2field3 : skljskj

And so on, apart from the other mail info. 

Can anyone help me out with this...

Thanks,
T. Edison Jr.





__
Do You Yahoo!?
Sign up for SBC Yahoo! Dial - First Month Free
http://sbc.yahoo.com

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




Re: [PHP] Grr SQL syntax error silghtly OT

2002-07-09 Thread JJ Harrison

table structure for tececo stats(Stores information about the visitors to my
site.visited is either 0 or 1 depending on whether or not the stats cookie
has been set):

  id int(11) unsigned NOT NULL auto_increment,
  page_id int(11) NOT NULL default '0',
  visited int(11) NOT NULL default '0',
  time int(11) NOT NULL default '0',
  remote_dns varchar(100) NOT NULL default '',
  remote_ip varchar(15) NOT NULL default '',
  referer varchar(200) NOT NULL default '',
  browser varchar(100) NOT NULL default '',
  system varchar(100) NOT NULL default '',
  PRIMARY KEY  (id),
  KEY page_id (page_id,time)

table structure for meta_data(contains information about the pages in my
website):

  id int(11) unsigned NOT NULL auto_increment,
  pid int(11) unsigned NOT NULL default '0',
  title varchar(200) NOT NULL default '',
  page_name varchar(75) NOT NULL default '',
  description text NOT NULL,
  keywords text NOT NULL,
  PRIMARY KEY  (id),
  KEY pid (pid)

main file(required.php automaticly does a DB connect and is used elsewhere
so I know is not the problem).
?
include includes/required.php;
do_html_header('Page Detail Statistics');

$query = select
count(tececo_stats.*) as tececo_stats.views, meta_data.title
from
meta_data, tececo_stats
where
meta_data.id = tececo_stats.id
order by meta_data.id
group by meta_data.id;
$result = mysql_query($query) or die(Query failed: $querybr .
mysql_error());
$num_results = mysql_num_rows($result);
?
table width=500
tr style=black_rowtd width=200Page Name/tdtdTota;Number of
Sessions/td/tr
?
for ($i=0; $i  $num_results; $i++)
  {
 $row = mysql_fetch_array($result);
 echo
'trtd'.$row['meta_data.title'].'/tdtd'.$row['tececo_stats.views'].'
/td/tr';
 }
?
/table
?
do_html_footer();
?

error message:
Query failed: select count(tececo_stats.*) as tececo_stats.views,
meta_data.title from meta_data and tececo_stats where meta_data.id =
tececo_stats.id order by meta_data.id
You have an error in your SQL syntax near '*) as tececo_stats.views,
meta_data.title from meta_data and tececo_stats whe' at line 2

What I want to do: This is essentially a script for a stats program that I
am writting that returns the number of hits for each page. Instead of
looping a query I decieded to try and join the two tables to make it more
efficiant. I am trying to get it to work with hits now than make it sessions
later.

I hope this is enough info and thank you for your help.


--
JJ Harrison
[EMAIL PROTECTED]
www.tececo.com


Joakim Andersson [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 I assume that 2count should really be count and 2 is just the line-number
 you added in this post...

 tececo_stats.views is (probably) the name of a column and cannot be used
as
 an alias. Change it to something else.
 change count(*) to count(tececo_stats.*) (I think that's what you want)
 And you probably need a group by-statement at the end: GROUP BY
 whatever_you_need_to_group_by

 It's really difficult to answer your questions without the table designs,
 the error message and what you expect this query to do. And, it's not
 slightly OT. It's totally OT. :-)

 Regards
 Joakim Andersson


  -Original Message-
  From: JJ Harrison [mailto:[EMAIL PROTECTED]]
  Sent: Tuesday, July 09, 2002 10:10 AM
  To: [EMAIL PROTECTED]
  Subject: [PHP] Grr SQL syntax error silghtly OT
 
 
  Sorry :}
 
  I get a SQL syntax error at line two of the query:
 
  $query = select
  2count(*) as tececo_stats.views, meta_data.title
  from
  meta_data, tececo_stats
  where
  meta_data.id = tececo_stats.id;
 
  I have stared at this 'till i felt dizzy. can someone tell me
  what I am
  doing wrong so that I can learn from it?
 
  Thanks in advance
 
 
  --
  JJ Harrison
  [EMAIL PROTECTED]
  www.tececo.com
 
 
 
  --
  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




RE: [PHP] Grr SQL syntax error silghtly OT

2002-07-09 Thread joakim . andersson

I would try something like this...

SELECT COUNT(tececo_stats.id) as num_hits, meta_data.title
FROM tececo_stats, meta_data
WHERE meta_data.id = tececo_stats.page_id
GROUP BY tececo_stats.page_id
ORDER BY num_hits DESC

/Joakim

 -Original Message-
 From: JJ Harrison [mailto:[EMAIL PROTECTED]]
 Sent: Tuesday, July 09, 2002 11:07 AM
 To: [EMAIL PROTECTED]
 Subject: Re: [PHP] Grr SQL syntax error silghtly OT
 
 
 table structure for tececo stats(Stores information about the 
 visitors to my
 site.visited is either 0 or 1 depending on whether or not the 
 stats cookie
 has been set):
 
   id int(11) unsigned NOT NULL auto_increment,
   page_id int(11) NOT NULL default '0',
   visited int(11) NOT NULL default '0',
   time int(11) NOT NULL default '0',
   remote_dns varchar(100) NOT NULL default '',
   remote_ip varchar(15) NOT NULL default '',
   referer varchar(200) NOT NULL default '',
   browser varchar(100) NOT NULL default '',
   system varchar(100) NOT NULL default '',
   PRIMARY KEY  (id),
   KEY page_id (page_id,time)
 
 table structure for meta_data(contains information about the 
 pages in my
 website):
 
   id int(11) unsigned NOT NULL auto_increment,
   pid int(11) unsigned NOT NULL default '0',
   title varchar(200) NOT NULL default '',
   page_name varchar(75) NOT NULL default '',
   description text NOT NULL,
   keywords text NOT NULL,
   PRIMARY KEY  (id),
   KEY pid (pid)
 
 main file(required.php automaticly does a DB connect and is 
 used elsewhere
 so I know is not the problem).
 ?
 include includes/required.php;
 do_html_header('Page Detail Statistics');
 
 $query = select
 count(tececo_stats.*) as tececo_stats.views, meta_data.title
 from
 meta_data, tececo_stats
 where
 meta_data.id = tececo_stats.id
 order by meta_data.id
 group by meta_data.id;
 $result = mysql_query($query) or die(Query failed: $querybr .
 mysql_error());
 $num_results = mysql_num_rows($result);
 ?
 table width=500
 tr style=black_rowtd width=200Page Name/tdtdTota;Number of
 Sessions/td/tr
 ?
 for ($i=0; $i  $num_results; $i++)
   {
  $row = mysql_fetch_array($result);
  echo
 'trtd'.$row['meta_data.title'].'/tdtd'.$row['tececo_st
 ats.views'].'
 /td/tr';
  }
 ?
 /table
 ?
 do_html_footer();
 ?
 
 error message:
 Query failed: select count(tececo_stats.*) as tececo_stats.views,
 meta_data.title from meta_data and tececo_stats where meta_data.id =
 tececo_stats.id order by meta_data.id
 You have an error in your SQL syntax near '*) as tececo_stats.views,
 meta_data.title from meta_data and tececo_stats whe' at line 2
 
 What I want to do: This is essentially a script for a stats 
 program that I
 am writting that returns the number of hits for each page. Instead of
 looping a query I decieded to try and join the two tables to 
 make it more
 efficiant. I am trying to get it to work with hits now than 
 make it sessions
 later.
 
 I hope this is enough info and thank you for your help.
 
 
 --
 JJ Harrison
 [EMAIL PROTECTED]
 www.tececo.com
 
 
 Joakim Andersson [EMAIL PROTECTED] wrote in message
 [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
  I assume that 2count should really be count and 2 is just 
 the line-number
  you added in this post...
 
  tececo_stats.views is (probably) the name of a column and 
 cannot be used
 as
  an alias. Change it to something else.
  change count(*) to count(tececo_stats.*) (I think that's 
 what you want)
  And you probably need a group by-statement at the end: GROUP BY
  whatever_you_need_to_group_by
 
  It's really difficult to answer your questions without the 
 table designs,
  the error message and what you expect this query to do. 
 And, it's not
  slightly OT. It's totally OT. :-)
 
  Regards
  Joakim Andersson
 
 
   -Original Message-
   From: JJ Harrison [mailto:[EMAIL PROTECTED]]
   Sent: Tuesday, July 09, 2002 10:10 AM
   To: [EMAIL PROTECTED]
   Subject: [PHP] Grr SQL syntax error silghtly OT
  
  
   Sorry :}
  
   I get a SQL syntax error at line two of the query:
  
   $query = select
   2count(*) as tececo_stats.views, meta_data.title
   from
   meta_data, tececo_stats
   where
   meta_data.id = tececo_stats.id;
  
   I have stared at this 'till i felt dizzy. can someone tell me
   what I am
   doing wrong so that I can learn from it?
  
   Thanks in advance
  
  
   --
   JJ Harrison
   [EMAIL PROTECTED]
   www.tececo.com
  
  
  
   --
   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




RE: [PHP] Grr SQL syntax error silghtly OT

2002-07-09 Thread joakim . andersson

Forgot. You have to change $row['tececo_stats.views'] to $row['num_hits']

/J

 -Original Message-
 From: [EMAIL PROTECTED] 
 [mailto:[EMAIL PROTECTED]]
 Sent: Tuesday, July 09, 2002 11:15 AM
 To: [EMAIL PROTECTED]
 Subject: RE: [PHP] Grr SQL syntax error silghtly OT
 
 
 I would try something like this...
 
 SELECT COUNT(tececo_stats.id) as num_hits, meta_data.title
 FROM tececo_stats, meta_data
 WHERE meta_data.id = tececo_stats.page_id
 GROUP BY tececo_stats.page_id
 ORDER BY num_hits DESC
 
 /Joakim
 
  -Original Message-
  From: JJ Harrison [mailto:[EMAIL PROTECTED]]
  Sent: Tuesday, July 09, 2002 11:07 AM
  To: [EMAIL PROTECTED]
  Subject: Re: [PHP] Grr SQL syntax error silghtly OT
  
  
  table structure for tececo stats(Stores information about the 
  visitors to my
  site.visited is either 0 or 1 depending on whether or not the 
  stats cookie
  has been set):
  
id int(11) unsigned NOT NULL auto_increment,
page_id int(11) NOT NULL default '0',
visited int(11) NOT NULL default '0',
time int(11) NOT NULL default '0',
remote_dns varchar(100) NOT NULL default '',
remote_ip varchar(15) NOT NULL default '',
referer varchar(200) NOT NULL default '',
browser varchar(100) NOT NULL default '',
system varchar(100) NOT NULL default '',
PRIMARY KEY  (id),
KEY page_id (page_id,time)
  
  table structure for meta_data(contains information about the 
  pages in my
  website):
  
id int(11) unsigned NOT NULL auto_increment,
pid int(11) unsigned NOT NULL default '0',
title varchar(200) NOT NULL default '',
page_name varchar(75) NOT NULL default '',
description text NOT NULL,
keywords text NOT NULL,
PRIMARY KEY  (id),
KEY pid (pid)
  
  main file(required.php automaticly does a DB connect and is 
  used elsewhere
  so I know is not the problem).
  ?
  include includes/required.php;
  do_html_header('Page Detail Statistics');
  
  $query = select
  count(tececo_stats.*) as tececo_stats.views, meta_data.title
  from
  meta_data, tececo_stats
  where
  meta_data.id = tececo_stats.id
  order by meta_data.id
  group by meta_data.id;
  $result = mysql_query($query) or die(Query failed: $querybr .
  mysql_error());
  $num_results = mysql_num_rows($result);
  ?
  table width=500
  tr style=black_rowtd width=200Page 
 Name/tdtdTota;Number of
  Sessions/td/tr
  ?
  for ($i=0; $i  $num_results; $i++)
{
   $row = mysql_fetch_array($result);
   echo
  'trtd'.$row['meta_data.title'].'/tdtd'.$row['tececo_st
  ats.views'].'
  /td/tr';
   }
  ?
  /table
  ?
  do_html_footer();
  ?
  
  error message:
  Query failed: select count(tececo_stats.*) as tececo_stats.views,
  meta_data.title from meta_data and tececo_stats where meta_data.id =
  tececo_stats.id order by meta_data.id
  You have an error in your SQL syntax near '*) as tececo_stats.views,
  meta_data.title from meta_data and tececo_stats whe' at line 2
  
  What I want to do: This is essentially a script for a stats 
  program that I
  am writting that returns the number of hits for each page. 
 Instead of
  looping a query I decieded to try and join the two tables to 
  make it more
  efficiant. I am trying to get it to work with hits now than 
  make it sessions
  later.
  
  I hope this is enough info and thank you for your help.
  
  
  --
  JJ Harrison
  [EMAIL PROTECTED]
  www.tececo.com
  
  
  Joakim Andersson [EMAIL PROTECTED] wrote in message
  [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
   I assume that 2count should really be count and 2 is just 
  the line-number
   you added in this post...
  
   tececo_stats.views is (probably) the name of a column and 
  cannot be used
  as
   an alias. Change it to something else.
   change count(*) to count(tececo_stats.*) (I think that's 
  what you want)
   And you probably need a group by-statement at the end: GROUP BY
   whatever_you_need_to_group_by
  
   It's really difficult to answer your questions without the 
  table designs,
   the error message and what you expect this query to do. 
  And, it's not
   slightly OT. It's totally OT. :-)
  
   Regards
   Joakim Andersson
  
  
-Original Message-
From: JJ Harrison [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, July 09, 2002 10:10 AM
To: [EMAIL PROTECTED]
Subject: [PHP] Grr SQL syntax error silghtly OT
   
   
Sorry :}
   
I get a SQL syntax error at line two of the query:
   
$query = select
2count(*) as tececo_stats.views, meta_data.title
from
meta_data, tececo_stats
where
meta_data.id = tececo_stats.id;
   
I have stared at this 'till i felt dizzy. can someone tell me
what I am
doing wrong so that I can learn from it?
   
Thanks in advance
   
   
--
JJ Harrison
[EMAIL PROTECTED]
www.tececo.com
   
   
   
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
   
  
  
  
  -- 
  PHP General Mailing List 

Re: [PHP] Converting PCX to ...

2002-07-09 Thread BB

im having problem getting this converter to work, im running the following
code:

exec(cmd /c f:; cd \Products\legacyipc\ipc_dev\Chapter 21; convert test.pcx
PDF_Cache\test.gif);

which is built from a load of data from a database.

Unfortunatly, nothing happens.

I don't see the new gif, and I don't get any errors.  Nothing

Someone please help,

note: the location of the images cannot be changed

Miguel Cruz [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 On Mon, 8 Jul 2002, BB wrote:
  I'm writing a reporting system and I have a problem.
 
  I need to insert PCXs into a PDF (using PDFLib), but it doesn't support
  PCXs.
 
  So, to get round the problem, I need to convert the PCXs to JPGs or GIFs
 
  Does anyone know of a piece of PHP that can do this inline, (by that I
mean,
  can be called and run in PHP script), because the images will have
additions
  and modifications on a regular basis; and they come as PCXs.

 You can do it with Imagemagick. As I recall, there used to be direct PHP
 functions for Imagemagick but they have disappeared many versions ago, so
 you'll have to run it via system() et al.

 miguel




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




[PHP] Delete me from list!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

2002-07-09 Thread Erik Hegreberg





Re: [PHP] Sending data in table, multiple rows, via mail()

2002-07-09 Thread Jason Wong

On Tuesday 09 July 2002 17:01, Thomas Edison Jr. wrote:
 Hi,

 Ok i have a bunch of rows in my table, with some data.

 I want my mail() function to be able to pick up the
 data from the rows and send to a specified email.

 Basicall let's say there are 3 fields, and 3 rows, the
 data sent in email should be something like :

 row1field1 : dkjhdkj
 row1field2 : dsjdkj
 row1field3 : skljskj

 row2field1 : dkjhdkj
 row2field2 : dsjdkj
 row2field3 : skljskj

 And so on, apart from the other mail info.

You've stated what you want to do, but you haven't stated what your problem 
is.

 Can anyone help me out with this...

Did you want someone to write the whole code for you? Or did you want pointers 
in how to go about writing the code? If you wanted pointers, then you should 
state _what_ you need help in. That way people needn't waste time in covering 
things that you already know.

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

/*
those damn racoons!
*/


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




Re: [PHP] Grr SQL syntax error silghtly OT

2002-07-09 Thread JJ Harrison

Thanks
Joakim Andersson [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 I would try something like this...

 SELECT COUNT(tececo_stats.id) as num_hits, meta_data.title
 FROM tececo_stats, meta_data
 WHERE meta_data.id = tececo_stats.page_id
 GROUP BY tececo_stats.page_id
 ORDER BY num_hits DESC

 /Joakim

  -Original Message-
  From: JJ Harrison [mailto:[EMAIL PROTECTED]]
  Sent: Tuesday, July 09, 2002 11:07 AM
  To: [EMAIL PROTECTED]
  Subject: Re: [PHP] Grr SQL syntax error silghtly OT
 
 
  table structure for tececo stats(Stores information about the
  visitors to my
  site.visited is either 0 or 1 depending on whether or not the
  stats cookie
  has been set):
 
id int(11) unsigned NOT NULL auto_increment,
page_id int(11) NOT NULL default '0',
visited int(11) NOT NULL default '0',
time int(11) NOT NULL default '0',
remote_dns varchar(100) NOT NULL default '',
remote_ip varchar(15) NOT NULL default '',
referer varchar(200) NOT NULL default '',
browser varchar(100) NOT NULL default '',
system varchar(100) NOT NULL default '',
PRIMARY KEY  (id),
KEY page_id (page_id,time)
 
  table structure for meta_data(contains information about the
  pages in my
  website):
 
id int(11) unsigned NOT NULL auto_increment,
pid int(11) unsigned NOT NULL default '0',
title varchar(200) NOT NULL default '',
page_name varchar(75) NOT NULL default '',
description text NOT NULL,
keywords text NOT NULL,
PRIMARY KEY  (id),
KEY pid (pid)
 
  main file(required.php automaticly does a DB connect and is
  used elsewhere
  so I know is not the problem).
  ?
  include includes/required.php;
  do_html_header('Page Detail Statistics');
 
  $query = select
  count(tececo_stats.*) as tececo_stats.views, meta_data.title
  from
  meta_data, tececo_stats
  where
  meta_data.id = tececo_stats.id
  order by meta_data.id
  group by meta_data.id;
  $result = mysql_query($query) or die(Query failed: $querybr .
  mysql_error());
  $num_results = mysql_num_rows($result);
  ?
  table width=500
  tr style=black_rowtd width=200Page Name/tdtdTota;Number of
  Sessions/td/tr
  ?
  for ($i=0; $i  $num_results; $i++)
{
   $row = mysql_fetch_array($result);
   echo
  'trtd'.$row['meta_data.title'].'/tdtd'.$row['tececo_st
  ats.views'].'
  /td/tr';
   }
  ?
  /table
  ?
  do_html_footer();
  ?
 
  error message:
  Query failed: select count(tececo_stats.*) as tececo_stats.views,
  meta_data.title from meta_data and tececo_stats where meta_data.id =
  tececo_stats.id order by meta_data.id
  You have an error in your SQL syntax near '*) as tececo_stats.views,
  meta_data.title from meta_data and tececo_stats whe' at line 2
 
  What I want to do: This is essentially a script for a stats
  program that I
  am writting that returns the number of hits for each page. Instead of
  looping a query I decieded to try and join the two tables to
  make it more
  efficiant. I am trying to get it to work with hits now than
  make it sessions
  later.
 
  I hope this is enough info and thank you for your help.
 
 
  --
  JJ Harrison
  [EMAIL PROTECTED]
  www.tececo.com
 
 
  Joakim Andersson [EMAIL PROTECTED] wrote in message
  [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
   I assume that 2count should really be count and 2 is just
  the line-number
   you added in this post...
  
   tececo_stats.views is (probably) the name of a column and
  cannot be used
  as
   an alias. Change it to something else.
   change count(*) to count(tececo_stats.*) (I think that's
  what you want)
   And you probably need a group by-statement at the end: GROUP BY
   whatever_you_need_to_group_by
  
   It's really difficult to answer your questions without the
  table designs,
   the error message and what you expect this query to do.
  And, it's not
   slightly OT. It's totally OT. :-)
  
   Regards
   Joakim Andersson
  
  
-Original Message-
From: JJ Harrison [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, July 09, 2002 10:10 AM
To: [EMAIL PROTECTED]
Subject: [PHP] Grr SQL syntax error silghtly OT
   
   
Sorry :}
   
I get a SQL syntax error at line two of the query:
   
$query = select
2count(*) as tececo_stats.views, meta_data.title
from
meta_data, tececo_stats
where
meta_data.id = tececo_stats.id;
   
I have stared at this 'till i felt dizzy. can someone tell me
what I am
doing wrong so that I can learn from it?
   
Thanks in advance
   
   
--
JJ Harrison
[EMAIL PROTECTED]
www.tececo.com
   
   
   
--
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] Moderator where are you, delete me from the list!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

2002-07-09 Thread Erik Hegreberg





RE: [PHP] Moderator where are you, delete me from the list!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

2002-07-09 Thread Martin Towell

look at the footer

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



-Original Message-
From: Erik Hegreberg [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, July 09, 2002 7:40 PM
To: [EMAIL PROTECTED]
Subject: [PHP] Moderator where are you, delete me from the
list




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




RE: [PHP] Delete me from list!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

2002-07-09 Thread Brian McGarvie

Obviously you are one of those ppl who dont keep important emails...

I can handle administrative requests automatically. Please
do not send them to the list address! Instead, send
your message to the correct command address:

For help and a description of available commands, send a message to:
   [EMAIL PROTECTED]

To subscribe to the list, send a message to:
   [EMAIL PROTECTED]

To remove your address from the list, just send a message to
the address in the ``List-Unsubscribe'' header of any list
message. If you haven't changed addresses since subscribing,
you can also send a message to:
   [EMAIL PROTECTED]

or for the digest to:
   [EMAIL PROTECTED]

For addition or removal of addresses, I'll send a confirmation
message to that address. When you receive it, simply reply to it
to complete the transaction.

If you need to get in touch with the human owner of this list,
please send a message to:

[EMAIL PROTECTED]

Please include a FORWARDED list message with ALL HEADERS intact
to make it easier to help you.

 -Original Message-
 From: Erik Hegreberg [mailto:[EMAIL PROTECTED]]
 Sent: 09 July 2002 10:28 AM
 To: [EMAIL PROTECTED]
 Subject: [PHP] Delete me from
 list!!
 !!
 !!
 !!
 
 
 
 
 

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




[PHP] PHP Image Functions

2002-07-09 Thread Mark Colvin

I have a directory of jpegs that I want to display thumbnails of and have a
link to the original jpeg. I would rather not create separate thumbnails
images preferring to create them in memory to display them. I have installed
GD v.1.8.4. The code below outputs jumbled text to the browser (possibly the
jpeg stream?). Code is as follows:

  /tr
tdimg alt=text src=?php echo CreateThumbnail(); ?
valign=top //td
  /tr

?php
function CreateThumbnail()
{
  $x = 130;
  $y = 100;

  $quality = 75;

  $thumbnail = imagecreate($x, $y);
  $originalimage = imagecreatefromjpeg('test.jpg');

  imagecopyresized($thumbnail, $originalimage, 0, 0, 0, 0, $x, $y,
  ImageSX($originalimage),ImageSY($originalimage));

  header(Content-Type: image/jpeg);
  imagejpeg($thumbnail,'test.jpg',$quality);

  imagedestroy($thumbnail);
}
?

Why will this not work?



This e-mail is intended for the recipient only and
may contain confidential information. If you are
not the intended recipient then you should reply
to the sender and take no further ation based
upon the content of the message.
Internet e-mails are not necessarily secure and
CCM Limited does not accept any responsibility
for changes made to this message. 
Although checks have been made to ensure this
message and any attchments are free from viruses
the recipient should ensure that this is the case.


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




[PHP] Bad table iso-8859-1

2002-07-09 Thread Philippe

Hello everyone,

I have a problem with charset iso-8859-1.
My configuration is : Apache 1.3.26 on MacOS X with PHP 4.2.1

when I execute this script :
? print ord(é); ?
I have result 142 which is the code of the macinstosh table and when i 
send it to my browser or in a email, this doesn't work.
I must have the windows table where this caracter has the code 233.

I've added in Apache a AddDefaultCharset iso-8859-1.
I also made a ini_set(default_charset,iso-8859-1) But it doesn't 
change anything. It seems to change the 'local values' but not the 
'master values'
I canno't change the value in php.ini because on MacOS X, there wans't a 
file php.ini

So I've made a personal function to change code on fly but it isn't 
speed.

Any suggestions ??

best regards.


Philippe BARRIELLE
Sce Informatique
---
*  S.A. Editions et Publicites - ABRITEL *
109, La Canebière - B.P 2033 - 13201 Marseille cedex 01 - France
Tél  : 33 (0)4 91 11 00 72   Wap : http://wap.abritel.fr
Email: [EMAIL PROTECTED] Web : http://www.abritel.fr
---
LOCATIONS VACANCES - FRANCE - SPAIN - DOM - PORTUGAL
---


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




Re: [PHP] Converting PCX to ...

2002-07-09 Thread BB

batch files rock!

:o)

Bb [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 im having problem getting this converter to work, im running the following
 code:

 exec(cmd /c f:; cd \Products\legacyipc\ipc_dev\Chapter 21; convert
test.pcx
 PDF_Cache\test.gif);

 which is built from a load of data from a database.

 Unfortunatly, nothing happens.

 I don't see the new gif, and I don't get any errors.  Nothing

 Someone please help,

 note: the location of the images cannot be changed

 Miguel Cruz [EMAIL PROTECTED] wrote in message
 [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
  On Mon, 8 Jul 2002, BB wrote:
   I'm writing a reporting system and I have a problem.
  
   I need to insert PCXs into a PDF (using PDFLib), but it doesn't
support
   PCXs.
  
   So, to get round the problem, I need to convert the PCXs to JPGs or
GIFs
  
   Does anyone know of a piece of PHP that can do this inline, (by that I
 mean,
   can be called and run in PHP script), because the images will have
 additions
   and modifications on a regular basis; and they come as PCXs.
 
  You can do it with Imagemagick. As I recall, there used to be direct PHP
  functions for Imagemagick but they have disappeared many versions ago,
so
  you'll have to run it via system() et al.
 
  miguel
 





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




Re: [PHP] Re: mbstring: Japanese conversion not working for me

2002-07-09 Thread Jean-Christian Imbeault

Alberto Serra wrote:

 
 the charset codes must be fully specified, such as
 ISO-2022-JP (the one you are using yourself)
 SHIFT-JIS
 EUC-JP


I tried EUC-JP and ISO-2022-JPand neither worked. Ah well ... so much 
for a nice idea quick hack to displaying multiple charsets at once.

Jc


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




[PHP] Browser Troubles...

2002-07-09 Thread Brian McGarvie

OK...

I have developed a web-application... on Windows 2k Server, IIS5, PHP, MsSQL/MySQL.

Now... on certain browser platforms the browser spuriously dies for no reason. 
(Primarily Oldish IE 5.0(but not all releases) and 5.5).

I have tried MS's mailing lists/support but not had any usefull feedback.

Has anyone came accross this kind of thing before?

Thanks In Advance...

[ http://www.the-local-guide.com :: http://www.mcgarvie.net ]


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




[PHP] EXIF and thumbnails

2002-07-09 Thread Victor Spång Arthursson

Hello!

I know it's possible to read thumbnails from the EXIF-headers in for 
example jpeg-images.

But is it also possible to _write_ EXIF-data, that is, if I want to 
create a thumbnail where there is none?

Sincerely

Victor


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




[PHP] Re: Figuring Out the Best Day in stats program

2002-07-09 Thread Richard Lynch

?
$query = select count(*) as monthly_views from visitors group by
extract('year', time), extract('month', time) order by monthly_view desc
limit 1;

Warning: Supplied argument is not a valid MySQL result resource in
C:\Inetpub\TecEco_PHP\stats_interface\summary.php on line 75
You have an error in your SQL syntax near ''year', time), extract('month',

 Dig through the manual of your database (you didn't say which one) in the
 Date/Time functions section, and see if you can find one that will extract
 the year and month from a timestamp.

 1. 'extract' is probably not the right function name.  You'll have to look
 that up.

http://www.mysql.com/doc/D/a/Date_and_time_functions.html


-- 
Like Music?  http://l-i-e.com/artists.htm


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




Re: [PHP] Browser Troubles...

2002-07-09 Thread René Moonen

snip

Now... on certain browser platforms the browser spuriously dies for no reason. 
(Primarily Oldish IE 5.0(but not all releases) and 5.5).

Has anyone came accross this kind of thing before?

/snip
  

What? M$ software crashing? Na... never seen that ;-)

sorry... coudn't help that!

What output do you produce with your PHP script? Is it plain HTML, does 
it include Javascripts or some our scripts? Did you check the HTML code 
of the output? Does it contain invalid tags or missing end tags?


René







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




Re: [PHP] Thanks

2002-07-09 Thread Richard Lynch

Probably a stupid question. Is there anyway to force POSTing a form from
the refresh META?

META HTTP-EQUIV=Refresh CONTENT=2;URL=someURL/somescript.php

IMHO that is NOT possible, but maybe I am wrong.

You are correct -- it cannot be done.

If there is no JavaScript, you can only force a POST by getting the user
to click on a FORM element, some how, some way...

*UNLESS*

Use PHP in a GET URL to call something like Rasmus' old 'posttohost'
function which will do the POST.

I don't know if that will work for what you are trying to achieve...

I guess the root question is *WHY* do you want to force a POST?

-- 
Like Music?  http://l-i-e.com/artists.htm


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




[PHP] Re: PHP/MySQL and parameterized queries

2002-07-09 Thread Richard Lynch

Does MySQL support parameterized queries (e.g., INSERT INTO table
(Col1,Col2) VALUES (?,?)), and if so, is there a PHP function that allows
you to create and attach parameters to MySQL queries?

I don't believe MySQL supports that, so there's no PHP mechanism for it.

However, you *can* insert a bunch of rows at once with something like:

$query = insert into table (col1, col2) values (1, 2), (3, 4), (5, 6);

I don't guarantee I got the MySQL syntax correct, though.

This is, however, not supported under other database engines, so be aware
that you'll need to alter it if you ever move to something other than MySQL.

-- 
Like Music?  http://l-i-e.com/artists.htm


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




[PHP] Re: Error: Parse error: parse error, unexpected $ in...

2002-07-09 Thread Richard Lynch

Hi all. Im getting the above mentioned error: *Parse error*: parse 
error, unexpected $ in *c:\program files\apache 
group\apache\htdocs\login.php* on line *38* when I try to view the page 
I just created. As a forewarning, I am very new to PHP, so I may have 
done something stupid, and if it matters, I am also using windows, not 
*nix. Any help with this would be greatly appreciated.

You kinda gotta show us line 38, and the lines before it...

Wild Guess would be a missing ; in the line *BEFORE* 38.
Second choice would be a missing } somewhere, or a missing quote.

Consider looking into configuring your editor to syntax-highlight your PHP
for you.

-- 
Like Music?  http://l-i-e.com/artists.htm


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




Re: [PHP] Thanks - Actually POSTING without javascript

2002-07-09 Thread Richard Lynch

javascript in this page verifies user configuration (screen, java 
enabled, platform etc) and stuffs this data into a hidden form then 
sends it back to index.html where data will be used to understand 
whether we can rely on jscript and cookies within this session.

Aha!

What you probably should do is have your index.php page spew out some
JavaScript that re-directs them to the JavaScript-enabled home page, and
then whatever you wish to display to the non-JavaScript users.

The JavaScript users will end up on the other home page, and the
non-JavaScript users won't.

Separate the non-JavaScript users right away.

-- 
Like Music?  http://l-i-e.com/artists.htm


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




Re: [PHP] Problem with SQL query

2002-07-09 Thread Richard Lynch

LIMIT was not included in the SQL92 SQL standards and very few vendors
implement all of SQL99; the use of ANSI standards to promote portable
programs has always been beset by this kind of problems.

Wow!  There's actually an SQL99 that vendors are targeting, kinda sorta?

Hey, with any luck, but 2009, they'll all be SQL99-compliant, and we can
start all over!

Not that they ever all reached SQL92 compliance.

Oh, just in case people don't know.

SQL92 is named SQL92 because it was defined in... [drum roll]  1992

That's 100 years ago in doggie years :-)

Consider yourself lucky if any of your SQL is really portable without
jumping through hoops.

I do want to apologize for my month_view/monthly_views typo.

-- 
Like Music?  http://l-i-e.com/artists.htm


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




[PHP] Re: transporting variable via post to another site

2002-07-09 Thread Richard Lynch

I do have a multisite form. There are several fields on page 1 and several
on page 2.

Everything works fine exept of error handling. Which means if a user wants
to go back from step 2 to one and has already filled in some data in site 2
he will loose this data for sure. It is not possible to transport the data
via get anymor because the text is way to long.

POST text can be very large, but your server is allowed to limit it as low
as 2K, I think.

GET data can be limited as small as 255 characters, I think.

Those limits may have increased, but the bottom line is still GET *can* have
a much lower limit.

It's up to the server to impose (or not) this limit.

So how could this be done with post? I tryed to include a hidden text field,
but since this must be another form (action links to page 1) I can't get the
value of the entered data.

You'll be able to do a quick hack to fix it just using POST, but, truly,
you'll save yourself a lot of headache long-term to use:

http://php.net/session_start

to just keep track of the user's ID, and store all the data as they fill it
in in a 'temporary' table in your database.

Create a table with all the fields in all the forms, and call it something
like 'incomplete_applications'

Then, when the user has clicked around on all the pages and is happy, they
can submit the 'final' application.

You can then double-check all the data and make sure it's good, and then
insert it to the real table, and delete it from the temp table.

You'll need to sit down and plan this out a bit more, but you'll be much
happier with the results.

-- 
Like Music?  http://l-i-e.com/artists.htm


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




[PHP] Re: Mailing all the elements of a form

2002-07-09 Thread Richard Lynch

I have looked in PHP manual but I cannot seem to find what I am looking for.

I have a very large form that I need to be able to mail. I just don't want
to have to code all of the field into my mail() function.

I think this one is still in the FAQ, so maybe it's time to re-read that.

I asked the same question myself, lo these many years ago, when I had *read*
the FAQ, but didn't understand the question, much less the answer...  Felt
pretty silly when I went and re-read the FAQ, and there it was, plain as
day. :-)

Also cleared up a few other things that had been bugging the back of my
brain:

http://php.net/FAQ.php

-- 
Like Music?  http://l-i-e.com/artists.htm


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




Re: [PHP] Re: Stored Procedures

2002-07-09 Thread Richard Lynch

On Sat, 06 Jul 2002 15:27:47 -0500
 Do you have *ANY* idea how quickly:
 
 select * from MyTable can be parsed and an execution plan selected?!
 
 It's CHUMP CHANGE in time.
 
 *ONLY* if your SQL is so incredibly complicated that you can't even
 understand it will the parse/compile time of SQL be a factor in
 performance.

It is CHUMP CHANGE when you make a tinie web site with 2 users.  Do the
math.  If you have a SQL statement that takes 250 milliseconds to parse
and create an execution plan, then 250 * 1,000,000 page request per week
(which is what the site I finished averages, the company I
work for has 110,000 employees) = ??? This is second grade math.

No matter how you look at it, 10 extra milliseconds here or there
adds up when you work on a big site.  The db's I work with are not
simple select foo from bar queries.  An enterprise db is usually pretty
complex.  My main reason for posting a reply was not to start a stupid
flame war with you.  It was from stopping you from filling the heads of
new programmers on this list with bunk.  Stored procedures are not junk!
I wonder why they are the most requested feature for MySQL?  Why would all
the Big DB's (Oracle, DB2, PostgreSQL, SQL Server, etc.) support them
if they had no benifit?  The biggest benifit is SPEED, the second is
the ability to encapsulate the underlying database structure.  A DBA can
change the db structure at will as long as the sproc returns the same
columns.

Yes, if your site gets millions of hits, an SPROC can improve raw SPEED.

And it *MAY* be the only option available to wring out that performance you
need.

There are some significant down-sides to the administration of SRPOC, as I
noted earlier.

The company I was working for was *NOT* getting millions of hits, had no
*CHANCE* of getting millions of hits, and mindlessly wasted weeks' of
developer time and drastically increased maintenance costs because SPROCS
make it faster has been the watch-word.

Their DBA was their chief IT who was their main lead developer, and then
there was me.  Two programmers in the entire 7-person company.

If somebody actually *HAS* a system large enough to need SPROCs and *has* a
DBA who isn't also the chief-bottle-washer, they almost-for-sure don't need
me, or you, to tell them about SPROCs. :-)

My primary concern is the little guy who's going to run out and change their
entire architecture around for a 3000-hits-a-month web-site because they
keep hearing SPROCs will make it faster without anybody ever bothering to
mention little things like overhead and administration and maintenance
to them.

I'm sorry my rant touched off a nerve, and if there *IS* anybody stuck with
a million-hits-a-day site, by all means, *TEST* some SPROCs and see if they
improve your performance enough to make the maintenance hit worthwhile!

By all means, *DESIGN* the darn thing with as many layers of solid, clean,
simple API as it takes.

But if you're trying to improve page load speed on a low-traffic site,
SPROCs are almost for sure not your answer.

If you don't even *have* a speed problem, running out and spending a
gazillion $$$ worth of people-hours on SPROCs is downright silly.

-- 
Like Music?  http://l-i-e.com/artists.htm

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




[PHP] Re: suppressing errors with @

2002-07-09 Thread Richard Lynch

Doesn't  surpress output (in general)?
Variables don't usually produce an output so putting  before it shouldn't
make any difference.

 suppresses *ERROR* output, not just any old output.

 echo foo;

will echo foo out.

 echo $foo;

will echo out anything in $foo, but if you haven't *PUT* anything in $foo
yet, and if you have E_ALL turned on like you should, then the  will
suppress the Warning: message.

 can generally appear just about anywhere, and not necessarily just in
front of functions (unless this changed on purpose in 4.2 for some reason
beyond my ken)  I don't use  a whole lot, except for pg_fetch_row() where
you pretty much have to (ugh!)

Anyway, this is legal (or was before 4.2), if silly:

if ($foo){
}

Here, the test for $foo, which might not be set, will suppress the
Warning: about $foo not being set, because there is an  in front of it.

Of course, you *OUGHT* to be using:

if (isset($foo)){
}

in the first place!

I dunno why the  behaviour changed in the original post's case.

Might even be an actual bug...

-- 
Like Music?  http://l-i-e.com/artists.htm


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




Re: [PHP] inserting linebrakes in multisite forms

2002-07-09 Thread Richard Lynch

That looks like the result of htmlentities(nl2br($string)).

Actually, it's probably the result of just nl2br($string) and being in the
midst of the INPUT tag in the first place...

Do it the other way around.

Better yet, don't call nl2br or htmlentities or anything else on data that
you are inserting into your database. Madness that way lies.
Instead, use those functions only when outputting data to the browser.

Yes!  I forgot to say that part.  Don't put the nl2br() part in before you
insert it to the database.

You'll give yourself a major headache some day, like when you need to send
that data off to something that's *not* a browser.  And it *will* happen,
sooner or later.

You *DO* need the htmlentities() to change your $string into valid HTML, so
you can send it to the browser and fish it back out reliably.

You are essentially treating the browser as a data storage facility, but a
browser only accepts HTML data.

Thus, you must convert your data into HTML using htmlentities() when storing
it there.

You do *NOT* want to convert it with htmlentities() or nl2br() when storing
it in MySQL.

You only want to use Magic Quotes *OR* addslashes() to store into MySQL.

Then, only when you *finally* output it to the end-user do you want to use
nl2br() to add any HTML needed to properly display it.

I hope this is making some sense now.  It's hard to know when to apply these
functions, but the two basic rules I would suggest you try to follow are:

Be sure you use the right function to store the data in the place you're
putting it:

htmlentities to store HTML data
addlashes() to store MySQL data (Or Magic Quotes instead of addslashes)
nl2br() only to output the data in the final rendering to the end-user

And, only apply these functions at the last minute that you have to --
Applying them any sooner than that will give you a data-headache.

Still, though, using the browser as data storage facility in a multi-page
FORM is not such a Good Idea (tm) in the first place.

The browser is really good at *presenting* data, but wasn't really designed
as a substitute for a database.  Put your data into the database as soon as
possible.  MySQL is *really* good at data storage.

-- 
Like Music?  http://l-i-e.com/artists.htm


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




[PHP] Re: About submitting multipart.forms

2002-07-09 Thread Richard Lynch

has anyone met with this problem.. using IE to submit multipart forms. in
text fields if there is  ... all text after it will disappear..quite a
nuisance when submitting

You probably aren't using http://php.net/htmlentities as you pass data back
out to the browser.

Microsoft, in it's infinite wisdom, has decided that things like:

copy; don't really need the semi-colon to be HTML Character Entity
thingies, and copy is just as good.  (Try it!)

Thus, if you don't use htmlentities to turn regulation require into
amp;regulations require, then MS has foolishly decided that reg *must*
be the HTML Entity reg;, and you're just forgetting the ;

You should be using htmlentities anyway, but it's quite annoying when
dumping data to the browser that MS does such stupid things with it.

Sigh.

Anyway, moral of the story:

*ANY* time you are sending strings out to the browser as data, use
?php echo htmlentities($data);? on the data part.

EG:

INPUT TYPE=HIDDEN NAME=data VALUE=?=htmlentities($data);?



-- 
Like Music?  http://l-i-e.com/artists.htm


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




Re: [PHP] Survey: MySQL vs PostgreSQL for PHP

2002-07-09 Thread Richard Lynch

I've been using MySQL/PHP for quite some time.  Several months ago, I
wanted to port a project over to PostgreSQL.  I found everything about pg
(eg the website, documentation, installation process) far less straight
ahead than MySQL.  So much so, that I didn't get around to actually
installing pg.

I actually found PostgreSQL more straight-forward, since the arguments are
required.
(Or used to be.)  So I better understood what was going on in PostgreSQL.

Not as many examples out there but, really, changing:

mysql_query($query) to
pg_exec($connection, $query)

in reading the examples is not that tricky...

Oh well.  Different tastes for different folks.

Plus, as others have pointed out, the supporting functions in PHP aren't
as powerful/diverse.  For example, there's no insert id function.

Yes, there *IS* such a function, but it's a two-step process.

$oid = pg_getlastoid() followed by a SELECT ... where oid = $oid

http://www.php.net/manual/en/function.pg-last-oid.php

OID stands for Object ID, and every PosgreSQL object has a unique OID. 
Every row, every Large Object, every everything.

Whoops.  Just double-checked, and apparently pSQL 7.2 doesn't *have* to have
OIDs for everything.  This could get interesting, folks...  A quick perusal
of the PHP Docs makes me say:
Only get rid of the optional OID if you are 100% sure you'll never need go
use pg_last_oid() or you'll be in deep trouble.

You do *NOT* want to just use the oid as my own id however.  OIDs can
change when you export/import database data, if you're not careful, and it's
just bad form to use that internal ID as your own.

PostgreSQL (and any SQL database) would be completely un-usable (*) if there
wasn't some way to reliably get the last tuple inserted from your own
connection.

Kinda funny that never made it into SQL92 :-)

(*) Yeah, okay, you can generate your own unique ID before the insert, and
then SELECT on that to get the auto-generated ID...  Might as well not
bother with an auto-generated ID, then, eh?

-- 
Like Music?  http://l-i-e.com/artists.htm

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




[PHP] Re: inserting linebrakes in multisite forms

2002-07-09 Thread Richard Lynch

One Form has a textfield, I submit it to another html site where there is
another form with a textfield. Inside this textfield I place a hidden field
with the value of the field from page 1 then I submit to the actual php site
inserting the values into a db.

On the middle page, use View Source in your browser to look at the HTML
and your HIDDEN text.

I'm guessing that where you spit that HIDDEN text out, you are not using:

http://php.net/htmlentities

EG:

?php
echo INPUT TYPE=HIDDEN NAME=whatever VALUE\, htmlentities($whatever),
\\n;
?

at this point I do insert the linebrakes (nl2br) but only the field from
page 2 is really stored with linebrakes the other one is not. How come?

Has anybody a good idea or even know how to do this?

You may also want to consider storing each page's worth of data in a
temporary table, kinda like a shopping cart, and then you only have to pass
the User's ID around to keep track of all their stuff.

I'll go into this more in the answer to your next question :-)

-- 
Like Music?  http://l-i-e.com/artists.htm


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




[PHP] Re: newbie: a couple basic questions

2002-07-09 Thread Richard Lynch

1) in a fuction, does a return statment automatically exit the function as
well?

Yes.  Nothing more will get executed inside the function after the return;

Some purists claim that you should *NEVER* have a return *ANYWHERE* except
the last line of a function.

EG:

# WRONG
function divide($numerator, $denominator){
  if ($denomiator == 0){
return '';
  }
  else{
return $numerator/$denominator;
  }
}

# RIGHT
function divide($numerator, $denominator){
  $result = '';
  if ($denominator == 0){
$result = '';
  }
  else{
$result = $numerator/$denominator;
  }
  return $result;
}

It probably seems silly here, but when your functions get to be three or
four screenfuls long, a return you aren't seeing on the monitor can
frequently get you very confused, very fast.


2) can someone give me a better explination of $HTTP_POST_VARS

If you give somebody an HTML FORM (like those forms you fill out on-line),
after they fill it out, the PHP page that *proccess* the FORM page will find
all the data in an array named $HTTP_POST_VARS.

Actually, it got renamed to $_POST recently.  (The old one will still work
for a while, but convert ASAP).

Sample HTML:

HTMLBODYFORM ACTION=process.php METHOD=POST
  INPUT NAME=searchkey INPUT TYPE=SUBMIT NAME=search VALUE=Search
/FORM/BODY/HTML

Sample PHP:
(note the filename must match the ACTION= part above)

?php
  echo Searchkey is , $_POST['searchkey'], BR\n;
  echo search button was clicked: , isset($_POST['search']), BR\n;
?

You could even not know what fields are in the FORM, and just output all
of them:

(this would be a replacement process.php file)
?php
  while (list($variable, $value) = each($_POST)){
echo $variable is $valueBR\n;
  }
?

-- 
Like Music?  http://l-i-e.com/artists.htm


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




[PHP] Re: configure breaks at return type of qsort...

2002-07-09 Thread Richard Lynch

configure: error: Cannot find header files under /usr/include/mysql
Bad exit status from /home/askwar/RPM/tmp/rpm-tmp.64223 (%build)

I called configure with these parameters:


--with-mysql=/usr/include/mysql

host:/S.u.S.E. # ls -la /usr/include/mysql

Does anyone have an idea about why this error happens?

Here's the thing:

PHP needs to find the MySQL headers, and you made a really good guess on the
--with-mysql part so it could have found those...

But, PHP *ALSO* needs to find the MySQL libraries, which are probably
under /usr/lib/mysql

Now, you only get to specify *ONE* pathname in your --with-mysql=xxx

So, here's the deal-io.

You tell ./configure the directory *UP* *TO* the common part of where
MySQL headers and libraries are, and it digs down inside there to find both:

--with-mysql=/usr

Does that make sense?

PHP needs to dig inside of that to find the include dir, *AND* the lib
dir where stuff like libmysql.so are living.

So only give ./configure enough info to know where to start digging, not the
whole path to just the include and then it can't find the lib -- and,
paradoxically enough, it can't dig down to find the include inside the
include, because you dug too deep already.

In your case, it's just /usr

Somebody else might have:

/usr/local/mysql/
include/
lib/

and they would use /usr/local/mysql

Don't worry about exactly how ./configure is going to dig down inside of
/usr/include/mysql and /usr/lib/mysql
as opposed to
/usr/local/mysql/include and /usr/local/mysql/lib
on some other system
(See how the directory structures are inverted ?)

./configure is real good at digging down the directories either way it's
laid out.

It just ain't good at backing up a directory or two to find the parts it
needs.

-- 
Like Music?  http://l-i-e.com/artists.htm


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




[PHP] Re: Printing Problem

2002-07-09 Thread Richard Lynch

I'll repeat my ealier question because some people can not think for
themselves..

There are actually two (2) possibilities here...

One is that you actually want to print the invoices on the printer connected
to the *WEB* *SERVER*  If that is the case, you really should skip the whole
JavaScript part, and just mess with lp and PHP from the command line, if at
all possible.

The other is that you have a little hole in the background knowledge you
need to understand why you're really not making a lot of sense by insisting
that PHP pause the dialogs...

I want to run a print job of 200+ invoices

I have a javascript code to open a print dialog box and
Then go to next invoice and do the loop..

Problem I am having is that I want it to pause if the ok button on the 
dialog Box is not pressed..
When I run the script it fly's throught and brings up a heap of printer
Dialog boxes which causes me to ctrl+alt+del...

Anyway or pausing the script untill ok is pressed?

Thanks in advance..

(PS: I have sent this to this group because
 1. The loop is done in php and NOT javascript

The loop you are using in PHP is *generating* JavaScript.

The *PRINTING* is being done on the *BROWSER* and PHP lives on the *SERVER*

So the loop speed is not the controlling factor.  Honest.  More on this in a
minute.

 2. My question is regarding php and pausing the loop and not
with the javascript code)

You can, if you like, use http://php.net/sleep to pause that loop as much as
you want.

*BUT* this is almost for sure *NOT* going to work all by itself.

Look at this picture:

+---+   +-+
| Browser 1.|-- URL|2. Web Server|
|   |   |3, 4, 5. |
| JavaScript  7.|--|6. PHP   |
| 8.|   | |
| 9.|   +-+
+---+
  |
  |
  |
  |
  v
   PRINTER

Now, take this in slow motion

1. Browser asks for URL.
2. Web-Server gets Request.
3. Web-Server identifies it as PHP page.
4. Web-Server fires up PHP.
5. PHP spews out HTML/JavaScript response.
6. PHP finishes HTML/JavaScript output.
7. Browser gets HTML/JavaScript.
8. Browser displays HTML.
9. Browser executes JavaScript.

As you can see, it really doesn't matter how fast or how slow your PHP
script delivers the HTML/JavaScript to the browser, really.

The *JAVASCRIPT* execution determines how fast those dialogs are going to
pop up, no matter how quick/fast PHP delivers it.

Think of it this way:  Whether the pitcher throws a fast ball or a curve,
it's how hard the batter *HITS* the ball that makes it a home run or not. 
So the speed of the ball delivery is irrelevent to the distance the ball
travels.

[Technically, Newton's action/reaction laws do factor in a trifle on the
ball's speed, but let's not pick nits, okay?]

Similarly, no matter what speed PHP delivers the JavaScript, it's the Java
engine that runs it.  Don't matter if PHP delivers it slow or fast, the
*BROWSER* gonna run it the same speed.

Actually, 5, 6, 7, and 8 can over-lap a little.

So, really long and complicated PHP with lots of HTML going out *might* have
the browser displaying the top of the HTML before PHP finishes spewing out
the bottom of the HTML...

But, honestly, even when you *think* that's happening, it's usually really
just the browser being slow to *draw* the HTML, and PHP has finished and
gone home already.

So for all practical purposes, you might as well just think of each of those
9 steps as one after the other.  (And if you have TABLE tags, it *IS* going
to be one after the other.)

Now, you just *MIGHT* achieve a very crude control over PHP output and
convince *SOME* browsers to execute the JavaScript if you do this just
right

1. You'll probably have to have all the print happen in the HEAD tag, or
maybe even before the HTML tag, so the browser doesn't get distracted by
the layout of the BODY.

2. You'll almost-for-sure have to send each Print job in a *SEPARATE*
SCRIPT/SCRIPT tag, or the JavaScript compiler will be waiting for the
closing /SCRIPT before it compiles the JavaScript and executes it.

3. You'll need to call http://php.net/flush after each print is output, so
that the JavaScript is forced out to the browser.

Even, then, I'm betting this just isn't gonna work... It *might* on *some*
browsers, but not reliably...

Still, here it is:

?php
  while (list($invoice) = each($invoices)){
echo SCRIPT LANGUAGE=JavaScript\n;
echo javaprint($invoice); # Whatever it takes to do the print in
JavaScript
echo /SCRIPT\n;
flush();
sleep(5);
  }
?
HTML
  HEAD
TITLEWhatever/TITLE
  /HEAD
  BODY
  /BODY
/HTML

You *MIGHT* be able to get away with putting the JavaScript into the HEAD
part, but almost-for-sure if you put it into the BODY or lower, it ain't
gonna work.  I could be wrong on that part, but I doubt it.

Of course, if 

Re: [PHP] Re: suppressing errors with @

2002-07-09 Thread Richard Lynch

I use it in front of variables (never tried it on $GLOBALS, etc though)

eg: (using register_globals = on  thingo  - hey don't blame me, it's the
tech guys who have it on, and there's too much legacy code to turn it off :(
- anyway)

?
  if ($var) { echo Yep, var is there; } else { echo nope; }
?

The risk is in hackers using an un-initialized $var to pass in their own
data.

If you've *correctly* programmed and caught *every* single case where that
might happen, by using isset() or even something like the above, only doing
something more useful, you're almost-for-sure okay.

register_globals off just annoys me since I *always* initialize variables,
and there's no point to me re-writing the tons of scripts for it, but that's
life.

That said, the sheer number of non-programmers writing PHP made
register_globals on a Bad Idea (tm) really...

I guess even some good programmers could occasionally miss a variable
initialization, though I never do :-)

-- 
Like Music?  http://l-i-e.com/artists.htm


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




Re: [PHP] Software on web Accessing mySQL/PHP

2002-07-09 Thread Richard Lynch

Basically we have created a Software in Visual Basic.
Now the software uses mySQL on the internet as
Backend. However, our server does not allow Remote
Host Connection, which means we cannot access our
mySQL Database on the Internet by our Software on a
local client. We need the mySQL Database on the
Internet because basically everything will be
available on a website later through PHP Pages.

Now, my problem is how to connect to my mySQL DB on
the Internet, via my Software, when my Server Company
doesn't allow Remote Host Connection to mySQL.

What is suggested to me is to place the Software on
the Internet. I have no clue how to do that. Because
if i place an .exe file on the net, it will just start
downloading instead of running. 

*IF* your ISP is running PHP on Windows, you *MIGHT* be able to just upload
your .exe to the CGI-BIN directory and get it to work somehow through
that...

But, really, your ISP is gonna be able to clarify this much faster than any
of us...

If all else fails, and this is really, really crude, you *COULD* build a PHP
script that would spew out whatever data you needed from MySQL, and you
*COULD* (I assume) get your VB program to read the HTML via HTTP, and then
you *COULD* POST back to the web-server from VB any changes and PHP could
process them...

This would be really ugly, but does satisfy the conditions I think you have
laid out...

How then can i accomplish this? 
The software feeds in Data in the mySQL DB on the
internet, and then the PHP pages access the mySQL DB
to show data to users on the Website. It's something
like that. The software involves a lot of processing,
decryption, conversion etc. to convert a .dat data
into usable mySQL Tables Data.

-- 
Like Music?  http://l-i-e.com/artists.htm


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




[PHP] Re: A problem in mysql_fetch_array

2002-07-09 Thread Richard Lynch

I have insert some text with space to mysql DB with varchar()

When I use mysql_fetch_array function to retrieve the data from DB . I 
found only the first session text can be shown . It means if any space 
there . It will split like session by session. for example. my DB have a 
text Hello World , It can retrieve only HELLO by using mysql_fetch_array . 

Wild Guess:

Somewhere, you have something like this:

echo INPUT TYPE=HIDDEN NAME=hello VALUE=$hello;
(Where $hello is your variable with Hello World in it.)

This turns into this in the HTML

INPUT TYPE=HIDDEN NAME=hello VALUE=Hello World

Which, in HTML terms, means that World is part of the *TAG*, not the data
-- It's an attribute, because there is a space and no quotes around your
data.

You need to convince the HTML to look like this:

INPUT TYPE=HIDDEN NAME=hello VALUE=Hello World

so the PHP should be:

echo INPUT TYPE=HIDDEN NAME=hello VALUE=\$hello\;

And, just in case $hello might some day contain  or  or  or  or anything
else that has special meaning in HTML, it should *really* be this:

echo INPUT TYPE=HIDDEN NAME=hello VALUE=\, htmlentities($hello), \;

http://php.net/htmlentities

-- 
Like Music?  http://l-i-e.com/artists.htm


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




[PHP] Re: Little php execution question.

2002-07-09 Thread Richard Lynch

Hello php-general,

  I finally finish my work on one of the projects. I got a question
  how PHP executes a script.
  Let's say i got a little script but it takes him a long time to work
  (don't blame me please) If a user stops loading page of will close
  the window. Will Script continue working till the end or php will
  kill that process?

Yes.

:-)

http://php.net/ignore_user_abort

Test thoroughly!

-- 
Like Music?  http://l-i-e.com/artists.htm


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




[PHP] Re: Parsing CGI for PHP?

2002-07-09 Thread Richard Lynch

Can this be done with apache 1.3 ?
I want to have the output of my CGI-script to be parsed with PHP, or 
rather, have the php within the ? .. ? parsed, of course, since the 
script outputs alot more than just php-code.

Is it possible?


I don't think so.

Apache 1.x was designed to hand off the URL to one, and only one, CGI or Handler 
pre-processor.

Only with Apache 2.x can you stack handlers.  I dunno if Apache 2.x lets you 
mixmatch CGI with Handlers, though.

Unless you can output to some kind of file somewhere, and send the user there with a 
Location: header, which is really ugly

-- 
Like Music?  http://l-i-e.com/artists.htm


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




[PHP] Re: Converting PCX to ...

2002-07-09 Thread Richard Lynch

I'm writing a reporting system and I have a problem.

I need to insert PCXs into a PDF (using PDFLib), but it doesn't support
PCXs.

So, to get round the problem, I need to convert the PCXs to JPGs or GIFs

Does anyone know of a piece of PHP that can do this inline, (by that I mean,
can be called and run in PHP script), because the images will have additions
and modifications on a regular basis; and they come as PCXs.

I think you will be stuck with using http://php.net/exec to run some
external process to convert them.

Image Magik seems to convert almost every format known to man...

-- 
Like Music?  http://l-i-e.com/artists.htm


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




[PHP] Re: keep textformating ?

2002-07-09 Thread Richard Lynch

Lets say I have a guestbook, and I want the text the visitors write in it be
saved in a database(mysql) and when retrieved, if should have the same
textformating, I guess this is a really basic thing, but I don't know what
to look for :)
I've caught \n and ereg*, but I'm not sure that's the thing, help bitte .)

Also use WRAP=VIRTUAL in the TEXTAREA tags, unless you want annoyed users
when they type too much...


-- 
Like Music?  http://l-i-e.com/artists.htm


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




[PHP] Re: Editing Word Documents

2002-07-09 Thread Richard Lynch

I have an intranet, which provides access to, amongst others, Word 
Documents about policies, etc. What the guys are looking for is a way to 
do the following:

1. Show a list of files available for editing
2. If a file is clicked, then it is locked for other users (no access)
3. The file opens on the client's machine
4. The client edits it
5. The client then closes the file, it auto-saves and he goes about 
his business.

Points 1 through 3 are relatively trivial. Point 4 and 5 (especially 5) 
have me lost.

How do you get a file to be edited, and then automatically returned to 
the server by M$ Word in it's changed format. Is this possible?

How would this change in a database-backended system (including the 
files as BLOBs)?

They'd have to be uploaded *SOMEHOW*...

If the employees can't do that by hand, then perhaps some kind of
scheduled task on the Win boxes could be programmed to do it.

Don't forget to *UNLOCK* after a successful upload, but not when, not if,
when, the upload fails.

There's simply NO WAY the server can reach out and suck in a file of its own
volitoin... Major privacy/security problem there.

You *COULD* also install Apache + PHP on every desktop, and have them
serving up their edited Word files to the Intranet, and then PHP could use
HTTP to suck them back in...

But that's probably not gonna fly for non-technical reasons.  Well, not
counting really bad Security as a technical reason.

-- 
Like Music?  http://l-i-e.com/artists.htm


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




[PHP] Re: add to basket

2002-07-09 Thread Richard Lynch

What's the best way to implement functions like 'add to basket' or 'add to 
wishlist' and so on.

I mean: you are on a page with detail information about a product. If the 
user clicks the link for 'add to basket' I have to perform a piece of 
script and then go back to the detail page of the given product. But 
clicking on this link leads me away form the page...

I was thinking of using $HTTP_REFERER i the ad_to_basket.php page in 
order to retrieve the last url, but now I don't know how to go back to this 
detailpage, is there a php command for this, or is my approach totally wrong??

- sample.php 
?php
  require 'basket.inc';
?
Display rest of page here.
A HREF=?=$PHP_SELF??item_id=42Item # 42/A
Display items already in cart:
?php
  $query = select item_id from basket where user_id = '$user_id';
  $basket = mysql_query($query) or error_log(mysql_error());
  while (list($item_id) = mysql_fetch_row($basket)){
echo $item_idBR\n;
  }
?



- basket.inc ---
?php
  session_start();
  $user_id = session_id();
  if (isset($item_id)){
$query = insert into basket (user_id, item_id) values('$user_id',
$item_id);
mysql_query($query) or error_log(mysql_error());
  }
?
---

You'll want to complicate this horribly with a quantity so you'll need to
check if they have any or not, and then do an insert if they don't and an
update quantity = quantity + 1 if they do, and then validating data, and
so on, but that's really all there is to a shopping cart at its most
simplistic.

What most people mean when they say shopping cart these days is shopping
cart and shipping charges and catalog system and pricing structures
and secure checkout and...

-- 
Like Music?  http://l-i-e.com/artists.htm


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




[PHP] Re: regex for emoticon codes

2002-07-09 Thread Richard Lynch

i have something like 
$str = sometext sometext [emoticon01] sometext [emoticon23] sometext;

i would like to use regex to replace those codes into:
sometext sometext /images/emot/01.gif sometext /images/emot/23.gif sometext

all numerics after the code emoticon consisted of exactly 2 digits; and they
are in the range from emoticon01 to emoticon30.

i have spent the whole day starring at my crt and reading manpages plus
examples. i achieved nothing but sore eyes.

i would GREATLY-GREATLY appreciate if someone could gimme a code snippet on how
to this sorta thing.

You're lucky.  You don't have to strain your brain with Regex. :-)

?php
  for ($i = 1; $i = 30; $i++){
$emoticon[] = '[emoticon' . sprintf(%02d, $i) . ']';
$images[] = '/images/emot/' . sprintf(%02d, $i) . '.gif';
  }
  
  $str = sometext sometext [emoticon01] sometext [emoticon23] sometext;
  echo str_replace($emoticons, $images, $str);
?

http://php.net/str_replace

-- 
Like Music?  http://l-i-e.com/artists.htm


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




[PHP] Re: $_REQUEST???

2002-07-09 Thread Richard Lynch

Can the $_REQUEST be trusted??  The documentation said it is the combination
of $_GET, $_POST, $_COOKIE  $_FILE.  If the PHPSESSID is found in
$_REQUEST, I can tell it is from $_COOKIE.  I wonder if the PHPSESSID can be
stored into $_REQUEST if hte $_COOKIE is unavailable or turned off?

Since *NONE* of $_GET $_POST or $_COOKIE can be trusted, I don't think any
combination of them should be trusted.

$_REQUEST is useful when you con't *CARE* if the data came from GET/POST,
and have a script that accepts either.

I have written several such scripts, and the interface of one
site/application accesses it with GET, and the other with POST, and I really
don't give a [bleep] whether the incoming data is GET or POST.

It's all coming from the Internet and is not to be trusted.

Forging a POST is not significantly more tricky than changing a URL.

Just do Save As... HTML from somebody's site, change the HTML FORM
elements, and then open the local file in your browser and POST away.

I've even used this technique to make use of broken sites simply by
providing the FORM elements they forgot that their processing script told me
it needed.

-- 
Like Music?  http://l-i-e.com/artists.htm


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




[PHP] Re: Passing variables

2002-07-09 Thread Richard Lynch

After reading Kevin Yank's Managing Users ... at www.sitepoint.com, I 
tried the following 2 scripts. Unfortunately, the variable $course is NOT 
being passed to the 2nd script. Thus, per the script, the Home page is 
displayed. Why?

In addition to needing session_start() in page 2, you simply cannot reliably
use session_start() which sends a Cookie and a Location: to the browser.

You're going to have to send your data as GET data, or not do all those
header(Location: ...) calls, and just combine the three scripts into one.


-- 
Like Music?  http://l-i-e.com/artists.htm


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




[PHP] Re: Cross-Site Sesison ID Propagation

2002-07-09 Thread Richard Lynch

Hello all fellow-hackers

I am working on a project that includes a number of web sites, which are
grouped together into one network. Kind of like the ‘OSDN’ network, of which
Slashdot.org, for example, is a member.

I need to implement a cross-site session. Using a technique, similar to the
one described at PHPBuilder
(http://www.phpbuilder.com/columns/chriskings20001128.php3) I implemented
this without too much difficulty.

The links at the top of each site (links to other sites in the network)
simply include the session id in the GET request:

a href=http://www.site.com/?sid=1234567;Site1/a | a
href=http://www.site2.com/?sid=1234567;Site2/a | a
href=http://www.site3.com/?sid=1234567;Site3/a etc

As per article, the session id is passed between the sites with ease and the
session from Site 1 can be continued on Site 3 for example.

However, there are a number of cross-site links in the main body of the site
(i.e. not in the network link bar at the top of the page) that link various
articles from one site to another.

Thus, when a user clicks on one of these cross-site links, s/he cannot
continue her/his session, as the session ID is not propagated; the
‘--enable-trans-sid’ option only works on internal links (a very wise design
choice, may I add).

However, in my case, I would like to be able to define a list of external
sites that the ‘--enable-trans-sid’ option works with. (i.e. the sites in
the network).

Is this possible?

If not, which method could I use to propagate the session id between the
sites in the network?

I know, it would be possible to manually add the session id to each
cross-site link, but this is not a great idea, as a number of the links are
from web site visitors in user-comments / forum posts they have submitted.

I may be possible to use output buffering to rewrite the cross-site links to
include the session id (like the ‘--enable-trans-sid’ option works, I
guess). But, as I am using compression
(ob_start(zlib.output_compression);), that may not work. Plus, it seems a
very fiddly method to me.

Any suggestions from anyone, on how I may perform the cross-site session
propagation?

Wild Guess:

Would setCookie('user_id', $PHPSESSID, 0, '/othersite.com');

let you get away with setting the cookies for the other site?

Surely not, or you could wipe out other site's cookies, or worse, replace
them with hacker data...

But 5 minutes will tell you for sure...

Hey, but all those stupid Banner Ad sites give me a cookie from the
*other* guy's site.

All ya gotta do is have three invisible GIFs on all three sites that come
from the *other* sites and the GIF does the set_cookie() of whatever their
user ID is.

--
Like Music?  http://l-i-e.com/artists.htm


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




[PHP] Re: Time to Calculate Time

2002-07-09 Thread Richard Lynch

i have variables $Start, $End each with a timestamp 2 hours apart
(2002070714, 2002070716) respectively
  01234567890123

How do i calculate those to timestamps to get the answer 2?

I've tried working them into unix timestamps and then calculating but no
luck...

any one got any ideas ??

I'm guessing these are coming from MySQL... If so, you can subtract the two
in MySQL much easier/faster than PHP...

http://mysql.com/

If not:

$s = mktime(substr($Start, 8, 2), substr($Start, 10, 2), substr($Start, 12,
2), substr($Start, 4, 2), substr($Start, 6, 2), substr($Start, 0, 4));
$e = mktime(substr($End, 8, 2), substr($End, 10, 2), substr($End, 12, 2),
substr($End, 4, 2), substr($End, 6, 2), substr($End, 0, 4));

$delta = $e - $s;


At this point, it boils down to the question -- Will it ever be, like,
*DAYS* instead of hours, or, more importantly, *MONTHS*?

Because as soon as you get into months or larger time units, it gets
complicated...

Until then, you can divide by 60, or 60*60, or 60*60*24 to get the number of
minutes, hours, days respectively...

-- 
Like Music?  http://l-i-e.com/artists.htm


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




[PHP] Re: PHP Script Speed

2002-07-09 Thread Richard Lynch

but I am wondering if it is at the cost of a slower page loading. The reason
I think this is whenever I would like to display a variable I have to put in
a script tag like ?PHP print $S_Current; ?. I might have as many as 20 of
these on a page. Every time doesn't PHP have to start again and parse out
this information causing it to be really slow?

PHP is already started, and going, and reading your HTML.

It only has to notice when you have ?php and start paying a little more
attention instead of just spewing out the HTML it encounters.

The context change from HTML mode to PHP mode is a negligible, practically
un-measurable performance hit.

I switch back/forth way more than 20 times in most scripts.

Rule of Thumb:
90% of your script's time is being spent in 10% of the code.

If it's too slow figure out where that 90% is, and optimize that.

Actually, it's a bit more complicated than that in the web...

That 90% might all be in MySQL, or in the network congestion, or in your
messed-up reverse DNS lookup, or...

But, still, if you've narrowed the speed problem down to PHP itself, then
start figuring out where it's spending all its time *before* you change a
line of code.

If it's not too slow don't even worry about performance, unless you are
actually working on a site that is likely to balloon into millions of users
or whatever.

Even then -- only testing *YOUR* site, and *YOUR* set up will find the 90%
reliably.

-- 
Like Music?  http://l-i-e.com/artists.htm


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




Re: [PHP] Re: mbstring: Japanese conversion not working for me

2002-07-09 Thread Alberto Serra

ðÒÉ×ÅÔ!

Jean-Christian Imbeault wrote:
 I tried EUC-JP and ISO-2022-JPand neither worked. Ah well ... so much 
 for a nice idea quick hack to displaying multiple charsets at once.

They should. I checked out w3c.org at that and it definitely should. No 
exception for japanese mentioned anywhere.

The two parameters actually open a local exception from the

meta http-equiv=Content-Language content={LANCODE}
meta http-equiv=Content-Type content=text/html; charset={CHARSET}

headers. And SPAN sections can be nested. At least, so the standard goes.

Besides, while checking the docs I stepped onto something really funny 
(to say the very least). I quote from

http://www.htmlcompendium.org/attributes-list/attributes-notes/lang.htm

---
The argument to the lang= attribute is made up of two parts; a primary 
code and an optional subcode (separated by a - hyphen). The primary 
code is a two character language code.
i.e.tag lang=en

The subcode is understood to be a (ISO 3166) country code. However, 
W3C also gives several examples:
tag lang=en-US tag lang=en-cockney tag lang=i-cherokee

They also propose a method of handling such artificial languages as 
Elfish and Klingon. For such languages they propose the primary code of x
-

Now I hope I shall never manage a porting to a Klingon repository LOLOL

Anyway, if you do not need it for your application but just for a 
debugging procedure you can just forget about it :)

ÐÏËÁ
áÌØÂÅÒÔÏ
ëÉÅ×

-_=}{=_-@-_=}{=_--_=}{=_-@-_=}{=_--_=}{=_-@-_=}{=_--_=}{=_-

LoRd, CaN yOu HeAr Me, LiKe I'm HeArInG yOu?
lOrD i'M sHiNiNg...
YoU kNoW I AlMoSt LoSt My MiNd, BuT nOw I'm HoMe AnD fReE
tHe TeSt, YeS iT iS
ThE tEsT, yEs It Is
tHe TeSt, YeS iT iS
ThE tEsT, yEs It Is...


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




RE: [PHP] Browser Troubles...

2002-07-09 Thread Brian McGarvie

There is rather a lot to check... i have checked *most* of it... the only JS is to 
open a pop-up window, but that functions correctly...

In one particular version of IE it fails even to submit the login form ;\

Works perfectly in Mozzilla/NN(4-6)... also fine in IE 6, and as I mentiond most 
IE5.0 except a handfull... but I obviously cant let the client view it as I am unsure 
what browser they will use...


 -Original Message-
 From: René Moonen [mailto:[EMAIL PROTECTED]]
 Sent: 09 July 2002 11:05 AM
 To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
 Subject: Re: [PHP] Browser Troubles...
 
 
 snip
 
 Now... on certain browser platforms the browser spuriously 
 dies for no reason. (Primarily Oldish IE 5.0(but not all 
 releases) and 5.5).
 
 Has anyone came accross this kind of thing before?
 
 /snip
   
 
 What? M$ software crashing? Na... never seen that ;-)
 
 sorry... coudn't help that!
 
 What output do you produce with your PHP script? Is it plain 
 HTML, does 
 it include Javascripts or some our scripts? Did you check the 
 HTML code 
 of the output? Does it contain invalid tags or missing end tags?
 
 
 René
 
 
 
 
 
 
 
 -- 
 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




RE: [PHP] PHP Image Functions

2002-07-09 Thread joakim . andersson

Well, you're halfway there...
You just have to separate the image-script from the rest like this:

image_spewing_script.php:
?php
  $x = 130;
  $y = 100;

  $quality = 75;

  $thumbnail = imagecreate($x, $y);
  $originalimage = imagecreatefromjpeg('test.jpg');

  imagecopyresized($thumbnail, $originalimage, 0, 0, 0, 0, $x, $y,
  ImageSX($originalimage),ImageSY($originalimage));

  header(Content-Type: image/jpeg);
  imagejpeg($thumbnail,'test.jpg',$quality);

  imagedestroy($thumbnail);
?

and in the other file (your actual page):

  /tr
tdimg alt=text src=image_spewing_script.php valign=top
//td
  /tr

Regards
Joakim Andersson



 -Original Message-
 From: Mark Colvin [mailto:[EMAIL PROTECTED]]
 Sent: Tuesday, July 09, 2002 11:27 AM
 To: Php (E-mail)
 Subject: [PHP] PHP Image Functions
 
 
 I have a directory of jpegs that I want to display thumbnails 
 of and have a
 link to the original jpeg. I would rather not create separate 
 thumbnails
 images preferring to create them in memory to display them. I 
 have installed
 GD v.1.8.4. The code below outputs jumbled text to the 
 browser (possibly the
 jpeg stream?). Code is as follows:
 
 Why will this not work?
 
 
 
 This e-mail is intended for the recipient only and
 may contain confidential information. If you are
 not the intended recipient then you should reply
 to the sender and take no further ation based
 upon the content of the message.
 Internet e-mails are not necessarily secure and
 CCM Limited does not accept any responsibility
 for changes made to this message. 
 Although checks have been made to ensure this
 message and any attchments are free from viruses
 the recipient should ensure that this is the case.
 
 
 -- 
 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] Bug in SQL can you help?

2002-07-09 Thread JJ Harrison

Here is my SQL(used in a PHP script so this isn't ot)

SELECT
extract(year FROM time),
extract(month FROM time),
count(*) as monthly_views,
  time
FROM
tececo_stats
group by
   extract(year FROM time),
   extract(month FROM time)
order by
   monthly_views desc
limit 1

the problem is that is counts the number of rows in the whole thing not the
echoed row. How can I get it count the best days only?


--
JJ Harrison
[EMAIL PROTECTED]
www.tececo.com



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




Re: [PHP] Re: Editing Word Documents

2002-07-09 Thread Marek Kilimajer

The only way I see this can be done is simly let every user mount a 
share under the same letter,
all you need to do then is a 
href=file:///X:/directory/file.docfile/a, then locking files is up
to samba or windows server.

Marek

Richard Lynch wrote:

I have an intranet, which provides access to, amongst others, Word 
Documents about policies, etc. What the guys are looking for is a way to 
do the following:

1. Show a list of files available for editing
2. If a file is clicked, then it is locked for other users (no access)
3. The file opens on the client's machine
4. The client edits it
5. The client then closes the file, it auto-saves and he goes about 
his business.

Points 1 through 3 are relatively trivial. Point 4 and 5 (especially 5) 
have me lost.

How do you get a file to be edited, and then automatically returned to 
the server by M$ Word in it's changed format. Is this possible?

How would this change in a database-backended system (including the 
files as BLOBs)?



They'd have to be uploaded *SOMEHOW*...

If the employees can't do that by hand, then perhaps some kind of
scheduled task on the Win boxes could be programmed to do it.

Don't forget to *UNLOCK* after a successful upload, but not when, not if,
when, the upload fails.

There's simply NO WAY the server can reach out and suck in a file of its own
volitoin... Major privacy/security problem there.

You *COULD* also install Apache + PHP on every desktop, and have them
serving up their edited Word files to the Intranet, and then PHP could use
HTTP to suck them back in...

But that's probably not gonna fly for non-technical reasons.  Well, not
counting really bad Security as a technical reason.

  




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




[PHP] Somehone having a problem to write to the list

2002-07-09 Thread Alberto Serra

To the *list* *maintainers*: this guy says he is registered but cannot 
write to the list. So he wrote me in instead.

úÄÒÁ×Ï! (it's like that, right?)

Djurovski Dejan wrote:
 $aDBLink=@mysql_connect($host, $user, $password);
 mysql_select_db($db, $aDBLink);

you might want to take the  sign off the connection step to get the 
error message. Looks like you did not connect at all but got no warning 
because you told your function to keep shut.

At that point you cannot query anything, but you cannot know about it.

ðÏËÁ
áÌØÂÅÒÔÏ
ëÉÅ×

-_=}{=_-@-_=}{=_--_=}{=_-@-_=}{=_--_=}{=_-@-_=}{=_--_=}{=_-

LoRd, CaN yOu HeAr Me, LiKe I'm HeArInG yOu?
lOrD i'M sHiNiNg...
YoU kNoW I AlMoSt LoSt My MiNd, BuT nOw I'm HoMe AnD fReE
tHe TeSt, YeS iT iS
ThE tEsT, yEs It Is
tHe TeSt, YeS iT iS
ThE tEsT, yEs It Is...


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




Re: [PHP] Bug in SQL can you help?

2002-07-09 Thread Jason Wong

On Tuesday 09 July 2002 18:32, JJ Harrison wrote:
 Here is my SQL(used in a PHP script so this isn't ot)

Aside from the fact that this has _nothing_ to do with php, you would most 
likely get a better response from the php-db list where, hopefully, the sql 
experts hangout.

 SELECT
 extract(year FROM time),
 extract(month FROM time),
 count(*) as monthly_views,
   time

[snip]

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

/*
Philadelphia is not dull -- it just seems so because it is next to
exciting Camden, New Jersey.
*/


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




RE: [PHP] PHP Image Functions

2002-07-09 Thread Mark Colvin

Thanks for your reply. Its a bit further forward but still not working. I
have split the files and the output now shows the text part of 'img
alt=text src=...' ie it won't recognise the image. Anything else you can
think of?




This e-mail is intended for the recipient only and
may contain confidential information. If you are
not the intended recipient then you should reply
to the sender and take no further ation based
upon the content of the message.
Internet e-mails are not necessarily secure and
CCM Limited does not accept any responsibility
for changes made to this message. 
Although checks have been made to ensure this
message and any attchments are free from viruses
the recipient should ensure that this is the case.


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




Re: [PHP] Sending data in table, multiple rows, via mail()

2002-07-09 Thread Thomas Edison Jr.

Thank you for your *extreme* kindness...

I do not know where to begin to make this happen. 
I created a variable and ran the entire do while loop
to read contents of the table and tried storing them
in the variable, which could be used as Content of the
mail. However, i just get the Last Row in my DB Table
sent in mail.. not all the rows. Following is part of
the code i'm using, and it could be absolutely wrong,
but that's all i know.. 

?

$db = mysql_connect(localhost,user, pwd);
mysql_select_db(tbl,$db);

$result = mysql_query(SELECT * FROM cart where
sid='$s',$db);

$realcontent=

if ($myrow = mysql_fetch_array($result)) {
  do {

   
   $myrow[pid]br
   $myrow[nm]br
   $myrow[q]br
   
 
  } while ($myrow = mysql_fetch_array($result));
}

;


$to = [EMAIL PROTECTED];
$subject = Purchase order Website;
$from = Purchase Order;
$stuff = 
Name : $name\n
Phone : $phone\n
Fax : $fax\n
Email : $email\n
Address : $address\n
Country : $country\n
Order:\n\n
$realcontent\n\n;


mail($to,$subject,$stuff,$from);
?




__
Do You Yahoo!?
Sign up for SBC Yahoo! Dial - First Month Free
http://sbc.yahoo.com

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




[PHP] Re: qmail with perl and php

2002-07-09 Thread adi



 try to specify the sender with -f:
 mail([EMAIL PROTECTED], My Subject, Line 1\nLine 2\nLine 3, From:
[EMAIL PROTECTED] ,  [EMAIL PROTECTED]);



 - Original Message -
 From: Jeff MacDonald [EMAIL PROTECTED]
 To: Qmail [EMAIL PROTECTED]
 Sent: Thursday, August 08, 2002 8:05 AM
 Subject: qmail with perl and php


  Hi
 
  I've installed qmail with vopmail, it works the way i want it, however
 
  php does not want to send mail [i've made the change re qmail-inject in
  php.ini]
 
  as well Mail::Mailer with perl does not work.
 
  This is on FreeBSD, i've symlinked /usr/sbin/sendmail to
  /var/qmail/bin/sendmail
  as well
 
  any insight would be REALLY appreciated.
 
 
  Thanks.
 



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




RE: [PHP] PHP Image Functions

2002-07-09 Thread joakim . andersson

imagejpeg($thumbnail,'test.jpg',$quality);
should of course be
imagejpeg($thumbnail,'',$quality);

Otherwise you are creating a new image on your server and not outputting it
to the browser.

/Joakim

 -Original Message-
 From: Mark Colvin [mailto:[EMAIL PROTECTED]]
 Sent: Tuesday, July 09, 2002 12:30 PM
 To: [EMAIL PROTECTED]
 Cc: Php (E-mail)
 Subject: RE: [PHP] PHP Image Functions
 
 
 Thanks for your reply. Its a bit further forward but still 
 not working. I
 have split the files and the output now shows the text part of 'img
 alt=text src=...' ie it won't recognise the image. 
 Anything else you can
 think of?
 
 
 
 
 This e-mail is intended for the recipient only and
 may contain confidential information. If you are
 not the intended recipient then you should reply
 to the sender and take no further ation based
 upon the content of the message.
 Internet e-mails are not necessarily secure and
 CCM Limited does not accept any responsibility
 for changes made to this message. 
 Although checks have been made to ensure this
 message and any attchments are free from viruses
 the recipient should ensure that this is the case.
 
 

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




RE: [PHP] PHP Image Functions

2002-07-09 Thread Mark Colvin

That's the winner!! Everything working good now. Thanks again.




This e-mail is intended for the recipient only and
may contain confidential information. If you are
not the intended recipient then you should reply
to the sender and take no further ation based
upon the content of the message.
Internet e-mails are not necessarily secure and
CCM Limited does not accept any responsibility
for changes made to this message. 
Although checks have been made to ensure this
message and any attchments are free from viruses
the recipient should ensure that this is the case.


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




Re: [PHP] Submitting form in new window!

2002-07-09 Thread Chris Hewitt

Thomas,

If using JavaScript to open the window, then php is not going to be able 
to transfer variables as it is not being used. As you form is not being 
submitted (you intercepted it with a JavaScript call, right?) then you 
need to transfer them manually by getting the JavaScript to add the 
variables to the end of the url as GET data.

If I have this wrong (and I've had to make some assumptions) then please 
show us some code.

HTH
Chris

Thomas Edison Jr. wrote:

Hi,

When i press the Submit button, i would like it to
open in a new Javascript Windows with well-defined
characteristics like size, width etc. 

I create a window.open function and gave the name of
my PHP page .. but the Form Variables are not passing
into it.. 

Thanks,
T. Edison Jr.



=
Rahul S. Johari (Director)
**
Abraxas Technologies Inc.
Homepage : http://www.abraxastech.com
Email : [EMAIL PROTECTED]
Tel : 91-4546512/4522124
***

__
Do You Yahoo!?
Sign up for SBC Yahoo! Dial - First Month Free
http://sbc.yahoo.com




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




Re: [PHP] Editing Word Documents

2002-07-09 Thread Chris Hewitt

I think what the OP meant (certainly what I meant), is that the Word doc 
is accessed from a normal link. Clients use windows and the browser has 
the .doc mime type set and spawns Word. The user edits it. I had 
(vainly) hoped for a way of setting the File..Save As to trigger PHP's 
File Upload facility.

Has anyone had this need, found a way around it or found it not possible?

Thanks for the WebDAV pointer. I shall certainly be looking into that 
but I had hoped for a simpler way compatible with existing windows 
versions. Longer term it looks the right way to go.

Thanks
Chris

Kevin Stone wrote:

Of course you can open and edit any file in PHP you just need to know the
file format.  But I highly doubt there is any method using PHP that will
allow you to prompt the opening of a file into an external application.
Editing of the file would have to be done in memory, or manually in the
browser (HTML form, textarea field).  Unfortunately Microsoft is notoriously
protective of its file formats.
-Kevin

- Original Message -
From: Chris Hewitt [EMAIL PROTECTED]
To: David Russell [EMAIL PROTECTED]
Cc: php-general [EMAIL PROTECTED]
Sent: Monday, July 08, 2002 11:51 AM
Subject: Re: [PHP] Editing Word Documents


David Russell wrote:

snip--
5. The client then closes the file, it auto-saves and he goes about
his business.

By coincidence, I'd be very interested in this too, particularly from a
linux server.

Regards

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




RE: [PHP] Sending data in table, multiple rows, via mail()

2002-07-09 Thread joakim . andersson

This bit looks kind of wierd. Don't know if it even should be possible to do
like that...
 $realcontent=
 
 if ($myrow = mysql_fetch_array($result)) {
   do {
 

$myrow[pid]br
$myrow[nm]br
$myrow[q]br

  
   } while ($myrow = mysql_fetch_array($result));
 }
 
 ;

You might wanna do like this instead:

$realcontent = ;
while ($myrow = mysql_fetch_array($result))
{
$realcontent .= $myrow['pid']br;
$realcontent .= $myrow['nm']br;
$realcontent .= $myrow['q']br;
}

Regards
Joakim Andersson

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




Re: [PHP] Submitting form in new window!

2002-07-09 Thread Thomas Edison Jr.

Hi,

Ok, let me show some code :

  form name=\drama\ action=\add2cart.php\
method=post target=\blank\
   input type=hidden name=sessid value= $PHPSESSID 
   input type=hidden name=proid value=
$result[vProID] 
   input type=hidden name=proname value=
$result[vProName] 
   font color=#00 face=verdana size=2Quantity
input type=\text\ size=3 name=\qty\ input
type=\submit\ value=\Add To Cart\/font


This is the SUBMIT button that submits the form
alongwith the Form Variables to a file called
Add2Cart.php !! But this file simply opens in an
unadministered new window.

i would like to use the window.open function, or
whatever can accomplish this, to restrict parameters
of the window in which add2cart.php opens, at the same
time the variables of my form should get submitted
into the add2cart.php

T. Edison Jr.


__
Do You Yahoo!?
Sign up for SBC Yahoo! Dial - First Month Free
http://sbc.yahoo.com

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




Re: [PHP] Re: Editing Word Documents

2002-07-09 Thread Chris Hewitt

Marek,

Yes I thought about windows shares. On the internet (as opposed to 
intranet) the word security leapt to mind and I went away from the 
idea. Has anyone used Samba shares on the internet or know if its 
secure/insecure?

Thanks

Chris

Marek Kilimajer wrote:

 The only way I see this can be done is simly let every user mount a 
 share under the same letter,
 all you need to do then is a 
 href=file:///X:/directory/file.docfile/a, then locking files is up
 to samba or windows server.

Marek

 Richard Lynch wrote:

 I have an intranet, which provides access to, amongst others, Word 
 Documents about policies, etc. What the guys are looking for is a 
 way to do the following:

 1. Show a list of files available for editing
 2. If a file is clicked, then it is locked for other users (no access)
 3. The file opens on the client's machine
 4. The client edits it
 5. The client then closes the file, it auto-saves and he goes 
 about his business.

 Points 1 through 3 are relatively trivial. Point 4 and 5 (especially 
 5) have me lost.

 How do you get a file to be edited, and then automatically returned 
 to the server by M$ Word in it's changed format. Is this possible?

 How would this change in a database-backended system (including the 
 files as BLOBs)?
   


 They'd have to be uploaded *SOMEHOW*...

 If the employees can't do that by hand, then perhaps some kind of
 scheduled task on the Win boxes could be programmed to do it.

 Don't forget to *UNLOCK* after a successful upload, but not when, not 
 if,
 when, the upload fails.

 There's simply NO WAY the server can reach out and suck in a file of 
 its own
 volitoin... Major privacy/security problem there.

 You *COULD* also install Apache + PHP on every desktop, and have them
 serving up their edited Word files to the Intranet, and then PHP 
 could use
 HTTP to suck them back in...

 But that's probably not gonna fly for non-technical reasons.  Well, not
 counting really bad Security as a technical reason.

  







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




RE: [PHP] Bug in SQL can you help?

2002-07-09 Thread joakim . andersson

 -Original Message-
 From: JJ Harrison [mailto:[EMAIL PROTECTED]]
 Sent: Tuesday, July 09, 2002 12:33 PM
 To: [EMAIL PROTECTED]
 Subject: [PHP] Bug in SQL can you help?
 
 
 Here is my SQL(used in a PHP script so this isn't ot)

PHP-script or not, it's still an SQL-query, right?

I'll give it a shot anyway...

 SELECT
 extract(year FROM time),
 extract(month FROM time),
 count(*) as monthly_views,
   time
 FROM
 tececo_stats
 group by
extract(year FROM time),
extract(month FROM time)
 order by
monthly_views desc
 limit 1
 
 the problem is that is counts the number of rows in the whole 
 thing not the
 echoed row. How can I get it count the best days only?

SELECT CONCAT(YEAR(time), MONTH(time)) AS my_period, MAX(COUNT(*)) AS
monthly_views
FROM tececo_stats
GROUP BY my_period

/Joakim

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




Re: [PHP] Bug in SQL can you help?

2002-07-09 Thread JJ Harrison

Thanks
Jason Wong [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 On Tuesday 09 July 2002 18:32, JJ Harrison wrote:
  Here is my SQL(used in a PHP script so this isn't ot)

 Aside from the fact that this has _nothing_ to do with php, you would most
 likely get a better response from the php-db list where, hopefully, the
sql
 experts hangout.

  SELECT
  extract(year FROM time),
  extract(month FROM time),
  count(*) as monthly_views,
time

 [snip]

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

 /*
 Philadelphia is not dull -- it just seems so because it is next to
 exciting Camden, New Jersey.
 */




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




RE: [PHP] Sending data in table, multiple rows, via mail()

2002-07-09 Thread Thomas Edison Jr.

Hi,

WOW... THANKS A LOT!!
This actually did it .. i was on a slight wrong
track..

 $realcontent = ;
 while ($myrow = mysql_fetch_array($result))
 {
   $realcontent .= $myrow['pid']br;
   $realcontent .= $myrow['nm']br;
   $realcontent .= $myrow['q']br;
 }
 

Thanks,

T. Edison Jr.



__
Do You Yahoo!?
Sign up for SBC Yahoo! Dial - First Month Free
http://sbc.yahoo.com

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




[PHP] Re: Converting PCX to ...

2002-07-09 Thread BB

I got a problem with that!

I've written a batch file that sits in the same dir as the PHP script and
when I exec it, it doesn't work!  I've thouroghly thrashed the batch file
for errors and it came up ok every time.  if I echo the exec it only returns
the first line of the batch file.

Anyone?

Richard Lynch [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]...
 I'm writing a reporting system and I have a problem.
 
 I need to insert PCXs into a PDF (using PDFLib), but it doesn't support
 PCXs.
 
 So, to get round the problem, I need to convert the PCXs to JPGs or GIFs
 
 Does anyone know of a piece of PHP that can do this inline, (by that I
mean,
 can be called and run in PHP script), because the images will have
additions
 and modifications on a regular basis; and they come as PCXs.

 I think you will be stuck with using http://php.net/exec to run some
 external process to convert them.

 Image Magik seems to convert almost every format known to man...

 --
 Like Music?  http://l-i-e.com/artists.htm




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




[PHP] Re: getting the IP address off a visitor

2002-07-09 Thread Kondwani Spike Mkandawire

Despite all downfalls of using IP addresses,
if you are in North America most people
in a University or business environment use
a fast connection (DSL or Cable) you may
choose to use the following chunk of code to
retrieve someone's IP number

if (getenv(HTTP_X_FORWARDED_FOR)){
   $ip=getenv(HTTP_X_FORWARDED_FOR);
 }
 else {
  $someones = getenv(REMOTE_ADDR);
 }
// From Klemens Karssen's code from www.php.net

Alternatively use Cookies which are easy to
use (check the cookie function on www.php.net
Cookies and Sessions from my understanding
of earlier discussions in this forum might be a
wiser idea...

Spike..


Sebastian Marcu [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 Hi there,

 I am new to PHP and need some help.
 I was wondering if there is a way to get hold of the IP address of a site
 visitor with PHP. I'm trying to develop an interaction where the server
 would recognise a new visitor from a returning visitor via the IP address.

 Regards,


 Sebastian







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




RE: [PHP] Re: Converting PCX to ...

2002-07-09 Thread Jay Blanchard

[snip]
I've written a batch file that sits in the same dir as the PHP script and
when I exec it, it doesn't work!  I've thouroghly thrashed the batch file
for errors and it came up ok every time.  if I echo the exec it only returns
the first line of the batch file.
[/snip]

I have found that even though the batch, shell, or other procedural call in
an exec(), system(),  sits in the same directory as the PHP script you must
include the /full/path/to/the/script in order for it to work properly.

HTH!

Jay



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




[PHP] mbstring: php.ini: need help understanding some settings/functions

2002-07-09 Thread Jean-Christian Imbeault

I am trying to use the mbstring library so I can receive user input in 
japanese and then put it into my pgsql DB. But the documentation is 
really sparse and sometimes confusing.

I can't understand some of the functions provided by mbstring or it's 
settings in php.ini. Some functions/settings don't seem to do what they 
say or the explanation of how to use them is missing.

For example I tought internal_encoding was used along with 
--enable-mbstring-enc-trans so that any input would be automatically 
converted to the internal encoding.

But it is isn't. When I check what charset POST data is in it is always 
in the charset the user used, never in the internal_encoding charset. I 
have to manually convert myself using mbstring functions.

I guess I don't understand what the settings of mbstring in php.ini and 
at compile time really do.


Can someone explain to me what is the use of:

--enable-mbstring-enc-trans at compile time
mb_http_input()
mb_http_output()
mb_internal_encoding()
mb_language()
mb_output_handler()

Thanks!

Jc


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




[PHP] Re: Print Question

2002-07-09 Thread Kondwani Spike Mkandawire

I wasn't in the office hence haven't visited this group for a while...
Here's an idea though I still may not understand the whole situation
but from what I think it is here goes:

I guess you will have to mix javascript and php in the following
manner...  use onclick for a particular HTML variable and
create a function in Java Script that runs when you click this
and returns true or writes to an HTML variable say
input type= hidden name=hasClicked value=false...
the HTML value will give this hidden variable the value true when
clicked otherwise it will be defaulted at false... You can use
document.write.formName.hasClicked.value = true...

Then continue with:

if($hasClicked == true)
Run the Script...  This will mean your script won't run
until OK is pressed...

I hope this helps and I hope its not too late...

Spike...

Chris Kay [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]...

Question I have is

I want to run a print job of 200+ invoices

I have a javascript code to open a print dialog box and
Then go to next invoice and do the loop..

Problem I am having is that I want it to pause if the ok button on the
dialog
Box is not pressed..

When I run the script it fly's throught and brings up a heap of printer
Dialog boxes which causes me to ctrl+alt+del...

Anyway or pausing the script untill ok is pressed?

Thanks in advance..


---
Chris Kay
Technical Support - Techex Communications
Website: www.techex.com.au   Email: [EMAIL PROTECTED]
Telephone: 1300 88 111 2 - Fax: (02) 9970 5788
Address: Suite 13, 5 Vuko Place, Warriewood, NSW 2102
Platinum Channel Partner of the Year - Request DSL - Broadband for
Business

---





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




Re: [PHP] Re: Editing Word Documents

2002-07-09 Thread Marek Kilimajer

If you can use virtual private network, it is secure. But I don't know 
about plain Samba solution.

Chris Hewitt wrote:

 Marek,

 Yes I thought about windows shares. On the internet (as opposed to 
 intranet) the word security leapt to mind and I went away from the 
 idea. Has anyone used Samba shares on the internet or know if its 
 secure/insecure?

 Thanks

 Chris

 Marek Kilimajer wrote:

 The only way I see this can be done is simly let every user mount a 
 share under the same letter,
 all you need to do then is a 
 href=file:///X:/directory/file.docfile/a, then locking files is up
 to samba or windows server.

Marek

 Richard Lynch wrote:

 I have an intranet, which provides access to, amongst others, Word 
 Documents about policies, etc. What the guys are looking for is a 
 way to do the following:

 1. Show a list of files available for editing
 2. If a file is clicked, then it is locked for other users (no access)
 3. The file opens on the client's machine
 4. The client edits it
 5. The client then closes the file, it auto-saves and he goes 
 about his business.

 Points 1 through 3 are relatively trivial. Point 4 and 5 
 (especially 5) have me lost.

 How do you get a file to be edited, and then automatically returned 
 to the server by M$ Word in it's changed format. Is this possible?

 How would this change in a database-backended system (including the 
 files as BLOBs)?
   



 They'd have to be uploaded *SOMEHOW*...

 If the employees can't do that by hand, then perhaps some kind of
 scheduled task on the Win boxes could be programmed to do it.

 Don't forget to *UNLOCK* after a successful upload, but not when, 
 not if,
 when, the upload fails.

 There's simply NO WAY the server can reach out and suck in a file of 
 its own
 volitoin... Major privacy/security problem there.

 You *COULD* also install Apache + PHP on every desktop, and have them
 serving up their edited Word files to the Intranet, and then PHP 
 could use
 HTTP to suck them back in...

 But that's probably not gonna fly for non-technical reasons.  Well, not
 counting really bad Security as a technical reason.

  









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




Re: [PHP] Submitting form in new window!

2002-07-09 Thread Jason Wong

On Tuesday 09 July 2002 19:25, Thomas Edison Jr. wrote:
 Hi,

 Ok, let me show some code :

   form name=\drama\ action=\add2cart.php\
 method=post target=\blank\
input type=hidden name=sessid value= $PHPSESSID 
input type=hidden name=proid value=
 $result[vProID] 
input type=hidden name=proname value=
 $result[vProName] 
font color=#00 face=verdana size=2Quantity
 input type=\text\ size=3 name=\qty\ input
 type=\submit\ value=\Add To Cart\/font


 This is the SUBMIT button that submits the form
 alongwith the Form Variables to a file called
 Add2Cart.php !! But this file simply opens in an
 unadministered new window.

 i would like to use the window.open function, or
 whatever can accomplish this, to restrict parameters
 of the window in which add2cart.php opens, at the same
 time the variables of my form should get submitted
 into the add2cart.php

Attach a javascript event to the submit button such that on submit opens up a 
window with your required specs. Then set the url of that window to point to 
add2cart.php, and also attach the form values to the url.

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

/*
People need good lies.  There are too many bad ones.
-- Bokonon, Cat's Cradle by Kurt Vonnegut, Jr.
*/


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




[PHP] Executing Script through image

2002-07-09 Thread JJ Harrison

I am making a stats program.

When the nessicary include file is included it does a reverse-DNS lookup to
find the remote host's DNS name. The problem with this is that is seems
slow(at least on my test server with a DSL connection). I thought the best
way to speed things up would be putting the entire script into a file and
then using img src=stats.php within the page. The problem is that I
don't know how to output the image with PHP.

The image would not be dynamic just a file on the server.

I would appreciate peoples comments or other suggestions

JJ Harrison
[EMAIL PROTECTED]
www.tececo.com






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




[PHP] Re: Executing Script through image

2002-07-09 Thread BB

$filename = your/file.gif;
header(Content-Type: image/gif);
header(Content-length:.filesize($filename));
$fn=fopen($filename,rb);
while(!feof($fn)) {
 echo fread($fn, 4096);
}

in fopen( , );
the b denotes to read as binary and is only nessecary on a windows system

Jj Harrison [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 I am making a stats program.

 When the nessicary include file is included it does a reverse-DNS lookup
to
 find the remote host's DNS name. The problem with this is that is seems
 slow(at least on my test server with a DSL connection). I thought the best
 way to speed things up would be putting the entire script into a file and
 then using img src=stats.php within the page. The problem is that I
 don't know how to output the image with PHP.

 The image would not be dynamic just a file on the server.

 I would appreciate peoples comments or other suggestions

 JJ Harrison
 [EMAIL PROTECTED]
 www.tececo.com








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




  1   2   3   4   5   >