Re: [PHP] Single Quote in String functions

2007-07-12 Thread Richard Lynch
On Thu, July 12, 2007 7:02 am, Sancar Saran wrote:

> I cannot do any operation wiht single quote like
>
> explode("'",$strContent);
>
> Did I miss someting ?

Works for me, so you've definitely missed something somewhere.

Like telling us what's in $strContent and whatever else is before the
code that you think is broken, but isn't, because that code that came
before this code is what's really broken.

-- 
Some people have a "gift" link here.
Know what I want?
I want you to buy a CD from some indie artist.
http://cdbaby.com/browse/from/lynch
Yeah, I get a buck. So?

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



Re: [PHP] need a form for connecting to paypal payment pro.

2007-07-12 Thread Richard Lynch
On Thu, July 12, 2007 7:33 am, Ross wrote:

> I need a secure form. I have one here
> http://www.edinburghnights.co.uk/pay/php/curl_https.html but it has no
> algorithm check on the CC number. Also I need to make the form secure.
> Can
> someone point me to an example or tutorial.

To make the form "secure" in regards to internet transmission, you
need to install OpenSSL (or other SSL implementation) and buy an SSL
Certificate from a reputable CA (e.g., Verisign/Thawte...)

Well, okay, technically, you can generate a free one for yourself, and
it's just as secure in the transmission, but the browser pops up a
nasty warning to the users that they are doing something insecure
(i.e., trusting you even though you haven't paid the $200 for a
background check to get a Cert) and you almost for sure don't want
that.

The algorithm to check the validity of a CC number can be found in
Google so easily, I refuse to even answer that one. :-)

"credit card number validity checksum algorithm" ought to get you the
results you want.

-- 
Some people have a "gift" link here.
Know what I want?
I want you to buy a CD from some indie artist.
http://cdbaby.com/browse/from/lynch
Yeah, I get a buck. So?

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



Re: [PHP] Help setting up php

2007-07-12 Thread Richard Lynch
On Thu, July 12, 2007 8:25 am, Karl Schmitt wrote:
> Can someone please help me?
>
> I am new to installing and working with php and webservers.  I am
> using
> IIS 6.
>
> I can not get php to load the ini file.

This line:
Configuration File (php.ini) Path   C:\WINDOWS

tells you that PHP *looked* for the php.ini file in:
C:\WINDOWS

However, it did not FIND php.ini there, as there is no php.ini on the
path name shown.

Therefore, PHP just used the default default values for everything.

You need to copy the php.ini-recommended to C:\WINDOWS and name it
php.ini

You'll then need to restart Apache, errr, IIS, which probably means
reboot the whole machine, knowing Microsoft. :-)

-- 
Some people have a "gift" link here.
Know what I want?
I want you to buy a CD from some indie artist.
http://cdbaby.com/browse/from/lynch
Yeah, I get a buck. So?

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



Re: [PHP] can't open file

2007-07-12 Thread Richard Lynch
On Thu, July 12, 2007 11:10 am, Anugrah Widya wrote:
> dear php developer,
>
> i have weird situation here, i can't create a file in 777 mode
> directory
> and stay in same server, is this a bug ??
>
> fyi. i'm using fc6, and php 5.1.6

Show us code.

It's almost for sure not a PHP bug, whatever it is you are saying.

-- 
Some people have a "gift" link here.
Know what I want?
I want you to buy a CD from some indie artist.
http://cdbaby.com/browse/from/lynch
Yeah, I get a buck. So?

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



Re: [PHP] can't open file

2007-07-12 Thread Richard Lynch
On Thu, July 12, 2007 11:30 am, Anugrah Widya wrote:
> Stut wrote:
>> Anugrah Widya wrote:
>>> dear php developer,
>>>
>>> i have weird situation here, i can't create a file in 777 mode
>>> directory and stay in same server, is this a bug ??
>>>
>>> fyi. i'm using fc6, and php 5.1.6
>>
>> I'm not sure I understand what the problem is. Please post the code
>> you're using and a more detailed description of what you're trying
>> to
>> achieve and what's actually happening.
>>
>> -Stut
>>
> here the situation is, i have two domain (two website), and both stay
> in
> same server, and use same php
>
> Website A -> /var/www/html/A
> Website B -> /var/www/html/B
>
> website A would like to create some  file in website B, in
> /var/www/html/B/var/tmp/queue, and that map is in 777 mode created by
> script
>
> what i got is the fopen() won't succeed to create the file in website
> B
>
> but if i test to write into /var/www/html/A/var/tmp/queue in website A
> admin it succeed
>
> is it because of some configuration in php.ini i didn't activate or
> what ??

If it's not safe_mode as Stut suggests, it's also possible that the
PHP user (probably Apache User) does not have permission to write into
/var/www/html/B/var/tmp/queue, regardless of whether you are in A or
B.

It's also remotely possible that your server is running two (or more)
pools of Apache servers, one for each of A and B (and others) and A
can write to A dir and B can write to B dir, because each is running
as a different user.

Or, you could be using php_suexec or fast cgi to achieve a similar
effect...

Basically, this is going to boil down to:

PHP us running as User X.

User X does not have permission to write to dir B.

The permission could be foiled by PHP with safe_mode, or could be
built into the permissions on the directories with chmod.

So if it's not safe_mode, mess around with "ls -als" on the directory,
and use phpinfo() or http://php.net/get_current_user to figure out who
you are, and then it should be pretty clear who can/can't write to
that directory and why it's not working.

-- 
Some people have a "gift" link here.
Know what I want?
I want you to buy a CD from some indie artist.
http://cdbaby.com/browse/from/lynch
Yeah, I get a buck. So?

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



Re: [PHP] mail function from and reply to address problem

2007-07-12 Thread Chris

Richard Lynch wrote:

On Thu, July 12, 2007 6:33 pm, Tanner Postert wrote:

I am currently running

PHP 5.1.4
Fedora Core 5

i'm trying to exectute the following test script.




You really ought to be getting the return value from mail() and
checking it for success...

Error-checking is good. :-)


i have about 10 or so different virtual hosts running on this machine,
and
if i use any of them for the from & reply-to addresses, it works fine,
or
even if i use domains I don't control like aol.com or example.com
those work
too, but one particular new virtual host doesn't work, it re-writes
the from
address to the default virtual host address. which is strange because
that
isn't in the php.ini anywhere, but it could just be taking the
hostname.

anyone have any ideas?


As I understand it:

If the PHP (read: Apache) User is not "trusted" in sendmail config,
then sendmail won't let that user forge the return headers, and the
return comes from the default set in sendmail configuration.


Which is mentioned in the documentation:

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

;)

Sendmail and exim definitely have this sort of problem, I don't think 
postfix or qmail do though.


--
Postgresql & php tutorials
http://www.designmagick.com/

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



Re: [PHP] Re: Displaying HTML characters in real format

2007-07-12 Thread Richard Lynch
On Thu, July 12, 2007 6:08 pm, Dan wrote:
> string htmlentities ( string $string [, int $quote_style [, string
> $charset
> [, bool $double_encode]]] )
>
> This function is identical to htmlspecialchars() in all ways, except
> with
> htmlentities(), all characters which have HTML character entity
> equivalents
> are translated into these entities.
>
> This means that if there's an HTML equivelant it will translate into
> that.
> For example.  ' and " don't have HTML equivelants, it is ',
> anything
> with a #number won't get translated.  With htmlspecialchars it will.

I think you've managed to confuse more than you've explained...

" does have an HTML equivalent, it's "

htmlspecialchars and htmlentities do the same thing to ", they turn it
into " so it can be displayed as CONTENT in a webpage instead of
possibly being mistaken for CODE.

Both functions will also do exactly the same thing for < > & as well: 
Convert them to < > & respectively.

htmlentities will ALSO convert every other goofy character into an
HTML Equivalent, so it is safe to spew out to a browser, so the
browser will know it's CONTENT and not CODE.

htmlspecialchars will do NO conversion on anything but those special
four chars, so is not save to apply unless you somehow magically
"know" that the data contains no HTML-specific characters other than
those four...

IOW, htmlspecialchars is probably not real useful for general everyday
PHP scripting, as it only escapes 4 our of a whole bunch of characters
that need escapgin.

htmlentities is irreplacable for general everyday PHP scripting,
because it escapes all of them.

-- 
Some people have a "gift" link here.
Know what I want?
I want you to buy a CD from some indie artist.
http://cdbaby.com/browse/from/lynch
Yeah, I get a buck. So?

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



Re: [PHP] Displaying HTML characters in real format

2007-07-12 Thread Richard Lynch
On Thu, July 12, 2007 12:37 pm, Don Don wrote:
> Am kind of confused between htmlspecialchars and htmlentities. I've
> got data  i need to display data on a page containing e.g. " but
> will like it to be displayed as "
>
> htmlspecialchars or htmlentities or page character set ?

htmlspecialchars ONLY escapes four characters: < > & "

htmlentities escapes ALL characters that need it

I honestly can think of no valid use for htmlspecialchars, to tell you
the truth...

There must be some use for it, though.

Put it this way:
Whatever data you have, it probably shouldn't contain HTML if you are
asking this question, so you probably should be using htmlentities to
escape everything and be safe.

If it DOES have HTML in it, and you want that HTML to get to the
browser, I'm concerned that you don't understand just how dangerous
that is...
http://phpsec.org/

-- 
Some people have a "gift" link here.
Know what I want?
I want you to buy a CD from some indie artist.
http://cdbaby.com/browse/from/lynch
Yeah, I get a buck. So?

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



Re: [PHP] About PHP/XML/XSLT/MYSQL Web Sites

2007-07-12 Thread Richard Lynch
On Fri, July 13, 2007 12:19 am, Nathan Nobbe wrote:
> thing as i mentioned before is i cannot see a reason to create xml
> data while processing a GET or POST request from a client; it would
> just be
> an extra step with no apparent benefit as far as i can tell.

You DEFINITELY are not being nearly paranoid enough!

Don't write another line of code or draw another diagram until you've
realized the sheer fallacy of the above statement.

:-)

-- 
Some people have a "gift" link here.
Know what I want?
I want you to buy a CD from some indie artist.
http://cdbaby.com/browse/from/lynch
Yeah, I get a buck. So?

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



Re: [PHP] About PHP/XML/XSLT/MYSQL Web Sites

