[PHP] The page before for newman.

2002-07-25 Thread Philip J. Newman

I'm looking for the global veriable that lists the page before the page that
i just came from.  Anyone know what i'm talking about?

---
Philip J. Newman.
PhilipNZ.com Design Solutions
http://www.philipnz.com/
[EMAIL PROTECTED]

Mob: +64 (25) 6144012.
Tele: +64 (25) 6144012.

Personal Site:
Philip J. Newman
Internet Developer
http://www.philipsdomain.com/
[EMAIL PROTECTED]




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




Re: [PHP] The page before for newman.

2002-07-25 Thread Miguel Cruz

On Thu, 25 Jul 2002, Philip J. Newman wrote:
> I'm looking for the global veriable that lists the page before the page
> that i just came from.  Anyone know what i'm talking about?

$_SERVER['HTTP_REFERER']

miguel


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




Re: [PHP] Password Generator Script

2002-07-25 Thread Liam MacKenzie



Random Password : 


In action:
http://scripts.operationenigma.net/passgen.php


Have fun  :-)





- Original Message -
From: "Monty" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, July 25, 2002 2:49 PM
Subject: [PHP] Password Generator Script


> Can anyone recommend where I could find a decent script that automatically
> generates passwords? I don't care if they are readable or just random
> letters, numbers.
>
> Thanks!
>
>
> --
> 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] best way to log bad email address'

2002-07-25 Thread Miguel Cruz

On Thu, 25 Jul 2002, Justin French wrote:
> what's the best way to log the bad email address' from a mail() loop?
> 
> >From the manual:
> "mail() returns TRUE if the mail was successfully accepted for delivery,
> FALSE otherwise."
> 
> Is the definition of "accepted for delivery" dependent on each server, or is
> there are general definition of what it means?

In almost every case, mail() will return true, regardless of how bogus the 
destination email address is. 

mail() just dumps it into the mail queue. There's a lot that goes on 
between there and delivery, and mail() doesn't wait around.

You'll need to catch bounces as they come in. To make life easier, assign 
your own unique Message-IDs and remember them, so you can easily 
invalidate addresses.

miguel


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




RE: [PHP] install issues on Solaris

2002-07-25 Thread Peter

ok unix.h problem solved but now it's saying can't locate .libs/libZend.a
 any ideas?


~thinks: sheesh no wonder more and more people just use windose for PHP
since it looking like its too bloody hard to install any where else lol~

> -Original Message-
> From: Peter [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, 25 July 2002 3:46 PM
> To: php_gen
> Subject: [PHP] install issues on Solaris
>
>
> hi there,
>
> some of you may remember my post from yesterday ( titled  install to unix
> ... hastles )
> as I said in that one I was using Solaris 9 ( the newest ver of
> the Solaris
> OS ) i have since gone back to Solaris 8 and am having the same
> problem when
> I go to do the "make" looking through the ./configure output i
> discovered it
> can find "unix.h" but when I do the make (and inparticular when it goes
> through the Zend Makefile ) it cannot find it.. any one got any clues or
> suggestions?  ( Solaris does come with an old ver (4.0.6 I think) on a
> companion CD but I wanna try and figure this one out as it's a
> newer ver of
> php (4.2.1) )
>
> any help would be apreciated... I can attach soft copies of both the make
> and the configure screen outputs for any that are interested...
>
> Cheers
>
> Peter
> "the only dumb question is the one that wasn't asked"
>
>
>
> --
> 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] Newman Asks, Do i have to use session_name('sid') every ...

2002-07-25 Thread Philip J. Newman

session_name('sid');
session_start();

Do i have to use session_name('sid'); every time i use session_start(); or
can session_name be used once?

---
Philip J. Newman.
PhilipNZ.com Design Solutions
http://www.philipnz.com/
[EMAIL PROTECTED]

Mob: +64 (25) 6144012.
Tele: +64 (25) 6144012.

Personal Site:
Philip J. Newman
Internet Developer
http://www.philipsdomain.com/
[EMAIL PROTECTED]




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




Re: [PHP] Re: How do I validate input using php?

2002-07-25 Thread Miguel Cruz

On Wed, 24 Jul 2002, Mike Mannakee wrote:
> Here's the code I use to validate emails:
> 
> function check_email($email)
>  {
>   global $email;
>   $regex="^([a-z0-9_]|\\-|\\.)+@(([a-z0-9_]|\\-)+\\.)+[a-z]{2,4}$";
>   return eregi($regex, $email, $trash);
>  }

Please search the archives on this topic; it's been covered exhaustively,
and each time it comes up we get 25 bad functions and eventually one good
one. The above function will bark at valid domains (.museum, etc.) and
will allow patently invalid domains (anything containing _).

miguel


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




Re: [PHP] Newman Asks, Do i have to use session_name('sid') every...

2002-07-25 Thread Richard Baskett

Just once when you first create the session.

Rick

This is the final test of a gentleman--his respect for those who can
be of no possible service to him. - William Lyon Phelps

> From: "Philip J. Newman" <[EMAIL PROTECTED]>
> Date: Thu, 25 Jul 2002 19:43:23 +1200
> To: <[EMAIL PROTECTED]>
> Subject: [PHP] Newman Asks, Do i have to use session_name('sid') every ...
> 
> session_name('sid');
> session_start();
> 
> Do i have to use session_name('sid'); every time i use session_start(); or
> can session_name be used once?
> 
> ---
> Philip J. Newman.
> PhilipNZ.com Design Solutions
> http://www.philipnz.com/
> [EMAIL PROTECTED]
> 
> Mob: +64 (25) 6144012.
> Tele: +64 (25) 6144012.
> 
> Personal Site:
> Philip J. Newman
> Internet Developer
> http://www.philipsdomain.com/
> [EMAIL PROTECTED]
> 
> 
> 
> 
> -- 
> 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] Newman Asks, Do i have to use session_name('sid') every...

2002-07-25 Thread PHP Developers

http://crushme.clients.philipnz.com/crushweb.php?startWeb=guest_book&sid=63e
9864efec3df8d84455e9e7fdb39a2&PHPSESSID=810e806280e1f6e26a3d04fea3242766

sid = the session, and when session_name('sid'); it adds
&PHPSESSID=810e806280e1f6e26a3d04fea3242766 to the url?

whats up with that?


- Original Message -
From: "Richard Baskett" <[EMAIL PROTECTED]>
To: "Philip J. Newman" <[EMAIL PROTECTED]>; "PHP General"
<[EMAIL PROTECTED]>
Sent: Thursday, July 25, 2002 7:50 PM
Subject: Re: [PHP] Newman Asks, Do i have to use session_name('sid')
every...


> Just once when you first create the session.
>
> Rick
>
> This is the final test of a gentleman--his respect for those who can
> be of no possible service to him. - William Lyon Phelps
>
> > From: "Philip J. Newman" <[EMAIL PROTECTED]>
> > Date: Thu, 25 Jul 2002 19:43:23 +1200
> > To: <[EMAIL PROTECTED]>
> > Subject: [PHP] Newman Asks, Do i have to use session_name('sid') every
...
> >
> > session_name('sid');
> > session_start();
> >
> > Do i have to use session_name('sid'); every time i use session_start();
or
> > can session_name be used once?
> >
> > ---
> > Philip J. Newman.
> > PhilipNZ.com Design Solutions
> > http://www.philipnz.com/
> > [EMAIL PROTECTED]
> >
> > Mob: +64 (25) 6144012.
> > Tele: +64 (25) 6144012.
> >
> > Personal Site:
> > Philip J. Newman
> > Internet Developer
> > http://www.philipsdomain.com/
> > [EMAIL PROTECTED]
> >
> >
> >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
>




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




Re: [PHP] Re: PHP Security Advisory: Vulnerability in PHP versions4.2.0

2002-07-25 Thread Miguel Cruz

On Wed, 24 Jul 2002, Scott Fletcher wrote:
> It work very nicely  The whole process take 30 to 45 minutes for just
> one server.  I wonder how does someone did 12 computers  in 10 minutes.
> Cool!

  cd /usr/src/local
  tar -zxf php-4.2.2.tar.gz
  cd php-4.2.2
  ../php-4.2.1/config.nice
  make install
  for i in server1 server2 server3 server4 server5 serverN
  scp ../apache_1.3.26/src/httpd ${i}:/usr/local/apache/bin/

Most of the time was watching 'make install'.

miguel


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




Re: [PHP] PHP Security Advisory: Vulnerability in PHP versions4.2.0and 4.2.1

2002-07-25 Thread Miguel Cruz

On Tue, 23 Jul 2002, Richard Lynch wrote:
> This is excluding support contracts for software you paid for -- Once you
> pay Oracle enough money for Support Contracts, they have pretty good
> support, from what I hear... :-)

They're attentive and responsive and about as knowledgeable as you could 
hope for (definitely not your typical tech support script readers), but 
the product is so hopelessly complex that it's still easy to stump them.

miguel


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




[PHP] Image Resizing

2002-07-25 Thread Nicholas Mercier

Okay.  Unless I failed a math course in high school (which is possible) I 
think my formulas are sound.  However I'm having issues with this code.

The Intended result:  Take any image larger then 180x200 (WxH) and resize 
it proportionally so it fits within 200x180.
What I'm getting, exactly what I want, except images come back deformed or 
miscreated.  I've attached 2 jpegs that are produced by this script.  If 
anyone can help out it would be greatly appreciated

$lastnumQry = "SELECT imageID FROM images ORDER BY imageID DESC";
$lastnumRslt = mysql_query($lastnumQry, $conn);
$lastnum = mysql_fetch_array($lastnumRslt);
$newnum = $lastnum['imageID']+1;

//Set image dir
$image_root = $DOCUMENT_ROOT.'/images/';

//Create a temp image file from uploaded jpeg
$tempimage = imagecreatefromjpeg("$f_image");
$temp_h = ImageSX($tempimage);
$temp_w = ImageSY($tempimage);

//Checks that the image is not too small
if($temp_h < 50 && $temp_w <50)
{
echo "ERROR: Image is less then 50x50.";
exit;
}
//set file name

$filename = $newnum.'.jpg';

//save image
if(!ImageJpeg($tempimage, $image_root.$filename))
{
echo "ERROR: Image unable to upload!";
exit;
}
$smallfilename = $newnum.'_t.jpg';

if($temp_h < 200 && $temp_w <180)
{
//Save thumbnail
if(!ImageJpeg($tempimage, $image_root.$smallfilename))
{
echo "ERROR: Thumbnail Image unable to upload!";
exit;
}
}
else
{
echo "Resize beginning.";
if(($temp_h*1.8) > ($temp_w*2))
{
$ratio = $temp_h/$temp_w;
$dest_w = 200*$ratio;
$dest_h = 200;
echo "ONE - $dest_w - $dest_h";
}
if(($temp_h*1.8) < ($temp_w*2))
{
$ratio = $temp_w/$temp_h;
echo "Ratio - $ratio ";
$dest_w = 180;
$dest_h = 180*$ratio;
echo "TWO - $dest_w - $dest_h";
}
if(($temp_h*1.8) == ($temp_w*2))
{
$dest_w = 180;
$dest_h = 200;
}
$image_t = imagecreatetruecolor($dest_w, $dest_h);
imagecopyresampled($image_t, $tempimage, 0, 0, 0, 0, $dest_w, $dest_h, 
$temp_w, $temp_h);
if(!ImageJpeg($image_t, $image_root.$smallfilename))
{
echo "ERROR: Thumbnail Image unable to Upload!";
exit;
}
}


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


[PHP] Follow Up

2002-07-25 Thread Nicholas Mercier

Okay, I somehow fixed it.  But to make sure I am clear on this ImageSY Will 
give the vertical height of an image and ImageSX will give the width?

Sorry to spam with such a stupid mistake...

Me.


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




Re: [PHP] Facing some problem with mySQL Installation

2002-07-25 Thread S.

Maybe it's a permission problem: if you read the installation procedure of 
MySQL, you can find that some file system permission modifies are required 
(you must modify the permissions of 2 or 3 file (or directories));
Have you chenged theese permission?

S.

Il 08:52, giovedì 25 luglio 2002, Manisha ha scritto:
> I know I should not ask this question - but as I am not getting prompt
> reply from mysql mailing list posting it here too - Just in case anybody
> knows about it
>
> 
> I am trying to install the mySQL on our remote server thr putty (SSH).
> Following are the set of commands given by me,
>
> I have downloaded mysql-3.23 for BSDi.
>
> 1)put into /usr/home/mysql-src directory and given following 2 commands
> going into
> shell>cd  /usr/home/mysql-src
> shell>gunzip mysql-.tar.gz
> shell>tar xvf mysql-.tar
>
> This is creating the directory mysql-
> 2)Config -
>
> shell>cd  /usr/home/mysql-src/mysql-
> shell>./configure -basedir=/usr/home/mysql -with-low-memory
>
> This command is giving me problem - saying - at the end
> shell>Starting mysqld daemon with database from
> /usr/home/mysql-src/mysql-/data
> rm /tmp/mysql.sock - Operation not permitted
> mysqld end
>
>
> Can anybody help me in this matter - What is the meaning of it ?
>
> Thanks in advance and regards
> Manisha


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




Re: [PHP] The page before for newman.

2002-07-25 Thread Justin French

$_GLOBAL['HTTP_REFERER']

Which I found myself by going to the manual, looking at the variables
section, looking under predefined variables, and having a bit of a dig
around :)

Be warned, HTTP_REFERER does NOT have to be set by the browser, so you
shouldn't rely on it AT ALL for mission critical stuff.


Justin French


on 25/07/02 5:27 PM, Philip J. Newman ([EMAIL PROTECTED]) wrote:

> I'm looking for the global veriable that lists the page before the page that
> i just came from.  Anyone know what i'm talking about?
> 
> ---
> Philip J. Newman.
> PhilipNZ.com Design Solutions
> http://www.philipnz.com/
> [EMAIL PROTECTED]
> 
> Mob: +64 (25) 6144012.
> Tele: +64 (25) 6144012.
> 
> Personal Site:
> Philip J. Newman
> Internet Developer
> http://www.philipsdomain.com/
> [EMAIL PROTECTED]
> 
> 
> 


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




Re: [PHP] Accessing upper directory of public_html directory

2002-07-25 Thread Miguel Cruz

On Wed, 24 Jul 2002, Justin French wrote:
> If your ISP doesn't allow you to use .htaccess files in this way, AND can't
> provide you with a directory outside the document root for placing sensitive
> files, then I'd recommend switching hosts, because they clearly don't have
> an understanding of what you need.

It's possible they put each of their customer in a chroot jail, in which
case - barring gross mistakes on the part of the customer - keeping the
password in a .php file in the docroot is quite secure.

miguel


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




Re: [PHP] best way to log bad email address'

2002-07-25 Thread Justin French

on 25/07/02 5:37 PM, Miguel Cruz ([EMAIL PROTECTED]) wrote:

> In almost every case, mail() will return true, regardless of how bogus the
> destination email address is.
>
> mail() just dumps it into the mail queue. There's a lot that goes on
> between there and delivery, and mail() doesn't wait around.

That's what I figured/feared :)

> You'll need to catch bounces as they come in. To make life easier, assign
> your own unique Message-IDs and remember them, so you can easily
> invalidate addresses.

Erm, I'm on a shared server, so I don't *think* it's that easy unfortunately
-- I can't get a message to bounce to the From: or Reply-To: headers I set.
My guess is it goes to an address set in php.ini, or somewhere else, and is
global to the entire server (doesn't help me).

Unless I can set it was .htaccess or ini_set().


TIA

Justin French





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




Re: [PHP] control structure question

2002-07-25 Thread Miguel Cruz

On Tue, 23 Jul 2002, Javier Montserat wrote:
> So refering back, i re-wrote the original example using the switch syntax...
> 
> switch (true) {
> case doStep1():
> case doStep2():
> case doStep3():
>   error();
>   break;
> default:
>   valid();
> }
> 
> Each case expressions is evaluated, until one of them evaluates to a value 
> equal (==) to the switch expression (in this case a boolean error flag).
> 
> The error() code will only be called if one of the doStep() evaluates to 
> false.
> 
> And the valid() code will only be evaluated if the switch reached the 
> default, which means that none of the above check returned false
> 
> I think for this example the switch syntax is more elegant than using a 
> series of if() statements.

That's pretty clever!

miguel


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




Re: [PHP] Newman Asks, Do i have to use session_name('sid') every...

2002-07-25 Thread Justin French

on 25/07/02 5:43 PM, Philip J. Newman ([EMAIL PROTECTED]) wrote:

> session_name('sid');
> session_start();
> 
> Do i have to use session_name('sid'); every time i use session_start(); or
> can session_name be used once?

*sigh*

How about testing it on two pages?

Or better still, LOOK IN THE MANUAL

php.net/session_name CLEARLY states:

"
The session name references the session id in cookies and URLs. It should
contain only alphanumeric characters; it should be short and descriptive
(i.e. for users with enabled cookie warnings). The session name is reset to
the default value stored in session.name at request startup time. Thus, you
need to call session_name() for every request (and before session_start() or
session_register() are called).
"

Justin French


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




Re: [PHP] Re: can there be a fax gateway?

2002-07-25 Thread Miguel Cruz

On Wed, 24 Jul 2002, Briggsy wrote:
> Altn-N have a product called relayfax which is used with e-mail. You could
> use forms to send an email and have realyfax fax it
> 
> www.altn.com They have awesome support for their mailserver MDaemon so I
> would say realyfax would be equally as good

Also, there's a free volunteer network of fax servers you can read about 
at:

   http://www.tpc.int/

Coverage is not universal, and you might get ads on the cover sheet, but
I've used it plenty of times over the years (this has been around for a
decade or so) and it's served me well.

miguel


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




[PHP] NT2000 ARGH!

2002-07-25 Thread Francis

Ok PHP was working fine on this NT2000 box and now its totally smegged.
Every PHP page gives the error:

-2147467259 (0x80004005)

Then IIS restarts itself, i've tried reinstalling with the latest version
(4.2.2) of PHP, rebooted, no joy, then reinstalled IIS rebooted thenthen it
constantly asked for a username and password (NT authentication box) for php
files ONLY, if you typed in the admin password it seemed to work ok,
rebooted again and now I get the above error message. Is 4.2.2 a stable
release? not that it really matters as I was getting the same problems with
4.2.1

HELP! :)



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




RE: [PHP] datetime field - still a newbie

2002-07-25 Thread John Holmes

> I have a datetime field in one of my mysql tables...when displaying
some
> of
> my records I want to display the date in the aforementioned datetime
> field,
> but if the date is today I want to display "today" instead.  If the
date
> is
> yesterday I want it to display that  so I how do I compare the
date in
> my record to todays date? Thanks

I posted this response earlier...did you get it? Are you looking for a
MySQL solution or a PHP solution??

SELECT IF(TO_DAYS(CURDATE()) =
TO_DAYS(date_column),'Today',IF(TO_DAYS(CURDATE())-1 =
TO_DAYS(date_column),'Yesterday',date_column)) FROM your_table;

If you want a PHP solution, then just select the regular MySQL date
format MMDD and use something like this when looping through your
results.

switch($your_row['Date_Column'])
{
  case date("Ymd"):
echo "Today";
break;
  case date("Ymd",strtotime("-1 day")):
echo "Yesterday";
break;
  default:
echo $your_row['Date_Column'];
}

Untested code, of course...

---John Holmes...




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




RE: [PHP] install issues on Solaris

2002-07-25 Thread David Robley

In article <[EMAIL PROTECTED]>, [EMAIL PROTECTED] 
says...
> ok unix.h problem solved but now it's saying can't locate .libs/libZend.a
>  any ideas?
> 
> 
> ~thinks: sheesh no wonder more and more people just use windose for PHP
> since it looking like its too bloody hard to install any where else lol~
> 

Furrfu - don't tar all *nix with the same brush :-) Presumably, for some 
reason, that file hasn't been created? Have a look in the libs directory 
under your tarball extraction directory; but perhaps the few lines out of 
make output prior to the error might be useful?


Cheers
-- 
David Robley
Temporary Kiwi!

Quod subigo farinam

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




[PHP] RE: [PHP-DB] Re: arrays, variables, and register_globals

2002-07-25 Thread David Robley

On 25 Jul 2002 at 2:04, GOLD, MATTHEW wrote:

>  thank you very much for your quick response.
> 
> How do I run mysql_fetch_row before the while loop?  I don't want two
> loops, because I just want this variable to print out once.
> 
> I tried this, but it didn't work:
> 
> $query = "Select blah1, blah2, blah3 from blahtable";
> $result = mysql_query ($query)
>  or die ("Cannot complete query");
> 
> $row = mysql_fetch_row ($result))
> print ("$row[4]");
> 
> while ($row = mysql_fetch_row ($result))
> {
>  print "$row[1], $row[2], etc.");
> }
> 
> ?>
> 
> I realize that my problem is that I don't really understand arrays...but I
> am new to all of this, and I very much appreciate your help.
> 
> best,
> 
> Matt

So what you want to do is print a field from the first row extracted from the table, 
then 
loop through all the rows and print several fields? I think you want mysql_data_seek.

Whenever you do a mysql_fetch_row, php grabs the current row from the result set, and 
shifts a pointer to the next record in the result set. In this case it seems you need 
to 
print from the first record, then reset the pointer to the first record and print from 
all 
records found. So:

$row = mysql_fetch_row ($result))
print ("$row[4]");

mysql_data_seek($result, 0);  // Add this

while ($row = mysql_fetch_row ($result))

Unless I misunderstand what you are trying to do

Cheers
-- 
David Robley
Temporary Kiwi!
Quod subigo farinam

"I've been to a film festival in the South of France," said Tom cannily.



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




[PHP] testing

2002-07-25 Thread lallous

test



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




[PHP] include() limits

2002-07-25 Thread lallous

Hello,

I wonder how much I can include files?

does it matter if the size sum of the source code included are above 1MB ?

thanks,

elias



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




[PHP] Re: testing

2002-07-25 Thread lallous

test ok!



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




[PHP] Re: NT2000 ARGH!

2002-07-25 Thread Francis

ok change to cgi, seems to be alot more stable now.

"Francis" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Ok PHP was working fine on this NT2000 box and now its totally smegged.
> Every PHP page gives the error:
>
> -2147467259 (0x80004005)
>
> Then IIS restarts itself, i've tried reinstalling with the latest version
> (4.2.2) of PHP, rebooted, no joy, then reinstalled IIS rebooted thenthen
it
> constantly asked for a username and password (NT authentication box) for
php
> files ONLY, if you typed in the admin password it seemed to work ok,
> rebooted again and now I get the above error message. Is 4.2.2 a stable
> release? not that it really matters as I was getting the same problems
with
> 4.2.1
>
> HELP! :)
>
>



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




[PHP] PHP: preview an html file.

2002-07-25 Thread Alia Mikati

Hello everybody,
I hope u can help me with this. I'll be very grateful!
This file retrieves a list of files from a folder on the server and then 
has to diplay a list of them. When selecting one of them in the list, it 
should display a preview (i.e. its contents) in the same file. I think i 
should use frames but donno how to do it :(.
Thx a lot









 
 Plz select a page template:
 

read()))
 {
if ($entry != '.' && $entry != '..')
echo ''.$entry.'.\n';
 }
?>

 
 









close();
?>



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




Re: [PHP] include() limits

2002-07-25 Thread Jason Wong

On Thursday 25 July 2002 18:41, lallous wrote:
> Hello,
>
> I wonder how much I can include files?
>
> does it matter if the size sum of the source code included are above 1MB ?

Instead of testing the mailing list, why not try the above for yourself?

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

/*
Deadwood, n.:
Anyone in your company who is more senior than you are.
*/


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




[PHP] Re: preview an html file.

2002-07-25 Thread lallous

Hello,

1. you must have a frame system with two frames: frame1 called fileslist,
fametwo called: preview
when you build the files list do like this:
$filename";
}
?>

then declare a javascript function as:

function display(filename)
{
  window.frames['preview'].location = filename;
}


should work.

//Elias

