[PHP] PHP wiki recommendations

2005-09-08 Thread Murray @ PlanetThoughtful
Hi All,

I want to add a wiki to my blog site to help create a knowledgebase of the
characters, localities, stories I write to make it easier for new visitors
to delve into the areas that interest them.

I've been experimenting with a couple of different wiki packages, but am
always interested in others' thoughts and recommendations.

In particular, I've looked at MediaWiki and PmWiki. Of the two, I like
MediaWiki's 'completeness', but it's also quite slow and doesn't strike me
as being particularly (or easily?) customizable. PmWiki is probably my
current candidate, but again I'd like to make sure I'm not missing a more
obvious choice.

My shopping list for the ideal wiki application is:

- wiki entries preferably stored in MySQL tables. I'm not adamant about this
(eg PmWiki uses files rather than a db backend), but it would suit my
purposes better to be able to draw from the wiki tables from the front page
of my blog to show lists of recently added and recently updated wiki entries

- non-reliance on CamelCase wiki links. Many of my characters etc use joined
CamelCase names (eg KillFork and DangerSpoon), and to avoid confusion I'd
rather explicitly define links to wiki content

- ability to categorize wiki entries

- ability to compare history of wiki edits and easily reinstate older edits
if wiki pages get 'graffiti'd' 

- ability to allow others to edit / create wiki entries, thru a user id /
password system, so that regulars who would like to participate can do so

- ability to customize presentation of wiki pages, presumably through CSS
etc, so that I can maintain the 'look and feel' of my blog thru the wiki
content

- PHP based, though my host does run Perl, so if the killer wiki app is a
Perl-based one, I'm sure I can muddle thru implementing it

If anyone has any recommendations for other wiki applications I should look
at before making a decision, I'd love to hear from you!

Much warmth,

Murray
---
Lost in thought...
http://www.planetthoughtful.org

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



[PHP] preg_match help please

2005-09-08 Thread Steve Turnbull
Hi