2007-07-12 Thread Richard Lynch
On Thu, July 12, 2007 4:15 pm, Kelvin Park wrote:
> I'm trying to setup a XSLT based web site.
> I wasn't exactly sure about the flow of the whole system when data
> from
> relational database is transferred to XML and in turn the data
> inputted
> from the user is relayed back to the database through XML (or directly
> to the database with PHP DB connection). I built a flowchart
> illustrating what the flow of the XSLT/PHP/MYSQL system might be like.
> If you think it's the wrong way or an inefficient way of getting user
> inputted data back to mysql, I would appreciate any comments.
> If you cannot download the PDF file, you can bring it up with direct
> address the the file: http://www.envigan.net/CMSFLOW.pdf

Maybe you already know this, and it's too detail oriented to be in
your diagram.  Maybe not.

Filter Input; Escape Output

Escape output is pretty easy:

Right before you cram it into MySQL, put it into another variable with
mysql_real_escape_string() called on it first, and put THAT into
MySQL, not the original.

Right before you spew it to a browser, call htmlentities() on it, and
use THAT to go out to the browser, not the original.

Filter Input is a bit tougher...

It basically boils down to:

Trust no one.
Validate everything.

If you aren't already paranoid, nor even not paranoid enough, start
reading here:
http://phpsec.org/

-- 
Some people have a "gift" link here.
Know what I want?
I want you to buy a CD from some indie artist.
http://cdbaby.com/browse/from/lynch
Yeah, I get a buck. So?

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



Re: [PHP] mail function from and reply to address problem

2007-07-12 Thread Richard Lynch
On Thu, July 12, 2007 6:33 pm, Tanner Postert wrote:
> I am currently running
>
> PHP 5.1.4
> Fedora Core 5
>
> i'm trying to exectute the following test script.
>
>  $to  = '[EMAIL PROTECTED]';
> $subject = 'the subject';
> $message = 'body';
> $headers = 'From: [EMAIL PROTECTED]' . "\r\n" .
> 'Reply-To: [EMAIL PROTECTED]' . "\r\n" .
> 'X-Mailer: PHP/' . phpversion();
>
> mail($to, $subject, $message, $headers);
> ?>

You really ought to be getting the return value from mail() and
checking it for success...

Error-checking is good. :-)

> i have about 10 or so different virtual hosts running on this machine,
> and
> if i use any of them for the from & reply-to addresses, it works fine,
> or
> even if i use domains I don't control like aol.com or example.com
> those work
> too, but one particular new virtual host doesn't work, it re-writes
> the from
> address to the default virtual host address. which is strange because
> that
> isn't in the php.ini anywhere, but it could just be taking the
> hostname.
>
> anyone have any ideas?

As I understand it:

If the PHP (read: Apache) User is not "trusted" in sendmail config,
then sendmail won't let that user forge the return headers, and the
return comes from the default set in sendmail configuration.

Substitute postfix or whatever as appropriate for your configuration.

So you now have the joy of digging into sendmail configuration.

Good luck!

-- 
Some people have a "gift" link here.
Know what I want?
I want you to buy a CD from some indie artist.
http://cdbaby.com/browse/from/lynch
Yeah, I get a buck. So?

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



Re: [PHP] PHP short tags: Questions

2007-07-12 Thread Micky Hulse

Hey Richard, thanks for the reply. I appreciate it. :)

Richard Lynch wrote:

http://php.net/


Yikes! I guess it was one of those RTFM question/answers! Lol. :D


#2 sounds awfully bogus to me...


Yeah... Hmm, now I am starting to wonder where I heard/read that. Maybe 
it was a co-worker. I am glad I asked here for clarification.



1 and 3 sure ought to cover it though.


Yep yep. Sounds good to me. Good enough reasons to think twice about 
using short tags.


Also, FYI for those interested, a list member mentioned (off-list) that 
shorthand tags "are considered by many to be deprecated" and have been 
on the "verge of removal from the PHP language a few times in the past."


Interesting stuff. :)

Thanks again Richard and all.

Cheers,
Micky

--
Wishlists: 
   Switch: 
 BCC?: 
   My: 

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



Re: [PHP] SMS questions

2007-07-12 Thread Richard Lynch
On Thu, July 12, 2007 7:07 pm, Brian Dunning wrote:
> Here's another thing that would be nice: A web service to look up the
> carrier for a cell number. That way you could simply send an email to
> [EMAIL PROTECTED], though this would still be only a partial
> solution. This is a lot harder now that numbers are transportable
> between carriers.

If you have the service from the SMS vendors, you can lookup the
carrier for any number.

If there was a web service for it, you'd have a zillion more spammers
using those gateways to send text messages to random cell numbers.  Oh
joy.

> I was not able to find any service provider that makes the SMS
> messages appear to come from the sender's cell phone, so they could
> be replied to normally.

So you'll have to play postman and route things through your number.

Doesn't seem that onerous to me...

-- 
Some people have a "gift" link here.
Know what I want?
I want you to buy a CD from some indie artist.
http://cdbaby.com/browse/from/lynch
Yeah, I get a buck. So?

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



Re: [PHP] SMS questions

2007-07-12 Thread Richard Lynch
It's annoying as crap to work with them.

But if they were not so vigilant and picuyane, you know what we'd have?

A zillion spam phone messages ringing your cell day and night from all
kinds of idiots.

Do you really want that?

I sure don't.

Give them at least some credit for trying to be responsible, even if
it does stifle lot of potentially useful applications.

I'd give a lot of money to be able to teleport back in time and yell
at the email designer folks to tell them just how horrible a mess they
were making... :-)

On Thu, July 12, 2007 6:56 pm, Nathan Nobbe wrote:
> Brian,
>
> I was experimenting late last year using PHP to send SMS messages.  I
> think
> there is a
> lot of potential in the marketplace around SMS.  But most of the phone
> companies wouldnt
> even talk to me and all i was trying to do was hit a development API
> to test
> some code out.
> im almost certain you will have to go through a provider if you intend
> to
> have messages source #
> based upon a value you provide rather than a phone you own.
> i have already grown a deep hatred for telcos due to this exclusive
> club
> thing they have going.
> i will focus all my energy on any opportunity that arises to thwart
> them.
> good luck,
>
> -nathan
>
> On 7/12/07, Brian Dunning <[EMAIL PROTECTED]> wrote:
>>
>> Hi all - I've been looking at a number of the commercial service
>> providers for bulk SMS messaging, most of whom have PHP APIs. But
>> since they are selling something they don't answer my question
>>
>> Is there any (legal, legitimate) way to send an SMS message that can
>> be replied to the desired SMS cell number? Like, if I use PHP to
>> send
>> an SMS to Bob, can I make it appear to come from Jim's cell phone so
>> that Bob can reply directly to Jim normally? The services all
>> require
>> Jim to log into their web site to read any replies.
>>
>> --
>> PHP General Mailing List (http://www.php.net/)
>> To unsubscribe, visit: http://www.php.net/unsub.php
>>
>>
>


-- 
Some people have a "gift" link here.
Know what I want?
I want you to buy a CD from some indie artist.
http://cdbaby.com/browse/from/lynch
Yeah, I get a buck. So?

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



Re: [PHP] SMS questions

2007-07-12 Thread Richard Lynch
On Thu, July 12, 2007 6:39 pm, Brian Dunning wrote:
> Hi all - I've been looking at a number of the commercial service
> providers for bulk SMS messaging, most of whom have PHP APIs. But
> since they are selling something they don't answer my question
>
> Is there any (legal, legitimate) way to send an SMS message that can
> be replied to the desired SMS cell number? Like, if I use PHP to send
> an SMS to Bob, can I make it appear to come from Jim's cell phone so
> that Bob can reply directly to Jim normally? The services all require
> Jim to log into their web site to read any replies.

Almost for sure no.

The SMS carriers are taking their lessons from email spam and pretty
much won't let you do anything even remotely like that hinky.

Plus, their only customers are mostly, umm, errr, ring tones and
fortune-tellers, so they have more than enough problems already with
disputed billing from their clients' customers.

Hmmm.  I'm probably conflating "SMS short code provisioning" with more
general short code services, as I only worked on a short code
application...  But I'm betting you can't forge the caller phone
number even in "regular" messaging.  Just too much room for abuse
there.

Good Luck!

-- 
Some people have a "gift" link here.
Know what I want?
I want you to buy a CD from some indie artist.
http://cdbaby.com/browse/from/lynch
Yeah, I get a buck. So?

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



Re: [PHP] PHP short tags: Questions

2007-07-12 Thread Richard Lynch
On Thu, July 12, 2007 6:42 pm, Micky Hulse wrote:
> I am trying to describe why php short tags failed to work on a
> server...
> here is my simplified explanation:
>
> "it had to do with the server settings... The short_open_tag directive
> in php.ini was set to 0."
>
> Do you think that is an ok way to describe the problem to a
> technically
> literate non php coder?

How technically literate are we talking here?... :-)