"Alia Mikati" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Hello everybody,
> I hope u can help me with this. I'll be very grateful!
> This file retrieves a list of files from a folder on the server and then
> has to diplay a list of them. When selecting one of them in the list, it
> should display a preview (i.e. its contents) in the same file. I think i
> should use frames but donno how to do it :(.
> Thx a lot
>
>
>
>  $d = dir("/home/mcms/public_html/MCMS/Alia/pageTmp");
> ?>
>
> 
> 
> 
> 
>  
>  Plz select a page template:
>  
>
>   while (false !== ($entry = $d->read()))
>  {
> if ($entry != '.' && $entry != '..')
> echo ''.$entry.'.\n';
>  }
> ?>
>
>  
>  
>  value="/home/mcms/public_html/MCMS/Alia/pageTmp/" name="pageField" />
>
>
>  /*if (!$file = fopen("/home/mcms/public_html/MCMS/Alia/pageTmp/
> $pageList", "rb")){
> echo("couldnt open the file.");
> } else{
> fpassthru($file);
> }*/
> ?>
>
> 
> 
> 
>
>  $d->close();
> ?>
>
>



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




[PHP] uploading pictures

2002-07-25 Thread Oliver Witt

Hi!
I got a problem with uploading pictures. Using a script following this
schema:

if (is_uploaded_file($HTTP_POST_FILES['userfile']['tmp_name'])) {
copy($HTTP_POST_FILES['userfile']['tmp_name'],
"/place/to/put/uploaded/file");
} else {
echo "Possible file upload attack. Filename: " .
$HTTP_POST_FILES['userfile']['name'];

 the script always returns:
Warning: Unable to create '/*.jpg': Permission denied in fotos2.php on
line 62

I do not understand why that happens. Do I need to include a password
somewhere or somehitng like that? Thank you for your help!
Oliver



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




Re: [PHP] uploading pictures

2002-07-25 Thread Alexander Kuznetsov

Hello Oliver,

Thursday, July 25, 2002, 1:23:24 PM, you wrote:

OW> Hi!
OW> I got a problem with uploading pictures. Using a script following this
OW> schema:

OW> if (is_uploaded_file($HTTP_POST_FILES['userfile']['tmp_name'])) {
OW> copy($HTTP_POST_FILES['userfile']['tmp_name'],
OW> "/place/to/put/uploaded/file");
OW> } else {
OW> echo "Possible file upload attack. Filename: " .
OW> $HTTP_POST_FILES['userfile']['name'];

OW>  the script always returns:
OW> Warning: Unable to create '/*.jpg': Permission denied in fotos2.php on
OW> line 62

OW> I do not understand why that happens. Do I need to include a password
OW> somewhere or somehitng like that? Thank you for your help!
OW> Oliver

i think u should set write permissions to directory
where u r trying to copy file

-- 
Best regards,
Alexander Kuznetsov
Leading Web-programmer
[EMAIL PROTECTED]
Centre of engineering technologies CS Trade
http://www.cstrade.ru



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




[PHP] Reg exp to remove line feeds before lines starting with white space

2002-07-25 Thread Nicklas af Ekenstam

Hi

I'm trying to do some parsing of mail headers and since not all
headers follow the pattern:

X-Header-A: A string
X-Header-B: Another string that is longer
X-Header-C: And this string is very very long compared

But may very well look like this:

X-Header-A: A string
X-Header-B: Another string that is 
 longer
X-Header-C: And this string is very very long 
compared

(Note that two of the header lines above wrap more than one line.)

In order to read the headers into an array of header key/value fields
i would like a reg exp to remove all new lines/line feeds before a
line starting with one or more white spaces or tabs.

I've tried myself but I'm just nog good with reg exps.


Thanks in advance,
Nicklas

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




[PHP] pop3 authentication

2002-07-25 Thread Henry

i've got this code for domain/email authentication:

function validateEmail ($email) {
 //
 $d = explode('@',$email) ;
 $domain = $d[1] ;
 $link = fsockopen($domain, 80, &$errno, &$errstr, 30) ;
 if (!$link) {return false ;} else { return true ; }
}

in addition i'd like to check a pop3 server on the domain, is this possible using 
php?? anyone have
demo code for something like this?

cheers
Henry



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




[PHP] Applying XSL to XML with PHP

2002-07-25 Thread ctan

I'm trying to apply XSL to XML stored in a MySQL database with PHP. How do I
go about doing this? I've tried following the example on php.net but I seem
to run into a lot of trouble. Here's how the code looks like (BTW aml is XML
stored in the argument Table):


if (! empty($searchword ))

   $query = "SELECT aml FROM arguments WHERE aml LIKE '%$searchword%'";
   $result = mysql_query($query) or die ("Query failed");
   $line = mysql_fetch_array($result, MYSQL_ASSOC);

// Create an array
$arguments = array('/_xml'=> $line);

//XSL file
$xsl = "./sheet1.xsl"; 

// Create an XSLT processor
$xslthandler = xslt_create();

// Perform the transformation
$html = xslt_process( $xslthandler, 'arg:/_xml', $xsl, NULL, $arguments);

// Detect errors
if (!$html) die ('XSLT processing error: '.xslt_error($xslthandler));

// Destroy the XSLT processor
xslt_free($xslthandler);

// Output the resulting HTML
print $html;


What I get on the screen is:


Array ( [0] => "With the contents of my variable...")


And:


Warning: Sablotron error on line 1: XML parser error 2: syntax error in
/home/httpd/html/ctan/resultworkingcopy2.php on line 93 XSLT processing
error: XML parser error 2: syntax error


What gives? I really need to solve this urgent. Thanks...

Chia

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




Re[2]: [PHP] uploading pictures

2002-07-25 Thread Alexander Kuznetsov

Hello Oliver,

Thursday, July 25, 2002, 1:42:05 PM, you wrote:

OW> Alexander Kuznetsov schrieb:

>> i think u should set write permissions to directory
>> where u r trying to copy file

OW> Thank you for answering.
OW> But how do I set write permisisons? With a .htaccess file?
OW> Oliver

i think the reason is write permission on file system of the server
and u have to type chmod command:

shell> chmod a+r /place/to/put/uploaded/file

P.S. When reply message use Reply-To All option for you answer will be
accessible in PHP-general mailing list ;)

-- 
Best regards,
Alexander Kuznetsov



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




[PHP] timing header("Location: " )

2002-07-25 Thread JJ Harrison

Is it possible to make the browser wait say, 5 seconds before redirection by
outputting headers?  I know you can do it with meta tags but not how by
outputting headers


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



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




Re: [PHP] timing header("Location: " )

2002-07-25 Thread Rénald CASAGRAUDE

On Thursday, July 25, 2002, at 01:02 PM, JJ Harrison wrote:

> Is it possible to make the browser wait say, 5 seconds before 
> redirection by
> outputting headers?  I know you can do it with meta tags but not how by
> outputting headers

http://www.php.net/manual/en/function.sleep.php

R.


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




[PHP] PHP extension names

2002-07-25 Thread Peter

Hi,

I need to use extension_loaded() to try and detect which database interface(s) are 
installed on some servers.  Nowhere have I been able to find a 
list of the internal extension names that is the string required as the function 
argument.  I know I can see those in my build of PHP using

% php -m

but that's not the complete list.  Can someone help?
Thanks,
Peter



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




[PHP] Re: PHP extension names

2002-07-25 Thread lallous

try:
  function_exists('mysql_query') <- if TRUE then MySql is supported, etc...


"Peter" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Hi,
>
> I need to use extension_loaded() to try and detect which database
interface(s) are installed on some servers.  Nowhere have I been able to
find a
> list of the internal extension names that is the string required as the
function argument.  I know I can see those in my build of PHP using
>
> % php -m
>
> but that's not the complete list.  Can someone help?
> Thanks,
> Peter



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




[PHP] Re: Creating a calender / diary

2002-07-25 Thread lallous

try www.hotscripts.com there are lots of scripts as your request.

"Craig" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> i am using dreamweaver mx and want to acheive the following
>
> 9:00 task 1
> 9:30 task 2
> 10:00   task 3
> task 4
> task 5
> 10:30   task 6
>
> i have a recordset that displays the tasks ordered by the time but what i
> dont want is to display the time for every item, or if an entry is at
10:15
> for example.
>
> Any ideas???
>
>
> Craig
>
>
>



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




[PHP] preg_match() occurence position

2002-07-25 Thread lallous

Hello,

Can I get the starting position of my string occurence when using any
regexps searching functions in PHP ?

for example:
$mem='this is a test';
preg_match('/test/', ...) should return me somehow: 10


Thanks



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




Re: [PHP] preg_match() occurence position

2002-07-25 Thread Jason Wong

On Thursday 25 July 2002 20:40, lallous wrote:
> Hello,
>
> Can I get the starting position of my string occurence when using any
> regexps searching functions in PHP ?
>
> for example:
> $mem='this is a test';
> preg_match('/test/', ...) should return me somehow: 10

No. 

If search string does not involve a regex then just use the plain string 
search functions.

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

/*
We will have solar energy as soon as the utility companies solve one technical
problem -- how to run a sunbeam through a meter.
*/


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




Re: [PHP] preg_match() occurence position

2002-07-25 Thread Alexander Kuznetsov

Hello lallous,

Thursday, July 25, 2002, 3:40:32 PM, you wrote:

l> Hello,

l> Can I get the starting position of my string occurence when using any
l> regexps searching functions in PHP ?

l> for example:
l> $mem='this is a test';
l> preg_match('/test/', ...) should return me somehow: 10


l> Thanks


why regexps?
what about simple string fuctions in PHP?

for your example they will be more usefull:

strrpos - http://www.php.net/manual/en/function.strrpos.php

sample:

$text = "string";
echo strrpos($text, "r"); // must show 2 as result



-- 
Best regards,
Alexander Kuznetsov



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




RE: [PHP] preg_match() occurence position

2002-07-25 Thread John Holmes

> Can I get the starting position of my string occurence when using any
> regexps searching functions in PHP ?
> 
> for example:
> $mem='this is a test';
> preg_match('/test/', ...) should return me somehow: 10

Does it have to be a regular expression you are searching for? If not,
you can use strpos().

www.php.net/strpos

---John Holmes...


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




[PHP] Re: preg_match() occurence position

2002-07-25 Thread David Robley

In article <[EMAIL PROTECTED]>, [EMAIL PROTECTED] 
says...
> Hello,
> 
> Can I get the starting position of my string occurence when using any
> regexps searching functions in PHP ?
> 
> for example:
> $mem='this is a test';
> preg_match('/test/', ...) should return me somehow: 10
> 
> 
> Thanks

strpos might be useful

-- 
David Robley
Temporary Kiwi!

Quod subigo farinam

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




[PHP] Re: Reg exp to remove line feeds before lines starting with white space

2002-07-25 Thread lallous


Mailing-List: contact [EMAIL PROTECTED]; run by ezmlm
Delivered-To: mailing list [EMAIL PROTECTED]
Received1: (qmail 60843 invoked from network); 25 Jul 2002 10:36:29 -
Received: from unknown (HELO parker.comology.com) (213.187.218.7)
  by pb1.pair.com with SMTP; 25 Jul 2002 10:36:29 -
Received2: (qmail 14308 invoked by uid 500); 25 Jul 2002 10:36:27 -
Date: Thu, 25 Jul 2002 12:36:27 +0200
To: [EMAIL PROTECTED]
Message-ID: <[EMAIL PROTECTED]>
Reply-To: Nicklas af Ekenstam <[EMAIL PROTECTED]>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
User-Agent: Mutt/1.3.28i
X-Operating-System: Linux parker 2.4.10-4GB
X-PGP-Key: http://nille.org/pubkey.txt
Organization: comology.se
Subject: Reg exp to remove line feeds before lines starting with white space
From: [EMAIL PROTECTED] (Nicklas Af Ekenstam)

Hi

Im trying to do some parsing of mail headers and since not all
headers follow the pattern:
';

$lines = split("\n", $mem);

for ( $c = count($lines), $i=0, $headers = array(), $lastkey = 'x'
 ;$i<$c
 ;$i++)
{
  $t = $lines[$i];
  if (preg_match('/^([a-z].+?):\s*(.+)/i', $t, $result))
  {
$lastkey = $result[1];
$headers[$lastkey] = trim($result[2]);
  }
  else
  {
$headers[$lastkey] .= "\n" . $t;
  }

  // end of headers?
  if (trim($t)=='')
break;
}

while (list($key, $val) = each($headers))
  echo "$key=$val\n";
?>

note: i have renamed headers with same name! like 'received' cause I don't
know how you want to handle them!

good luck,

//elias

"Nicklas Af Ekenstam" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Hi
>
> I'm trying to do some parsing of mail headers and since not all
> headers follow the pattern:
>
> X-Header-A: A string
> X-Header-B: Another string that is longer
> X-Header-C: And this string is very very long compared
>
> But may very well look like this:
>
> X-Header-A: A string
> X-Header-B: Another string that is
>  longer
> X-Header-C: And this string is very very long
> compared
>
> (Note that two of the header lines above wrap more than one line.)
>
> In order to read the headers into an array of header key/value fields
> i would like a reg exp to remove all new lines/line feeds before a
> line starting with one or more white spaces or tabs.
>
> I've tried myself but I'm just nog good with reg exps.
>
>
> Thanks in advance,
> Nicklas



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




[PHP] Re: Applying XSL to XML with PHP

2002-07-25 Thread Peter Clarke

Ctan wrote:
> I'm trying to apply XSL to XML stored in a MySQL database with PHP. How do I
> go about doing this? I've tried following the example on php.net but I seem
> to run into a lot of trouble. Here's how the code looks like (BTW aml is XML
> stored in the argument Table):
> 
> 
> if (! empty($searchword ))
> 
>$query = "SELECT aml FROM arguments WHERE aml LIKE '%$searchword%'";
>$result = mysql_query($query) or die ("Query failed");
>$line = mysql_fetch_array($result, MYSQL_ASSOC);
> 
> // Create an array
> $arguments = array('/_xml'=> $line);
> 
> //XSL file
> $xsl = "./sheet1.xsl"; 
> 
> // Create an XSLT processor
> $xslthandler = xslt_create();
> 
> // Perform the transformation
> $html = xslt_process( $xslthandler, 'arg:/_xml', $xsl, NULL, $arguments);
> 
> // Detect errors
> if (!$html) die ('XSLT processing error: '.xslt_error($xslthandler));
> 
> // Destroy the XSLT processor
> xslt_free($xslthandler);
> 
> // Output the resulting HTML
> print $html;  
> 
> 
> What I get on the screen is:
> 
> 
> Array ( [0] => "With the contents of my variable...")
> 
> 
> And:
> 
> 
> Warning: Sablotron error on line 1: XML parser error 2: syntax error in
> /home/httpd/html/ctan/resultworkingcopy2.php on line 93 XSLT processing
> error: XML parser error 2: syntax error
> 
> 
> What gives? I really need to solve this urgent. Thanks...
> 
> Chia

What is the xml. There may be a content encoding problem or some other 
xml issue.

Peter


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




Re: [PHP] preg_match() occurence position

2002-07-25 Thread lallous

Yes, I'm aware of the strpos() or any other non-regexp string functions...

but it is either I use regexp to match a certain pattern or I'll have to
write a char-by-char parser to emulate regexp searching and yet get the
position of the occurence!

Thank you all anyway.

//Elias

"Alexander Kuznetsov" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Hello lallous,
>
> Thursday, July 25, 2002, 3:40:32 PM, you wrote:
>
> l> Hello,
>
> l> Can I get the starting position of my string occurence when using any
> l> regexps searching functions in PHP ?
>
> l> for example:
> l> $mem='this is a test';
> l> preg_match('/test/', ...) should return me somehow: 10
>
>
> l> Thanks
>
>
> why regexps?
> what about simple string fuctions in PHP?
>
> for your example they will be more usefull:
>
> strrpos - http://www.php.net/manual/en/function.strrpos.php
>
> sample:
>
> $text = "string";
> echo strrpos($text, "r"); // must show 2 as result
>
>
>
> --
> Best regards,
> Alexander Kuznetsov
>
>



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




RE: [PHP] Newman Asks, List Asks ...

2002-07-25 Thread Jay Blanchard

..do you have access to http://www.php.net? Nothing personal Newman, but
RTFM. Most of the answers, if not all are there. Also, did you know that
http://www.vaahq.com is down? Just thought I'd let you know since it is in
your portfolio.

Oh, and that whole tird-person Newman thingboring and irritating.

"Put more FUN in dysFUNctional"

*
* Want to meet other PHP developers *
* in your area? Check out:  *
* http://php.meetup.com/*
* No developer is an island ... *
*




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




Re: [PHP] preg_match() occurence position

2002-07-25 Thread Michael Sims

On Thu, 25 Jul 2002 15:05:36 +0200, you wrote:

> l> for example:
> l> $mem='this is a test';
> l> preg_match('/test/', ...) should return me somehow: 10

How about this:

$mem='this is a test';

if(preg_match("/(.*)test/",$mem,$matches)) {
  echo strlen($matches[1]);
}