I am trying to find a regular expression to match a variable, what I think
should work (but doesn't) is;

preg_match ('^/[\w],[\w],/', $variable)

The $variable MUST contain an alpha-numeric string, followed by a comma,
followed by another alpha-numeric string, followed by another comma
followed by (but doesn't have to!!) another alpha-numeric string followed
by nothing.

I realise my regex above doesn't allow for the last 'followed by nothing',
but to me it looks like it should match the first part of the string up to
the last comma?

Help appreciated, and apologies if this isn't strictly the correct group.

Thanks
Steve

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



Re: [PHP] preg_match help please

2005-09-08 Thread Jasper Bryant-Greene

Steve Turnbull wrote:

I am trying to find a regular expression to match a variable, what I think
should work (but doesn't) is;

preg_match ('^/[\w],[\w],/', $variable)

The $variable MUST contain an alpha-numeric string, followed by a comma,
followed by another alpha-numeric string, followed by another comma
followed by (but doesn't have to!!) another alpha-numeric string followed
by nothing.

I realise my regex above doesn't allow for the last 'followed by nothing',
but to me it looks like it should match the first part of the string up to
the last comma?


Something like

'/^\w+,\w+,\w*$/'

maybe? (untested)

http://php.net/reference.pcre.pattern.syntax

--
Jasper Bryant-Greene
Freelance web developer
http://jasper.bryant-greene.name/

If you find my advice useful, please consider donating to a poor
student! You can choose whatever amount you think my advice was
worth to you. http://tinyurl.com/7oa5s

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



[PHP] unserialize() problem

2005-09-08 Thread Harris Kosmidhs
Hello all.

I wrote some php pages running on apache1.3/php4.4.0-1
In the login page I make use of a class where I store the users name and
some integers (i.e whether the user ia able to see a certain page) and
serialize the class to a session var. When you go to a page I
unserialize the session var and check if the user is permited to see the
page.

No when I moved the files to my host server running apache2/php4.3.2 a
strange problem appears. When I access the page for the first time the
session var is unserialized ok and so I can see the page. If I refresh
it this session var (and only this.alla the other session variables wotk
ok) is lost and I cannot unserialize it.

What may be the problem?

Thanks

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



Re: [PHP] preg_match help please

2005-09-08 Thread Steve Turnbull
On Thu, 08 Sep 2005 19:27:49 +1200, Jasper Bryant-Greene wrote:

 Steve Turnbull wrote:
 I am trying to find a regular expression to match a variable, what I think
 should work (but doesn't) is;
 
 preg_match ('^/[\w],[\w],/', $variable)
 
 The $variable MUST contain an alpha-numeric string, followed by a comma,
 followed by another alpha-numeric string, followed by another comma
 followed by (but doesn't have to!!) another alpha-numeric string followed
 by nothing.
 
 I realise my regex above doesn't allow for the last 'followed by nothing',
 but to me it looks like it should match the first part of the string up to
 the last comma?
 
 Something like
 
 '/^\w+,\w+,\w*$/'
 
 maybe? (untested)
 
 http://php.net/reference.pcre.pattern.syntax

Thats got me a lot further - thanks

I reduced it slightly to '/^\w+,\w+,' because at the end there is the
possibility of an alpha-numeric character(s) OR nothing at all with the
exception of a possible line break (note possible)

It's the 'possibly nothing at all' which I am slightly stuck on

Thanks
Steve

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



Re: [PHP] preg_match help please

2005-09-08 Thread Jasper Bryant-Greene

Steve Turnbull wrote:

On Thu, 08 Sep 2005 19:27:49 +1200, Jasper Bryant-Greene wrote:


Something like

'/^\w+,\w+,\w*$/'

maybe? (untested)

http://php.net/reference.pcre.pattern.syntax



Thats got me a lot further - thanks

I reduced it slightly to '/^\w+,\w+,' because at the end there is the
possibility of an alpha-numeric character(s) OR nothing at all with the
exception of a possible line break (note possible)

It's the 'possibly nothing at all' which I am slightly stuck on


That's what the \w* means. That means 0 or more word-characters, as 
opposed to \w+ which means 1 or more word-characters. The $ after that 
means end of string which makes sure that it's the last thing in the 
string.


In other words, \w* means some word-characters, or nothing at all. You'd 
need to handle the newline in much the same way. The URL I gave you 
should help out a lot with that.


--
Jasper Bryant-Greene
Freelance web developer
http://jasper.bryant-greene.name/

If you find my advice useful, please consider donating to a poor
student! You can choose whatever amount you think my advice was
worth to you. http://tinyurl.com/7oa5s

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



Re: [PHP] regular expression for integer range

2005-09-08 Thread Mark Rees
Murray @ PlanetThoughtful [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
  Hi all,
 
 
  I want to write regular expression for checking the string format
entered
  by user.
 
  the allowed formats are
 
  examples:
  10
  10,
  10,12-10
  12-10
 
  that is the valid strings are:
  1. only integer
  2. an integer, range of integers example 3
 
  and no other characters must be allowed.

You could simplify the matter by replacing all - and , with, say, 0 and
then using the simple \d+ (I think) regexp.


 Hi babu,

 As you've pointed out, you have 4 distinct scenarios to deal with, and it
 may be very difficult, without a great deal of tuning and tweaking, to
 define a regular expression that can effectively match all 4 scenarios
 without including false matches as well.

 One way of dealing with this is to build more specialized and exact
regular
 expressions for each possible scenario and group them together in an if
 statement.

 Eg.

 if (preg_match('/^\d+$/',$subject) || preg_match('/^\d+,$/',$subject) ||
 preg_match('/^\d+,\d+-\d+$/', $subject) || etc etc){

 // code for successful match of valid data in $subject

 } else {

 // code for invalid data in $subject

 }

 Basically, the if/else statement is testing each distinct possible pattern
 and executing code if any of those distinct possible patterns match.

 It may not ultimately be the most graceful way of dealing with the
 situation, but having spent many hours attempting to tweak complex regular
 expressions looking for the magic combination, I've learned that breaking
 scenarios down this way can save a lot of development time and
frustration.
 This doesn't mean there isn't a benefit to finding the perfect regular
 expression for your needs, just that it can often be difficult to
guarantee
 your code won't be plagued by false matches or false exclusions as your
 expression becomes more and more complex.

 Hope this helps a little.

 Much warmth,

 Murray
 ---
 Lost in thought...
 http://www.planetthoughtful.org

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



[PHP] problem with multi field validation

2005-09-08 Thread Muthukumar
Hi All,

Greetings.

I am working on making php script with gets information from a file with five fields and load it on browser.

# cat machines.log
machine1:os:team1:member1:booked

machine2:os:team1:member2:booked

machine3:os:team1::

machine4:os:team1::

format is like machine:os:team:member owning now: booked / available status

Requirement as,

Read machines.log and update the gui. Change machines.log and gui on getting inputs from user on member and booked field. Member field is text box and booked is selection box. If I have two or more machines with empty members, I can not get form value using _javascript_.


I have attached my machines.php file for your views.

Please revert with any queries and inputs.

Thanks,
-Muthu

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

[PHP] regex

2005-09-08 Thread Merlin

Hi there,

I would like to create a regex which only executes if the client does not come 
from a specified IP adress.


Any ideas how to place this into the Rewrite Rule regex?:

RewriteRule  ^(.*)$

Thank you for any help on that,

Merlin

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



Re: [PHP] regex

2005-09-08 Thread Jasper Bryant-Greene

Merlin wrote:
I would like to create a regex which only executes if the client does 
not come from a specified IP adress.


Any ideas how to place this into the Rewrite Rule regex?:


What does this have to do with PHP?

http://www.google.com/search?q=regular+expression

The top four or five results on that search will all answer your question.

--
Jasper Bryant-Greene
Freelance web developer
http://jasper.bryant-greene.name/

If you find my advice useful, please consider donating to a poor
student! You can choose whatever amount you think my advice was
worth to you. http://tinyurl.com/7oa5s

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



[PHP] RE: [PHP-DEV] OCI8 1.1 announce

2005-09-08 Thread BUSTARRET, Jean-Francois

 -Message d'origine-
 De : Antony Dovgal [mailto:[EMAIL PROTECTED]
 Envoyé : mercredi 7 septembre 2005 18:06
 À : php-dev; [EMAIL PROTECTED]; php-general@lists.php.net
 Objet : [PHP-DEV] OCI8 1.1 announce

 Hi all,

 Yesterday OCI8 extension have been updated in the PHP CVS (HEAD only).
 This updated driver resolves a large amount of bug reports and adds
 some improvements both functionality and performance, and much better
 documentation (see here: http://php.net/oci8).
 
 A lot of time has been invested in updating this driver including
 help from Wez Furlong and the OCI team which gave a lot of feedback
 on how to do things the best and most efficient way.

[...]

Great news !

I'll test the new oci8 soon.

Thanks for your work.

Jean-François

-
Le present message (y compris tous les elements attaches) est confidentiel et 
est destine a ses seuls destinataires. Si vous
l'avez recu par erreur, merci de l'indiquer a son expediteur par retour et de 
proceder a sa destruction dans vos systemes.
Toute utilisation ou diffusion non autorisee de son contenu, en totalite ou en 
partie, est strictement interdite. Les idees et
opinions presentees dans ce message sont celles de son auteur, et ne 
representent pas necessairement celles de TF1 (et/ou des
entites membres du Groupe TF1).

This message (including any attachments) is confidential and may be privileged. 
If you have received it by mistake please notify
the sender by return email and delete this message from your system. Any 
unauthorised use or dissemination of this message in
whole or in part is strictly prohibited. Any views or opinions presented are 
solely those of its author and do not necessarily
represent those of TF1 (and/or its group companies).

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



RE: [PHP] preg_match help please

2005-09-08 Thread Ford, Mike
On 08 September 2005 09:15, Steve Turnbull wrote:

 On Thu, 08 Sep 2005 19:27:49 +1200, Jasper Bryant-Greene wrote:
 
  Steve Turnbull wrote:
   I am trying to find a regular expression to match a variable,
   what I think should work (but doesn't) is; 
   
   preg_match ('^/[\w],[\w],/', $variable)
   
   The $variable MUST contain an alpha-numeric string, followed by a
   comma, followed by another alpha-numeric string, followed by
   another comma followed by (but doesn't have to!!) another
   alpha-numeric string followed by nothing. 
   
   I realise my regex above doesn't allow for the last 'followed by
   nothing', but to me it looks like it should match the first part
   of the string up to the last comma?
  
  Something like
  
  '/^\w+,\w+,\w*$/'
  
  maybe? (untested)
  
  http://php.net/reference.pcre.pattern.syntax
 
 Thats got me a lot further - thanks
 
 I reduced it slightly to '/^\w+,\w+,' because at the end there is the
 possibility of an alpha-numeric character(s) OR nothing at
 all with the
 exception of a possible line break (note possible)
 
 It's the 'possibly nothing at all' which I am slightly stuck on

The * takes care of that -- it means 0 or more of the preceding entity.

Cheers!

Mike

-
Mike Ford,  Electronic Information Services Adviser,
Learning Support Services, Learning  Information Services,
JG125, James Graham Building, Leeds Metropolitan University,
Headingley Campus, LEEDS,  LS6 3QS,  United Kingdom
Email: [EMAIL PROTECTED]
Tel: +44 113 283 2600 extn 4730  Fax:  +44 113 283 3211 


To view the terms under which this email is distributed, please go to 
http://disclaimer.leedsmet.ac.uk/email.htm

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



[PHP] Cleaning a resultset

2005-09-08 Thread Shaun
Hi,

I have a resultset from a query and need to remove some rows after doing 
some php processing then insert into another table i.e.

/** Get data**/
 $qid = mysql_query('SELECT ...);

 /** Clean data **/
 while( $r = mysql_fetch_object( $qid ) ) {

 }

How can i generate a new resultset / remove data from the existing resultset 
using this method?

Thanks for your help 

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



RE: [PHP] Cleaning a resultset

2005-09-08 Thread Murray @ PlanetThoughtful
 Hi,
 
 I have a resultset from a query and need to remove some rows after doing
 some php processing then insert into another table i.e.
 
 /** Get data**/
  $qid = mysql_query('SELECT ...);
 
  /** Clean data **/
  while( $r = mysql_fetch_object( $qid ) ) {
 
  }
 
 How can i generate a new resultset / remove data from the existing
 resultset
 using this method?
 
 Thanks for your help

Hi Shaun,

Basically while iterating thru the resultset in $qid, test / cleans the data
row by row, and perform an INSERT query for each row within your while loop
that you want to be inserted into your other table.

Hope this helps.

Much warmth,

Murray
---
Lost in thought...
http://www.planetthoughtful.org



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



Re: [PHP] regex

2005-09-08 Thread John Nichel

Merlin wrote:

Hi there,

I would like to create a regex which only executes if the client does 
not come from a specified IP adress.


Any ideas how to place this into the Rewrite Rule regex?:


I'm betting members of the Apache mailing list know.

--
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



[PHP] access resources via a proxy

2005-09-08 Thread Vedanta Barooah
Hello all!

Consider this...

Web Server A belongs to an intranet and hosts sites internally, Server
A can only access external web resources via proxy http://proxy:8080 .
How does Server A access resources from Server B which is in the
internet using PHP?

A typical scenario:
Server A needs to display news, which resides on Server B as RSS
feeds. For this the PHP script hosted on Server A need to go via the
proxy http://proxy:8088 then read the feed in Server B for it to
display… how this can be achieved?

Any clues please help!!

Thanks,
Vedanta


RE: [PHP] Help with Class

2005-09-08 Thread Ian Barnes
Hi Thomas,

Thanks for the help. That didn't work though ...

Its now set to be $SDK = new sdk;

Nothing :(

-Original Message-
From: Thomas [mailto:[EMAIL PROTECTED] 
Sent: 08 September 2005 09:08 AM
To: 'Ian Barnes'
Subject: RE: [PHP] Help with Class


Sorry for not explaining ... [code]$SDK = new ipbsdk;[/code] initializes
the $SDK variable as a reference of the class ipbsdk. The '' operator is
called the reference operator. So by leaving it out you copy (the default
initialization) the resulting class object.

Maybe that does the trick.

T

-Original Message-
From: Ian Barnes [mailto:[EMAIL PROTECTED] 
Sent: 08 September 2005 08:52 AM
To: 'Thomas'
Subject: RE: [PHP] Help with Class

Sorry for the stupid question. How do I init the class as a copy not a
reference ?

-Original Message-
From: Thomas [mailto:[EMAIL PROTECTED] 
Sent: 08 September 2005 08:25 AM
To: 'Ian Barnes'
Subject: RE: [PHP] Help with Class

Hmm, that is strange because OO tells us that by nulling an object you
destroy it. I don't see what the other person could have done to avoid the
destruction of his class ... (that would be above my head)

One more thing I would try (which you have not done yet) is to initialize
the class as a copy and not a reference. That should not impair your code
much because you are creating a new one ever time anyway.

 think it cant be done
That would somehow go against my understanding of OO programming ;-) ...

Good luck.

Thomas

-Original Message-
From: Ian Barnes [mailto:[EMAIL PROTECTED] 
Sent: 08 September 2005 08:07 AM
To: 'Thomas'
Subject: RE: [PHP] Help with Class

Hi,

I put the db object in there temporarily because the SDK class resets it and
I haven't gotten round to changing it yet. 

I tried initing $SDK to null at the start but that hasn't worked either.

The class that I initing isn't mine, it was written by someone else and they
don't allow for multiple directories. The first run in the foreach loop runs
perfectly, I get all the info back I need, so its just when the loop runs
again. 

Here is my current code with all options I have tried:
foreach ( $forums as $num=$val )
{
$SDK=null;
$sdk = null;
$db = new db ( 'localhost' , 'user' , 'pass' , 'db' );
$sql = 'SELECT * FROM vaults WHERE id = '.$val.'';
$result = $db-get($sql);
$fetchd = mysql_fetch_array ( $result );
$forumid = $fetchd['forumid'];
$posterid = $fetchd['posterid'];
$title = $_POST['title'];
$desc = $_POST['desc'];
$post = $_POST['post'];
require_once ( $fetchd['path'].'sdk/ipbsdk_class.inc.php' );
$SDK = new ipbsdk;
$info = $SDK - get_info ( $posterid );
$postername = $info['name'];
echo Forum ID:.$forumid;
echo BRTitle:.$title;
echo BRDesc:.$desc;
echo BRPost:.$post;
echo BRPosterID:.$posterid;
echo BRPosterName:.$postername;
echo BR;
//  if ($SDK - new_topic($forumid, $title, $desc, $post, $posterid,
$postername)) {
//  echo 'Topic Created!';
//  } else {
//  echo $SDK-sdk_error();
//  }
unset ( $sdk );
$SDK = null;
unset ( $SDK );
$sdk = null;
unset ( $GLOBALS['SDK']);
unset ( $GLOBALS['sdk'] ) ;
$GLOBALS['SDK'] = null;
$GLOBALS['sdk'] = null;
$_SESSION['sdk'] = null;
$_SESSION['SDK'] = null;
unset ( $_SESSION['SDK'] );
unset ( $_SESSION['sdk'] );
register_shutdown_function($SDK);
register_shutdown_function($sdk);
}

So as you can see, I have tried a lot of things and im starting to think it
cant be done, in which case ill just have to take the other persons class
and either modify it (which is against his terms) or take what he does and
do it manually myself.

Thanks for the help.

Ian



-Original Message-
From: Thomas [mailto:[EMAIL PROTECTED] 
Sent: 08 September 2005 07:54 AM
To: 'Ian Barnes'
Subject: RE: [PHP] Help with Class

First up, I am not sure if you need to create a new db object every single
loop, as far as I can see you can easily leave that outside the loop (unless
you connect to a different db on each loop).

Maybe you could initialize the $SDK variable on top of your loop with null
($SDK=null;) that way ever loop will serve you up with a 'nulled' $SDK
variable.

Does your current code not initialize the correct classes?

T

-Original Message-
From: Ian Barnes [mailto:[EMAIL PROTECTED] 
Sent: 08 September 2005 07:19 AM
To: [EMAIL PROTECTED]
Cc: 'PHP General'
Subject: RE: [PHP] Help with Class

Hi,

 

Thanks for the help, but none of those worked. 

 

Anyone else got any suggestions? Or possibly another way of achieving this ?

 

Cheers

Ian

 

  _  

From: Jason Davidson [mailto:[EMAIL PROTECTED] 
Sent: 07 September 2005 05:47 PM
To: Ian Barnes
Cc: PHP General
Subject: Re: [PHP] Help with Class

 

I would have guessed unset($sqk); 

[PHP] Deadlock with session handling code?

2005-09-08 Thread Ben Ramsey
The following message is from a co-worker. I'm passing it along as a 
favor. Any help would be greatly appreciated since we're both somewhat 
stuck with no clue how to proceed with this.


Thanks,
Ben Ramsey



I'm having a major problem with my PHP scripts getting stuck on one of 
our production servers.


The system runs normally for a while, but after some time, certain httpd 
processed get wedged.  This causes the server to spawn more httpd 
processes, but those eventually get stuck too, and the whole mess shuts 
down once we reach MaxServers.


Without knowing too much about PHP, this appears to be related to some 
sort of deadlock in the session handling code.  The problem seems to 
occur regardless of which script is being used, but I admittedly cannot 
figure out how to reproduce it.  It only seems to occur when the system 
gets under heavy load, though.  (The Red Cross linked to our site this 
morning to help collect volunteers for the hurricane relief effort, and 
that caused the server to die in short order. :-( )


We're using Apache 2.0.46-RH (prefork MPM) and PHP 4.3.2 (RedHat pl23). 
 Unfortunately, we are running in a managed hosting environment, so we 
cannot easily change Apache or PHP versions.


I was able to attach a GDB process to one of the running Apaches, and I 
found the following stack trace.  Unfortunately, it couldn't figure out 
how to find the symbols (see above comment about the managed hosting 
environment), but there were a few useful tidbits:


(gdb) bt
#0  0x0042b291 in flock () from /lib/tls/libc.so.6
#1  0x010c23de in zm_info_session () from /etc/httpd/modules/libphp4.so
#2  0x0002 in ?? ()
#3  0x0180 in ?? ()
#4  0x094919cc in ?? ()
#5  0x09273220 in ?? ()
#6  0xbfffa5a4 in ?? ()
#7  0xbfffa594 in ?? ()
#8  0xbfffa110 in ?? ()
#9  0x094107f4 in ?? ()
#10 0x093f32cf in ?? ()
#11 0x0001 in ?? ()
#12 0xbfffa120 in ?? ()
#13 0x706d742f in ?? ()
#14 0x7365732f in ?? ()
#15 0x32645f73 in ?? ()
#16 0x63393966 in ?? ()
#17 0x62393063 in ?? ()
#18 0x37663530 in ?? ()
#19 0x38643466 in ?? ()
#20 0x34353166 in ?? ()
#21 0x32366630 in ?? ()
#22 0x33663961 in ?? ()
#23 0x3965 in ?? ()
#24 0x011f9003 in ?? () from /etc/httpd/modules/libphp4.so
#25 0xb5650760 in ?? ()
#26 0xb5650758 in ?? ()
#27 0xbfffa198 in ?? ()
#28 0xbfffa594 in ?? ()
#29 0x in ?? ()

I poked around in the PHP code until I found the zm_info_session 
function in the session handler.  I didn't see how that function could 
be related, but I noticed an associated flock() call in the files 
module.  On that hunch, I then decided to see what I could find with lsof:


/usr/sbin/lsof | sort -k 9 | grep sess

httpd   15498  apache   81uW  REG104,5 172917162 
/tmp/sess_d2f99cc09b05f7f4d8f1540f62a9f3e9
httpd   15594  apache   81u   REG104,5 172917162 
/tmp/sess_d2f99cc09b05f7f4d8f1540f62a9f3e9
httpd   15728  apache   81u   REG104,5 172917162 
/tmp/sess_d2f99cc09b05f7f4d8f1540f62a9f3e9
httpd   15934  apache   81u   REG104,5 172917162 
/tmp/sess_d2f99cc09b05f7f4d8f1540f62a9f3e9
httpd   15955  apache   81u   REG104,5 172917162 
/tmp/sess_d2f99cc09b05f7f4d8f1540f62a9f3e9
httpd   15957  apache   81u   REG104,5 172917162 
/tmp/sess_d2f99cc09b05f7f4d8f1540f62a9f3e9
httpd   15959  apache   81u   REG104,5 172917162 
/tmp/sess_d2f99cc09b05f7f4d8f1540f62a9f3e9
httpd   15982  apache   81u   REG104,5 172917162 
/tmp/sess_d2f99cc09b05f7f4d8f1540f62a9f3e9
httpd   16071  apache   81u   REG104,5 172917162 
/tmp/sess_d2f99cc09b05f7f4d8f1540f62a9f3e9
httpd   16072  apache   81u   REG104,5 172917162 
/tmp/sess_d2f99cc09b05f7f4d8f1540f62a9f3e9

[... many, many httpd processes later ...]
httpd   16368  apache   81u   REG104,5 172917162 
/tmp/sess_d2f99cc09b05f7f4d8f1540f62a9f3e9
httpd   16372  apache   81u   REG104,5 172917162 
/tmp/sess_d2f99cc09b05f7f4d8f1540f62a9f3e9
httpd   16373  apache   81u   REG104,5 172917162 
/tmp/sess_d2f99cc09b05f7f4d8f1540f62a9f3e9
httpd   16375  apache   81u   REG104,5 172917162 
/tmp/sess_d2f99cc09b05f7f4d8f1540f62a9f3e9
httpd   16376  apache   81u   REG104,5 172917162 
/tmp/sess_d2f99cc09b05f7f4d8f1540f62a9f3e9


Aha!  The 81uW appears to tell us that PID 15498 has an exclusive 
write lock on the entire file, and that the other httpd processes have 
read or write locks of some length.  All of these processes *stayed* in 
this state for a very long time.


As an experiment, I tried killing PID 15498, but it just moved the W 
lock to some other process within the group, per lsof.  Nonetheless, it 
seemed like all of the processes were waiting for something.


In one other case, later in the day, I found a situation where the 
processes also seemed to be in the same state.  It hadn't gotten to the 
point where it killed the machine, but I saw a bunch of httpd's running 
and trying to access the same 

[PHP] Better timestamp explanation to the client

2005-09-08 Thread Ryan A
Hi,
In one of our tables we have these fields:

cust_no bigint(20),
cust_name varchar(30),
last_online datetime,

and in that members profile, if someone visits it, on the top of the page we
have this:

// connect to db, query for record and display it below
Last seen: ?php echo $last_online; ?

Any ideas on the simplest way to make it look like this:

Last seen: Less than a minute ago!

Last seen: 25 mins ago

Last seen:  2 hours 11 mins ago

Last seen: 1 (or 2 or 3) day/s ago

else{ echo $last_seen; }



I have seen this done on a few sites (Swedish sites actually, I can give you
the URLs if you need them)

I think it looks much better than:
Last seen : 2005-09-07 20:59:01


Thanks!
Ryan

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



Re: [PHP] Sessions , expiry times and different time zones

2005-09-08 Thread Jordan Miller
As I said, **rather** than relying on cookie expiration. This  
*necessarily* means that you will need to set the cookie expiration  
to sometime way in the future, like next year (or more dynamically,  
use the date() and mktime() functions to always set the cookie  
expiration to + 1 yr from today). If you do this, you will have no  
chance of the cookie itself expiring; therefore you can rely solely  
on the $_SESSION variable. The cookie will contain the session id  
that the webserver will be able to use to repopulate the $_SESSION  
variable as long as $_SESSION['expiration'] is still in the future.  
If $_SESSION['expiration'] is in the past (or is empty) and you issue  
a session_destroy() and a setcookie(), the cookie can be destroyed, too.


I have written something similar to this in the past, and it behaves  
exactly as you would like and expect. Another benefit is that this is  
more secure than relying on a cookie-supplied expiration time.


Jordan



On Sep 6, 2005, at 8:51 PM, Dan Rossi wrote:



client cookie expires hence no more session ...

On 07/09/2005, at 1:57 AM, Jordan Miller wrote:




Hi  Dan,

Couldn't you store an expiration time directly in the $_SESSION  
variable, rather than relying on cookie expiration (if I  
understand your question correctly)?  Each time a page is loaded,  
update the expiration time in this variable to +24hr from the  
current time (all times relative to the server's time). Then, it  
shouldn't matter from which time zone the user is browsing.


Jordan



On Sep 6, 2005, at 10:37 AM, Dan Rossi wrote:




hi there I have run into problems with sessions , cookies and  
expiryt times with different time zones. Ie our server is in the  
States however I am browsing from Koala land downunder. I have  
been trying to get the session to expire in a day, however for  
ppl in the states this is ok, but for me its already expired so i  
have been experiencing issues. How do i solve this ?


--
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] Parsing MS-WORD docs

2005-09-08 Thread Rory Browne
What OS are you using?

What do you want to do? ie why do you want to parse them?

Chances are that you will not be able to do it with PHP, but may be
able to call an external utility from PHP that will perform the
required task.

On 9/7/05, Shafiq Rehman [EMAIL PROTECTED] wrote:
 Hello,
 
 I want to parse the .doc files with PHP. Anybody have some idea regarding
 this problem.
 
 Your help regarding this matter is really appreciated
 
 Regards
 --
 
 PHP is too logical for my brain (http://www.phpgurru.com)
 


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



Re: [PHP] Breaking up search terms into an array intelligently

2005-09-08 Thread Paul Groves

Brent Baisley wrote:
It sounds like you are trying to build a full text search string,  
perhaps for searching a MySQL database?


Actually, I was thinking of doing a MySQL non full-text search, hence 
the need to split the words/phrases up so that they could then be fed 
into individual WHERE fieldname LIKE %word% SQL fragments, but now 
I'm thinking maybe it would be a better idea to do a FULLTEXT search 
(with the indexes set up), espc. as what I need it for is a 
Google-like search of many fields at once within a table, would 
certainly make for a less complex query...


Below is the function I came  up 
with a while ago. It's worked fine, although it currently does not  
check for multiple spaces, but that should be easy to change. 


Yup, I've written an enhanced_explode() function that does just this 
(using preg_split)


It uses  a 
space as a delimiter and it checks for quotes for searching on  phrases. 


I like the way this bit works! :-)

It returns the search string for a MySQL full text boolean  mode search. 
You should be able to easily adapt it to your specific  needs.


There's a few things I'm a bit confused about - e.g. if you're doing a 
FULLTEXT search, why do you need to split things up at all? In FULLTEXT 
 searches the search string is parsed into words anyway. However, I can 
see that you've seperated all the search values with a + by the end, 
and that you've appended a * onto the end of search terms, so I assume 
what you're actually doing is preparing for a BOOLEAN mode FULLTEXT 
search? Actually, this must be the case, otherwise the phrase search is 
meaningless! :-)


A boolean search could actually be quite useful for my needs, my only 
concerns really are a) Results are not sorted by relevance unlike a 
normal FULLTEXT search (so what are they ordered by?) and b) if I use 
the function below, then any user-added operators (+, - etc.) in 
$seachVal are not really dealt with properly - am I right in assuming 
either use the function, or allow users to enter their own operators, 
but not both (apart from quoting phrases)?


BTW sorry for my ignorance here, I''ve only recently begun to look into 
FULLTEXT searches!


thanks

Paul


function prepFullTextSearch($searchVal) {
//Split words into list
$word_List= explode(' ',stripslashes(trim 
($searchVal)));

//Step through word list to get search phrases
$i= 0;
$isPhrase= false;
foreach($word_List as $word) {
$searchItems[$i]= trim(($isPhrase?$searchItems[$i].'  
'.$word:$word));

//Check for start of Phrase
if(substr($searchItems[$i],0,1) == '') {
$isPhrase= true;
}
//If not building a phrase, append wildcard (*) to end  of word
if(!$isPhrase) {
$searchItems[$i].= '*';
$i++;
}
//Check for end of Phrase
if(substr($searchItems[$i],-1) == '') {
$isPhrase= false;
$i++;
}
}
$searchVal= '+'.implode(' +',$searchItems);
return $searchVal;
}



On Sep 7, 2005, at 10:54 AM, Paul Groves wrote:

I want to be able to break up a number of search terms typed into  an 
input

box into array, simple enough one would think, just use explode, e.g


$array = explode( , $string);


But what if I want to be able to cope with search terms seperated  by  1
space (a common typing error)? This should work:


function enhanced_explode($string) {
 $array = preg_split (/\s+/, $string);
 return ($array);
}


But what if I want to allow Google-type search parameters, so that
something like the following is split into 3 search terms?:
firstsearchterm second search term thirdsearchterm
The following code will do the trick, but is slow and doesn't allow  for
multiple spaces as the delimiter, nor the possibility of multiple  
delimiters

(e.g.  , +, , etc.)


function explode2($delimeter, $string)
{
   for ($i = 0; $i  strlen($string); $i++)
   {
   if ($string{$i} == '')
   {
   if ($insidequotes)
   $insidequotes = false;
   else
   $insidequotes = true;
   }
   elseif ($string{$i} == $delimeter)
   {
   if ($insidequotes)
   {
   $currentelement .= $string{$i};
   }
   else
   {
   $returnarray[$elementcount++] = $currentelement;
   $currentelement = '';
   }
   }
   else
   {
   $currentelement .= $string{$i};
   }
   }

   $returnarray[$elementcount++] = $currentelement;

   return $returnarray;
}

None of these solutions are ideal, I guess a clever regular exression
(preg_split) could solve this, but I'm not quite sure how - does  
anyone have

any ideas? Thanks

Paul

--
PHP General Mailing List (http://www.php.net/)
To 

Re: [PHP] Better timestamp explanation to the client

2005-09-08 Thread Chris
I'd probably out how many minutes it's been, then format it using if 
statements.


$iMinues = (value from database);
if(1  $iMinutes) $sLastseen = 'Less than a minute ago!';
elseif(1 == $iMinutes) $sLastseen = '1 minute ago';
elseif(60  $iMinutes) $sLastseen = {$iMinutes} minutes ago;
elseif(120  $iMinutes) $sLastseen = '1 hour '.($iMinutes - 60).' 
minutes ago';

...

I don't think there is any real shortcut for doing this kind of thing, 
though I could be wrong.


Chris

Ryan A wrote:


Hi,
In one of our tables we have these fields:

cust_no bigint(20),
cust_name varchar(30),
last_online datetime,

and in that members profile, if someone visits it, on the top of the page we
have this:

// connect to db, query for record and display it below
Last seen: ?php echo $last_online; ?

Any ideas on the simplest way to make it look like this:

Last seen: Less than a minute ago!

Last seen: 25 mins ago

Last seen:  2 hours 11 mins ago

Last seen: 1 (or 2 or 3) day/s ago

else{ echo $last_seen; }



I have seen this done on a few sites (Swedish sites actually, I can give you
the URLs if you need them)

I think it looks much better than:
Last seen : 2005-09-07 20:59:01


Thanks!
Ryan

 



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



[PHP] Re: Parsing MS-WORD docs

2005-09-08 Thread Ben Ramsey

zzapper wrote:

On Wed, September 7, 2005 7:39 am, Shafiq Rehman wrote:


Hello,

I want to parse the .doc files with PHP. Anybody have some idea regarding
this problem.

Your help regarding this matter is really appreciated



Also consider antiword



And also:

wvWare: http://wvware.sourceforge.net/
Word2x: http://word2x.sourceforge.net/

--
Ben Ramsey
http://benramsey.com/

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



Re: [PHP] Better timestamp explanation to the client

2005-09-08 Thread Jordan Miller
methinks you should convert the datetime to a unix timestamp with  
strtotime(). then you can compare the difference between this  
timestamp and a unix timestamp of now to find if you have logged in  
within a min. of the previous time. Then, once you know what text to  
display (e.g. Less than a minute ago!), you can format the original  
datetime timestamp with the date() function to be however you like.  
You may have to read the manuals for all three of these functions  
several times. good luck!


actually, you may be able to do simple operators (e.g. , , or -)  
with the datetime as is, without having to convert to a unix  
timestamp. NOW in datetime format can be gotten with:

$now = date('Y-m-d H:i:s');

i'm not sure though. just try it!

Jordan


On Sep 8, 2005, at 9:41 AM, Ryan A wrote:


Hi,
In one of our tables we have these fields:

cust_no bigint(20),
cust_name varchar(30),
last_online datetime,

and in that members profile, if someone visits it, on the top of  
the page we

have this:

// connect to db, query for record and display it below
Last seen: ?php echo $last_online; ?

Any ideas on the simplest way to make it look like this:

Last seen: Less than a minute ago!

Last seen: 25 mins ago

Last seen:  2 hours 11 mins ago

Last seen: 1 (or 2 or 3) day/s ago

else{ echo $last_seen; }



I have seen this done on a few sites (Swedish sites actually, I can  
give you

the URLs if you need them)

I think it looks much better than:
Last seen : 2005-09-07 20:59:01


Thanks!
Ryan

--
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] preg_match help please

2005-09-08 Thread Steve Turnbull
On Thu, 08 Sep 2005 09:15:03 +0100, Steve Turnbull wrote:

 On Thu, 08 Sep 2005 19:27:49 +1200, Jasper Bryant-Greene wrote:
 
 Steve Turnbull wrote:
 I am trying to find a regular expression to match a variable, what I think
 should work (but doesn't) is;
 
 preg_match ('^/[\w],[\w],/', $variable)
 
 The $variable MUST contain an alpha-numeric string, followed by a comma,
 followed by another alpha-numeric string, followed by another comma
 followed by (but doesn't have to!!) another alpha-numeric string followed
 by nothing.
 
 I realise my regex above doesn't allow for the last 'followed by nothing',
 but to me it looks like it should match the first part of the string up to
 the last comma?
 
 Something like
 
 '/^\w+,\w+,\w*$/'
 
 maybe? (untested)
 
 http://php.net/reference.pcre.pattern.syntax
 
 Thats got me a lot further - thanks
 
 I reduced it slightly to '/^\w+,\w+,' because at the end there is the
 possibility of an alpha-numeric character(s) OR nothing at all with the
 exception of a possible line break (note possible)
 
 It's the 'possibly nothing at all' which I am slightly stuck on
 
 Thanks
 Steve


One more thing (I have tried researching myself and reading the o'rielly
book, but I need fairly swift solutions)...

How would I check for this scenario;

Two commas, which MAY have, but don't always have a value between, but
the commas must ALWAYS be there - i.e.

var1,var2,var3
var1,var2,
var1,,

Cheers
Steve

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



[PHP] php.ini and php.config Tutorial?

2005-09-08 Thread Vizion
Hi

Background:
I am installing php with apache2 and ssl, mysql-server-5.0.11 on one of my 
Freebsd 5.3. servers. I propose to  run a forum (currently investigating 
phpbb but would like to consider others) and am also looking  for suitable 
blog and wiki applications. I am more of a system administrator than a 
programmer although I do have considerable experience of some programming 
languages.

Questions:
1.
As I am new to php I would appreciated if someone could help me locate a 
tutorial which not only describes what is in the configuration files (which 
the distributed configuration files do quite well) but also, some 
explanations that might be understood by a php neophyte, plus guidance and 
detailed examples on one might choose on option over another in different 
circumstances. For those who are not familiar with php the configuration 
files can appear daunting. 

2.
Recomendations for forum, wiki and blog modules.

Thanks
david
-- 
40 yrs navigating and computing in blue waters.
English Owner  Captain of British Registered 60' bluewater Ketch S/V Taurus.
 Currently in San Diego, CA. Sailing bound for Europe via Panama Canal after 
completing engineroom refit.

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



Re: [PHP] preg_match help please

2005-09-08 Thread Steve Turnbull
On Thu, 08 Sep 2005 16:36:36 +0100, Steve Turnbull wrote:

 On Thu, 08 Sep 2005 09:15:03 +0100, Steve Turnbull wrote:
 
 On Thu, 08 Sep 2005 19:27:49 +1200, Jasper Bryant-Greene wrote:
 
 Steve Turnbull wrote:
 I am trying to find a regular expression to match a variable, what I think
 should work (but doesn't) is;
 
 preg_match ('^/[\w],[\w],/', $variable)
 
 The $variable MUST contain an alpha-numeric string, followed by a comma,
 followed by another alpha-numeric string, followed by another comma
 followed by (but doesn't have to!!) another alpha-numeric string followed
 by nothing.
 
 I realise my regex above doesn't allow for the last 'followed by nothing',
 but to me it looks like it should match the first part of the string up to
 the last comma?
 
 Something like
 
 '/^\w+,\w+,\w*$/'
 
 maybe? (untested)
 
 http://php.net/reference.pcre.pattern.syntax
 
 Thats got me a lot further - thanks
 
 I reduced it slightly to '/^\w+,\w+,' because at the end there is the
 possibility of an alpha-numeric character(s) OR nothing at all with the
 exception of a possible line break (note possible)
 
 It's the 'possibly nothing at all' which I am slightly stuck on
 
 Thanks
 Steve
 
 
 One more thing (I have tried researching myself and reading the o'rielly
 book, but I need fairly swift solutions)...
 
 How would I check for this scenario;
 
 Two commas, which MAY have, but don't always have a value between, but
 the commas must ALWAYS be there - i.e.
 
 var1,var2,var3
 var1,var2,
 var1,,
 
No matter now - sorted. I hadn't read the final reply before I posted this
one

Thanks again

Steve

 Cheers
 Steve

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



Re: [PHP] php.ini and php.config Tutorial?

2005-09-08 Thread Vizion
On Thursday 08 September 2005 08:34,  the author Vizion contributed to the 
dialogue on-
 [PHP] php.ini and php.config Tutorial?: 

Hi

Background:
I am installing php with apache2 and ssl, mysql-server-5.0.11 on one of my
Freebsd 5.3. servers. I propose to  run a forum (currently investigating
phpbb but would like to consider others) and am also looking  for suitable
blog and wiki applications. I am more of a system administrator than a
programmer although I do have considerable experience of some programming
languages.

Questions:
1.
As I am new to php I would appreciated if someone could help me locate a
tutorial which not only describes what is in the configuration files (which
the distributed configuration files do quite well) but also, some
explanations that might be understood by a php neophyte, plus guidance and
detailed examples on one might choose on option over another in different
circumstances. For those who are not familiar with php the configuration
files can appear daunting.

Added note of explanation -- my first build of php did not fare well -- I was 
not able to run php test scripts located in virtual host directories. Somehow 
I also finished up with a debug build rather than a production build - so I 
am going to start again from scratch!
2.
Recomendations for forum, wiki and blog modules.


Thanks
david
--
40 yrs navigating and computing in blue waters.
English Owner  Captain of British Registered 60' bluewater Ketch S/V
 Taurus. Currently in San Diego, CA. Sailing bound for Europe via Panama
 Canal after completing engineroom refit.

-- 
40 yrs navigating and computing in blue waters.
English Owner  Captain of British Registered 60' bluewater Ketch S/V Taurus.
 Currently in San Diego, CA. Sailing bound for Europe via Panama Canal after 
completing engineroom refit.

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



Re: [PHP] php.ini and php.config Tutorial?

2005-09-08 Thread Rory Browne
Hi David

I know that quite a lot of online docs can be daunting for new users,
but you should not underestimate the quality of the php documentation.

On 9/8/05, Vizion [EMAIL PROTECTED] wrote:
 Hi
 
 Background:
 I am installing php with apache2 and ssl, mysql-server-5.0.11 on one of my
 Freebsd 5.3. servers. I propose to  run a forum (currently investigating
 phpbb but would like to consider others) and am also looking  for suitable
 blog and wiki applications. I am more of a system administrator than a
 programmer although I do have considerable experience of some programming
 languages.
 
 Questions:
 1.
 As I am new to php I would appreciated if someone could help me locate a
 tutorial which not only describes what is in the configuration files (which
 the distributed configuration files do quite well) but also, some
 explanations that might be understood by a php neophyte, plus guidance and
 detailed examples on one might choose on option over another in different
 circumstances. For those who are not familiar with php the configuration
 files can appear daunting.

http://www.php.net/manual/en/configuration.php

 
 2.
 Recomendations for forum, wiki and blog modules.

www.hotscripts.com


 
 Thanks
 david
 --
 40 yrs navigating and computing in blue waters.
 English Owner  Captain of British Registered 60' bluewater Ketch S/V Taurus.
  Currently in San Diego, CA. Sailing bound for Europe via Panama Canal after
 completing engineroom refit.
 
 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 


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



Re: [PHP] php.ini and php.config Tutorial?

2005-09-08 Thread Vizion
On Thursday 08 September 2005 09:49,  the author Rory Browne contributed to 
the dialogue on-
 Re: [PHP] php.ini and php.config Tutorial?: 

Hi David

I know that quite a lot of online docs can be daunting for new users,
but you should not underestimate the quality of the php documentation.


Sure -- I did look at those - my feeling is that they are high on providing 
the facts but low on providing meaning, context and interpretation.

Mathematically it is easy to understand x+y=z but if you do not know or cannot 
know the value attributable to x or y or z the formula is *** useless. In 
my view one needs to distinquish between documentation (which records what 
something does in technical terms) and the qualities of a manual which 
explains which might refer to the documentation as it seeks to explain how 
and why one should choose to apply the options defined in the documentation.

The php.net references  the general documentation stanfard is superb but I 
found it to be somewhat lacking in its ability to meet the expectations of a 
manual. However, unless I missed a salient link, I did not find the brief 
section on installation and configuration very useful.

Incidentally the book by Luke Welling  Laura Thomson, PHP and MySQL web 
Development seemed to promisong in fulfilling the manual role for programming 
PHP. I was however disappointed because but  the general standard throughout 
the book does not seem to have been carried through to the Appendix on 
installation and configuration. It does not go into detail in regard to 
configuration options.

I have written to the authors in the hope they might give consider devoting a 
full chapter to that topic in their next edition.

Do you happen to have any other suggestions?

Thanks

david

On 9/8/05, Vizion [EMAIL PROTECTED] wrote:
 Hi

 Background:
 I am installing php with apache2 and ssl, mysql-server-5.0.11 on one of my
 Freebsd 5.3. servers. I propose to  run a forum (currently investigating
 phpbb but would like to consider others) and am also looking  for suitable
 blog and wiki applications. I am more of a system administrator than a
 programmer although I do have considerable experience of some programming
 languages.

 Questions:
 1.
 As I am new to php I would appreciated if someone could help me locate a
 tutorial which not only describes what is in the configuration files
 (which the distributed configuration files do quite well) but also, some
 explanations that might be understood by a php neophyte, plus guidance and
 detailed examples on one might choose on option over another in different
 circumstances. For those who are not familiar with php the configuration
 files can appear daunting.

http://www.php.net/manual/en/configuration.php

 2.
 Recomendations for forum, wiki and blog modules.

www.hotscripts.com

 Thanks
 david
 --
 40 yrs navigating and computing in blue waters.
 English Owner  Captain of British Registered 60' bluewater Ketch S/V
 Taurus. Currently in San Diego, CA. Sailing bound for Europe via Panama
 Canal after completing engineroom refit.

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

-- 
40 yrs navigating and computing in blue waters.
English Owner  Captain of British Registered 60' bluewater Ketch S/V Taurus.
 Currently in San Diego, CA. Sailing bound for Europe via Panama Canal after 
completing engineroom refit.

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



[PHP] RE: PHP wiki recommendations

2005-09-08 Thread Finner, Doug
 I'm not a Wiki expert, but have been using TikiWiki for a while and
very much like it.  It does everything you say with the possible
exception of CSS.  It may very well support CSS, I just don't need it so
haven't investigated.  It also allows for the use of templates that can
be applied globally or by each user (these may be the CSS bit, again, I
just haven't played).

User logins can be pre-assigned or user driven so you can control who
does what.

I think you can turn on/off the CamelCase feature.

Doug


-Original Message-
From: Murray @ PlanetThoughtful [mailto:[EMAIL PROTECTED] 
Sent: Thursday, September 08, 2005 2:03 AM
To: php-general@lists.php.net
Subject: PHP wiki recommendations

Hi All,

I want to add a wiki to my blog site to help create a knowledgebase of
the characters, localities, stories I write to make it easier for new
visitors to delve into the areas that interest them.

I've been experimenting with a couple of different wiki packages, but am
always interested in others' thoughts and recommendations.

In particular, I've looked at MediaWiki and PmWiki. Of the two, I like
MediaWiki's 'completeness', but it's also quite slow and doesn't strike
me as being particularly (or easily?) customizable. PmWiki is probably
my current candidate, but again I'd like to make sure I'm not missing a
more obvious choice.

My shopping list for the ideal wiki application is:

- wiki entries preferably stored in MySQL tables. I'm not adamant about
this (eg PmWiki uses files rather than a db backend), but it would suit
my purposes better to be able to draw from the wiki tables from the
front page of my blog to show lists of recently added and recently
updated wiki entries

- non-reliance on CamelCase wiki links. Many of my characters etc use
joined CamelCase names (eg KillFork and DangerSpoon), and to avoid
confusion I'd rather explicitly define links to wiki content

- ability to categorize wiki entries

- ability to compare history of wiki edits and easily reinstate older
edits if wiki pages get 'graffiti'd' 

- ability to allow others to edit / create wiki entries, thru a user id
/ password system, so that regulars who would like to participate can do
so

- ability to customize presentation of wiki pages, presumably through
CSS etc, so that I can maintain the 'look and feel' of my blog thru the
wiki content

- PHP based, though my host does run Perl, so if the killer wiki app is
a Perl-based one, I'm sure I can muddle thru implementing it

If anyone has any recommendations for other wiki applications I should
look at before making a decision, I'd love to hear from you!

Much warmth,

Murray
---
Lost in thought...
http://www.planetthoughtful.org
___
This e-mail message has been sent by Kollsman, Inc. and is for the use
of the intended recipients only. The message may contain privileged
or confidential information. If you are not the intended recipient
you are hereby notified that any use, distribution or copying of
this communication is strictly prohibited, and you are requested to
delete the e-mail and any attachments and notify the sender immediately.

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



Re: [PHP] Session expires randomly

2005-09-08 Thread Mauricio Pellegrini
On Tue, 2005-09-06 at 19:43, Philip Hallstrom wrote:
 On Tue, 6 Sep 2005, Mauricio Pellegrini wrote:
 
  You were right! That was exactly the problem
  after reading your message, I 've verified the value for gc_maxlifetime
  and found that it was set to 1440 secs in other words 24 minutes.
 
  Thank you for that.
 
  But, now I need to come up with something to avoid this behaviour.
 
  The problem is that there's a second php application ruuning on the same
  server and I don't want to change the default for gc_maxlilfetime,
 
 
 Why not just change it on your pages?  The manual says it can get changed 
 anywhere... so just make a call to ini_set() on your pages and other 
 scripts will remain unaffected.
 
 ?


Well I`ve just tryed that but didn't work.

I think that ini_set(session.gc_maxlifetime,28800) is useless,
because after setting the value for gc.maxlifetime the scripts ends
normally.

 I mean the html is displayed and the application waits for user input.
But at that time ( after the script has finished ) the original value
for session.gc_maxlifetime is restored (defaults to 1440).

So , does any one have any other ideas?

Thanks 
Mauricio






 
 
 
 
 
  So I was thinking on implementing some sort of automatic session refresh
  after a short period, let's say every 20 minutes of inactivity.
 
  And of course I should provide the users with a manual way to make
  session end, sort of a logout from the application.( no problem with
  that)
 
  My question is:
 
   Is there a way to set sort of a timer as to invoke an hipothetical
  refresh_session.php without reloading the current page on the client?
 
  Thanks
  Mauricio.
 
 
 
  On Fri, 2005-09-02 at 14:20, [EMAIL PROTECTED] wrote:
  On Fri, 2 Sep 2005, Mauricio Pellegrini wrote:
 
  Hi, I have this problem , When I start a Session everything seems to
  be
  ok but sometimes with no reason the session vanishes.
 
  All settings are default , I mean session_cache_expire is 180 min.
  I understand that this setting should make sessions last for at least
  3
  hours but in my case it seems not to be true since the real duration
  varies from 20 minutes to an hour
 
  I think the parameter you need to look at in php.ini is
  session.gc_maxlifetime. It sets the session lifetime, not
  session_cache_expire. The default lifetime is probably 1440 seconds,
  roughly 20 minutes, so the behavior you are seeing is completely normal -
  it's all working as it should.
 
  Kirk
 
  -- 
  PHP General Mailing List (http://www.php.net/)
  To unsubscribe, visit: http://www.php.net/unsub.php
 

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



[PHP] Re: php.ini and php.config Tutorial?

2005-09-08 Thread Raj Shekhar
in infinite wisdom Vizion spoke thus  On 09/08/2005 09:04 PM:

 Questions:
 1.
 As I am new to php I would appreciated if someone could help me locate a 
 tutorial which not only describes what is in the configuration files (which 
 the distributed configuration files do quite well) but also, some 
 explanations that might be understood by a php neophyte, plus guidance and 
 detailed examples on one might choose on option over another in different 
 circumstances. For those who are not familiar with php the configuration 
 files can appear daunting. 

If you check the php.ini file that comes with the php source code, you
will find it to be heavily commented.   If you get stuck on some ini
setting, you can always double check it with the php manual


 
 2.
 Recomendations for forum, wiki and blog modules.

Wiki - PmWiki http://rajshekhar.net/content/view/24/26/
Blog - s9y

-- 
Raj Shekhar
blog : http://rajshekhar.net/blog  home : http://rajshekhar.net
Disclaimer : http://rajshekhar.net/disclaimer

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



[PHP] Re: access resources via a proxy

2005-09-08 Thread Raj Shekhar
in infinite wisdom Vedanta Barooah spoke thus  On 09/08/2005 07:22 PM:

 A typical scenario:
 Server A needs to display news, which resides on Server B as RSS
 feeds. For this the PHP script hosted on Server A need to go via the
 proxy http://proxy:8088 then read the feed in Server B for it to
 display… how this can be achieved?
 
 Any clues please help!!

http://pear.php.net/manual/en/package.http.http-request.proxy-auth.php


-- 
Raj Shekhar
blog : http://rajshekhar.net/blog  home : http://rajshekhar.net
Disclaimer : http://rajshekhar.net/disclaimer

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



[PHP] Rotating images from a folder

2005-09-08 Thread Ross
Hi,

I am looking to rotate 6 or 7 different images from a folder onto homepage. 
So I need 2 things


(i) The method of  upload an image from a specified folder.

(ii)  The way to randomise this action


Any tutorials or pointers will be helpful..

R. 

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



Re: [PHP] Create a new $_COOKIE[PHPSESSID] in PHP4.3.1

2005-09-08 Thread Steffen Stollfuß
hy

try this

$sess_id = session_id();
// Unset all Session Vars
session_unset();
// Destroy Session
session_destroy();

/*
// Get session file and delete it !!!
if (strtolower('files' == session_module_name()))
{

if( substr(PHP_OS, 0, 3) == 'WIN' )
{
$tz = //;
$path = str_replace( chr(92) , $tz , session_save_path() );
}
else
{
$tz = /;
$path = session_save_path();
}

@unlink($path . $tz .'sess_'. $sess_id );
}
*/
---
 PGP Public Key: www.rt31x-tutorial.de/php/Steffen Stollfuss_pub.asc
---


Re: [PHP] Session expires randomly

2005-09-08 Thread Kirk . Johnson
   So I was thinking on implementing some sort of automatic session 
refresh
   after a short period, let's say every 20 minutes of inactivity.
  
   And of course I should provide the users with a manual way to make
   session end, sort of a logout from the application.( no problem with
   that)
  
   My question is:
  
   Is there a way to set sort of a timer as to invoke an 
hipothetical
   refresh_session.php without reloading the current page on the 
client?
  
   Thanks
   Mauricio.

Below is some code, in four parts, to do this with JavaScript's 
setTimeout() function. Since it is JavaScript, this will not work in 
browsers that don't support JavaScript or browsers in which the user has 
disabled JavaScript. Good luck!

Kirk

/* Part 1: Add this script to your page. */

//   After 14 minutes on a single page a new window is opened, warning the
//   user that their session is about to expire. The user can then choose
//   to continue or end their session by pushing a button. The pop-window 
//   will kill all Session info, redirect the main window to the 
//   login page, and then close itself if the user decides to end the 
//   session or, if after 58 seconds, the user has taken no action. 

script
  // 84 ms = 14 minutes
  setTimeout('sessionPop()', 84);
/script


/* Part 2: Have this JS function defined somewhere accessible by your page 
*/


//  function sessionPop()

//  called by setTimeout function in ./include/footer.inc
//  Does the following
//  1. Open new window
//  2. Write the HTML to the window. It is done this way so that there is 
no trip 
//  to the server which could result in the Session being refreshed.
 
function sessionPop() {
  x = window.open('', 'check', 'height=200, width=400, titlebar=yes, 
status=no, toolbar=no, menubar=no, location=no, resizable=yes, 
scrollbars=no');
 
  x.document.write('htmlheadtitleSession About To 
Expire/title/headbodyimg src=./images/some_logo.gif width=58 
height=50pDo you want to extend your session?form 
action=logout.php method=post name=refreshSess 
id=refreshSessinput type=submit name=sessionRefresh value=Yes. 
Extend Sessionnbsp;nbsp;input type=button value=No. Logout 
onClick=window.opener.location = \'logout.php\'; 
window.close();/form/bodyscriptfunction timeOut() 
{window.opener.location = logout.php; window.close();} 
setTimeout(timeOut(), 58000);/script/html');
 
  // Need to reset the timer so the user will continue
  // to get the pop-up when they choose to extend the session
  // 84 ms = 14 minutes
  setTimeout('sessionPop()', 84);


/* Part 3: Here is the content of logout.php */

?
  /*
logout.php is the handler for the form POST from the pop-up window 
generated by the javascript function 'sessionPop()' contained in 
./include/jsFunctions.js. 

logout.php can also be arrived at from redirection due to a Session
Timout on any application page. 
  */

  // sessionRefresh is the submit button to continue the Session.
  // If we get sessionRefresh in the POST close the window. POSTing
  // to the page keeps the Session alive.

  // Otherwise, this page has been reloaded from a redirect so kill
  // all Session info and redirect to home page.

  if (!$HTTP_POST_VARS[sessionRefresh]) {
// Kill all current session info
kill_session();
header(Location: $someURL);
  } else {
?
  html
  head
  title /title
  script language=JavaScript
  !--
window.close();
  //--
  /script
  /head

  body

  /body
  /html


/* Part 4: Here is the definition of PHP function kill_session() */

function kill_session()
{
  $name = session_name();
  session_unset();
  session_destroy();
  setcookie($name, '', (time() - 2592000), '/', '', 0);
}

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



[PHP] Limit - nr of sessions on a domain?

2005-09-08 Thread Gustav Wiberg

Hi there!

I'm trying to set 30 diffrent cookies on a domain, but it seems that a 
cookie sets to zero and there is a max of 18 or 19 cookies... Can this be 
right?


/G
http://www.varupiraten.se/

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



Fw: [PHP] Limit - nr of sessions on a domain?

2005-09-08 Thread Gustav Wiberg
- Original Message - 
From: Gustav Wiberg [EMAIL PROTECTED]

To: PHP General php-general@lists.php.net
Sent: Thursday, September 08, 2005 11:36 PM
Subject: [PHP] Limit - nr of sessions on a domain?



Hi there!

I'm trying to set 30 diffrent cookies on a domain, but it seems that a 
cookie sets to zero and there is a max of 18 or 19 cookies... Can this be 
right?


This is an output of my cookievalues... But the problem is that i want a 
larger array. Isn't this possible?


Array ( [1] = voted [17] = voted [19] = voted [22] = voted [24] = voted 
[25] = voted [26] = voted [PHPSESSID] = 7d5917c49d7e0fba693f5a122c7851a4 
[2] = voted [3] = voted [6] = voted [7] = voted [8] = voted [9] = 
voted [10] = voted [11] = voted [13] = voted [12] = voted [14] = voted 
[15] = voted )


Array ( [17] = voted [19] = voted [22] = voted [24] = voted [25] = 
voted [26] = voted [PHPSESSID] = 7d5917c49d7e0fba693f5a122c7851a4 [2] = 
voted [3] = voted [6] = voted [7] = voted [8] = voted [9] = voted [10] 
= voted [11] = voted [13] = voted [12] = voted [14] = voted [15] = 
voted [18] = voted )


Array ( [19] = voted [22] = voted [24] = voted [25] = voted [26] = 
voted [PHPSESSID] = 7d5917c49d7e0fba693f5a122c7851a4 [2] = voted [3] = 
voted [6] = voted [7] = voted [8] = voted [9] = voted [10] = voted [11] 
= voted [13] = voted [12] = voted [14] = voted [15] = voted [18] = 
voted [20] = voted )





/G
http://www.varupiraten.se/

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



--
No virus found in this incoming message.
Checked by AVG Anti-Virus.
Version: 7.0.344 / Virus Database: 267.10.19/92 - Release Date: 2005-09-07




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



Re: [PHP] Checking a date for validity

2005-09-08 Thread Todd Cary

Chris W. Parker wrote:

Todd Cary mailto:[EMAIL PROTECTED]
on Wednesday, September 07, 2005 3:39 PM said:



  /* Is date good */
  function is_date_good($date) {
if (strtotime($date) == -1) {
  $retval = 0;
} else {
  if (strpos($date, /)  0) {
$parts = explode(/, $date);
  } elseif (strpos($date, -)  0) {
$parts2 = explode(-, $date);
$parts[0] = $parts2[1];
$parts[1] = $parts2[2];
$parts[2] = $parts2[0];



Why $parts2?

Just use $parts instead, like you did in the other two blocks.

Change it to:



  if (strpos($date, /)  0) {
$parts = explode(/, $date);
  } elseif (strpos($date, -)  0) {
$parts = explode(-, $date);
  } else {
$parts = explode(., $date);
  }




Is there a simplier solution?



How about strtotime()? In your function you're pretty much only
accepting a certain number of formats for your date already so you could
probably go with just passing the date (in whatever format it's given)
to strtotim() and check for a 'false' or a timestamp.


Chris.

Chris -

That you for the helpful comments!  The reason I use the strtotime() up 
front is to make sure junk data has not been placed in the fields.  My 
client tests by putting %^#$ into fields, and that creates a problem 
with their php 4.2.x but not with my 4.3.9.  The strtotime() took care 
of the problem...


Todd

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



Re: [PHP] Checking a date for validity

2005-09-08 Thread Todd Cary

Chris W. Parker wrote:

Todd Cary mailto:[EMAIL PROTECTED]
on Wednesday, September 07, 2005 3:39 PM said:



  /* Is date good */
  function is_date_good($date) {
if (strtotime($date) == -1) {
  $retval = 0;
} else {
  if (strpos($date, /)  0) {
$parts = explode(/, $date);
  } elseif (strpos($date, -)  0) {
$parts2 = explode(-, $date);
$parts[0] = $parts2[1];
$parts[1] = $parts2[2];
$parts[2] = $parts2[0];



Why $parts2?

Just use $parts instead, like you did in the other two blocks.

Change it to:



  if (strpos($date, /)  0) {
$parts = explode(/, $date);
  } elseif (strpos($date, -)  0) {
$parts = explode(-, $date);
  } else {
$parts = explode(., $date);
  }




Is there a simplier solution?



How about strtotime()? In your function you're pretty much only
accepting a certain number of formats for your date already so you could
probably go with just passing the date (in whatever format it's given)
to strtotim() and check for a 'false' or a timestamp.


Chris.

Chris -

That you for the helpful comments!  The reason I use the strtotime() up
front is to make sure junk data has not been placed in the fields.  My
client tests by putting %^#$ into fields, and that creates a problem
with their php 4.2.x but not with my 4.3.9.  The strtotime() took care
of the problem...

Todd

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



Re: [PHP] Checking a date for validity

2005-09-08 Thread Todd Cary

Chris W. Parker wrote:

Todd Cary mailto:[EMAIL PROTECTED]
on Wednesday, September 07, 2005 3:39 PM said:



  /* Is date good */
  function is_date_good($date) {
if (strtotime($date) == -1) {
  $retval = 0;
} else {
  if (strpos($date, /)  0) {
$parts = explode(/, $date);
  } elseif (strpos($date, -)  0) {
$parts2 = explode(-, $date);
$parts[0] = $parts2[1];
$parts[1] = $parts2[2];
$parts[2] = $parts2[0];



Why $parts2?

Just use $parts instead, like you did in the other two blocks.

Change it to:



  if (strpos($date, /)  0) {
$parts = explode(/, $date);
  } elseif (strpos($date, -)  0) {
$parts = explode(-, $date);
  } else {
$parts = explode(., $date);
  }




Is there a simplier solution?



How about strtotime()? In your function you're pretty much only
accepting a certain number of formats for your date already so you could
probably go with just passing the date (in whatever format it's given)
to strtotim() and check for a 'false' or a timestamp.


Chris.

Chris -

That you for the helpful comments!  The reason I use the strtotime() up
front is to make sure junk data has not been placed in the fields.  My
client tests by putting %^#$ into fields, and that creates a problem
with their php 4.2.x but not with my 4.3.9.  The strtotime() took care
of the problem...

Todd

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



Re: [PHP] Re: php.ini and php.config Tutorial?

2005-09-08 Thread Vizion
On Thursday 08 September 2005 12:36,  the author Raj Shekhar contributed to 
the dialogue on-
 [PHP] Re: php.ini and php.config Tutorial?: 

in infinite wisdom Vizion spoke thus  On 09/08/2005 09:04 PM:
 Questions:
 1.
 As I am new to php I would appreciated if someone could help me locate a
 tutorial which not only describes what is in the configuration files
 (which the distributed configuration files do quite well) but also, some
 explanations that might be understood by a php neophyte, plus guidance and
 detailed examples on one might choose on option over another in different
 circumstances. For those who are not familiar with php the configuration
 files can appear daunting.

If you check the php.ini file that comes with the php source code, you
will find it to be heavily commented.   If you get stuck on some ini
setting, you can always double check it with the php manual

As I said in another postiing :
Sure -- I did look at those - my feeling is that they are high on providing 
the facts but low on providing meaning, context and interpretation.

Mathematically it is easy to understand x+y=z but if you do not know or cannot 
know the value attributable to x or y or z the formula is *** useless. In 
my view one needs to distinquish between documentation (which records what 
something does in technical terms) and the qualities of a manual which 
explains which might refer to the documentation as it seeks to explain how 
and why one should choose to apply the options defined in the documentation.

The php.net references  the general documentation stanfard is superb but I 
found it to be somewhat lacking in its ability to meet the expectations of a 
manual. However, unless I missed a salient link, I did not find the brief 
section on installation and configuration very useful.

Incidentally the book by Luke Welling  Laura Thomson, PHP and MySQL web 
Development seemed to promisong in fulfilling the manual role for programming 
PHP. I was however disappointed because but  the general standard throughout 
the book does not seem to have been carried through to the Appendix on 
installation and configuration. It does not go into detail in regard to 
configuration options.

I have written to the authors in the hope they might give consider devoting a 
full chapter to that topic in their next edition.

Do you happen to have any other suggestions?

 2.
 Recomendations for forum, wiki and blog modules.

Wiki - PmWiki http://rajshekhar.net/content/view/24/26/
Blog - s9y

--
Raj Shekhar
blog : http://rajshekhar.net/blog  home : http://rajshekhar.net

Thanks very much for yr help

david

-- 
40 yrs navigating and computing in blue waters.
English Owner  Captain of British Registered 60' bluewater Ketch S/V Taurus.
 Currently in San Diego, CA. Sailing bound for Europe via Panama Canal after 
completing engineroom refit.

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



Re: [PHP] Help with Class

2005-09-08 Thread Ryan Creaser

Ian Barnes wrote:


   require_once (
$fetchd['path'].'sdk/ipbsdk_class.inc.php' );
 



What is the above line doing? It looks like you are trying to redeclare 
the ipbsdk class each time around the loop which is illegal in php. You 
can't do :


class ipbsdk {
...
}

and then (in the same request)

class ipbsdk {

}

because the names will clash. This should  cause a Fatal error: Cannot 
redeclare class ipbsdk ... message though. Are you seeing any errors?


- Ryan

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



[PHP] How large string in cookie?

2005-09-08 Thread Gustav Wiberg

How large can a string be in a cookie? (the value-parameter)

/G
http://www.varupiraten.se/

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



[PHP] Inserting records question

2005-09-08 Thread Iggep
Still learning, so sorry if this sounds really simply noobish.  But as I 
understand things currently this should work.  But doesn't.  I've been 
looking over tutorials but just don't see whatever the problem is.

I created a simple table with the following fields (in order)
tc_id (auto nmbr)
lname
fname
machine_name
email_addr
problem
date_time_submitted (timestamp)

And I'm trying to run this insert from form input.  

$username=somename;
$password=somepass;
$database=somedb;
$table=sometable;
mysql_connect(localhost,$username,$password);
@mysql_select_db($database) or die(Unable to Connect to DB);
$tc_query = INSERT INTO $tablel VALUES(NULL, $lname, $fname, 
$machine_name, 
$email_addr, $problem, NULL);
$result = mysql_query($tc_query);
mysql_close();

So what exactly do I seem to be missing here?

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



[PHP] SPL array filter

2005-09-08 Thread Kevin Waterson

Want to filter out cats from this array using SPL FilterIterator
$arr = array('koala', 'dingo', 'cat', 'Steve Irwin', 'fish');

kind regrards
Kevin

-- 
Democracy is two wolves and a lamb voting on what to have for lunch. 
Liberty is a well-armed lamb contesting the vote.

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



Re: [PHP] How large string in cookie?

2005-09-08 Thread Philip Hallstrom

How large can a string be in a cookie? (the value-parameter)


According to here: http://wp.netscape.com/newsref/std/cookie_spec.html

There are limitations on the number of cookies that a client can store at 
any one time. This is a specification of the minimum number of cookies 
that a client should be prepared to receive and store.


* 300 total cookies
* 4 kilobytes per cookie, where the name and the OPAQUE_STRING combine 
to form the 4 kilobyte limit.
* 20 cookies per server or domain. (note that completely specified 
hosts and domains are treated as separate entities and have a 20 cookie 
limitation for each, not combined)


Servers should not expect clients to be able to exceed these limits. When 
the 300 cookie limit or the 20 cookie per server limit is exceeded, 
clients should delete the least recently used cookie. When a cookie larger 
than 4 kilobytes is encountered the cookie should be trimmed to fit, but 
the name should remain intact as long as it is less than 4 kilobytes.


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



Re: [PHP] Inserting records question

2005-09-08 Thread Philip Hallstrom

Still learning, so sorry if this sounds really simply noobish.  But as I
understand things currently this should work.  But doesn't.  I've been
looking over tutorials but just don't see whatever the problem is.

I created a simple table with the following fields (in order)
tc_id (auto nmbr)
lname
fname
machine_name
email_addr
problem
date_time_submitted (timestamp)

And I'm trying to run this insert from form input.

$username=somename;
$password=somepass;
$database=somedb;
$table=sometable;
mysql_connect(localhost,$username,$password);
@mysql_select_db($database) or die(Unable to Connect to DB);
$tc_query = INSERT INTO $tablel VALUES(NULL, $lname, $fname, 
$machine_name,
$email_addr, $problem, NULL);
$result = mysql_query($tc_query);
mysql_close();

So what exactly do I seem to be missing here?


A lot of single quotes... around the parameters you are inserting...

add in a print($tc_query) and see what that looks like... run that 
directly in mysql and it will give you more details on the error.


Or, make it look like this:

$tc_query = INSERT INTO $tablel VALUES(NULL, '$lname', '$fname', 
'$machine_name', '$email_addr', '$problem', NULL);


I'd also suggest you read this page:

http://www.php.net/mysql_escape_string

good luck!

-p

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



Re: [PHP] Inserting records question

2005-09-08 Thread Scott Noyes
 mysql_connect(localhost,$username,$password);
 @mysql_select_db($database) or die(Unable to Connect to 
 DB);
 $tc_query = INSERT INTO $tablel VALUES(NULL, $lname, $fname, 
 $machine_name,
 $email_addr, $problem, NULL);
 $result = mysql_query($tc_query);

It's always nice to check if the query even ran, using or
die(mysql_error()).  You might also want to print out the query
itself to see if there are missing values.  Perhaps you're relying on
register globals, which is turned off?

$result = mysql_query($tc_query) or die(mysql_error() .  in the query
$tc_query;

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



RE: [PHP] Inserting records question

2005-09-08 Thread Warren Vail
It might also be a factor, but the variable containing the table name is
$table (not $table1 as coded in the query string).

Warren Vail
[EMAIL PROTECTED]

 -Original Message-
 From: Philip Hallstrom [mailto:[EMAIL PROTECTED] 
 Sent: Thursday, September 08, 2005 6:41 PM
 To: Iggep
 Cc: php-general@lists.php.net
 Subject: Re: [PHP] Inserting records question
 
 
  Still learning, so sorry if this sounds really simply 
 noobish.  But as 
  I understand things currently this should work.  But doesn't.  I've 
  been looking over tutorials but just don't see whatever the problem 
  is.
 
  I created a simple table with the following fields (in order) tc_id 
  (auto nmbr) lname
  fname
  machine_name
  email_addr
  problem
  date_time_submitted (timestamp)
 
  And I'm trying to run this insert from form input.
 
  $username=somename;
  $password=somepass;
  $database=somedb;
  $table=sometable;
  mysql_connect(localhost,$username,$password);
  @mysql_select_db($database) or die(Unable to 
 Connect to DB);
  $tc_query = INSERT INTO $tablel VALUES(NULL, 
 $lname, $fname, 
  $machine_name, $email_addr, $problem, NULL);
  $result = mysql_query($tc_query);
  mysql_close();
 
  So what exactly do I seem to be missing here?
 
 A lot of single quotes... around the parameters you are inserting...
 
 add in a print($tc_query) and see what that looks like... run that 
 directly in mysql and it will give you more details on the error.
 
 Or, make it look like this:
 
 $tc_query = INSERT INTO $tablel VALUES(NULL, '$lname', '$fname', 
 '$machine_name', '$email_addr', '$problem', NULL);
 
 I'd also suggest you read this page:
 
http://www.php.net/mysql_escape_string

good luck!

-p

-- 
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] Help with Class

2005-09-08 Thread Ian Barnes
Hi Ryan,

I am including a different class.inc.php file each time the foreach loops.
Each one sits in a different dir. Yes, I do get that error. 

My understanding of OOP is that I could null the $sdk variable and re-init
it when the loop starts again..

Cheers

-Original Message-
From: Ryan Creaser [mailto:[EMAIL PROTECTED] 
Sent: 09 September 2005 12:34 AM
To: Ian Barnes
Cc: PHP General
Subject: Re: [PHP] Help with Class

Ian Barnes wrote:

require_once (
$fetchd['path'].'sdk/ipbsdk_class.inc.php' );
  


What is the above line doing? It looks like you are trying to redeclare 
the ipbsdk class each time around the loop which is illegal in php. You 
can't do :

class ipbsdk {
 ...
}

and then (in the same request)

class ipbsdk {
...
}

because the names will clash. This should  cause a Fatal error: Cannot 
redeclare class ipbsdk ... message though. Are you seeing any errors?

- Ryan

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



Re: [PHP] Re: access resources via a proxy

2005-09-08 Thread Vedanta Barooah
what about existing apps... do i need to rewrite them :(

On 9/9/05, Raj Shekhar [EMAIL PROTECTED] wrote:
 in infinite wisdom Vedanta Barooah spoke thus  On 09/08/2005 07:22 PM:
 
  A typical scenario:
  Server A needs to display news, which resides on Server B as RSS
  feeds. For this the PHP script hosted on Server A need to go via the
  proxy http://proxy:8088 then read the feed in Server B for it to
  display… how this can be achieved?
 
  Any clues please help!!
 
 http://pear.php.net/manual/en/package.http.http-request.proxy-auth.php
 
 
 --
 Raj Shekhar
 blog : http://rajshekhar.net/blog  home : http://rajshekhar.net
 Disclaimer : http://rajshekhar.net/disclaimer
 
 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 
 


-- 
*~:~*~:~*~:~*~:~*~:~*~:~*~:~*~:~*~:~*~:~*
Vedanta Barooah
YM! - vedanta2006
Skype - vedanta2006


Re: [PHP] Re: Parsing MS-WORD docs

2005-09-08 Thread Shafiq Rehman
Hello,

Thanx to all of you for excellent suggestions. I am using Linux as OS and I 
want to parse the CVs and place in db for fulltext search. I think wvWare 
will work a lot for my case.

Thanx again.

On 9/8/05, Ben Ramsey [EMAIL PROTECTED] wrote:
 
 zzapper wrote:
 On Wed, September 7, 2005 7:39 am, Shafiq Rehman wrote:
 
 Hello,
 
 I want to parse the .doc files with PHP. Anybody have some idea 
 regarding
 this problem.
 
 Your help regarding this matter is really appreciated
 
 
  Also consider antiword
 
 
 And also:
 
 wvWare: http://wvware.sourceforge.net/
 Word2x: http://word2x.sourceforge.net/
 
 --
 Ben Ramsey
 http://benramsey.com/
 
 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 
 


-- 
*** phpgurru.com http://phpgurru.com [A php resource provider] ***

\\\|///
\\ - - //
( @ @ ) PHP is too logical for my brain
+---oOOo-(_)-oOOo--+
| Mian Shafiq ur Rehman
| phpgurru.com http://phpgurru.com [A php resource provider]
| 107 B, New Town, Multan Road
| Lahore Pakistan
|
| Mobile: 0300 423 9385
|
| ooo0 http://www.phpgurru.com
| ( ) 0ooo E-Mail: [EMAIL PROTECTED]
+---\ (( )--+
\_) ) /
(_/