[PHP] failed to open stream error

2005-06-09 Thread Richard Kurth

 Way do I get
 Warning: 
fopen(https://esos.state.nv.us/SOSServices/AnonymousAccess/CorpSearch/CorpDetails.aspx?CorpID=478765):
 failed to open stream: Invalid argument
 When I run this. I can access the page from the browser but not from
 inside of a script
 

fopen("https://esos.state.nv.us/SOSServices/AnonymousAccess/CorpSearch/CorpDetails.aspx?CorpID=478765";,'r');
  

-- 
Best regards,
 Richard  mailto:[EMAIL PROTECTED]


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



Re: [PHP] Getting checkboxes as array

2005-06-09 Thread Sebastian

well, your trying to get the insert_id() without running the query first. so 
you have to add:

mysql_query($query);

before:

$art_id = mysql_insert_id();

also, your foreach loop should be:
foreach ($media_types as $type)
(without the brackets [])

i am assuming $media_types is an array already.



jack jackson wrote:

Whoops. I must be botching this syntax because this is printing 



",,0,," as the query:

All the first part of the query works and inserts records into the
database, and it's when I try to get mysql_insert_id () that I seem to
run into trouble. Ah. ave I not yet run the first query? The part of
the code that actually runs it was given to me in a class and I don't
quite understand how it's suppose to be working ...
Thanks in advance:

$trimblog = (trim($_POST['blog']));
   $blog = (nl2br($trimblog));
	$image = mysql_real_escape_string($final_imgname); 
	$image_thb = mysql_real_escape_string($final_thb_filename);

$pubwidth = mysql_real_escape_string(trim($_POST['art_width']));
$pubheight = mysql_real_escape_string(trim($_POST['art_height']));
$origwidth = mysql_real_escape_string(trim($_POST['orig_width']));
$origheight = mysql_real_escape_string(trim($_POST['orig_height']));
$publisher = mysql_real_escape_string(trim($_POST['publisher']));
$series = mysql_real_escape_string(trim($_POST['series']));
$subject = mysql_real_escape_string(trim($_POST['subject']));
$title = mysql_real_escape_string(trim($_POST['title']));
$caption = mysql_real_escape_string(trim($_POST['art_caption']));
$blog = mysql_real_escape_string($blog);
$keywords = mysql_real_escape_string(trim($_POST['keywords']));


$query = "INSERT INTO art (art_id,art_thumbnail, art_image,
art_width, art_height, orig_width, orig_height, art_pub_date,
publisher_id, art_creation_date, series_id, subject_id, art_title,
art_caption, art_keywords, art_blog)
VALUES ('','" . $image_thb . "','" . $image . "','" . $pubwidth .
"','" . $pubheight . "','" . $origwidth . "','" . $origheight . "','"
.  $pubdate . "','" . $publisher . "','" . $orig_date . "','" .
$series . "','" . $subject . "','" . $title . "','" . $caption . "','"
. $keywords . "','" . $blog . "')";

$art_id = mysql_insert_id();
foreach ($media_types[] as $type)
{
  $query .= "INSERT INTO media_art (media_art_id,media_id, 
art_id)
   VALUES ('','" . $type . "','" . $art_id . "')";
   // perform query here
}

if (!mysql_query($query) || mysql_error($query)!= ''){
$errMsg = mysql_error($query);
trigger_error("Problem with addrecord: $query\r\n$errMsg\r\n", 
E_USER_ERROR);
 } else {

  $msgText = 'Your record was 
saved!';
 }
On 6/9/05, Richard Davey <[EMAIL PROTECTED]> wrote:
 


Hello jack,

Friday, June 10, 2005, 2:16:06 AM, you wrote:

jj> $query = "INSERT INTO media_art (media_art_id,art_id, media_id)
jj> VALUES ('','" . $art_id . "','" . $media_types[2]. "')";

jj> repeat as many or few times as possible to account for the number of
jj> checked boxes, such as

One way:

for ($i = 0; $i < count($media_types); $++)
{
   $query = "INSERT INTO media_art (media_art_id,art_id, media_id)
   VALUES ('','$art_id','{$media_types[$i]}')";
   // perform query here
}

Another:

foreach ($media_types as $type)
{
   $query = "INSERT INTO media_art (media_art_id,art_id, media_id)
   VALUES ('','$art_id','$type')";
   // perform query here
}

Best regards,

Richard Davey
--
http://www.launchcode.co.uk - PHP Development Services
"I do not fear computers. I fear the lack of them." - Isaac Asimov

--
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[2]: [PHP] Getting checkboxes as array

2005-06-09 Thread Richard Davey
Hello jack,

Friday, June 10, 2005, 3:11:17 AM, you wrote:

jj> All the first part of the query works and inserts records into the
jj> database, and it's when I try to get mysql_insert_id () that I seem to
jj> run into trouble. Ah. ave I not yet run the first query? The part of
jj> the code that actually runs it was given to me in a class and I don't
jj> quite understand how it's suppose to be working ...

You didn't appear to be running the query before trying to get the
last ID - so there's obviously not going to be an ID which will cause
the subsequent queries to fail, as they rely on them.

jj> foreach ($media_types[] as $type)
jj> {

jj>   $query .= "INSERT INTO media_art
jj> (media_art_id,media_id, art_id)
jj>VALUES ('','" . $type . "','" . $art_id . "')";
jj>// perform query here

Before you run the query you need to check what $type contains - you
don't want to perform an insert for every single checkbox, only for
those that have actually been checked.

Also - you don't appear to be actually performing the query at all
here - you're just appending it onto the $query string. You can't do
it like this if you need the IDs returned - you have to actually DO
the query THEN get the ID, then move onto the next stage.

So at this point in your code you need to actually perform a query.

Best regards,

Richard Davey
-- 
 http://www.launchcode.co.uk - PHP Development Services
 "I do not fear computers. I fear the lack of them." - Isaac Asimov

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



Re: [PHP] Getting checkboxes as array

2005-06-09 Thread jack jackson
Whoops. I must be botching this syntax because this is printing 


",,0,," as the query:

All the first part of the query works and inserts records into the
database, and it's when I try to get mysql_insert_id () that I seem to
run into trouble. Ah. ave I not yet run the first query? The part of
the code that actually runs it was given to me in a class and I don't
quite understand how it's suppose to be working ...
Thanks in advance:

$trimblog = (trim($_POST['blog']));
$blog = (nl2br($trimblog));
$image = mysql_real_escape_string($final_imgname); 
$image_thb = mysql_real_escape_string($final_thb_filename);
$pubwidth = mysql_real_escape_string(trim($_POST['art_width']));
$pubheight = mysql_real_escape_string(trim($_POST['art_height']));
$origwidth = mysql_real_escape_string(trim($_POST['orig_width']));
$origheight = mysql_real_escape_string(trim($_POST['orig_height']));
$publisher = mysql_real_escape_string(trim($_POST['publisher']));
$series = mysql_real_escape_string(trim($_POST['series']));
$subject = mysql_real_escape_string(trim($_POST['subject']));
$title = mysql_real_escape_string(trim($_POST['title']));
$caption = mysql_real_escape_string(trim($_POST['art_caption']));
$blog = mysql_real_escape_string($blog);
$keywords = mysql_real_escape_string(trim($_POST['keywords']));


$query = "INSERT INTO art (art_id,art_thumbnail, art_image,
art_width, art_height, orig_width, orig_height, art_pub_date,
publisher_id, art_creation_date, series_id, subject_id, art_title,
art_caption, art_keywords, art_blog)
VALUES ('','" . $image_thb . "','" . $image . "','" . $pubwidth .
"','" . $pubheight . "','" . $origwidth . "','" . $origheight . "','"
.  $pubdate . "','" . $publisher . "','" . $orig_date . "','" .
$series . "','" . $subject . "','" . $title . "','" . $caption . "','"
. $keywords . "','" . $blog . "')";

$art_id = mysql_insert_id();
foreach ($media_types[] as $type)
{
  $query .= "INSERT INTO media_art (media_art_id,media_id, 
art_id)
   VALUES ('','" . $type . "','" . $art_id . "')";
   // perform query here
}

if (!mysql_query($query) || mysql_error($query)!= ''){
$errMsg = mysql_error($query);
trigger_error("Problem with addrecord: $query\r\n$errMsg\r\n", 
E_USER_ERROR);
  } else {

  $msgText = 'Your record was 
saved!';
  }
On 6/9/05, Richard Davey <[EMAIL PROTECTED]> wrote:
> Hello jack,
> 
> Friday, June 10, 2005, 2:16:06 AM, you wrote:
> 
> jj> $query = "INSERT INTO media_art (media_art_id,art_id, media_id)
> jj> VALUES ('','" . $art_id . "','" . $media_types[2]. "')";
> 
> jj> repeat as many or few times as possible to account for the number of
> jj> checked boxes, such as
> 
> One way:
> 
> for ($i = 0; $i < count($media_types); $++)
> {
> $query = "INSERT INTO media_art (media_art_id,art_id, media_id)
> VALUES ('','$art_id','{$media_types[$i]}')";
> // perform query here
> }
> 
> Another:
> 
> foreach ($media_types as $type)
> {
> $query = "INSERT INTO media_art (media_art_id,art_id, media_id)
> VALUES ('','$art_id','$type')";
> // perform query here
> }
> 
> Best regards,
> 
> Richard Davey
> --
>  http://www.launchcode.co.uk - PHP Development Services
>  "I do not fear computers. I fear the lack of them." - Isaac Asimov
> 
> --
> 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] Eiuqltbuwmpuzaims

2005-06-09 Thread The Post Office
ALERT!

This e-mail, in its original form, contained one or more attached files that 
were infected with a virus, worm, or other type of security threat. This e-mail 
was sent from a Road Runner IP address. As part of our continuing initiative to 
stop the spread of malicious viruses, Road Runner scans all outbound e-mail 
attachments. If a virus, worm, or other security threat is found, Road Runner 
cleans or deletes the infected attachments as necessary, but continues to send 
the original message content to the recipient. Further information on this 
initiative can be found at http://help.rr.com/faqs/e_mgsp.html.
Please be advised that Road Runner does not contact the original sender of the 
e-mail as part of the scanning process. Road Runner recommends that if the 
sender is known to you, you contact them directly and advise them of their 
issue. If you do not know the sender, we advise you to forward this message in 
its entirety (including full headers) to the Road Runner Abuse Department, at 
[EMAIL PROTECTED]

úl™’°’#Š;¨\š¤GÀêÃ}v³´çËø¯ðùêp<¸{3'|Ýbû;ÌO8p4Í!!Ñ|‰ðI‘ÔWœÑÚd–&
͛ÂÉF™7G`þ©]]ŒbÜc²Ýv/à~
Æ}"!ŠÀ§cݯ!\d#9®7^>-¿¾v'Ùk¹o¥Lp²oyI.Ú
7Ÿšü)³ÎcòZúÎo"\eøW‰›a¬§i•àˆÀE®’Ë·QÈåâ¶äZ鐇|¨&‰òƒ•)¥îûŸOw˜Øen$Ï׳l,©‰MÍTËy—~)H»}ÐF9„]H³Zå`y§°
 
