[PHP] Re: corrupt images

2003-05-30 Thread Al
Check that you are using the correct MIME type.

There is a note on this in the User Contributed Notes under the function definition.  



Jason Jacobs wrote:

Hi all.  I've been struggling with getting images to upload cleanly.  I'm using php 4.2.2.  When I look at the uploaded file info, it gives me no errors and the file size is fine.  But the picture is all messed up.  I'm using the move_uploaded_file function.  The max size is 8mb in php.ini, and I set the MAX_FILE_SIZE in the form to 100k.  None of the images I'm testing have been over 30k.

I've seen that some people have had this problem, but a solution hasn't been consistent.  Some said to use copy() and some said it's a bug in PHP.  If anyone knows what's going on I'd appreciate some advice.  Thanks!

-jason
 



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


Re: [PHP] strip_tags() Quandry....

2003-05-30 Thread CF High
Hey Justin.

Sorry for the late reply -- got totally wrapped up in utilizing that highly
useful bit of reg exp code.

Thanks for the heads up; it certainly solved the problem.

Unfortunately, or fortunately, new problems have arisen -- time to dive into
learning some reg exp syntax

Thanks again,

--Noah



Justin French [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 on 28/05/03 2:56 PM, CF High ([EMAIL PROTECTED]) wrote:


  I've got a chunk of HTML text I'd like to format for insertion into our
  mySql db.
 
  Let's say $html_string equals the following:
 
  tr
  td1/td
  tdBardo, Jesse/td
  tdS/td
  tdA/td
  tdAndover, MA/td
  /tr
 
  To setup this chunk of text for insertion I first use
  strip_tags($html_string); that results in:
 
  1
  Bardo, Jesse
  S
  A
  Andover, MA
 
  I then use str_replace(,,,$html_string) to create a space delimited
  string.

 exactly... for starters, there might be tabs (\t), newlines (\n, \r,
\n\r),
 plus multiple spaces (  ).

 this is DEFINITELY a quick hack, adapted from code on
 au.php.net/preg-replace... someone with more regular expression knowledge
 can probably get this down to 1 or 2 lines, with a perfomance gain as well
 :)

 ?

 $html = tr
 td1/td
 tdBardo, Jesse/td
 tdS/td
 tdA/td
 tdAndover, MA/td
 /tr;

 $html = preg_replace ('[\/\!]*?[^]*?'si, ' ', $html);
 $html = preg_replace ('([\r\n])[\s]+', ' ', $html);
 $html = preg_replace (([\s]+), ' ', $html);
 $html = trim($html);

 echo pre; print_r($html); echo /pre;

 ?

 You'll need to test it thoroughly, and make sure it's ok on larger blocks
of
 text, like whatever your target source is, to make sure it doesn't bog
 anything down.



 Justin




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



Re: [PHP] Netbilling PHP Script

2003-05-30 Thread Mike Morton
I have to get this off my chest, and I tried to send it directly to Jason
off list, but the email bounces back.  Why?  Probably because he gets a lot
of these emails.  Don't like what I have to say?  Tough luck, I am sick of
unconstructive emails hitting the list putting people down.  If you cannot
or will not answer someone, just don't answer them at all.  Be helpful, not
hurtful.  Oops, should take my own advice and not post this at all, but I
need to get it off my chest, I am sure that I am not the only one thinking
it:

Jason:

Why do you bother to answer on the php list at all?  90% of the messages
from you are 'search google'  if you do not have constructive info to offer,
why bother to answer at all.  I am directing this to you because the list
does not need to see my crap about it, but it just makes me sick to see you
over and over putting people down who are just asking for help.

Really, I have been a member of MANY lists over the years, and I truly have
never seen anyone as negative as you.  If you do not have a useful answer to
the question just don't answer- you clutter the list and my inbox.

And no, 'search google' is not a good answer - at the best of times it is
tough to wade through all the crap that google spits at you, at the worst of
times, most people do not even know what to search for to narrow it down!
Never mind searching the list archive - half the time all I get back is your
emails saying 'search google'!

Geeze, look what you have made me do, get pissed of and waste my time
flaming you. What a waste of our time.


On 5/29/03 5:43 AM, Jason Wong [EMAIL PROTECTED] wrote:

 On Thursday 29 May 2003 17:36, Ralph wrote:
 I have to setup credit card verification/processing with Netbilling.com,
 does anybody know of a PHP based Netbilling gateway script or class?
 
 Have you searched google?

--
Cheers

Mike Morton


*
* Tel: 905-465-1263
* Email: [EMAIL PROTECTED]
*


Indeed, it would not be an exaggeration to describe the history of the
computer industry for the past decade as a massive effort to keep up with
Apple.
- Byte Magazine

Given infinite time, 100 monkeys could type out the complete works of
Shakespeare. Win 98 source code? Eight monkeys, five minutes.
-- NullGrey 


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



[PHP] making sense of time(), date() and strtotime()

2003-05-30 Thread Justin French
I have $_POST['day'] (1-31), $_POST['month'] (1-12), $_POST['year']
(2003-2004).

I store all dates as unix (epoch) timestamps, and generate the timestamp for
the event with:

strtotime('{$_POST['month']}/{$_POST['day']}/{$_POST['day']}');

Everything works fine on my LAN (Australia), but when I upload my database
to the live server (US), the dates are a day behind (when echo'd with
date('Y-m-d')), presumably due to the time difference between the two
servers.

Timestamps generated directly on the live server appear correct when echoed
out using date.


How can I reliably generate timestamps which will work on any server, and
reliably convert these timestamps to human readable format (eg
date('Y-m-d')) on any server?


Is the key to use GMT in the strtotime() string and use gmdate() instead of
date()?  Or is it more complex than that?


Thanks,

Justin French


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



[PHP] session_regenerate_id()

2003-05-30 Thread Dan Joseph
Hi,

I know this function is new, however, does anyone have any documentation on
it?  There is nothing on php.net...

-Dan Joseph


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



[PHP] A good function

2003-05-30 Thread Daniel J. Rychlik
What is a good function for striping white space and removing \\..\..  and possible 
,  Anything that would be considered unwanted user input???  

I looked at trim() but its doesnt do all the things I need it to do.  

-Dan

Re: [PHP] Decrypting data with GnuPG

2003-05-30 Thread Pierre-Luc Soucy
From the GnuPG docs:

--passphrase-fd n

Read the passphrase from file descriptor n. If you use 0 for n, the 
passphrase will be read from stdin. This can only be used if only one 
passphrase is supplied. Don't use this option if you can avoid it.

I added --passphrase-fd 0 to my command so the passphrase should 
normally be read from stdin (according to the docs), but it still does 
not work. Any idea? I am unfortunately not familiar with C code, so I 
can difficultly find solutions to my problems by reading the GnuPG source.

Thanks!

Pierre-Luc

Evan Nemerson wrote:
GnuPG doesn't use stdin to read the password, which is where you're
sending it. It uses a more low-level interface (check out the below link
if you're interested) where they interact directly with the virtual
console.
Try piping to your command- that won't work either

echo $PASSPHRASE | \
/usr/bin/gpg \
--homedir=/path/to/.gnupg \
--no-secmem-warning \
--always-trust \
--yes \
--output /path/to/output.txt \
--decrypt /path/to/testtext.asc
GnuPG source code for TTY I/O:
http://cvs.gnupg.org/cgi-bin/viewcvs.cgi/*checkout*/gnupg/util/ttyio.c?rev=1.28content-type=text/plain


On Wed, 2003-05-28 at 16:14, Pierre-Luc Soucy wrote:

Hi,

I would like to decrypt data encoded with GnuPG without including the 
private key passphrase in the command to prevent people from viewing it 
with ps.

Here is the code I wrote:


$command = /usr/bin/gpg --homedir=/path/to/.gnupg --no-secmem-warning 
--always-trust --yes --output /path/to/output.txt --decrypt 
/path/to/testtext.asc;
$passphrase = '***';

$fp = popen($command, 'w+');
fputs($fp, $passphrase);
pclose($fp);
print Done;
exit;
==
I assumed that the fputs() function would write the passphrase at the 
prompt, but that doesn't seem to be the case - the command does not 
create the output.txt file when ran by the PHP program (which is running 
as a CGI under my user BTW) while it works when ran from the shell.

Any idea why?

Thanks!

Pierre-Luc Soucy





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


RE: [PHP] A good function

2003-05-30 Thread Dan Joseph
Hi,

Have a look at: http://us2.php.net/manual/en/function.ereg-replace.php

That might do what you want.

-Dan Joseph

 What is a good function for striping white space and removing 
 \\..\..  and possible ,  Anything that would be considered 
 unwanted user input???  
 
 I looked at trim() but its doesnt do all the things I need it to do.  


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



Re: [PHP] PHP and Flash

2003-05-30 Thread Sancar Saran
On Thursday 29 May 2003 14:31, César Aracena wrote:
 Hi all,

 I just made a pretty little flash banner with buttons and everything...
 Does anyone knows if I can make the flash buttons links with dynamic
 content? I need to fetch cartain common pages but with different
 variables.

 Thanks in advanced,


Hi,
I try to do same think a while ago, You have to pass variable into flash code. 
I think Flash 6.0  able to do this. Also I found that code. Which is work 
with flash 4.0.

html
head
titlemoock web flash importing a cookie using a query string/title
/HEAD

BODY BGCOLOR=#00


DIV ALIGN=CENTER
SCRIPT LANGUAGE=JavaScript1.2

!--

// name: flash cookie importer, query string version
// version: 1.0.1
// author: colin moock
// description: passes the value of the first variable in
//  a browser's cookie to a flash movie.

// last updated: june 2, 2000



window.document.cookie = msg = Burak

// if the cookie isn't empty
if (window.document.cookie != ) {
// get the value of the cookie.
var theCookie = document.cookie;

// extract the value of our cookie variable from the cookie.
// ! note that this example only handles a single-variable cookie.
theCookie = 
theCookie.substring((theCookie.indexOf(=)+1),theCookie.length);
}
else {
// if there's no cookie, then set the tracker to the default label.
theCookie = null;
}

// write the object/embed tags with the cookie appended to the .swf file name
document.write(
OBJECT
+ CLASSID=clsid:D27CDB6E-AE6D-11cf-96B8-44455354
+ WIDTH=550
+ HEIGHT=400
+ 
CODEBASE=http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=4,0,2,0'
+ PARAM NAME=MOVIE VALUE=import-cookie.swf?cookie= + theCookie + 

+ PARAM NAME=PLAY VALUE=true
+ PARAM NAME=LOOP VALUE=false
+ PARAM NAME=QUALITY VALUE=high
+ PARAM NAME=MENU VALUE=false
+ EMBED
+  SRC=import-cookie.swf?cookie= + theCookie
+  WIDTH=550
+  HEIGHT=400
+  PLAY=true
+  LOOP=false
+  QUALITY=high
+  MENU=false
+  TYPE=application/x-shockwave-flash
+  
PLUGINSPAGE=http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash
+ /EMBED
+ /OBJECT
);
// --
/SCRIPT

/DIV

/BODY
/HTML


But I.m not sure work well with php
If you get workable solution, can you shared us?


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



Re: [PHP] making sense of time(), date() and strtotime()

2003-05-30 Thread Rasmus Lerdorf
If you have your date components split up already the way you do, you
should be using mktime().

Next you have to determine which timezone your information is from.  If
you consider your month/day/year values to be GMT values, then use
gmmktime() to generate your timestamp.  Otherwise, make sure you
putenv(TZ=whatever) the timezone that matches your data before your call
to mktime().

It is important to understand that a UNIX timestamp (seconds since 1970
epoch) carries no timezone information.  A single UNIX timestamp
represents one specific second all over the world.  That is, if I gave you
the timestamp for when my baby was born, it would be the exact second this
happened.  This might be Monday here, but Tuesday in Australia.  Timezone
information is only applied once you go to display a human-readable date
from the unix timestamp.  gmdate() is just a special-case that does about
the same as:

   $old = getenv(TZ);
   putenv(TZ=GMT);
   echo date(M d Y H:i:s,$timestamp);
   putenv(TZ=$old);

It is in there because GMT is needed for all sorts of stuff and we figured
having a shortcut version of the above was a good idea.

If you really want to use strtotime() you can just tack the timezone
associated with your data onto the end of the string.  In your example:

  strtotime({$_POST['month']}/{$_POST['day']}/{$_POST['day']} GMT);

if your month/day/year are in GMT.

-Rasmus

On Thu, 29 May 2003, Justin French wrote:

 I have $_POST['day'] (1-31), $_POST['month'] (1-12), $_POST['year']
 (2003-2004).

 I store all dates as unix (epoch) timestamps, and generate the timestamp for
 the event with:

 strtotime('{$_POST['month']}/{$_POST['day']}/{$_POST['day']}');

 Everything works fine on my LAN (Australia), but when I upload my database
 to the live server (US), the dates are a day behind (when echo'd with
 date('Y-m-d')), presumably due to the time difference between the two
 servers.

 Timestamps generated directly on the live server appear correct when echoed
 out using date.


 How can I reliably generate timestamps which will work on any server, and
 reliably convert these timestamps to human readable format (eg
 date('Y-m-d')) on any server?


 Is the key to use GMT in the strtotime() string and use gmdate() instead of
 date()?  Or is it more complex than that?


 Thanks,

 Justin French


 --
 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] Variables don't pass... *sniff*

2003-05-30 Thread Wendell Brown
On Thu, 29 May 2003 10:33:16 +0100, Ford, Mike   [LSS]
wrote:

Well, how about references, then?  (And me, personally, I'd use isset()
rather than is_array().)

   if (isset($_POST)):
  $POST = $_POST;
   else:
  $POST = $HTTP_POST_VARS;
   endif;

I was told that PHP didn't do pointers - just goes to show that you
can't believe everything your told.  Thanks for the POINTER. ;)


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



RE: [PHP] Variables don't pass... *sniff*

2003-05-30 Thread Rasmus Lerdorf
On Thu, 29 May 2003, Wendell Brown wrote:

 On Thu, 29 May 2003 10:33:16 +0100, Ford, Mike   [LSS]
 wrote:

 Well, how about references, then?  (And me, personally, I'd use isset()
 rather than is_array().)
 
if (isset($_POST)):
   $POST = $_POST;
else:
   $POST = $HTTP_POST_VARS;
endif;

 I was told that PHP didn't do pointers - just goes to show that you
 can't believe everything your told.  Thanks for the POINTER. ;)

It isn't a pointer.  It is a reference which you should think of as a
symbol table alias.  A pointer, at least by my definition, is a memory
address.  In PHP it isn't a memory address, just another entry in the
symbol table that references the same data as another symbol.

-Rasmus

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



RE: [PHP] Variables don't pass... *sniff*

2003-05-30 Thread Ford, Mike [LSS]
 -Original Message-
 From: Wendell Brown [mailto:[EMAIL PROTECTED]
 Sent: 29 May 2003 15:18
 
 On Thu, 29 May 2003 10:33:16 +0100, Ford, Mike   [LSS]
 wrote:
 
 Well, how about references, then?  (And me, personally, I'd 
 use isset()
 rather than is_array().)
 
if (isset($_POST)):
   $POST = $_POST;
else:
   $POST = $HTTP_POST_VARS;
endif;
 
 I was told that PHP didn't do pointers - just goes to show that you
 can't believe everything your told.  Thanks for the POINTER. ;)

Umm -- it doesn't -- these are *references* which are *not* pointers (but work just as 
well in this instance).  For the official word on this, see 
http://www.php.net/language.references .

Cheers!

Mike

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

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



Re: [PHP] Netbilling PHP Script

2003-05-30 Thread Jason Wong
On Thursday 29 May 2003 21:49, Mike Morton wrote:
 I have to get this off my chest, and I tried to send it directly to Jason
 off list, but the email bounces back.  Why?  Probably because he gets a lot
 of these emails.  

Because I don't like spam.

 Why do you bother to answer on the php list at all?  90% of the messages
 from you are 'search google'  

