[PHP] simple terms

2004-12-17 Thread Jason Wydro
i would like to better understand pear. is there some ver basic doc that
you know of?
 
---

Jason Wydro

voice: 727 489 2684

fax: 727 489 7422

email: [EMAIL PROTECTED]

web:   www.jasonwydro.com

-

 


答复: [PHP] Re: upload file warning

2004-12-17 Thread yangshiqi
All right.
I know that it exactly does what it is, and can't be really caught directly
since this happens before the script gets control.
After display_errors = off, I can pick it up from error logs.

Thanks all.

-邮件原件-
发件人: M. Sokolewicz [mailto:[EMAIL PROTECTED] 
发送时间: 2004年12月17日 14:48
收件人: [EMAIL PROTECTED]
主题: [PHP] Re: upload file warning

Yangshiqi wrote:
> I got a php waring when I upload my file:
> 
>  
> 
> Warning: MAX_FILE_SIZE of 20 bytes exceeded - file
[imgpath=mz-n10.pdf]
> not saved in Unknown on line 0
> 
that seems like a very descriptive warning to me...
>  
> 
>  
> 
> In the form I write like these:
> 
>  
> 
> 
yes... this is where you did put it...
> 
> 
>  
> 
> And my configuration is :
> 
>  
> 
> file_uploads = on
> 
> upload_max_filesize = 4M
> 
> upload_tmp_dir = /tmp
> 
>  
> 
> so, what 's wrong? 
what do you *think* is wrong :| I mean... just *read* the warning :S
And can I catch the exceeded file error before it is
> passed back to the client?
a) it's checked for size and discarded immediately
b) the file is never passed 'back' to the client. It just disappears 
into the abyss that is /dev/null
> 
>  
> 
>  
> 
> Best wishes.
> 
>  
> 
> yangshiqi
> 
>  
> 
>  
> 
>  
> 
> 

-- 
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] File-handling

2004-12-17 Thread gustav
Hi there!

Can someone explain the major difference between fgets and fopen? Which is
the best together with plain textfiles? and why?

eof and feof. What's the difF? *don't get it*

When using fget. Is it something special you should think when taking care
of line-breaks? (/n, /r/n ...)

/G

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



Re: [PHP] File-handling

2004-12-17 Thread Ian Firla

fgets uses the resource created by fopen.

Read the manual:

http://it.php.net/fopen

http://it.php.net/fgets

look at the example:



Ian

On Fri, 2004-12-17 at 11:24 +0100, [EMAIL PROTECTED] wrote:
> Hi there!
> 
> Can someone explain the major difference between fgets and fopen? Which is
> the best together with plain textfiles? and why?
> 
> eof and feof. What's the difF? *don't get it*
> 
> When using fget. Is it something special you should think when taking care
> of line-breaks? (/n, /r/n ...)
> 
> /G
> 

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



[PHP] mysql sessions vs flat file?

2004-12-17 Thread Jason Morehouse
Hello all,
Has anyone had an experience with storing sessions in mysql (or sqlite)? 
 If so, what if any are the performance benefits?  Obviously, there 
would have to be an extra db query per page... but would that be faster 
then opening a text file?

Also, I was trying to post to the php news server, but my messages 
weren't showing up.  Is it read only?  Or just slow?

Cheers,
-J
--
 Vendorama
 http://www.vendorama.com
 The evolution of e-commerce
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Refreshing page after form submission

2004-12-17 Thread S.D.Price

Hi, I have a form which when submitted adds a record to a DB. However if
the user clicks back it resubmits the same record.

I have tried using cache control to no avail :

header ("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
header ("Last-Modified:" . gmdate("D, d M Y H:i:s"). " GMT");
header ("Cache-control: no-store, no-cache, must revalidate");
header("Cache-control: post-check=0, pre-check=0, false");
header ("Pragma: no-cache");
session_cache_limiter("nocache");

I also tried testing for the presence of a submit button so if the user
enters data submits the form and clicks back the page will refresh.

";
} else { 
} 
?>

The problem is I need to display a confirmation message after the user
submits, and with this technique the page always redisplays the (empty)
form after submission.

Any ideas?



Steve



Re: [PHP] mysql sessions vs flat file?

2004-12-17 Thread Raditha Dissanayake
Jason Morehouse wrote:
Hello all,
Has anyone had an experience with storing sessions in mysql (or 
sqlite)?  If so, what if any are the performance benefits?  Obviously, 
there would have to be an extra db query per page... but would that be 
faster then opening a text file?
Speed depends on several factors and I would not comment on it. One of 
the main advantages of placing session information in the database is 
that your web application can then be clustered more easily.  The other 
advantage is that if you are on a shared hosting enviorenment there some 
measure of additional protection for your session data when it's stored 
in the database.
The main disadvantage is that you are complicating your application a 
bit and session management errors may become harder to track.

Also, I was trying to post to the php news server, but my messages 
weren't showing up.  Is it read only?  Or just slow?

Cheers,
-J

--
Raditha Dissanayake.
--
http://www.radinks.com/print/card-designer/ | Card Designer Applet
http://www.radinks.com/upload/  | Drag and Drop Upload 

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


[PHP] IDE recommendation-- (Free?)

2004-12-17 Thread GH
Hi...

 I am looking for a FREE PHP IDE that uses syntax highlighting and
code completion amongst other features...

Do any of you have any recommendations... again I am looking for FREE
(not much budget for me)?

I use BOTH Linux and Windows

Thanks
Gary

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



Re: [PHP] IDE recommendation-- (Free?)

2004-12-17 Thread John Nichel
GH wrote:
Hi...
 I am looking for a FREE PHP IDE that uses syntax highlighting and
code completion amongst other features...
Do any of you have any recommendations... again I am looking for FREE
(not much budget for me)?
I use BOTH Linux and Windows
Thanks
Gary
Yeah, search the archives and/or read the email that you got when you 
subscribed to this list.

--
By-Tor.com
...it's all about the Rush
http://www.by-tor.com
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] IDE recommendation-- (Free?)

2004-12-17 Thread Mat Harris
On Fri, Dec 17, 2004 at 08:20:36 -0500, GH wrote:
> Hi...
> 
>  I am looking for a FREE PHP IDE that uses syntax highlighting and
> code completion amongst other features...
> 
> Do any of you have any recommendations... again I am looking for FREE
> (not much budget for me)?
> 
> I use BOTH Linux and Windows