(It's fine, just kidding.)

> Additionally, is there a good reference on the net that explains the
> differences between short open tags and normal open tags?

http://php.net/

> Main negative things I have read about short open tags:
>
> 1. Not as portable.
> 2. Security risk/less secure.
> 3. Will conflict with XML tags.
> 4. Other?

#2 sounds awfully bogus to me...

1 and 3 sure ought to cover it though.

-- 
Some people have a "gift" link here.
Know what I want?
I want you to buy a CD from some indie artist.
http://cdbaby.com/browse/from/lynch
Yeah, I get a buck. So?


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



Re: [PHP] text field truncation with sql server

2007-07-12 Thread Richard Lynch
What is the 3981st character?

Does your database driver, whatever it is, which you've told us is not
PDO, have any kind of limit in the buffer size of query data
back/forth?

What driver ARE you using?
I see mssql in the code, so assume that's it, right?...

Does it happen on every record at 3980?
If you don't know, add more records with enough length to find out.

PS
Using all those echo statements probably a pretty bad habit to get
into, and you probably should be using htmlentities() on each element,
before you do the nl2br...

If the 3981st character happens to be a '<' that would explain why you
aren't seeing our data...  Use "View Source" in your browser if you
don't understand the preceding sentence. :-)

On Thu, July 12, 2007 11:37 pm, Bruce Cowin wrote:
> I have a simple page that displays a record from the sql server
> database.  One of the fields is a text field and keeps getting
> truncated at 3980 characters.  I searched and saw someone had reported
> this as a PDO bug so I'm not using PDO anymore, but I'm still getting
> the truncation.  Anyone know about this or have a work around?  Here
> is the code.  It's the body field that is a text field.  I've checked
> the field in the database and it definitely has more data than is
> displayed.
>
>   $cn = mssql_connect($myserver, $myuser, $mypwd);
>   mssql_select_db($mydb, $cn);
>   $result = mssql_query("select * from emails where id = 
> $emailid",
> $cn);
>   $row = mssql_fetch_array($result, MSSQL_ASSOC);
>
>   echo "";
>   echo "Id: " . $row['id'] . "";
>   echo "From: " . $row['mailfrom'] . "";
>   echo "To: " . $row['mailto'] . "";
>   echo "Cc: " . $row['mailcc'] . "";
>   echo "Subject: " . $row['subject'] . "";
>   echo "Date: " . $row['sentdate'] . "";
>   echo "Body: " . nl2br($row['body']) . "";
>   echo "";
>
> Thanks for any help.
>
> Regards,
>
> Bruce
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>


-- 
Some people have a "gift" link here.
Know what I want?
I want you to buy a CD from some indie artist.
http://cdbaby.com/browse/from/lynch
Yeah, I get a buck. So?

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



RE: [PHP] SMS questions

2007-07-12 Thread Jay Blanchard
[snip]
...schtuff
[/snip]

Please, do not cast aspersions upon the telcos, for those of us who work
in the industry cannot even get some of what you are talking about. We
have a vendor that provides the SMS part and they will not expose the
SMS API to us (not all SMS platforms are equal either) and we paid for
the equipment and software.

But alas, I do have an advantage. I have reversed engineered some of the
items and continue to work on this using PHP. If I can ever make it
stable it will be a great kernel for an open source project. I must
caution however that work proceeds slowly because the real job keeps
jumping in the way.

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



Re: [PHP] About PHP/XML/XSLT/MYSQL Web Sites

2007-07-12 Thread Nathan Nobbe

kelvin,

attached is a very simple diagram i put together when i got home
illustrating a possible relationship between the main components in an xsl
templated php application w/ a database back-end.  as ive mentioned there
are other configurations as well.  primarily the main options in the overall
relationship are rendering the xhtml on the client or server side and
building xml data in memory or reading in xml files from disk.  also, this
diagram does not take into account any sort of validation using DTDs or
XMLSchemas.  i am currently vaguely familiar w/ those technologies and
therefore dont know how to incorporate them into the image.
actually to be quite honest i dont think the would really be used when
generating a page to send to the client.  really those are important if you
expose an API and allow clients to send data to your application.  then it
would be handy to validate that xml w/ a dtd or xml schema.   the other
thing as i mentioned before is i cannot see a reason to create xml
data while processing a GET or POST request from a client; it would just be
an extra step with no apparent benefit as far as i can tell.

-nathan

On 7/12/07, Kelvin Park <[EMAIL PROTECTED]> wrote:


I'm trying to setup a XSLT based web site.
I wasn't exactly sure about the flow of the whole system when data from
relational database is transferred to XML and in turn the data inputted
from the user is relayed back to the database through XML (or directly
to the database with PHP DB connection). I built a flowchart
illustrating what the flow of the XSLT/PHP/MYSQL system might be like.
If you think it's the wrong way or an inefficient way of getting user
inputted data back to mysql, I would appreciate any comments.
If you cannot download the PDF file, you can bring it up with direct
address the the file: http://www.envigan.net/CMSFLOW.pdf



--
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] Social Networking Sites OT

2007-07-12 Thread Richard Lynch
It's gotten to the point where I pretty much view social networking
sites as just another form of spammers...

I blogged about it, and would like feedback from members of this
lists, for various reasons I would hope would be obvious.

PLEASE put responses in my blog, or your blog, or whatever, but not
here, as I'm sure this thread could be quite annoying as it has
minimal to zero concrete PHP content.

http://richardlynch.blogspot.com/

-- 
Some people have a "gift" link here.
Know what I want?
I want you to buy a CD from some indie artist.
http://cdbaby.com/browse/from/lynch
Yeah, I get a buck. So?

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



[PHP] text field truncation with sql server

2007-07-12 Thread Bruce Cowin
I have a simple page that displays a record from the sql server database.  One 
of the fields is a text field and keeps getting truncated at 3980 characters.  
I searched and saw someone had reported this as a PDO bug so I'm not using PDO 
anymore, but I'm still getting the truncation.  Anyone know about this or have 
a work around?  Here is the code.  It's the body field that is a text field.  
I've checked the field in the database and it definitely has more data than is 
displayed.

$cn = mssql_connect($myserver, $myuser, $mypwd);
mssql_select_db($mydb, $cn);
$result = mssql_query("select * from emails where id = 
$emailid", $cn);
$row = mssql_fetch_array($result, MSSQL_ASSOC);

echo "";
echo "Id: " . $row['id'] . "";
echo "From: " . $row['mailfrom'] . "";
echo "To: " . $row['mailto'] . "";
echo "Cc: " . $row['mailcc'] . "";
echo "Subject: " . $row['subject'] . "";
echo "Date: " . $row['sentdate'] . "";
echo "Body: " . nl2br($row['body']) . "";
echo "";

Thanks for any help.

Regards,

Bruce

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



Re: [PHP] PHP short tags: Questions

2007-07-12 Thread Chris

Micky Hulse wrote:

Hi Chris, thanks for the quick reply. I appreciate your help.

Chris wrote:

Sure.


Thanks. :)


1 & 3 definitely. No idea how it's a security risk.


Ah, great. Thanks for clarification.

I probably mis-read the info about it being a security risk.


I should have said I'm not aware of any security risks with using short 
tags ;) Just to clarify.


--
Postgresql & php tutorials
http://www.designmagick.com/

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



Re: [PHP] PHP short tags: Questions

2007-07-12 Thread Micky Hulse

Hi Chris, thanks for the quick reply. I appreciate your help.

Chris wrote:

Sure.


Thanks. :)


1 & 3 definitely. No idea how it's a security risk.


Ah, great. Thanks for clarification.

I probably mis-read the info about it being a security risk.

Have a great day,
Cheers,
Micky

--
Wishlists: 
   Switch: 
 BCC?: 
   My: 

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



Re: [PHP] PHP short tags: Questions

2007-07-12 Thread Chris


"it had to do with the server settings... The short_open_tag directive 
in php.ini was set to 0."


Do you think that is an ok way to describe the problem to a technically 
literate non php coder?


Sure.

Additionally, is there a good reference on the net that explains the 
differences between short open tags and normal open tags?


Main negative things I have read about short open tags:

1. Not as portable.
2. Security risk/less secure.
3. Will conflict with XML tags.


1 & 3 definitely. No idea how it's a security risk.

--
Postgresql & php tutorials
http://www.designmagick.com/

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



Re: [PHP] SMS questions

2007-07-12 Thread Nathan Nobbe

Brian,


Here's another thing that would be nice: A web service to look up the
carrier for a cell number. That way you could simply send an email to
[EMAIL PROTECTED], though this would still be only a partial
solution. This is a lot harder now that numbers are transportable
between carriers.


from what i can tell this is somewhat of a pipe dream, unless youre a big
company that a telco *really* likes and have tons of money.  the voip
industry
which ive been working in for nearly 2 years now has lots of feature like
this.
the only reason they have those features is because of the sheer nature of
voip, which enables almost anyone to provide telephone functionality over
the
internet.
cell phones are a totally different story though and my fear is the only way
to
get in is a dirty hack they [telcos] are overlooking that if properly
exploited could become
an open source movement that the phone companies would have to accept.
something similar to the open source voip movement but w/ cell phones.
i was close to this hack late last year, but its so unreliable that theres
no way
to go to production w/ it.

-nathan

On 7/12/07, Brian Dunning <[EMAIL PROTECTED]> wrote:


Here's another thing that would be nice: A web service to look up the
carrier for a cell number. That way you could simply send an email to
[EMAIL PROTECTED], though this would still be only a partial
solution. This is a lot harder now that numbers are transportable
between carriers.

I was not able to find any service provider that makes the SMS
messages appear to come from the sender's cell phone, so they could
be replied to normally.

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




Re: [PHP] Array Push question

2007-07-12 Thread John Comerford
As you guys can probably guess from the question I'm still getting to 
grips with some parts of php.


I had stripped down the code for my original post, maybe this will clear 
things up a bit:


$Rows[] = array();
$currentRow = count($Rows) - 1;
$Rows[$currentRow]['test'] = "this is a test";
$Rows[$currentRow]['Data'] = array();
$Rows[$currentRow]['Config'] = "This is the row config";

So from what you guys have said I have changed it to be the following:

$Rows[] = array('test' => 'this is a test', 'Data' => array(), 'Config' 
=> 'This is the row config');


Which seems to be doing what I want.

Thanks for the replies,
 JC


Jim Lucas wrote:

John Comerford wrote:

Hi Folks,

Is there a better way of doing the following:

$Rows[] = array();
$currentRow = count($Rows) - 1;
$Rows[$currentRow]['test'] = "this is a test";


I imagine that you are doing other actions between the above three 
lines? Correct?


Really, the simplest way of doing this is to call this over and over 
again.


$Rows[]['test'] = "this is a test";

it will give you the same results as array_push, but without a 
function call


$Rows[]['test'] = "this is a test";
$Rows[]['test'] = "this is another test";
$Rows[]['test'] = "this is even another test";

print_r($Rows);

this will show you that it does what you are doing in the above code, 
but again, the question.
What are you doing between all the lines of code that made you think 
that you had to do it your example way?  Are you using count() and 
doing math with it?  or something else?




Specifically I am wonder if I can avoid having to use 'count'.

TIA,
 JC



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



Re: [PHP] SMS questions

2007-07-12 Thread Brian Dunning
Here's another thing that would be nice: A web service to look up the  
carrier for a cell number. That way you could simply send an email to  
[EMAIL PROTECTED], though this would still be only a partial  
solution. This is a lot harder now that numbers are transportable  
between carriers.