Of course, if "test" occurs more than once then the above won't work,
since regex's are "greedy"...

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




[PHP] Re: How to store an image into a mysql database using php language?

2002-07-25 Thread lallous

insert into table(imagefield) values(load_file('/path/to/image.jpg'))

i remember that worked for me.

//elias

"Rija" <[EMAIL PROTECTED]> wrote in message
001501c231f5$72337a40$3d00a8c0@workelp3">news:001501c231f5$72337a40$3d00a8c0@workelp3...
I want to store image data into mysql table using BLOB but I don't know how
to read it after. To record the image, I doesn't have any problem, but to
read the file after and to view the image, I can't do anything the variable
show only comment like this: memobin24.bin

So how can I do?

This was the script.







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




Re: [PHP] preg_match() occurence position

2002-07-25 Thread Tim Fountain


On Thursday, July 25, 2002, Michael Sims wrote:

> On Thu, 25 Jul 2002 15:05:36 +0200, you wrote:

>> for example:
>> $mem='this is a test';
>> preg_match('/test/', ...) should return me somehow: 10

> How about this:

> $mem='this is a test';

> if(preg_match("/(.*)test/",$mem,$matches)) {
>   echo strlen($matches[1]);
> }

> Of course, if "test" occurs more than once then the above won't
> work, since regex's are "greedy"...

If you add a ? after the * then that'll make it non-greedy won't it?

-- 
Tim Fountain ([EMAIL PROTECTED])
http://www.tfountain.co.uk/


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




Re: [PHP] Re: PHP 4.2.2 install woe: cannot stat libs/libphp.so

2002-07-25 Thread Reuben D. Budiardja

Hi, Thanks for the reply, but somehow I got it to work yesterday.
Someone else in this list pointed out the same problem and file a bug
report. They say it's fixed in CVS.

http://bugs.php.net/?id=18522&edit=2

Reuben D. Budiardja


On Wed, 2002-07-24 at 19:49, David Robley wrote:
> In article <[EMAIL PROTECTED]>, 
> [EMAIL PROTECTED] says...
> > On Wed, 2002-07-24 at 08:29, Ian Ball wrote:
> > > Assuming you are installing from your php-4.2.2 directory, it would appear 
> > > the libphp4.so hasn't actually been made, which would point to a possible 
> > > error in the configuration parameters.  I am also assuming your php 4.2.1 
> > > made OK which would mean all necessary libraries etc are available on your 
> > > system.  What are you using for the configure?  On my system it was
> > > ./configure --with-mysql --with-apxs=/usr/local/apache/bin/apxs
> > > I did have ldap in there too, but for most people this is not necessary.  
> > 
> > Here is my configure line. Yes, my prev php 4.2.1 made and install fine
> > with the same configure line. I did exactly the same steps as when I
> > install 4.2.1
> > 
> 
> OK - after you do 'make' is there a file libphp4.so in the lib directory 
> under where you unpacked the install tarball? If not, something has 
> apparently gone wrong with the make process or the configure; you might 
> check (I think it is) config.log in the top of the install directory for 
> any clues.
> 
> I'm not sure, but it might be --enable-track-vars (unless that is a typo); 
> check with configure --help | grep track

> Cheers 
> -- 
> David Robley
> Temporary Kiwi!
> 
> Quod subigo farinam
> 
> -- 
> 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() occurence position

2002-07-25 Thread Justin French

on 25/07/02 11:05 PM, lallous ([EMAIL PROTECTED]) wrote:

> Yes, I'm aware of the strpos() or any other non-regexp string functions...
> 
> but it is either I use regexp to match a certain pattern or I'll have to
> write a char-by-char parser to emulate regexp searching and yet get the
> position of the occurence!

Actually, I've just written one of them, and they're not that hard, as long
as the sub-set of what you want to do is limited.

Justin French



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




[PHP] automatic job execution

2002-07-25 Thread Paul O'Neil

I have a php script I would like run like a cron job every so many minutes.
How is this done?


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




Re: [PHP] automatic job execution

2002-07-25 Thread Scott

Depends on what system you are running, let us know and we can better 
answer the question.




On Thu, 25 Jul 2002, Paul O'Neil wrote:

> I have a php script I would like run like a cron job every so many minutes.
> How is this done?
> 
> 
> 


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




Re: [PHP] automatic job execution

2002-07-25 Thread Scott

On second thought, do you just want the script to run and sleep or 
actually schedule it as a job?  You could just use sleep().

set_time_out(0);

while ($i = 0){
your code

sleep(60);
}

We use this at my company for a file parsing program, it runs, sleeps 15
minutes and repeats.

-Scott



On Thu, 25 Jul 2002, Paul O'Neil wrote:

> I have a php script I would like run like a cron job every so many minutes.
> How is this done?
> 
> 
> 


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




RE: [PHP] automatic job execution

2002-07-25 Thread Paul O'Neil

I looked at some old posts and I found #!/usr/local/bin/php -q should be
included at the top of the script but I don't think I have permission on the
system I'm on.

-Original Message-
From: Scott [mailto:[EMAIL PROTECTED]]
Sent: Thursday, July 25, 2002 6:25 AM
To: Paul O'Neil
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP] automatic job execution


On second thought, do you just want the script to run and sleep or
actually schedule it as a job?  You could just use sleep().

set_time_out(0);

while ($i = 0){
your code

sleep(60);
}

We use this at my company for a file parsing program, it runs, sleeps 15
minutes and repeats.

-Scott



On Thu, 25 Jul 2002, Paul O'Neil wrote:

> I have a php script I would like run like a cron job every so many
minutes.
> How is this done?
>
>
>


--
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] automatic job execution

2002-07-25 Thread Paul O'Neil

awe shit, that did work. thanks!

-Original Message-
From: Scott [mailto:[EMAIL PROTECTED]]
Sent: Thursday, July 25, 2002 6:25 AM
To: Paul O'Neil
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP] automatic job execution


On second thought, do you just want the script to run and sleep or
actually schedule it as a job?  You could just use sleep().

set_time_out(0);

while ($i = 0){
your code

sleep(60);
}

We use this at my company for a file parsing program, it runs, sleeps 15
minutes and repeats.

-Scott



On Thu, 25 Jul 2002, Paul O'Neil wrote:

> I have a php script I would like run like a cron job every so many
minutes.
> How is this done?
>
>
>


--
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] automatic job execution

2002-07-25 Thread Scott

In order to run the script from the command line you need the cgi or 
executable version of PHP.  You can have both on the machine, Apache uses 
mod_php and you use the cgi version for your scripts on the machine.


On Thu, 25 Jul 2002, Negrea Mihai wrote:

> and what happens if you restart apache... ?
> 
> On Thursday 25 July 2002 04:25 pm, Scott wrote:
> > On second thought, do you just want the script to run and sleep or
> > actually schedule it as a job?  You could just use sleep().
> >
> > set_time_out(0);
> >
> > while ($i = 0){
> > your code
> >
> > sleep(60);
> > }
> >
> > We use this at my company for a file parsing program, it runs, sleeps 15
> > minutes and repeats.
> >
> > -Scott
> >
> > On Thu, 25 Jul 2002, Paul O'Neil wrote:
> > > I have a php script I would like run like a cron job every so many
> > > minutes. How is this done?
> 
> 


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




Re: [PHP] preg_match() occurence position

2002-07-25 Thread lallous

Yes, I've done it before too...but I saw some other libraries(in other
programming langs) that has such features...

"Justin French" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> on 25/07/02 11:05 PM, lallous ([EMAIL PROTECTED]) wrote:
>
> > Yes, I'm aware of the strpos() or any other non-regexp string
functions...
> >
> > but it is either I use regexp to match a certain pattern or I'll have to
> > write a char-by-char parser to emulate regexp searching and yet get the
> > position of the occurence!
>
> Actually, I've just written one of them, and they're not that hard, as
long
> as the sub-set of what you want to do is limited.
>
> Justin French
>
>



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




RE: [PHP] automatic job execution

2002-07-25 Thread Scott

You can do that or just run the command:
/usr/local/bin/php -q name_of_script.php

If you want to call the script directly by name instead of calling php 
like that you will need to make to executable and add the # line at the 
top.


On Thu, 25 Jul 2002, Paul O'Neil wrote:

> I looked at some old posts and I found #!/usr/local/bin/php -q should be
> included at the top of the script but I don't think I have permission on the
> system I'm on.
> 
> -Original Message-
> From: Scott [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, July 25, 2002 6:25 AM
> To: Paul O'Neil
> Cc: [EMAIL PROTECTED]
> Subject: Re: [PHP] automatic job execution
> 
> 
> On second thought, do you just want the script to run and sleep or
> actually schedule it as a job?  You could just use sleep().
> 
> set_time_out(0);
> 
> while ($i = 0){
>   your code
> 
>   sleep(60);
> }
> 
> We use this at my company for a file parsing program, it runs, sleeps 15
> minutes and repeats.
> 
> -Scott
> 
> 
> 
> On Thu, 25 Jul 2002, Paul O'Neil wrote:
> 
> > I have a php script I would like run like a cron job every so many
> minutes.
> > How is this done?
> >
> >
> >
> 
> 
> --
> 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 msql_fetch_array() FIXED ! Now cookie problems :(

2002-07-25 Thread Matthew Bielecki

Hello again,

I got the fetch_array problems fixed.  I was using the actual server name, 
when I switched back to localhost everything worked!!

Now I have a question about how to make cookies work on a Windows machine. 
 This is what I have these parameters set to but it's not working.  Do I 
have slashes/backslashes wrong, or is there something else I have to do in 
Apache??:

session.save_path = "C:/Program Files/Apache 
Group/Apache/web/php/dir/files/temp"

; Whether to use cookies.
session.use_cookies = 1


; Name of the session (used as cookie name).
session.name = PHPSESSID

; Initialize session on request startup.
session.auto_start = 0

; Lifetime in seconds of cookie or, if 0, until browser is restarted.
session.cookie_lifetime = 0

; The path for which the cookie is valid.
session.cookie_path = "c:/Program Files/Apache 
Group/Apache/web/php/dir/files/temp"

; The domain for which the cookie is valid.
session.cookie_domain = www.mydomain.com



As always, thanks for your help.








PHPCoder <[EMAIL PROTECTED]>
07/24/02 01:50 PM

 
To: Matthew Bielecki <[EMAIL PROTECTED]>
cc: php-general <[EMAIL PROTECTED]>
Subject:Re: [PHP] Help with msql_fetch_array()


I can almost guarantee that it's not the second line that is "failing", 
the problem here is that $result is not containing naything, and that is 
normally due to the fact that you are not connecting to the db, or the 
table "tablename" is not there.

I use the following format as my "standard" MySQL connect and query 
snippet:

$link = @mysql_connect("localhost",$username,$password) or die ('Could 
not connect!'); //@ suppresses the default error message generated by 
this function and the "or die()" bit kills the script right then and 
there should it not be able to connect.
mysql_select_db("YOUR_DB_NAME",$link);
$sql = "select * from your_table_name";
if ( $result = mysql_query($sql)) {  // checks to see if $result 
contains anything before it even tries to fetch an associative array 
from it.
 $row = mysql_fetch_assoc($result);
} else {
echo "Empty result set!";

Note also that I use mysql_fetch_assoc and NOT mysql_fecth_array, as 9 
out of 10 times, you don't need the array element id's that is returned 
by mysql_fetch_array.

Matthew Bielecki wrote:

>I have a couple of scripts that fail with the error of:
>Warning: mysql_fetch_array(): supplied argument is not a valid MySQL 
result 
>resource in...
>
>I'm new to both SQL and PHP and I'm wondering if I have some setting 
>turned off or what.
>
>Here's the piece of code that is failing (the second line fails):
>
>$result = mysql_db_query($dbname, "SELECT * FROM tablename ORDER BY id");
>$row = mysql_fetch_array($result);
>
>
>Thanks for your help in advance!!
>







Re: [PHP] Help with msql_fetch_array() FIXED ! Now cookie problems:(

2002-07-25 Thread Scott

On Thu, 25 Jul 2002, Matthew Bielecki wrote:
> session.save_path = "C:/Program Files/Apache 
> Group/Apache/web/php/dir/files/temp"

Considering using something like:  c:/temp, sure beats typing and 
remembering that path :)

How are you setting the cookie in the code?




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




[PHP] PHP Meetup, how many of you have signed up?

2002-07-25 Thread Jay Blanchard

Top 10 Locales --
Washington DC (9 members)
Amsterdam (7 members)
Leeds, UK (7 members)
London, England (7 members)
Atlanta (5 members)
Manhattan (below 42nd St) (5 members)
Melbourne (5 members)
Oakland-Alameda, CA (4 members)
Nashville, TN (4 members)
St. Louis, MO (4 members)

I am somewhat surprised that there are no more developers in Texas signed
up. In my area it would just be me and one other. I was hoping to get to see
enough to start a users group. There is only a total of 268 signed up
world-wide.

*
* Want to meet other PHP developers *
* in your area? Check out:  *
* http://php.meetup.com/*
* No developer is an island ... *
*



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




Re[2]: [PHP] Help with msql_fetch_array() FIXED ! Now cookie problems :(

2002-07-25 Thread Alexander Kuznetsov

Hello Matthew,

Thursday, July 25, 2002, 5:06:09 PM, you wrote:

MB> Hello again,

MB> I got the fetch_array problems fixed.  I was using the actual server name, 
MB> when I switched back to localhost everything worked!!

MB> Now I have a question about how to make cookies work on a Windows machine. 
MB>  This is what I have these parameters set to but it's not working.  Do I 
MB> have slashes/backslashes wrong, or is there something else I have to do in 
MB> Apache??:

MB> session.save_path = "C:/Program Files/Apache 
MB> Group/Apache/web/php/dir/files/temp"

MB> ; Whether to use cookies.
MB> session.use_cookies = 1


MB> ; Name of the session (used as cookie name).
MB> session.name = PHPSESSID

MB> ; Initialize session on request startup.
MB> session.auto_start = 0

MB> ; Lifetime in seconds of cookie or, if 0, until browser is restarted.
MB> session.cookie_lifetime = 0

MB> ; The path for which the cookie is valid.
MB> session.cookie_path = "c:/Program Files/Apache 
MB> Group/Apache/web/php/dir/files/temp"

MB> ; The domain for which the cookie is valid.
MB> session.cookie_domain = www.mydomain.com

try something like this

session.save_path = c:/Program Files/Apache Group/Apache/web/php/dir/files/temp

i mean without "..."
i had that problem - deleted "" and all is working now


-- 
Best regards,
Alexander Kuznetsov



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




[PHP] Sessions, how they exist and die

2002-07-25 Thread Matt Babineau

My question is, if I have a user on my web site, and they leave and come
back does their session still exist? the file in the /tmp folder exists
until it is deleted by the OS? If the user comes back will they get
assigned the same session they had before? I know the questions are
pretty newbish but I have had experiences in other languages in the past
where this is the case. The session cookie stayed in the users browser,
so they kept getting the same session and not a new session if they left
and came back a day later.
 
Matt Babineau
MCWD / CCFD
-
e:   [EMAIL PROTECTED]
p: 603.943.4237
w:   http://www.criticalcode.com
PO BOX 601
Manchester, NH 03105
 



Re: [PHP] preg_match() occurence position

2002-07-25 Thread Tech Support

How about this:

$text = "this is test";

preg_match can return the first match in an optional array I'll call
$matches
http://www.php.net/manual/en/function.preg-match.php

preg_match('/test/', $text, $matches);

strpos returns the numeric position of the first occurrence
http://www.php.net/manual/en/function.strpos.php

$pos = strpos($text, $matches[0]);

die("$pos"); // should be what you want... 10


Jim Grill
Support
Web-1 Hosting
http://www.web-1hosting.net
- Original Message -
From: "lallous" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, July 25, 2002 7:40 AM
Subject: [PHP] preg_match() occurence position


> Hello,
>
> Can I get the starting position of my string occurence when using any
> regexps searching functions in PHP ?
>
> for example:
> $mem='this is a test';
> preg_match('/test/', ...) should return me somehow: 10
>
>
> Thanks
>
>
>
> --
> 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 Meetup, how many of you have signed up?

2002-07-25 Thread Martin Clifford

I've signed up, and I suppose I would qualify for the Washington, DC area, though that 
is not strictly the locale I have setup :o)

As it's new, I'm sure many will be signing up in the coming weeks.  Personally, I can 
hardly wait to sit around and chat with other PHP developers.  Sign up now if you 
haven't all!

Martin Clifford
Homepage: http://www.completesource.net
Developer's Forums: http://www.completesource.net/forums/


>>> "Jay Blanchard" <[EMAIL PROTECTED]> 07/25/02 10:15AM >>>
Top 10 Locales --
Washington DC (9 members)
Amsterdam (7 members)
Leeds, UK (7 members)
London, England (7 members)
Atlanta (5 members)
Manhattan (below 42nd St) (5 members)
Melbourne (5 members)
Oakland-Alameda, CA (4 members)
Nashville, TN (4 members)
St. Louis, MO (4 members)

I am somewhat surprised that there are no more developers in Texas signed
up. In my area it would just be me and one other. I was hoping to get to see
enough to start a users group. There is only a total of 268 signed up
world-wide.

*
* Want to meet other PHP developers *
* in your area? Check out:  *
* http://php.meetup.com/*
* No developer is an island ... *
*



-- 
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] Speeding up PHP or MySQL

2002-07-25 Thread David Buerer

John,

You made one comment which is caught my attention:

> that's a no go :(  Or is there a way of storing common query results?

If the results to a commonly called query are the same for a time period,
than why don't you right a routine that just stores the results into a new
database that also has a results_expired field.  Then, everytime the results
are request, you can write a function which checks to see if the results are
still valid, if they are, it displays them, if not, it requeries...

i.e.

function getresults($common_query)
{
  $query="SELECT results,TIMESTAMP(expired) as dt_expired FROM storedqueries
WHERE query=$common_query";
  $results=mysql_fetch_object(mysql_query($query)) or error_handler();
  
  if($results->expired <=time())
  {
//rebuild long slow query and exectue it so that $results has the result
of the new query and $query is the query
   $update_query="INSERT INTO storedqueryies (query,results,expired) VALUES
($query,$results->results,[expired_time)
   mysql_query($update_query) or error_handler();
  }

  return $results->results;
  
}



-Original Message-
From: John Holmes [mailto:[EMAIL PROTECTED]] 
Sent: Wednesday, July 24, 2002 6:49 PM
To: 'Richard Baskett'; 'PHP General'
Subject: RE: [PHP] Speeding up PHP or MySQL


> Is there anyways to speed up MySQL queries?  Or showing the results 
> through PHP? I have several queries that have about 8 left joins or 
> so.. Yes
very
> huge and when you have lots of people using these functions at once it 
> really slows down.. Are there any practices that you can think of that 
> would speed up any sql queries?  I was thinking of using stored 
> procedures,
but
> after a bit of research I found ou= t that MySQL doesn=B9t have that
yet
> so
> that's a no go :(  Or is there a way of storing common query results?
I
> am
> looking for _anything_ that will speed up showing results to large 
> queries..

How about an index on your tables?

---John Holmes...


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




Re: Re[2]: [PHP] Help with msql_fetch_array() FIXED ! Now cookie problems:(

2002-07-25 Thread Matthew Bielecki

OH MY GOSH...I ACTUALLY GOT A REAL PROGRAM TO RUN!

Thanks a ton x 1,000,000 Alexander 

Thanks,

Matthew J. Bielecki, MCP, A+ Certified Technician
Hobart Corporation
Field Engineer - Weighing & Network Systems
Phone  (937) 332-7163Fax  (937) 332-3222
Email   [EMAIL PROTECTED]




Alexander Kuznetsov <[EMAIL PROTECTED]>
07/25/02 10:15 AM
Please respond to Alexander Kuznetsov

 
To: "Matthew Bielecki" <[EMAIL PROTECTED]>
cc: php-general <[EMAIL PROTECTED]>
Subject:Re[2]: [PHP] Help with msql_fetch_array() FIXED !  Now cookie 
problems :(


Hello Matthew,

Thursday, July 25, 2002, 5:06:09 PM, you wrote:

MB> Hello again,

MB> I got the fetch_array problems fixed.  I was using the actual server 
name, 
MB> when I switched back to localhost everything worked!!

MB> Now I have a question about how to make cookies work on a Windows 
machine. 
MB>  This is what I have these parameters set to but it's not working.  Do 
I 
MB> have slashes/backslashes wrong, or is there something else I have to 
do in 
MB> Apache??:

MB> session.save_path = "C:/Program Files/Apache 
MB> Group/Apache/web/php/dir/files/temp"

MB> ; Whether to use cookies.
MB> session.use_cookies = 1


MB> ; Name of the session (used as cookie name).
MB> session.name = PHPSESSID

MB> ; Initialize session on request startup.
MB> session.auto_start = 0

MB> ; Lifetime in seconds of cookie or, if 0, until browser is restarted.
MB> session.cookie_lifetime = 0

MB> ; The path for which the cookie is valid.
MB> session.cookie_path = "c:/Program Files/Apache 
MB> Group/Apache/web/php/dir/files/temp"

MB> ; The domain for which the cookie is valid.
MB> session.cookie_domain = www.mydomain.com

try something like this

session.save_path = c:/Program Files/Apache 
Group/Apache/web/php/dir/files/temp

i mean without "..."
i had that problem - deleted "" and all is working now


-- 
Best regards,
Alexander Kuznetsov







Re: [PHP] Sessions, how they exist and die

2002-07-25 Thread Tech Support

Hi Matt,

The user's browser will retain the session cookie as long as it is open
unless "session.cookie_lifetime" is set to something other than zero in the
php.ini or you can also set it in your script like this:

// set session cookie to expire in 30 minutes.
ini_set("session.cookie_lifetime","1800");

If they don't close their browser they can leave and come back to your site
and still have the same session. In I.E. you can even pop a new browser and
the child browser will have the same session cookie as the parent
feature or bug??? who knows.

As far as the files in /tmp are concerned... There are two variables that
control them in the php.ini

1) session.gc_maxlifetime
2) session.gc_probability

if session.gc_maxlifetime is set to 1800 then php will see any files left in
/tmp as garbage after 30 minutes. session.gc_probability is a percentual
probability that any "garbage" will be deleted. Since any files left in /tmp
will be useless to a browser that exceeded our 30 minutes they are not
harmful but will need to be culled eventually to keep it from growing
forever. If session.gc_probability was set 100 then every single time there
was session activity the "garbage" files would be deleted. This could get to
be too much extra overhead on a busy server so you could set it to something
like 1 so that only every 1 out of a hundred times there was session
activity the "garbage" files would be deleted.

NOTE: if session.gc_maxlifetime is set to something less than
session.cookie_lifetime and gc_probability is high (or you just get unlucky
and the number comes up) session data on the server could be deleted and the
user's browser would still have the old session cookie to a session that no
longer exists. This means that the user will not be able to get another
session and can make a mess of an ecommerce deal. I believe all three ini
variables can be set by user via ini_set and I would strongly recommend
taking advantage of that if you are on a shared server and cannot control
what's in php.ini.
http://www.php.net/manual/en/function.ini-set.php

Sorry for the book. But sessions can be difficult to grasp if your new and I
thought this was important.

Jim Grill
Support
Web-1 Hosting
http://www.web-1hosting.net
- Original Message -
From: "Matt Babineau" <[EMAIL PROTECTED]>
To: "'PHP'" <[EMAIL PROTECTED]>
Sent: Thursday, July 25, 2002 9:15 AM
Subject: [PHP] Sessions, how they exist and die


> My question is, if I have a user on my web site, and they leave and come
> back does their session still exist? the file in the /tmp folder exists
> until it is deleted by the OS? If the user comes back will they get
> assigned the same session they had before? I know the questions are
> pretty newbish but I have had experiences in other languages in the past
> where this is the case. The session cookie stayed in the users browser,
> so they kept getting the same session and not a new session if they left
> and came back a day later.
>
> Matt Babineau
> MCWD / CCFD
> -
> e:   [EMAIL PROTECTED]
> p: 603.943.4237
> w:   http://www.criticalcode.com
> PO BOX 601
> Manchester, NH 03105
>
>



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




[PHP] pdf to html

2002-07-25 Thread Tyler Longren

Hi,

I've been searching around for ways to convert pdf to html.  I haven't
had much luck.

I have a client that has a bunch of pdf's stored in a mysql table. 
They don't want their users to have to download the pdf file, they want
the pdf to be displayed in the web browser all the time.  Google has
something that allows them to convert pdf to html, so, is it possible
for me to do the same?

These pdf's are graphic intensive...there's not much plain text.

Thanks everyone,
Tyler

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




[PHP] RE: Applying XSL to XML with PHP

2002-07-25 Thread ctan

The XML would be something like this... 




  

  Argument from Position to Know
  
a is in a position to know whether A is true
a asserts that A is true
A is true
  
  Is a in a position to know whether A is true?
  Is a an honest (trustworthy, reliable) source?
  Did a actually assert that A is true?

  

 
  If any journalists learn about the invasion, then the newspapers
will print the news. And if the newspapers print the news, then the invasion
will not be a secret. If the invasion is not a secret, then our troops will
not have the advantage of surprise. If we do not have the advantage of
surprise, then the enemy will be prepared. And if the enemy is prepared,
then we are likely to suffer higher casualties. But no journalists learned
about the invasion. Therefore, we are not likely to suffer higher
casualties.
  
 


  we are likely to suffer higher
casualties


  

  we are not likely to suffer higher
casualties

  


  

  the enemy will be prepared


  

  our troops will not have the advantage
of surprise


  

  invasion is not a secret


  

  If any journalists learn about
the invasion


  

   no journalists learned
about the invasion

  

  
  

  the newspapers print the
news

  

  

  

  

  



Hope this helps...

chia

-Original Message-
From: Peter Clarke [mailto:[EMAIL PROTECTED]] 
Sent: 25 July 2002 13:06
To: Ctan
Cc: [EMAIL PROTECTED]
Subject: Re: Applying XSL to XML with PHP


Ctan wrote:
> I'm trying to apply XSL to XML stored in a MySQL database with PHP. 
> How do I go about doing this? I've tried following the example on 
> php.net but I seem to run into a lot of trouble. Here's how the code 
> looks like (BTW aml is XML stored in the argument Table):
> 
> 
> if (! empty($searchword ))
> 
>$query = "SELECT aml FROM arguments WHERE aml LIKE '%$searchword%'";
>$result = mysql_query($query) or die ("Query failed");
>$line = mysql_fetch_array($result, MYSQL_ASSOC);
> 
> // Create an array
> $arguments = array('/_xml'=> $line);
> 
> //XSL file
> $xsl = "./sheet1.xsl";
> 
> // Create an XSLT processor
> $xslthandler = xslt_create();
> 
> // Perform the transformation
> $html = xslt_process( $xslthandler, 'arg:/_xml', $xsl, NULL, 
> $arguments);
> 
> // Detect errors
> if (!$html) die ('XSLT processing error: '.xslt_error($xslthandler));
> 
> // Destroy the XSLT processor
> xslt_free($xslthandler);
> 
> // Output the resulting HTML
> print $html;  
> 
> 
> What I get on the screen is:
> 
> 
> Array ( [0] => "With the contents of my variable...")
> 
> 
> And:
> 
> 
> Warning: Sablotron error on line 1: XML parser error 2: syntax error 
> in /home/httpd/html/ctan/resultworkingcopy2.php on line 93 XSLT 
> processing
> error: XML parser error 2: syntax error
> 
> 
> What gives? I really need to solve this urgent. Thanks...
> 
> Chia

What is the xml. There may be a content encoding problem or some other 
xml issue.

Peter



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




[PHP] String Manipulation

2002-07-25 Thread Mike

Hello all,
I know that this has probably been discussed before and that you will
tell me to go through all the back messages on the list but I really
don't have time to do that because I am on a really tight schedule, but
I was wondering if anyone could give me some pointers on how to pull
some information out of a string. I have something like this:
(Something) - is wrong with me
or
something - (is wrong with me)
or 
something - (is wrong with me

what I need to know how to do is take the stuff that is inside the
Brackets (or partial brackets) and put them into another string
the way I am currently doing it is like this:
Variable names have been changed per my boss(My Boss wanted me to change
them for some reason)


I know that there has to be a shorter version of this, can anyone help
me out with it?

Thank You,
Mike
[EMAIL PROTECTED]
[EMAIL PROTECTED]


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




[PHP] pulling records from mysql

2002-07-25 Thread Tyler Durdin

I have a column in my table named firstname with twenty records in it. How 
can i use php to pull out individual records (say for ex. record 16)? Also, 
how could i pull out all records upto number 15? Thanks in advance.



_
Send and receive Hotmail on your mobile device: http://mobile.msn.com


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




Re: [PHP] Re: newbie form problem

2002-07-25 Thread Analysis & Solutions

On Sun, Jul 21, 2002 at 03:50:15PM -0500, Richard Lynch wrote:
> >if (!$MailFromAddress) {
>
> This should probably be:
> 
> if (!isset($MailFromAddress) || !$MailFromAddress)){

Or better:

  if ( empty($MailFromAddress) ) {

--Dan

-- 
   PHP classes that make web design easier
SQL Solution  |   Layout Solution   |  Form Solution
sqlsolution.info  | layoutsolution.info |  formsolution.info
 T H E   A N A L Y S I S   A N D   S O L U T I O N S   C O M P A N Y
 4015 7 Av #4AJ, Brooklyn NY v: 718-854-0335 f: 718-854-0409

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




RE: [PHP] pulling records from mysql

2002-07-25 Thread David Buerer

Create a column like.person_id with the auto_incr flag set.  Every
record will be given a unique id starting at 1 and incrementing by 1 each
time.  Then you can query based on person_id field to get an individual
record

-Original Message-
From: Tyler Durdin [mailto:[EMAIL PROTECTED]] 
Sent: Thursday, July 25, 2002 8:18 AM
To: [EMAIL PROTECTED]
Subject: [PHP] pulling records from mysql


I have a column in my table named firstname with twenty records in it. How 
can i use php to pull out individual records (say for ex. record 16)? Also, 
how could i pull out all records upto number 15? Thanks in advance.



_
Send and receive Hotmail on your mobile device: http://mobile.msn.com


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




[PHP] 'Previous' 1, 2, 3, 4, etc. 'Next'

2002-07-25 Thread ctan

I seem to have a problem getting the page to display beyond the limit if a
page, i.e. if the limit if 10 rows in a page I'll only get the 1st ten rows
and then a link to further rows but when I chick on them they give me
nothing. Here's the code:


$searchword = $_POST['searchword'];
print "Your word(s) is/are: $searchword\n\n";

// Searching by keyword
if (! empty($searchword )){ 
   $max = 0;
   $query = "SELECT aml FROM arguments WHERE aml LIKE '%$searchword%'";
   $result1 = mysql_query($query)
or die ("Query failed");

// Determine the number of items containing the $searchword   
 while ($line1 = mysql_fetch_array($result1)){
 $max++;
 }  


// The number of results to be displayed on screen
$maxresult = 10; 

$sql_text = "SELECT aml FROM arguments WHERE aml LIKE '%$searchword%'";

// When the current page is yet to be determined
if (!$page) { 
 $page = 1;
 } 

$backpage = $page - 1;
$nextpage = $page + 1;
$result2 = mysql_query($sql_text);
$start = ($maxresult * $page) - $maxresult; 
$num_rows = mysql_num_rows($result2); 

// When the query returns less or equal number of rows than the limit set by
$maxresult
if ($num_rows <= $maxresult) {
 $num_pages = 1; 
   } 

// When the query returns the exact limit set by $maxresult
else if (($num_rows % $maxresult) == 0) {
   $num_pages = ($num_rows / $maxresult);
   } 

// For any other cases...
else {
   $num_pages = ($num_rows / $maxresult) + 1;
   } 

// Declared as an integer
$num_pages = (int) $num_pages;

// The current page is greater than the total number of pages or 
// the current page is less than 0
if (($page > $num_pages) || ($page < 0)) {
 error("You have specified an invalid page number");
   }

// Set the limit per page   
$sql_text = $sql_text . " LIMIT $start, $maxresult";
$result2 = mysql_query($sql_text);

// The navigation between pages
// Ensure only display when total number of return results exceeds
$maxresult
// i.e. will not display if only 1 page
if ($max>$maxresult){
 print "- ";
   if ($backpage) { 
   print "Prev";
   } 

// If its the first page; have 'Prev' un-clickable
else {
   print "Prev";
   }

for ($i = 1; $i <= $num_pages; $i++) {
   if ($i != $page) { 

  print " $i ";
   } 
 else { 
  print " $i "; 
   } 
}

if ($page != $num_pages) {
   print "Next -";
   } 
else {
   print "Next -";
   }
   print "";
}

print "Results";
while ($line = mysql_fetch_array($result2, MYSQL_ASSOC)) {
print "\t\n";
// The different color, in this case light blue will
show that
//the particular table belong to search by
keywords
  foreach ($line as$col_value) {
print "\t\t$col_value\n";
  }
  print "\t\n";
}


}


I suspect the problem is because I set the limits to a page and thus
anything more is ignored. That particular area of code is highlighted in
red. Could anyone please tell me where I have gone wrong and how I can fix
this. Thank you loads in advance. Incidentally this will be use php script
to conduct search of a database, whereby the user inputs a 'searchword' to
look for in a HTML form and the php script which processes the form input. 

Chia



Re: [PHP] String Manipulation

2002-07-25 Thread Bas Jobsen

Maybe something like:
eregi('([a-z]*)( *)(\(*)([a-z]+)( *)(\)*)([a-z]*)',$string,$matches);
echo $matches[4];

Op donderdag 25 juli 2002 17:13, schreef Mike:
> Hello all,
> I know that this has probably been discussed before and that you will
> tell me to go through all the back messages on the list but I really
> don't have time to do that because I am on a really tight schedule, but
> I was wondering if anyone could give me some pointers on how to pull
> some information out of a string. I have something like this:
> (Something) - is wrong with me
> or
> something - (is wrong with me)
> or
> something - (is wrong with me
>
> what I need to know how to do is take the stuff that is inside the
> Brackets (or partial brackets) and put them into another string
> the way I am currently doing it is like this:
> Variable names have been changed per my boss(My Boss wanted me to change
> them for some reason)
>  $parenpos = strpos($tartist,")");
> $bracketpos = strpos($tartist,"]");
> if($parenpos){
>   $artist = trim(substr($tartist,0,$parenpos));
>   $title  = trim(substr($tartist,$parenpos+3));
>   $secondparenpos = strpos($title,"(");
>   $secondbracketpos = strpos($tartist,"[");
>   $title = trim(substr($title,0,$secondparenpos));
>   }elseif($bracketpos){
>   $artist = chop(substr($tartist,1,$bracketpos-1));
>   $title  = trim(substr($tartist,$bracketpos+3));
> }
> ?>
>
> I know that there has to be a shorter version of this, can anyone help
> me out with it?
>
> Thank You,
> Mike
> [EMAIL PROTECTED]
> [EMAIL PROTECTED]

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




Re: [PHP] pulling records from mysql

2002-07-25 Thread Martin Clifford

You would need to use SQL to identify which columns and rows you need to retrieve, 
then use various MySQL PHP functions to gather the information.

For your two queries, they would appear thus, respectively:

SELECT firstname FROM tablename WHERE id=16

and

SELECT firstname FROM tablename ORDER BY id ASC LIMIT 15

The functions you'll want to look into are mysql_connect(), mysql_select_db(), 
mysql_query() and mysql_fetch_array().  They can be found at http://www.php.net, do a 
search for any one of the functions ;o)

HTH

Martin

>>> "Tyler Durdin" <[EMAIL PROTECTED]> 07/25/02 11:18AM >>>
I have a column in my table named firstname with twenty records in it. How 
can i use php to pull out individual records (say for ex. record 16)? Also, 
how could i pull out all records upto number 15? Thanks in advance.



_
Send and receive Hotmail on your mobile device: http://mobile.msn.com 


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



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




Re: [PHP] String Manipulation

2002-07-25 Thread Tech Support

I tested this out with success.
$string = ereg_replace('(.*(\(|\[)|(\)|\]).*)', '', $string);

###
// Here is actual working code
$string1 = "(Something) - is wrong with me";
$string2 = "something - (is wrong with me)";
$string3 = "something - (is wrong with me";
$string4 = "[something] - is wrong with me";
$string5 = "something - [is wrong with me]";
$string6 = "something - [is wrong with me";
for ($i = 1; $i < 7; $i++)
{
 $data = "string" . $i;
 $data = ereg_replace('(.*(\(|\[)|(\)|\]).*)', '', ${$data}); // the magic
line. feed it the string(s).
 print "$i) $data";
}
###

Jim Grill
Support
Web-1 Hosting
http://www.web-1hosting.net
- Original Message -
From: "Mike" <[EMAIL PROTECTED]>
To: "PHP List" <[EMAIL PROTECTED]>
Sent: Thursday, July 25, 2002 10:13 AM
Subject: [PHP] String Manipulation


> Hello all,
> I know that this has probably been discussed before and that you will
> tell me to go through all the back messages on the list but I really
> don't have time to do that because I am on a really tight schedule, but
> I was wondering if anyone could give me some pointers on how to pull
> some information out of a string. I have something like this:
> (Something) - is wrong with me
> or
> something - (is wrong with me)
> or
> something - (is wrong with me
>
> what I need to know how to do is take the stuff that is inside the
> Brackets (or partial brackets) and put them into another string
> the way I am currently doing it is like this:
> Variable names have been changed per my boss(My Boss wanted me to change
> them for some reason)
>  $parenpos = strpos($tartist,")");
> $bracketpos = strpos($tartist,"]");
> if($parenpos){
> $artist = trim(substr($tartist,0,$parenpos));
> $title  = trim(substr($tartist,$parenpos+3));
> $secondparenpos = strpos($title,"(");
> $secondbracketpos = strpos($tartist,"[");
> $title = trim(substr($title,0,$secondparenpos));
> }elseif($bracketpos){
> $artist = chop(substr($tartist,1,$bracketpos-1));
> $title  = trim(substr($tartist,$bracketpos+3));
> }
> ?>
>
> I know that there has to be a shorter version of this, can anyone help
> me out with it?
>
> Thank You,
> Mike
> [EMAIL PROTECTED]
> [EMAIL PROTECTED]
>
>
> --
> 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] String Manipulation

2002-07-25 Thread Mike

Thanks, it worked like a charm ;)
Mike

-Original Message-
From: Tech Support [mailto:[EMAIL PROTECTED]] 
Sent: Thursday, July 25, 2002 11:39 AM
To: Mike; PHP List
Subject: Re: [PHP] String Manipulation

I tested this out with success.
$string = ereg_replace('(.*(\(|\[)|(\)|\]).*)', '', $string);

###
// Here is actual working code
$string1 = "(Something) - is wrong with me";
$string2 = "something - (is wrong with me)";
$string3 = "something - (is wrong with me";
$string4 = "[something] - is wrong with me";
$string5 = "something - [is wrong with me]";
$string6 = "something - [is wrong with me";
for ($i = 1; $i < 7; $i++)
{
 $data = "string" . $i;
 $data = ereg_replace('(.*(\(|\[)|(\)|\]).*)', '', ${$data}); // the
magic
line. feed it the string(s).
 print "$i) $data";
}
###

Jim Grill
Support
Web-1 Hosting
http://www.web-1hosting.net
- Original Message -
From: "Mike" <[EMAIL PROTECTED]>
To: "PHP List" <[EMAIL PROTECTED]>
Sent: Thursday, July 25, 2002 10:13 AM
Subject: [PHP] String Manipulation


> Hello all,
> I know that this has probably been discussed before and that you will
> tell me to go through all the back messages on the list but I really
> don't have time to do that because I am on a really tight schedule,
but
> I was wondering if anyone could give me some pointers on how to pull
> some information out of a string. I have something like this:
> (Something) - is wrong with me
> or
> something - (is wrong with me)
> or
> something - (is wrong with me
>
> what I need to know how to do is take the stuff that is inside the
> Brackets (or partial brackets) and put them into another string
> the way I am currently doing it is like this:
> Variable names have been changed per my boss(My Boss wanted me to
change
> them for some reason)
>  $parenpos = strpos($tartist,")");
> $bracketpos = strpos($tartist,"]");
> if($parenpos){
> $artist = trim(substr($tartist,0,$parenpos));
> $title  = trim(substr($tartist,$parenpos+3));
> $secondparenpos = strpos($title,"(");
> $secondbracketpos = strpos($tartist,"[");
> $title = trim(substr($title,0,$secondparenpos));
> }elseif($bracketpos){
> $artist = chop(substr($tartist,1,$bracketpos-1));
> $title  = trim(substr($tartist,$bracketpos+3));
> }
> ?>
>
> I know that there has to be a shorter version of this, can anyone help
> me out with it?
>
> Thank You,
> Mike
> [EMAIL PROTECTED]
> [EMAIL PROTECTED]
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
>



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



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




RE: [PHP] 'Previous' 1, 2, 3, 4, etc. 'Next'

2002-07-25 Thread Matt Schroebel

> -Original Message-
> From: ctan [mailto:[EMAIL PROTECTED]] 
> Sent: Thursday, July 25, 2002 11:24 AM
> To: [EMAIL PROTECTED]
> Subject: [PHP] 'Previous' 1, 2, 3, 4, etc. 'Next'
> 
> 
> I seem to have a problem getting the page to display beyond 
> the limit if a
> page, i.e. if the limit if 10 rows in a page I'll only get 
> the 1st ten rows
> and then a link to further rows but when I chick on them they give me
> nothing. Here's the code:
> 
> 
> $searchword = $_POST['searchword'];
> print "Your word(s) is/are: $searchword\n\n";
> 
> // Searching by keyword
> if (! empty($searchword )){ 
>$max = 0;
>$query = "SELECT aml FROM arguments WHERE aml LIKE 
> '%$searchword%'";
>$result1 = mysql_query($query)
>   or die ("Query failed");
> 
> // Determine the number of items containing the $searchword   
>while ($line1 = mysql_fetch_array($result1)){
>$max++;
>}  


This could just be:
$max = mysql_num_rows($result1); 
---
> 
> 
> // The number of results to be displayed on screen
> $maxresult = 10; 
> 
> $sql_text = "SELECT aml FROM arguments WHERE aml LIKE 
> '%$searchword%'";
> 
> // When the current page is yet to be determined
> if (!$page) { 
>$page = 1;
>} 

^^^
Do you have register_globals on or should you be setting  
$page = $_GET['page'] here?


> 
> $backpage = $page - 1;
> $nextpage = $page + 1;
> $result2 = mysql_query($sql_text);
> $start = ($maxresult * $page) - $maxresult; 
> $num_rows = mysql_num_rows($result2); 
> 
> // When the query returns less or equal number of rows than 
> the limit set by
> $maxresult
> if ($num_rows <= $maxresult) {
>$num_pages = 1; 
>} 
> 
> // When the query returns the exact limit set by $maxresult
> else if (($num_rows % $maxresult) == 0) {
>$num_pages = ($num_rows / $maxresult);

^
You could simplify this here with
$num_pages = ceil(($num_rows / $maxresult));
And get rid of the else below
--

>} 
> 
> // For any other cases...
> else {
>$num_pages = ($num_rows / $maxresult) + 1;
>} 
> 
> // Declared as an integer
> $num_pages = (int) $num_pages;
> 
> // The current page is greater than the total number of pages or 
> // the current page is less than 0
> if (($page > $num_pages) || ($page < 0)) {
>error("You have specified an invalid page number");
>}
> 
> // Set the limit per page   
> $sql_text = $sql_text . " LIMIT $start, $maxresult";
> $result2 = mysql_query($sql_text);
> 
> // The navigation between pages
> // Ensure only display when total number of return results exceeds
> $maxresult
> // i.e. will not display if only 1 page
> if ($max>$maxresult){
>print "- ";
>if ($backpage) { 
>print " href=\"$PHP_SELF?searchword=$searchword&page=$backpage\">Prev";
>} 
> 
> // If its the first page; have 'Prev' un-clickable
> else {
>print "Prev";
>}
> 
> for ($i = 1; $i <= $num_pages; $i++) {
>if ($i != $page) { 
>   
>   print "  href=\"$PHP_SELF?searchword=$searchword&page=$i\">$i ";
>} 
>else { 
>   print " $i "; 
>} 
> }
> 
> if ($page != $num_pages) {
>print " href=\"$PHP_SELF?searchword=$searchword&page=$nextpage\">Next -";
>} 
> else {
>print "Next -";
>}
>print "";
> }
> 
> print "Results";
> while ($line = mysql_fetch_array($result2, MYSQL_ASSOC)) {
>   print "\t\n";
>   // The different color, in this case 
> light blue will
> show that
>   //the particular table belong to search by
> keywords
> foreach ($line as$col_value) {
>   print 
> "\t\t$col_value\n";
>   }
>   print "\t\n";
> }
> 
> 
> }
> 

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




[PHP] Re: Applying XSL to XML with PHP

2002-07-25 Thread Peter Clarke


ctan wrote:
> The XML would be something like this... 
> 
> 



Just noticed something...
$line = mysql_fetch_array($result, MYSQL_ASSOC);
returns an array. Your $arguments array wants a string.
So..

$xml = join($line, '');
$arguments = array('/_xml'=> $xml);

Peter


> 
> Hope this helps...
> 
> chia
> 
> -Original Message-
> From: Peter Clarke [mailto:[EMAIL PROTECTED]] 
> Sent: 25 July 2002 13:06
> To: Ctan
> Cc: [EMAIL PROTECTED]
> Subject: Re: Applying XSL to XML with PHP
> 
> 
> Ctan wrote:
> 
>>I'm trying to apply XSL to XML stored in a MySQL database with PHP. 
>>How do I go about doing this? I've tried following the example on 
>>php.net but I seem to run into a lot of trouble. Here's how the code 
>>looks like (BTW aml is XML stored in the argument Table):
>>
>>
>>if (! empty($searchword ))
>>
>>   $query = "SELECT aml FROM arguments WHERE aml LIKE '%$searchword%'";
>>   $result = mysql_query($query) or die ("Query failed");
>>   $line = mysql_fetch_array($result, MYSQL_ASSOC);
>>
>>// Create an array
>>$arguments = array('/_xml'=> $line);
>>
>>//XSL file
>>$xsl = "./sheet1.xsl";
>>
>>// Create an XSLT processor
>>$xslthandler = xslt_create();
>>
>>// Perform the transformation
>>$html = xslt_process( $xslthandler, 'arg:/_xml', $xsl, NULL, 
>>$arguments);
>>
>>// Detect errors
>>if (!$html) die ('XSLT processing error: '.xslt_error($xslthandler));
>>
>>// Destroy the XSLT processor
>>xslt_free($xslthandler);
>>
>>// Output the resulting HTML
>>print $html;  
>>
>>
>>What I get on the screen is:
>>
>>
>>Array ( [0] => "With the contents of my variable...")
>>
>>
>>And:
>>
>>
>>Warning: Sablotron error on line 1: XML parser error 2: syntax error 
>>in /home/httpd/html/ctan/resultworkingcopy2.php on line 93 XSLT 
>>processing
>>error: XML parser error 2: syntax error
>>
>>
>>What gives? I really need to solve this urgent. Thanks...
>>
>>Chia
> 
> 
> What is the xml. There may be a content encoding problem or some other 
> xml issue.
> 
> Peter
> 
> 
> 
> 



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




[PHP] Paying Job...

2002-07-25 Thread Gerard Samuel

Basically, someone is looking to get a database driven site built,
and Ive never written code for money before.
Im looking for advice, as to how the experienced coders in here charge 
for their work.
Do you charge by the page, script or by the hour (that would be nice).

Thanks for any input you may provide...

-- 
Gerard Samuel
http://www.trini0.org:81/
http://dev.trini0.org:81/



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




RE: [PHP] String Manipulation

2002-07-25 Thread Mike

Ok, It works and everything, but I just was wondering:
$data = ereg_replace('(.*(\(|\[)|(\)|\]).*)', '', ${$data});
--^  ^
what does this do exactly, I see that you are replacing all the
characters [] and () but what is the ${$data} for?
Also for future reference is there a way that you could return the
string with all the parentheses stripped out?
Thank You again,
Mike
[EMAIL PROTECTED]


And what would be
-Original Message-
From: Tech Support [mailto:[EMAIL PROTECTED]] 
Sent: Thursday, July 25, 2002 11:39 AM
To: Mike; PHP List
Subject: Re: [PHP] String Manipulation

I tested this out with success.
$string = ereg_replace('(.*(\(|\[)|(\)|\]).*)', '', $string);

###
// Here is actual working code
$string1 = "(Something) - is wrong with me";
$string2 = "something - (is wrong with me)";
$string3 = "something - (is wrong with me";
$string4 = "[something] - is wrong with me";
$string5 = "something - [is wrong with me]";
$string6 = "something - [is wrong with me";
for ($i = 1; $i < 7; $i++)
{
 $data = "string" . $i;
 $data = ereg_replace('(.*(\(|\[)|(\)|\]).*)', '', ${$data}); // the
magic
line. feed it the string(s).
 print "$i) $data";
}
###

Jim Grill
Support
Web-1 Hosting
http://www.web-1hosting.net
- Original Message -
From: "Mike" <[EMAIL PROTECTED]>
To: "PHP List" <[EMAIL PROTECTED]>
Sent: Thursday, July 25, 2002 10:13 AM
Subject: [PHP] String Manipulation


> Hello all,
> I know that this has probably been discussed before and that you will
> tell me to go through all the back messages on the list but I really
> don't have time to do that because I am on a really tight schedule,
but
> I was wondering if anyone could give me some pointers on how to pull
> some information out of a string. I have something like this:
> (Something) - is wrong with me
> or
> something - (is wrong with me)
> or
> something - (is wrong with me
>
> what I need to know how to do is take the stuff that is inside the
> Brackets (or partial brackets) and put them into another string
> the way I am currently doing it is like this:
> Variable names have been changed per my boss(My Boss wanted me to
change
> them for some reason)
>  $parenpos = strpos($tartist,")");
> $bracketpos = strpos($tartist,"]");
> if($parenpos){
> $artist = trim(substr($tartist,0,$parenpos));
> $title  = trim(substr($tartist,$parenpos+3));
> $secondparenpos = strpos($title,"(");
> $secondbracketpos = strpos($tartist,"[");
> $title = trim(substr($title,0,$secondparenpos));
> }elseif($bracketpos){
> $artist = chop(substr($tartist,1,$bracketpos-1));
> $title  = trim(substr($tartist,$bracketpos+3));
> }
> ?>
>
> I know that there has to be a shorter version of this, can anyone help
> me out with it?
>
> Thank You,
> Mike
> [EMAIL PROTECTED]
> [EMAIL PROTECTED]
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
>



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



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




Re: [PHP] Paying Job...

2002-07-25 Thread Tyler Longren

Charge by which ever will get you the most money.

tyler

On Thu, 25 Jul 2002 11:46:38 -0400
Gerard Samuel <[EMAIL PROTECTED]> wrote:

> Basically, someone is looking to get a database driven site built,
> and Ive never written code for money before.
> Im looking for advice, as to how the experienced coders in here charge
> 
> for their work.
> Do you charge by the page, script or by the hour (that would be nice).
> 
> Thanks for any input you may provide...
> 
> -- 
> Gerard Samuel
> http://www.trini0.org:81/
> http://dev.trini0.org:81/
> 
> 
> 
> -- 
> 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] Paying Job...

2002-07-25 Thread Martin Clifford

<>

Why didn't you just say, "Charge by whichever will screw the client the worst."?  
Jesus.

Martin

>>> Tyler Longren <[EMAIL PROTECTED]> 07/25/02 11:44AM >>>
Charge by which ever will get you the most money.

tyler

On Thu, 25 Jul 2002 11:46:38 -0400
Gerard Samuel <[EMAIL PROTECTED]> wrote:

> Basically, someone is looking to get a database driven site built,
> and Ive never written code for money before.
> Im looking for advice, as to how the experienced coders in here charge
> 
> for their work.
> Do you charge by the page, script or by the hour (that would be nice).
> 
> Thanks for any input you may provide...
> 
> -- 
> Gerard Samuel
> http://www.trini0.org:81/ 
> http://dev.trini0.org:81/ 
> 
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php 
> 

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



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




[PHP] Re: arrays, variables, and register_globals--solved--thank you

2002-07-25 Thread Matthew K. Gold

Thank you very much, David--you understood the problem exactly and your
solution worked perfectly!

I'd like to add a comment about mysql_data_seek to the php manual entry on
mysql_fetch_row, because I would think that this might be a common
problem...

Matt

- Original Message -
From: David Robley <[EMAIL PROTECTED]>
To: GOLD, MATTHEW <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Thursday, July 25, 2002 5:37 AM
Subject: RE: [PHP-DB] Re: arrays, variables, and register_globals



> So what you want to do is print a field from the first row extracted from
the table, then
> loop through all the rows and print several fields? I think you want
mysql_data_seek.
>
> Whenever you do a mysql_fetch_row, php grabs the current row from the
result set, and
> shifts a pointer to the next record in the result set. In this case it
seems you need to
> print from the first record, then reset the pointer to the first record
and print from all
> records found. So:
>
> $row = mysql_fetch_row ($result))
> print ("$row[4]");
>
> mysql_data_seek($result, 0);  // Add this
>
> while ($row = mysql_fetch_row ($result))
>
> Unless I misunderstand what you are trying to do
>
> Cheers
> --
> David Robley
> Temporary Kiwi!
> Quod subigo farinam
>
> "I've been to a film festival in the South of France," said Tom cannily.
>


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




Re: [PHP] Paying Job...

2002-07-25 Thread Brent Baisley

I have never charge by the page simply because I don't want to be 
limited in my design. Also, I don't want them saying I've added unneeded 
pages to up the price.
I don't know how you would charge by the script since you should be 
using object oriented code. Wouldn't this be similar to charging by the 
page?
So that leaves hourly or by the project (not mentioned). Personally, I 
like to do it by the project, although I am probably a minority in my 
preference. By the project gives the client a nice set price. However, 
the scope has to be extremely well defined. It should be anyway, but 
more so if charging by the project. I then charge by the hour for 
requests outside the original scope, which happens all the time. It also 
keeps them in check on their requests. Depending on the client, I 
require a third or half up front for a project.

On Thursday, July 25, 2002, at 11:46 AM, Gerard Samuel wrote:

> Basically, someone is looking to get a database driven site built,
> and Ive never written code for money before.
> Im looking for advice, as to how the experienced coders in here charge 
> for their work.
> Do you charge by the page, script or by the hour (that would be nice).
>
> Thanks for any input you may provide...
>
> -- Gerard Samuel
> http://www.trini0.org:81/
> http://dev.trini0.org:81/
>
> -- PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
--
Brent Baisley
Systems Architect
Landover Associates, Inc.
Search & Advisory Services for Advanced Technology Environments
p: 212.759.6400/800.759.0577


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




Re: [PHP] Paying Job...

2002-07-25 Thread Tyler Longren

Why even bother charging money if you aren't out to make as much as you
can?  That's just my point of view.

tyler

On Thu, 25 Jul 2002 11:59:28 -0400
"Martin Clifford" <[EMAIL PROTECTED]> wrote:

> <>
> 
> Why didn't you just say, "Charge by whichever will screw the client
> the worst."?  Jesus.
> 
> Martin
> 
> >>> Tyler Longren <[EMAIL PROTECTED]> 07/25/02 11:44AM >>>
> Charge by which ever will get you the most money.
> 
> tyler
> 
> On Thu, 25 Jul 2002 11:46:38 -0400
> Gerard Samuel <[EMAIL PROTECTED]> wrote:
> 
> > Basically, someone is looking to get a database driven site built,
> > and Ive never written code for money before.
> > Im looking for advice, as to how the experienced coders in here
> > charge
> > 
> > for their work.
> > Do you charge by the page, script or by the hour (that would be
> > nice).
> > 
> > Thanks for any input you may provide...
> > 
> > -- 
> > Gerard Samuel
> > http://www.trini0.org:81/ 
> > http://dev.trini0.org:81/ 
> > 
> > 
> > 
> > -- 
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php 
> > 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php 
> 
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 

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




Re: [PHP] pulling records from mysql

2002-07-25 Thread Tech Support

This query will return only the 16th row

SELECT firstname FROM table_name LIMIT 16, 1

This query will give you all rows up to 15

SELECT firstname FROM table_name LIMIT 1, 15


Jim Grill
Support
Web-1 Hosting
http://www.web-1hosting.net
- Original Message -
From: "Tyler Durdin" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, July 25, 2002 10:18 AM
Subject: [PHP] pulling records from mysql


> I have a column in my table named firstname with twenty records in it. How
> can i use php to pull out individual records (say for ex. record 16)?
Also,
> how could i pull out all records upto number 15? Thanks in advance.
>
>
>
> _
> Send and receive Hotmail on your mobile device: http://mobile.msn.com
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
>



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




Re: [PHP] Paying Job...

2002-07-25 Thread Peter J. Schoenster

On 25 Jul 2002 at 11:46, Gerard Samuel wrote:

> Basically, someone is looking to get a database driven site built,
> and Ive never written code for money before.
> Im looking for advice, as to how the experienced coders in here charge
> for their work. Do you charge by the page, script or by the hour (that
> would be nice).

Not talking about what to charge  but how to charge. Good question.

I've travelled quite a bit and in a lot of countries a price is "how much do you want 
to pay". Seriously, when you ask the price the answer is usually that, 
sometimes excactly that or other times what the seller considers you might pay based 
on his quick evalution of you.

Now, are software companies much different than that? I don't think so. Try to get a 
price on some software "products".  Not as easy as it seems. 

What are you really selling? You are not selling "packaged" software. You are selling 
a service. Most, not all, services get priced by time. I worked at an 
ad agency and I had to account for 7.75 hours per day. I would attach my time to jobs 
and the account execs would bill the clients periodically (and 
sometimes they reduced the time I spent). Often there was the thought to bill for 
value provided rather than time which is tricky if not also walking an 
ethical borderline, imho.

I love the people who bill by the project. They will spend all of 10 minutes to "know" 
a project and bid. I guess most of them hope to whine later to get 
more money.  I would bet that this method has the most success. But then you would 
make more money selling drugs than providing software solutions 
so success is probably not measured by money or acceptance.

Personally, if it's a small thing like fixing something broken in software I 
understand or just doing something that's pretty generic I will provide an estimate 
of time, as in from 4 - 8 hours. The client must trust me and be willing to pay the 
high figure if need be. I will usually not bill more than the high figure if 
I've underestimated.

If it's a project (more than 15 hours) then I prefer to try and get a blueprint going 
so I can determine what it is I'm going to build before I agree to build it at 
a price. This worked for me three times, for FedEx and for an Architectural Firm and a 
"monster" type job company. Usually this method fails because 
your client will balk at paying for what is "so obvious" :) and when other developers 
will also agree that it's "so obvious". 

So, imho, it is a question of "who you are" to determine how to charge. Best bet, 
imho, is to try to understand the project as much as possible and give 
them a decent range. Be prepared to spend a lot more time on it than you budget. Try 
to get the job especially since it sounds like it's your first. If they 
want a fixed price for something which isn't even fixed yet, heck, give it, plenty of 
others will. Experience helps, understanding the nature of the client 
helps ... I'd suggest do whatever you have to do to get the job, you want the 
experience more than the money (possibly).

Peter

http://www.coremodules.com/
Web Application Software and Support  at Affordable Prices

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




RE: [PHP] Paying Job...

2002-07-25 Thread Paul Maine

In today's depressed IT market, what are the prevailing hourly rates for a
very experienced PHP/MySQL developer? I desire to use this information as a
guage of what I am currently charging.


Paul

-Original Message-
From: Peter J. Schoenster [mailto:[EMAIL PROTECTED]]
Sent: Thursday, July 25, 2002 11:36 AM
To: [EMAIL PROTECTED]
Subject: Re: [PHP] Paying Job...


On 25 Jul 2002 at 11:46, Gerard Samuel wrote:

> Basically, someone is looking to get a database driven site built,
> and Ive never written code for money before.
> Im looking for advice, as to how the experienced coders in here charge
> for their work. Do you charge by the page, script or by the hour (that
> would be nice).

Not talking about what to charge  but how to charge. Good question.

I've travelled quite a bit and in a lot of countries a price is "how much do
you want to pay". Seriously, when you ask the price the answer is usually
that,
sometimes excactly that or other times what the seller considers you might
pay based on his quick evalution of you.

Now, are software companies much different than that? I don't think so. Try
to get a price on some software "products".  Not as easy as it seems.

What are you really selling? You are not selling "packaged" software. You
are selling a service. Most, not all, services get priced by time. I worked
at an
ad agency and I had to account for 7.75 hours per day. I would attach my
time to jobs and the account execs would bill the clients periodically (and
sometimes they reduced the time I spent). Often there was the thought to
bill for value provided rather than time which is tricky if not also walking
an
ethical borderline, imho.

I love the people who bill by the project. They will spend all of 10 minutes
to "know" a project and bid. I guess most of them hope to whine later to get
more money.  I would bet that this method has the most success. But then you
would make more money selling drugs than providing software solutions
so success is probably not measured by money or acceptance.

Personally, if it's a small thing like fixing something broken in software I
understand or just doing something that's pretty generic I will provide an
estimate
of time, as in from 4 - 8 hours. The client must trust me and be willing to
pay the high figure if need be. I will usually not bill more than the high
figure if
I've underestimated.

If it's a project (more than 15 hours) then I prefer to try and get a
blueprint going so I can determine what it is I'm going to build before I
agree to build it at
a price. This worked for me three times, for FedEx and for an Architectural
Firm and a "monster" type job company. Usually this method fails because
your client will balk at paying for what is "so obvious" :) and when other
developers will also agree that it's "so obvious".

So, imho, it is a question of "who you are" to determine how to charge. Best
bet, imho, is to try to understand the project as much as possible and give
them a decent range. Be prepared to spend a lot more time on it than you
budget. Try to get the job especially since it sounds like it's your first.
If they
want a fixed price for something which isn't even fixed yet, heck, give it,
plenty of others will. Experience helps, understanding the nature of the
client
helps ... I'd suggest do whatever you have to do to get the job, you want
the experience more than the money (possibly).

Peter

http://www.coremodules.com/
Web Application Software and Support  at Affordable Prices

--
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] Paying Job...

2002-07-25 Thread Dave [Hawk-Systems]

>I have never charge by the page simply because I don't want to be
>limited in my design. Also, I don't want them saying I've added unneeded
>pages to up the price.

or have customers nitpicking about removing pages to cut costs...

>I don't know how you would charge by the script since you should be
>using object oriented code. Wouldn't this be similar to charging by the
>page?

how much code is original these days either...  we have a collection of snippets
for just about every instance...  perhaps only charging the a quarter of the
value of the development for an app, but rehashing the code for several other
lcients cutting down on development time.

>So that leaves hourly or by the project (not mentioned). Personally, I
>like to do it by the project, although I am probably a minority in my
>preference. By the project gives the client a nice set price. However,
>the scope has to be extremely well defined. It should be anyway, but

thats the trick...  otherwise the simple aplpication will in teh customer eyes
include this, that, and the other thing, despite the 30-50 hours that adds to
the developemnt.  You can't overstate the boundries of deliverables in a
contract.

>more so if charging by the project. I then charge by the hour for
>requests outside the original scope, which happens all the time. It also
>keeps them in check on their requests. Depending on the client, I
>require a third or half up front for a project.

good form.

Always build in some slush factor as well...  clients ask for minor this and
minor that...  if you have built in some slush, you can give them those without
additional cost.  the more they beat you up on the contract price, the more
"slush" you remove, and make them aware that "its all fine, but every little
extra will have to be charged now" since theve removed your flexibility.

Look at it like you aren't doing the development, you are outsourcing it... what
is going to ensure that at the end of the project you have enough to pay your
developer plus posket a few bucks.  Take those steps, and make sure everyone is
clear about everything.

Dave


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




RE: [PHP] Paying Job...

2002-07-25 Thread Matt Babineau

When first speaking with a client, would you charge an initial
constation fee for lets say conference calls? How would you invoice
stuff like this? on a monthly basis? Or every two weeks?

Matt Babineau
MCWD / CCFD
-
e: [EMAIL PROTECTED]
p: 603.943.4237
w: http://www.criticalcode.com
PO BOX 601
Manchester, NH 03105


-Original Message-
From: Peter J. Schoenster [mailto:[EMAIL PROTECTED]] 
Sent: Thursday, July 25, 2002 12:36 PM
To: [EMAIL PROTECTED]
Subject: Re: [PHP] Paying Job...


On 25 Jul 2002 at 11:46, Gerard Samuel wrote:

> Basically, someone is looking to get a database driven site built, and

> Ive never written code for money before. Im looking for advice, as to 
> how the experienced coders in here charge for their work. Do you 
> charge by the page, script or by the hour (that would be nice).

Not talking about what to charge  but how to charge. Good question.

I've travelled quite a bit and in a lot of countries a price is "how
much do you want to pay". Seriously, when you ask the price the answer
is usually that, 
sometimes excactly that or other times what the seller considers you
might pay based on his quick evalution of you.

Now, are software companies much different than that? I don't think so.
Try to get a price on some software "products".  Not as easy as it
seems. 

What are you really selling? You are not selling "packaged" software.
You are selling a service. Most, not all, services get priced by time. I
worked at an 
ad agency and I had to account for 7.75 hours per day. I would attach my
time to jobs and the account execs would bill the clients periodically
(and 
sometimes they reduced the time I spent). Often there was the thought to
bill for value provided rather than time which is tricky if not also
walking an 
ethical borderline, imho.

I love the people who bill by the project. They will spend all of 10
minutes to "know" a project and bid. I guess most of them hope to whine
later to get 
more money.  I would bet that this method has the most success. But then
you would make more money selling drugs than providing software
solutions 
so success is probably not measured by money or acceptance.

Personally, if it's a small thing like fixing something broken in
software I understand or just doing something that's pretty generic I
will provide an estimate 
of time, as in from 4 - 8 hours. The client must trust me and be willing
to pay the high figure if need be. I will usually not bill more than the
high figure if 
I've underestimated.

If it's a project (more than 15 hours) then I prefer to try and get a
blueprint going so I can determine what it is I'm going to build before
I agree to build it at 
a price. This worked for me three times, for FedEx and for an
Architectural Firm and a "monster" type job company. Usually this method
fails because 
your client will balk at paying for what is "so obvious" :) and when
other developers will also agree that it's "so obvious". 

So, imho, it is a question of "who you are" to determine how to charge.
Best bet, imho, is to try to understand the project as much as possible
and give 
them a decent range. Be prepared to spend a lot more time on it than you
budget. Try to get the job especially since it sounds like it's your
first. If they 
want a fixed price for something which isn't even fixed yet, heck, give
it, plenty of others will. Experience helps, understanding the nature of
the client 
helps ... I'd suggest do whatever you have to do to get the job, you
want the experience more than the money (possibly).

Peter

http://www.coremodules.com/
Web Application Software and Support  at Affordable Prices

-- 
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] Paying Job...

2002-07-25 Thread Jay Blanchard

C'mon guys, he asked a legitimate question that most freelancers ask when
they start. Here is the starting question;

How much is your time worth to you? $50 an hour, $200.00 a day, $6000 a
month?

Here is one method;

a. Estimate how many hours you think that the job will take once you have
received ALL RELEVANT INFORMATION so that you can make a true assessment.
b. Multiply those hours against your self assessed hourly worth, currently
around the lower end of the scale due to your lack of experience.
c. Take that total and multiply by 1.3
d. HAVE A CONTRACT There are many good examples on the web.

HTH!

Jay

"Perhaps you’re diagonally parked in a parallel universe"

*
* Want to meet other PHP developers *
* in your area? Check out:  *
* http://php.meetup.com/*
* No developer is an island ... *
*



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




  1   2   3   >