I can heartily recommend SciTE (http://www.scintilla.org/SciTE.html)
i believe it has the features you desire, plus, there is a version customised
for php, available here http://amip.tools-for.net/SciTE-CVS.exe

btw, there is a GTK+ version so you can use it on linux as well.

> Thanks
> Gary

hope this helps

mat

-- 
Cats land on their feet. 
Toast lands jellyside down.
A cat glued to some jelly toast will hover in quantum indecision 

perl -e'$_=q#: 13_2: 12/o{>: 8_4) (_4: 6/2^-2; 3;-2^\2: 5/7\_/\7:\
1   m m::#;y#:#\n#;s#(\D)(\d+)#$1x$2#ge;print'

Yes, of course it's the right cabl [le0: NO CARRIER]


pgpcUcPrglOn2.pgp
Description: PGP signature


Re: [PHP] IDE recommendation-- (Free?)

2004-12-17 Thread Jeffery Fernandez
Mat Harris wrote:
On Fri, Dec 17, 2004 at 08:20:36 -0500, GH wrote:
 

Hi...
I am looking for a FREE PHP IDE that uses syntax highlighting and
code completion amongst other features...
Do any of you have any recommendations... again I am looking for FREE
(not much budget for me)?
I use BOTH Linux and Windows
   

I can heartily recommend SciTE (http://www.scintilla.org/SciTE.html)
i believe it has the features you desire, plus, there is a version customised
for php, available here http://amip.tools-for.net/SciTE-CVS.exe
btw, there is a GTK+ version so you can use it on linux as well.
 

Thanks
Gary
   

hope this helps
mat
 

here you go.. a well maintained list: 
http://www.thelinuxconsultancy.co.uk/phpeditors/

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


Re: [PHP] Refreshing page after form submission

2004-12-17 Thread Mike Smith
Would something like this work

If($_POST['submit']){//add error checking for whatever critical fields

echo "Thank you for filling out my form.\n";

} else {
//display form with a 

}

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



[PHP] Question

2004-12-17 Thread Tom Luigjes
>Hi, I'm trying to make a little script to edit arrays.
>For example, i have an array file named config.php, and it holds this:
>
>$config = array(
>'email' => 'E-mail',
>'meta_author' => 'Author',
>?>
>
>I wish to edit this file, through another file, named edit.php, or
>admin.php, i would like to use forms for it. At the moment i've found out
>how to show the arrays within a text field, but now i wish to edit them
>through the same text field. With buttons etc.
>
>Here's how i call the arrays from the file:
>
> 
>
>Is there anything that can let me edit it? I think i will have to edit it
>through a form, it might be simple, though it might not be, please help me
>out!

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



[PHP] Re: File Locking during *other* file operations

2004-12-17 Thread Jason Barnett
Gerard Samuel wrote:
Im talking about file locking during deleting, and moving
files.
Is it possible to perform file locking for these file operations?
If so, can you provide psuedo code.
Thanks
Sure... just acquire the exclusive lock like you would for writing to a 
file, but do the delete / move instead.  Your apps must actually try to 
flock before *every* file operation though if you expect the locking 
system to work.

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


RE: [PHP] File Locking during *other* file operations

2004-12-17 Thread Michael Sims
Gerard Samuel wrote:
> Im talking about file locking during deleting, and moving
> files.
> Is it possible to perform file locking for these file operations?

Yes, have your scripts attempt to lock a separate lock file before performing
deleting or moving operations.

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



Re: [PHP] Question

2004-12-17 Thread Ligaya Turmelle
I assume by edit you mean change the value to something completely new. 
 If you are having the user input the new value you 1) must make sure 
it is valid input and 2)move it into the array value (maybe set the 
array as a session variable so it crosses over to the next page instead 
of being re initialized).

Maybe something like:
if(isset($_POST['submit']){
// make sure the input is valid first
$_SESSION['config']['email'] = $_POST['email'];
$_SESSION['config']['meta_author'] = $_POST['author'];
}
if (!isset($_SESSION['config'])){
$_SESSION['config']= array(
'email' => 'E-mail',
'meta_author' => 'Author')
}


Respectfully,
Ligaya Turmelle
---
Life is a game... so have fun.
---
www.PHPCommunity.org
Open Source, Open Community
Visit for more information or to join the movement

Tom Luigjes wrote:
Hi, I'm trying to make a little script to edit arrays.
For example, i have an array file named config.php, and it holds this:
 'E-mail',
  'meta_author' => 'Author',
?>
I wish to edit this file, through another file, named edit.php, or
admin.php, i would like to use forms for it. At the moment i've found out
how to show the arrays within a text field, but now i wish to edit them
through the same text field. With buttons etc.
Here's how i call the arrays from the file:
 
Is there anything that can let me edit it? I think i will have to edit it
through a form, it might be simple, though it might not be, please help me
out!


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

Re: [PHP] simple terms

2004-12-17 Thread Ligaya Turmelle
All I know of is the PEAR documentation 
(http://pear.php.net/manual/en/introduction.php) and a couple of books 
on the market.  I have "Essential PHP Tools..." by David Sklar 
(http://www.amazon.com/exec/obidos/tg/detail/-/1590592808/qid=1103298277/sr=1-10/ref=sr_1_10/104-7552277-0639155?v=glance&s=books)

Respectfully,
Ligaya Turmelle
---
Life is a game... so have fun.
---
www.PHPCommunity.org
Open Source, Open Community
Visit for more information or to join the movement

Jason Wydro wrote:
i would like to better understand pear. is there some ver basic doc that
you know of?
 
---

Jason Wydro
voice: 727 489 2684
fax: 727 489 7422
email: [EMAIL PROTECTED]
web:   www.jasonwydro.com
-
 


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

[PHP] Re: I got the mail form blues! HTML/POST/mail() question - Also request for style suggestions

2004-12-17 Thread Monique Verrier
Hi David --

When I do that, it creates a problem because it displays a "> at the bottom
of my screen.  It is making me crazy!  I think it has to do with all the
quotes in the HTML, but I don't know how to deal with it.  I have listed the
code below.  Do you have any ideas?  Thank you for you help.

Monique.
**
$hmessage = '



  

  

  
Courtesy of
Costill.Com
  



  
 
  



  
'.$message.'

  To: '.$recemail.'
  To: '.$rname.'


  From: '.$sendername.'


  '.$mailmessage.'


   


   
';
  //okay a lot of the html is in $hmessage

  mysql_data_seek ($rsList, 0);

do { $hmessage .=''.
  $row_rsList['name'].''.
$row_rsList['addr'].''.
$row_rsList['csz'].''.
   $row_rsList['tel'].'Type: '.
   $row_rsList['type'].'';

   if (!is_null($row_rsList['category'])) {$hmessage
.=$row_rsList['category'];}
   $hmessage .= "";
   if (!is_null($row_rsList['comments']))
 {
 $hmessage .=''.$lblcomment;
 $hmessage .= $row_rsList['comments'];
 $hmessage .="";
 }
  $hmessage .='';

  } while ($row_rsList = mysql_fetch_assoc($rsList));


  $hmessage .='
  
 ©2004  
www.healdsburgmenus.com';


***

"David Robley" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> On Fri, 17 Dec 2004 14:32, Monique Verrier wrote:
>
> > Hi!
> >
> > I have an html string stored in $message.  I "submit" the form to a
> > subroutine and the value in $message is lost.  All the other variables
> > come
> > into feedback.php just fine.  I would love any help.  This is a new
> > language for me so any suggestions for streamlining my code would also
be
> > much
> > appreciated.  Thanks -- Monique.
> >
> > Here's my code:
> >
> >  > $message=getmsg($message,$recemail,$sendername,$mailmessage,$rsList
> $rname);
> >   mysql_free_result($rsList);
> >  echo $message;  // this displays perfectly
> > ?>
> >
> >> ?>">
> >   
> > 
> >   
> > 
> > 
>
> I think if you were to actually echo $message here, it should display in
the
> hidden field as you expect, and hence be passed as part of the form data
to
> the target script.
>
> > 
> >  > value="Name,Email,Subject,Updates,Message">
> >   
> > 
> >   
> > 
> >   
>
> -- 
> David Robley
>
> A cat is the universe's way of showing us perfection.

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



Re: [PHP] Miami PHP groups?

2004-12-17 Thread Ligaya Turmelle
http://www.php.net/support.php -- and follow the links under user groups
Respectfully,
Ligaya Turmelle
---
Life is a game... so have fun.
---
www.PHPCommunity.org
Open Source, Open Community
Visit for more information or to join the movement

Josh wrote:
Any computer groups or resources for learning PHP in the Miami area?  I am
new here ... trying to learn PHP... would like to meet other people doing
the same.

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

[PHP] Problem with loose typing

2004-12-17 Thread Chris Boget
Consider the following:

  function test() {
static $i = 0;

$i++;
$retval = ( $i <= 10 ) ? $i : '';

return $retval;

  }
  while( $bob = test()) {
echo $bob . '';

  }

You would expect the while loop to go on forever just looking
at the above code.  However, what's happening is that when the
empty string is getting returned due to $i being > 10, the while
loop is resolving FALSE when $bob is set to the value of the
empty string.
Is there any way that I can force this not to happen?  That the
while loop resolves as FALSE only when the function actually
returns a (boolean) FALSE value?

thnx,
Chris

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



Re: [PHP] Re: I got the mail form blues! HTML/POST/mail() question - Also request for style suggestions

2004-12-17 Thread Richard Lynch


You need to http://php.net/urlencode anything you echo into a HIDDEN INPUT
so that the HTML tags in it don't get used by the browser display
rendering engine.


Monique Verrier wrote:
> Hi David --
>
> When I do that, it creates a problem because it displays a "> at the
> bottom
> of my screen.  It is making me crazy!  I think it has to do with all the
> quotes in the HTML, but I don't know how to deal with it.  I have listed
> the
> code below.  Do you have any ideas?  Thank you for you help.
>
> Monique.
> **
> $hmessage = '
> 
>  marginheight="0">
>  class="big">
>   
> 
>width="97" height="115" border="0">
>  width="90%" border="0" cellpadding="2" cellspacing="1" class="xbig">
>   
> Courtesy
> of
> Costill.Com
>   
> 
> 
> 
>   
>  
>   
> 
>
> 
>   
> '.$message.'
> 
>   To: '.$recemail.'
>   To: '.$rname.'
> 
> 
>   From: '.$sendername.'
> 
> 
>   '.$mailmessage.'
> 
> 
>    
> 
> 
>    
> ';
>   //okay a lot of the html is in $hmessage
>
>   mysql_data_seek ($rsList, 0);
>
> do { $hmessage .=''.
>   $row_rsList['name'].''.
> $row_rsList['addr'].''.
> $row_rsList['csz'].''.
>$row_rsList['tel'].'Type: '.
>$row_rsList['type'].'';
>
>if (!is_null($row_rsList['category'])) {$hmessage
> .=$row_rsList['category'];}
>$hmessage .= "";
>if (!is_null($row_rsList['comments']))
>  {
>  $hmessage .=''.$lblcomment;
>  $hmessage .= $row_rsList['comments'];
>  $hmessage .="";
>  }
>   $hmessage .='';
>
>   } while ($row_rsList = mysql_fetch_assoc($rsList));
>
>
>   $hmessage .='
>cellpadding="2"
> bgcolor="CC">
>  ©2004  
>  align="right">www.healdsburgmenus.com';
>
>
> ***
>
> "David Robley" <[EMAIL PROTECTED]> wrote in message
> news:[EMAIL PROTECTED]
>> On Fri, 17 Dec 2004 14:32, Monique Verrier wrote:
>>
>> > Hi!
>> >
>> > I have an html string stored in $message.  I "submit" the form to a
>> > subroutine and the value in $message is lost.  All the other variables
>> > come
>> > into feedback.php just fine.  I would love any help.  This is a new
>> > language for me so any suggestions for streamlining my code would also
> be
>> > much
>> > appreciated.  Thanks -- Monique.
>> >
>> > Here's my code:
>> >
>> > > > $message=getmsg($message,$recemail,$sendername,$mailmessage,$rsList
>> $rname);
>> >   mysql_free_result($rsList);
>> >  echo $message;  // this displays perfectly
>> > ?>
>> >
>> >   > > ?>">
>> >   
>> > 
>> >   
>> > 
>> > 
>>
>> I think if you were to actually echo $message here, it should display in
> the
>> hidden field as you expect, and hence be passed as part of the form data
> to
>> the target script.
>>
>> > 
>> > > > value="Name,Email,Subject,Updates,Message">
>> >   
>> > 
>> >   
>> > 
>> >   
>>
>> --
>> David Robley
>>
>> A cat is the universe's way of showing us perfection.
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>


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

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



Re: [PHP] Refreshing page after form submission

2004-12-17 Thread Richard Lynch
S.D.Price wrote:
> Hi, I have a form which when submitted adds a record to a DB. However if
> the user clicks back it resubmits the same record.

When you send out the FORM the first time, create a random unique value:
$token = md5(uniqid());
Store that token in your database in a table.
Include that in an INPUT TYPE=HIDDEN with a random unique VALUE=""
When you process the form, mark that $token in the database as "Submitted"
If they attempt to re-process the same form (IE, the $token is already
"Submitted") then you can do something, or nothing, or whatever you think
best.

> I have tried using cache control to no avail :

Browsers and cache control have a turbulent history, and while they are
really nifty for getting good browsers to refresh content, they are not
real reliable.

If you *need* more control over content caching, change your URLs, perhaps
randomly, when you want content to not be cached.

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

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



[PHP] Re: Problem with loose typing

2004-12-17 Thread M. Sokolewicz
Chris Boget wrote:
Consider the following:
  function test() {
static $i = 0;
$i++;
$retval = ( $i <= 10 ) ? $i : '';
return $retval;
  }
  while( $bob = test()) {
echo $bob . '';
  }
   while(false !== ($bob = test())) {
 echo $bob . '';
   }
You would expect the while loop to go on forever just looking
at the above code.  However, what's happening is that when the
empty string is getting returned due to $i being > 10, the while
loop is resolving FALSE when $bob is set to the value of the
empty string.
Is there any way that I can force this not to happen?  That the
while loop resolves as FALSE only when the function actually
returns a (boolean) FALSE value?
thnx,
Chris
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


RE: [PHP] Problem with loose typing

2004-12-17 Thread Michael Sims
Chris Boget wrote:
>   function test() {
> static $i = 0;
> 
> $i++;
> $retval = ( $i <= 10 ) ? $i : '';
> 
> return $retval;
> 
>   }
>   while( $bob = test()) {
> echo $bob . '';
> 
>   }
> 
> You would expect the while loop to go on forever just looking
> at the above code. 

I wouldn't, but apparently you do. :)

> However, what's happening is that when the
> empty string is getting returned due to $i being > 10, the while
> loop is resolving FALSE when $bob is set to the value of the
> empty string.
> Is there any way that I can force this not to happen?  That the
> while loop resolves as FALSE only when the function actually
> returns a (boolean) FALSE value?

while ( ($bob = test()) !== false ) {
  echo $bob . '';
}

should do the trick.

HTH

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



[PHP] How to verify the file after the FTP transfer???

2004-12-17 Thread Scott Fletcher
Hi!  I'm now stuck on how to verify the file after the FTP transfer.  I'm
writing a script that do the files and database backup and verifying them.
I'm using the Unix machine.  Since I'm using the tar utility via the shell
environment in PHP, like PassThru() or Exec().  I'm using the tar utility
via Exec() for backing up and verifying because it have a lot of tar's
options that I can use.  As for the FTP, I decided to do the Exec() for
transfering and verifying.   Now the only thing left is to verify it.  I
welcome your suggestion and thought on this...

Thanks,
 Scott

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



Re: [PHP] Problem with loose typing

2004-12-17 Thread Jason Wong
On Saturday 18 December 2004 00:02, Chris Boget wrote:

> Is there any way that I can force this not to happen?  That the
> while loop resolves as FALSE only when the function actually
> returns a (boolean) FALSE value?

Make the test more explicit:

 while (TRUE === ($bob = test())) { ... }

-- 
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
--
/*
It is very difficult to prophesy, especially when it pertains to the future.
*/

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



RE: [PHP] Refreshing page after form submission

2004-12-17 Thread S.D.Price

Thanks this was the best solution I used this code as part of form
validation.

// query to check record has not already been added by comparing
submitted title with title of last record
$query_gnewsid_unique = "SELECT MAX(newsid) AS newsid FROM
tblnews";

// execute query
$result_gnewsid_unique = mysql_query($query_gnewsid_unique);

$row_gnewsid_unique = mysql_fetch_array($result_gnewsid_unique);
$newsid_unique = $row_gnewsid_unique['newsid'];


// query to extract last title from tblnews 
$query_gtitle_unique = "SELECT title
FROM tblnews
WHERE newsid = $newsid_unique"; 
$result_gtitle_unique = mysql_query($query_gtitle_unique);

$row_gtitle_unique = mysql_fetch_array($result_gtitle_unique);
$title_unique = $row_gtitle_unique['title'];



if ($title == $title_unique) {  
$message_unique = "You have already entered this record.";  
$unique = TRUE;
}


Steve

-Original Message-
From: Burhan Khalid [mailto:[EMAIL PROTECTED] 
Sent: 17 December 2004 13:07
To: S.D.Price
Subject: Re: [PHP] Refreshing page after form submission


S.D.Price wrote:
> Hi, I have a form which when submitted adds a record to a DB. However 
> if the user clicks back it resubmits the same record.
> 
> I have tried using cache control to no avail :
> 
> header ("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
> header ("Last-Modified:" . gmdate("D, d M Y H:i:s"). " GMT"); header 
> ("Cache-control: no-store, no-cache, must revalidate");
> header("Cache-control: post-check=0, pre-check=0, false"); header 
> ("Pragma: no-cache"); session_cache_limiter("nocache");
> 
> I also tried testing for the presence of a submit button so if the 
> user enters data submits the form and clicks back the page will 
> refresh.
> 
>  
> if ($_POST['submit']) {
> echo "";
> } else { 
> } 
> ?>
> 
You can try and check if the user's information already exists in the 
database, then display an appropriate message.

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



Re: [PHP] Problem with loose typing

2004-12-17 Thread Matt M.
> You would expect the while loop to go on forever just looking
> at the above code.  However, what's happening is that when the
> empty string is getting returned due to $i being > 10, the while
> loop is resolving FALSE when $bob is set to the value of the
> empty string.
> Is there any way that I can force this not to happen?  That the
> while loop resolves as FALSE only when the function actually
> returns a (boolean) FALSE value?

I think this should do it.

  function test() {
   static $i = 0;

   $i++;
   $retval = ( $i <= 10 ) ? $i : '';

   return $retval;

 }
 while( ($bob = test()) !== false ) {
   echo $bob . 'ECHO';

 }

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



[PHP] Mass mySQL update...

2004-12-17 Thread Russell P Jones
So I populated a mySQL database but forgot to create random ids for each
record.

I have used phpmyadmin to add a varchar(15) column named "id" at the end
of the database for each record, but now am wondering if there is an easy
way to get random ID's into each of these...

The column values for many of the entries are not unique, so I couldnt
just loop through saying where term = $row[term] set id= rand(1, 9)

any other ideas? Any way to refer to a particular row without matching
values?

Russ

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



[PHP] Re: Conflicts between c-client and MySQL

2004-12-17 Thread Sasha Dolgy
Hi,

Has anyone else had any success with this?

MySQL-client-4.1.7-0
php 5.0.3


/usr/local/imap-2004a/lib/libc-client.a(misc.o)(.text+0x8a4): In function 
`hash_reset':
/build/imap-2004a/c-client/misc.c:278: multiple definition of `hash_reset'
/usr/lib/mysql/libmysqlclient.a(hash.o)(.text+0x130): first defined here
/usr/bin/ld: Warning: size of symbol `hash_reset' changed from 94 in 
/usr/lib/mysql/libmysqlclient.a(hash.o) to 89 in 
/usr/lib/mysql/libmysqlclient.a(hash.o)
collect2: ld returned 1 exit status
make: *** [libphp5.la] Error 1


"Rodolfo Gonzalez Gonzalez" <[EMAIL PROTECTED]> wrote in 
message news:[EMAIL PROTECTED]
> Hello,
>
> I'm trying to compile with: UW-IMAP's c-client 2004, MySQL 4.1.7,
> php-5.0.3RC2 and php-5.0.2, configure  --with-imap
> --with-mysqli, and I get this:
>
> /usr/lib/libc-client.a(misc.o)(.text+0x8a4): In function `hash_reset':
> /home/rodolfo/software/imap-2004a/c-client/misc.c:278: multiple definition
> of `hash_reset'
> /usr/lib/mysql/libmysqlclient.a(hash.o)(.text+0x130): first defined here
> /usr/bin/ld: Warning: size of symbol `hash_reset' changed from 94 to 89 in
> /usr/lib/libc-client.a(misc.o)
> collect2: ld returned 1 exit status
> make: *** [libphp5.la] Error 1
>
> Any help is appreciated,
> Rodolfo. 

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



Re: [PHP] File-handling

2004-12-17 Thread Richard Lynch
[EMAIL PROTECTED] wrote:
> Hi there!
>
> Can someone explain the major difference between fgets and fopen? Which is
> the best together with plain textfiles? and why?

fgets can be handy to read a large file one LINE at a time.

This is most useful in files that are line-based, such as SQL data dumps,
CSV files, text files, config files, etc. when you want to process their
contents a line at a time and do something to the data.

fget lets you read an arbitrary amount of data -- this is useful if you
just want to transfer the data from point A to B without interpreting it,
or if the data is binary and has some sort of internal byte-structure you
need to tear apart to process it.

For small files, you might as well just use http://php.net/file or other
functions that deal with the whole file at once -- You only really want to
mess with fopen/fget|fgets/fclose if you have files that could potentially
be HUGE, and you can read a chunk at a time, deal with it, and read some
more -- Avoiding trying to suck the whole thing into RAM all at once.

> When using fget. Is it something special you should think when taking care
> of line-breaks? (/n, /r/n ...)

If your data could potentially be coming from Mac, PC, and/or Linux
instead of just one platform, you'll have to write some code to figure out
what to do with line-breaks.

Since I'm always on Linux servers, I generally do:

$data = str_replace("\r\n", "\n", $data); //PC -> Linux
$data = str_replace("\r", "\n", $data); //Mac -> Linux

This converts everything to Linux format, which is what I'll use internally.

Note that the order of the two lines is crucial -- If you flip-flop them,
you'll make a real mess.

If you're not trying to change the data, nor interpret it, you needn't
worry about the newlines.

> eof and feof. What's the difF? *don't get it*

EOF is an acronym for End Of File.

feof is the function used to determine if a file has reached its EOF --
that is, if you have successfully read all of the data, and there is no
more data to read, and the file still seems kosher, so you're DONE.


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

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



Re: [PHP] Miami PHP groups?

2004-12-17 Thread Richard Lynch
Josh wrote:
> Any computer groups or resources for learning PHP in the Miami area?  I am
> new here ... trying to learn PHP... would like to meet other people doing
> the same.

I can't believe you tried to Google and didn't find it... :-)

http://phpusergroups.org/groups.phtml?id=311&menu=groups

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

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



Re: [PHP] File Locking during *other* file operations

2004-12-17 Thread Gerard Samuel
Michael Sims wrote:
Yes, have your scripts attempt to lock a separate lock file before performing
deleting or moving operations.
 

Jason Barnett wrote:
Sure... just acquire the exclusive lock like you would for writing to 
a file, but do the delete / move instead.  Your apps must actually try 
to flock before *every* file operation though if you expect the 
locking system to work.

Thanks.  I'll try to see what I can come up with...
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] User Groups Mailing List

2004-12-17 Thread Richard Lynch
Is there any interest in a PHP mailing list for User Groups?

I'm thinking topics along the lines of:
Forming a User Group
Promoting a User Group
Tips&Tricks for increasing attendance and the quality of meetings

Perhaps sharing/swapping resources, recommending speakers.

Posts by experts who are traveling and want to hook up with a User Group
to show off their latest PHP work/technology.

I'd be happy to moderate such a list, and could find some kind of host for
it if PHP.net is not willing/suitable/able to do so.

I know I've had many challenges to keep the Chicago User Group going and
suspect many people could benefit from this sort of list.

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

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



Re: [PHP] mysql sessions vs flat file?

2004-12-17 Thread Robert Cummings
On Fri, 2004-12-17 at 11:34, Richard Lynch wrote:
> Granted, this assumes you've got a good clean working SQL-based session
> setup in the first place, which is several days, perhaps even weeks of
> work for the beginner, before they really understand all the bits and
> pieces and ins and outs of the session data moving around.

Only if you're not using OOP... *cackles and runs* ;)

Cheers,
Rob.
-- 
..
| InterJinn Application Framework - http://www.interjinn.com |
::
| An application and templating framework for PHP. Boasting  |
| a powerful, scalable system for accessing system services  |
| such as forms, properties, sessions, and caches. InterJinn |
| also provides an extremely flexible architecture for   |
| creating re-usable components quickly and easily.  |
`'

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



Re: [PHP] How to verify the file after the FTP transfer???

2004-12-17 Thread Richard Davey
Hello Scott,

Friday, December 17, 2004, 4:26:46 PM, you wrote:

SF> As for the FTP, I decided to do the Exec() for transfering and
SF> verifying. Now the only thing left is to verify it. I welcome your
SF> suggestion and thought on this...

Perform an ls/dir on the FTP server once it has completed - if the
file is there and is the right file size, it obviously worked :)

Best regards,

Richard Davey
-- 
 http://www.launchcode.co.uk - PHP Development Services
 "I am not young enough to know everything." - Oscar Wilde

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



Re: [PHP] pspell on w32

2004-12-17 Thread Richard Lynch
php wrote:
> A phpinfo() command shows that I have php4.3.10 with pspell enabled.
> However, when I run the command pspell_check($pspell_link, "testt") in my
> web scripts, the page appears to header redirect on itself indefinitely.

Try to use wget or the MS-DOS equivalent to find out exactly what the
web-server is sending out -- which is driving your browser crazy.

Also try to run the script from an MS-DOS prompt:
C:\php\bin\php.exe C:\full\path\to\your\script.php

You'll have to get the paths right, of course, and may have to dink around
with the Environment Variable setting of "path" in "My Computer" (I think
that's where they hide it) so you can have all your DLLs and stuff in the
$path variable.

If all else fails, take a *COPY* of your script, and a *COPY* of php.exe
and a *COPY* of all the DLLs you need, and toss them in a single directory
and try to run it that way.  In theory, Windows .exes look for DLLs in
their own directory first.

'Course, Microsoft tends to break their own rules as fast as they make
them, so no promise on that actually working. :-v

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

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



Re: [PHP] web IDE

2004-12-17 Thread Richard Lynch
Malcolm Mill wrote:
> Create a web page that allows me to create files with basic formating
> tags in them (i.e for html .: for shell
> #!/usr/bin/php: for php ).

You can use PHP to http://php.net/echo out any kind of content you want,
including HTML if you use http://php.net/htmlentities to make them visible
in the browser and http://php.net/urlencode to send them back and forth in
forms.

That said, you may want to just *BUY* a good IDE like DreamWeaver or the
Zend IDE or Komodo instead of trying to write one from scratch.

If you are having a tough time coding because you can't remember tags and
functions, writing your own IDE is going to be a nightmare.

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

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



php-general@lists.php.net

2004-12-17 Thread Richard Lynch
Tomas Tintera wrote:
> Thanks for your answers (you probably don't understand me).
>
> I am looking for some construct (or statement or function) which allows
> to do this:
>
> 
>
> Note that the unset() has no return value (and so it can't be used as a
> part of other expression; it can be only used as a stand-alone
> statement), so I thing it could be good if there were some construct
> which makes expression with return value from expression with no return
> value.
>
> It is not possible to use just
> 

Perhaps something like this:

function my_unset($var){
  global $$var;
  $wasset = isset($$var);
  unset($$var);
  return $wasset;
}

my_unset('a'); //unset($a);



Or, in a more general way:

function forcereturn ($php){
  return eval($php);
}


Damned if I understand *why* you want this, mind you. :-)

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

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



Re: [PHP] Delete files from the server

2004-12-17 Thread Richard Lynch
Steve Marquez wrote:
> I have uploaded some pictures and thumbnails using a PHP form into a
> particular directory. I would like to be able to select the name of the
> picture and then chose to delete that picture and its thumbnail from the
> server using another form.
>
> The name of the picture is in the MySQL database.
>
> Is there any way to do this?

I asked this question a half-dozen years ago, because I didn't know Un*x
and couldn't find the answer, despite a pretty good search...

Did you try searching PHP's function list for 'delete'?

They added that entry just for folks like you and me :-)

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

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



RE: [PHP] Question in posting form-data

2004-12-17 Thread Richard Lynch
Yao, Minghua wrote:
> Yes. I did modify the original since I need to send data to a program
> which takes only form-data.
> "content-disposition: " came from RFC 2388. I don't think the program can
> take application/x-www-form-urlencoded content. Further help needed.

Try it the old way -- I suspect you broke things by changing it around...

You definitely need the $name= and the urlencode of the value, however.

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

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



Re: [PHP] mysql sessions vs flat file?

2004-12-17 Thread Richard Lynch
Jason Morehouse wrote:
> Has anyone had an experience with storing sessions in mysql (or sqlite)?

Yes, in MySQL.

>   If so, what if any are the performance benefits?

This depends on *SO* many factors...

Is your MySQL database pretty small?

Is your site heavy traffic?

Are most of your sessions short-lived?

Will the MySQL data end up being in RAM and cached?

Sooner or later, the MySQL stuff has to hit the hard drive, one way or
another -- But the user perception could be *MUCH* faster if MySQL caching
is reducing disk access over the course of a short session.

> Obviously, there
> would have to be an extra db query per page... but would that be faster
> then opening a text file?

If you're on a high-traffic site, only some benchmark tests on your
hardware is going to tell you for sure.

If you're not, the MySQL solution is not going to be noticably
slower/faster than the file-based sessions, if you're already opening a
MySQL connection anyway.

If you're *NOT* already making a MySQL connection, then you'd have to test
and see which is faster -- or not worry too much about it, as they'll be
pretty close, and on a low-volume site it won't matter which you use from
a performance perspective.

I haven't tried SQLite, but I suspect it's going to be about the same.


Also an alternative viewpoint to another poster:

If you are writing the MySQL scripts to control sessions, and if you
understand how the sessions work (which takes some doing) then, in my
experience, you can debug session problems easier and faster, because you
already have "hooks" in place to track where stuff is coming from and
going to.

Granted, this assumes you've got a good clean working SQL-based session
setup in the first place, which is several days, perhaps even weeks of
work for the beginner, before they really understand all the bits and
pieces and ins and outs of the session data moving around.

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

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



Re: [PHP] Mass mySQL update...

2004-12-17 Thread Jason Wong
On Saturday 18 December 2004 00:39, Russell P Jones wrote:

> I have used phpmyadmin to add a varchar(15) column named "id" at the end
> of the database for each record, but now am wondering if there is an easy
> way to get random ID's into each of these...

Why? What are these random ID's used for?

> The column values for many of the entries are not unique, so I couldnt
> just loop through saying where term = $row[term] set id= rand(1, 9)
>
> any other ideas? Any way to refer to a particular row without matching
> values?

UPDATE without a WHERE clause (or with WHERE 1) will update all rows.

-- 
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
--
/*
BOFH Excuse #308:

CD-ROM server needs recalibration
*/

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



Re: [PHP] Mass mySQL update...

2004-12-17 Thread John Nichel
Russell P Jones wrote:
So I populated a mySQL database but forgot to create random ids for each
record.
I have used phpmyadmin to add a varchar(15) column named "id" at the end
of the database for each record, but now am wondering if there is an easy
way to get random ID's into each of these...
The column values for many of the entries are not unique, so I couldnt
just loop through saying where term = $row[term] set id= rand(1, 9)
any other ideas? Any way to refer to a particular row without matching
values?
Russ
http://lists.mysql.com/
--
John C. Nichel
ÜberGeek
KegWorks.com
716.856.9675
[EMAIL PROTECTED]
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] GD, problem adding text to GIF images

2004-12-17 Thread Richard Lynch

Greg Donald wrote:
> On Thu, 16 Dec 2004 12:27:27 -0700, Vail, Warren <[EMAIL PROTECTED]>
> wrote:
>> I believe that is the nature of GIF images, I seem to recall they were
>> very
>> compact but limited to a maximum of 16 colors (or 32 or some number like
>> that[maybe 64]), fewer colors that JPEG.  Anyone know exactly?
>
> gifs are 8bit, 256 colors.

GIFs can have lower than that as well.

You can find the GIF format definition on-line -- It's not *that* tricky
to read and understand, really.

I wrote a GIF parser in Lisp one time.  Damned if I remember why...

Maybe they had no GIF support back then, and I was converting it to a PICT
in Lisp.  [shudder]  I was young and foolish. :-)

Might have been the other way around -- writing a valid GIF from a PICT --
which would have been easier, I reckon, since I could have ignored some of
the complexities I didn't need...

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

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



Re: [PHP] GD, problem adding text to GIF images

2004-12-17 Thread Richard Lynch
Juan Nin wrote:
> I'm adding text to images using the native gd in PHP 4.3.9
>
> I have no problems with jpg images, but with gif ones, the colour of
> the text added to the image always results a dark grey
> The image itself and text are fine, but not the colour, which should be
> white..
>
> Has anyone experienced this problem?
>
> Used functions are:
>
>
>   imagecreatefromgif
>   imagettftext
>   imagegif

When you create that image from the original GIF, you are inheriting the
COLOR PALLETTE that is in that GIF.

The original GIF maker may well have restricted you to, say, 4 colors, in
order to make the GIF really small, none of which colors are white.

I'm assuming you are using http://php.net/imagecolorallocate already, and
are trying to use  255, 255, 255 to get white.

However, if the pallette is only allowed to have 4 colors, and they are
already in use, you ain't gonna get your white color -- Your
imagecolorallocate will return -1 -- Which shouldn't work too good at all
in the rest of your script...

So I'm a bit confused exactly how you got the gray color.

That said, here are some possible ideas.

#1.
Check all your return codes from all your functions.  If you *think* you
are getting a color, but you get -1, something went wrong.  Catch it, deal
with it, and do something smart about it.

#2.
Use http://php.net/imagecreatetruecolor to make your image.
Then use http://php.net/imagecreatefromgif to pull in the GIF
Then use http://php.net/imagecopy to *copy* the GIF into your image.

#3.
There are PHP functions to examine the pallette.  Use them.  Figure out
where the gray is coming from and why.

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

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



Re: [PHP] Problem with loose typing

2004-12-17 Thread Richard Lynch
Chris Boget wrote:
> Consider the following:
>
>   function test() {
> static $i = 0;
>
> $i++;
> $retval = ( $i <= 10 ) ? $i : '';
>
> return $retval;
>
>   }
>   while( $bob = test()) {
> echo $bob . '';
>
>   }
>
> You would expect the while loop to go on forever just looking
> at the above code.  However, what's happening is that when the
> empty string is getting returned due to $i being > 10, the while
> loop is resolving FALSE when $bob is set to the value of the
> empty string.
> Is there any way that I can force this not to happen?  That the
> while loop resolves as FALSE only when the function actually
> returns a (boolean) FALSE value?

The easiest thing is to change the '' in your ternary operator to TRUE.

TRUE ain't never gonna evaluate to FALSE in PHP.  Well, I guess you could
hack the source to make that happen, if you were bored enough...

Another option is to use === to test $bob explicitly against '' and/or
FALSE so that PHP's loose type conversion doesn't confuse you.

You could even change '' to 'LOTS AND LOTS' so that after 10, you see
'LOTS AND LOTS'

Or, if you were wanting this to actually be useful, you could do something
like:

$retval = ($i <= 10) ? $i : ('~10^' . log($i, 10));

For the English majors, I imagine there's a http://php.net/printf input
that would let you get things like 'hundreds', 'thousands', 'millions',
etc.

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

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



Re: [PHP] mysql sessions vs flat file?

2004-12-17 Thread Richard Lynch




Robert Cummings wrote:
> On Fri, 2004-12-17 at 11:34, Richard Lynch wrote:
>> Granted, this assumes you've got a good clean working SQL-based session
>> setup in the first place, which is several days, perhaps even weeks of
>> work for the beginner, before they really understand all the bits and
>> pieces and ins and outs of the session data moving around.
>
> Only if you're not using OOP... *cackles and runs* ;)

Yeah, a beginner trying to write an OOP MySQL session based system would
take MONTHS, and still get it all wrong with nasty snarled code.

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

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



Re: [PHP] User Groups Mailing List

2004-12-17 Thread Chris Shiflett
--- Richard Lynch <[EMAIL PROTECTED]> wrote:
> Is there any interest in a PHP mailing list for User Groups?

Yep. :-)

http://lists.nyphp.org/mailman/listinfo/phpm

That list consists of several user group leaders, company representatives
(mainly book and magazine publishers), and other notable community
members.

> I'm thinking topics along the lines of:
> Forming a User Group
> Promoting a User Group
> Tips&Tricks for increasing attendance and the quality of
> meetings
> 
> Perhaps sharing/swapping resources, recommending speakers.
> 
> Posts by experts who are traveling and want to hook up with a
> User Group to show off their latest PHP work/technology.
> 
> I'd be happy to moderate such a list, and could find some
> kind of host for it if PHP.net is not willing/suitable/able
> to do so.
> 
> I know I've had many challenges to keep the Chicago User
> Group going and suspect many people could benefit from this
> sort of list.

Having another founder on the list would certainly be helpful, if you're
interested in contributing. Eventually, we want to have much more than a
mailing list, however - we'd like to create a resource as useful as Perl
Mongers.

Chris

=
Chris Shiflett - http://shiflett.org/

PHP Security - O'Reilly HTTP Developer's Handbook - Sams
Coming Soon http://httphandbook.org/

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



Re: [PHP] Re: I got the mail form blues! HTML/POST/mail() question - Also request for style suggestions

2004-12-17 Thread Monique Verrier
Thanks for the help already.  I am still struggling.  I didn't have any luck
with urlencode(), but I used htmlentities() and the variable did get passed
as a section of HTML code.  When I sent the mail, however, it displayed as
text within the e-mail message and not as a table.  I was using these mail
headers:

MIME-Version: 1.0
Content-type: text/html; charset=iso-8859-1

Any other ideas would be appreciated.  Thank you -- Monique.

This is from the e-mail message that was delivered by the program:
**
Content-type: text/html; charset=iso-8859-1

From: [EMAIL PROTECTED] <[EMAIL PROTECTED]>

Reply-To: [EMAIL PROTECTED] <[EMAIL PROTECTED]>

Sender: [EMAIL PROTECTED] <[EMAIL PROTECTED]>

>From [EMAIL PROTECTED]

To [EMAIL PROTECTED]

>From test

Subject Your message From test

Message


















etc

***


"Richard Lynch" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
>
>
> You need to http://php.net/urlencode anything you echo into a HIDDEN INPUT
> so that the HTML tags in it don't get used by the browser display
> rendering engine.
>
>
> Monique Verrier wrote:
> > Hi David --
> >
> > When I do that, it creates a problem because it displays a "> at the
> > bottom
> > of my screen.  It is making me crazy!  I think it has to do with all the
> > quotes in the HTML, but I don't know how to deal with it.  I have listed
> > the
> > code below.  Do you have any ideas?  Thank you for you help.
> >
> > Monique.
> > **
> > $hmessage = '
> > 
> >  > marginheight="0">
> >  > class="big">
> >   
> > 
> >> width="97" height="115" border="0">
> >  > width="90%" border="0" cellpadding="2" cellspacing="1" class="xbig">
> >   
> > Courtesy
> > of
> > Costill.Com
> >   
> > 
> > 
> > 
> >   
> >  
> >   
> > 
> >
> > 
> >   
> > '.$message.'
> > 
> >   To: '.$recemail.'
> >   To: '.$rname.'
> > 
> > 
> >   From: '.$sendername.'
> > 
> > 
> >   '.$mailmessage.'
> > 
> > 
> >    
> > 
> > 
> >    
> > ';
> >   //okay a lot of the html is in $hmessage
> >
> >   mysql_data_seek ($rsList, 0);
> >
> > do { $hmessage .=''.
> >   $row_rsList['name'].''.
> > $row_rsList['addr'].''.
> > $row_rsList['csz'].''.
> >$row_rsList['tel'].'Type: '.
> >$row_rsList['type'].'';
> >
> >if (!is_null($row_rsList['category'])) {$hmessage
> > .=$row_rsList['category'];}
> >$hmessage .= "";
> >if (!is_null($row_rsList['comments']))
> >  {
> >  $hmessage .=''.$lblcomment;
> >  $hmessage .= $row_rsList['comments'];
> >  $hmessage .="";
> >  }
> >   $hmessage .='';
> >
> >   } while ($row_rsList = mysql_fetch_assoc($rsList));
> >
> >
> >   $hmessage
.='
> >> cellpadding="2"
> > bgcolor="CC">
> >  ©2004  
> >  > align="right">www.healdsburgmenus.com';
> >
> >
> > ***
> >
> > "David Robley" <[EMAIL PROTECTED]> wrote in message
> > news:[EMAIL PROTECTED]
> >> On Fri, 17 Dec 2004 14:32, Monique Verrier wrote:
> >>
> >> > Hi!
> >> >
> >> > I have an html string stored in $message.  I "submit" the form to a
> >> > subroutine and the value in $message is lost.  All the other
variables
> >> > come
> >> > into feedback.php just fine.  I would love any help.  This is a new
> >> > language for me so any suggestions for streamlining my code would
also
> > be
> >> > much
> >> > appreciated.  Thanks -- Monique.
> >> >
> >> > Here's my code:
> >> >
> >> >  >> > $message=getmsg($message,$recemail,$sendername,$mailmessage,$rsList
> >> $rname);
> >> >   mysql_free_result($rsList);
> >> >  echo $message;  // this displays perfectly
> >> > ?>
> >> >
> >> >>> > ?>">
> >> >   
> >> > 
> >> >   
> >> > 
> >> > 
> >>
> >> I think if you were to actually echo $message here, it should display
in
> > the
> >> hidden field as you expect, and hence be passed as part of the form
data
> > to
> >> the target script.
> >>
> >> > 
> >> >  >> > value="Name,Email,Subject,Updates,Message">
> >> >   
> >> > 
> >> >   
> >> > 
> >> >   
> >>
> >> --
> >> David Robley
> >>
> >> A cat is the universe's way of showing us perfection.
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
> >
>
>
> -- 
> Like Music?
> http://l-i-e.com/artists.htm

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



Re: [PHP] How to verify the file after the FTP transfer???

2004-12-17 Thread Richard Lynch
Scott Fletcher wrote:
> Hi!  I'm now stuck on how to verify the file after the FTP transfer.  I'm
> writing a script that do the files and database backup and verifying them.
> I'm using the Unix machine.  Since I'm using the tar utility via the shell
> environment in PHP, like PassThru() or Exec().  I'm using the tar utility
> via Exec() for backing up and verifying because it have a lot of tar's
> options that I can use.  As for the FTP, I decided to do the Exec() for
> transfering and verifying.   Now the only thing left is to verify it.  I
> welcome your suggestion and thought on this...

Your first crude check is to see if the LENGTH of the file is what it
should be.

All your code should be checking that.

There are some built-in tar consistency checks you could run on the
uploaded file to see if tar thinks it's still kosher -- These are not
exhaustive nor would you want to claim that it was a "for sure" good
transfer just because tar thinks the file is okay.

You could also create "signatures" of files on each side, and compare the
signatures.  There are a number of possible algorithms to choose from for
the signature, but http://php.net/md5 should be an easy one.  That leaves
a 1 in 2 billion chance that the files are not the same.

If 1 in 2 billion isn't good enough odds, you *could* go so far as to
transfer the file *BACK* to the original server, with a different name,
and then exec("diff $original $copy") to see if they are the same.  Of
course, this could give a false negative if the transfer *back* was no
good, but the first transfer was actually kosher.

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

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



Re: [PHP] Mass mySQL update...

2004-12-17 Thread Ligaya Turmelle
if you don't mind it being an int - try something like...
ALTER TABLE table
ADD ID INT NOT NULL INTEGER UNIQUE AUTO_INCREMENT,
ADD PRIMARY KEY (ID);
Reference:
http://dev.mysql.com/doc/mysql/en/ALTER_TABLE.html
Respectfully,
Ligaya Turmelle
---
Life is a game... so have fun.
---
www.PHPCommunity.org
Open Source, Open Community
Visit for more information or to join the movement

Russell P Jones wrote:
So I populated a mySQL database but forgot to create random ids for each
record.
I have used phpmyadmin to add a varchar(15) column named "id" at the end
of the database for each record, but now am wondering if there is an easy
way to get random ID's into each of these...
The column values for many of the entries are not unique, so I couldnt
just loop through saying where term = $row[term] set id= rand(1, 9)
any other ideas? Any way to refer to a particular row without matching
values?
Russ

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

[PHP] formating output

2004-12-17 Thread Larry L
I'm sure this is easy and I'll feel silly when I see how it's done,
but, my mnd is a blank,

this structure prints out a table with a new row for each item

 
 <$results[1] " ;
}
?>


what I want to do is print out a table 4 columns wide and however many rows
high needed to run through the data

HOW do I loop through the array and  get data   printed 4 times
then a new row started and then 4 more  cells printed, etc


thank you in advance

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



RE: [PHP] User Groups Mailing List

2004-12-17 Thread Vail, Warren
http://www.meetup.com is a website that has been around a couple of years at
least, and provides lots of organization tips for groups interested in most
subject and yes there is a whole series of them oriented around PHP, and I
believe another around MySQL.  Promote, promote, promote, seems to be the
word(s) for the day.

Warren Vail


> -Original Message-
> From: Chris Shiflett [mailto:[EMAIL PROTECTED] 
> Sent: Friday, December 17, 2004 9:58 AM
> To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
> Subject: Re: [PHP] User Groups Mailing List
> 
> 
> --- Richard Lynch <[EMAIL PROTECTED]> wrote:
> > Is there any interest in a PHP mailing list for User Groups?
> 
> Yep. :-)
> 
> http://lists.nyphp.org/mailman/listinfo/phpm
> 
> That list consists of several user group leaders, company 
> representatives (mainly book and magazine publishers), and 
> other notable community members.
> 
> > I'm thinking topics along the lines of:
> > Forming a User Group
> > Promoting a User Group
> > Tips&Tricks for increasing attendance and the quality of meetings
> > 
> > Perhaps sharing/swapping resources, recommending speakers.
> > 
> > Posts by experts who are traveling and want to hook up with a User 
> > Group to show off their latest PHP work/technology.
> > 
> > I'd be happy to moderate such a list, and could find some 
> kind of host 
> > for it if PHP.net is not willing/suitable/able to do so.
> > 
> > I know I've had many challenges to keep the Chicago User 
> Group going 
> > and suspect many people could benefit from this sort of list.
> 
> Having another founder on the list would certainly be 
> helpful, if you're interested in contributing. Eventually, we 
> want to have much more than a mailing list, however - we'd 
> like to create a resource as useful as Perl Mongers.
> 
> Chris
> 
> =
> Chris Shiflett - http://shiflett.org/
> 
> PHP Security - O'Reilly HTTP Developer's Handbook - Sams
> Coming Soon http://httphandbook.org/
> 
> -- 
> 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] PHP problem

2004-12-17 Thread GD-Aqua
I would like to know what this problem is.

PHP has encountered an Access Violation at 01650AFD

Thank You

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



Re: [PHP] pspell on w32

2004-12-17 Thread php
Thank you for the comments.  I've run my script command line and found the 
following:

Unhandled Error: C:\Aspell\dict/en-only.rws: The file 
"C:\Aspell\data/iso8859-1.
dat" is not in the proper format.

abnormal program termination

It looks like the directory aspell is looking for is being referenced with 
the wrong type of slash?  What do I do about that?

-Ethan Nelson,
Modulus, LLC

"Richard Lynch" <[EMAIL PROTECTED]> wrote in message 
news:[EMAIL PROTECTED]
> php wrote:
>> A phpinfo() command shows that I have php4.3.10 with pspell enabled.
>> However, when I run the command pspell_check($pspell_link, "testt") in my
>> web scripts, the page appears to header redirect on itself indefinitely.
>
> Try to use wget or the MS-DOS equivalent to find out exactly what the
> web-server is sending out -- which is driving your browser crazy.
>
> Also try to run the script from an MS-DOS prompt:
> C:\php\bin\php.exe C:\full\path\to\your\script.php
>
> You'll have to get the paths right, of course, and may have to dink around
> with the Environment Variable setting of "path" in "My Computer" (I think
> that's where they hide it) so you can have all your DLLs and stuff in the
> $path variable.
>
> If all else fails, take a *COPY* of your script, and a *COPY* of php.exe
> and a *COPY* of all the DLLs you need, and toss them in a single directory
> and try to run it that way.  In theory, Windows .exes look for DLLs in
> their own directory first.
>
> 'Course, Microsoft tends to break their own rules as fast as they make
> them, so no promise on that actually working. :-v
>
> -- 
> Like Music?
> http://l-i-e.com/artists.htm 

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



Re: [PHP] Re: I got the mail form blues! HTML/POST/mail() question - Also request for style suggestions

2004-12-17 Thread Richard Lynch
Monique Verrier wrote:
> Thanks for the help already.  I am still struggling.  I didn't have any
> luck
> with urlencode(), but I used htmlentities() and the variable did get
> passed
> as a section of HTML code.  When I sent the mail, however, it displayed as
> text within the e-mail message and not as a table.  I was using these mail
> headers:

Unless you want to spend a lotof time figuring out MIME specifications,
just use the MIME email sending class from here: http://phpclasses.org

Or, better yet, DON'T SEND HTML ENHANCED (cough, cough) EMAIL!

It's *going* to get ignored by some readers, like myself.

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

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



RE: [PHP] User Groups Mailing List

2004-12-17 Thread Richard Lynch
Vail, Warren wrote:
> http://www.meetup.com is a website that has been around a couple of years
> at
> least, and provides lots of organization tips for groups interested in
> most
> subject and yes there is a whole series of them oriented around PHP, and I
> believe another around MySQL.  Promote, promote, promote, seems to be the
> word(s) for the day.

I'm actually the organizer for several Meetup groups as well.

Tell you the truth, I'm not that hot on Meetup's feature set, site design,
or implementation details.

EG:  As an Organizer, I get *way* too many notification emails, and don't
have any kind of fine-grain control, much less the concept that maybe they
should put all my stuff into one weekly update for me.  Sigh.

It's a nice idea, but I don't think they've really sat down and tested it
on normal users.

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

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



[PHP] problem with PHP

2004-12-17 Thread GD-Aqua
I would like to know what this mean`s.


PHP has encountered an Access Violation at 01650AFD


Thank You
Mike harrell

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



[PHP] nntp://news.php.net -- read only?

2004-12-17 Thread Jason Morehouse
Sorry for the lame question... but I prefer to read and reply to 
messages via the news server.  However, I can't seem to post to 
news.php.net.  I'm using thunderbird, and have tried a few different 
outgoing servers, including news.php.net.  Is the news server read only? 
 I thought for sure I was able to reply on it some time ago

Thanks,
-J
--
 Vendorama
 http://www.vendorama.com
 The evolution of e-commerce
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] mysql sessions vs flat file?

2004-12-17 Thread Greg Donald
On Fri, 17 Dec 2004 09:57:56 -0800 (PST), Richard Lynch <[EMAIL PROTECTED]> 
wrote:
> Yeah, a beginner trying to write an OOP MySQL session based system would
> take MONTHS, and still get it all wrong with nasty snarled code.

Months?  Come on..  it's just six functions and a call to
session_set_save_handler().

And a good chunck of the code is already written in the example at
http://www.php.net/session_set_save_handler.

:)


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

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



RE: [PHP] formating output

2004-12-17 Thread Jay Blanchard
[snip]
this structure prints out a table with a new row for each item


<$results[1] " ;
}
?>


what I want to do is print out a table 4 columns wide and however many
rows
high needed to run through the data

HOW do I loop through the array and  get data   printed 4 times
then a new row started and then 4 more  cells printed, etc
[/snip]

Is the data all in one row in the database?

\n;
for($i = 0; $i < count($results); $i++){
if(0 = $i%4){
print "" . $results[$i] . "\n\n\n";
} else {
print "" . $results[$i] . "\n";
}
}
print "";
?>
NOT TESTED and may give too many  tags. You'll need to test for
total data cells returned

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



[PHP] Re: nntp://news.php.net -- read only?

2004-12-17 Thread Daniel Schierbeck
Jason Morehouse wrote:
Sorry for the lame question... but I prefer to read and reply to 
messages via the news server.  However, I can't seem to post to 
news.php.net.  I'm using thunderbird, and have tried a few different 
outgoing servers, including news.php.net.  Is the news server read only? 
 I thought for sure I was able to reply on it some time ago

Thanks,
-J
No. I'm using the news server too. It's just slow sometimes, and might 
throw an error.

--
Daniel Schierbeck
Help spread Firefox (www.getfirefox.com): 
http://www.spreadfirefox.com/?q=user/register&r=6584

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


RE: [PHP] Question in posting form-data

2004-12-17 Thread Yao, Minghua
Thank you for your reply. I tried the "original" code. It worked well. But the 
site I am trying to send the data to only takes "form-data". That is why I 
modified the code. I tried $name= and urlencode. It didn't help.

-Minghua
-Original Message-
From: Richard Lynch [mailto:[EMAIL PROTECTED]
Sent: Fri 12/17/2004 11:27 AM
To: Yao, Minghua
Cc: Erwin Kerk; [EMAIL PROTECTED]
Subject: RE: [PHP] Question in posting form-data
 
Yao, Minghua wrote:
> Yes. I did modify the original since I need to send data to a program
> which takes only form-data.
> "content-disposition: " came from RFC 2388. I don't think the program can
> take application/x-www-form-urlencoded content. Further help needed.

Try it the old way -- I suspect you broke things by changing it around...

You definitely need the $name= and the urlencode of the value, however.

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






[PHP] Re: nntp://news.php.net -- read only?

2004-12-17 Thread Jason Barnett
Jason Morehouse wrote:
Sorry for the lame question... but I prefer to read and reply to 
messages via the news server.  However, I can't seem to post to 
news.php.net.  I'm using thunderbird, and have tried a few different 
outgoing servers, including news.php.net.  Is the news server read only? 
 I thought for sure I was able to reply on it some time ago

Thanks,
-J

I am using thunderbird right now to post this message, so naturally I 
can help you ;)

Tools -> Account Settings
Add Account
Newsgroup account
Your user info
news.php.net
Then when you have that set up you should see news.php.net in the left 
frame.
Right-click on it and choose subscribe
Then browse through the php folder and find which group you want to 
subscribe to (this group is php.general).  I'm using Thunderbird 1.0 
although it also worked for me in prior versions of Thunderbird (I was 
using the 0.6 tree for a while).

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


RE: [PHP] PHP problem

2004-12-17 Thread Mike
 How about this - 

Tell us the OS, version of PHP, the portion of the code it's dying on
(enable some logfile writing if you don't know) and any other *useful*
information and we might be able to help you.

Did you do any Google searching? I searched for "01650AFD" and came up with
a number of PHP-related links, but haven't investigated yet.

Your message is about as helpful as "PHP is broken, please fix".

-M

> -Original Message-
> From: GD-Aqua [mailto:[EMAIL PROTECTED] 
> Sent: Friday, December 17, 2004 2:43 PM
> To: [EMAIL PROTECTED]
> Subject: [PHP] PHP problem
> 
> I would like to know what this problem is.
> 
> PHP has encountered an Access Violation at 01650AFD
> 
> Thank You
> 
> --
> 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] How do I find my php.ini file?

2004-12-17 Thread Don
Hi,

Fedora Core 3, PHP 5.03, MySQL 4.17, Apache 2.0.52

Recent PHP installation.  I created a phpinfo() page.  When I display it in
my browser, it says:

Configuration File (php.ini) Path/etc

Yet when I log on to my server and look for it in /etc, it is not there.

How can I find it???

Thanks,
Don

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.817 / Virus Database: 555 - Release Date: 12/15/2004
 

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



RE: [PHP] problem with PHP

2004-12-17 Thread Jay Blanchard
[snip]
I would like to know what this mean`s.


PHP has encountered an Access Violation at 01650AFD


Thank You
Mike harrell
[/snip]

If you ask the question over and over no one will answer you. You must
be patient. Have you searched for the answer on the web?

An access violation usually means that PHP is attempting to use a memory
address currently occupied by other information.

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



RE: [PHP] How do I find my php.ini file?

2004-12-17 Thread Jay Blanchard
[snip]
Fedora Core 3, PHP 5.03, MySQL 4.17, Apache 2.0.52

Recent PHP installation.  I created a phpinfo() page.  When I display it
in
my browser, it says:

Configuration File (php.ini) Path/etc

Yet when I log on to my server and look for it in /etc, it is not there.

How can I find it???
[/snip]

Use a locate or find command from the command line.

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



Re: [PHP] How do I find my php.ini file?

2004-12-17 Thread Matthew Sims
> Hi,
>
> Fedora Core 3, PHP 5.03, MySQL 4.17, Apache 2.0.52
>
> Recent PHP installation.  I created a phpinfo() page.  When I display it
> in
> my browser, it says:
>
> Configuration File (php.ini) Path/etc
>
> Yet when I log on to my server and look for it in /etc, it is not there.
>
> How can I find it???
>
> Thanks,
> Don

Quick and dirty way:

$ sudo find / -name php.ini

-- 
--Matthew Sims
--

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



Re: [PHP] How do I find my php.ini file?

2004-12-17 Thread John Nichel
Don wrote:
Hi,
Fedora Core 3, PHP 5.03, MySQL 4.17, Apache 2.0.52
Recent PHP installation.  I created a phpinfo() page.  When I display it in
my browser, it says:
Configuration File (php.ini) Path/etc
Yet when I log on to my server and look for it in /etc, it is not there.
How can I find it???
find / -name php.ini
locate php.ini
If you installed from source, you will have to copy one of the ini files 
from the untared source to the proper location.

--
By-Tor.com
...it's all about the Rush
http://www.by-tor.com
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] 4.3.10 breaking things?

2004-12-17 Thread Ben
Hi All,
I just upgraded to 4.3.10 and have found a number of scripts have broken 
including:

phpMyAdmin-2.6.1-rc1
squirrelmail-1.4.3a + the xss patch
Both of these worked just fine with php 4.3.9 with the switch to 4.3.10 
being the only change that has been made.

In addition pdflib functions pdf_stringwidth, pdf_show_boxed, and 
pdf_get_value (plus more as I am quickly discovering) now require 
additional parameters although the current php documentation appears to 
suggest that these additional parameters are only required when using php5.

Is anyone else experiencing similar problems?
- Ben
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] How do I find my php.ini file?

2004-12-17 Thread John Holmes
Don wrote:
Hi,
Fedora Core 3, PHP 5.03, MySQL 4.17, Apache 2.0.52
Recent PHP installation.  I created a phpinfo() page.  When I display it in
my browser, it says:
Configuration File (php.ini) Path/etc
Yet when I log on to my server and look for it in /etc, it is not there.
How can I find it???
You don't have a php.ini file and PHP is using the defaults. If there 
was a php.ini file, it would be listed in the path, i.e. "/etc/php.ini" 
instead of just "/etc". Sample php.ini files are included with the 
source as php.ini-recommended and php.ini-dist (or file names that are 
close to that). Edit and rename to php.ini and place it in the path 
above (where PHP is expecting to find the file, /etc).

--
---John Holmes...
Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/
php|architect: The Magazine for PHP Professionals – www.phparch.com
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


php-general@lists.php.net

2004-12-17 Thread Tomas Tintera
Richard Lynch wrote:
>Perhaps something like this:
>
>function my_unset($var){
> global $$var;
> $wasset = isset($$var);
> unset($$var);
> return $wasset;
>}
>
>my_unset(‘a‘); //unset($a);
>
>
>
>Or, in a more general way:
>
>function forcereturn ($php){
> return eval($php);
>}
>
>
>Damned if I understand *why* you want this, mind you. :-)
Thank you, Richard. That's what I am looking for.
Your first solution may not be usable, because the variable to unset may
not be a global variable. The second solution (that using eval()) may
have a bug, because the unset() is called in a local-scope of the
function forcereturn() (and so the variable "unset()"ted differs from
the variable that we really want to unset()).
However, there can be used eval() instead of forcereturn():

Nevertheless, this solution has defects for general use: A lot of
expressions with no return value can't be called with eval() (e.g.
eval('break;') is not a good idea).
However I don't say I need to use a break command. All I needed was
already said. Thank you.
--Tomas_Tintera
ps. I want it because it seems to be practical to write the whole
program in a one expression (usually composed of "AND" and "OR"
operators). And it's nice. When reading such a code, you can feel as
when reading poetry ;).
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Re: 4.3.10 breaking things? Back working after reverting to 4.3.9

2004-12-17 Thread Ben
Ben wrote:
Hi All,
I just upgraded to 4.3.10 and have found a number of scripts have broken 
including:

phpMyAdmin-2.6.1-rc1
squirrelmail-1.4.3a + the xss patch
I know, bad form replying to one's own message...
Reverting back to 4.3.9 with the same build configuration options used 
in 4.3.10 has fixed the problems with the various scripts.

Because I haven't found any other mention of others having a similar 
problem (both here and on the SM and phpmyadmin lists) I'm wondering if 
this is something stupid I've done.  Any pointers would be most 
appreciated.  Here are the build configuration options I used and my 
php.ini file.

- Ben
Build Configuration Options (used for both 4.3.9 and 4.3.10):
./configure \
--with-apxs=/usr/bin/apache-1.3.33/bin/apxs \
--with-mysql \
--with-pdflib=/usr/local \
--with-gd \
--enable-ftp \
--enable-gd-imgstrttf \
--enable-calendar \
--with-png-dir=/usr/lib \
--with-zlib-dir=/usr/include \
--with-freetype-dir=/usr/local/include/freetype2 \
--with-jpeg-dir=/usr/lib \
--with-tiff-dir=/usr/lib \
--enable-track-vars \
--enable-sockets \
--enable-trans-sid \
--with-mm=/usr/lib \
--enable-gd-native-ttf \
--with-dom=/usr/lib \
--with-xslt=/usr/lib \
--with-crack=/usr/lib
php.ini (same file used for both 4.3.9 and 4.3.10 - pretty much stock):
[PHP]
engine = On
short_open_tag = On
asp_tags = Off
precision=  14
y2k_compliance = Off
output_buffering = Off
zlib.output_compression = Off
implicit_flush = Off
allow_call_time_pass_reference = On
safe_mode = Off
safe_mode_exec_dir =
safe_mode_allowed_env_vars = PHP_
safe_mode_protected_env_vars = LD_LIBRARY_PATH
disable_functions =
highlight.string  = #CC
highlight.comment = #FF9900
highlight.keyword = #006600
highlight.bg  = #FF
highlight.default = #CC
highlight.html= #00
expose_php = On
max_execution_time = 30 ; Maximum execution time of each script, in 
seconds
memory_limit = 8M  ; Maximum amount of memory a script may consume (8MB)
error_reporting  =  E_ALL & ~E_NOTICE
display_errors = On
display_startup_errors = Off
log_errors = Off
track_errors = Off
warn_plus_overloading = Off
variables_order = "EGPCS"
register_globals = On
register_argc_argv = On
post_max_size = 8M
gpc_order = "GPC"
magic_quotes_gpc = On
magic_quotes_runtime = Off
magic_quotes_sybase = Off
auto_prepend_file =
auto_append_file =
default_mimetype = "text/html"
doc_root =
user_dir =
extension_dir = ./
enable_dl = On
file_uploads = On
upload_max_filesize = 2M
allow_url_fopen = On
[Syslog]
define_syslog_variables  = Off
[mail function]
SMTP = localhost
sendmail_from =
sendmail_path = /usr/lib/sendmail -t -i
[Logging]
[Java]
[SQL]
sql.safe_mode = Off
[ODBC]
odbc.allow_persistent = On
odbc.check_persistent = On
odbc.max_persistent = -1
odbc.max_links = -1
odbc.defaultlrl = 4096
odbc.defaultbinmode = 1
[MySQL]
mysql.allow_persistent = On
mysql.max_persistent = -1
mysql.max_links = -1
mysql.default_port =
mysql.default_socket =/var/lib/mysql/mysql.sock
mysql.default_host =
mysql.default_user =
mysql.default_password =
[mSQL]
msql.allow_persistent = On
msql.max_persistent = -1
msql.max_links = -1
[PostgresSQL]
pgsql.allow_persistent = On
pgsql.max_persistent = -1
pgsql.max_links = -1
[Sybase]
sybase.allow_persistent = On
sybase.max_persistent = -1
sybase.max_links = -1
sybase.min_error_severity = 10
sybase.min_message_severity = 10
sybase.compatability_mode = Off
[Sybase-CT]
sybct.allow_persistent = On
sybct.max_persistent = -1
sybct.max_links = -1
sybct.min_server_severity = 10
sybct.min_client_severity = 10
[bcmath]
bcmath.scale = 0
[browscap]
[Informix]
ifx.default_host =
ifx.default_user =
ifx.default_password =
ifx.allow_persistent = On
ifx.max_persistent = -1
ifx.max_links = -1
ifx.textasvarchar = 0
ifx.byteasvarchar = 0
ifx.charasvarchar = 0
ifx.blobinfile = 0
ifx.nullformat = 0
[Session]
session.save_handler = files
session.save_path = /tmp
session.use_cookies = 1
session.name = PHPSESSID
session.auto_start = 0
session.cookie_lifetime = 0
session.cookie_path = /
session.cookie_domain =
session.serialize_handler = php
session.gc_probability = 1
session.gc_maxlifetime = 28800
session.referer_check =
session.entropy_length = 0
session.entropy_file =
session.cache_limiter = none
session.cache_expire = 180
session.use_trans_sid = 1
url_rewriter.tags = "a=href,area=href,frame=src,input=src,form=fakeentry"
[MSSQL]
mssql.allow_persistent = On
mssql.max_persistent = -1
mssql.max_links = -1
mssql.min_error_severity = 10
mssql.min_message_severity = 10
mssql.compatability_mode = Off
[Assertion]
[Ingres II]
ingres.allow_persistent = On
ingres.max_persistent = -1
ingres.max_links = -1
ingres.default_database =
ingres.default_user =
ingres.default_password =
[Verisign Payflow Pro]
pfpro.defaulthost = "test.signio.com"
pfpro.defaultport = 443
pfpro.defaulttimeout = 30
[Sockets]
sockets.use_system_read = On
[com]
[Printer]
zend_extension="/usr/local/lib/php_accelerator_1.3.3r2.so"
[Crack]
crack.default_dictionary = "/usr/local/lib/pw_dict"

--
PHP G

[PHP] Scope issue

2004-12-17 Thread GH
Hi I am having an issue with I think it is the scope of variables:

I have a file that I am including which has the following"

";

global $langauge;
$language['project_name'] = "P.L.I.M.S";
$language['sub_project_name'] = "DCR CC";
?>

In my main file, I am attempting to from with in a function call
$language['project_name'] and i am failing... can you offer any
advice?

Thanks

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



RE: [PHP] Re: 4.3.10 breaking things? Back working after reverting to 4.3.9

2004-12-17 Thread Michael Sims
Ben wrote:
> Reverting back to 4.3.9 with the same build configuration options used
> in 4.3.10 has fixed the problems with the various scripts.

Do you use Zend Optimizer?

If so you should upgrade to the latest version:
http://bugs.php.net/bug.php?id=31134
http://bugs.php.net/bug.php?id=31108

I don't use it personally but I figured this might be your issue.

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



[PHP] script PHP to detect IP address

2004-12-17 Thread welly limston
 
Anybody out there who know the PHP script that can use to detect an IP address 
of a PC?

If u don’t know, maybe some sites address which have related with this topic, 
might be point me little. 

 

Many your help very appreciate.

Thank’s so much for ur respone

 



-
Do you Yahoo!?
 Yahoo! Mail - You care about security. So do we.

RE: [PHP] Scope issue

2004-12-17 Thread Mike
> In my main file, I am attempting to from with in a function 
> call $language['project_name'] and i am failing... can you 
> offer any advice?
> 

Are there any specific reasons that you need to set the variable to global
scope? 

It's typically recommended that unless you need to, to pass the variable
into the function and return the modified value if you plan on changing it. 

-M

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



RE: [PHP] script PHP to detect IP address

2004-12-17 Thread Warren Vail
hmmm, perhaps you are not clear about how IP addresses are used (assigned
and reassigned), if your interest is the ip address of a PC connected to
your website or the ip of the website, probably depends on your web server,
for my apache server;

$_SERVER["SERVER_ADDR"] (apache server IP address, at least the one being
used by my connection)
$_SERVER["REMOTE_ADDR"] (browser IP address, that is connected to my task)

If on the other hand you are talking about a stand alone script, you need to
understand how IP addresses are assigned as needed (there is probably no one
IP address that identifies a single PC in most cases), there are a few
exceptions where fixed IP addresses are assigned, but more often not.
Perhaps if you were to identify what you are trying to find out, asking that
question would get you a more definitive answer?

good luck,

Warren Vail

> -Original Message-
> From: welly limston [mailto:[EMAIL PROTECTED]
> Sent: Friday, December 17, 2004 6:18 PM
> To: [EMAIL PROTECTED]
> Subject: [PHP] script PHP to detect IP address
>
>
>
> Anybody out there who know the PHP script that can use to detect
> an IP address of a PC?
>
> If u dont know, maybe some sites address which have related with
> this topic, might be point me little.
>
>
>
> Many your help very appreciate.
>
> Thanks so much for ur respone
>
>
>
>
>
> -
> Do you Yahoo!?
>  Yahoo! Mail - You care about security. So do we.

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



Re: [PHP] formating output

2004-12-17 Thread Tatang Widyanto
print "\n";
print "\n";
$counter = 0;
while ($result = mysql_fetch_array($pointer)) {
$counter++;
if ($counter % 4 === 0) {
print "".$result[1]."\n";
print "\n";
print "\n";
} else {
print "".$result[1]."\n";
}
}
// add blank cells if number of cell on last row isn'4 four.
for ($i = 0; $i < $counter % 4; $i++) {
print " \n";
}
print "\n";
print "\n";
-
Larry L wrote:
I'm sure this is easy and I'll feel silly when I see how it's done,
but, my mnd is a blank,
this structure prints out a table with a new row for each item
 
 <$results[1] " ;
}
?>

what I want to do is print out a table 4 columns wide and however many rows
high needed to run through the data
HOW do I loop through the array and  get data   printed 4 times
then a new row started and then 4 more  cells printed, etc
thank you in advance
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] How do I find my php.ini file?

2004-12-17 Thread S. Kang
use phpinfo() function
and look for "Configuration File (php.ini) Path". for example of php 
5.0x, it is normally /etc/php.5.ini

good luck.
Jay Blanchard wrote:
[snip]
Fedora Core 3, PHP 5.03, MySQL 4.17, Apache 2.0.52
Recent PHP installation.  I created a phpinfo() page.  When I display it
in
my browser, it says:
Configuration File (php.ini) Path/etc
Yet when I log on to my server and look for it in /etc, it is not there.
How can I find it???
[/snip]
Use a locate or find command from the command line.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Re: 4.3.10 breaking things? Back working after reverting to 4.3.9

2004-12-17 Thread The Doctor
On Fri, Dec 17, 2004 at 06:47:23PM -0600, Michael Sims wrote:
> Ben wrote:
> > Reverting back to 4.3.9 with the same build configuration options used
> > in 4.3.10 has fixed the problems with the various scripts.
> 
> Do you use Zend Optimizer?
> 
> If so you should upgrade to the latest version:
> http://bugs.php.net/bug.php?id=31134
> http://bugs.php.net/bug.php?id=31108
> 
> I don't use it personally but I figured this might be your issue.
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 

It broke serendipity.

-- 
Member - Liberal International  
This is [EMAIL PROTECTED]   Ici [EMAIL PROTECTED]
God Queen and country! Beware Anti-Christ rising!
Merry Christmas 2004 and Happy New Year 2005

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