I was not able to find any service provider that makes the SMS  
messages appear to come from the sender's cell phone, so they could  
be replied to normally.


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



Re: [PHP] SMS questions

2007-07-12 Thread Nathan Nobbe

Brian,

I was experimenting late last year using PHP to send SMS messages.  I think
there is a
lot of potential in the marketplace around SMS.  But most of the phone
companies wouldnt
even talk to me and all i was trying to do was hit a development API to test
some code out.
im almost certain you will have to go through a provider if you intend to
have messages source #
based upon a value you provide rather than a phone you own.
i have already grown a deep hatred for telcos due to this exclusive club
thing they have going.
i will focus all my energy on any opportunity that arises to thwart them.
good luck,

-nathan

On 7/12/07, Brian Dunning <[EMAIL PROTECTED]> wrote:


Hi all - I've been looking at a number of the commercial service
providers for bulk SMS messaging, most of whom have PHP APIs. But
since they are selling something they don't answer my question

Is there any (legal, legitimate) way to send an SMS message that can
be replied to the desired SMS cell number? Like, if I use PHP to send
an SMS to Bob, can I make it appear to come from Jim's cell phone so
that Bob can reply directly to Jim normally? The services all require
Jim to log into their web site to read any replies.

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




RE: [PHP] mail function from and reply to address problem

2007-07-12 Thread Steve Perkins
Sounds more like the mail server than PHP. Although weird anyway ! What mail
server are you using : local/remote, smtp/sendmail/qmail ? 

Try using whatever method and send a mail through this server from outside
of PHP with the same problem parameters ? Does that work ? It should either
eliminate PHP, or point the finger ! I suspect eliminate but you never
know..

That's where I think I'd start anyway. Send uz an update when you have some
answers.

Steve


-Original Message-
From: Tanner Postert [mailto:[EMAIL PROTECTED] 
Sent: 13 July 2007 00:33
To: php-general@lists.php.net
Subject: [PHP] mail function from and reply to address problem

I am currently running

PHP 5.1.4
Fedora Core 5

i'm trying to exectute the following test script.



i have about 10 or so different virtual hosts running on this machine, and
if i use any of them for the from & reply-to addresses, it works fine, or
even if i use domains I don't control like aol.com or example.com those work
too, but one particular new virtual host doesn't work, it re-writes the from
address to the default virtual host address. which is strange because that
isn't in the php.ini anywhere, but it could just be taking the hostname.

anyone have any ideas?

thanks in advance.

Tanner

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



[PHP] PHP short tags: Questions

2007-07-12 Thread Micky Hulse

Hi,

I am trying to describe why php short tags failed to work on a server... 
here is my simplified explanation:


"it had to do with the server settings... The short_open_tag directive 
in php.ini was set to 0."


Do you think that is an ok way to describe the problem to a technically 
literate non php coder?


Additionally, is there a good reference on the net that explains the 
differences between short open tags and normal open tags?


Main negative things I have read about short open tags:

1. Not as portable.
2. Security risk/less secure.
3. Will conflict with XML tags.
4. Other?

Thanks!
Cheers,
M

--
Wishlists: 
   Switch: 
 BCC?: 
   My: 

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



[PHP] SMS questions

2007-07-12 Thread Brian Dunning
Hi all - I've been looking at a number of the commercial service  
providers for bulk SMS messaging, most of whom have PHP APIs. But  
since they are selling something they don't answer my question


Is there any (legal, legitimate) way to send an SMS message that can  
be replied to the desired SMS cell number? Like, if I use PHP to send  
an SMS to Bob, can I make it appear to come from Jim's cell phone so  
that Bob can reply directly to Jim normally? The services all require  
Jim to log into their web site to read any replies.


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



[PHP] mail function from and reply to address problem

2007-07-12 Thread Tanner Postert

I am currently running

PHP 5.1.4
Fedora Core 5

i'm trying to exectute the following test script.



i have about 10 or so different virtual hosts running on this machine, and
if i use any of them for the from & reply-to addresses, it works fine, or
even if i use domains I don't control like aol.com or example.com those work
too, but one particular new virtual host doesn't work, it re-writes the from
address to the default virtual host address. which is strange because that
isn't in the php.ini anywhere, but it could just be taking the hostname.

anyone have any ideas?

thanks in advance.

Tanner


[PHP] Re: Displaying HTML characters in real format

2007-07-12 Thread Dan
string htmlentities ( string $string [, int $quote_style [, string $charset 
[, bool $double_encode]]] )


This function is identical to htmlspecialchars() in all ways, except with 
htmlentities(), all characters which have HTML character entity equivalents 
are translated into these entities.


This means that if there's an HTML equivelant it will translate into that. 
For example.  ' and " don't have HTML equivelants, it is ', anything 
with a #number won't get translated.  With htmlspecialchars it will.


Hope that answered your question.

- Dan

"Don Don" <[EMAIL PROTECTED]> wrote in message 
news:[EMAIL PROTECTED]

Hi all,

Am kind of confused between htmlspecialchars and htmlentities. I've got 
data  i need to display data on a page containing e.g. " but will 
like it to be displayed as "


htmlspecialchars or htmlentities or page character set ?

Cheers


-
Take the Internet to Go: Yahoo!Go puts the Internet in your pocket: mail, 
news, photos & more. 


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



[PHP] About PHP/XML/XSLT/MYSQL Web Sites

2007-07-12 Thread Kelvin Park

I'm trying to setup a XSLT based web site.
I wasn't exactly sure about the flow of the whole system when data from 
relational database is transferred to XML and in turn the data inputted 
from the user is relayed back to the database through XML (or directly 
to the database with PHP DB connection). I built a flowchart 
illustrating what the flow of the XSLT/PHP/MYSQL system might be like. 
If you think it's the wrong way or an inefficient way of getting user 
inputted data back to mysql, I would appreciate any comments.
If you cannot download the PDF file, you can bring it up with direct 
address the the file: http://www.envigan.net/CMSFLOW.pdf



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

Re: [PHP] Displaying HTML characters in real format

2007-07-12 Thread Jim Lucas

Don Don wrote:
Hi all,  


Am kind of confused between htmlspecialchars and htmlentities. I've got data  i need to 
display data on a page containing e.g. " but will like it to be displayed as 
"

htmlspecialchars or htmlentities or page character set ?

Cheers

   
-
Take the Internet to Go: Yahoo!Go puts the Internet in your pocket: mail, news, photos & more. 

a little confused with what you have to begin with.

Are you saying that in the text that you want to have displayed, it has " 
instead of "

or is it that you have a quot " and want to run htmlspecialchars() or htmlentities() on it?  and 
then have it displayed as " and not "?


which is it?

--
Jim Lucas

   "Some men are born to greatness, some achieve greatness,
   and some have greatness thrust upon them."

Twelfth Night, Act II, Scene V
by William Shakespeare

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



[PHP] Re: Displaying HTML characters in real format

2007-07-12 Thread Al
Best way to learn, and remember, things like this is to make a simple test page 
and see for yourself.


Don Don wrote:
Hi all,  


Am kind of confused between htmlspecialchars and htmlentities. I've got data  i need to 
display data on a page containing e.g. " but will like it to be displayed as 
"

htmlspecialchars or htmlentities or page character set ?

Cheers

   
-
Take the Internet to Go: Yahoo!Go puts the Internet in your pocket: mail, news, photos & more. 


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



[PHP] Re: Help setting up php

2007-07-12 Thread Joker7
In news: [EMAIL PROTECTED] -
"Karl Schmitt"  wrote :
> Can someone please help me?
>
>
>
> I am new to installing and working with php and webservers.  I am
> using IIS 6.
>
>
>
> I can not get php to load the ini file.
>
>
>
> I have followed multiple guides including those listed on the install
> pages and even went back and let the installer run, which changed
> nothing.
>
>
>
> php in installed in ISAPI mode.
>
>
>
> You can see my test page here:
>
> www.ctconline.com/test.php
>
>
>
> I can post screen shots over email it that will help.  I need access
> to the gd library at least for work.
>
>
>
> Any help would be most appreciated.
>
>
>
> Thank you Karl Schmitt

Take a look here http://t56.hopto.org/out/ it's how I have it working.

Chris

-- 
Cheap As Chips Broadband http://yeah.kick-butt.co.uk
Superb hosting & domain name deals http://host.kick-butt.co.uk 

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



[PHP] Displaying HTML characters in real format

2007-07-12 Thread Don Don
Hi all,  

Am kind of confused between htmlspecialchars and htmlentities. I've got data  i 
need to display data on a page containing e.g. " but will like it to be 
displayed as "

htmlspecialchars or htmlentities or page character set ?

Cheers

   
-
Take the Internet to Go: Yahoo!Go puts the Internet in your pocket: mail, news, 
photos & more. 

Re: [PHP] can't open file

2007-07-12 Thread Stut

Anugrah Widya wrote:

Stut wrote:

Anugrah Widya wrote:

dear php developer,

i have weird situation here, i can't create a file in 777 mode 
directory and stay in same server, is this a bug ??


fyi. i'm using fc6, and php 5.1.6


I'm not sure I understand what the problem is. Please post the code 
you're using and a more detailed description of what you're trying to 
achieve and what's actually happening.


-Stut

here the situation is, i have two domain (two website), and both stay in 
same server, and use same php


Website A -> /var/www/html/A
Website B -> /var/www/html/B

website A would like to create some  file in website B, in 
/var/www/html/B/var/tmp/queue, and that map is in 777 mode created by 
script


what i got is the fopen() won't succeed to create the file in website B

but if i test to write into /var/www/html/A/var/tmp/queue in website A 
admin it succeed


is it because of some configuration in php.ini i didn't activate or what ??


You probably have some form of safe mode enabled. See 
http://php.net/features.safe-mode for details.


-Stut

--
http://stut.net/

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



Re: [PHP] can't open file

2007-07-12 Thread Anugrah Widya

Stut wrote:

Anugrah Widya wrote:

dear php developer,

i have weird situation here, i can't create a file in 777 mode 
directory and stay in same server, is this a bug ??


fyi. i'm using fc6, and php 5.1.6


I'm not sure I understand what the problem is. Please post the code 
you're using and a more detailed description of what you're trying to 
achieve and what's actually happening.


-Stut

here the situation is, i have two domain (two website), and both stay in 
same server, and use same php


Website A -> /var/www/html/A
Website B -> /var/www/html/B

website A would like to create some  file in website B, in 
/var/www/html/B/var/tmp/queue, and that map is in 777 mode created by script


what i got is the fopen() won't succeed to create the file in website B

but if i test to write into /var/www/html/A/var/tmp/queue in website A 
admin it succeed


is it because of some configuration in php.ini i didn't activate or what ??

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



Re: [PHP] can't open file

2007-07-12 Thread Daniel Brown

On 7/12/07, Anugrah Widya <[EMAIL PROTECTED]> wrote:

dear php developer,

i have weird situation here, i can't create a file in 777 mode directory
and stay in same server, is this a bug ??


   How are you attempting to create the file?
   What do your PHP settings allow and disallow?
   Do you mean " directory on the same server" or that you're
magically bouncing to a different, random server every time you try to
create a file?
   Can you provide the code that you're trying to use to create the file?
   Are you getting any errors?

--
Daniel P. Brown
[office] (570-) 587-7080 Ext. 272
[mobile] (570-) 766-8107

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



Re: [PHP] can't open file

2007-07-12 Thread Stut

Anugrah Widya wrote:

dear php developer,

i have weird situation here, i can't create a file in 777 mode directory 
and stay in same server, is this a bug ??


fyi. i'm using fc6, and php 5.1.6


I'm not sure I understand what the problem is. Please post the code 
you're using and a more detailed description of what you're trying to 
achieve and what's actually happening.


-Stut

--
http://stut.net/

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



Re: [PHP] Re: PHP Brain Teasers

2007-07-12 Thread Tijnema

On 7/12/07, Jon Anderson <[EMAIL PROTECTED]> wrote:

Daniel Brown wrote:
>Did you come before or after the chicken egg?
>
Relevant to the above:

$a = array('Chicken','Egg');
echo "The " . $a[array_rand($a)] . " comes first.";

I appologize if this one's already been done...I've only glanced at a
few entries in this thread, entertaining though it is. :-)