Probably because 90% of the questions on the list can be answered by searching 
google?

 if you do not have constructive info to
 offer, why bother to answer at all. 

So constructive info would be for ME to search google and present the results 
neatly in my reply? Somehow I don't think so.

 I am directing this to you because the
 list does not need to see my crap about it, but it just makes me sick to
 see you over and over putting people down who are just asking for help.

Non-specific questions get non-specific answers.

If the OP wanted a better answer the question asked should have been something 
like:

I'm looking for a script to do blahblah, I searched on google/etc and found A, 
B and C. However I need features X, Y and Z.

Because:

1) We know the OP has done some homework
2) We know which packages the OP has already looked at and thus would not 
recommend them
3) We know what specific features the OP would like and thus can make an 
informed recommendation

 And no, 'search google' is not a good answer - at the best of times it is
 tough to wade through all the crap that google spits at you, 

So a good answer would be for ME to search google and present the results 
neatly in my reply? Somehow I don't think so.

 at the worst
 of times, most people do not even know what to search for to narrow it
 down! 

Well in this particular case php netbilling would have been a good start. 
Not exactly rocket science.

 Never mind searching the list archive - half the time all I get back
 is your emails saying 'search google'!

Probably it's because a lot of people look to the list as a first resort 
instead of consulting the manual, the archives and google. Thus they keep 
asking the same questions over and over again.

 Geeze, look what you have made me do, get pissed of and waste my time
 flaming you. What a waste of our time.

Well if you have nothing better to do then maybe you should search google try 
out all the links then present an executive summary for our friend the OP so 
that he can save himself some time.

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


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



RE: [PHP] Variables don't pass... *sniff*

2003-05-30 Thread Wendell Brown
On Thu, 29 May 2003 07:21:01 -0700 (Pacific Standard Time), Rasmus
Lerdorf wrote:

It isn't a pointer.  It is a reference which you should think of as a
symbol table alias.  A pointer, at least by my definition, is a memory
address.  In PHP it isn't a memory address, just another entry in the
symbol table that references the same data as another symbol.

I understood the logical distinction, I guess I should have said most
of the benefits of a pointer without many of the potential headaches.

Pointers in C are REAL memory addresses, HOWEVER, in many (if not most)
situations they are used as symbol table aliases.  It's when they
AREN'T carefully used this way that memory overwrites happen.

As I said, most of the good without most of the bad.  :)


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



Re: [PHP] Date question

2003-05-30 Thread Shaun
of course ;)

but  i couldn't find a reference to this particular problem...

Jay Blanchard [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
Have you checked the date functions at http://www.php.net ?

-Original Message-
From: Shaun [mailto:[EMAIL PROTECTED]
Sent: Thursday, May 29, 2003 6:39 AM
To: [EMAIL PROTECTED]
Subject: [PHP] Date question


Hi,

For a given date, how can i find out the date of the day of the begining
of that week?

Thanks for your help



-- 
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] Netbilling PHP Script

2003-05-30 Thread Mike Morton
Jason, you are a sad sad man.

The point I was simply trying to make was that YOU do not have to do
ANYTHING.  Don't search google, don't spend any time on it at all, don't
even email.

There are plenty of people here that are willing to help - if you are not -
piss off.

Not everyone has your complete knowledge and massive experience and extreme
brainpower, and we are not all able to utilize our pitiful intellects to
your level and utilize all the useful resources that google has to offer.

As for this list being the first resort, why not?  Who are you to determine
whether this list is a first, last or any other kind of resource?  Do you
own it, do you manage or moderate it in any way?  If so, then perhaps you
should write an FAQ that is presented with the welcome to the list email
that states all the obvious answers, if not, then leave the moderation to
those who's job it is.

This is a list containing noobs, vets and everything inbetween.  You have to
be considerate to all levels.  You sir, are not.  You are arrogant (your
problem not mine), rude (your problem not mine), and overall just not a nice
person on this list.  If you are different in real life, cool, by try to use
some restraint on the list why don't you!

That is all, back to our regular programming :)

On 5/29/03 10:28 AM, Jason Wong [EMAIL PROTECTED] wrote:

 On Thursday 29 May 2003 21:49, Mike Morton wrote:
 I have to get this off my chest, and I tried to send it directly to Jason
 off list, but the email bounces back.  Why?  Probably because he gets a lot
 of these emails.
 
 Because I don't like spam.
 
 Why do you bother to answer on the php list at all?  90% of the messages
 from you are 'search google'
 
 Probably because 90% of the questions on the list can be answered by searching
 google?
 
 if you do not have constructive info to
 offer, why bother to answer at all.
 
 So constructive info would be for ME to search google and present the results
 neatly in my reply? Somehow I don't think so.
 
 I am directing this to you because the
 list does not need to see my crap about it, but it just makes me sick to
 see you over and over putting people down who are just asking for help.
 
 Non-specific questions get non-specific answers.
 
 If the OP wanted a better answer the question asked should have been something
 like:
 
 I'm looking for a script to do blahblah, I searched on google/etc and found A,
 B and C. However I need features X, Y and Z.
 
 Because:
 
 1) We know the OP has done some homework
 2) We know which packages the OP has already looked at and thus would not
 recommend them
 3) We know what specific features the OP would like and thus can make an
 informed recommendation
 
 And no, 'search google' is not a good answer - at the best of times it is
 tough to wade through all the crap that google spits at you,
 
 So a good answer would be for ME to search google and present the results
 neatly in my reply? Somehow I don't think so.
 
 at the worst
 of times, most people do not even know what to search for to narrow it
 down! 
 
 Well in this particular case php netbilling would have been a good start.
 Not exactly rocket science.
 
 Never mind searching the list archive - half the time all I get back
 is your emails saying 'search google'!
 
 Probably it's because a lot of people look to the list as a first resort
 instead of consulting the manual, the archives and google. Thus they keep
 asking the same questions over and over again.
 
 Geeze, look what you have made me do, get pissed of and waste my time
 flaming you. What a waste of our time.
 
 Well if you have nothing better to do then maybe you should search google try
 out all the links then present an executive summary for our friend the OP so
 that he can save himself some time.

--
Cheers

Mike Morton


*
* Tel: 905-465-1263
* Email: [EMAIL PROTECTED]
*


Indeed, it would not be an exaggeration to describe the history of the
computer industry for the past decade as a massive effort to keep up with
Apple.
- Byte Magazine

Given infinite time, 100 monkeys could type out the complete works of
Shakespeare. Win 98 source code? Eight monkeys, five minutes.
-- NullGrey 


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



Re: [PHP] Netbilling PHP Script

2003-05-30 Thread Justin French
Mike,

I agree that at times Jason (and plenty of others, including myself on a bad
day) tend to use the search google and RTFM replies a lot, but the
reality is that if people did a quick search in the manual, and a quick
search on google, this list would be a lot less cluttered.

It also goes a long way in showing that the original poster isn't simply
lazy, and has made SOME effort to find the answer before posting to a list.


We'd also have well-formed questions like:

I checked out the manual page on file uploads, and tried getting
the example script to work, but I'm getting the following error
(...) -- can anyone offer advice?

Rather than:

I can't get file uploading to work, please read my 2000 line
script and tell me what's wrong


I just had a kick around google, and couldn't find much to do with
netbilling and PHP (apart from http://dreamcost.com/?page=dreamaccount), but
the fact is if the OP had mentioned that he/she had already searched google
with little success, this whole discussion could have been avoided :)


Which is better?  Teaching someone the answer to a problem, or teaching
someone how to find the answer (and future answers) themselves?

Search google may not be a detailed answer, or even a polite one, but in
many cases (not necessarily this OP of this thread) a lazy question deserves
a lazy response.

Justin French






on 30/05/03 12:49 AM, Mike Morton ([EMAIL PROTECTED]) wrote:

 I have to get this off my chest, and I tried to send it directly to Jason
 off list, but the email bounces back.  Why?  Probably because he gets a lot
 of these emails.  Don't like what I have to say?  Tough luck, I am sick of
 unconstructive emails hitting the list putting people down.  If you cannot
 or will not answer someone, just don't answer them at all.  Be helpful, not
 hurtful.  Oops, should take my own advice and not post this at all, but I
 need to get it off my chest, I am sure that I am not the only one thinking
 it:
 
 Jason:
 
 Why do you bother to answer on the php list at all?  90% of the messages
 from you are 'search google'  if you do not have constructive info to offer,
 why bother to answer at all.  I am directing this to you because the list
 does not need to see my crap about it, but it just makes me sick to see you
 over and over putting people down who are just asking for help.
 
 Really, I have been a member of MANY lists over the years, and I truly have
 never seen anyone as negative as you.  If you do not have a useful answer to
 the question just don't answer- you clutter the list and my inbox.
 
 And no, 'search google' is not a good answer - at the best of times it is
 tough to wade through all the crap that google spits at you, at the worst of
 times, most people do not even know what to search for to narrow it down!
 Never mind searching the list archive - half the time all I get back is your
 emails saying 'search google'!
 
 Geeze, look what you have made me do, get pissed of and waste my time
 flaming you. What a waste of our time.
 
 
 On 5/29/03 5:43 AM, Jason Wong [EMAIL PROTECTED] wrote:
 
 On Thursday 29 May 2003 17:36, Ralph wrote:
 I have to setup credit card verification/processing with Netbilling.com,
 does anybody know of a PHP based Netbilling gateway script or class?
 
 Have you searched google?
 
 --
 Cheers
 
 Mike Morton
 
 
 *
 * Tel: 905-465-1263
 * Email: [EMAIL PROTECTED]
 *
 
 
 Indeed, it would not be an exaggeration to describe the history of the
 computer industry for the past decade as a massive effort to keep up with
 Apple.
 - Byte Magazine
 
 Given infinite time, 100 monkeys could type out the complete works of
 Shakespeare. Win 98 source code? Eight monkeys, five minutes.
 -- NullGrey 
 


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



Re: [PHP] Date question

2003-05-30 Thread Wendell Brown
On Thu, 29 May 2003 15:40:00 +0100, Shaun wrote:

of course ;)

but  i couldn't find a reference to this particular problem...

I don't think you are going to find a standard PHP function to do this.
 You are going to have to do something like this (I haven't tried it
but I think it will do what you want):

// Get a starting time
$d = strtotime( 12/31/2003 );

// Get the date of the Sunday on/or before that date

$s = strtotime( - . date(w, $d) .  days, $d );


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



Re: [PHP] Help with eval()

2003-05-30 Thread zavaboy
Umm, have you tested it? It didn't work for me...


Marek Kilimajer [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 for ($i = $aNum; eval ('return $i ' . $do . ' $bNum'); )



 zavaboy wrote:

 Hey,
 
 I'm having problems with the eval() function...
 
 if ($Sort == Up) {
 $do==;
 } else {
 $do==;
 }
 for ($i = $aNum; eval ('$i ' . $do . ' $bNum'); )
 //So.. the above line acts like:
 //for ($i = $aNum; $i = $bNum; )
 //...or...
 //for ($i = $aNum; $i = $bNum; )
 {
 i
 if ($Sort == Up) {
 $i++;
 } else {
 $i--
 }
 
 Any idea how to make it work right?
 
 
 
 - Zavaboy
 [EMAIL PROTECTED]
 www.zavaboy.com
 
 
 
 
 




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



[PHP] GD2 Bundled with PHP v 4.3.2

2003-05-30 Thread Dave O Keeffe
Hi All,

I read in the ChangeLog for v4.3.2 that GD2 is bundled with this release.  I 
downloaded and installed the Windows Installer version but my sample 
imagecreate code still doesn't work, it reports the error 'Call to undefined 
function: imagecreate()'.

When I uncomment the ;extension=php_gd2.dll line in php.ini I get a error 
message saying this file cannot be found, which is no surprise seeing as 
it's nowhere on my machine.

Is GD actually bundled with the windows version or do I have to compile it 
myself?

Thanks for any help...

_
The new MSN 8: smart spam protection and 2 months FREE*  
http://join.msn.com/?page=features/junkmail

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


[PHP] easy update

2003-05-30 Thread Edward Peloke
Ok,  I enroll in the school of 'If it ain't broke, don't fix it' and my
version of PHP has worked just fine so I never saw a reason to update.  Now,
I think I will take the plunge.  I can barely remember configuring apache
and php originally so is there an easy route to install the latest php
version?

Thanks,
Eddie


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



RE: [PHP] Date question

2003-05-30 Thread Ford, Mike [LSS]
 -Original Message-
 From: Shaun [mailto:[EMAIL PROTECTED]
 Sent: 29 May 2003 15:40
 
 of course ;)
 
 but  i couldn't find a reference to this particular problem...
 
 Jay Blanchard [EMAIL PROTECTED] wrote in message
 news:[EMAIL PROTECTED]
 Have you checked the date functions at http://www.php.net ?
 
 -Original Message-
 From: Shaun [mailto:[EMAIL PROTECTED]
 Sent: Thursday, May 29, 2003 6:39 AM
 To: [EMAIL PROTECTED]
 Subject: [PHP] Date question
 
 
 Hi,
 
 For a given date, how can i find out the date of the day of 
 the begining
 of that week?

Have you tried searching the list archives?  I'm pretty sure I answered this
one with a strtotime() solution not that long ago, but it wasn't the most
intuitively obvious way to do it.  If you can't find that post, let me know
and I'll see if I can dig it out of my Outbox archive.

Cheers!

Mike

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

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



RE: [PHP] easy update

2003-05-30 Thread Joe Stump
I prefer apt-get -u dist-upgrade ;)

If you follow the static compile in the INSTALL file that comes with the PHP
source you can compile it in a matter of minutes.

--Joe


--
Joe Stump [EMAIL PROTECTED]
http://www.joestump.net
Label makers are proof God wants Sys Admins to be happy.

-Original Message-
From: Edward Peloke [mailto:[EMAIL PROTECTED]
Sent: Thursday, May 29, 2003 7:39 AM
To: [EMAIL PROTECTED] Php. Net
Subject: [PHP] easy update


Ok,  I enroll in the school of 'If it ain't broke, don't fix it' and my
version of PHP has worked just fine so I never saw a reason to update.  Now,
I think I will take the plunge.  I can barely remember configuring apache
and php originally so is there an easy route to install the latest php
version?

Thanks,
Eddie


--
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] Netbilling PHP Script

2003-05-30 Thread Mike Morton
Justin:

Point well taken, and I agree for the most part.  Teaching people to learn
themselves is a much better solution that just giving the answer, however it
CAN be done in a constructive and helpful manner, rather than a rude and
abrupt one.

I have not noticed your responses, so I cannot comment, other than they did
not particularily jump out at me as rude as Jason's did.

step on soapbox
There is a lot of experience on this list, but we all have to remember that
there is also a lot of inexperience on this list.  When someone asks a
simple question they do not always even understand what they are asking, and
may not even know how to ask the correct question.  That is why if we do not
have an answer that is constructive, then we should not post it.
/step off soapbox

That is not to say that I am the judge of a constructive or non-constructive
answer, just that if you do not have anything nice to say, then don't say
anything at all!

Anyway, arguing noob teaching ethics is not paying the bills, so back to
that at least! :)


On 5/29/03 9:42 AM, Justin French [EMAIL PROTECTED] wrote:

 Mike,
 
 I agree that at times Jason (and plenty of others, including myself on a bad
 day) tend to use the search google and RTFM replies a lot, but the
 reality is that if people did a quick search in the manual, and a quick
 search on google, this list would be a lot less cluttered.
 
 It also goes a long way in showing that the original poster isn't simply
 lazy, and has made SOME effort to find the answer before posting to a list.
 
 
 We'd also have well-formed questions like:
 
   I checked out the manual page on file uploads, and tried getting
   the example script to work, but I'm getting the following error
   (...) -- can anyone offer advice?
 
 Rather than:
 
   I can't get file uploading to work, please read my 2000 line
   script and tell me what's wrong
 
 
 I just had a kick around google, and couldn't find much to do with
 netbilling and PHP (apart from http://dreamcost.com/?page=dreamaccount), but
 the fact is if the OP had mentioned that he/she had already searched google
 with little success, this whole discussion could have been avoided :)
 
 
 Which is better?  Teaching someone the answer to a problem, or teaching
 someone how to find the answer (and future answers) themselves?
 
 Search google may not be a detailed answer, or even a polite one, but in
 many cases (not necessarily this OP of this thread) a lazy question deserves
 a lazy response.
 
 Justin French
 
 
 
 
 
 
 on 30/05/03 12:49 AM, Mike Morton ([EMAIL PROTECTED]) wrote:
 
 I have to get this off my chest, and I tried to send it directly to Jason
 off list, but the email bounces back.  Why?  Probably because he gets a lot
 of these emails.  Don't like what I have to say?  Tough luck, I am sick of
 unconstructive emails hitting the list putting people down.  If you cannot
 or will not answer someone, just don't answer them at all.  Be helpful, not
 hurtful.  Oops, should take my own advice and not post this at all, but I
 need to get it off my chest, I am sure that I am not the only one thinking
 it:
 
 Jason:
 
 Why do you bother to answer on the php list at all?  90% of the messages
 from you are 'search google'  if you do not have constructive info to offer,
 why bother to answer at all.  I am directing this to you because the list
 does not need to see my crap about it, but it just makes me sick to see you
 over and over putting people down who are just asking for help.
 
 Really, I have been a member of MANY lists over the years, and I truly have
 never seen anyone as negative as you.  If you do not have a useful answer to
 the question just don't answer- you clutter the list and my inbox.
 
 And no, 'search google' is not a good answer - at the best of times it is
 tough to wade through all the crap that google spits at you, at the worst of
 times, most people do not even know what to search for to narrow it down!
 Never mind searching the list archive - half the time all I get back is your
 emails saying 'search google'!
 
 Geeze, look what you have made me do, get pissed of and waste my time
 flaming you. What a waste of our time.
 
 
 On 5/29/03 5:43 AM, Jason Wong [EMAIL PROTECTED] wrote:
 
 On Thursday 29 May 2003 17:36, Ralph wrote:
 I have to setup credit card verification/processing with Netbilling.com,
 does anybody know of a PHP based Netbilling gateway script or class?
 
 Have you searched google?
 
 --
 Cheers
 
 Mike Morton
 
 
 *
 * Tel: 905-465-1263
 * Email: [EMAIL PROTECTED]
 *
 
 
 Indeed, it would not be an exaggeration to describe the history of the
 computer industry for the past decade as a massive effort to keep up with
 Apple.
 - Byte Magazine
 
 Given infinite time, 100 monkeys could type out the complete works of
 Shakespeare. Win 98 source code? Eight monkeys, five minutes.
 -- NullGrey 
 
 

--
Cheers

Re: [PHP] Date question

2003-05-30 Thread Jason Wong
On Thursday 29 May 2003 22:40, Shaun wrote:
 of course ;)