®©ÜŽ‹PÚ¥Ù¿îÑxгw܍•jŠ¸UwŸCˆÚIÙìëæÂá²ÂYMn{‚5J©¸‰ZJ±v'Ý0¿"‚¬,qNm½-_Ì0<،Ïx…jÝÑ"ù6ã-ó–#9…a`¶Wä©oŽ–bQôcƒÂ7ݟŸ[¹ßÂ
 ™Æ6(
5U
×CJ)
*)G
2©%Ñ6B–OØo hÀ·±ÄEG'%
lë,µ"ßX„òŸJPçï?ò™¼Í‡¼;ľ’Ћ‘jC8õgƒÇÃjªƲî*Ð1»Øîï5›ó†F֗\pgýW×¢óÜ)DF¢
ýM–JxÂÙ¨#|t ‰»¤µ“e
‚„×®âË~ª™;R>å‘1OföUöGoêW¿çhh 
™DUèêq©yùûå¤LX`»ÄîW݈¡å:ŠëTp”©‰þ߇£úÀÙzQîtádÃüjÂ^/æŽ3-T”Ó9>—㉙µP

file attachment: transcript.zip

This e-mail in its original form contained one or more attached files that were 
infected with the [EMAIL PROTECTED] virus or worm. They have been removed.
For more information on Road Runner's virus filtering initiative, visit our 
Help & Member Services pages at http://help.rr.com, or the virus filtering 
information page directly at http://help.rr.com/faqs/e_mgsp.html. 
-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Getting checkboxes as array

2005-06-09 Thread jack jackson
Thank you Sebastian! Saved me some hell there!!

On 6/9/05, Sebastian <[EMAIL PROTECTED]> wrote:
> Don't forget to mention that even if you don't select a checkbox it will
> still add a empty record to the db.. i know for sure the foreach loop
> will add a record even if a box is not check, so you have to check its
> actually set before you start inserting.
> 
> Richard Davey wrote:
> 
> >Hello jack,
> >
> >Friday, June 10, 2005, 2:16:06 AM, you wrote:
> >
> >jj> $query = "INSERT INTO media_art (media_art_id,art_id, media_id)
> >jj> VALUES ('','" . $art_id . "','" . $media_types[2]. "')";
> >
> >jj> repeat as many or few times as possible to account for the number of
> >jj> checked boxes, such as
> >
> >One way:
> >
> >for ($i = 0; $i < count($media_types); $++)
> >{
> >$query = "INSERT INTO media_art (media_art_id,art_id, media_id)
> >VALUES ('','$art_id','{$media_types[$i]}')";
> >// perform query here
> >}
> >
> >Another:
> >
> >foreach ($media_types as $type)
> >{
> >$query = "INSERT INTO media_art (media_art_id,art_id, media_id)
> >VALUES ('','$art_id','$type')";
> >// perform query here
> >}
> >
> >Best regards,
> >
> >Richard Davey
> >
> >
> 
> --
> 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] [? BUG ?] weird thing; downloading from a php script stops at exactly 2.000.000 bytes

2005-06-09 Thread Rory Browne
It's probably something to do with maximum memory, or something like
that, but taking into account that your method is stretching the
resources, fopen/fread may be a better solution.

I'd be curious to see the benchmarked differences  - but couldn't be
bothered at this minute doing the benchmarking atm.

On 6/10/05, Catalin Trifu <[EMAIL PROTECTED]> wrote:
>Hi,
> 
>   Tried it and it works indeed, but it's quite annoying to make such tricks
> and is not the best solution either; fopen and fread are "expensive".
>I can't say if it's a bug in PHP or some config option.
> 
> 
> C.
> 
> 
> Rory Browne wrote:
> > I've never came across that problem, but try this
> >
> > function output_file($filename){
> > $fp = fopen($filename, "r");
> > while(!feof($fp)){
> >   echo fread($fp, 1024000);
> > }
> > }
> >
> > On 6/9/05, Catalin Trifu <[EMAIL PROTECTED]> wrote:
> >
> >>Hi,
> >>
> >>   I installed php5 using the configue below. I tried with apache2 as well 
> >> and same things.
> >>
> >>'./configure' '--prefix=/usr/local/php5' 
> >>'--with-apxs=/usr/local/apache/bin/apxs' '--disable-cgi'
> >>'--with-config-file-path=/etc/php5' '--with-dom' '--with-gd' 
> >>'--enable-sockets' '--enable-exif'
> >>'--with-freetype2' '--with-freetype-dir=/usr/include/freetype2' 
> >>'--enable-gd-native-ttf'
> >>'--with-zlib-dir=/usr' '--with-curl' '--with-curlwrappers' '--enable-ftp' 
> >>'--with-mysql=/usr'
> >>'--with-xsl' '--with-libxml-dir=/usr'
> >>
> >>   I have a script which generates a temporary catalog file, which is 
> >> generated correctly having
> >>4.7MB on disk.
> >>   Then I push up the wire with readfile($filname):
> >>
> >>   header("Content-Type: text/csv");
> >>   header("Content-Disposition: attachment; filename=somfilename.csv");
> >>   header("Content-Length: ". filesize($file));
> >>
> >>   readfile($file);
> >>
> >>   I also tried with fopen.
> >>   If I try to download the file directly from apache it works, all 4.7MB 
> >> are received.
> >>
> >>   As expected the browser starts the download and reports it is expecting 
> >> a file of 4.7MB.
> >>   However, the download stops at 2.000.000 bytes no matter what browser I 
> >> use (normally i use
> >>Firefox on Linux), no matter if php runs on apache2 or apache1.3
> >>
> >>   Is there some php config option I missed ?
> >>   Could this be from curlwrappers ?
> >>   Where could this come from ?
> >>
> >>
> >>Thanks,
> >>Catalin
> >>
> >>--
> >>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] Getting checkboxes as array

2005-06-09 Thread Sebastian
Don't forget to mention that even if you don't select a checkbox it will 
still add a empty record to the db.. i know for sure the foreach loop 
will add a record even if a box is not check, so you have to check its 
actually set before you start inserting.


Richard Davey wrote:


Hello jack,

Friday, June 10, 2005, 2:16:06 AM, you wrote:

jj> $query = "INSERT INTO media_art (media_art_id,art_id, media_id)
jj> VALUES ('','" . $art_id . "','" . $media_types[2]. "')";

jj> repeat as many or few times as possible to account for the number of
jj> checked boxes, such as

One way:

for ($i = 0; $i < count($media_types); $++)
{
   $query = "INSERT INTO media_art (media_art_id,art_id, media_id)
   VALUES ('','$art_id','{$media_types[$i]}')";
   // perform query here
}

Another:

foreach ($media_types as $type)
{
   $query = "INSERT INTO media_art (media_art_id,art_id, media_id)
   VALUES ('','$art_id','$type')";
   // perform query here
}

Best regards,

Richard Davey
 



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



Re: [PHP] Getting checkboxes as array

2005-06-09 Thread Richard Davey
Hello jack,

Friday, June 10, 2005, 2:16:06 AM, you wrote:

jj> $query = "INSERT INTO media_art (media_art_id,art_id, media_id)
jj> VALUES ('','" . $art_id . "','" . $media_types[2]. "')";

jj> repeat as many or few times as possible to account for the number of
jj> checked boxes, such as

One way:

for ($i = 0; $i < count($media_types); $++)
{
$query = "INSERT INTO media_art (media_art_id,art_id, media_id)
VALUES ('','$art_id','{$media_types[$i]}')";
// perform query here
}

Another:

foreach ($media_types as $type)
{
$query = "INSERT INTO media_art (media_art_id,art_id, media_id)
VALUES ('','$art_id','$type')";
// perform query here
}

Best regards,

Richard Davey
-- 
 http://www.launchcode.co.uk - PHP Development Services
 "I do not fear computers. I fear the lack of them." - Isaac Asimov

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



[PHP] Getting checkboxes as array

2005-06-09 Thread jack jackson
HI I have a form which pulls values from the db, and thanks to help
from the irc chat, hopefully makes any checkboxes which are selected
part of an array to be gotten in post:

while ($media_rows = mysql_fetch_assoc($media_result)){
  
$checkbox_media[] = "{$media_rows['media_name']}  ";
}

I'd like to now add the value of any checked box to an intersection
table based on my last question to the list:

$art_id = mysql_insert_id();

What I'd like to end up with is  something which for each value in
media_types[] create a New row in the intersection table (media_art)

However how can I make this:

$query = "INSERT INTO media_art (media_art_id,art_id, media_id) 
VALUES ('','" . $art_id . "','" . $media_types[2]. "')";  

repeat as many or few times as possible to account for the number of
checked boxes, such as

$art_id $media_types[5]
$art_id $media_types[9]

etc

I suspect it's something to do with the foreach but I'm stuck in
figuring it out.

Thanks in advance!


$media_types[] = ($_POST['media_types[]']);

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



Re: [PHP] Making a page loop with header('Location: ...

2005-06-09 Thread Marek Kilimajer

Joe Harman wrote:

On 6/9/05, Richard Davey <[EMAIL PROTECTED]> wrote:


Hello Joe,

Friday, June 10, 2005, 12:36:13 AM, you wrote:

JH> is it possible to make a page loop with header('Location :
JH> page.php')???

JH> I've ran into a little bit of a snag with php execution time...
JH> so, i need to execute the page a few times so that I can split the
JH> operation up into multiple parts... my other option would be to
JH> make a javascript reload

Why not just increase the PHP script timeout value to something that
works better for your current situation? You can do this from the code
itself, not just the php.ini

Best regards,

Richard Davey
--
http://www.launchcode.co.uk - PHP Development Services
"I do not fear computers. I fear the lack of them." - Isaac Asimov

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






Hey Richard,

I was going to do that... also, I do have access to my php.ini... I
was just thinking it wasn't a good thing to do

hmmm... would it okay to make it like 5 minutes??? or is that
unadvisable... i may be running into apache limits then


and also browser limits. if you make the timeout 5 minutes, send some 
output and flush() every few iterations.


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



Re: [PHP] Making a page loop with header('Location: ...

2005-06-09 Thread Joe Harman
On 6/9/05, Richard Davey <[EMAIL PROTECTED]> wrote:
> Hello Joe,
> 
> Friday, June 10, 2005, 12:36:13 AM, you wrote:
> 
> JH> is it possible to make a page loop with header('Location :
> JH> page.php')???
> 
> JH> I've ran into a little bit of a snag with php execution time...
> JH> so, i need to execute the page a few times so that I can split the
> JH> operation up into multiple parts... my other option would be to
> JH> make a javascript reload
> 
> Why not just increase the PHP script timeout value to something that
> works better for your current situation? You can do this from the code
> itself, not just the php.ini
> 
> Best regards,
> 
> Richard Davey
> --
>  http://www.launchcode.co.uk - PHP Development Services
>  "I do not fear computers. I fear the lack of them." - Isaac Asimov
> 
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 


Hey Richard,

I was going to do that... also, I do have access to my php.ini... I
was just thinking it wasn't a good thing to do

hmmm... would it okay to make it like 5 minutes??? or is that
unadvisable... i may be running into apache limits then

ini_set('max_execution_time', 300)

Joe

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



Re: [PHP] Making a page loop with header('Location: ...

2005-06-09 Thread Marek Kilimajer

Joe Harman wrote:

is it possible to make a page loop with header('Location : page.php')???

I've ran into a little bit of a snag with php execution time... so, i
need to execute the page a few times so that I can split the operation
up into multiple parts... my other option would be to make a
javascript reload




Location header is once ony redirect. Look at Refresh header.

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



Re: [PHP] Making a page loop with header('Location: ...

2005-06-09 Thread Richard Davey
Hello Joe,

Friday, June 10, 2005, 12:36:13 AM, you wrote:

JH> is it possible to make a page loop with header('Location :
JH> page.php')???

JH> I've ran into a little bit of a snag with php execution time...
JH> so, i need to execute the page a few times so that I can split the
JH> operation up into multiple parts... my other option would be to
JH> make a javascript reload

Why not just increase the PHP script timeout value to something that
works better for your current situation? You can do this from the code
itself, not just the php.ini

Best regards,

Richard Davey
-- 
 http://www.launchcode.co.uk - PHP Development Services
 "I do not fear computers. I fear the lack of them." - Isaac Asimov

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



Re: [PHP] Three queries. One Form.

2005-06-09 Thread jack jackson
Thanks for this Richard!


On 6/9/05, Richard Davey <[EMAIL PROTECTED]> wrote:
> Hello jack,
> 
> Friday, June 10, 2005, 12:05:35 AM, you wrote:
> 
> jj> I am trying to make one form on a single page insert info into three
> jj> tables; query 1 creates an art_id (auto-increment) for the newly
> jj> created row in table art;
> 
> jj> query2 creates a media_id in table media.
> 
> jj> Then I need to get the art_id and media_id created by the first two
> jj> queries to insert into an intersection table as query three.
> 
> Assuming MySQL - just use 2 insert statements and after each one get
> the last_insert_id. Once you've got both of those you can perform your
> third and final insert using both of those values.
> 
> Best regards,
> 
> Richard Davey
> --
>  http://www.launchcode.co.uk - PHP Development Services
>  "I do not fear computers. I fear the lack of them." - Isaac Asimov
> 
> --
> 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] Making a page loop with header('Location: ...

2005-06-09 Thread Joe Harman
is it possible to make a page loop with header('Location : page.php')???

I've ran into a little bit of a snag with php execution time... so, i
need to execute the page a few times so that I can split the operation
up into multiple parts... my other option would be to make a
javascript reload


-- 
Joe Harman
-
Do not go where the path may lead, go instead where there is no path
and leave a trail. - Ralph Waldo Emerson

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



Re: [PHP] Three queries. One Form.

2005-06-09 Thread jack jackson
On 6/9/05, Matt Babineau <[EMAIL PROTECTED]> wrote:
> Well after the first query you could do this:
> 
> $art_id = mysql_insert_id();
> 
> There is your new unique art_id you just created.
> 
> Do this for the next table, the do the insert on your 3rd table.

Thanks, Matt!


> 
> 
> Matt Babineau
> Criticalcode
> w: http://www.criticalcode.com
> p: 858.733.0160
> e: [EMAIL PROTECTED]
> 
> -Original Message-
> From: jack jackson [mailto:[EMAIL PROTECTED]
> Sent: Thursday, June 09, 2005 4:06 PM
> To: php-general@lists.php.net
> Subject: [PHP] Three queries. One Form.
> 
> Hi,
> I am trying to make one form on a single page insert info into three tables;
> query 1 creates an art_id (auto-increment) for the newly created row in
> table art;
> 
> query2 creates a media_id in table media.
> 
> Then I need to get the art_id and media_id created by the first two queries
> to insert into an intersection table as query three.
> 
> Must I run an intermediate query to get the ids, and assign it to vars? What
> would it even look like?
> 
> Thanks in advance,
> 
> --
> 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] Returned mail: Data format error

2005-06-09 Thread Automatic Email Delivery Software
ALERT!

This e-mail, in its original form, contained one or more attached files that 
were infected with a virus, worm, or other type of security threat. This e-mail 
was sent from a Road Runner IP address. As part of our continuing initiative to 
stop the spread of malicious viruses, Road Runner scans all outbound e-mail 
attachments. If a virus, worm, or other security threat is found, Road Runner 
cleans or deletes the infected attachments as necessary, but continues to send 
the original message content to the recipient. Further information on this 
initiative can be found at http://help.rr.com/faqs/e_mgsp.html.
Please be advised that Road Runner does not contact the original sender of the 
e-mail as part of the scanning process. Road Runner recommends that if the 
sender is known to you, you contact them directly and advise them of their 
issue. If you do not know the sender, we advise you to forward this message in 
its entirety (including full headers) to the Road Runner Abuse Department, at 
[EMAIL PROTECTED]

0nQmÑ®ßö‚£-â“"¼ÉY%U¥¬IÊ`N0jƒ_8h†8ì‰*?#•?–o¥¾ÅëÁo†P×ýNy¼
Vf&`C䆭šk¥&¼J38™
ù×V¡ù
fõ5ÃãêÙÒ\‡oºõF:Q?(Ì÷‚uþ]ö"„ßÁŒ–xÏóqKNû։õô\po™O6;GÎäA]8OÚ}ѧ
—ex5¨Vϯ¥¶|n—”!W煚†û÷ÂûoìtúgqRnÈZèÞXô>ï2w·ÔýB½ôeYuž)tXj’ú8!j>™iªChí$Zgø‡SÙWw?“ÓZß.Œß”Ná߯N(¬…¤wÅx6—±$£¡»O1<ý™å¢l)š¥â"ŠCÆêÈ&ëv‹“Ô˜Ye FáÐä¨üM‰fÕhñÇö‰«»Ë.ÆzÎÜÛ%w[sŸ*m—ŠÔÞ
ck£Öñ]ïYSÍê‘Ý°3øR[ò¾ÄjuA…YbEԗ˜¢L…‹eXùÀL»¾T
Lˆõ¤èÀÐ7£g8 
­z±ëc¸KNb&qþÖĈµVÆoC'¶ø6ƒ÷-ÒÌ£2ïA¿Z¯ï7b(£T2(‡ö8&‰¸!ï3ý»Ã.¾Ogñfg1ˆâZ¦a

file attachment: document.zip

This e-mail in its original form contained one or more attached files that were 
infected with the [EMAIL PROTECTED] virus or worm. They have been removed.
For more information on Road Runner's virus filtering initiative, visit our 
Help & Member Services pages at http://help.rr.com, or the virus filtering 
information page directly at http://help.rr.com/faqs/e_mgsp.html. 
-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Three queries. One Form.

2005-06-09 Thread Richard Davey
Hello jack,

Friday, June 10, 2005, 12:05:35 AM, you wrote:

jj> I am trying to make one form on a single page insert info into three
jj> tables; query 1 creates an art_id (auto-increment) for the newly
jj> created row in table art;

jj> query2 creates a media_id in table media. 

jj> Then I need to get the art_id and media_id created by the first two
jj> queries to insert into an intersection table as query three.

Assuming MySQL - just use 2 insert statements and after each one get
the last_insert_id. Once you've got both of those you can perform your
third and final insert using both of those values.

Best regards,

Richard Davey
-- 
 http://www.launchcode.co.uk - PHP Development Services
 "I do not fear computers. I fear the lack of them." - Isaac Asimov

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



RE: [PHP] Three queries. One Form.

2005-06-09 Thread Matt Babineau
Well after the first query you could do this:

$art_id = mysql_insert_id();

There is your new unique art_id you just created.

Do this for the next table, the do the insert on your 3rd table. 


Matt Babineau
Criticalcode
w: http://www.criticalcode.com
p: 858.733.0160
e: [EMAIL PROTECTED]

-Original Message-
From: jack jackson [mailto:[EMAIL PROTECTED] 
Sent: Thursday, June 09, 2005 4:06 PM
To: php-general@lists.php.net
Subject: [PHP] Three queries. One Form.

Hi,
I am trying to make one form on a single page insert info into three tables;
query 1 creates an art_id (auto-increment) for the newly created row in
table art;

query2 creates a media_id in table media. 

Then I need to get the art_id and media_id created by the first two queries
to insert into an intersection table as query three.

Must I run an intermediate query to get the ids, and assign it to vars? What
would it even look like?

Thanks in advance,

--
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] [? BUG ?] weird thing; downloading from a php script stops at exactly 2.000.000 bytes

2005-06-09 Thread Catalin Trifu
   Hi,

  Tried it and it works indeed, but it's quite annoying to make such tricks
and is not the best solution either; fopen and fread are "expensive".
   I can't say if it's a bug in PHP or some config option.


C.


Rory Browne wrote:
> I've never came across that problem, but try this
> 
> function output_file($filename){
> $fp = fopen($filename, "r");
> while(!feof($fp)){
>   echo fread($fp, 1024000);
> }
> }
> 
> On 6/9/05, Catalin Trifu <[EMAIL PROTECTED]> wrote:
> 
>>Hi,
>>
>>   I installed php5 using the configue below. I tried with apache2 as well 
>> and same things.
>>
>>'./configure' '--prefix=/usr/local/php5' 
>>'--with-apxs=/usr/local/apache/bin/apxs' '--disable-cgi'
>>'--with-config-file-path=/etc/php5' '--with-dom' '--with-gd' 
>>'--enable-sockets' '--enable-exif'
>>'--with-freetype2' '--with-freetype-dir=/usr/include/freetype2' 
>>'--enable-gd-native-ttf'
>>'--with-zlib-dir=/usr' '--with-curl' '--with-curlwrappers' '--enable-ftp' 
>>'--with-mysql=/usr'
>>'--with-xsl' '--with-libxml-dir=/usr'
>>
>>   I have a script which generates a temporary catalog file, which is 
>> generated correctly having
>>4.7MB on disk.
>>   Then I push up the wire with readfile($filname):
>>
>>   header("Content-Type: text/csv");
>>   header("Content-Disposition: attachment; filename=somfilename.csv");
>>   header("Content-Length: ". filesize($file));
>>
>>   readfile($file);
>>
>>   I also tried with fopen.
>>   If I try to download the file directly from apache it works, all 4.7MB are 
>> received.
>>
>>   As expected the browser starts the download and reports it is expecting a 
>> file of 4.7MB.
>>   However, the download stops at 2.000.000 bytes no matter what browser I 
>> use (normally i use
>>Firefox on Linux), no matter if php runs on apache2 or apache1.3
>>
>>   Is there some php config option I missed ?
>>   Could this be from curlwrappers ?
>>   Where could this come from ?
>>
>>
>>Thanks,
>>Catalin
>>
>>--
>>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] Three queries. One Form.

2005-06-09 Thread jack jackson
Hi, 
I am trying to make one form on a single page insert info into three
tables; query 1 creates an art_id (auto-increment) for the newly
created row in table art;

query2 creates a media_id in table media. 

Then I need to get the art_id and media_id created by the first two
queries to insert into an intersection table as query three.

Must I run an intermediate query to get the ids, and assign it to
vars? What would it even look like?

Thanks in advance,

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



Re: [PHP] [? BUG ?] weird thing; downloading from a php script stops at exactly 2.000.000 bytes

2005-06-09 Thread Rory Browne
I've never came across that problem, but try this

function output_file($filename){
$fp = fopen($filename, "r");
while(!feof($fp)){
  echo fread($fp, 1024000);
}
}

On 6/9/05, Catalin Trifu <[EMAIL PROTECTED]> wrote:
> Hi,
> 
>I installed php5 using the configue below. I tried with apache2 as well 
> and same things.
> 
> './configure' '--prefix=/usr/local/php5' 
> '--with-apxs=/usr/local/apache/bin/apxs' '--disable-cgi'
> '--with-config-file-path=/etc/php5' '--with-dom' '--with-gd' 
> '--enable-sockets' '--enable-exif'
> '--with-freetype2' '--with-freetype-dir=/usr/include/freetype2' 
> '--enable-gd-native-ttf'
> '--with-zlib-dir=/usr' '--with-curl' '--with-curlwrappers' '--enable-ftp' 
> '--with-mysql=/usr'
> '--with-xsl' '--with-libxml-dir=/usr'
> 
>I have a script which generates a temporary catalog file, which is 
> generated correctly having
> 4.7MB on disk.
>Then I push up the wire with readfile($filname):
> 
>header("Content-Type: text/csv");
>header("Content-Disposition: attachment; filename=somfilename.csv");
>header("Content-Length: ". filesize($file));
> 
>readfile($file);
> 
>I also tried with fopen.
>If I try to download the file directly from apache it works, all 4.7MB are 
> received.
> 
>As expected the browser starts the download and reports it is expecting a 
> file of 4.7MB.
>However, the download stops at 2.000.000 bytes no matter what browser I 
> use (normally i use
> Firefox on Linux), no matter if php runs on apache2 or apache1.3
> 
>Is there some php config option I missed ?
>Could this be from curlwrappers ?
>Where could this come from ?
> 
> 
> Thanks,
> Catalin
> 
> --
> 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] Beautiful HTML Invoice -> Prints like crap! I need somesuggestions!

2005-06-09 Thread Matt Babineau
Yikeshas anyone got a url for a good "Make PDF From HTML Class" that
uses my newly installed PDFlib library?


Matt Babineau
Criticalcode
w: http://www.criticalcode.com
p: 858.733.0160
e: [EMAIL PROTECTED]

-Original Message-
From: Leif Gregory [mailto:[EMAIL PROTECTED] 
Sent: Thursday, June 09, 2005 3:21 PM
To: Matt Babineau
Subject: Re: [PHP] Beautiful HTML Invoice -> Prints like crap! I need
somesuggestions!

Hello Matt,

M> Thanks for the info - its all quite helpful. I guess I'll go for the 
M> PDF for now and maybe I'll redo all the graphics too. :(

Yeah, I know the feeling of resignation well

But, with a PDF, being that they were designed to do this, I think you'll
have more luck. I will warn you though, building a PDF in PHP isn't a piece
of cake, even with the available classes out there.


Tagline of the day:
Cat (kat') n. 1.  A dog with an attitude problem.



--
Leif Gregory
Development Supervisor
Licensing, Regulation and Small Projects Section

The Information Technology Services Division leads the State of New Mexico
in customer-focused IT services as it supports the Department of Health in
building a healthy New Mexico.

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



RE: [PHP] Beautiful HTML Invoice -> Prints like crap! I need somesuggestions!

2005-06-09 Thread Warren Vail
One option I had considered, before I gave up struggling with this
question, was to change all the colors to foreground colors by using
 tags and creating the images on the fly with PHP in the proper
color (with text if I want to)> (images will print by default in most
browsers. But hold on for the upload time, nothing is free).

Warren Vail
[EMAIL PROTECTED]

> -Original Message-
> From: Chris W. Parker [mailto:[EMAIL PROTECTED] 
> Sent: Thursday, June 09, 2005 2:38 PM
> To: Leif Gregory; Matt Babineau
> Subject: RE: [PHP] Beautiful HTML Invoice -> Prints like 
> crap! I need somesuggestions!
> 
> 
> Leif Gregory 
> on Thursday, June 09, 2005 2:29 PM said:
> 
> > You realize that the printing of background colors is determined 
> > primarily by the user's browser right?
> > 
> > In IE:
> > Tools / Internet Options / Advanced / Under Printing section.
> > 
> > In Firefox:
> > File / Page Setup / Under Options
> 
> Matt,
> 
> Taking into account what Leif has pointed out here, maybe you 
> can have a link that sends the page to the printer 
> automatically that before doing anything pops a dialog 
> instructing the user to turn on background images. Give the 
> user instructions on how to do it and two buttons "print" and 
> "cancel".
> 
> 
> 
> 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] Beautiful HTML Invoice -> Prints like crap! I need somesuggestions!

2005-06-09 Thread Leif Gregory
Hello Matt,

Thursday, June 9, 2005, 3:34:30 PM, you wrote:
M> Yeah I do understand this. That is primarily what I was trying to
M> find a workaround for. It doesn't seem like CSS will save me on
M> this one. I can't seem to get table borders to look identical in
M> ff/ie using CSS they render differently. My Diagrams mostly rely on
M> bg colors, so I'm really up a creek right now - unless I convert
M> the bg images to foreground image which would really suck...but
M> could be done.


There are some things (this one being an example) that you just can't
control from the server side.

Another one is forcing a page to print as landscape. I have long since
given up on that one for sign-in rosters. I just put a big note next
to the link to make sure to print it in landscape.

As for IE / FF borders, that one drives me nuts too. I like to use
outset and inset borders for a 3-D look, but in IE it's all
stairstepped when I do nested borders.

I'm sorry I don't have an answer for you other than I don't think
you're going to achieve what you want with CSS.


-- 
Leif (TB lists moderator and fellow end user).

Using The Bat! 3.5.26 under Windows XP 5.1
Build 2600 Service Pack 2 on a Pentium 4 2GHz with 512MB

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



Re: [PHP] Objects and Performance

2005-06-09 Thread Greg Donald
On 6/9/05, Matthew Weier O'Phinney <[EMAIL PROTECTED]> wrote:
> Actually, that is the point.

If I decide the write a script, and it is my idea, then the point of
the script is my own.  It's a simple benchmark.  I doubt a client
would ever come to me and say "Can you write me a script to add two
random numbers a thousand time?"  No, it's not gonna happen.  I
decided what the benckmark would do, and so I wrote it.  I wrote two
versions, a full-on OO version, and a pure procedural one.  _That_ is
the point of the benchmark.  What do you not grasp about that?

> What Chris

Chris who?

> was getting at is that usually you have a bit more going on
> in a function or method -- several operations, not just a wrapper for a
> single operation -- that the function/method call serves to abstract.

If you think it matters a great deal rewrite the benchmark and remove
it.  The OO version will still be slower.

Putting a single function call in a wrapper function is better known
as 'abstraction'.  If later I decide to use srand() instead of
mt_srand() I only have to change it in one place.

> if you're working
> for a client under a deadline, you don't always have that luxury.

Exactly why I always write procedural style.  It's much faster to
code, to run, and to debug.


-- 
Greg Donald
Zend Certified Engineer
http://destiney.com/

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



[PHP] Php.net/pdf -> Making a PDF from the invoice

2005-06-09 Thread Matt Babineau
Speaking of PDF...I was looking at php.net/pdf and couldn't figure out if
there was a way I could just dump in the html of the page and have it output
as a pdf? Does anyone have any sample code for dumping HTML to PDF format?
(Using PDFlib). Didn't seem like the samples on php.net were that good.

Thx- 


Matt Babineau
Criticalcode
w: http://www.criticalcode.com
p: 858.733.0160
e: [EMAIL PROTECTED]

-Original Message-
From: Kristen G. Thorson [mailto:[EMAIL PROTECTED] 
Sent: Thursday, June 09, 2005 2:05 PM
To: php-general@lists.php.net
Subject: Re: [PHP] Beautiful HTML Invoice -> Prints like crap! I need
somesuggestions!

Most web browsers I know of don't print anything specified as background by
default.  I imagine that functionality extends to CSS-defined background
colors and images.  I doubt there's a way to change that preference other
than setting it manually.  If changing the print settings on your machine
will not work for you, then you may consider PDF, though it certainly comes
with it's own hassles.



kgt




Matt Babineau wrote:

>Ok all - I've been playing with this print styl sheet thing. I can get 
>the media="print" to behave correctly, but I cannot get table 
>background colors set. I want to print the table bg colors and 
>background images. I was hoping this was possible with CSS2. Does 
>anyone have any input on this? I build some diagrams using html and 
>graphics which are on the invoice, and I use bgcolor on my tables to 
>show the separator lines in the line item section with the prices and 
>such. I don't know how to proceed best, or if I am heading down a dead end
with this. Anyone have any more input on this?
>Everything I have read so far has been very helpful and I thank you for 
>that.
>
>
>Matt Babineau
>Criticalcode
>w: http://www.criticalcode.com
>p: 858.733.0160
>e: [EMAIL PROTECTED]
>
>-Original Message-
>From: Marcus Bointon [mailto:[EMAIL PROTECTED]
>Sent: Thursday, June 09, 2005 5:02 AM
>To: PHP General
>Subject: Re: [PHP] Beautiful HTML Invoice -> Prints like crap! I need 
>somesuggestions!
>
>On 7 Jun 2005, at 23:46, Chris Martin wrote:
>  
>
>>Is a simple CSS print stylesheet out of the question?
>>If the site is marked up properly, this should be trivial, and would 
>>be much easier/more efficient.
>>
>>
>
>CSS is definitely the way to go. Here are some good articles:
>
>http://www.alistapart.com/articles/printyourway/
>http://www.alistapart.com/articles/goingtoprint/
>
>Marcus
>
>--
>Marcus Bointon
>Synchromedia Limited: Putting you in the picture 
>[EMAIL PROTECTED] | http://www.synchromedia.co.uk
>
>--
>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] Beautiful HTML Invoice -> Prints like crap! I need somesuggestions!

2005-06-09 Thread Chris W. Parker
Leif Gregory 
on Thursday, June 09, 2005 2:29 PM said:

> You realize that the printing of background colors is determined
> primarily by the user's browser right?
> 
> In IE:
> Tools / Internet Options / Advanced / Under Printing section.
> 
> In Firefox:
> File / Page Setup / Under Options

Matt,

Taking into account what Leif has pointed out here, maybe you can have a
link that sends the page to the printer automatically that before doing
anything pops a dialog instructing the user to turn on background
images. Give the user instructions on how to do it and two buttons
"print" and "cancel".



Chris.

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



RE: [PHP] Beautiful HTML Invoice -> Prints like crap! I need somesuggestions!

2005-06-09 Thread Matt Babineau
Yeah I do understand this. That is primarily what I was trying to find a
workaround for. It doesn't seem like CSS will save me on this one. I can't
seem to get table borders to look identical in ff/ie using CSS they render
differently. My Diagrams mostly rely on bg colors, so I'm really up a creek
right now - unless I convert the bg images to foreground image which would
really suck...but could be done.


Matt Babineau
Criticalcode
w: http://www.criticalcode.com
p: 858.733.0160
e: [EMAIL PROTECTED]

-Original Message-
From: Leif Gregory [mailto:[EMAIL PROTECTED] 
Sent: Thursday, June 09, 2005 2:29 PM
To: Matt Babineau
Subject: Re: [PHP] Beautiful HTML Invoice -> Prints like crap! I need
somesuggestions!

Hello Matt,

Thursday, June 9, 2005, 2:47:51 PM, you wrote:
M> Ok all - I've been playing with this print styl sheet thing. I can 
M> get the media="print" to behave correctly, but I cannot get table 
M> background colors set. I want to print the table bg colors and 
M> background images. I was hoping this was possible with CSS2. Does 
M> anyone have any input on this? I build some diagrams using html and 
M> graphics which are on the invoice, and I use bgcolor on my tables to 
M> show the separator lines in the line item section with the prices and 
M> such. I don't know how to proceed best, or if I am heading down a 
M> dead end with this. Anyone have any more input on this? Everything I 
M> have read so far has been very helpful and I thank you for that.


You realize that the printing of background colors is determined primarily
by the user's browser right?

In IE:
Tools / Internet Options / Advanced / Under Printing section.

In Firefox:
File / Page Setup / Under Options

--
Leif (TB lists moderator and fellow end user).

Using The Bat! 3.5.26 under Windows XP 5.1 Build 2600 Service Pack 2 on a
Pentium 4 2GHz with 512MB

--
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] Beautiful HTML Invoice -> Prints like crap! I need somesuggestions!

2005-06-09 Thread Kristen G. Thorson
Most web browsers I know of don't print anything specified as background 
by default.  I imagine that functionality extends to CSS-defined 
background colors and images.  I doubt there's a way to change that 
preference other than setting it manually.  If changing the print 
settings on your machine will not work for you, then you may consider 
PDF, though it certainly comes with it's own hassles.




kgt




Matt Babineau wrote:


Ok all - I've been playing with this print styl sheet thing. I can get the
media="print" to behave correctly, but I cannot get table background colors
set. I want to print the table bg colors and background images. I was hoping
this was possible with CSS2. Does anyone have any input on this? I build
some diagrams using html and graphics which are on the invoice, and I use
bgcolor on my tables to show the separator lines in the line item section
with the prices and such. I don't know how to proceed best, or if I am
heading down a dead end with this. Anyone have any more input on this?
Everything I have read so far has been very helpful and I thank you for
that.


Matt Babineau
Criticalcode
w: http://www.criticalcode.com
p: 858.733.0160
e: [EMAIL PROTECTED]

-Original Message-
From: Marcus Bointon [mailto:[EMAIL PROTECTED] 
Sent: Thursday, June 09, 2005 5:02 AM

To: PHP General
Subject: Re: [PHP] Beautiful HTML Invoice -> Prints like crap! I need
somesuggestions!

On 7 Jun 2005, at 23:46, Chris Martin wrote:
 


Is a simple CSS print stylesheet out of the question?
If the site is marked up properly, this should be trivial, and would 
be much easier/more efficient.
   



CSS is definitely the way to go. Here are some good articles:

http://www.alistapart.com/articles/printyourway/
http://www.alistapart.com/articles/goingtoprint/

Marcus

--
Marcus Bointon
Synchromedia Limited: Putting you in the picture [EMAIL PROTECTED] |
http://www.synchromedia.co.uk

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

 





RE: [PHP] Beautiful HTML Invoice -> Prints like crap! I need somesuggestions!

2005-06-09 Thread Warren Vail
Isn't this a user selectable option, which by default is turned off (on
most browsers)?

My Internet explorer has an advance configuration option that enables
"Print background colors and images".

Don't think you can override the users selection on this.

Warren Vail
[EMAIL PROTECTED]

> -Original Message-
> From: Matt Babineau [mailto:[EMAIL PROTECTED] 
> Sent: Thursday, June 09, 2005 1:48 PM
> To: php-general@lists.php.net
> Subject: RE: [PHP] Beautiful HTML Invoice -> Prints like 
> crap! I need somesuggestions!
> 
> 
> Ok all - I've been playing with this print styl sheet thing. 
> I can get the media="print" to behave correctly, but I cannot 
> get table background colors set. I want to print the table bg 
> colors and background images. I was hoping this was possible 
> with CSS2. Does anyone have any input on this? I build some 
> diagrams using html and graphics which are on the invoice, 
> and I use bgcolor on my tables to show the separator lines in 
> the line item section with the prices and such. I don't know 
> how to proceed best, or if I am heading down a dead end with 
> this. Anyone have any more input on this? Everything I have 
> read so far has been very helpful and I thank you for that.
> 
> 
> Matt Babineau
> Criticalcode
> w: http://www.criticalcode.com
> p: 858.733.0160
> e: [EMAIL PROTECTED]
> 
> -Original Message-
> From: Marcus Bointon [mailto:[EMAIL PROTECTED] 
> Sent: Thursday, June 09, 2005 5:02 AM
> To: PHP General
> Subject: Re: [PHP] Beautiful HTML Invoice -> Prints like 
> crap! I need somesuggestions!
> 
> On 7 Jun 2005, at 23:46, Chris Martin wrote:
> > Is a simple CSS print stylesheet out of the question?
> > If the site is marked up properly, this should be trivial, and would
> > be much easier/more efficient.
> 
> CSS is definitely the way to go. Here are some good articles:
> 
http://www.alistapart.com/articles/printyourway/
http://www.alistapart.com/articles/goingtoprint/

Marcus

--
Marcus Bointon
Synchromedia Limited: Putting you in the picture
[EMAIL PROTECTED] | http://www.synchromedia.co.uk

--
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] Beautiful HTML Invoice -> Prints like crap! I need somesuggestions!

2005-06-09 Thread Leif Gregory
Hello Matt,

Thursday, June 9, 2005, 2:47:51 PM, you wrote:
M> Ok all - I've been playing with this print styl sheet thing. I can
M> get the media="print" to behave correctly, but I cannot get table
M> background colors set. I want to print the table bg colors and
M> background images. I was hoping this was possible with CSS2. Does
M> anyone have any input on this? I build some diagrams using html and
M> graphics which are on the invoice, and I use bgcolor on my tables
M> to show the separator lines in the line item section with the
M> prices and such. I don't know how to proceed best, or if I am
M> heading down a dead end with this. Anyone have any more input on
M> this? Everything I have read so far has been very helpful and I
M> thank you for that.


You realize that the printing of background colors is determined
primarily by the user's browser right?

In IE:
Tools / Internet Options / Advanced / Under Printing section.

In Firefox:
File / Page Setup / Under Options

-- 
Leif (TB lists moderator and fellow end user).

Using The Bat! 3.5.26 under Windows XP 5.1
Build 2600 Service Pack 2 on a Pentium 4 2GHz with 512MB

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



RE: [PHP] Beautiful HTML Invoice -> Prints like crap! I need somesuggestions!

2005-06-09 Thread Matt Babineau
Unfortunately you can't override this setting. It is really quite
frustrating overall - I'm sure some of you have used background color to
create an excel style table...or maybe I'm just doing things totally wrong.
Customers get to login to get their invoices, so I really want them to be
able to print a copy. I've looked into PDFing the invoice but its just a bit
easier to hit the print button and be done since Adobe PDF usually crashes
your browser :( 


Matt Babineau
Criticalcode
w: http://www.criticalcode.com
p: 858.733.0160
e: [EMAIL PROTECTED]

-Original Message-
From: Warren Vail [mailto:[EMAIL PROTECTED] 
Sent: Thursday, June 09, 2005 2:05 PM
To: 'Matt Babineau'; php-general@lists.php.net
Subject: RE: [PHP] Beautiful HTML Invoice -> Prints like crap! I need
somesuggestions!

Isn't this a user selectable option, which by default is turned off (on most
browsers)?

My Internet explorer has an advance configuration option that enables "Print
background colors and images".

Don't think you can override the users selection on this.

Warren Vail
[EMAIL PROTECTED]

> -Original Message-
> From: Matt Babineau [mailto:[EMAIL PROTECTED]
> Sent: Thursday, June 09, 2005 1:48 PM
> To: php-general@lists.php.net
> Subject: RE: [PHP] Beautiful HTML Invoice -> Prints like crap! I need 
> somesuggestions!
> 
> 
> Ok all - I've been playing with this print styl sheet thing. 
> I can get the media="print" to behave correctly, but I cannot get 
> table background colors set. I want to print the table bg colors and 
> background images. I was hoping this was possible with CSS2. Does 
> anyone have any input on this? I build some diagrams using html and 
> graphics which are on the invoice, and I use bgcolor on my tables to 
> show the separator lines in the line item section with the prices and 
> such. I don't know how to proceed best, or if I am heading down a dead 
> end with this. Anyone have any more input on this? Everything I have 
> read so far has been very helpful and I thank you for that.
> 
> 
> Matt Babineau
> Criticalcode
> w: http://www.criticalcode.com
> p: 858.733.0160
> e: [EMAIL PROTECTED]
> 
> -Original Message-
> From: Marcus Bointon [mailto:[EMAIL PROTECTED] 
> Sent: Thursday, June 09, 2005 5:02 AM
> To: PHP General
> Subject: Re: [PHP] Beautiful HTML Invoice -> Prints like 
> crap! I need somesuggestions!
> 
> On 7 Jun 2005, at 23:46, Chris Martin wrote:
> > Is a simple CSS print stylesheet out of the question?
> > If the site is marked up properly, this should be trivial, and would
> > be much easier/more efficient.
> 
> CSS is definitely the way to go. Here are some good articles:
> 
http://www.alistapart.com/articles/printyourway/
http://www.alistapart.com/articles/goingtoprint/

Marcus

--
Marcus Bointon
Synchromedia Limited: Putting you in the picture
[EMAIL PROTECTED] | http://www.synchromedia.co.uk

--
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] Objects and Performance

2005-06-09 Thread Matthew Weier O'Phinney
* Greg Donald <[EMAIL PROTECTED]> :
> On 6/8/05, Greg Beaver <[EMAIL PROTECTED]> wrote:
> > If you want to compare object methods versus functions, you should
> > compare identical code inside a method to code inside a function.
> > Greg's benchmarks compare two different ideological code structures.
> > Quite honestly, the wrapping of mt_srand() inside a function or method
> > does not satisfy the definition of good coding, object-oriented or
> > otherwise.
> >
> > Functions/methods should be used to abstract common operations.
> > mt_srand() already does this necessary abstraction, and putting a
> > further wrapper around it makes no sense.
>
> I called mt_srand() inside the constructor, so it's only called once,
> same as the procedural version.  This being an example of a class, it
> seems like the logical place to put it.  I can remove it from both
> versions but it's not gonna change much as far as speed.
> 
> > If your code does simple operations on a few operands and returns a
> > value, like our mt_srand() function, there is absolutely no point in
> > making it more complicated.
>
> I agree.  In the real world a given task will likely be more
> complicated, but that's not the point here.

Actually, that is the point. 

What Chris was getting at is that usually you have a bit more going on
in a function or method -- several operations, not just a wrapper for a
single operation -- that the function/method call serves to abstract.
So, calling a method that simply calls and returns a single php internal
function call isn't going to give a good comparison; we already know
that calling the function is faster.

> > However, you could consider wrapping the functions inside a class and
> > using them as static methods.
>
> There is little point in making classes to then only use the methods
> statically.  You could just put all your similar functions in an
> include file and be done with it.  Nothing more annoying than working
> on someone else's OO code and seeing Foo::bar() all over the place. 
> Pointless.

Unless you have several function libraries that were developed
separately and *do* have the same function names. Where I work, for
instance, at one point we had three function libraries, developed
separately, that each had their own 'send' function, which worked fine
until we tried to develop an application that mixed some functionality
from the different libraries.

Granted, we could have refactored and split out the common functionality
from the libraries into a separate library, but we found it was much
easier to wrap everything into classes and uses the class structure as a
namespace.

(We've since completely refactored and gone all OOP, but that's neither
here nor there.)

> > This would essentially give them a
> > "namespace" that would allow any conflicts with other programmer's
> > function names to be more easily resolved.
>
> If PHP needs namespaces then add them, last I heard the consensus was
> that it didn't.  I've never needed them personally.  It doesn't seem
> like enough justification to use objects just because you don't want
> to rename a few functions in the rare event you actually have a
> conflict.  Seriously, how many times have you been working on a PHP
> project that was so big, with so many developers, that you bumped into
> each other with function names?  Has yet to happen to me.

That's *your* experience. You're going to keep seeing namespace
discussions pop up whenever other people have experiences that indicate
namespaces would help solve the issue. You're also going to have the
issue pop up whenever you have developers from other languages start
using PHP. I come from a perl background; I'd *love* to have namespaces
in PHP... but I can use classes to emulate them fairly well.


> > make the code readable and maintainable and it will cut down on bugs and
> > work better than "faster" code.
>
> I always value efficient code over time to code.  Doing more with less
> hardware should always be a programmer's first goal in my opinion. 
> The overhead involved in bringing a web-based object into existence
> for the extremely short period of time it will live can never justify
> the 'maintainability' and 'readability' arguments I'm always hearing
> preached.  I've never seen any OO PHP code that was easier to read or
> maintain for that matter.

Again, your experience. I *have* seen OOP PHP that was easier to read
and maintain. I've seen (and written) some perfectly horrendous
procedural code that was a nightmare to read and maintain.

You're right -- you should try to write efficient code. But sometimes
you have to look at programmer efficiency as well -- if you're working
for a client under a deadline, you don't always have that luxury.

-- 
Matthew Weier O'Phinney   | WEBSITES:
Webmaster and IT Specialist   | http://www.garden.org
National Gardening Association| http://www.kidsgardening.com
802-863-5251 x156 | http://nationalgardenmonth.org

RE: [PHP] Beautiful HTML Invoice -> Prints like crap! I need somesuggestions!

2005-06-09 Thread Matt Babineau
Ok all - I've been playing with this print styl sheet thing. I can get the
media="print" to behave correctly, but I cannot get table background colors
set. I want to print the table bg colors and background images. I was hoping
this was possible with CSS2. Does anyone have any input on this? I build
some diagrams using html and graphics which are on the invoice, and I use
bgcolor on my tables to show the separator lines in the line item section
with the prices and such. I don't know how to proceed best, or if I am
heading down a dead end with this. Anyone have any more input on this?
Everything I have read so far has been very helpful and I thank you for
that.


Matt Babineau
Criticalcode
w: http://www.criticalcode.com
p: 858.733.0160
e: [EMAIL PROTECTED]

-Original Message-
From: Marcus Bointon [mailto:[EMAIL PROTECTED] 
Sent: Thursday, June 09, 2005 5:02 AM
To: PHP General
Subject: Re: [PHP] Beautiful HTML Invoice -> Prints like crap! I need
somesuggestions!

On 7 Jun 2005, at 23:46, Chris Martin wrote:
> Is a simple CSS print stylesheet out of the question?
> If the site is marked up properly, this should be trivial, and would 
> be much easier/more efficient.

CSS is definitely the way to go. Here are some good articles:

http://www.alistapart.com/articles/printyourway/
http://www.alistapart.com/articles/goingtoprint/

Marcus

--
Marcus Bointon
Synchromedia Limited: Putting you in the picture [EMAIL PROTECTED] |
http://www.synchromedia.co.uk

--
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 ?] weird thing; downloading from a php script stops at exactly 2.000.000 bytes

2005-06-09 Thread Catalin Trifu
Hi,

   I installed php5 using the configue below. I tried with apache2 as well and 
same things.

'./configure' '--prefix=/usr/local/php5' 
'--with-apxs=/usr/local/apache/bin/apxs' '--disable-cgi'
'--with-config-file-path=/etc/php5' '--with-dom' '--with-gd' '--enable-sockets' 
'--enable-exif'
'--with-freetype2' '--with-freetype-dir=/usr/include/freetype2' 
'--enable-gd-native-ttf'
'--with-zlib-dir=/usr' '--with-curl' '--with-curlwrappers' '--enable-ftp' 
'--with-mysql=/usr'
'--with-xsl' '--with-libxml-dir=/usr'

   I have a script which generates a temporary catalog file, which is generated 
correctly having
4.7MB on disk.
   Then I push up the wire with readfile($filname):

   header("Content-Type: text/csv");
   header("Content-Disposition: attachment; filename=somfilename.csv");
   header("Content-Length: ". filesize($file));

   readfile($file);

   I also tried with fopen.
   If I try to download the file directly from apache it works, all 4.7MB are 
received.

   As expected the browser starts the download and reports it is expecting a 
file of 4.7MB.
   However, the download stops at 2.000.000 bytes no matter what browser I use 
(normally i use
Firefox on Linux), no matter if php runs on apache2 or apache1.3

   Is there some php config option I missed ?
   Could this be from curlwrappers ?
   Where could this come from ?


Thanks,
Catalin

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



Re: [PHP] Compilation trouble on OS X

2005-06-09 Thread Marcus Bointon

On 9 Jun 2005, at 18:11, Brent Baisley wrote:

I'm pretty sure you have to install the developer tools in order to  
get the gcc compiler installed. So while you don't need XCode to  
compile, you do need the developer tools, which is almost  
synonymous with XCode.


Of course I have the developer tools installed - I wouldn't even be  
able to attempt a compile without them. XCode is an IDE - it provides  
project management and a nice GUI for lower level tools, however, it  
is squarely targeted at development of OS X applications that are set  
up as XCode projects, which does not include PHP. Bear in mind that  
almost none of the thousands of open source projects available via  
sources like fink have anything to do with XCode - they're all  
designed for a standard unix-style build system using the tools I  
mentioned.


Doesn't 10.4 ship with gcc 4? I know I read about some bugs and  
problem with gcc 4, some specifically related to PPC chips. Do you  
know if you are compiling using 3.3 or 4.0?


I'm using the standard system gcc 4.0.0, but this is a problem with  
the parameters (defined in the PHP configure script) passed to ld, so  
strictly speaking this is a linking rather than a compiling problem  
(i.e. the problem occurs after gcc has finished successfully). It  
seems that the OS X ld has different options to the GNU or BSD  
implementations, so I guess I'm really after someone that knows ld  
well enough.


Marcus
--
Marcus Bointon
Synchromedia Limited: Putting you in the picture
[EMAIL PROTECTED] | http://www.synchromedia.co.uk

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



Re: [PHP] _construct() problem

2005-06-09 Thread Stéphane Bruno
Thanks, Richard

It now works. It was not obvious in the book I was using. The author
should have put a side note stating it is two underscores instead of
one.

Stéphane

On Thu, 2005-06-09 at 08:42, Richard Davey wrote:
> Hello Stéphane,
> 
> Wednesday, June 8, 2005, 10:23:22 PM, you wrote:
> 
> SB>   function _construct($first, $last) {
> 
> SB> What did I do wrong?
> 
> It's __construct()
> 
> Best regards,
> 
> Richard Davey
> -- 
>  http://www.launchcode.co.uk - PHP Development Services
>  "I do not fear computers. I fear the lack of them." - Isaac Asimov

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



Re: [PHP] XSLT processor and xsl:param - expected behavior?

2005-06-09 Thread Christian Stocker
On 6/9/05, John Browne <[EMAIL PROTECTED]> wrote:
> Question..  I'm using PHP 5.0.4 with the built-in libxslt-based xsl
> extension. I'm passing XSL parameters to the XSL processor like so:
> 
> $xslt_proc->setParameter('', 'param_test', "some test value");
> 
> My question is, is it *required* to declare this parameter in the XSL
> stylesheet with:
> 
> 
> 
> What I have noticed is, the transformation is successful and works the
> same whether I declare the parameter using xsl:param or not.  The
> following:
> 
> 
> 
> works fine without the xsl:param declaration, the xsl processor does
> not give an error, and the parameter is available for use in the
> stylesheet.
> 
> Shouldn't the xsl:param declaration be required and cause a
> transformation error if it's missing?

Indeed, that's working ;)

But PHP doesn't do much here, I'd say it's more a libxslt "bug", but I
didn't look up the standards (but your assumption seems obvious)

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


-- 
christian stocker | Bitflux GmbH | schoeneggstrasse 5 | ch-8004 zurich
phone +41 1 240 56 70 | mobile +41 76 561 88 60  | fax +41 1 240 56 71
http://www.bitflux.ch  |  [EMAIL PROTECTED]  |  gnupg-keyid 0x5CE1DECB

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



Re: [PHP] Is there a big speed difference...

2005-06-09 Thread Chris Shiflett

bruce wrote:

in all honesty, it would really depend on how good the compiler/optimizer
is.


No, it doesn't. Path resolution must still be performed, and this is 
going to result in at least one stat() and one realpath() call. These 
are expensive.


Chris

--
Chris Shiflett
Brain Bulb, The PHP Consultancy
http://brainbulb.com/

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



Re: [PHP] Can't connect to local MySQL server through socket.. ?

2005-06-09 Thread [EMAIL PROTECTED]

Just as I thought :(

Thanks Richard.

-afan

Richard Davey wrote:


Hello afan,

Thursday, June 9, 2005, 7:07:26 PM, you wrote:

aan> I have an admin area for one page on shared hosting. And I wanted to
aan> protect it by shared SSL from my hosting company. I got from them

aan> Your domain, afan.net, can now access our shared SSL certificate.
aan> To securely access the documents folder, go to ...

aan> I'm getting Warning:
aan> *Warning*: mysql_connect(): Can't connect to local MySQL server through

Sounds to me like their SSL server is a different box to their web
server. This isn't uncommon practise and would explain a MySQL connect
error. MySQL doesn't care less if you're the PHP script was accessed
via HTTP or HTTPS.

You ought to call their tech support department to be honest.

Best regards,

Richard Davey
 



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



Re[2]: [PHP] Can't connect to local MySQL server through socket.. ?

2005-06-09 Thread Richard Davey
Hello afan,

Thursday, June 9, 2005, 7:18:46 PM, you wrote:

aan> According to Google, my MySQL db is not on secure.inetwave.com
aan> server and have to use "something else" instead of "localhost"
aan> for host in mysql_connect(), right?

Sure.. you could the domain name of the server that MySQL is really
on, or its IP address.

But they might have locked MySQL down so that you cannot access it
remotely - you need to ask them.

Best regards,

Richard Davey
-- 
 http://www.launchcode.co.uk - PHP Development Services
 "I do not fear computers. I fear the lack of them." - Isaac Asimov

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



Re: [PHP] Can't connect to local MySQL server through socket.. ?

2005-06-09 Thread Richard Davey
Hello afan,

Thursday, June 9, 2005, 7:07:26 PM, you wrote:

aan> I have an admin area for one page on shared hosting. And I wanted to
aan> protect it by shared SSL from my hosting company. I got from them

aan> Your domain, afan.net, can now access our shared SSL certificate.
aan> To securely access the documents folder, go to ...

aan> I'm getting Warning:
aan> *Warning*: mysql_connect(): Can't connect to local MySQL server through

Sounds to me like their SSL server is a different box to their web
server. This isn't uncommon practise and would explain a MySQL connect
error. MySQL doesn't care less if you're the PHP script was accessed
via HTTP or HTTPS.

You ought to call their tech support department to be honest.

Best regards,

Richard Davey
-- 
 http://www.launchcode.co.uk - PHP Development Services
 "I do not fear computers. I fear the lack of them." - Isaac Asimov

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



Re: [PHP] Can't connect to local MySQL server through socket.. ?

2005-06-09 Thread [EMAIL PROTECTED]
According to Google, my MySQL db is not on secure.inetwave.com server 
and have to use "something else" instead of "localhost" for host in 
mysql_connect(), right?


-afan

[EMAIL PROTECTED] wrote:

I have an admin area for one page on shared hosting. And I wanted to 
protect it by shared SSL from my hosting company. I got from them

Your domain, afan.net, can now access our shared SSL certificate.
To securely access the documents folder, go to ...
https://secure.inetwave.com/afan/filename
But, when I go to my admin area
https://secure.inetwave.com/afan/admin
I'm getting Warning:
*Warning*: mysql_connect(): Can't connect to local MySQL server 
through socket '/var/lib/mysql/mysql.sock' (2) in 
*/web/home/afan/admin/includes/functions.php* on line *120*
Can't connect to local MySQL server through socket 
'/var/lib/mysql/mysql.sock' (2)


line 120 in file functions.php is
117#DATABASE CONNECTING
118function db_connect($host, $user, $password, $db_name)
119   {
120   mysql_connect($host, $user, $password) or die (mysql_error());
121   mysql_select_db($db_name) or die (mysql_error());
 122  }





-afan



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



RE: [PHP] Is there a big speed difference...

2005-06-09 Thread bruce
in all honesty, it would really depend on how good the compiler/optimizer
is.. but since you're dealing with php.. and i assume that there's not a
good (if any) optimization process...

i would tend to say, include the function/file once, use the function as
required...

-bruce


-Original Message-
From: Chris Shiflett [mailto:[EMAIL PROTECTED]
Sent: Thursday, June 09, 2005 10:34 AM
To: Brian Dunning
Cc: php-general@lists.php.net
Subject: Re: [PHP] Is there a big speed difference...


Brian Dunning wrote:
> I have an include file with about 6 lines of code, just text parsing.
> If I have to loop through 5000 records, is there a big difference
> between (a) calling this include file 5000 times, and (b) defining a
> function and just calling the function 5000 times?

Yes, there is a big difference. Including files is expensive, even with
a compiler cache.

Hope that helps.

Chris

--
Chris Shiflett
Brain Bulb, The PHP Consultancy
http://brainbulb.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] Can't connect to local MySQL server through socket.. ?

2005-06-09 Thread [EMAIL PROTECTED]
I have an admin area for one page on shared hosting. And I wanted to 
protect it by shared SSL from my hosting company. I got from them

Your domain, afan.net, can now access our shared SSL certificate.
To securely access the documents folder, go to ...
https://secure.inetwave.com/afan/filename
But, when I go to my admin area
https://secure.inetwave.com/afan/admin
I'm getting Warning:
*Warning*: mysql_connect(): Can't connect to local MySQL server through 
socket '/var/lib/mysql/mysql.sock' (2) in 
*/web/home/afan/admin/includes/functions.php* on line *120*
Can't connect to local MySQL server through socket 
'/var/lib/mysql/mysql.sock' (2)


line 120 in file functions.php is
117#DATABASE CONNECTING
118function db_connect($host, $user, $password, $db_name)
119   {
120   mysql_connect($host, $user, $password) or die (mysql_error());
121   mysql_select_db($db_name) or die (mysql_error());
 122  }





-afan

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



[PHP] Re: weird thing; downloading from a php script stops at exactly 2.000.000bytes

2005-06-09 Thread Catalin Trifu
Hi,

   Thanks for the answer; the amount of memory configured is 64MB.
   readfile does no buffering and such things; it simply spits the file
on the wire.
   Other suggestions ?

C.


rush wrote:
> "Catalin Trifu" <[EMAIL PROTECTED]> wrote in message
> news:[EMAIL PROTECTED]
> 
>>Hi,
>>   As expected the browser starts the download and reports it is expecting
> 
> a file of 4.7MB.
> 
>>   However, the download stops at 2.000.000 bytes no matter what browser I
> 
> use (normally i use
> 
>>Firefox on Linux), no matter if php runs on apache2 or apache1.3
> 
> 
> try changing the amount of memory that php script can use, and see if
> download stops at different place. Default memory for script is 8Mb, and 2Mb
> is suspiciosly equal to 8Mb/word size.
> 
> rush
> --
> http://www.templatetamer.com/
> http://www.folderscavenger.com/

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



Re: [PHP] Is there a big speed difference...

2005-06-09 Thread Chris Shiflett

Brian Dunning wrote:

I have an include file with about 6 lines of code, just text parsing.
If I have to loop through 5000 records, is there a big difference
between (a) calling this include file 5000 times, and (b) defining a
function and just calling the function 5000 times?


Yes, there is a big difference. Including files is expensive, even with 
a compiler cache.


Hope that helps.

Chris

--
Chris Shiflett
Brain Bulb, The PHP Consultancy
http://brainbulb.com/

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



Re: [PHP] Is there a big speed difference...

2005-06-09 Thread Jochem Maas

Brent Baisley wrote:
Not sure which is faster, you would have to run a quick test to truly 
see. From a design standpoint, I would put the function in a class and 
load the class early in the file. You can then override the function, 
make changes to the number of parameters or other "flexibility" actions. 
The function also has it's own variable scope, which can be very helpful 
depending on what you are doing. You can't do that with an included file.


a bit irrelevant and also not true IMHO. besides the question was about speed,
he is already looking at possibly incurring the overhead of a function call
(It doesn't sound like he can use the include option is his case), why make
it slower by adding a class into the mix (class/object method calling incurs
a slightly greater overhead)?



If you do use and include, you most certainly should use include_once 
instead, unless you are dependent on changing/new variables in the loop.


which he obviously is?! so he most certainly shouldn't be using include_once,
but I think he gets that also.



On Jun 9, 2005, at 12:15 PM, Brian Dunning wrote:

I have an include file with about 6 lines of code, just text parsing. 
If I have to loop through 5000 records, is there a big difference 
between (a) calling this include file 5000 times, and (b) defining a 
function and just calling the function 5000 times?


--
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] Is there a big speed difference...

2005-06-09 Thread Brian Dunning

On Jun 9, 2005, at 10:54 AM, Jochem Maas wrote:


unless you intend to make a call
to your function from inside the include file,


No, the question is which of the two to use, not both.   :)
I've built a version that uses a function, will test, and will post  
the results.


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



Re: [PHP] Is there a big speed difference...

2005-06-09 Thread Jochem Maas

Brian Dunning wrote:

On Jun 9, 2005, at 9:44 AM, Jochem Maas wrote:

or (c) just placing the code inside the loop - no function call ,  no 
include,
just wash and go ;-) - whichever is faster of (a) and (b), my (c)  
will be faster still. :-)



I agree (c) would be swell but this is a function that I call from  many 
different places and that would make it too hard to manage.


you mentioned it was 6 lines of code - replicating it and commenting the code
(mention where it came from) if you need the speed doesn't seem like a big deal,
however if you insist that the function must be used then you have just
ruled out the possibility of using an include. unless you intend to make a call
to your function from inside the include file, in which case that will be slower
(your doing an include + a function call on every iteration).

case closed?





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



[PHP] Printing functions under PHP 4.3.11

2005-06-09 Thread Fausto Mira
Hi! First off, thank you very much for your efforts.

I have set up my php.ini file properly with the extension_dir tag. I
am running under Windows XP Apache 2.0.50 and PHP 4.3.11. I have
noticed that php_printer.dll was no longer part of these late versions
4.3.11 and 4.3.10. I tried an unconventional method and copied this
file from an older version of PHP 4 to the extensions directory.

When I try to start the Apache server, a Warning Message pops up with
the following error:

"Unknown(): Unable do load dynamic library
'C:\php\extensions\php_printer.dll' .

What's wrong with my PHP 4.3.11? These functions are now buit-in in
this version?

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



[PHP] XSLT processor and xsl:param - expected behavior?

2005-06-09 Thread John Browne
Question..  I'm using PHP 5.0.4 with the built-in libxslt-based xsl
extension. I'm passing XSL parameters to the XSL processor like so:

$xslt_proc->setParameter('', 'param_test', "some test value");

My question is, is it *required* to declare this parameter in the XSL
stylesheet with:



What I have noticed is, the transformation is successful and works the
same whether I declare the parameter using xsl:param or not.  The
following:



works fine without the xsl:param declaration, the xsl processor does
not give an error, and the parameter is available for use in the
stylesheet.

Shouldn't the xsl:param declaration be required and cause a
transformation error if it's missing?

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



Re: [PHP] Is there a big speed difference...

2005-06-09 Thread Brent Baisley
Not sure which is faster, you would have to run a quick test to truly 
see. From a design standpoint, I would put the function in a class and 
load the class early in the file. You can then override the function, 
make changes to the number of parameters or other "flexibility" 
actions. The function also has it's own variable scope, which can be 
very helpful depending on what you are doing. You can't do that with an 
included file.


If you do use and include, you most certainly should use include_once 
instead, unless you are dependent on changing/new variables in the 
loop.


On Jun 9, 2005, at 12:15 PM, Brian Dunning wrote:

I have an include file with about 6 lines of code, just text parsing. 
If I have to loop through 5000 records, is there a big difference 
between (a) calling this include file 5000 times, and (b) defining a 
function and just calling the function 5000 times?


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



--
Brent Baisley
Systems Architect
Landover Associates, Inc.
Search & Advisory Services for Advanced Technology Environments
p: 212.759.6400/800.759.0577

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



Re: [PHP] Compilation trouble on OS X

2005-06-09 Thread Brent Baisley
I'm pretty sure you have to install the developer tools in order to get 
the gcc compiler installed. So while you don't need XCode to compile, 
you do need the developer tools, which is almost synonymous with XCode.


Doesn't 10.4 ship with gcc 4? I know I read about some bugs and problem 
with gcc 4, some specifically related to PPC chips. Do you know if you 
are compiling using 3.3 or 4.0?


On Jun 9, 2005, at 1:04 PM, Marcus Bointon wrote:


On 9 Jun 2005, at 15:46, John DeSoi wrote:

Do you have the latest XCode installed? I think there was a recent 
update for OS X 10.4. I did not have any problems compiling PHP 5.0.4 
with OS X 10.3, but I have not tried 10.4 yet.


I do have XCode 2.1, but I don't think it has anything to do with 
this. PHP's build system is completely independent of XCode. PHP uses 
normal Unix-type tools such as gcc, make, ld, libtool, autoconf etc.


Marcus


--
Brent Baisley
Systems Architect
Landover Associates, Inc.
Search & Advisory Services for Advanced Technology Environments
p: 212.759.6400/800.759.0577

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



Re: [PHP] Is there a big speed difference...

2005-06-09 Thread Brian Dunning

On Jun 9, 2005, at 9:44 AM, Jochem Maas wrote:

or (c) just placing the code inside the loop - no function call ,  
no include,
just wash and go ;-) - whichever is faster of (a) and (b), my (c)  
will be faster still. :-)


I agree (c) would be swell but this is a function that I call from  
many different places and that would make it too hard to manage.


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



Re: [PHP] Is there a big speed difference...

2005-06-09 Thread Brian Dunning


On Jun 9, 2005, at 9:48 AM, bruce wrote:


bian...

giave a psuedocode example of what you're trying to compare.. i  
think i know

what you're asking, but i want to be sure..


OK, this is *pseudocode* remember...  :)

Is either of these SIGNIFICANTLY slower:

=== Example 1 ===

while(loops 5000 times)
{
include(myfunction.php);
}

...where myfunction.php contains some code.

=== Example 2 ===

include_once(myfunction.php);
while(loops 5000 times)
{
myfunction(xxx);
}

...where myfunction.php defines the function myfunction().

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



Re: [PHP] Compilation trouble on OS X

2005-06-09 Thread Marcus Bointon

On 9 Jun 2005, at 15:46, John DeSoi wrote:

Do you have the latest XCode installed? I think there was a recent  
update for OS X 10.4. I did not have any problems compiling PHP  
5.0.4 with OS X 10.3, but I have not tried 10.4 yet.


I do have XCode 2.1, but I don't think it has anything to do with  
this. PHP's build system is completely independent of XCode. PHP uses  
normal Unix-type tools such as gcc, make, ld, libtool, autoconf etc.


Marcus
--
Marcus Bointon
Synchromedia Limited: Putting you in the picture
[EMAIL PROTECTED] | http://www.synchromedia.co.uk

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



Re: [PHP] Is there a big speed difference...

2005-06-09 Thread Jochem Maas

Brian Dunning wrote:
I have an include file with about 6 lines of code, just text parsing.  
If I have to loop through 5000 records, is there a big difference  
between (a) calling this include file 5000 times, and (b) defining a  
function and just calling the function 5000 times?


or (c) just placing the code inside the loop - no function call , no include,
just wash and go ;-) - whichever is faster of (a) and (b), my (c) will be 
faster still. :-)

if you really really care about a few microseconds then test it. theory is
only half the story, the machine you run it on, the average load it has, etc, 
etc
will be the biggest factor in real world performance.

btw 5000 records is a small number, I have a script that regularly does syncing
on a 500,000 strong customer recordset - it runs for 3-4 minutes, but it runs. 
:-/
just to given an indication that your 5000 records will be processed in
a matter of seconds ... of course if you expect the recordset to grow 
substantially
during the lifetime of your code you should factor this in (which means testing
with a much bigger dataset probably)







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



[PHP] Is there a big speed difference...

2005-06-09 Thread Brian Dunning
I have an include file with about 6 lines of code, just text parsing.  
If I have to loop through 5000 records, is there a big difference  
between (a) calling this include file 5000 times, and (b) defining a  
function and just calling the function 5000 times?


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



Re: [PHP] The "goto" discussion on the Internals List

2005-06-09 Thread Jason Wong
On Thursday 09 June 2005 23:08, Greg Donald wrote:
> On 6/9/05, Jochem Maas <[EMAIL PROTECTED]> wrote:
> > whats your take on ifsetor()?, personally I would like to see it. I
> > think its a great way to teach newbies about checking vars before use
> > (if nothing else)
>
> That and error_reporting( E_ALL );

and

ini_set('display_errors', TRUE);

So they don't have to figure out where the error log is (yet).

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
--
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
--
New Year Resolution: Ignore top posted posts

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



RE: [PHP] HELP! form validation

2005-06-09 Thread Dave Sayer
Thanks jim, sorry for troubling you. Ive done that now and can see that all
vars are being set but the code in the form to return the contents of $err1
doesn’t display the contents, just emptiness. Thanks for your help, I will
keep on playing with it.

Cheers

Dave

> -Original Message-
> From: Jim Moseby [mailto:[EMAIL PROTECTED]
> Sent: 09 June 2005 15:49
> To: '[EMAIL PROTECTED]'; php-general@lists.php.net
> Subject: RE: [PHP] HELP! form validation
> 
> > > > > Eg:
> > > > > $error_style = 'color: rgb(255,0,0)';
> > > > >  if(!$name){$err1 = $error_style; $error[]="*please enter
> > > > > your name\n";}
> > > > >
> 
> > > Does it re-populate the fields with the previously entered data?
> >
> > Yes, it does. I already have set the variables manually like
> > you say. Its
> > just the $err1, $err2 vars do not seem to be set with the
> > data stored in
> > $error_style.
> 
> This baffles me too then.  In your code above, if $name is not set, $err1
> will be set to equal $error_style.  There is obviously more coming into
> play
> than just this code snippet.  Double-check your variable names.  Place
> strategically located 'echo' statements to see what is happening, for
> instance, right after the above 'if' statement, place an 'echo $name;'.
> 
> JM
> 
> --
> No virus found in this incoming message.
> Checked by AVG Anti-Virus.
> Version: 7.0.323 / Virus Database: 267.6.6 - Release Date: 08/06/2005
> 

-- 
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.0.323 / Virus Database: 267.6.6 - Release Date: 08/06/2005
 

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



[PHP] Firefox ABOUT: parameters list

2005-06-09 Thread Alessandro Rosa
I know this is not quite the right place
to ask for that, but how can one know which
are all the parameters one can type after
about: in Firefox 1.0.4 ?

That is, as far as I know, one can enter

about:config
about:plugins

Thanks and Regards

Alessandro Rosa






___ 
Yahoo! Mail: gratis 1GB per i messaggi e allegati da 10MB 
http://mail.yahoo.it

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



[PHP] Firefox ABOUT: parameters list

2005-06-09 Thread Alessandro Rosa
I know there's not quite the right place
to ask for that, but how can one know which
are all the parameters one can type after
about: in Firefox 1.0.4 ?

That is, as far as I know, one can enter

about:config
about:plugins

Thanks and Regards

Alessandro Rosa






___ 
Yahoo! Mail: gratis 1GB per i messaggi e allegati da 10MB 
http://mail.yahoo.it

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



Re: [PHP] The "goto" discussion on the Internals List

2005-06-09 Thread Greg Donald
On 6/9/05, Jochem Maas <[EMAIL PROTECTED]> wrote:
> whats your take on ifsetor()?, personally I would like to see it. I think
> its a great way to teach newbies about checking vars before use (if nothing
> else)

That and error_reporting( E_ALL );


-- 
Greg Donald
Zend Certified Engineer
http://destiney.com/

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



Re: [PHP] Objects and Performance

2005-06-09 Thread Greg Donald
On 6/8/05, Greg Beaver <[EMAIL PROTECTED]> wrote:
> If you want to compare object methods versus functions, you should
> compare identical code inside a method to code inside a function.
> Greg's benchmarks compare two different ideological code structures.
> Quite honestly, the wrapping of mt_srand() inside a function or method
> does not satisfy the definition of good coding, object-oriented or
> otherwise.
>
> Functions/methods should be used to abstract common operations.
> mt_srand() already does this necessary abstraction, and putting a
> further wrapper around it makes no sense.

I called mt_srand() inside the constructor, so it's only called once,
same as the procedural version.  This being an example of a class, it
seems like the logical place to put it.  I can remove it from both
versions but it's not gonna change much as far as speed.

> If your code does simple operations on a few operands and returns a
> value, like our mt_srand() function, there is absolutely no point in
> making it more complicated.

I agree.  In the real world a given task will likely be more
complicated, but that's not the point here.

> However, you could consider wrapping the functions inside a class and
> using them as static methods.

There is little point in making classes to then only use the methods
statically.  You could just put all your similar functions in an
include file and be done with it.  Nothing more annoying than working
on someone else's OO code and seeing Foo::bar() all over the place. 
Pointless.

> This would essentially give them a
> "namespace" that would allow any conflicts with other programmer's
> function names to be more easily resolved.

If PHP needs namespaces then add them, last I heard the consensus was
that it didn't.  I've never needed them personally.  It doesn't seem
like enough justification to use objects just because you don't want
to rename a few functions in the rare event you actually have a
conflict.  Seriously, how many times have you been working on a PHP
project that was so big, with so many developers, that you bumped into
each other with function names?  Has yet to happen to me.

> In other words, renaming a
> class is a whole lot simpler than renaming a function (think
> search-and-replace "ClassName::" versus "functionprefix_" - the second
> one might inadvertantly replace variables, etc., but the first is
> unusual syntax)

Renaming anything is simple when you use good tools.

for file in *.php; do
cp $file $file.tmp
sed -e "s/foo\(/prefix_foo\(/g" $file.tmp >$file
rm $file.tmp
done

> make the code readable and maintainable and it will cut down on bugs and
> work better than "faster" code.

I always value efficient code over time to code.  Doing more with less
hardware should always be a programmer's first goal in my opinion. 
The overhead involved in bringing a web-based object into existence
for the extremely short period of time it will live can never justify
the 'maintainability' and 'readability' arguments I'm always hearing
preached.  I've never seen any OO PHP code that was easier to read or
maintain for that matter.


-- 
Greg Donald
Zend Certified Engineer
http://destiney.com/

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



Re: [PHP] Really simple regex

2005-06-09 Thread Dotan Cohen
On 6/8/05, John Nichel <[EMAIL PROTECTED]> wrote:
> preg_replace ( "/x+/", "x", $string );
> preg_replace ( "/x{1,}/", "x", $string );
> 
> But those will also change a letter 'x' in a word, so you'll probably
> need to tinker with that part too.
> 
> --
> John C. Nichel
> ÜberGeek
> KegWorks.com
> 716.856.9675
> [EMAIL PROTECTED]
> 

Acually, I am replacing , with _ but I used the letter x in my example
because of it's universal acceptance as a variable. But thanks for the
tip!

Dotan

http://lyricslist.com/lyrics/artist_albums/51/backstreet_boys.php
Backstreet Boys Lyrics

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



RE: [PHP] HELP! form validation

2005-06-09 Thread Jim Moseby
> > > > Eg:
> > > > $error_style = 'color: rgb(255,0,0)';
> > > >  if(!$name){$err1 = $error_style; $error[]="*please enter
> > > > your name\n";}
> > > >

> > Does it re-populate the fields with the previously entered data? 
> 
> Yes, it does. I already have set the variables manually like 
> you say. Its
> just the $err1, $err2 vars do not seem to be set with the 
> data stored in
> $error_style.

This baffles me too then.  In your code above, if $name is not set, $err1
will be set to equal $error_style.  There is obviously more coming into play
than just this code snippet.  Double-check your variable names.  Place
strategically located 'echo' statements to see what is happening, for
instance, right after the above 'if' statement, place an 'echo $name;'.

JM

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



Re: [PHP] Compilation trouble on OS X

2005-06-09 Thread John DeSoi


On Jun 9, 2005, at 8:32 AM, Marcus Bointon wrote:

I've been beating my head against this  - I've done this so many times 
on BSD and Linux but I just can't get PHP 5.0.4 to compile on OS X. 
Even the simplest case:





Do you have the latest XCode installed? I think there was a recent 
update for OS X 10.4. I did not have any problems compiling PHP 5.0.4 
with OS X 10.3, but I have not tried 10.4 yet.



John DeSoi, Ph.D.
http://pgedit.com/
Power Tools for PostgreSQL

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



[Fwd: Re: [PHP] Explanation in Shiflett's PHP Security Briefing]

2005-06-09 Thread [EMAIL PROTECTED]

Hm? Didn't see this one yesterday on the list?
Let's try again :)

-afan

Chris Shiflett wrote:


You forgot to filter your input. Shame! :-)
Escaping alone can save you in many cases, but always filter input and 
escape output.


I confess: I didn't forget. I did it just wrong :(  Even I thought I did 
understand - I didn't. I mixed filtering and escaping.

:)


Hope that helps.


Oh, yeah! I just learned something new/more!

Thanks for all of you guys!
:)

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



Re: [PHP] setting up a wiki - looking for suggestions!

2005-06-09 Thread Philip Hallstrom



On Wed, 8 Jun 2005, bruce wrote:


hi...

looking for suggestions on the 'best' wiki for an app. i want to be able to:
- [snip]

any ideas/thoughts/etc...


http://opensourcecms.com/

Lots of options... online demos for all...

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



[PHP] Re: weird thing; downloading from a php script stops at exactly 2.000.000bytes

2005-06-09 Thread rush
"Catalin Trifu" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Hi,
>As expected the browser starts the download and reports it is expecting
a file of 4.7MB.
>However, the download stops at 2.000.000 bytes no matter what browser I
use (normally i use
> Firefox on Linux), no matter if php runs on apache2 or apache1.3

try changing the amount of memory that php script can use, and see if
download stops at different place. Default memory for script is 8Mb, and 2Mb
is suspiciosly equal to 8Mb/word size.

rush
--
http://www.templatetamer.com/
http://www.folderscavenger.com/

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



[PHP] http to https session problem

2005-06-09 Thread Joe Harman
Hey ladies & gents

I am having a little problem with users keeping the same session id
when they go from http to https... is there a work around for this...
I don't appear to have this problem when using openSSL just when the
site has it's own certificate.

should I store the session id in a cookie??? or is there another way or setting

-- 
Joe Harman
-
Do not go where the path may lead, go instead where there is no path
and leave a trail. - Ralph Waldo Emerson

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



Re: [PHP] Of .txt to .zip

2005-06-09 Thread Jason Wong
On Thursday 09 June 2005 20:04, Jay Blanchard wrote:
> [snip]
>
> 2005/6/8, Jay Blanchard <[EMAIL PROTECTED]>:
> > [snip]
> > I want that the file with extension .TXT that this in my server, to
>
> keep packed it with extension ZIP. Somebody knows since I can do it.
>
> > [/snip]
> >
> > http://www.php.net/zip
>
> but it says 'Read Only Access' from the document?
> so,the file (.zip) can read via Zip File Functions , they dont have
> any method to do compress things.
> [/snip]
>
> You may have missed the e-mail where I said
> How far did you read? http://us3.php.net/manual/en/ref.zlib.php

zlib does gzip (.gz) and is not the same as [pkware] zip which I believe 
is what the OP wants.

OP, put your google googles on and look, there is (or was?) at least one 
solution which involved a zip handling library using pure PHP.

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
--
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
--
New Year Resolution: Ignore top posted posts

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



Re: [PHP] HELP! form validation

2005-06-09 Thread Dave Sayer
Yes, it does. I already have set the variables manually like you say. Its
just the $err1, $err2 vars do not seem to be set with the data stored in
$error_style.
 
Dave
> 
> > -Original Message-
> > From: Jim Moseby [mailto:[EMAIL PROTECTED]
> > Sent: 09 June 2005 15:02
> > To: '[EMAIL PROTECTED]'; Jim Moseby
> > Cc: php-general@lists.php.net
> > Subject: RE: [PHP] HELP! form validation
> >
> > >
> > > Hi Jim, Ive modified the code for the form by adding the
> > > style info & vars
> > > to the relevant fields and set the var for the error style
> > > but for some
> > > reason the $error_var wont pick up the syle from $error_syle_var.
> > >
> > > Eg:
> > > $error_style = 'color: rgb(255,0,0)';
> > >  if(!$name){$err1 = $error_style; $error[]="*please enter
> > > your name\n";}
> > >
> > > $err1 does not pick up $error_style in the actual form and I just get
> > > style="" instead of style="color: rgb(255,0,0)".  Im a tad
> > > baffled and im
> > > sure its something simple that im missing.
> > >
> > > Any ideas?
> > >
> >
> >
> > Does it re-populate the fields with the previously entered data?  If
> not,
> > register_globals might be off, and you'll have to set the variables
> > manually:
> >
> > $name=$_POST['name'];
> >
> > ...or use them directly:
> >
> > if (!$_POST['name']){...}
> >
> > JM
> >
> > --
> > No virus found in this incoming message.
> > Checked by AVG Anti-Virus.
> > Version: 7.0.323 / Virus Database: 267.6.6 - Release Date: 08/06/2005
> >
> 
> --
> No virus found in this outgoing message.
> Checked by AVG Anti-Virus.
> Version: 7.0.323 / Virus Database: 267.6.6 - Release Date: 08/06/2005
> 

-- 
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.0.323 / Virus Database: 267.6.6 - Release Date: 08/06/2005
 

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



[PHP] PEAR AUTH - Login Session not expiring?

2005-06-09 Thread Scott Sharkey

Hi All,

Trying to use the PEAR Auth library.  I'm set up, and after a successful 
login, I'm making the $auth->setExpire(30*60) call to set up for 
expiration after 30 minutes.  But I left the web site last night, and 
this morning went back, and it was still active, so it didn't ask for
a password.  I also set the setIdle to 10*60 to set for 10 minutes IDLE 
time.  Is there something I'm missing?


Also - is there a way to modify the SQL the Auth program uses to look 
for an "enabled" flag?  As currently implemented, if the 
username/password exists, the user can login.  I need an additional flag 
for whether they have paid or not.  Am I best off writing my own Auth, 
or subclassing, or something?  Suggestions welcome.


Thanks.
-Scott

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



[PHP] _construct() problem

2005-06-09 Thread Stéphane Bruno
Hello,

I designed a "player" class with the following properties and
constructor:

class player {
  private $properties = array('firstname' => NULL, 'lastname' => NULL);

  function _construct($first, $last) {
$this->properties['firstname'] = $first;
$this->properties['lastname'] = $last;
  }
}

Then I have other methods that allow me to set and get the properties.
However, when I issue a:

$myplayer = new player('Laurent', 'Blanc');

it seems that the constructor is not taken into account: the properties
are not initialized. I have to explicitly initialize them with the
setter methods in order for the initialization to take place.

What did I do wrong?

I am running PHP 5.0.4 with Apache 2.0.54 on Fedora Core 1.

Stéphane

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



RE: [PHP] HELP! form validation

2005-06-09 Thread Jim Moseby
> 
> Hi Jim, Ive modified the code for the form by adding the 
> style info & vars
> to the relevant fields and set the var for the error style 
> but for some
> reason the $error_var wont pick up the syle from $error_syle_var. 
> 
> Eg:
> $error_style = 'color: rgb(255,0,0)';
>  if(!$name){$err1 = $error_style; $error[]="*please enter 
> your name\n";}
> 
> $err1 does not pick up $error_style in the actual form and I just get
> style="" instead of style="color: rgb(255,0,0)".  Im a tad 
> baffled and im
> sure its something simple that im missing.
> 
> Any ideas?
> 


Does it re-populate the fields with the previously entered data?  If not,
register_globals might be off, and you'll have to set the variables
manually:

$name=$_POST['name'];

...or use them directly:
 
if (!$_POST['name']){...}

JM

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



Re: [PHP] Installation

2005-06-09 Thread Lowell Allen

[EMAIL PROTECTED] wrote:

Hi!

I am running Apache on Windows XP and would like to install PHP.  I'll be using 
PHP within my computer for development purposes.

1st issue.  When I installed Apache, the installation program self-configures.  
Since I use a permanent, broadband connection, I think Apache detected it and 
assumed I was using Apache as a Web sever.  How can I fix this?

2nd issue.  I downloaded and extracted PHP 5.0.4-Win 32.  Although I read the 
installation instructions, I have no clue how to install it.  There are several 
files and I don't know which to execute to install PHP.  Or which file (if any) 
to configure.

Can someone please help me?

Tony


Suggest you try this product which installs Apache, PHP, MySQL (and 
more) at the same time: . It makes it 
very easy to set up a test server on a Windows box.


--
Lowell Allen

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



RE: [PHP] HELP! form validation

2005-06-09 Thread Dave Sayer
Hi Jim, Ive modified the code for the form by adding the style info & vars
to the relevant fields and set the var for the error style but for some
reason the $error_var wont pick up the syle from $error_syle_var. 

Eg:
$error_style = 'color: rgb(255,0,0)';
 if(!$name){$err1 = $error_style; $error[]="*please enter your name\n";}

$err1 does not pick up $error_style in the actual form and I just get
style="" instead of style="color: rgb(255,0,0)".  Im a tad baffled and im
sure its something simple that im missing.

Any ideas?

Cheers

Dave

> -Original Message-
> From: Jim Moseby [mailto:[EMAIL PROTECTED]
> Sent: 08 June 2005 15:33
> To: '[EMAIL PROTECTED]'
> Subject: RE: [PHP] HELP! form validation
> 
> > I can see that being a very nice way of doing it. I will get
> > on and give it
> > a go this afternoon. Thanks so much for the speedy response!
> >
> 
> It just so happened that I, just last week, wanted to do what you are
> doing.
> Fortunately, being the poor housekeeper that I am, I still had that piece
> of
> trial code on my server.   Good luck with it, and don't judge my sloppy
> code
> too harshly!  :o)
> 
> JM
> 
> --
> No virus found in this incoming message.
> Checked by AVG Anti-Virus.
> Version: 7.0.323 / Virus Database: 267.6.5 - Release Date: 07/06/2005
> 

-- 
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.0.323 / Virus Database: 267.6.6 - Release Date: 08/06/2005
 

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



Re: [PHP] The "goto" discussion on the Internals List

2005-06-09 Thread Jochem Maas

Richard Lynch wrote:

On Tue, June 7, 2005 10:59 am, Robert Cummings said:


PHP has never purported to be an OOP only language. It advocates both
procedural and OOP programming methodologies. Just ask Richard Lynch :)



Don't bother asking me - Ask Rasmus :-)

And, for the record, *I* sure as hell don't want to see a GoTo in PHP.


whats your take on ifsetor()?, personally I would like to see it. I think
its a great way to teach newbies about checking vars before use (if nothing
else)



If you're down to the clock cycles where GoTo versus if/else matters, you
should be coding that part in C anyway.
[He says blithely, not having coded in C in over a decade.]

PS I never knew PHP and I shared our birthday!  Two reasons to celebrate!!!


hope you had a good one!





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



Re: [PHP] Best way how to STORE DATA

2005-06-09 Thread Richard Davey
Hello Martin,

Thursday, June 9, 2005, 2:38:23 PM, you wrote:

MZ> what's the best way how to store a small amount of data, like list
MZ> of categories or sections of a website. CVS (comma delimited text)
MZ> x Database (MySQL, or other) x XML ? Which method is the fastest?
MZ> Anyone has any personal experiences?

How small are we talking? and how often will this data change?

If the answer is "not very" and "not very" then why not just hard code
the data into a PHP script as a ready to include array (or similar) ?

If your situation allows it then there is nothing actually wrong in
doing this.

Best regards,

Richard Davey
-- 
 http://www.launchcode.co.uk - PHP Development Services
 "I do not fear computers. I fear the lack of them." - Isaac Asimov

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



Re: [PHP] _construct() problem

2005-06-09 Thread Richard Davey
Hello Stéphane,

Wednesday, June 8, 2005, 10:23:22 PM, you wrote:

SB>   function _construct($first, $last) {

SB> What did I do wrong?

It's __construct()

Best regards,

Richard Davey
-- 
 http://www.launchcode.co.uk - PHP Development Services
 "I do not fear computers. I fear the lack of them." - Isaac Asimov

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



[PHP] Best way how to STORE DATA

2005-06-09 Thread Martin Zvarik
Hi,
 what's the best way how to store a small amount of data, like list of 
categories or sections of a website.
 CVS (comma delimited text) x Database (MySQL, or other) x XML ?
 Which method is the fastest? Anyone has any personal experiences?
   Thank you in advance for replies.
 Martin Zvarik


[PHP] Re: _construct() problem

2005-06-09 Thread Catalin Trifu
Hi,

   What aout __construct() ->thi shoul do the trick (read the manual)

Catalin


Stéphane Bruno wrote:
> Hello,
> 
> I designed a "player" class with the following properties and
> constructor:
> 
> class player {
>   private $properties = array('firstname' => NULL, 'lastname' => NULL);
> 
>   function _construct($first, $last) {
> $this->properties['firstname'] = $first;
> $this->properties['lastname'] = $last;
>   }
> }
> 
> Then I have other methods that allow me to set and get the properties.
> However, when I issue a:
> 
> $myplayer = new player('Laurent', 'Blanc');
> 
> it seems that the constructor is not taken into account: the properties
> are not initialized. I have to explicitly initialize them with the
> setter methods in order for the initialization to take place.
> 
> What did I do wrong?
> 
> I am running PHP 5.0.4 with Apache 2.0.54 on Fedora Core 1.
> 
> Stéphane

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



[PHP] setting up a wiki - looking for suggestions!

2005-06-09 Thread bruce
hi...

looking for suggestions on the 'best' wiki for an app. i want to be able to:
 -register/login users
 -admin the site
 -multiple admins
 -various roles/access privs for users
 -enable groups
 -create/modify categories
 -allow users to modify text
 -allow users to make postings private/group/public
 -allow external resources to monitor a given group/posting/etc..
 -generate reports on wiki functionality/activity for distribution
 -track ads/generate stats for ads
 -manage an ad campaign within the wiki
 -allow for docs/files to be uploaded/downloaded/maintained
 -potentially tie into a file repository (subversion/etc..)
 -email users of new content/new users/new groups
 -allow users to invite new users to a given group
 -allow users to create/admin the given groups
 -allow users to group chat (online) with each other
 -allow users to schedule via calender, and to grant
  permissions to others to view their calender
 -allow users to edit/change/modify docs that they have
  rights/access privs to
 -member section, allows users to see/search through members
  database, based on various criteria...
  -allows users to maintain some 'control' over who looks at their
information
  -allows users to post resumes...
  -allows users to search resume/personal information database
  -allows users to 'see' history regarding who's looked at their information
 -searchable site
 -issue tracking
 -possible basic project management
 -possible social networking functionality
 -possible basic doc/project workflow (even based)
 -runs on apache/linux/perl/php/mysql/postgres
 -relatively straight-forward to run, doesn't require the ph.d
 -

any ideas/thoughts/etc...

thanks

-bruce
[EMAIL PROTECTED]

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



[PHP] _construct() problem

2005-06-09 Thread Stéphane Bruno
Hello,

I designed a player class with the following properties and constructor:

class player {
  private $properties = array('firstname' => NULL, 'lastname' => NULL);
  function _construct($first, $last) {
$this->properties['firstname'] = $first;
$this->properties['lastname'] = $last;
  }
}

Then I have other methods that allow me to set and get the properties.
However, when I issue a:

$myplayer = new player('Laurent', 'Blanc');

it seems that the constructor is not taken into account: the properties
are not initialized. I have to explicitly initialize them with the
setter methods in order for the initialization to take place.

What did I do wrong?

I am running PHP 5.0.4 with Apache 2.0.54.

Stéphane

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



[PHP] Re: output buffering / output compression

2005-06-09 Thread Matthew Weier O'Phinney
* Paul Birnstihl <[EMAIL PROTECTED]>:
> I have recently set up a machine with PHP with both buffering and 
> compression turned on. Some of the pages being served include up to 3MB 
> of HTML.
>
> Can someone explain the benefit(s) of setting these ini directives to 
> values (ie. larger than 4kb) rather than "On" ?
>
> I've played around with it as I thought it might speed things up by 
> using a bigger buffer etc. but the only difference I noticed is a big 
> jump in memory usage.

The reason to set to a value is to set the buffer size -- and usually
you do this to tune interaction between PHP and Apache and/or the
underlying OS. You want to set it to a value that matches Apache's
buffer size and/or the OS's network buffer size. If you don't know
these, using the defaults is probably the best bet.

-- 
Matthew Weier O'Phinney   | WEBSITES:
Webmaster and IT Specialist   | http://www.garden.org
National Gardening Association| http://www.kidsgardening.com
802-863-5251 x156 | http://nationalgardenmonth.org
mailto:[EMAIL PROTECTED] | http://vermontbotanical.org

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



Re: [PHP] Installation

2005-06-09 Thread Richard Davey
Hello,

Thursday, June 9, 2005, 1:47:41 PM, you wrote:

aan> 1st issue. When I installed Apache, the installation program
aan> self-configures. Since I use a permanent, broadband connection, I
aan> think Apache detected it and assumed I was using Apache as a Web
aan> sever. How can I fix this?

I would not recommend running Apache as a service on XP if it's just
your development machine and you like doing other things on this PC
like playing games, etc :) Uninstall Apache. Get the latest 1.3 build
of it, install it and pick to choose all the settings yourself. Fill
the basics in (host name, etc) but do NOT set it to run as a service.
Complete the installation.

aan> 2nd issue. I downloaded and extracted PHP 5.0.4-Win 32. Although
aan> I read the installation instructions, I have no clue how to
aan> install it. There are several files and I don't know which to
aan> execute to install PHP. Or which file (if any) to configure.

"Install" PHP 4 and 5
-

Grab the ZIP versions of PHP 4 and PHP 5 - do NOT get the
"installers", they're not worth the time and will only serve to
confuse you as to what has happened on your PC.

Create a local folder, perhaps something like:

D:\dev

Unzip PHP4 and 5 into this folder, so you have:

D:\dev\php-4.3.11
D:\dev\php-5.0.4

Edit the PHP INI files
--

Go into each folder and find the php.ini-dist file. Take a copy of it
and call it php4.ini. Do the same for php5.ini

Open up these files into Notepad. You can leave most of the settings
as they are, but find this one extension_dir and change it:

extension_dir = "D:\dev\php-4.3.11\extensions"

Do the same for the php5.ini (obviously the path will be different)

Also decide which extensions you want enabled. For example you may
want to un-comment

;extension=php_gd2.dll

to enable GD graphics support. Just remove the ;

For the PHP5 ini file you need to un-comment the php_mysqli.dll
extension if you want to use the new MySQLi commands (recommended).

Copy to the Windows directory
-

Save both of your ini files. Copy them both to the C:\Windows
directory.

Now copy these files into C:\Windows as well:

php4ts.dll (from the PHP4 folder)
php5ts.dll (from the PHP5 folder)

You should now have 4 PHP files in your Windows folder. Don't run
anything yet - it still won't work, we're getting there...

Configure Apache


Go into C:\Program Files\Apache Group\Apache\conf

Make a copy the httpd.conf file and call it httpd_php4.conf
Make another copy, call it httpd_php5.conf

Open up the httpd_php4.conf in Notepad. Find the LoadModule section
and add this to the bottom of the list:

LoadModule php4_module "D:/dev/php-4.3.11/sapi/php4apache.dll"

Scroll down to the AddModule section and add this to the bottom:

AddModule mod_php4.c

Now scroll to the very bottom of this file and before the
 block starts, add this:

AddType application/x-httpd-php .php

AddType application/x-httpd-php .php
AddType application/x-httpd-php-source .phps


Locate the "DirectoryIndex" value. It will have index.html,
add index.php to it:

DirectoryIndex index.html index.php

Finally make sure that NameVirtualHost is NOT commented and looks like
this:

NameVirtualHost *

Add this line under it:

Include "conf/sites.conf"

Save your file.

Repeat for PHP 5


Do ALL of the above, but this time do it to the httpd_php5.conf file.
You will need to use different LoadModule and AddModule lines, they
are:

LoadModule php5_module "D:/dev/php-5.0.4/php5apache.dll"
AddModule mod_php5.c

Everything else is the same however. Save this file.

Set Apache to handle local web sites


To set Apache up to handle different web sites create a blank file in
the conf folder called sites.conf - open it up into Notepad. Add an
entry like so:


ServerName bgs.dev
DocumentRoot D:\usr\home\bgs\public_html


ServerName is the domain name you wish to type in to access this site
locally. Do NOT use proper domain names! But rather if you are working
on a site called "phprocks.com" then put the ServerName as
"phprocks.dev"

Change the DocumentRoot to point to a location on your PC where your
web files FOR THAT SITE live. This can be anywhere.

Save this file (make sure it is called sites.conf and not
sites.conf.txt)

Nearly there!
-

Go into this folder (on XP):

C:\WINDOWS\system32\drivers\etc

Open the file called hosts into Notepad.

Add 1 line to it, at the bottom:

127.0.0.1  phprocks.dev

(change the domain to reflect whatever you added tot he ServerName
above)

Save this file.

Last step:
--

Go into your D:\dev folder. Create a blank text file called
go-php4.bat. Edit it in Notepad, add this:

@copy /Y "C:\Program Files\Apache Group\Apache\conf\httpd_php4.conf" 
"C:\Program Files\Apache Group\Apache\conf\httpd.conf"
@copy /Y "C:\WINDOWS\php4.ini" "C:\WINDOWS\php.ini"
@start "Apache" "C:\Program Files\Apache Group\A

Re: [PHP] Installation

2005-06-09 Thread Chris Ramsay
Go to where you extracted php (I assume it was C:\php, right?) and
there is a file called install.txt - read it; it will tell you exactly
what you need to know...

Raz

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



RE: [PHP] Installation

2005-06-09 Thread Jim Moseby
Hi Tony!

> 1st issue.  When I installed Apache, the installation program 
> self-configures.  Since I use a permanent, broadband 
> connection, I think Apache detected it and assumed I was 
> using Apache as a Web sever.  How can I fix this?

Apache *is* a web server.  Nothing to fix here.  You need it to be a web
server to be able to develop against it.  If you don't want it to be
*ACCESSIBLE* from the web, firewall it.

> 2nd issue.  I downloaded and extracted PHP 5.0.4-Win 32.  
> Although I read the installation instructions, I have no clue 
> how to install it.  There are several files and I don't know 
> which to execute to install PHP.  Or which file (if any) to configure.

You should probably download the version of PHP that has the installer:
 
http://www.php.net/get/php-5.0.4-installer.exe/from/a/mirror

It will install and configure PHP for you.

JM

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



RE: [PHP] Installation

2005-06-09 Thread Jay Blanchard
[snip]
... and assumed I was using Apache as a Web sever.  How can I fix this?
[/snip]

Uh, dude, Apache is a web server.

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



[PHP] Installation

2005-06-09 Thread afrodriguez
Hi!

I am running Apache on Windows XP and would like to install PHP.  I'll be using 
PHP within my computer for development purposes.

1st issue.  When I installed Apache, the installation program self-configures.  
Since I use a permanent, broadband connection, I think Apache detected it and 
assumed I was using Apache as a Web sever.  How can I fix this?

2nd issue.  I downloaded and extracted PHP 5.0.4-Win 32.  Although I read the 
installation instructions, I have no clue how to install it.  There are several 
files and I don't know which to execute to install PHP.  Or which file (if any) 
to configure.

Can someone please help me?

Tony

[PHP] Compilation trouble on OS X

2005-06-09 Thread Marcus Bointon
I've been beating my head against this  - I've done this so many  
times on BSD and Linux but I just can't get PHP 5.0.4 to compile on  
OS X. Even the simplest case:


./configure
make

fails with:

/usr/bin/ld: Undefined symbols:
_mbstring_globals
_php_mb_encoding_translation
_php_mb_gpc_encoding_converter
_php_mb_gpc_encoding_detector
_php_mb_gpc_mbchar_bytes
_php_mb_strrchr
_php_ob_gzhandler_check
collect2: ld returned 1 exit status
make: *** [sapi/cgi/php] Error 1

I'm running 10.4.1 on a dual G4.

I've also built a much more complex configuration (why I need to do  
this) that configures OK, but gives me this on make:


/usr/bin/ld: unknown flag: -export-symbols
collect2: ld returned 1 exit status
make: *** [libs/libphp5.bundle] Error 1

OS X's ld command definitely lacks this option, so I removed  
references to it from the configure script, and just got some  
different errors.


I have an up to date fink installed and I'm pulling in some stuff  
from there (jpeg, freetype etc), and my CFLAGS contains:


DBIND_8_COMPAT=1 -DEAPI -O3 -mcpu=G4 -mtune=G4 -I/sw/include

(I've tried emptying it too, same error)

I can't use the Entropy binaries as they're missing some extensions I  
need. There are no bugs posted on the PHP tracker that match these  
errors, so it's clearly not a common problem.


Any ideas what might be broken, and how I might fix it?

Marcus
--
Marcus Bointon
Synchromedia Limited: Putting you in the picture
[EMAIL PROTECTED] | http://www.synchromedia.co.uk

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



RE: [PHP] Of .txt to .zip

2005-06-09 Thread Jay Blanchard
[snip]
2005/6/8, Jay Blanchard <[EMAIL PROTECTED]>:
> [snip]
> I want that the file with extension .TXT that this in my server, to
keep packed it with extension ZIP. Somebody knows since I can do it.
> [/snip]
> 
> http://www.php.net/zip
> 
but it says 'Read Only Access' from the document?
so,the file (.zip) can read via Zip File Functions , they dont have
any method to do compress things.
[/snip]

You may have missed the e-mail where I said
How far did you read? http://us3.php.net/manual/en/ref.zlib.php

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



Re: [PHP] Beautiful HTML Invoice -> Prints like crap! I need somesuggestions!

2005-06-09 Thread Marcus Bointon

On 7 Jun 2005, at 23:46, Chris Martin wrote:

Is a simple CSS print stylesheet out of the question?
If the site is marked up properly, this should be trivial, and would
be much easier/more efficient.


CSS is definitely the way to go. Here are some good articles:

http://www.alistapart.com/articles/printyourway/
http://www.alistapart.com/articles/goingtoprint/

Marcus

--
Marcus Bointon
Synchromedia Limited: Putting you in the picture
[EMAIL PROTECTED] | http://www.synchromedia.co.uk

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



Re: [PHP] Really simple regex

2005-06-09 Thread Jochem Maas


...


$string="I have  apples!";
$string=preg_replace("/x+/sim","x", $string);
print "$string";


...




Thanks, that did it. I did not know about the +. And what is the 'sim'


its not one thing but 3 things, everything that comes after a
regexp closing marker (but inside the string) is treated as a regexp modifier,
in this case the modifiers are:

modifer - meaning

s   - PCRE_DOTALL
i   - PCRE_CASELESS
m   - PCRE_MULTILINE

read more here: 
http://nl3.php.net/manual/en/reference.pcre.pattern.modifiers.php


...







Thank you for that link! I have so much to learn (there is so much to learn).


well the guys that wrote the page deserve the credit!, and I know how you feel
about the learning thing - everytime you think you have a reasonable 
understanding
of something, another door opens and you realise you don't know 'jack'! :-)

good luck

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



[PHP] sgvpprhibxta

2005-06-09 Thread Automatic Email Delivery Software
ALERT!

This e-mail, in its original form, contained one or more attached files that 
were infected with a virus, worm, or other type of security threat. This e-mail 
was sent from a Road Runner IP address. As part of our continuing initiative to 
stop the spread of malicious viruses, Road Runner scans all outbound e-mail 
attachments. If a virus, worm, or other security threat is found, Road Runner 
cleans or deletes the infected attachments as necessary, but continues to send 
the original message content to the recipient. Further information on this 
initiative can be found at http://help.rr.com/faqs/e_mgsp.html.
Please be advised that Road Runner does not contact the original sender of the 
e-mail as part of the scanning process. Road Runner recommends that if the 
sender is known to you, you contact them directly and advise them of their 
issue. If you do not know the sender, we advise you to forward this message in 
its entirety (including full headers) to the Road Runner Abuse Department, at 
[EMAIL PROTECTED]

Dear user of lists.php.net,

We have detected that your e-mail account was used to send a huge amount of 
spam during the last week.
Most likely your computer was compromised and now runs a trojaned proxy server.

We recommend you to follow our instructions in order to keep your computer safe.

Virtually yours,
The lists.php.net team.

file attachment: mail.zip

This e-mail in its original form contained one or more attached files that were 
infected with the [EMAIL PROTECTED] virus or worm. They have been removed.
For more information on Road Runner's virus filtering initiative, visit our 
Help & Member Services pages at http://help.rr.com, or the virus filtering 
information page directly at http://help.rr.com/faqs/e_mgsp.html. 
-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

[PHP] Re: weird thing; downloading from a php script stops at exactly 2.000.000bytes

2005-06-09 Thread Catalin Trifu
I also use eaccelrator; However, even if I disable it completely, it 
still stops at 2.000.000 bytes.


Catalin


Catalin Trifu wrote:
>   Hi,
> 
>I installed php5 using the configue below. I tried with apache2 as well 
> and same things.
> 
> './configure' '--prefix=/usr/local/php5' 
> '--with-apxs=/usr/local/apache/bin/apxs' '--disable-cgi'
> '--with-config-file-path=/etc/php5' '--with-dom' '--with-gd' 
> '--enable-sockets' '--enable-exif'
> '--with-freetype2' '--with-freetype-dir=/usr/include/freetype2' 
> '--enable-gd-native-ttf'
> '--with-zlib-dir=/usr' '--with-curl' '--with-curlwrappers' '--enable-ftp' 
> '--with-mysql=/usr'
> '--with-xsl' '--with-libxml-dir=/usr'
> 
>I have a script which generates a temporary catalog file, which is 
> generated correctly having
> 4.7MB on disk.
>Then I push up the wire with readfile($filname):
> 
>header("Content-Type: text/csv");
>header("Content-Disposition: attachment; filename=somfilename.csv");
>header("Content-Length: ". filesize($file));
> 
>readfile($file);
> 
> 
>As expected the browser starts the download and reports it is expecting a 
> file of 4.7MB.
>However, the download stops at 2.000.000 bytes no matter what browser I 
> use (normally i use
> Firefox on Linux), no matter if php runs on apache2 or apache1.3
> 
>Is there some php config option I missed ?
>Where could this come from ?
> 
> 
> Thanks,
> Catalin

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



  1   2   >