jon



The same fault is made over and over again ;) as the fish egg was
earlier (as noted here)
Your code should be this:
$a = array('Chicken','Chicken egg');
echo "The " . $a[array_rand($a)] . " comes first.";

Tijnema
--
Vote for PHP Color Coding in Gmail! -> http://gpcc.tijnema.info

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



[PHP] can't open file

2007-07-12 Thread Anugrah Widya

dear php developer,

i have weird situation here, i can't create a file in 777 mode directory 
and stay in same server, is this a bug ??


fyi. i'm using fc6, and php 5.1.6

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



Re: [PHP] Re: PHP Brain Teasers

2007-07-12 Thread Daniel Brown

On 7/12/07, Robert Cummings <[EMAIL PROTECTED]> wrote:

> > I wasn't born silly-ass, I was hatched. >:)
>
> Did you come before or after the chicken egg?

After the first one, but I fried it up and so earth had to wait another
couple of million years for a chicken to evolve again.


  Ah, so then, presumably, the first chicken egg was a relative of
yours doesn't that make you the "Second Cummings?"

  Who knew we were in the presence of holiness?

--
Daniel P. Brown
[office] (570-) 587-7080 Ext. 272
[mobile] (570-) 766-8107

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



Re: [PHP] Re: PHP Brain Teasers

2007-07-12 Thread Jon Anderson

Daniel Brown wrote:

   Did you come before or after the chicken egg?


Relevant to the above:

$a = array('Chicken','Egg');
echo "The " . $a[array_rand($a)] . " comes first.";

I appologize if this one's already been done...I've only glanced at a 
few entries in this thread, entertaining though it is. :-)


jon

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



Re: [PHP] Re: PHP Brain Teasers

2007-07-12 Thread Robert Cummings
On Thu, 2007-07-12 at 17:06 +0200, Tijnema wrote:
> On 7/12/07, Daniel Brown <[EMAIL PROTECTED]> wrote:
> > On 7/12/07, Colin Guthrie <[EMAIL PROTECTED]> wrote:
> > > Thijs Lensselink wrote:
> > > >>  > > >> $evil[] = "6";
> > > >> $evil[] = "6";
> > > >> $evil[] = "6";
> > > >> for($i=0;$i > > >> $_ = sqrt($evil);
> > > >> }
> > > >> ?>
> >
> >It was supposed to be "money is the root of all evil," but the
> > code above wouldn't work correctly anyway, as each time through the
> > for() loop it'll try to get the square root of the array.
> >
> > > Thank _God_ it's Friday??? Covering all bases are we? ;)
> >
> >No, I said, "thank God it's ALMOST Friday."  Nothing to do with
> > the puzzle, I'm just exhausted this week for some reason.
> >
> > --
> > Daniel P. Brown
> 
> You can probably remember the good old time of being a child and
> having holiday ;)

G... must be nice, some of us had to toil 18 hours a day sweeping
chimneys!

;)

Cheers,
Rob.
-- 
...
SwarmBuy.com - http://www.swarmbuy.com

Leveraging the buying power of the masses!
...

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



Re: [PHP] Re: PHP Brain Teasers

2007-07-12 Thread Daniel Brown

On 7/12/07, Tijnema <[EMAIL PROTECTED]> wrote:

On 7/12/07, Daniel Brown <[EMAIL PROTECTED]> wrote:
> On 7/12/07, Tijnema <[EMAIL PROTECTED]> wrote:
> > You can probably remember the good old time of being a child and
> > having holiday ;)
> >
> > Tijnema
> > --
> > Vote for PHP Color Coding in Gmail! -> http://gpcc.tijnema.info
> >
>
>Don't rub it in, Tijnema ;-P
>
> --
> Daniel P. Brown

Hehe ;)

*fixed your post * :P

Tijnema

--
Vote for PHP Color Coding in Gmail! -> http://gpcc.tijnema.info



   Ha!

--
Daniel P. Brown
[office] (570-) 587-7080 Ext. 272
[mobile] (570-) 766-8107

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



Re: [PHP] Re: PHP Brain Teasers

2007-07-12 Thread Tijnema

On 7/12/07, Daniel Brown <[EMAIL PROTECTED]> wrote:

On 7/12/07, Tijnema <[EMAIL PROTECTED]> wrote:
> You can probably remember the good old time of being a child and
> having holiday ;)
>
> Tijnema
> --
> Vote for PHP Color Coding in Gmail! -> http://gpcc.tijnema.info
>

   Don't rub it in, Tijnema ;-P

--
Daniel P. Brown


Hehe ;)

*fixed your post * :P

Tijnema

--
Vote for PHP Color Coding in Gmail! -> http://gpcc.tijnema.info

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



Re: [PHP] Re: PHP Brain Teasers

2007-07-12 Thread Daniel Brown

On 7/12/07, Tijnema <[EMAIL PROTECTED]> wrote:

You can probably remember the good old time of being a child and
having holiday ;)

Tijnema
--
Vote for PHP Color Coding in Gmail! -> http://gpcc.tijnema.info



   Don't rub it in, Matijn ;-P

--
Daniel P. Brown
[office] (570-) 587-7080 Ext. 272
[mobile] (570-) 766-8107

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



Re: [PHP] Re: PHP Brain Teasers

2007-07-12 Thread Stut

Robert Cummings wrote:

On Thu, 2007-07-12 at 11:20 -0400, Daniel Brown wrote:

On 7/12/07, Robert Cummings <[EMAIL PROTECTED]> wrote:

G... must be nice, some of us had to toil 18 hours a day sweeping
chimneys!

;)

Cheers,
Rob.

What do you mean "us"?  Weren't you born before they invented the chimney?


I wasn't born silly-ass, I was hatched. >:)


As in "I've hatched a Cummings plan" ??

;)

-Stut

--
http://stut.net/

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



Re: [PHP] Re: PHP Brain Teasers

2007-07-12 Thread Robert Cummings
On Thu, 2007-07-12 at 11:27 -0400, Daniel Brown wrote:
> On 7/12/07, Robert Cummings <[EMAIL PROTECTED]> wrote:
> > On Thu, 2007-07-12 at 11:20 -0400, Daniel Brown wrote:
> > > On 7/12/07, Robert Cummings <[EMAIL PROTECTED]> wrote:
> > > > G... must be nice, some of us had to toil 18 hours a day sweeping
> > > > chimneys!
> > > >
> > > > ;)
> > > >
> > > > Cheers,
> > > > Rob.
> > >
> > > What do you mean "us"?  Weren't you born before they invented the 
> > > chimney?
> >
> > I wasn't born silly-ass, I was hatched. >:)
>
> Did you come before or after the chicken egg?

After the first one, but I fried it up and so earth had to wait another
couple of million years for a chicken to evolve again.

Cheers,
Rob.
-- 
...
SwarmBuy.com - http://www.swarmbuy.com

Leveraging the buying power of the masses!
...

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



Re: [PHP] URLs

2007-07-12 Thread Richard Heyes
This may or may not be a PHP question - I'll let the group decide. Note 
this URL:


http://www.someplace.com/SomeDirectory/SomeFile

compared to this URL:

http://www.someplace.com/SomeDirectory/SomeFile.php

Okay. How does one create the URL with no file extension? Is this done 
through PHP or is this a server setting? Thanks in advance!


A number of ways. You could use mod_rewrite, though you shouldn't if you 
care at all about performance.


Directories. ie. Make SomeFile a directory with an index.php file in it. 
You will end up up with a trailing slash on the URL though.


ForceType (IIRC). Use this directive in Apache to specify that SomeFile 
is actually be parsed by PHP. SomeFile should be a PHP script. Or 
SomeDirectory could actually be a PHP file again used with ForceType 
which inspects the URL and serves up the correct content.


The ForceType method is used on phpguru.org to make "static" look like a 
directory. It's actually a PHP file that shows the correct template 
based on the URL.


Eg:

http://www.phpguru.org/static/positioning.html

--
Richard Heyes
+44 (0)844 801 1072
http://www.websupportsolutions.co.uk
Knowledge Base and HelpDesk software

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



Re: [PHP] Re: PHP Brain Teasers

2007-07-12 Thread Daniel Brown

On 7/12/07, Robert Cummings <[EMAIL PROTECTED]> wrote:

On Thu, 2007-07-12 at 11:20 -0400, Daniel Brown wrote:
> On 7/12/07, Robert Cummings <[EMAIL PROTECTED]> wrote:
> > G... must be nice, some of us had to toil 18 hours a day sweeping
> > chimneys!
> >
> > ;)
> >
> > Cheers,
> > Rob.
>
> What do you mean "us"?  Weren't you born before they invented the chimney?

I wasn't born silly-ass, I was hatched. >:)

Cheers,
Rob.
--
...
SwarmBuy.com - http://www.swarmbuy.com

Leveraging the buying power of the masses!
...



   Did you come before or after the chicken egg?

--
Daniel P. Brown
[office] (570-) 587-7080 Ext. 272
[mobile] (570-) 766-8107

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



Re: [PHP] Re: PHP Brain Teasers

2007-07-12 Thread Robert Cummings
On Thu, 2007-07-12 at 11:20 -0400, Daniel Brown wrote:
> On 7/12/07, Robert Cummings <[EMAIL PROTECTED]> wrote:
> > G... must be nice, some of us had to toil 18 hours a day sweeping
> > chimneys!
> >
> > ;)
> >
> > Cheers,
> > Rob.
> 
> What do you mean "us"?  Weren't you born before they invented the chimney?

I wasn't born silly-ass, I was hatched. >:)

Cheers,
Rob.
-- 
...
SwarmBuy.com - http://www.swarmbuy.com

Leveraging the buying power of the masses!
...

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



Re: [PHP] Bandwidth and Mail statistics

2007-07-12 Thread Stut

Fernando Cosso wrote:

Hi guys
I have been asked to create a php script. It has to create a pdf with the
qmail and the bandwidth statistics. My first approach was to parse the html
output of the isoqlog for the mail and copy the mrtg's images
But it is a really nasty job.
I wonder if someone has done something similar to this.
Any help will be appreciated.
Best regards


You posted almost exactly the same request yesterday. No response 
usually means that nobody who can give you any assistance has seen it. 
Reposting it will not help and only serves to annoy.


A few questions...

1) Have you searched the list archives?

2) Have you Googled?

3) Have you MSN'd?

4) Have you actually tried anything yet?

-Stut

--
http://stut.net/

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



RE: [PHP] Re: PHP Brain Teasers

2007-07-12 Thread Jay Blanchard
[snip]
> >>  >> $evil[] = "6";
> >> $evil[] = "6";
> >> $evil[] = "6";
> >> for($i=0;$i >> $_ = sqrt($evil);
> >> }
> >> ?>

It was supposed to be "money is the root of all evil," but the
code above wouldn't work correctly anyway, as each time through the
for() loop it'll try to get the square root of the array.
[/snip]

The actual quote is "the love of money is the root of all evil", so you
need to find the root of love.

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



Re: [PHP] Re: PHP Brain Teasers

2007-07-12 Thread Daniel Brown

On 7/12/07, Robert Cummings <[EMAIL PROTECTED]> wrote:

G... must be nice, some of us had to toil 18 hours a day sweeping
chimneys!

;)

Cheers,
Rob.


   What do you mean "us"?  Weren't you born before they invented the chimney?

--
Daniel P. Brown
[office] (570-) 587-7080 Ext. 272
[mobile] (570-) 766-8107

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



Re: [PHP] Re: PHP Brain Teasers

2007-07-12 Thread Tijnema

On 7/12/07, Daniel Brown <[EMAIL PROTECTED]> wrote:

On 7/12/07, Colin Guthrie <[EMAIL PROTECTED]> wrote:
> Thijs Lensselink wrote:
> >>  >> $evil[] = "6";
> >> $evil[] = "6";
> >> $evil[] = "6";
> >> for($i=0;$i >> $_ = sqrt($evil);
> >> }
> >> ?>

   It was supposed to be "money is the root of all evil," but the
code above wouldn't work correctly anyway, as each time through the
for() loop it'll try to get the square root of the array.

> Thank _God_ it's Friday??? Covering all bases are we? ;)

   No, I said, "thank God it's ALMOST Friday."  Nothing to do with
the puzzle, I'm just exhausted this week for some reason.

--
Daniel P. Brown


You can probably remember the good old time of being a child and
having holiday ;)

Tijnema
--
Vote for PHP Color Coding in Gmail! -> http://gpcc.tijnema.info

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



Re: [PHP] Re: PHP Brain Teasers

2007-07-12 Thread Daniel Brown

On 7/12/07, Colin Guthrie <[EMAIL PROTECTED]> wrote:

Thijs Lensselink wrote:
>> > $evil[] = "6";
>> $evil[] = "6";
>> $evil[] = "6";
>> for($i=0;$i> $_ = sqrt($evil);
>> }
>> ?>


   It was supposed to be "money is the root of all evil," but the
code above wouldn't work correctly anyway, as each time through the
for() loop it'll try to get the square root of the array.


Thank _God_ it's Friday??? Covering all bases are we? ;)


   No, I said, "thank God it's ALMOST Friday."  Nothing to do with
the puzzle, I'm just exhausted this week for some reason.

--
Daniel P. Brown
[office] (570-) 587-7080 Ext. 272
[mobile] (570-) 766-8107

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



Re: [PHP] Array Push question

2007-07-12 Thread Jim Lucas

John Comerford wrote:

Hi Folks,

Is there a better way of doing the following:

$Rows[] = array();
$currentRow = count($Rows) - 1;
$Rows[$currentRow]['test'] = "this is a test";


I imagine that you are doing other actions between the above three lines? 
Correct?

Really, the simplest way of doing this is to call this over and over again.

$Rows[]['test'] = "this is a test";

it will give you the same results as array_push, but without a function call

$Rows[]['test'] = "this is a test";
$Rows[]['test'] = "this is another test";
$Rows[]['test'] = "this is even another test";

print_r($Rows);

this will show you that it does what you are doing in the above code, but 
again, the question.
What are you doing between all the lines of code that made you think that you had to do it your 
example way?  Are you using count() and doing math with it?  or something else?




Specifically I am wonder if I can avoid having to use 'count'.

TIA,
 JC




--
Jim Lucas

   "Some men are born to greatness, some achieve greatness,
   and some have greatness thrust upon them."

Twelfth Night, Act II, Scene V
by William Shakespeare

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



[PHP] Re: PHP Brain Teasers

2007-07-12 Thread Colin Guthrie
Thijs Lensselink wrote:
>> > $evil[] = "6";
>> $evil[] = "6";
>> $evil[] = "6";
>> for($i=0;$i> $_ = sqrt($evil);
>> }
>> ?>


>> That also illustrates to newbies the allowance of using an
>> underscore as a variable.  (Thank God it's almost Friday)

Thank _God_ it's Friday??? Covering all bases are we? ;)


>> --
>> Daniel P. Brown
>> [office] (570-) 587-7080 Ext. 272
>> [mobile] (570-) 766-8107
>>
> 
> number of the beast? :)

N! It's the "root of all evil"!!!

:p

Col

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



Re: [PHP] Re: PHP Brain Teasers