Try:

$start_date_ts = time();
if ('Mon' != date('D', $start_date_ts)) { 
  $start_date_ts = strtotime(last monday);
} 
$start_date= strftime(%Y-%m-%d, $start_date_ts);
echo $start_date;
  
Season to taste.

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


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



[PHP] Random Blank Output wit 4.3.2

2003-05-30 Thread Andy BIERLAIR
Hi,

I’ve tried php-4.3.2 with my old config (4.3.1), and I noticed that all our
VirtualHosts are sometimes blank and then after a browser refresh, the
content is showed. This happens approx. 1 in 10 times.

You can try it with one of our vhosts: www.hot.lu and refreshing it a few
times.

The problem used to be a little different and I found a solution, but it
only stopped the random output of an open_base_dir restricion (which isn't
present!)

At random times a PHP gave the error:

Warning: open_basedir restriction in effect. File is in wrong directory
in Unknown on line 0

Warning: Failed opening '/php/page/I/happen/to/be/looking/at.php' for
inclusion (include_path='.:/usr/local/lib/php') in Unknown on line 0

I followed the instructions in this thread and changed the php.ini file:
http://bugs.php.net/bug.php?id=15302 



I hope that someone can help me out since I think that I'm not the first one
to have this problem.

Btw: This problem did not occur in = PHP-4.3.1


Thanks,
 


* Andy BIERLAIR - root eSolutions sàrl - Management    *
* 133, route de Diekirch - L-7220 Walferdange - Luxembourg *
* E-mail: [EMAIL PROTECTED] *
* URL:    http://www.root.lu - http://www.network.lu   *

 



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



RE: [PHP] GD2 Bundled with PHP v 4.3.2