2007-07-12 Thread Thijs Lensselink
On Thu, 12 Jul 2007 09:56:18 -0400, "Daniel Brown" <[EMAIL PROTECTED]> wrote:
> On 7/12/07, Jay Blanchard <[EMAIL PROTECTED]> wrote:
>> [snip]
>> Mine was trying to go for an old funk song that starts:
>>
>> What goes up, must come down.
>> Spinning wheel got to go 'round
>> Drop all the painted ponies by the riverside.
>> [mumble] let the spinning wheel slide.
>>
>> Only later did I realize I broke the cardinal rule of Name That Tune
>> and have NO IDEA what the song title is nor who wrote/sang it...
>> [/snip]
>>
>> Spinning Wheel - Blood, Sweat & Tears
>>
>> --
>> PHP General Mailing List (http://www.php.net/)
>> To unsubscribe, visit: http://www.php.net/unsub.php
>>
>>
> 
>  $evil[] = "6";
> $evil[] = "6";
> $evil[] = "6";
> for($i=0;$i $_ = sqrt($evil);
> }
> ?>
> 
> That also illustrates to newbies the allowance of using an
> underscore as a variable.  (Thank God it's almost Friday)
> 
> --
> Daniel P. Brown
> [office] (570-) 587-7080 Ext. 272
> [mobile] (570-) 766-8107
> 

number of the beast? :)

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



Re: [PHP] URLs

2007-07-12 Thread Daniel Brown

On 7/12/07, Philip Thompson <[EMAIL PROTECTED]> wrote:

Hi.

This may or may not be a PHP question - I'll let the group decide.
Note this URL:

http://www.someplace.com/SomeDirectory/SomeFile

compared to this URL:

http://www.someplace.com/SomeDirectory/SomeFile.php

Okay. How does one create the URL with no file extension? Is this
done through PHP or is this a server setting? Thanks in advance!

~Philip

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




   That would be done via either a server setting (such as Apache's
mod_rewrite) or having multiple directories to act as a file, with an
index.php or other default file in there.  So that if you called:

   http://www.somplace.com/somePath/

   - OR -
   http://www.somplace.com/somePath/hawaii.php
   (with an .htaccess file holding:
   DirectoryIndex hawaii.php
   }



--
Daniel P. Brown
[office] (570-) 587-7080 Ext. 272
[mobile] (570-) 766-8107

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



Re: [PHP] URLs

2007-07-12 Thread Stut

Philip Thompson wrote:
This may or may not be a PHP question - I'll let the group decide. Note 
this URL:


http://www.someplace.com/SomeDirectory/SomeFile

compared to this URL:

http://www.someplace.com/SomeDirectory/SomeFile.php

Okay. How does one create the URL with no file extension? Is this done 
through PHP or is this a server setting? Thanks in advance!


I do this under Apache with the MultiViews option.

-Stut

--
http://stut.net/

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



[PHP] Re: URLs

2007-07-12 Thread Mikey

Philip Thompson wrote:

Hi.

This may or may not be a PHP question - I'll let the group decide. Note 
this URL:


http://www.someplace.com/SomeDirectory/SomeFile

compared to this URL:

http://www.someplace.com/SomeDirectory/SomeFile.php

Okay. How does one create the URL with no file extension? Is this done 
through PHP or is this a server setting? Thanks in advance!


~Philip


It is a server setting - see ModRewrite for Apache.

HTH,

Mikey

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



[PHP] URLs

2007-07-12 Thread Philip Thompson

Hi.

This may or may not be a PHP question - I'll let the group decide.  
Note this URL:


http://www.someplace.com/SomeDirectory/SomeFile

compared to this URL:

http://www.someplace.com/SomeDirectory/SomeFile.php

Okay. How does one create the URL with no file extension? Is this  
done through PHP or is this a server setting? Thanks in advance!


~Philip

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



Re: [PHP] Single Quote in String functions

2007-07-12 Thread Robert Cummings
On Thu, 2007-07-12 at 15:47 +0300, Sancar Saran wrote:
> On Thursday 12 July 2007 15:11:28 Stut wrote:
> > Sancar Saran wrote:
> > > I cannot do any operation wiht single quote like
> > >
> > > explode("'",$strContent);
> > >
> > > Did I miss someting ?
> >
> > In what way "can't"? What happens / doesn't happen?
> >
> > -Stut
> >
> > --
> > http://stut.net/
> 
> Hi,
> 
> Problem was
> 
> $strng = "'cInputI' style='width:146px;'>";

Shouldn't that be $string = ...?

> $arrExplode = explode("'",$string);
> 
> $arrExplode contins
> 
> [array][1]
> * "0"=>[string]['cInputI' style='width:146px;'>]
> 
> And not only explode for example I canot trim first "'" 

Cheers,
Rob.
-- 
...
SwarmBuy.com - http://www.swarmbuy.com

Leveraging the buying power of the masses!
...

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



Re: [PHP] Re: PHP Brain Teasers

2007-07-12 Thread Daniel Brown

On 7/12/07, Jay Blanchard <[EMAIL PROTECTED]> wrote:

[snip]
Mine was trying to go for an old funk song that starts:

What goes up, must come down.
Spinning wheel got to go 'round
Drop all the painted ponies by the riverside.
[mumble] let the spinning wheel slide.

Only later did I realize I broke the cardinal rule of Name That Tune
and have NO IDEA what the song title is nor who wrote/sang it...
[/snip]

Spinning Wheel - Blood, Sweat & Tears

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






   That also illustrates to newbies the allowance of using an
underscore as a variable.  (Thank God it's almost Friday)

--
Daniel P. Brown
[office] (570-) 587-7080 Ext. 272
[mobile] (570-) 766-8107

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



Re: [PHP] Help setting up php

2007-07-12 Thread Robert Cummings
On Thu, 2007-07-12 at 09:25 -0400, Karl Schmitt wrote:
> Can someone please help me?  
>
> I am new to installing and working with php and webservers.  I am using
> IIS 6.
>
> I can not get php to load the ini file.

Your webserver is looking for it here:

C:\WINDOWS\php.ini

Is it there?

Cheers,
Rob.
-- 
...
SwarmBuy.com - http://www.swarmbuy.com

Leveraging the buying power of the masses!
...

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



Re: [PHP] need a form for connecting to paypal payment pro.

2007-07-12 Thread Daniel Brown

On 7/12/07, Ross <[EMAIL PROTECTED]> wrote:

Hi,

I need a secure form. I have one here
http://www.edinburghnights.co.uk/pay/php/curl_https.html but it has no
algorithm check on the CC number. Also I need to make the form secure. Can
someone point me to an example or tutorial.


Many thanks,


R.

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




   Ross,

   If you're processing through PayPal Website Payments Pro, why do
you need algorithms for credit card checking?  PayPal only charges the
fees on successful transactions, so you wouldn't pay anything if the
numbers were incorrect.

   Also, for specific help with the PayPal API, just go directly to
http://www.paypaldev.com/.  It's a forum that is run by a third-party,
but the actual people from PayPal's technical departments frequently
post in there to assist.

--
Daniel P. Brown
[office] (570-) 587-7080 Ext. 272
[mobile] (570-) 766-8107

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



[PHP] Help setting up php

2007-07-12 Thread Karl Schmitt
Can someone please help me?  

 

I am new to installing and working with php and webservers.  I am using
IIS 6.

 

I can not get php to load the ini file.

 

I have followed multiple guides including those listed on the install
pages and even went back and let the installer run, which changed
nothing.  

 

php in installed in ISAPI mode. 

 

You can see my test page here:

www.ctconline.com/test.php

 

I can post screen shots over email it that will help.  I need access to
the gd library at least for work.

 

Any help would be most appreciated.

 

Thank you Karl Schmitt



RE: [PHP] PHP 5.0.1 Date

2007-07-12 Thread Shafer, Philip
Yes, TZ env var helps and it works when I use putenv().

However if I set TZ in the server, and restart apache/php, TZ is getting
wiped out.

I think my server admin and I have to do some poking around to figure
out why.

Thanks for the help.

-phil

-Original Message-
From: Richard Lynch [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, July 11, 2007 4:25 PM
To: Shafer, Philip
Cc: php-general@lists.php.net
Subject: Re: [PHP] PHP 5.0.1 Date

Almost for sure from the TZ environment variable, and almost for sure
there's more about it in the FAQ, IIRC:
http://php.net/faq.php

On Wed, July 11, 2007 11:14 am, Shafer, Philip wrote:
> The time reported by the date() function is off by one hour.
>
> Currently our server is configured to EDT (-400) time zone, however
> our
> php installation is reporting the timezone at EST (-500).
>
> I know in php 5.1.x you can set the timezone in php.ini.  However
> we're
> not prepared to update php at the moment.
>
> Can anybody let me know where PHP 5.0.1 gets the timezone information
> from?  How can I change this so PHP returns the proper date.
>
> Thanks,
>
> Phil
>
> ---
> Philip Shafer
> Web Programmer
> University Web Services
> Rowan University
> Glassboro NJ 08028
> 856-256-4418
> [EMAIL PROTECTED]
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>


-- 
Some people have a "gift" link here.
Know what I want?
I want you to buy a CD from some indie artist.
http://cdbaby.com/browse/from/lynch
Yeah, I get a buck. So?

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



Re: [PHP] Single Quote in String functions

2007-07-12 Thread Sancar Saran
On Thursday 12 July 2007 15:11:28 Stut wrote:
> Sancar Saran wrote:
> > I cannot do any operation wiht single quote like
> >
> > explode("'",$strContent);
> >
> > Did I miss someting ?
>
Omg, It's my bad, sorry for lameness. 

Before the exploding text I do some encoding decodings. 

So? I do mis sequenced decodings. Thats why it does not work explode or trim, 
or str_replace even all other string functions.

Regards

Sancar

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



Re: [PHP] Array Question

2007-07-12 Thread Robert Cummings
On Thu, 2007-07-12 at 09:58 +0100, Stut wrote:
> Richard Lynch wrote:
> > On Wed, July 11, 2007 4:16 pm, Robert Cummings wrote:
> >>> But I'd have to say that the intent is not all that clear, really,
> >>> and
> >>> I'd be leery of this feature, personally.
> >> I wouldn't be leery at all. It's been around for a very long time and
> >> it's documented:
> >>
> >>
> >> http://www.php.net/manual/en/language.types.array.php#language.types.array.casting
> > 
> > As soon as I hit send I knew that would be mis-interpreted...
> > 
> > Leery is the wrong word.
> > 
> > Sorry.
> > 
> > It just seems a bit to clever to me...
> > 
> > I suspect I'd skim this code a hundred times and not realize what it
> > was doing.
> > 
> > But maybe that's just me. :-)
> 
> I would have to agree. I'm a big fan of self-documenting code, and this 
> one requires a little bit more knowledge of the intricacies of PHP than 
> I would expect from your 'average' developer.

Hmmm, I thought using an explicit cast was very self explanatory --
especially when the name of the cast is "array". Maybe I'm alone in that
thought. I mean if you convert a scalar to an array what do you expect
to get? An array with the scalar. *shrug* I can't see how it would be
anything else.

Cheers,
Rob.
-- 
...
SwarmBuy.com - http://www.swarmbuy.com

Leveraging the buying power of the masses!
...

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



Re: [PHP] Array Push question

2007-07-12 Thread Stut

M. Sokolewicz wrote:

Stut wrote:

Zoltán Németh wrote:

2007. 07. 12, csütörtök keltezéssel 10.28-kor Stut ezt írta:

John Comerford wrote:

Hi Folks,

Is there a better way of doing the following:

$Rows[] = array();
$currentRow = count($Rows) - 1;
$Rows[$currentRow]['test'] = "this is a test";

Specifically I am wonder if I can avoid having to use 'count'.
1) The code above will produce a $currentRow of -1 which is probably 
not what you want.


Maybe you didn't notice the [] in the first line of the OP's code?
I think this code should produce 0 for $currentRow, not -1.


Indeed, my bad. In that case the OP is better off creating the item in 
a temporary variable and then adding it to the array.


$row = array();
$row['test'] = 'this is a test';
$Rows[] = $row;

-Stut


what's wrong with skipping the temporary variable and just doing
$Rows[] = array('test'=>'this is a test');
?


Nothing, unless you're building a complex element. I was assuming that 
the OP had simplified their code down to the minimum required to 
illustrate the problem.


-Stut

--
http://stut.net/

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



Re: [PHP] Single Quote in String functions

2007-07-12 Thread Sancar Saran
On Thursday 12 July 2007 15:11:28 Stut wrote:
> Sancar Saran wrote:
> > I cannot do any operation wiht single quote like
> >
> > explode("'",$strContent);
> >
> > Did I miss someting ?
>
> In what way "can't"? What happens / doesn't happen?
>
> -Stut
>
> --
> http://stut.net/

Hi,

Problem was

$strng = "'cInputI' style='width:146px;'>";
$arrExplode = explode("'",$string);

$arrExplode contins

[array][1]
* "0"=>[string]['cInputI' style='width:146px;'>]

And not only explode for example I canot trim first "'" 

Regards

Sancar

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



[PHP] need a form for connecting to paypal payment pro.

2007-07-12 Thread Ross
Hi,

I need a secure form. I have one here 
http://www.edinburghnights.co.uk/pay/php/curl_https.html but it has no 
algorithm check on the CC number. Also I need to make the form secure. Can 
someone point me to an example or tutorial.


Many thanks,


R. 

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



Re: [PHP] Single Quote in String functions

2007-07-12 Thread Stut

Sancar Saran wrote:

I cannot do any operation wiht single quote like

explode("'",$strContent);

Did I miss someting ?


In what way "can't"? What happens / doesn't happen?

-Stut

--
http://stut.net/

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



[PHP] Re: Single Quote in String functions

2007-07-12 Thread M. Sokolewicz

Sancar Saran wrote:

Hi,

I cannot do any operation wiht single quote like

explode("'",$strContent);

Did I miss someting ?

Regards

Sancar


what do you mean by 'cannot do' ?

If I do:
http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Single Quote in String functions

2007-07-12 Thread Sancar Saran
Hi,

I cannot do any operation wiht single quote like

explode("'",$strContent);

Did I miss someting ?

Regards

Sancar

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



Re: [PHP] Array Push question

2007-07-12 Thread M. Sokolewicz

Stut wrote:

Zoltán Németh wrote:

2007. 07. 12, csütörtök keltezéssel 10.28-kor Stut ezt írta:

John Comerford wrote:

Hi Folks,

Is there a better way of doing the following:

$Rows[] = array();
$currentRow = count($Rows) - 1;
$Rows[$currentRow]['test'] = "this is a test";

Specifically I am wonder if I can avoid having to use 'count'.
1) The code above will produce a $currentRow of -1 which is probably 
not what you want.


Maybe you didn't notice the [] in the first line of the OP's code?
I think this code should produce 0 for $currentRow, not -1.


Indeed, my bad. In that case the OP is better off creating the item in a 
temporary variable and then adding it to the array.


$row = array();
$row['test'] = 'this is a test';
$Rows[] = $row;

-Stut


what's wrong with skipping the temporary variable and just doing
$Rows[] = array('test'=>'this is a test');
?

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



RE: [PHP] Re: PHP Brain Teasers

2007-07-12 Thread Jay Blanchard
[snip]
Mine was trying to go for an old funk song that starts:

What goes up, must come down.
Spinning wheel got to go 'round
Drop all the painted ponies by the riverside.
[mumble] let the spinning wheel slide.

Only later did I realize I broke the cardinal rule of Name That Tune
and have NO IDEA what the song title is nor who wrote/sang it...
[/snip]

Spinning Wheel - Blood, Sweat & Tears

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



Re: [PHP] Array Push question

2007-07-12 Thread Stut

Zoltán Németh wrote:

2007. 07. 12, csütörtök keltezéssel 10.28-kor Stut ezt írta:

John Comerford wrote:

Hi Folks,

Is there a better way of doing the following:

$Rows[] = array();
$currentRow = count($Rows) - 1;
$Rows[$currentRow]['test'] = "this is a test";

Specifically I am wonder if I can avoid having to use 'count'.
1) The code above will produce a $currentRow of -1 which is probably not 
what you want.


Maybe you didn't notice the [] in the first line of the OP's code?
I think this code should produce 0 for $currentRow, not -1.


Indeed, my bad. In that case the OP is better off creating the item in a 
temporary variable and then adding it to the array.


$row = array();
$row['test'] = 'this is a test';
$Rows[] = $row;

-Stut

--
http://stut.net/

2) If you actually mean that you have an array that contains items and 
you want the last one, used end (http://php.net/end).


3) I'm not really sure what the context is, but this is a very odd way 
of working with arrays. Either you already know the key or you don't. If 
you're just trying to append to the array you can do that with the 
following syntax... $Rows[] = array('test' => 'this is a test');


-Stut

--
http://stut.net/





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



Re: [PHP] Array Push question

2007-07-12 Thread Zoltán Németh
2007. 07. 12, csütörtök keltezéssel 10.28-kor Stut ezt írta:
> John Comerford wrote:
> > Hi Folks,
> > 
> > Is there a better way of doing the following:
> > 
> > $Rows[] = array();
> > $currentRow = count($Rows) - 1;
> > $Rows[$currentRow]['test'] = "this is a test";
> > 
> > Specifically I am wonder if I can avoid having to use 'count'.
> 
> 1) The code above will produce a $currentRow of -1 which is probably not 
> what you want.

Maybe you didn't notice the [] in the first line of the OP's code?
I think this code should produce 0 for $currentRow, not -1.

greets
Zoltán Németh

> 
> 2) If you actually mean that you have an array that contains items and 
> you want the last one, used end (http://php.net/end).
> 
> 3) I'm not really sure what the context is, but this is a very odd way 
> of working with arrays. Either you already know the key or you don't. If 
> you're just trying to append to the array you can do that with the 
> following syntax... $Rows[] = array('test' => 'this is a test');
> 
> -Stut
> 
> -- 
> http://stut.net/
> 

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



Re: [PHP] Array Push question

2007-07-12 Thread Thijs Lensselink
On Thu, 12 Jul 2007 18:45:36 +1000, John Comerford <[EMAIL PROTECTED]> wrote:
> Hi Folks,
> 
> Is there a better way of doing the following:
> 
> $Rows[] = array();
> $currentRow = count($Rows) - 1;
> $Rows[$currentRow]['test'] = "this is a test";
> 
> Specifically I am wonder if I can avoid having to use 'count'.
> 
> TIA,
>   JC
> 
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php

Seems my eyes are to tired today. Didn't read the code very good.
But the answer still stays the same :)

$Rows = array();
array_push($Rows, array('test' => 'this is a test'));

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



Re: [PHP] Array Push question

2007-07-12 Thread Stut

John Comerford wrote:

Hi Folks,

Is there a better way of doing the following:

$Rows[] = array();
$currentRow = count($Rows) - 1;
$Rows[$currentRow]['test'] = "this is a test";

Specifically I am wonder if I can avoid having to use 'count'.


1) The code above will produce a $currentRow of -1 which is probably not 
what you want.


2) If you actually mean that you have an array that contains items and 
you want the last one, used end (http://php.net/end).


3) I'm not really sure what the context is, but this is a very odd way 
of working with arrays. Either you already know the key or you don't. If 
you're just trying to append to the array you can do that with the 
following syntax... $Rows[] = array('test' => 'this is a test');


-Stut

--
http://stut.net/

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



Re: [PHP] Array Question

2007-07-12 Thread Stut

Richard Lynch wrote:

On Wed, July 11, 2007 4:16 pm, Robert Cummings wrote:

But I'd have to say that the intent is not all that clear, really,
and
I'd be leery of this feature, personally.

I wouldn't be leery at all. It's been around for a very long time and
it's documented:


http://www.php.net/manual/en/language.types.array.php#language.types.array.casting


As soon as I hit send I knew that would be mis-interpreted...

Leery is the wrong word.

Sorry.

It just seems a bit to clever to me...

I suspect I'd skim this code a hundred times and not realize what it
was doing.

But maybe that's just me. :-)


I would have to agree. I'm a big fan of self-documenting code, and this 
one requires a little bit more knowledge of the intricacies of PHP than 
I would expect from your 'average' developer.


If performance is going to be an issue (and in terms of cycles I can't 
see this saving much), buy faster/more hardware - it's far cheaper than 
developer time!!


-Stut

--
http://stut.net/

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



Re: [PHP] Array Push question

2007-07-12 Thread dev
On Thu, 12 Jul 2007 18:45:36 +1000, John Comerford <[EMAIL PROTECTED]> wrote:
> Hi Folks,
> 
> Is there a better way of doing the following:
> 
> $Rows[] = array();
> $currentRow = count($Rows) - 1;
> $Rows[$currentRow]['test'] = "this is a test";
> 
> Specifically I am wonder if I can avoid having to use 'count'.
> 
> TIA,
>   JC
> 
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php

This code looks weird...

$currenRow will be numeric. So why would you do $currentRow['test']?
Anyway if you just wanna add an element to the end of the array use array_push

http://nl3.php.net/manual/en/function.array-push.php

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



[PHP] Array Push question

2007-07-12 Thread John Comerford

Hi Folks,

Is there a better way of doing the following:

$Rows[] = array();
$currentRow = count($Rows) - 1;
$Rows[$currentRow]['test'] = "this is a test";

Specifically I am wonder if I can avoid having to use 'count'.

TIA,
 JC

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



Re: [PHP] getting the "next" element of an associative array

2007-07-12 Thread Olav Mørkrid

yep, a for loop is the fallback i use now.

any reason why there isn't a built-in function for this?

any plans for it in future versions of php?

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



Re: [PHP] getting the "next" element of an associative array

2007-07-12 Thread Chris

Olav Mørkrid wrote:

chris

for your suggestion to work, the internal array pointer of $array
would first have to be set to point to the current element ($index).

but how do you do this?

this may seem like childs play, but i actually can't find any
documented php function for this. it would be something like:


My apologies - I misread your post. I just thought you wanted the next 
record, not the next key.


Jim's function looked pretty easy and simple :)


On 12/07/07, Chris <[EMAIL PROTECTED]> wrote:

Olav Mørkrid wrote:
> let's say we have the following associative array:
>
> $array = array(
>  "red" => "ferrari",
>  "yellow" => "volkswagen",
>  "green" => "mercedes",
>  "blue" => "volvo"
> );
>
> then we have a current index into the array:
>
> $index = "yellow";
> $current = $array[$index];
>
> now: how do i get the key of the next array element (in this case 
"green")?

>
> $next = ?

Funnily enough:

$next = next($array);

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


--
Postgresql & php tutorials
http://www.designmagick.com/






--
Postgresql & php tutorials
http://www.designmagick.com/

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



Re: [PHP] getting the "next" element of an associative array

2007-07-12 Thread Olav Mørkrid

chris

for your suggestion to work, the internal array pointer of $array
would first have to be set to point to the current element ($index).

but how do you do this?

this may seem like childs play, but i actually can't find any
documented php function for this. it would be something like:

array_set_internal_pointer($array, $index);

On 12/07/07, Chris <[EMAIL PROTECTED]> wrote:

Olav Mørkrid wrote:
> let's say we have the following associative array:
>
> $array = array(
>  "red" => "ferrari",
>  "yellow" => "volkswagen",
>  "green" => "mercedes",
>  "blue" => "volvo"
> );
>
> then we have a current index into the array:
>
> $index = "yellow";
> $current = $array[$index];
>
> now: how do i get the key of the next array element (in this case "green")?
>
> $next = ?

Funnily enough:

$next = next($array);

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


--
Postgresql & php tutorials
http://www.designmagick.com/



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