2003-05-30 Thread Ford, Mike [LSS]
 -Original Message-
 From: Dave O Keeffe [mailto:[EMAIL PROTECTED]
 Sent: 29 May 2003 15:28
 
 I read in the ChangeLog for v4.3.2 that GD2 is bundled with 
 this release.  I 
 downloaded and installed the Windows Installer version but my sample 
 imagecreate code still doesn't work, it reports the error 
 'Call to undefined 
 function: imagecreate()'.
 
 When I uncomment the ;extension=php_gd2.dll line in php.ini I 
 get a error 
 message saying this file cannot be found, which is no 
 surprise seeing as 
 it's nowhere on my machine.
 
 Is GD actually bundled with the windows version or do I have 
 to compile it 
 myself?

There should be a php_gd2.dll in the extensions subdirectory of your PHP
4.3.2 download -- it needs to be moved to your extension_dir directory.

Cheers!

Mike

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

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



[PHP] Re: PHP OOP x Procedural Performance

2003-05-30 Thread rush
William N. Zanatta [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]

   It is a known issue that function calls are expensive for the processor.

   The OOP let us better organize the code but, thinking in function (or
 method) calls it may be more expensive than in the procedural form.

   My question is, has anyone made any tests regarding the performance of
 OOP versus procedural language? Is it a good choice to code in OOP with
 PHP ?

I would say, that web app model is so inefficient in itself, that you can
hardly do anything to make things significantly worse or better performance
wise. Also OOP is extensively used in other environments, and unless you are
coding critical device drivers, it is rarely to expensive in terms of
processing time.

So my advice would be use OOP, and take benefit of better organization of
your code.

Just my 2c.

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





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



Re: [PHP] Help with eval()

2003-05-30 Thread David Grant
zavaboy wrote:

Umm, have you tested it? It didn't work for me...

Marek Kilimajer [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
for ($i = $aNum; eval ('return $i ' . $do . ' $bNum'); )
Untested:

for ($i = $aNum; eval(return (\$i  . $do .   \$bNum););)

--
David Grant
Web Developer
[EMAIL PROTECTED]
http://www.wiredmedia.co.uk
Tel: 0117 930 4365, Fax: 0870 169 7625

Wired Media Ltd
Registered Office: 43 Royal Park, Bristol, BS8 3AN
Studio: Whittakers House, 32 - 34 Hotwell Road, Bristol, BS8 4UD
Company registration number: 4016744

**
This email and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom they
are addressed. If you have received this email in error please notify
the system manager.
**

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


Re: [PHP] A good function

2003-05-30 Thread Shaun
how about stripslashes();

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

HTH

Shaun

Dan Joseph [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 Hi,

 Have a look at: http://us2.php.net/manual/en/function.ereg-replace.php

 That might do what you want.

 -Dan Joseph

  What is a good function for striping white space and removing
  \\..\..  and possible ,  Anything that would be considered
  unwanted user input???
 
  I looked at trim() but its doesnt do all the things I need it to do.




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



Re: [PHP] Netbilling PHP Script

2003-05-30 Thread Adam Voigt
Agreed, if you don't have something usefull to say,
don't say anything at all.


On Thu, 2003-05-29 at 10:57, Mike Morton wrote:
 Justin:
 
 Point well taken, and I agree for the most part.  Teaching people to learn
 themselves is a much better solution that just giving the answer, however it
 CAN be done in a constructive and helpful manner, rather than a rude and
 abrupt one.
 
 I have not noticed your responses, so I cannot comment, other than they did
 not particularily jump out at me as rude as Jason's did.
 
 step on soapbox
 There is a lot of experience on this list, but we all have to remember that
 there is also a lot of inexperience on this list.  When someone asks a
 simple question they do not always even understand what they are asking, and
 may not even know how to ask the correct question.  That is why if we do not
 have an answer that is constructive, then we should not post it.
 /step off soapbox
 
 That is not to say that I am the judge of a constructive or non-constructive
 answer, just that if you do not have anything nice to say, then don't say
 anything at all!
 
 Anyway, arguing noob teaching ethics is not paying the bills, so back to
 that at least! :)
 
 --
 Cheers
 
 Mike Morton
 
 
 *
 * Tel: 905-465-1263
 * Email: [EMAIL PROTECTED]
 *
 
 
 Indeed, it would not be an exaggeration to describe the history of the
 computer industry for the past decade as a massive effort to keep up with
 Apple.
 - Byte Magazine
 
 Given infinite time, 100 monkeys could type out the complete works of
 Shakespeare. Win 98 source code? Eight monkeys, five minutes.
 -- NullGrey 
-- 
Adam Voigt ([EMAIL PROTECTED])
Linux/Unix Network Administrator
The Cryptocomm Group


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



Re: [PHP] Help with eval()

2003-05-30 Thread zavaboy
I get a infinite loop and parse error, unexpected $...


David Grant [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 zavaboy wrote:

  Umm, have you tested it? It didn't work for me...
 
 
  Marek Kilimajer [EMAIL PROTECTED] wrote in message
  news:[EMAIL PROTECTED]
 
 for ($i = $aNum; eval ('return $i ' . $do . ' $bNum'); )

 Untested:

 for ($i = $aNum; eval(return (\$i  . $do .   \$bNum););)


 -- 
 David Grant
 Web Developer

 [EMAIL PROTECTED]
 http://www.wiredmedia.co.uk

 Tel: 0117 930 4365, Fax: 0870 169 7625

 Wired Media Ltd
 Registered Office: 43 Royal Park, Bristol, BS8 3AN
 Studio: Whittakers House, 32 - 34 Hotwell Road, Bristol, BS8 4UD

 Company registration number: 4016744

 **
 This email and any files transmitted with it are confidential and
 intended solely for the use of the individual or entity to whom they
 are addressed. If you have received this email in error please notify
 the system manager.

 **




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



RE: [PHP] Re: PHP OOP x Procedural Performance

2003-05-30 Thread Joe Stump
In my experience OOP isn't any faster/slower. I've used it on sites that get
30M hits a month; so if it's gonna break I'd have seen it by now.

One thing I'd like to abundantly point out is that NOT EVERYTHING BELONGS IN
OOP! For instance, if you're building classes that output HTML - you've
skipped a few chapters in your OOP design books.

OOP with PHP is lacking as far as complex application development (PHP5
looks to fix this), but it works great for base classes. I usually program
CORE functionality in OOP (ie. Basket for e-commerce which keeps track of
users' baskets). The rest of the code is procedural (ie. code that does
basic math and organizes the page).

--Joe

--
Joe Stump [EMAIL PROTECTED]
http://www.joestump.net
Label makers are proof God wants Sys Admins to be happy.

-Original Message-
From: rush [mailto:[EMAIL PROTECTED]
Sent: Thursday, May 29, 2003 8:02 AM
To: [EMAIL PROTECTED]
Subject: [PHP] Re: PHP OOP x Procedural Performance


William N. Zanatta [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]

   It is a known issue that function calls are expensive for the processor.

   The OOP let us better organize the code but, thinking in function (or
 method) calls it may be more expensive than in the procedural form.

   My question is, has anyone made any tests regarding the performance of
 OOP versus procedural language? Is it a good choice to code in OOP with
 PHP ?

I would say, that web app model is so inefficient in itself, that you can
hardly do anything to make things significantly worse or better performance
wise. Also OOP is extensively used in other environments, and unless you are
coding critical device drivers, it is rarely to expensive in terms of
processing time.

So my advice would be use OOP, and take benefit of better organization of
your code.

Just my 2c.

rush
--
http://www.templatetamer.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] Netbilling PHP Script

2003-05-30 Thread Cal Evans
Mike,

I'm glad you vented. Now let me. I say none of this in anger and quite a lot
of it in amusement. Please don't take this the wrong way. (By saying that
I'm insuring that you WILL take it the wrong way!)  :)

Why is it helpful to give a person the answer to a question that has been
answered before?  Why is it not more helpful to show them how to find the
answer to their question and possibly to the next one...and the net
one...and the next one. All of us at one point or another have gotten mad
because they've been told to RTFM. (UTFG, UTFW, etc.) But the fact of the
matter is if you get told that a couple of time, you may actually start
doing it.  Jason's search google answer is very appropriate for many
questions asked on this list.

The people who answer questions here do it of their own free will, for no
pay, and in the case of independent consultants, at the expense of their
paying work. (Those of you who are employed and posting from work are just
slacking!)  :) Therefore, it is their right to answer in the way that they
feel most helpful. If RTFM is the quickest way to get a newb to start
reading the manual instead of asking (yet again) how the mail() function
works then that's what will be posted.

Telling people like Jason off as you have done feels really good. But at
some point Jason will decide that it's no longer worth while to bother to
read this list and drop. Then you can tell off someone else who knows what
they are talking about because they don't follow your rules of
etiquette...and maybe they will leave.  At some point, you will  find
yourself in the list all by yourself. (except for the newb over in the
corner still twiddling with the mail() function)

It boils down to this. mailing lists have been around longer than you or I
have been on the Internet. (Unless you are Vint Cerf and if you are I HUMBLY
apologize and bow at your feet!) The rules of mailinglist etiquette
(especially for technical lists, which this is) have matured over the years
and are not really up for discussion. If you don't like them, go elsewhere,
start your own list. Otherwise, play nice.

most humbly,
=C=


- Original Message -
From: Mike Morton [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Thursday, May 29, 2003 8:49 AM
Subject: Re: [PHP] Netbilling PHP Script


 I have to get this off my chest, and I tried to send it directly to Jason
 off list, but the email bounces back.  Why?  Probably because he gets a
lot
 of these emails.  Don't like what I have to say?  Tough luck, I am sick of
 unconstructive emails hitting the list putting people down.  If you cannot
 or will not answer someone, just don't answer them at all.  Be helpful,
not
 hurtful.  Oops, should take my own advice and not post this at all, but I
 need to get it off my chest, I am sure that I am not the only one thinking
 it:

 Jason:

 Why do you bother to answer on the php list at all?  90% of the messages
 from you are 'search google'  if you do not have constructive info to
offer,
 why bother to answer at all.  I am directing this to you because the list
 does not need to see my crap about it, but it just makes me sick to see
you
 over and over putting people down who are just asking for help.

 Really, I have been a member of MANY lists over the years, and I truly
have
 never seen anyone as negative as you.  If you do not have a useful answer
to
 the question just don't answer- you clutter the list and my inbox.

 And no, 'search google' is not a good answer - at the best of times it is
 tough to wade through all the crap that google spits at you, at the worst
of
 times, most people do not even know what to search for to narrow it down!
 Never mind searching the list archive - half the time all I get back is
your
 emails saying 'search google'!

 Geeze, look what you have made me do, get pissed of and waste my time
 flaming you. What a waste of our time.


 On 5/29/03 5:43 AM, Jason Wong [EMAIL PROTECTED] wrote:

  On Thursday 29 May 2003 17:36, Ralph wrote:
  I have to setup credit card verification/processing with
Netbilling.com,
  does anybody know of a PHP based Netbilling gateway script or class?
 
  Have you searched google?

 --
 Cheers

 Mike Morton

 
 *
 * Tel: 905-465-1263
 * Email: [EMAIL PROTECTED]
 *
 

 Indeed, it would not be an exaggeration to describe the history of the
 computer industry for the past decade as a massive effort to keep up with
 Apple.
 - Byte Magazine

 Given infinite time, 100 monkeys could type out the complete works of
 Shakespeare. Win 98 source code? Eight monkeys, five minutes.
 -- NullGrey


 --
 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 eval()

2003-05-30 Thread David Grant
zavaboy wrote:

I get a infinite loop and parse error, unexpected $...
Told you it was untested.. :P

--
David Grant
Web Developer
[EMAIL PROTECTED]
http://www.wiredmedia.co.uk
Tel: 0117 930 4365, Fax: 0870 169 7625

Wired Media Ltd
Registered Office: 43 Royal Park, Bristol, BS8 3AN
Studio: Whittakers House, 32 - 34 Hotwell Road, Bristol, BS8 4UD
Company registration number: 4016744

**
This email and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom they
are addressed. If you have received this email in error please notify
the system manager.
**

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


[PHP] Links in e-mail

2003-05-30 Thread christian tischler
I use mail() to send e-mail automatically.

But all I can send is text. I would like to send links, but can figure out
how to make them work.

Thanks,

Christian



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



[PHP] ldap_add() troubles

2003-05-30 Thread Cecile
Hi list,

i'm very newbie in PHP so sorry for this simple question but i havn't found any
differences between my code and example code on a lot of website that i visited.

I use PHP-4.3.1, OpenLDAP 2.1.19, BerkeleyDB-4.1.25 and Apache-2.0.45.

My problem is that my variables are not taken into account.

This is the code :
--

?php

print centerform method='post'  Username : br
   input type='text' name='user' size='20'/form\n;
print centerform method='post'  Firstname : br
   input type='text' name='firstname' size='20'/form\n;
print centerform method='post'  Lastname : br
   input type='text' name='lastname' size='20'/form\n;
print centerform method='post'  Telephon Number : br
   input type='text' name='tel' size='20'/form\n;
print centerform method='post'  Mobile Number : br
   input type='text' name='mobile' size='20'/form\n;
print centerform method='post'  Address : br
   textarea name='street' rows='3' cols='20'/textarea/form\n;
print centerform method='post'br
   input type='submit' value='Valider' name='goldap'/form\n;


$user = ( $_POST['user'] );
$firstname = ( $_POST['firstname'] );
$lastname = ( $_POST['lastname'] );
$tel = ( $_POST['tel'] );
$mobile = ( $_POST['mobile'] );
$street = ( $_POST['street'] );



if ($_POST['goldap']) {
/* connect to ldap server*/
$ldapconn = ldap_connect(localhost);
or die(Could not connect to LDAP server.);

/* binding to ldap server*/
$ldapbind = ldap_bind($ldapconn, cn=Admin,dc=labo,dc=be, pass);

$dn = uid=$user,ou=accounts,dc=labo,dc=be;
echo brUser: $dn;

$info[objectclass][0] = top;
$info[objectclass][1] = person;
$info[objectclass][2] = inetorgperson;
$info[objectclass][3] = qmailuser;
$info[uid] = $user;
$info[cn] = $user;
$info[sn] = $lastname;
$info[displayname] = $firstname $lastname;
$info[telephonenumber] = $tel;
$info[street] = $street;
$info[mailmessagestore] = /var/qmail/maildirs/$user/Maildir;
$info[mail] = [EMAIL PROTECTED];
$info[mailalternateaddress] = [EMAIL PROTECTED];
$info[mailhost] = cleyman.labo.be;
$info[userpassword] = $user;
$info[accountstatus] = active;
$info[description] = Qmail User;
ldap_add($ldapconn, $dn, $info );
if ($ldapbind) {
echo brBind OKbr;
} else {
echo brBind failed !br;
}
if ($ldap_query) {
echo brInsert OKbr;
ldap_close($ldapconn);
} else {
echo brInsert failed !br;
ldap_close($ldapconn);
}
}
?

Here is error messages that i have when i submit the query :
---
PHP Error :
---

User: uid=,ou=accounts,dc=labo,dc=be
 ^^^
Warning: ldap_add(): Add: Invalid DN syntax in
/usr/local/apache2/htdocs/testll/ldapweb/testadd2.php on line ***
= is the line where ldap_add is executed ($info).

Bind OK (authentication is ok)
Insert failed !



LDAP Error :


ber_dump: buf=0x081e5fb0 ptr=0x081e5fb0 end=0x081e6142 len=402
  :  02 01 02 68 82 01 8b 04  1e 75 69 64 3d 2c 6f 75   ...h.uid=,ou
  0010:  3d 61 63 63 6f 75 6e 74  73 2c 64 63 3d 6c 61 62   =accounts,dc=lab
  0020:  6f 2c 64 63 3d 62 65 30  82 01 67 30 36 04 0b 6f   o,dc=be0..g06..o
  0030:  62 6a 65 63 74 63 6c 61  73 73 31 27 04 03 74 6f   bjectclass1'..to
  0040:  70 04 06 70 65 72 73 6f  6e 04 0d 69 6e 65 74 6f   p..person..ineto
  0050:  72 67 70 65 72 73 6f 6e  04 09 71 6d 61 69 6c 75   rgperson..qmailu
  0060:  73 65 72 30 09 04 03 75  69 64 31 02 04 00 30 08   ser0...uid1...0.
  0070:  04 02 63 6e 31 02 04 00  30 08 04 02 73 6e 31 02   ..cn1...0...sn1.
  0080:  04 00 30 11 04 0b 64 69  73 70 6c 61 79 6e 61 6d   ..0...displaynam
  0090:  65 31 02 04 00 30 15 04  0f 74 65 6c 65 70 68 6f   e1...0...telepho
  00a0:  6e 65 6e 75 6d 62 65 72  31 02 04 00 30 0c 04 06   nenumber1...0...
  00b0:  73 74 72 65 65 74 31 02  04 00 30 32 04 10 6d 61   street1...02..ma
  00c0:  69 6c 6d 65 73 73 61 67  65 73 74 6f 72 65 31 1e   ilmessagestore1.
  00d0:  04 1c 2f 76 61 72 2f 71  6d 61 69 6c 2f 6d 61 69   ../var/qmail/mai
  00e0:  6c 64 69 72 73 2f 2f 4d  61 69 6c 64 69 72 30 12   ldirs//Maildir0.
  

RE: [PHP] Links in e-mail

2003-05-30 Thread Joe Stump
Most MUA's will convert http://* or www.* to a link. Otherwise you'll have
to send MIME encoded HTML with a href=/a tags. The problem with the
second solution is that not all MUA's (ie. mutt) support MIME encoded HTML
messages.

--Joe

--
Joe Stump [EMAIL PROTECTED]
http://www.joestump.net
Label makers are proof God wants Sys Admins to be happy.

-Original Message-
From: christian tischler [mailto:[EMAIL PROTECTED]
Sent: Thursday, May 29, 2003 8:14 AM
To: [EMAIL PROTECTED]
Subject: [PHP] Links in e-mail


I use mail() to send e-mail automatically.

But all I can send is text. I would like to send links, but can figure out
how to make them work.

Thanks,

Christian



--
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] Links in e-mail

2003-05-30 Thread Adam Voigt
For the third parameter of the mail command, use:

Content-type:text/html\r\n

I.E.:

mail($to,$subject,$body,Content-type:text/html\r\n);

On Thu, 2003-05-29 at 11:13, christian tischler wrote:
 I use mail() to send e-mail automatically.
 
 But all I can send is text. I would like to send links, but can figure out
 how to make them work.
 
 Thanks,
 
 Christian
-- 
Adam Voigt ([EMAIL PROTECTED])
Linux/Unix Network Administrator
The Cryptocomm Group


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



Re: [PHP] Links in e-mail

2003-05-30 Thread ruusvuu
$link = http://somedomain.com;;

$msg .= $link\n;


Quoting christian tischler [EMAIL PROTECTED]:

 I use mail() to send e-mail automatically.
 
 But all I can send is text. I would like to send links, but can figure out
 how to make them work.
 
 Thanks,
 
 Christian
 
 
 
 -- 
 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] Structered or Object Oriented?

2003-05-30 Thread Jaime Diaz
I would like to know wich is the best way to program in PHP, is it OO or
structured, because I red in a book that if I program in OO PHP the
performance of the page is slower than programming it in structured.
But if i have a big web site isn´t it better to program Object Oriented.





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



[PHP] [sessions] using [sockets]. Very tough!

2003-05-30 Thread Nicholas F. Singh
Hello all you great PHPers,

Who among you can solve this tricky problem?

OK, a little background: my goal is to send local POST requests to some of my php 
pages from **within** a php program. I have already successfully done simple POST data 
transfers with sockets using HTTPClient.class. This is not an issue. This class 
really just prints out the appropriate headers and receives a server response using 
sockets -- rather simple.

I am now trying to get php SESSIONS to work with this socketed setup. I already have 
sessions working for normal HTTP requests. You can pass session IDs using cookies or 
with a POST/GET variable, as you know.

Now, I've set up two files, tst1.php and tst2.php. TST1 sends TST2 some POST data, 
and attempts to relay the session id to maintain session state:

 tst1.php 
--
include(HTTPClient.class);
session_save_path(mypathtosessions); //No, this is not what I actually have in my 
code, silly
session_start(); //Executes a new session.

//Create socket object
$HTTP = new Net_HTTP_Client(mydomain,80); //No, this is not what I actually have in 
my code, silly

///
// (1) GET - This example attempts to send the session ID via the GET method. If you 
execute the code below,
// it will lock up. However, if you change PHPSESSID to, say, blah, the code 
will not lock up.
// There's some problem, here!
$HTTP-Post(/~refcoord/tst2.php?PHPSESSID=.session_id(), // --
array( 
 Bob = Jones, 
   
 ID_we_need_to_pass_to_tst2 = session_id()
));

///
// (2) POST - This example attempts to send the session ID via the POST method. The 
same set of wierd circumstances
// occur here just as in GET. There's some systematic conflict occurring on the server.
$HTTP-Post(/~refcoord/tst2.php, array(
   
 Bob = Jones, 
   
 ID_we_need_to_pass_to_tst2 = session_id()
   
 PHPSESSID = session_id() // --
   ));

///
// (3) COOKIE - I even went so far as to simulate a cookie! Still, the example below 
locks up any server response.
// again, if I change PHPSESSID to ANY other value, the server will at least give a 
response!
$HTTP-addHeader(Cookie, PHPSESSID=.session_id()); // --
$HTTP-Post(/~refcoord/tst2.php, array(
   
 Bob = Jones, 
   
 ID_we_need_to_pass_to_tst2 = session_id()
));

///
//Print out the REPSONSE we get after sending an HTTP POST request to tst2.php
echo $HTTP-getBody();
///

--
--



 tst2.php 
--
session_save_path(mypathtosessions); //Set the path where session files will be saved
session_start(); //Starts session. If a session ID is passed to this file,
// the progam will use that session. If this file does 
not
// get passed a session id via GET/POST or COOKIE, 
this function
// will generate a *new* ID (bad!)

//Print POSTed sample data passed in from tst1.php (works 100%)
echo brbutst2.php POSTed Data:/u/bbr;
while (list ($name, $value) = each ($HTTP_POST_VARS)) 
if($name != ID_we_need_to_pass_to_tst2)
echo $name: $valuebr\n;

//Compare the session IDs
echo brSession ID from tst1.php = .$_POST[ID_we_need_to_pass_to_tst2];
echo brSession ID from tst2.php = .session_id();
echo bri(These should be the same, but they are not! The function session_start() 
inbr

RE: [PHP] Re: PHP OOP x Procedural Performance

2003-05-30 Thread Johnson, Kirk
 One thing I'd like to abundantly point out is that NOT 
 EVERYTHING BELONGS IN
 OOP! For instance, if you're building classes that output 
 HTML - you've
 skipped a few chapters in your OOP design books.

Joe,

I am curious about this opinion, could you elaborate a bit, please? I am not
an OOP programmer, and I'm just interested in your thoughts on this, if you
have time.

Kirk


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



Re: [PHP] Netbilling PHP Script

2003-05-30 Thread Jason Wong
On Thursday 29 May 2003 22:49, Mike Morton wrote:

 There are plenty of people here that are willing to help - if you are not -
 piss off.

For the record the gentleman posted the question twice. I didn't even bother 
to answer the first one (and no-one else did). When he posted again he was 
obviously desperate (or more likely impatient) and may have kept on posting 
until he got an answer.

And to suggest that have you searched google? is rude, is beyond my powers 
of reasoning.

 Not everyone has your complete knowledge and massive experience and extreme
 brainpower, and we are not all able to utilize our pitiful intellects to
 your level and utilize all the useful resources that google has to offer.

If you think it requires massive intellect to be able to use a search engine 
then I really do pity you. Honestly.

 As for this list being the first resort, why not?  

Obviously you do not know how mailing lists work.

 Who are you to determine
 whether this list is a first, last or any other kind of resource?

Of course you can use it as a first resort, but very soon people will get fed 
with replying to your questions if they can be answered in the manual, 
archives etc.

 Do you own it, do you manage or moderate it in any way?

No, what gave you that impression?

 If so, then perhaps you
 should write an FAQ that is presented with the welcome to the list email
 that states all the obvious answers, if not, then leave the moderation to
 those who's job it is.

The problem is not lack of information, the problem is that people don't read. 
Case in point: a few days ago someone asked whether there was a FAQ section 
on www.php.net.

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


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



RE: [PHP] Re: PHP OOP x Procedural Performance

2003-05-30 Thread Joe Stump
Sure ...

I'm of the belief that OOP (in PHP anyways) has great use for core
libraries. Core libraries, by their nature, generally don't output HTML.
It's a core libraries job to separate logic and presentation. How portable
is your library that outputs HTML for a guy who wants PDF/WAP/XML output?

For instance, I have a product class that does various things to format
product *data* prior to my procedural scripts putting it into my Smarty
templates. If that product class outputted the data in HTML it would be
useless to me for WAP users or a script that generated PDF versions of our
online catalog.

--Joe

--
Joe Stump [EMAIL PROTECTED]
http://www.joestump.net
Label makers are proof God wants Sys Admins to be happy.

-Original Message-
From: Johnson, Kirk [mailto:[EMAIL PROTECTED]
Sent: Thursday, May 29, 2003 8:21 AM
To: 'Joe Stump'; [EMAIL PROTECTED]
Subject: RE: [PHP] Re: PHP OOP x Procedural Performance


 One thing I'd like to abundantly point out is that NOT
 EVERYTHING BELONGS IN
 OOP! For instance, if you're building classes that output
 HTML - you've
 skipped a few chapters in your OOP design books.

Joe,

I am curious about this opinion, could you elaborate a bit, please? I am not
an OOP programmer, and I'm just interested in your thoughts on this, if you
have time.

Kirk



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



Re: [PHP] Re: Biding Arrays from Oracle Stored Procedure to PHP Variables

2003-05-30 Thread Gregory Watson
Thanks Lang - from the notes you sent me I'm able to bind arrays 
successfully using a complex select, but using the procedure still gives 
me an error:

   Warning: OCIStmtExecute: ORA-01008: not all variables bound in
   C:\ftp_dir\boards\winners.php on line 20
   Warning: OCIFetch: ORA-24374: define not done before fetch or
   execute and fetch in C:\ftp_dir\boards\winners.php on line 21
All the variables are there; is there any way to get more detail on 
which variable or variables is causing problems?

Thanks again

Greg

Lang Sharpe wrote:

Have a look at this paper, in particular the collections section at the end

http://www.phpconference.de/2001/slides/arntzen_ocipaper.txt

I've never used them myself, because they look a bit dodgy. But it may be 
the only way to do what you're trying to do.

Lang
 



[PHP] PHP.INI question.

2003-05-30 Thread Ananth Kesari
Hi,

Can we use one PHP.INI directive to set the other?

What I mean is like this:

Let's say I have:
upload_tmp_dir = sys:/php/temp
in the PHP.INI file.

Now I want to set the same value into the open_basedir directive like:
open_basedir = .;sys:/php/temp

Here, I do not want to hard code sys:/ptp/temp, but I want this
to be read off from the upload_tmp_dir directive of PHP.INI file.
Something to this effect:
open_basedir = .;$upload_tmp_dir

The above doesn't work.

Can something like this be done and if yes, how?

Thanks,
Ananth.


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



[PHP] Getting POSTed values from dynamically named checkboxes

2003-05-30 Thread Dillon, John
My problem relates to IF statement in the following code.  There are two
checkboxes, named altid$thisid, so for instance they become altid36 and
altid37.  When the form is submitted with both checked, I can read the first
altid36, but the second does not pass the IF test.  Any suggestions re
possible reasons?


$checkedalts = array();
$x=0;
$y=1;
$array_id = explode(,, $_POST[idlist]);
foreach($array_id as $thisid){
if(${altid . $thisid} == 1){
//OR if(ISSET($_POST[${altid . $thisid}])){
$checkedalts[$x] = $thisid;
$checkedalts[$y] = ${altprice . $thisid};
$x=$x+2;
$y=$x+1;
}
}

The HTML before submission is (without the !--):

!--
tr
  tdWhatever/td
  tdinput type=checkbox name=altid36  value=1
/td
  td class=textset22input size=10 type=textfield
value= name=altprice36/td
/trtr
  tdSomething else/td
  tdinput type=checkbox name=altid37  value=1
/td
  tdinput size=10 type=textfield value=
name=altprice37/td
/trtr 
//--

Thanks,

John
Please reply to both cc and return address if not to the list.


   http://www.cantor.com
CONFIDENTIAL: This e-mail, including its contents and attachments, if any, are 
confidential. If you are not the named recipient please notify the sender and 
immediately delete it. You may not disseminate, distribute, or forward this e-mail 
message or disclose its contents to anybody else. Copyright and any other intellectual 
property rights in its contents are the sole property of Cantor Fitzgerald.
 E-mail transmission cannot be guaranteed to be secure or error-free. The sender 
therefore does not accept liability for any errors or omissions in the contents of 
this message which arise as a result of e-mail transmission.  If verification is 
required please request a hard-copy version.
 Although we routinely screen for viruses, addressees should check this e-mail and 
any attachments for viruses. We make no representation or warranty as to the absence 
of viruses in this e-mail or any attachments. Please note that to ensure regulatory 
compliance and for the protection of our customers and business, we may monitor and 
read e-mails sent to and from our server(s). 

For further important information, please read the  Important Legal Information and 
Legal Statement at http://www.cantor.com/legal_information.html


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



Re: [PHP] Getting POSTed values from dynamically named checkboxes

2003-05-30 Thread David Grant
Dillon, John wrote:

My problem relates to IF statement in the following code.  There are two
checkboxes, named altid$thisid, so for instance they become altid36 and
altid37.  When the form is submitted with both checked, I can read the first
altid36, but the second does not pass the IF test.  Any suggestions re
possible reasons?
$checkedalts = array();
$x=0;
$y=1;
$array_id = explode(,, $_POST[idlist]);
foreach($array_id as $thisid){
if(${altid . $thisid} == 1){
//OR if(ISSET($_POST[${altid . $thisid}])){
$checkedalts[$x] = $thisid;
$checkedalts[$y] = ${altprice . $thisid};
$x=$x+2;
$y=$x+1;
}
}
The HTML before submission is (without the !--):

!--
tr
  tdWhatever/td
  tdinput type=checkbox name=altid36  value=1
/td
  td class=textset22input size=10 type=textfield
value= name=altprice36/td
/trtr
  tdSomething else/td
  tdinput type=checkbox name=altid37  value=1
/td
  tdinput size=10 type=textfield value=
name=altprice37/td
/trtr 
//--

Not what you're looking for, but... are you sure you're doing this the 
easiest way?

Try putting your values in an array instead, e.g.

altid[36] and altprice[36]

Then access through:

foreach ($_POST['altid'] as $id = $value)
{
  $price = $_POST['altprice'][$id]
}
Regards,

David

--
David Grant
Web Developer
[EMAIL PROTECTED]
http://www.wiredmedia.co.uk
Tel: 0117 930 4365, Fax: 0870 169 7625

Wired Media Ltd
Registered Office: 43 Royal Park, Bristol, BS8 3AN
Studio: Whittakers House, 32 - 34 Hotwell Road, Bristol, BS8 4UD
Company registration number: 4016744

**
This email and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom they
are addressed. If you have received this email in error please notify
the system manager.
**

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


Re: [PHP] Help with eval()

2003-05-30 Thread Marek Kilimajer
yes, missing semi-comma:
for ($i = $aNum; eval ('return $i ' . $do . ' $bNum;'); )
the rest is up to you, I don't know what you want to do whit it

Marek Kilimajer wrote:

for ($i = $aNum; eval ('return $i ' . $do . ' $bNum'); )



zavaboy wrote:

Hey,

I'm having problems with the eval() function...

if ($Sort == Up) {
$do==;
} else {
$do==;
}
for ($i = $aNum; eval ('$i ' . $do . ' $bNum'); )
//So.. the above line acts like:
//for ($i = $aNum; $i = $bNum; )
//...or...
//for ($i = $aNum; $i = $bNum; )
{
i
if ($Sort == Up) {
$i++;
} else {
$i--
}
Any idea how to make it work right?



- Zavaboy
[EMAIL PROTECTED]
www.zavaboy.com


 





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


Re: [PHP] [sessions] using [sockets]. Very tough!

2003-05-30 Thread Marek Kilimajer
Nicholas F. Singh wrote:

Hello all you great PHPers,

Who among you can solve this tricky problem?

OK, a little background: my goal is to send local POST requests to some of my php pages from **within** a php program. I have already successfully done simple POST data transfers with sockets using HTTPClient.class. This is not an issue. This class really just prints out the appropriate headers and receives a server response using sockets -- rather simple.

I am now trying to get php SESSIONS to work with this socketed setup. I already have sessions working for normal HTTP requests. You can pass session IDs using cookies or with a POST/GET variable, as you know.

Now, I've set up two files, tst1.php and tst2.php. TST1 sends TST2 some POST data, and attempts to relay the session id to maintain session state:

 tst1.php 
--
include(HTTPClient.class);
session_save_path(mypathtosessions); //No, this is not what I actually have in my 
code, silly
session_start(); //Executes a new session.
//Create socket object
$HTTP = new Net_HTTP_Client(mydomain,80); //No, this is not what I actually have in 
my code, silly
///
// (1) GET - This example attempts to send the session ID via the GET method. If you execute the code below,
// it will lock up. However, if you change PHPSESSID to, say, blah, the code will not lock up.
// There's some problem, here!
$HTTP-Post(/~refcoord/tst2.php?PHPSESSID=.session_id(), // --
   array(  Bob = Jones, 
   ID_we_need_to_pass_to_tst2 = session_id()
   ));

Sure it will lock up. tst1.php has the session file locked for itself, 
and as you use the same session id, the same session file would be used 
for tst2.php. You can use different session_save_paths for each file. Or 
you can let tst2.php set its own session id and get the cookie.



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


RE: [PHP] Re: PHP OOP x Procedural Performance

2003-05-30 Thread Michael Sweeney
Joe, 

I mostly agree with your opinion. But remember that a method in an
object that has output doesn't have to print the output - it can return
it instead and the calling function can then either display the output
or do something else with it. And if it makes sense to have a method
return HTML, another developer can override that method so that it
returns XML. Or yet another method could take the HTML output of the
first one and convert it to PDF. 

The question, I think, is about figuring out the most effective place to
do what solves the problems. I'm afraid that saying You should never
ever ever write an OOP method that has HTML in it's output is so rigid
that it might make the development process more difficult and complex
than it needs to be.

Michael

On Thu, 2003-05-29 at 11:28, Joe Stump wrote:
 Sure ...
 
 I'm of the belief that OOP (in PHP anyways) has great use for core
 libraries. Core libraries, by their nature, generally don't output HTML.
 It's a core libraries job to separate logic and presentation. How portable
 is your library that outputs HTML for a guy who wants PDF/WAP/XML output?
 
 For instance, I have a product class that does various things to format
 product *data* prior to my procedural scripts putting it into my Smarty
 templates. If that product class outputted the data in HTML it would be
 useless to me for WAP users or a script that generated PDF versions of our
 online catalog.
 
 --Joe
 

 
 -Original Message-
 From: Johnson, Kirk [mailto:[EMAIL PROTECTED]
 Sent: Thursday, May 29, 2003 8:21 AM
 To: 'Joe Stump'; [EMAIL PROTECTED]
 Subject: RE: [PHP] Re: PHP OOP x Procedural Performance
 
 
  One thing I'd like to abundantly point out is that NOT
  EVERYTHING BELONGS IN
  OOP! For instance, if you're building classes that output
  HTML - you've
  skipped a few chapters in your OOP design books.
 
 Joe,
 
 I am curious about this opinion, could you elaborate a bit, please? I am not
 an OOP programmer, and I'm just interested in your thoughts on this, if you
 have time.
 
 Kirk



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



[PHP] Can we use one PHP.INI directive to set the other?

2003-05-30 Thread Ananth Kesari
Hi,

Can we use one PHP.INI directive to set the other?

What I mean is like this:

Let's say I have:
upload_tmp_dir = sys:/php/temp
in the PHP.INI file.

Now I want to set the same value into the open_basedir directive like:
open_basedir = .;sys:/php/temp

Here, I do not want to hard code sys:/ptp/temp, but I want this
to be read off from the upload_tmp_dir directive of PHP.INI file.
Something to this effect:
open_basedir = .;$upload_tmp_dir

The above doesn't work.

Can something like this be done and if yes, how?

Thanks,
Ananth.


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



Re: [PHP] [sessions] using [sockets]. Very tough!

2003-05-30 Thread N. F. Singh
Good point. However, the whole point is that I need to pass that session ID
so that TST2 can access the same session info TST1 is. Know what I mean? I
wonder how I can resolve this...

Thanks for the reply!

- Original Message -
From: Marek Kilimajer [EMAIL PROTECTED]
To: Nicholas F. Singh [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Sent: Thursday, May 29, 2003 11:11 AM
Subject: Re: [PHP] [sessions] using [sockets]. Very tough!



 Nicholas F. Singh wrote:

 Hello all you great PHPers,
 
 Who among you can solve this tricky problem?
 
 OK, a little background: my goal is to send local POST requests to some
of my php pages from **within** a php program. I have already successfully
done simple POST data transfers with sockets using HTTPClient.class. This
is not an issue. This class really just prints out the appropriate headers
and receives a server response using sockets -- rather simple.
 
 I am now trying to get php SESSIONS to work with this socketed setup. I
already have sessions working for normal HTTP requests. You can pass
session IDs using cookies or with a POST/GET variable, as you know.
 
 Now, I've set up two files, tst1.php and tst2.php. TST1 sends TST2
some POST data, and attempts to relay the session id to maintain session
state:
 
  tst1.php 

---
---
 include(HTTPClient.class);
 session_save_path(mypathtosessions); //No, this is not what I actually
have in my code, silly
 session_start(); //Executes a new session.
 
 //Create socket object
 $HTTP = new Net_HTTP_Client(mydomain,80); //No, this is not what I
actually have in my code, silly
 

///

 // (1) GET - This example attempts to send the session ID via the GET
method. If you execute the code below,
 // it will lock up. However, if you change PHPSESSID to, say, blah,
the code will not lock up.
 // There's some problem, here!
 $HTTP-Post(/~refcoord/tst2.php?PHPSESSID=.session_id(), // --
 
array(  Bob = Jones,
 
ID_we_need_to_pass_to_tst2 = session_id()

  ));
 
 Sure it will lock up. tst1.php has the session file locked for itself,
 and as you use the same session id, the same session file would be used
 for tst2.php. You can use different session_save_paths for each file. Or
 you can let tst2.php set its own session id and get the cookie.







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



[PHP] easy conversion to a date?

2003-05-30 Thread Anthony
I have a form where the user enters a date into a text input field.  I need
to convert this text to a date and put it in a field in a mySQL database.
Is there an easy way to do this?  Do I have to tear the string appart and
create a date out of the parts?  Someone must have a fiunction that will do
this work already right?

Thanks for your help
- Anthony



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



Re: [PHP] vpopmail what is it???

2003-05-30 Thread Jason Wong
On Friday 30 May 2003 07:03, Haseeb Iqbal wrote:
 Actually i know what vpopmail is but to be abs clear i want to read more. i
 have a few questions in my mind. that i want to be clear about.i want to
 make a script that would create new users on a qmail server.i want to be
 sure this is what i want.

Not sure what your last sentence means -- if you have already decided upon (or 
are already) using vpopmail then there isn't much choice? The subject of 
using the vpopmail functions was touched upon recently, refer to archives.

Otherwise you may want to consider using vmailmgr instead. This has a daemon 
which makes it easier to interface using php (no need to worry about 
setuid/setgid etc).

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


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



Re: [PHP] easy conversion to a date?

2003-05-30 Thread Jordan S. Jones
Anthony,

I believe that what you are looking for is the following:
http://www.php.net/strtotime
Jordan

Anthony wrote:

I have a form where the user enters a date into a text input field.  I need
to convert this text to a date and put it in a field in a mySQL database.
Is there an easy way to do this?  Do I have to tear the string appart and
create a date out of the parts?  Someone must have a fiunction that will do
this work already right?
Thanks for your help
- Anthony


 



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


Re: [PHP] [sessions] using [sockets]. Very tough!

2003-05-30 Thread Marek Kilimajer
You can do:
session_start();
$session_id = session_id();
session_write_close();
Lock has been released, now you are free to post $session_id to the 
other script

N. F. Singh wrote:

Good point. However, the whole point is that I need to pass that session ID
so that TST2 can access the same session info TST1 is. Know what I mean? I
wonder how I can resolve this...
Thanks for the reply!

- Original Message -
From: Marek Kilimajer [EMAIL PROTECTED]
To: Nicholas F. Singh [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Sent: Thursday, May 29, 2003 11:11 AM
Subject: Re: [PHP] [sessions] using [sockets]. Very tough!
 

Nicholas F. Singh wrote:

   

Hello all you great PHPers,

Who among you can solve this tricky problem?

OK, a little background: my goal is to send local POST requests to some
 

of my php pages from **within** a php program. I have already successfully
done simple POST data transfers with sockets using HTTPClient.class. This
is not an issue. This class really just prints out the appropriate headers
and receives a server response using sockets -- rather simple.
 

I am now trying to get php SESSIONS to work with this socketed setup. I
 

already have sessions working for normal HTTP requests. You can pass
session IDs using cookies or with a POST/GET variable, as you know.
 

Now, I've set up two files, tst1.php and tst2.php. TST1 sends TST2
 

some POST data, and attempts to relay the session id to maintain session
state:
 

 tst1.php 
 

---
   

---
 

include(HTTPClient.class);
session_save_path(mypathtosessions); //No, this is not what I actually
 

have in my code, silly
 

session_start(); //Executes a new session.

//Create socket object
$HTTP = new Net_HTTP_Client(mydomain,80); //No, this is not what I
 

actually have in my code, silly
 

///
   


 

// (1) GET - This example attempts to send the session ID via the GET
 

method. If you execute the code below,
 

// it will lock up. However, if you change PHPSESSID to, say, blah,
 

the code will not lock up.
 

// There's some problem, here!
$HTTP-Post(/~refcoord/tst2.php?PHPSESSID=.session_id(), // --
 

array(  Bob = Jones,
 

ID_we_need_to_pass_to_tst2 = session_id()
 

 ));
 

Sure it will lock up. tst1.php has the session file locked for itself,
and as you use the same session id, the same session file would be used
for tst2.php. You can use different session_save_paths for each file. Or
you can let tst2.php set its own session id and get the cookie.


   



 



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


Re: [PHP] easy conversion to a date?

2003-05-30 Thread Michael Sweeney
Look at http://www.php.net/strtotime

..micahel..

On Thu, 2003-05-29 at 09:21, Anthony wrote:
 I have a form where the user enters a date into a text input field.  I need
 to convert this text to a date and put it in a field in a mySQL database.
 Is there an easy way to do this?  Do I have to tear the string appart and
 create a date out of the parts?  Someone must have a fiunction that will do
 this work already right?
 



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



Re: [PHP] Help with eval()

2003-05-30 Thread zavaboy
Ok, it works now! Thanks!
Go visit what I'm working on at: http://zavaboy.jimbug.org/phptest/blog.php
I'm working on a blog, mainly for myself...
If you go there, tell me if the yellow days are clickable. Also tell me if
you see red dates on the blog.
I should be the only one to see those things because the PHP looks for a
matching IP.

Thanks again!


Marek Kilimajer [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 yes, missing semi-comma:
 for ($i = $aNum; eval ('return $i ' . $do . ' $bNum;'); )

 the rest is up to you, I don't know what you want to do whit it

 Marek Kilimajer wrote:

  for ($i = $aNum; eval ('return $i ' . $do . ' $bNum'); )
 
 
 
  zavaboy wrote:
 
  Hey,
 
  I'm having problems with the eval() function...
 
  if ($Sort == Up) {
  $do==;
  } else {
  $do==;
  }
  for ($i = $aNum; eval ('$i ' . $do . ' $bNum'); )
  //So.. the above line acts like:
  //for ($i = $aNum; $i = $bNum; )
  //...or...
  //for ($i = $aNum; $i = $bNum; )
  {
  i
  if ($Sort == Up) {
  $i++;
  } else {
  $i--
  }
 
  Any idea how to make it work right?
 
 
 
  - Zavaboy
  [EMAIL PROTECTED]
  www.zavaboy.com
 
 
 
 
 
 
 




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



Re: [PHP] [sessions] using [sockets]. Very tough!

2003-05-30 Thread N. F. Singh
Fantastic! I was totally unaware of this function. Thanks very much! If any
of you guys found this helpfull, be sure to call session_start() again if
you're using --enable-trans-sid. Otherwise, on your subsequent call to
another page needing a session state, the SID won't be propogated (at least
on my server, Apache).

Thanks again, Marek.

NFS
- Original Message -
From: Marek Kilimajer [EMAIL PROTECTED]
To: N. F. Singh [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Sent: Thursday, May 29, 2003 11:24 AM
Subject: Re: [PHP] [sessions] using [sockets]. Very tough!


 You can do:
 session_start();
 $session_id = session_id();
 session_write_close();

 Lock has been released, now you are free to post $session_id to the
 other script

 N. F. Singh wrote:

 Good point. However, the whole point is that I need to pass that session
ID
 so that TST2 can access the same session info TST1 is. Know what I mean?
I
 wonder how I can resolve this...
 
 Thanks for the reply!
 
 - Original Message -
 From: Marek Kilimajer [EMAIL PROTECTED]
 To: Nicholas F. Singh [EMAIL PROTECTED]
 Cc: [EMAIL PROTECTED]
 Sent: Thursday, May 29, 2003 11:11 AM
 Subject: Re: [PHP] [sessions] using [sockets]. Very tough!
 
 
 
 
 Nicholas F. Singh wrote:
 
 
 
 Hello all you great PHPers,
 
 Who among you can solve this tricky problem?
 
 OK, a little background: my goal is to send local POST requests to some
 
 
 of my php pages from **within** a php program. I have already
successfully
 done simple POST data transfers with sockets using HTTPClient.class.
This
 is not an issue. This class really just prints out the appropriate
headers
 and receives a server response using sockets -- rather simple.
 
 
 I am now trying to get php SESSIONS to work with this socketed setup. I
 
 
 already have sessions working for normal HTTP requests. You can pass
 session IDs using cookies or with a POST/GET variable, as you know.
 
 
 Now, I've set up two files, tst1.php and tst2.php. TST1 sends TST2
 
 
 some POST data, and attempts to relay the session id to maintain session
 state:
 
 
  tst1.php 
 
 

--
-
 
 
 ---
 
 
 include(HTTPClient.class);
 session_save_path(mypathtosessions); //No, this is not what I
actually
 
 
 have in my code, silly
 
 
 session_start(); //Executes a new session.
 
 //Create socket object
 $HTTP = new Net_HTTP_Client(mydomain,80); //No, this is not what I
 
 
 actually have in my code, silly
 
 

//
/
 
 
 
 
 
 // (1) GET - This example attempts to send the session ID via the GET
 
 
 method. If you execute the code below,
 
 
 // it will lock up. However, if you change PHPSESSID to, say,
blah,
 
 
 the code will not lock up.
 
 
 // There's some problem, here!
 $HTTP-Post(/~refcoord/tst2.php?PHPSESSID=.session_id(), // --
 
 
 
 array(  Bob = Jones,
 
 
 ID_we_need_to_pass_to_tst2 = session_id()
 
 
   ));
 
 
 Sure it will lock up. tst1.php has the session file locked for itself,
 and as you use the same session id, the same session file would be used
 for tst2.php. You can use different session_save_paths for each file. Or
 you can let tst2.php set its own session id and get the cookie.
 
 
 
 
 
 
 
 
 
 
 





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



RE: [PHP] strip_tags() Quandry....

2003-05-30 Thread Carl Furst
Yes, no problem! Glad it worked out. you may wish to actually study the
perlre man page on perl.com. This goes into the most details and talks about
how PERL actually EXTENDS shell regular expressions significantly and
excellent resource that I have used many many times.

I figure since PHP regexps are perl compatible, might as well go to the
source, no?

My other suggestion is that if you are taking this HTML and putting into a
database, especially MySQL you should scrub for pipes, nulls and slashes,
hackers can exploit user input to open a tty or shell or even access user
files like /etc/passwd and mess wid ya here are a few regexps that do
that

For pipes:
preg_replace('/\|/g','',$html_string);
 For nulls:
Preg_replace('/\0/g','',$html_string);
For slashes
preg_replace('/\//g','',$html_string);  # to be clearer, you can use s!\/!
g; just so you can see where the regexp begins and ends.


Some other useful ones for data like the stuff you're doing:
Spaces at the beginning:
/^\s/
spaces at the end:
/\s$/
br tags into \n
preg_replace('!\br\!', \n, $string);

regular expressions are key.. if you have an editor like bbedit on the mac
or UltraEdit on the PC it will make your life SO much easier. Especially if
you are a database massager, oh man the hours I have saved!

C.




-Original Message-
From: Noah [mailto:[EMAIL PROTECTED]
Sent: Thursday, May 29, 2003 12:34 PM
To: Carl Furst
Subject: Re: [PHP] strip_tags() Quandry

Hey Carl.

Sorry for the late reply -- got totally wrapped up in utilizing that highly
useful bit of reg exp code.

Thanks for the heads up; it certainly solved the problem.

Unfortunately, or fortunately, new problems have arisen -- time to dive into
learning some reg exp syntax

Thanks again,

--Noah


- Original Message -
From: Carl Furst [EMAIL PROTECTED]
To: CF High [EMAIL PROTECTED]
Sent: Tuesday, May 27, 2003 8:49 PM
Subject: RE: [PHP] strip_tags() Quandry


use regular expressions:

preg_replace(/\s+/, ,$html_string);

-Original Message-
From: CF High [mailto:[EMAIL PROTECTED]
Sent: Tuesday, May 27, 2003 11:57 PM
To: [EMAIL PROTECTED]
Subject: [PHP] strip_tags() Quandry


Hey all.

I've got a chunk of HTML text I'd like to format for insertion into our
mySql db.

Let's say $html_string equals the following:

tr
td1/td
tdBardo, Jesse/td
tdS/td
tdA/td
tdAndover, MA/td
/tr

To setup this chunk of text for insertion I first use
strip_tags($html_string); that results in:

1
Bardo, Jesse
S
A
Andover, MA

I then use str_replace(,,,$html_string) to create a space delimited
string.

Here's where I believe the problem occurs.  There are apparently numerous
blank spaces within the string.  I've tried replacing the blank spaces, or
whatever is separating the data to no avail.

I've tried a number of aimless efforts to get the string properly formatted,
but no luck -- any suggestions?

Thanks for helping me over this hurdle...

--Noah



--
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] strip_tags() Quandry....

2003-05-30 Thread CPT John W. Holmes
 Yes, no problem! Glad it worked out. you may wish to actually study the
 perlre man page on perl.com. This goes into the most details and talks
about
 how PERL actually EXTENDS shell regular expressions significantly and
 excellent resource that I have used many many times.

 I figure since PHP regexps are perl compatible, might as well go to the
 source, no?

 My other suggestion is that if you are taking this HTML and putting into a
 database, especially MySQL you should scrub for pipes, nulls and slashes,
 hackers can exploit user input to open a tty or shell or even access user
 files like /etc/passwd and mess wid ya here are a few regexps that do
 that

While I agree that regexp are powerful and useful, the examples you gave are
better suited to using str_replace(), trim(), or nl2br() calls rather than a
regular expression.

Also, about the warning for inserting data into a database... try not to
scare people to much. If you have

column = '$value'
or
column = $value

in your query, as long as you've run addslashes on $value to escape single
quotes in the first case and double quotes in the second, there's no
vulnerabilities.

If you have

column = $column

then you BETTER make sure that $column is a number and only a number. When
you put unquoted (unquoted within the actual SQL, not PHP) values into your
SQL, that's when you open yourself up to vulnerabilities if you're not
validating that the value is only a number.


 For pipes:
 preg_replace('/\|/g','',$html_string);
  For nulls:
 Preg_replace('/\0/g','',$html_string);
 For slashes
 preg_replace('/\//g','',$html_string);  # to be clearer, you can use s!\/!
 g; just so you can see where the regexp begins and ends.

str_replace('|','',$html_string);
etc...

 Some other useful ones for data like the stuff you're doing:
 Spaces at the beginning:
 /^\s/
 spaces at the end:
 /\s$/

trim()

 br tags into \n
 preg_replace('!\br\!', \n, $string);

nl2br();

---John Holmes...


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



Re: [PHP] PHP OOP x Procedural Performance

2003-05-30 Thread Ernest E Vogelsinger
At 04:05 29.05.2003, William N. Zanatta said:
[snip]
 It is a known issue that function calls are expensive for the processor.

  The OOP let us better organize the code but, thinking in function (or
method) calls it may be more expensive than in the procedural form.

  My question is, has anyone made any tests regarding the performance of
OOP versus procedural language? Is it a good choice to code in OOP with
PHP ?
[snip] 

Recently we did some research for a decision on how to proceed with a
project - basically the question was should we use objects for tata
storage, or simple associative arrays and a static class handling array nodes.



The testbed source is copied below. The test was run on RH Linux 7.2
running on a Dell Rackmount Server with 2x1GHz, 1GB memory, Apache 1.3.27,
PHP 4.3.2.

The numbers:

3.912186 secs (0.039122 msecs each): Created 10 array entries
0.397721 secs (0.003977 msecs each): Write-Accessed 10 array values
0.364761 secs (0.003648 msecs each): Read-Accessed 10 array values
0.343353 secs (0.003434 msecs each): Deleted 10 array values using
store[idx] = null
0.302970 secs (0.003030 msecs each): Deleted 10 array values using
unset(store[idx])
-
4.880921 secs (0.048809 msecs each): Created 10 object entries
0.492642 secs (0.004926 msecs each): Write-Accessed 10 object values
using direct access
1.148577 secs (0.011486 msecs each): Write-Accessed 10 object values
using access method
0.465929 secs (0.004659 msecs each): Read-Accessed 10 object values
using direct access
0.977031 secs (0.009770 msecs each): Read-Accessed 10 object values
using access method
0.490641 secs (0.004906 msecs each): Deleted 10 object values using
store[idx] = null
0.298719 secs (0.002987 msecs each): Deleted 10 object values using
unset(store[idx])

Comparing the numbers (Array = 100%):
Creating:   124.7% 
Write-Access (direct):  123.8%
Write-Access (method):  314.9%
Read-Access (direct):   127.7%
Read-Access (method):   267.9%
Deletion (set to null): 142.9%
Deletion (using unset):  98.5%

For a small number of objects the performance penalty may be minimal.
However if you're dealing with a huge number of instances it may be worth
considering different approaches.

One interesting thing to note is that clearing an array entry using
$array[$idx] = null;
is between 20% - 40% slower than using
unset($array[$idx]);

function measure($start = null, $string = null, $passes = null)
{
$x = microtime();
if ($start) {
list($s0, $s1) = explode(' ', $start);
list($e0, $e1) = explode(' ', $x);
$time = ($e0 + $e1) - ($s0 + $s1);
if ($passes)
$x = sprintf(%f secs (%f msecs each): %s\n,
$time, ($time * 1000) / $passes, $string);
else
$x = sprintf(%f secs: %s\n, $time, $string);
}
return $x;
}

function make_array()
{
$a = array(
'rid'   = null,
'owid'  = null,
'pid'   = null,
'dcid'  = null,
'dsid'  = null,
'drid'  = null,
'usg'   = null,
'rtb'   = null,
'idx'   = null,
'env'   = null,
'xid'   = null,
'ci'= null,
'cr'= null,
'cd'= null,
'cts'   = null,
'cs'= null,
'ctx'   = null,
'cbl'   = null,
);
return $a;
}

class TEST {
var $a;

function TEST() {
$this-a = make_array();
}
function access($entry) {
return $this-a[$entry];
}
function set($entry, $value) {
$this-a[$entry] = $value;
}
}

function runtest($cmd, $text)
{
global $LOOPS;
global $astore;
global $ostore;

$code =  EOC
\$x = measure();
for (\$i = 0; \$i  \$LOOPS; ++\$i) $cmd;
echo measure(\$x, $text);
EOC;

eval($code);
}

function arcopy($x)
{
$a = array();
while (list($k, $v) = each ($x))
$a[$k] = $v;
return $a;
}

$LOOPS = 10;
$astore = array();
$ostore = array();

runtest('$astore[] = make_array()', 'Created $i array entries');
runtest('$astore[$i][rid] = $i', 'Write-Accessed $i array values');
runtest('$n = $astore[$i][rid]', 'Read-Accessed $i array values');
$astore2 = arcopy($astore);
runtest('$astore[$i] = null', 'Deleted $i array values using store[idx] =
null');
$astore = $astore2;
runtest('unset($astore[$i])', 'Deleted $i array values using
unset(store[idx])');
echo -\n;
runtest('$ostore[] = new TEST()', 'Created $i object entries');

Re: [PHP] easy conversion to a date?

2003-05-30 Thread Anthony
exactly what I'm looking for.  Thanks!

- Anthony

Jordan S. Jones [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 Anthony,

 I believe that what you are looking for is the following:
 http://www.php.net/strtotime

 Jordan

 Anthony wrote:

 I have a form where the user enters a date into a text input field.  I
need
 to convert this text to a date and put it in a field in a mySQL database.
 Is there an easy way to do this?  Do I have to tear the string appart and
 create a date out of the parts?  Someone must have a fiunction that will
do
 this work already right?
 
 Thanks for your help
 - Anthony
 
 
 
 
 




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



Re: [PHP] Re: PHP OOP x Procedural Performance

2003-05-30 Thread rush
Joe Stump [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 Sure ...

 I'm of the belief that OOP (in PHP anyways) has great use for core
 libraries. Core libraries, by their nature, generally don't output HTML.
 It's a core libraries job to separate logic and presentation. How portable
 is your library that outputs HTML for a guy who wants PDF/WAP/XML output?

 For instance, I have a product class that does various things to format
 product *data* prior to my procedural scripts putting it into my Smarty
 templates. If that product class outputted the data in HTML it would be
 useless to me for WAP users or a script that generated PDF versions of our
 online catalog.

Core libraries are of course first candidate for OOP, but I think there are
many other places where you can use it successfully. Take for instance how
it is used in TemplateTamer.

In it, you define a class responsible for the generation of the page. In
typicall usage you have a common class that all page classes inherit from,
and which defines elements of page common to all pages on the site, and
specific page classes implement only the parts they differ in. When the site
grows, it is common to refine the hierarchy of page classes, so you have one
page class on the top, then a few below it describing main sections of the
site, and then on the bottom concrete page classes.

Another OOP usage in TT can be in creating classes that represent GUI
components. For instance on one site I have worked, I have created a
JobAdForm object, that handles for reponsible displaying form and editing of
JobAd object. Than when I needed similar but litle more extended version for
superuser pages, I have just created a subclass SuperuserJobAdForm, and
overided necessary parts, but inhertied 95% of code.

So I think there is usage for OOP also in gui parts of the code, where it
can also help better organization of code, and reuse between the pages or
components on the same site.

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




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



[PHP] Re: Links in e-mail

2003-05-30 Thread Manuel Lemos
Hello,

On 05/29/2003 12:13 PM, Christian Tischler wrote:
I use mail() to send e-mail automatically.

But all I can send is text. I would like to send links, but can figure out
how to make them work.
In most mail programs, if you start address in text messages with 
http:// or mailto: for instance, they will highlight them as links.

However, if you want to put arbitrary text in links you need to compose 
and send HTML messages.

In that case you may want to try this class for composing and sending 
HTML messages properly:

http://www.phpclasses.org/mimemessage

--

Regards,
Manuel Lemos
Free ready to use OOP components written in PHP
http://www.phpclasses.org/
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] imagecreatefromjpeg()

2003-05-30 Thread Edward Peloke
ok, I am having an off day, I admit...I got this script off codewalkers this
morning (cheating, I know)

?php

//phpinfo();
function thumbnail($i,$nw,$p,$nn) {
$img=imagecreatefromjpeg($i);
$ow=imagesx($img);
$oh=imagesy($img);
$scale=$nw/$ow;
$nh=ceil($oh*$scale);
$newimg=imagecreate($nw,$nh);
imagecopyresized($newimg,$img,0,0,0,0,$nw,$nh,$ow,$oh);
imagejpeg($newimg, $p.$nn);
return true;
}

#thumbnail(filetouse,newwidth,newpath,newname);
thumbnail(images/maddy.jpg,100,/images/,t_maddy.jpg);
?

I now have php 4.3.2 and I get the error call to undefined function
imagecreatefromjpeg().  Isn't php4.3.2 compiled with the gd library or do I
have to do something explicitely to use it?

Thanks,
Eddie


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



[PHP] opendir(), readdir() question..

2003-05-30 Thread ef
Hi all,

How can i do for the moment i open and list all file there, display in the
browser the order of this files by name ?. I have this code:

?php
$handle=opendir('.');
while ($file = readdir($handle)) {
if ($file != .  $file != ..) {
echo $file\n;
}
}
closedir($handle);
?

And the result send to the browser, is the files, but witouth any order.

Thanks for reading, your help is greatly appreciated!

-- 
Esteban Fernández T.




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



Re: [PHP] imagecreatefromjpeg()

2003-05-30 Thread Steve Keller
At 5/29/2003 01:55 PM, Edward Peloke wrote:

 Isn't php4.3.2 compiled with the gd library

Not necessarily. Run a phpinfo() and look in the configuration for --with-gd.



--
S. Keller
UI Engineer
The Health TV Channel, Inc.
(a non - profit organization)
3820 Lake Otis Pkwy.
Anchorage, AK 99508
907.770.6200 ext.220
907.336.6205 (fax)
Email: [EMAIL PROTECTED]
Web: www.healthtvchannel.org
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] imagecreatefromjpeg()

2003-05-30 Thread Steve Keller
At 5/29/2003 01:55 PM, Edward Peloke wrote:

 I now have php 4.3.2

I'm sorry, I read the version wrong. Feel free to ignore me.

--
S. Keller
UI Engineer
The Health TV Channel, Inc.
(a non - profit organization)
3820 Lake Otis Pkwy.
Anchorage, AK 99508
907.770.6200 ext.220
907.336.6205 (fax)
Email: [EMAIL PROTECTED]
Web: www.healthtvchannel.org
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


RE: [PHP] Re: PHP OOP x Procedural Performance

2003-05-30 Thread Dan Joseph
Hi,

From my personal recent experience, I can tell you that processing a lot of
echo's thru classes is a heck of a lot slower than just doing it the normal
way.  Although I wouldn't have done this particular project any other way, I
do with that I could get it to display faster.  Its not a big deal, just
bugs me.  Its really personal preference though.

-Dan Joseph


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



[PHP] Opening a Dynamic Pop Up Window

2003-05-30 Thread Jeffrey L. Fitzgerald
	Help! :-)

	Have a need for a pop up window to show images when the thumbnail is 
clicked. But the script I found only shows the image and no background, 
etc. I want to be able to have the pop up open and then send it a php 
created dynamic page with the proper html and image.

	In perl I know how to do this, by calling a perl script, sending the 
filename variable and returning with a generated page. But I am not as 
familiar with PHP. Here is the script I found:

	http://www.ciarasprettygoodpictures.com/gallery.php

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


RE: [PHP] imagecreatefromjpeg()

2003-05-30 Thread Edward Peloke
would this still be in phpinfo?  I am running apache on windows and all I
did was move unzip the binaries to my php folder, then move the dll into my
windows system directory...phpinfo now displays version 4.3.2but maybe I
need to do more...I was using 4.2.x before I upgraded.

-Original Message-
From: Steve Keller [mailto:[EMAIL PROTECTED]
Sent: Thursday, May 29, 2003 2:24 PM
To: Edward Peloke; [EMAIL PROTECTED] Php. Net
Subject: Re: [PHP] imagecreatefromjpeg()


At 5/29/2003 01:55 PM, Edward Peloke wrote:

  I now have php 4.3.2

I'm sorry, I read the version wrong. Feel free to ignore me.

--
S. Keller
UI Engineer
The Health TV Channel, Inc.
(a non - profit organization)
3820 Lake Otis Pkwy.
Anchorage, AK 99508
907.770.6200 ext.220
907.336.6205 (fax)
Email: [EMAIL PROTECTED]
Web: www.healthtvchannel.org



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



[PHP] \n outputs \r\n ??

2003-05-30 Thread Michael Isaacs
Still new to PHP - any assistance would be very much appreciated...

I am using a php script to send info to a local file for mail filtering.
Whe the php script sends the following:

fputs($nf, MAILDIR=$MAILDIR # Default mail directory\n);

the output actually has a chr 13, 10

ProcMail interprest the CR as a part of the phrase it is using for parsing,
so when it goes to send a filter out to a folder (testing in my case) it
appends a CR to the end of it, which goofs up the user mail agent.  It also
goofs up the filter itself, as it is looking for a CR in the criteria.

Is there a way to force it to only output a LF, not CRLF?  Configuration
issue?

Michael Isaacs



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



[PHP] Best Approach for defining User Access Levels

2003-05-30 Thread Monty
Hi. I've set up a membership site that has different levels of users. Each
member's DB record has a user_status field that has a number from 1-9, 9
being the highest (Admin) level of access. This has worked okay, but, I'm
finding this system of granting access too limiting, and need finer control
over who has access to what.

Does anyone know of a better system for granting access to groups of users
that isn't too complicated but is flexible enough to add or remove access to
whole groups of users? I'm trying to not reinvent the wheel here if
possible.

Thanks for any suggestions!

Monty


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



RE: [PHP] imagecreatefromjpeg()

2003-05-30 Thread Edward Peloke
Nevermind, I got it working with a few ini changes...


Thanks,
Eddie

-Original Message-
From: Steve Keller [mailto:[EMAIL PROTECTED]
Sent: Thursday, May 29, 2003 2:24 PM
To: Edward Peloke; [EMAIL PROTECTED] Php. Net
Subject: Re: [PHP] imagecreatefromjpeg()


At 5/29/2003 01:55 PM, Edward Peloke wrote:

  I now have php 4.3.2

I'm sorry, I read the version wrong. Feel free to ignore me.

--
S. Keller
UI Engineer
The Health TV Channel, Inc.
(a non - profit organization)
3820 Lake Otis Pkwy.
Anchorage, AK 99508
907.770.6200 ext.220
907.336.6205 (fax)
Email: [EMAIL PROTECTED]
Web: www.healthtvchannel.org



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



[PHP] Re: opendir(), readdir() question..

2003-05-30 Thread Catalin Trifu
Hi,

You could put them into an array and sort the array.

cheers,
Catalin

Ef [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 Hi all,

 How can i do for the moment i open and list all file there, display in the
 browser the order of this files by name ?. I have this code:

 ?php
 $handle=opendir('.');
 while ($file = readdir($handle)) {
 if ($file != .  $file != ..) {
 echo $file\n;
 }
 }
 closedir($handle);
 ?

 And the result send to the browser, is the files, but witouth any order.

 Thanks for reading, your help is greatly appreciated!

 --
 Esteban Fernández T.






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



[PHP] Re: \n outputs \r\n ??

2003-05-30 Thread Catalin Trifu
Hi,

If indeed \n puts CRLF pairs, which i doubt,
you can use the hex code for LF which is 0x0A
istead.

Cheers,
Catalin

Michael Isaacs [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 Still new to PHP - any assistance would be very much appreciated...

 I am using a php script to send info to a local file for mail filtering.
 Whe the php script sends the following:

 fputs($nf, MAILDIR=$MAILDIR # Default mail directory\n);

 the output actually has a chr 13, 10

 ProcMail interprest the CR as a part of the phrase it is using for
parsing,
 so when it goes to send a filter out to a folder (testing in my case) it
 appends a CR to the end of it, which goofs up the user mail agent.  It
also
 goofs up the filter itself, as it is looking for a CR in the criteria.

 Is there a way to force it to only output a LF, not CRLF?  Configuration
 issue?

 Michael Isaacs






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



[PHP] Re: Can we use one PHP.INI directive to set the other?

2003-05-30 Thread Catalin Trifu
Hi,

Simply put: it doesn't work; you have to put it by hand there,
or use the ini_set function in all PHP scripts you need.

Cheers,
Catalin


Ananth Kesari [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 Hi,

 Can we use one PHP.INI directive to set the other?

 What I mean is like this:

 Let's say I have:
 upload_tmp_dir = sys:/php/temp
 in the PHP.INI file.

 Now I want to set the same value into the open_basedir directive like:
 open_basedir = .;sys:/php/temp

 Here, I do not want to hard code sys:/ptp/temp, but I want this
 to be read off from the upload_tmp_dir directive of PHP.INI file.
 Something to this effect:
 open_basedir = .;$upload_tmp_dir

 The above doesn't work.

 Can something like this be done and if yes, how?

 Thanks,
 Ananth.




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



RE: [PHP] imagecreatefromjpeg()

2003-05-30 Thread Steve Keller
At 5/29/2003 02:42 PM, Edward Peloke wrote:

 Nevermind, I got it working with a few ini changes...

All rightee. Glad I could help.

--
S. Keller
UI Engineer
The Health TV Channel, Inc.
(a non - profit organization)
3820 Lake Otis Pkwy.
Anchorage, AK 99508
907.770.6200 ext.220
907.336.6205 (fax)
Email: [EMAIL PROTECTED]
Web: www.healthtvchannel.org
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Ebay Cookie? Login Help w/ Script

2003-05-30 Thread sevenfiftyflat
Hello All!

I hope someone can give me some good advice,

I'm trying to write a PHP script to make it easy for me to do my ebay
auctions, and I'm having problems dealing with the Cookies at Signin.

I _BELIEVE_ ( but I'm not sure ) that the problem is all about the
cookies.

I forget what site I found this script, but it's close, it'll show the
'Welcome to ebay' login screen, but you're not _actually_ logged in.  

I _think_ that ebay signs you in, and rechecks for the cookie, but can't
find it, and then signs you right out.

I'm not sure, any help would be great, thanks!

HTML
BODY BGCOLOR=#FF TEXT=#00
?php

$useragent = 'Mozilla/4.0 (compatible; MSIE 6.01; Windows NT 5.0)'; 
$ch = curl_init('http://cgi3.ebay.com/aw-cgi/eBayISAPI.dll'); 
$cookiefile = 'cookie.txt'; 
// IS it the name of the cookie??  This cookie usually ends in up your
Apache system dir.

$uid=USERID;
$pss=PASSWORD;

curl_setopt($ch, CURLOPT_HEADER, 1); 
curl_setopt($ch, CURLOPT_VERBOSE, 1); 
curl_setopt($ch, CURLOPT_USERAGENT, $useragent); 
curl_setopt($ch, CURLOPT_COOKIEJAR, $cookiefile); 
curl_setopt($ch, CURLOPT_COOKIEFILE, $cookiefile); 
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1); 
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); 
curl_setopt($ch,
CURLOPT_URL,http://cgi3.ebay.com/aw-cgi/eBayISAPI.dll;); 
curl_setopt($ch, CURLOPT_POST, 1); 
curl_setopt($ch, CURLOPT_POSTFIELDS,
MfcISAPICommand=SignInWelcomeuserid=$uidpass=$psskeepMeSignInOption=
1); 

//Maybe the problem is in the way the POST fields are posted to.
//I'm very new to CURL!

$page = curl_exec($ch); // execute the curl command 

echo pre$pageBRBRCURL infoBR; 

print_r(curl_getinfo($ch));

curl_close($ch); 
print BRBRSERVER infoBR;
print_r($_SERVER);
print BRBR Cookie infoBR;
print_r($_COOKIE);

//include(http://cgi5.ebay.com/ws1/eBayISAPI.dll?ListItemForSale;);

?

/BODY
/HTML



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



[PHP] Re: Opening a Dynamic Pop Up Window

2003-05-30 Thread Monty
This should be fairly easy. It sounds like the script you are using is
opening only the image in a new window, and not a page that loads the image
in a new window.

Just add some Javascript to the links around your thumbnails, like this:

a href=javascript:window.open('show_photo.php?img=image.jpg');

Then you need to create a script called show_photo.php that takes the img
var passed by the Javascript above and loads that image onto the page.

$image = $_GET['img'];

echo img src='$image' border=0;

Hope that helps.

Monty

 From: [EMAIL PROTECTED] (Jeffrey L. Fitzgerald)
 Newsgroups: php.general
 Date: Thu, 29 May 2003 14:28:11 -0400
 To: [EMAIL PROTECTED]
 Cc: [EMAIL PROTECTED]
 Subject: Opening a Dynamic Pop Up Window
 
 
 Help! :-)
 
 Have a need for a pop up window to show images when the thumbnail is
 clicked. But the script I found only shows the image and no background,
 etc. I want to be able to have the pop up open and then send it a php
 created dynamic page with the proper html and image.
 
 In perl I know how to do this, by calling a perl script, sending the
 filename variable and returning with a generated page. But I am not as
 familiar with PHP. Here is the script I found:
 
 http://www.ciarasprettygoodpictures.com/gallery.php
 


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



[PHP] request

2003-05-30 Thread Marius
?
$random = gmp_random(10);
echo $random;
?
how to do that it echoes a random number and not a
Resource id #1,
  

-- 
 Marius
 [EMAIL PROTECTED]



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



Re: [PHP] request

2003-05-30 Thread Weston Houghton
I would imagine that you have to add:
$random = gmp_strval($random);
In between the two lines to convert the resource to a string value.

Wes

On Thursday, May 29, 2003, at 04:24  PM, Marius wrote:

?
$random = gmp_random(10);
echo $random;
?
how to do that it echoes a random number and not a
Resource id #1,
--
 Marius
 [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] sound

2003-05-30 Thread Bobby
Does anybody know of a way under php to add a background sound to a
webpage...i have sound on my page when it's local but as soon as I copy
it to the server, nothing :(
thanks

-bobby
Bobby Brooks
[EMAIL PROTECTED]  http://bobby-brooks.com
Public Key = bobby-brooks.com/pubring.pkr

Simulated disorder postulates perfect discipline; simulated fear
postulates courage; simulated weakness postulates strength.
Sun Tzu - The Art of War (Chap 5-17)

ICQ-33647303 AOL_IM-TX Copenhagen
Yahoo-tx_copenhagen1977  [EMAIL PROTECTED]



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



Re: [PHP] sound

2003-05-30 Thread Jordan S. Jones
Have you copied the sound file to your server as well?

Jordan

Bobby wrote:

Does anybody know of a way under php to add a background sound to a
webpage...i have sound on my page when it's local but as soon as I copy
it to the server, nothing :(
thanks
-bobby
Bobby Brooks
[EMAIL PROTECTED]  http://bobby-brooks.com
Public Key = bobby-brooks.com/pubring.pkr
Simulated disorder postulates perfect discipline; simulated fear
postulates courage; simulated weakness postulates strength.
Sun Tzu - The Art of War (Chap 5-17)
ICQ-33647303 AOL_IM-TX Copenhagen
Yahoo-tx_copenhagen1977  [EMAIL PROTECTED]


 



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


RE: [PHP] sound

2003-05-30 Thread Julien Wadin
Php is on the server, not on the local client
You can make it with Flash

-Message d'origine-
De : Bobby [mailto:[EMAIL PROTECTED]
Envoyé : jeudi 29 mai 2003 21:39
À : [EMAIL PROTECTED]
Objet : [PHP] sound


Does anybody know of a way under php to add a background sound to a
webpage...i have sound on my page when it's local but as soon as I copy
it to the server, nothing :(
thanks

-bobby
Bobby Brooks
[EMAIL PROTECTED]  http://bobby-brooks.com
Public Key = bobby-brooks.com/pubring.pkr

Simulated disorder postulates perfect discipline; simulated fear
postulates courage; simulated weakness postulates strength.
Sun Tzu - The Art of War (Chap 5-17)

ICQ-33647303 AOL_IM-TX Copenhagen
Yahoo-tx_copenhagen1977  [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] sound

2003-05-30 Thread Bobby
I know that...i'm just curious if somebody knows of a bit of php code
outside of the usual html embed src and background tags for sound on a
webpage...and I'm trying to avoid having to add flash unless I have
to...but yes that is an option
Thanks
-bobby

 -Original Message-
 From: Julien Wadin [mailto:[EMAIL PROTECTED]
 Sent: Thursday, May 29, 2003 9:40 PM
 To: [EMAIL PROTECTED]
 Cc: [EMAIL PROTECTED]
 Subject: RE: [PHP] sound


 Php is on the server, not on the local client
 You can make it with Flash

 -Message d'origine-
 De : Bobby [mailto:[EMAIL PROTECTED]
 Envoyé : jeudi 29 mai 2003 21:39
 À : [EMAIL PROTECTED]
 Objet : [PHP] sound


 Does anybody know of a way under php to add a background
 sound to a webpage...i have sound on my page when it's local
 but as soon as I copy it to the server, nothing :( thanks

 -bobby
 Bobby Brooks
 [EMAIL PROTECTED]  http://bobby-brooks.com
 Public Key = bobby-brooks.com/pubring.pkr

 Simulated disorder postulates perfect discipline; simulated
 fear postulates courage; simulated weakness postulates
 strength. Sun Tzu - The Art of War (Chap 5-17)

 ICQ-33647303 AOL_IM-TX Copenhagen
 Yahoo-tx_copenhagen1977  [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] Structered or Object Oriented?

2003-05-30 Thread Rey Segundo Guerrero Proenza
Hi:

On Thu, 29 May 2003, Jaime Diaz wrote:

 I would like to know wich is the best way to program in PHP, is it OO or
 structured, because I red in a book that if I program in OO PHP the
 performance of the page is slower than programming it in structured.
 But if i have a big web site isn´t it better to program Object Oriented.

Partially this question has been discussed today under the subject:  PHP OOP x 
Procedural
Performance.

As a result, it looks to be no differences in the most of cases, but of course, it is
multifactorial depending problem, and more detailed analysis is needed.

-- 
Regards,

Prof. Rey Segundo Guerrero Proenza
  Dpto Computación Universidad de Granma
  Bayamo Cuba
  http://www.geocities.com/reysgp/



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



RE: [PHP] sound

2003-05-30 Thread Brian S. Drexler
Negative.  Sounds are client side, PHP is server side.

-Original Message-
From: Bobby [mailto:[EMAIL PROTECTED]
Sent: Thursday, May 29, 2003 3:45 PM
To: [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Subject: RE: [PHP] sound


I know that...i'm just curious if somebody knows of a bit of php code
outside of the usual html embed src and background tags for sound on a
webpage...and I'm trying to avoid having to add flash unless I have
to...but yes that is an option
Thanks
-bobby

 -Original Message-
 From: Julien Wadin [mailto:[EMAIL PROTECTED]
 Sent: Thursday, May 29, 2003 9:40 PM
 To: [EMAIL PROTECTED]
 Cc: [EMAIL PROTECTED]
 Subject: RE: [PHP] sound


 Php is on the server, not on the local client
 You can make it with Flash

 -Message d'origine-
 De : Bobby [mailto:[EMAIL PROTECTED]
 Envoyé : jeudi 29 mai 2003 21:39
 À : [EMAIL PROTECTED]
 Objet : [PHP] sound


 Does anybody know of a way under php to add a background
 sound to a webpage...i have sound on my page when it's local
 but as soon as I copy it to the server, nothing :( thanks

 -bobby
 Bobby Brooks
 [EMAIL PROTECTED]  http://bobby-brooks.com
 Public Key = bobby-brooks.com/pubring.pkr

 Simulated disorder postulates perfect discipline; simulated
 fear postulates courage; simulated weakness postulates
 strength. Sun Tzu - The Art of War (Chap 5-17)

 ICQ-33647303 AOL_IM-TX Copenhagen
 Yahoo-tx_copenhagen1977  [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] sound

2003-05-30 Thread Alex Earl
I'm guessing perhaps you didn't upload the sound to the server when you
uploaded the webpage?

Slide

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



Re: [PHP] Decrypting data with GnuPG

2003-05-30 Thread Evan Nemerson
Are you appending a newline to your passphrase?

$passphrase = my gnupg passphrase\n;



On Thursday 29 May 2003 06:56 am, you wrote:
  From the GnuPG docs:

 --passphrase-fd n

  Read the passphrase from file descriptor n. If you use 0 for n, the
 passphrase will be read from stdin. This can only be used if only one
 passphrase is supplied. Don't use this option if you can avoid it.

 I added --passphrase-fd 0 to my command so the passphrase should
 normally be read from stdin (according to the docs), but it still does
 not work. Any idea? I am unfortunately not familiar with C code, so I
 can difficultly find solutions to my problems by reading the GnuPG source.

 Thanks!

 Pierre-Luc

 Evan Nemerson wrote:
  GnuPG doesn't use stdin to read the password, which is where you're
  sending it. It uses a more low-level interface (check out the below link
  if you're interested) where they interact directly with the virtual
  console.
 
  Try piping to your command- that won't work either
 
  echo $PASSPHRASE | \
  /usr/bin/gpg \
  --homedir=/path/to/.gnupg \
  --no-secmem-warning \
  --always-trust \
  --yes \
  --output /path/to/output.txt \
  --decrypt /path/to/testtext.asc
 
  GnuPG source code for TTY I/O:
  http://cvs.gnupg.org/cgi-bin/viewcvs.cgi/*checkout*/gnupg/util/ttyio.c?re
 v=1.28content-type=text/plain
 
  On Wed, 2003-05-28 at 16:14, Pierre-Luc Soucy wrote:
 Hi,
 
 I would like to decrypt data encoded with GnuPG without including the
 private key passphrase in the command to prevent people from viewing it
 with ps.
 
 Here is the code I wrote:
 
 
 $command = /usr/bin/gpg --homedir=/path/to/.gnupg --no-secmem-warning
 --always-trust --yes --output /path/to/output.txt --decrypt
 /path/to/testtext.asc;
 $passphrase = '***';
 
 $fp = popen($command, 'w+');
 fputs($fp, $passphrase);
 pclose($fp);
 
 print Done;
 exit;
 ==
 
 I assumed that the fputs() function would write the passphrase at the
 prompt, but that doesn't seem to be the case - the command does not
 create the output.txt file when ran by the PHP program (which is running
 as a CGI under my user BTW) while it works when ran from the shell.
 
 Any idea why?
 
 Thanks!
 
 Pierre-Luc Soucy

-- 

Cats are intended to teach us that not everything in nature has a function.

-Garrison Keillor


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



Re: [PHP] request

2003-05-30 Thread Evan Nemerson
?php echo $random = gmp_intval(gmp_random(10)); ?


On Thursday 29 May 2003 01:24 pm, Marius wrote:
 ?
 $random = gmp_random(10);
 echo $random;
 ?
 how to do that it echoes a random number and not a
 Resource id #1,

-- 

Happy shall he be, that taketh and dasheth thy little ones against the stones.

-Psalms 137:9


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



Re: [PHP] Decrypting data with GnuPG

2003-05-30 Thread Pierre-Luc Soucy
I just tried, but that didn't correct the problem - the output.txt file 
is still not generated:

?
$command = /usr/bin/gpg --homedir=/path/to/homedir/.gnupg 
--no-secmem-warning --passphrase-fd 0 --always-trust --yes --output 
/path/to/homedir/.gpgkeys/temp/output.txt --decrypt 
/path/to/homedir/.gpgkeys/temp/testtext.asc;
$passphrase = 'MY_PASSPHRASE'.\n;

$fp = popen($command, 'w+');
fputs($fp, $passphrase);
fputs($fp, $passphrase);
pclose($fp);
print Done;
exit;
?
Regards,

Pierre-Luc

Evan Nemerson wrote:
Are you appending a newline to your passphrase?

$passphrase = my gnupg passphrase\n;



On Thursday 29 May 2003 06:56 am, you wrote:

From the GnuPG docs:

--passphrase-fd n

Read the passphrase from file descriptor n. If you use 0 for n, the
passphrase will be read from stdin. This can only be used if only one
passphrase is supplied. Don't use this option if you can avoid it.
I added --passphrase-fd 0 to my command so the passphrase should
normally be read from stdin (according to the docs), but it still does
not work. Any idea? I am unfortunately not familiar with C code, so I
can difficultly find solutions to my problems by reading the GnuPG source.
Thanks!

Pierre-Luc

Evan Nemerson wrote:

GnuPG doesn't use stdin to read the password, which is where you're
sending it. It uses a more low-level interface (check out the below link
if you're interested) where they interact directly with the virtual
console.
Try piping to your command- that won't work either

echo $PASSPHRASE | \
/usr/bin/gpg \
--homedir=/path/to/.gnupg \
--no-secmem-warning \
--always-trust \
--yes \
--output /path/to/output.txt \
--decrypt /path/to/testtext.asc
GnuPG source code for TTY I/O:
http://cvs.gnupg.org/cgi-bin/viewcvs.cgi/*checkout*/gnupg/util/ttyio.c?re
v=1.28content-type=text/plain
On Wed, 2003-05-28 at 16:14, Pierre-Luc Soucy wrote:

Hi,

I would like to decrypt data encoded with GnuPG without including the
private key passphrase in the command to prevent people from viewing it
with ps.
Here is the code I wrote:


$command = /usr/bin/gpg --homedir=/path/to/.gnupg --no-secmem-warning
--always-trust --yes --output /path/to/output.txt --decrypt
/path/to/testtext.asc;
$passphrase = '***';
$fp = popen($command, 'w+');
fputs($fp, $passphrase);
pclose($fp);
print Done;
exit;
==
I assumed that the fputs() function would write the passphrase at the
prompt, but that doesn't seem to be the case - the command does not
create the output.txt file when ran by the PHP program (which is running
as a CGI under my user BTW) while it works when ran from the shell.
Any idea why?

Thanks!

Pierre-Luc Soucy




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


[PHP] e-mailing with attachements

2003-05-30 Thread Artoo Smith
How do you send attachments when sending e-mail uisng the mail() command?

Thanks



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



[PHP] Re: Variables don't pass... *sniff*

2003-05-30 Thread George Whiffen
Daniel,

Switch register_globals back on, and everything works as it always did. 
 So do it!

All this fuss about register_globals being insecure is a complete load 
of rubbish. This issue really bores me, but it seems programmers are 
wasting a lot of time on it, so I guess I'd better run through the 
arguments one more time...

1. You can never know whether the input to your script came from a real 
GET, a COOKIE, or a POST.  It's very easy to create a simulated GET, 
COOKIE or POST.  You don't even need a programming language if you've 
got the right tools.  Even with php, (hardly a typical hacking tool), 
it's only a few lines of code.

2. That means that checking to make sure a variable was specifically a 
GET, COOKIE or POST variable has no security value whatsoever.

3. On the other hand, not worrying about how your script got its request 
variables (i.e. register globals is on) is intrinsically sound 
programming practice.  Your code should work and your logic should be 
sound regardless of what happened before your script got executed.  It's 
one of the great advantages of the internet. For example, on searches, 
you can have exactly the same search code and results page driven from a 
search form, or a link on another page, or a remote http request.  You 
code once, but your code can be used in many different ways.

4. In any case, register globals off only protects the sloppy programmer 
from the sloppy hacker. It doesn't stop the good programmer from being 
as cautious as they like.  You can already control the order in which 
variables are registered e.g. to make POST variables always override 
COOKIES or vice versa.  And, you can, if you really need to, 
double-check with the global variables, HTTP_POST_VARS etc.

5. When it comes to access control, (which seems to be where the bogus 
security argument starts), there is only one safe approach.  That is to 
require that a valid username and password are supplied with every 
request and then check them in every script. It's not hard, it doesn't 
take long and it's the proper way to do it.  There's a whole section of 
the http protocol, http authentication, which is designed precisely to 
make this easy.

But hey, don't worry about all this guff.  Just switch register globals 
back on.  If your system administrator/ISP won't let you, just refer 
them to this mail and tell them I'd be happy to explain anything they 
don't get.

Keep it simple!

George

[EMAIL PROTECTED] wrote:
Hi all!

I'm using Apache 2.0.45, PHP 4.3.2RC4, and MySQL 3.23.49 on Windows 2003
Server Standard.
I have a problem passing variables between pages. They simply get lost.
Neither GET nor POST pass values, and even hardcoding them into the URL,
like
htpp://localhost/comeon.php?aVariable=dinganotherVariable=dong

and putting this in comeon.php:

echo(Values: $aVariable, $anotherVariable);

only outputs

Values: ,

...I've tried with RC3 of PHP, even 4.3.1, but it doesn't work. I've used
PHP on my machine with Apache 2 before, and it worked fine. Actually I used
the same scripts fine on my old config. This was on XP however, so I'm not
sure if it's got something to do with the OS. I'm hoping it's a
configuration issue.
Any ideas are VERY much appreciated =).

Thanks,
Daniel
» There are 10 kinds of people - those who know binary and those who don't.
«


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


Re: [PHP] e-mailing with attachements

2003-05-30 Thread Ernest E Vogelsinger
At 23:20 29.05.2003, Artoo Smith said:
[snip]
How do you send attachments when sending e-mail uisng the mail() command?
[snip] 

If you want to use the builtin mail() function you gotta construct the
complete MIME compliant message, including all headers, yourself. For more
information on MIME you should consult RFC822.

Do yourself a favour and check out the relevant PEAR classes (Mail/Mime and
Mail). http://pear.php.net/packages.php?catpid=14catname=Mail. Performs
just great ;-)


-- 
   O Ernest E. Vogelsinger
   (\)ICQ #13394035
^ http://www.vogelsinger.at/



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



[PHP] Variables not being past

2003-05-30 Thread The Doctor
Questions,  I have a 
cusotmer using a basic username and password 
verifier on a php Web Page.

This was working and suddenly with I redefined the php environment,
the php variables are not getting passed on.

why?

-- 
Member - Liberal International  On 11 Sept 2001 the WORLD was violated.
This is [EMAIL PROTECTED]   Ici [EMAIL PROTECTED]
Society MUST be saved! Extremists must dissolve.  
Arsenal Winners of  the FA CUp 2003!

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



  1   2   >