php-general Digest 25 Apr 2009 01:03:02 -0000 Issue 6085
Topics (messages 291926 through 291959):
Re: Self-Process php forms or not?
291926 by: MEM
291929 by: Bob McConnell
291930 by: Jay Blanchard
291931 by: Sándor Tamás (HostWare Kft.)
291932 by: Tony Marston
291934 by: Tony Marston
291938 by: MEM
Re: Unable to send mail from PHP to AT&T e-mail address
291927 by: Bob McConnell
Re: checkboxes
291928 by: PJ
291936 by: tedd
Re: MySQL, MD5 and SHA1
291933 by: Andrew Ballard
Re: error with hosting
291935 by: Andrew Ballard
291937 by: Jan G.B.
291939 by: 9el
Re: MAIL Error
291940 by: tedd
291942 by: Bastien Koert
291944 by: Jan G.B.
Re: Creating A Chat?
291941 by: Matthieu
help with explode()
291943 by: Adam Williams
291945 by: Jônatas Zechim
291946 by: Jan G.B.
291947 by: Adam Williams
291948 by: Jan G.B.
291949 by: Adam Williams
Expression Engine
291950 by: Skip Evans
291951 by: Bastien Koert
I need ideas for things to code
291952 by: Andrew Hucks
291953 by: Nathan Rixham
291954 by: Michael Shadle
291956 by: Bastien Koert
291959 by: Adam Williams
inexplicable behaviour
291955 by: PJ
291957 by: Jônatas Zechim
SMTP mail server
291958 by: Ron Piggott
Administrivia:
To subscribe to the digest, e-mail:
[email protected]
To unsubscribe from the digest, e-mail:
[email protected]
To post to the list, e-mail:
[email protected]
----------------------------------------------------------------------
--- Begin Message ---
So, on your opinion, we can call that method, on some circumstances, a good
practice?
What about the moto: "let's separate business from presentation?"
Thanks once again,
Márcio
> -----Original Message-----
> From: Sándor Tamás (HostWare Kft.) [mailto:[email protected]]
> Sent: sexta-feira, 24 de Abril de 2009 13:53
> To: 'PHP-General List'
> Subject: Re: [PHP] Self-Process php forms or not?
>
> I think the main advantage is that if something goes wrong processing
> the
> datas, you can show the form again without redirecting again.
>
> And if you have to change the behavior of the page, you have to change
> only
> one file instead of two.
>
> SanTa
--- End Message ---
--- Begin Message ---
When you have it all in one file, the first thing you do is check to see if
this request was submitted from the form. If not, you send the blank form. If
it was, you validate all of the data. When a validation fails, you add error
messages and resend the form with any fields that passed the validation already
filled in. When validation succeeds, process and move on. No muss, no fuss.
Bob McConnell
-----Original Message-----
From: Sándor Tamás (HostWare Kft.) [mailto:[email protected]]
Sent: Friday, April 24, 2009 8:53 AM
To: 'PHP-General List'
Subject: Re: [PHP] Self-Process php forms or not?
I think the main advantage is that if something goes wrong processing the
datas, you can show the form again without redirecting again.
And if you have to change the behavior of the page, you have to change only
one file instead of two.
SanTa
----- Original Message -----
From: "MEM" <[email protected]>
To: "'PHP-General List'" <[email protected]>
Sent: Friday, April 24, 2009 2:34 PM
Subject: [PHP] Self-Process php forms or not?
I'm trying to understand the advantages behind opting by using a
Self-Process PHP Form, instead of having a form and then point the action of
the form to another .php page.
Can anyone point me some resources about this. Why using one instead of
another. What are the main advantages?
Regards,
Márcio
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--- End Message ---
--- Begin Message ---
[snip] What about the moto: "let's separate business from presentation?"[/snip]
This depends on how strictly you're following any given model like MVC. IMHO
you should use the right tool for the job.
--- End Message ---
--- Begin Message ---
Well, if you keen on separating business from presentation (which is usually
a good practice), you can always do this:
<?php
if (isset($_POST['action']))
{
if (DoProcess($_POST))
{
PrintSuccess();
}
else
{
PrintFailure();
PrintForm();
}
}
?>
So you can call in fact the processing page, the real presentation can be in
another PHP file, as well as the processing functions. Of course, instead of
PrintForm() you can actually implant the real HTML code.
And by the way, if you keep the form and the processing parts in one file,
and create the form like this:
<FORM action="<?= $_SERVER['PHP_SELF'] ?>">
you can name your file as you want, it will work without rewriting the page.
SanTa
----- Original Message -----
From: "MEM" <[email protected]>
To: "'Sándor Tamás (HostWare Kft.)'" <[email protected]>;
"'PHP-General List'" <[email protected]>
Sent: Friday, April 24, 2009 3:03 PM
Subject: RE: [PHP] Self-Process php forms or not?
So, on your opinion, we can call that method, on some circumstances, a good
practice?
What about the moto: "let's separate business from presentation?"
Thanks once again,
Márcio
-----Original Message-----
From: Sándor Tamás (HostWare Kft.) [mailto:[email protected]]
Sent: sexta-feira, 24 de Abril de 2009 13:53
To: 'PHP-General List'
Subject: Re: [PHP] Self-Process php forms or not?
I think the main advantage is that if something goes wrong processing
the
datas, you can show the form again without redirecting again.
And if you have to change the behavior of the page, you have to change
only
one file instead of two.
SanTa
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--- End Message ---
--- Begin Message ---
Having a script that is self executing - when it posts back to itself
instead of a separate script - has absolutely nothing to do with the
separation of business and presentation. It is possible for a single script
to use separate components for the presentation, business and data access
layers.
--
Tony Marston
http://www.tonymarston.net
http://www.radicore.org
""MEM"" <[email protected]> wrote in message
news:002b01c9c4dd$08569bc0$1903d3...@com...
> So, on your opinion, we can call that method, on some circumstances, a
> good
> practice?
>
> What about the moto: "let's separate business from presentation?"
>
>
> Thanks once again,
> Márcio
> -----Original Message-----
> From: Sándor Tamás (HostWare Kft.) [mailto:[email protected]]
> Sent: sexta-feira, 24 de Abril de 2009 13:53
> To: 'PHP-General List'
> Subject: Re: [PHP] Self-Process php forms or not?
>
> I think the main advantage is that if something goes wrong processing
> the
> datas, you can show the form again without redirecting again.
>
> And if you have to change the behavior of the page, you have to change
> only
> one file instead of two.
>
> SanTa
--- End Message ---
--- Begin Message ---
What you are describing is known as a "self executing" script where the
script posts back to itself. In other words it has two passes - the first
uses the GET method to build the screen for the user, which may or may not
be empty, while the second uses the POST method to send the user's changes
back to the server for validation and updating. By dealing with both the GET
and POST in a single script it means that you don't have to redirect to a
different script if you have to redisplay the data because of invalid use
input.
--
Tony Marston
http://www.tonymarston.net
http://www.radicore.org
""MEM"" <[email protected]> wrote in message
news:002301c9c4d9$03515920$09f40b...@com...
I'm trying to understand the advantages behind opting by using a
Self-Process PHP Form, instead of having a form and then point the action of
the form to another .php page.
Can anyone point me some resources about this. Why using one instead of
another. What are the main advantages?
Regards,
Márcio
--- End Message ---
--- Begin Message ---
Thanks to all for your replies.
I'm more elucidated about the possibilities now. I have seen here a lot of
keywords to start digging. :)
Thanks once again,
Márcio
> -----Original Message-----
> From: Tony Marston [mailto:[email protected]]
> Sent: sexta-feira, 24 de Abril de 2009 14:20
> To: [email protected]
> Subject: Re: [PHP] Self-Process php forms or not?
>
> Having a script that is self executing - when it posts back to itself
> instead of a separate script - has absolutely nothing to do with the
> separation of business and presentation. It is possible for a single
> script
> to use separate components for the presentation, business and data
> access
> layers.
>
> --
> Tony Marston
> http://www.tonymarston.net
> http://www.radicore.org
>
> ""MEM"" <[email protected]> wrote in message
> news:002b01c9c4dd$08569bc0$1903d3...@com...
> > So, on your opinion, we can call that method, on some circumstances,
> a
> > good
> > practice?
> >
> > What about the moto: "let's separate business from presentation?"
> >
> >
> > Thanks once again,
> > Márcio
>
>
> > -----Original Message-----
> > From: Sándor Tamás (HostWare Kft.) [mailto:[email protected]]
> > Sent: sexta-feira, 24 de Abril de 2009 13:53
> > To: 'PHP-General List'
> > Subject: Re: [PHP] Self-Process php forms or not?
> >
> > I think the main advantage is that if something goes wrong processing
> > the
> > datas, you can show the form again without redirecting again.
> >
> > And if you have to change the behavior of the page, you have to
> change
> > only
> > one file instead of two.
> >
> > SanTa
>
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
--- End Message ---
--- Begin Message ---
From: Chris
>>> the ini_set (or you can set the 5th param to the mail() function) is
a
>>
>>> return-path. If the message bounces (recipient's mailbox full,
server
>>> down, whatever the reason) it gets delivered to that address. They
>> serve
>>> different purposes.
>>
>> The dirty little secret that nobody seems to know is that the RFCs
>> reserve Return-path for use by the MTA servers. It can be replaced by
>> any of them in the routing chain and is used when mail crosses into
or
>> out of SMTP networks. If you want a return address other than From to
>> stick all the way through, you have to use the Reply-to and/or Sender
>> headers.
>
> Emails don't bounce to those addresses though do they? I've always
> thought the return-path is where an email is bounced to and reply-to
etc
> are used by mail clients, not the mta's.
The way I read it, the return-path field is used to indicate a gateway
where the message entered the current email network. So a bounced
message has to be returned to that gateway to get back to the network
from whence it came. This is useful where traffic passes into an SMTP
network from a network with an older routing mechanism, or vice versa.
The intent is to return the bounce to the Sender or From address, in
that order.
But, since the RFC specifically says the field is reserved for use by
the MTAs, it is not proper behavior for an email client to add it to the
header.
Reply-to is a specific instruction to the recipients client software to
insert this address as To when a reply is composed. It is ignored by the
MTA.
If you don't want bounces to go to the From address, use Sender. It was
intended for mailing lists and administrative assistants to send mail on
behalf of someone else without having to forge their From address. It's
also useful when you have a web site running on a commercial server farm
outside your domain that has to send mail that acts like it came from
inside that domain. Many border filters will block mail when the From
line says it came from within their domain. So the From address can be
the web server (it doesn't even have to be a valid address) while Sender
indicates the address in the domain where any bounces need to be sent.
Bob McConnell
--- End Message ---
--- Begin Message ---
Lists wrote:
> tedd wrote:
>> At 4:58 PM -0400 4/23/09, PJ wrote:
>>>
>>> >>> tedd wrote:
>>> >>> > http://php1.net/a/edit-db-demo/
>>> >>>
>>> >Hmmmm.... I've looked at your demo and, frankly, don't see it
>>> working.
>>> When I enter names and click on one of the search buttons, I don't get
>>> sane results. For instance, entering Johnson in last name and John in
>>> first name, I click on search first name and I get an entry from page R
>>> for first name John and Last name Raab. Doesn't make sense.
>>
>> PJ:
>>
>> Okay, if you enter "Johnson" in the last name text box and click the
>> "Search Last Name" button, the demo will provide you with a record
>> that has "Johnson" as the last name.
>>
>> Likewise, if you enter "John" in the first name text-box and click
>> the "Search First Name" button, the demo will provide you with a
>> record that has "John" as the first name.
>>
>> Both of those work -- so, where's the confusion?
>>
>> Apparently you want to enter "Johnson" in the last name text box and
>> "John" in the first name text box and then click something to find
>> that specific name right? Well, the demo is not set-up that way --
>> there is no "Click here and I'll find the specific person who has
>> this first and last name".
>>
>> The demo is set up to search for first OR last name OR email address.
>> It also provides a way to sort the records such that one can
>> sequentially step any sort made on first-name/last-name; or
>> last-name/first-name; or email address.
>>
>> It only does what it says it does. Did you review the instructions at
>> the bottom?
>>
>> Cheers,
>>
>> tedd
>
>
> Tedd, nice looking contact demo thingy.. but PJ has a point. ;-) It
> would make the app perhaps more intuitive if one could just type text
> in any of the 3 fields and then spit out results that match all of the
> comparisons that are not blank by clicking one button.
>
> .. not to take away from what you have done, but perhaps a future
> evolution of the demo.
>
> Donovan
>
Exactly. I expected to get all instances of Johnson or of John but I got
only 1 and I saw that there were others, so that didn't seem right.
And, if I may point out, the instructions are not available if js is not
enabled O:-) so that leaves only intuition to decipher things
especially if you only want to do a search.
BTW - I seem to have solved the problem of filtering the inputs. Was
rather simple: just use one form for each search.
And to avoid using @ for the error of $_POST['select'] one just has to
declare one just has to declare
$_POST['submit'] = ""; at top of script. :-) (I'm learning, I'm
learning) - now I have to check it all out.
--
unheralded genius: "A clean desk is the sign of a dull mind. "
-------------------------------------------------------------
Phil Jourdan --- [email protected]
http://www.ptahhotep.com
http://www.chiccantine.com/andypantry.php
--- End Message ---
--- Begin Message ---
At 5:30 PM -0500 4/23/09, Lists wrote:
Tedd, nice looking contact demo thingy.. but PJ has a point. ;-) It
would make the app perhaps more intuitive if one could just type
text in any of the 3 fields and then spit out results that match all
of the comparisons that are not blank by clicking one button.
.. not to take away from what you have done, but perhaps a future
evolution of the demo.
Donovan
Point taken.
Cheers,
tedd
--
-------
http://sperling.com http://ancientstones.com http://earthstones.com
--- End Message ---
--- Begin Message ---
On Wed, Apr 22, 2009 at 10:25 AM, Jan G.B. <[email protected]> wrote:
> 2009/4/21 Per Jessen <[email protected]>:
>> Jan G.B. wrote:
>>
>>> A web application that uses an external db server would be quite ...
>>> uhm... slow! Anyone did this, yet? ;)
>>
>> Certainly, and it's not slow. It depends entirely on your connection to
>> the public internet.
>>
>>
>
> As we're speaking of the internet, it also depends on the route and so
> it depends on servers which are not underlying your administration (in
> most cases at least).
> Having several servers with gigabit internet access also might be more
> expensive than a cat6 patch cable and a gigabit nic. So this setup
> would be just mad.
>
> Regards
>
There are definitely other ways to make the communication secure,
whether you route it through an local subnet, configure a totally
private network using secondary NICs, encrypt the connection, host
both on the same machine and use a local loopback address, etc. If
you've done one or more of these things to secure the pathway between
the web server and the database, and if you know that no one is going
to come behind you and reconfigure things, then you can probably rest
fairly comfortably passing unhashed/unencrypted values to MySQL all
you want.
I only made the suggestion as a matter of defensive programming, since
not everyone developing with PHP knows and/or has control over how PHP
and MySQL communicate. For many sites, a developer writing an app has
no idea whether the web server and database are on the same physical
machine, let alone how the two services communicate. What's more, in
some of these environments, what is true today could change tomorrow.
(The issue of query logs is another good point, too.) All I'm saying
is if you hash/encrypt the value in PHP rather than passing it off to
MySQL in open text, you don't have to worry about whether the
connection is (or becomes) sniffable.
For that matter if you're going to bring up performance, I know many
DBAs who would argue this as performance issue as well.
Andrew
--- End Message ---
--- Begin Message ---
On Tue, Apr 21, 2009 at 1:20 PM, Jan G.B. <[email protected]> wrote:
> Do yourself a favour:
>
> * remopve that 1337 hax0r name - it makes you look like a dumbass
This coming from someone whose e-mail address is ro0ot.w...@....?
Sounds a little ironic. ;-)
Andrew
--- End Message ---
--- Begin Message ---
2009/4/24 Andrew Ballard <[email protected]>:
> On Tue, Apr 21, 2009 at 1:20 PM, Jan G.B. <[email protected]> wrote:
>> Do yourself a favour:
>>
>> * remopve that 1337 hax0r name - it makes you look like a dumbass
>
> This coming from someone whose e-mail address is ro0ot.w...@....?
> Sounds a little ironic. ;-)
Got me. ;)
But try to find any free google-name like "Jan", etc.. I was looking
for something with "root" in the address. and actually this is only
the address, not my NAME.
--- End Message ---
--- Begin Message ---
On Fri, Apr 24, 2009 at 7:41 PM, Jan G.B. <[email protected]> wrote:
> 2009/4/24 Andrew Ballard <[email protected]>:
> > On Tue, Apr 21, 2009 at 1:20 PM, Jan G.B. <[email protected]>
> wrote:
> >> Do yourself a favour:
> >>
> >> * remopve that 1337 hax0r name - it makes you look like a dumbass
> >
> > This coming from someone whose e-mail address is ro0ot.w...@....?
> > Sounds a little ironic. ;-)
>
> Got me. ;)
> But try to find any free google-name like "Jan", etc.. I was looking
> for something with "root" in the address. and actually this is only
> the address, not my NAME.
>
HAHAHAHA you gotta look at this :D http://tr.im/jxK7
--- End Message ---
--- Begin Message ---
At 11:13 AM +0200 4/24/09, Jan G.B. wrote:
2009/4/22 tedd <[email protected]>:
> Your opinion as to IF I should say something, or not, carries
little weight.
When you've donated enough time helping others on this list, then perhaps
that will change.
Sorry, but that's a bad attitude in my opinion. It's like "No matter
how right or wrong you are, I will not listen to you unless you've
kissed Johns feet 10 times, like I did."
Nonsense. It not about who kisses who's feet and you know it. You're
deliberately clouding the issue in a failed attempt to support your
position that signatures should of any length. That's bullshit.
My point is that many of us donate our time on a regular basis to
this list to help others. And those regulars I consider friends. As
such their comments and opinions matter.
Whereas, your opinion doesn't matter much because you haven't
contributed anything I can remember other than a "superior than thou"
attitude about my comments that a poster should trim his signature,
which is considered normal and proper for posting to a list.
It's not hard to find support for my claim, such as:
http://en.wikipedia.org/wiki/Netiquette
So please, if your going to do nothing but be argumentative and
present obtuse opinion to boost your ego, then find something else to
do with your time. As far as I can see, you are wasting it here.
Cheers,
tedd
--
-------
http://sperling.com http://ancientstones.com http://earthstones.com
--- End Message ---
--- Begin Message ---
On Fri, Apr 24, 2009 at 10:03 AM, tedd <[email protected]> wrote:
> At 11:13 AM +0200 4/24/09, Jan G.B. wrote:
>
>> 2009/4/22 tedd <[email protected]>:
>> > Your opinion as to IF I should say something, or not, carries little
>> weight.
>>
>>> When you've donated enough time helping others on this list, then
>>> perhaps
>>> that will change.
>>>
>>
>> Sorry, but that's a bad attitude in my opinion. It's like "No matter
>> how right or wrong you are, I will not listen to you unless you've
>> kissed Johns feet 10 times, like I did."
>>
>
> Nonsense. It not about who kisses who's feet and you know it. You're
> deliberately clouding the issue in a failed attempt to support your position
> that signatures should of any length. That's bullshit.
>
> My point is that many of us donate our time on a regular basis to this list
> to help others. And those regulars I consider friends. As such their
> comments and opinions matter.
>
> Whereas, your opinion doesn't matter much because you haven't contributed
> anything I can remember other than a "superior than thou" attitude about my
> comments that a poster should trim his signature, which is considered normal
> and proper for posting to a list.
>
> It's not hard to find support for my claim, such as:
>
> http://en.wikipedia.org/wiki/Netiquette
>
> So please, if your going to do nothing but be argumentative and present
> obtuse opinion to boost your ego, then find something else to do with your
> time. As far as I can see, you are wasting it here.
>
> Cheers,
>
> tedd
>
> --
> -------
> http://sperling.com http://ancientstones.com http://earthstones.com
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
Don't make me send you to your rooms, girls. Play nice!
--
Bastien
Cat, the other other white meat
--- End Message ---
--- Begin Message ---
2009/4/24 Bastien Koert <[email protected]>:
>
>
> On Fri, Apr 24, 2009 at 10:03 AM, tedd <[email protected]> wrote:
>> Whereas, your opinion doesn't matter much because you haven't contributed
>> anything I can remember
Tedd, it's not my problem that your sight is limited.
I don't believe the Netiquette states that "whatever one says, it
doesn't matter unless the reader noticed <whatever>"
>>
>> It's not hard to find support for my claim, such as:
>>
>> http://en.wikipedia.org/wiki/Netiquette
>>
>> So please, if your going to do nothing but be argumentative and present
>> obtuse opinion to boost your ego, then find something else to do with your
>> time. As far as I can see, you are wasting it here.
>>
>> Cheers,
>>
>> tedd
>>
>> --
>> -------
>> http://sperling.com http://ancientstones.com http://earthstones.com
>>
>> --
>> PHP General Mailing List (http://www.php.net/)
>> To unsubscribe, visit: http://www.php.net/unsub.php
>>
>
> Don't make me send you to your rooms, girls. Play nice!
>
Seems to be to late. That wasn't nice at all.
> --
>
> Bastien
>
> Cat, the other other white meat
>
--- End Message ---
--- Begin Message ---
"Nitsan Bin-Nun" <[email protected]> a écrit dans le message de
news:[email protected]...
Hi Guys,
I have created few chats in the past, but I'm trying to create a new one
which saves on HTTP requests and do not become an overkill to the server
as
more users get in.
The chat is a one on one, I'm trying to achieve this:
* A user sends a message
* The message is not saved/save temporarily on the server
* The message is showed to the other user
Any ideas how i should implement this?
I have no idea how to build it in the most efficiency way, any notes or
recommendations or
anything that I should pay attention to during development will be very
appreciated.
--- End Message ---
--- Begin Message ---
I have a form where users submit search terms and it explodes the terms
into an array based upon spaces. But, how can I have explode() keep
words in quotation marks together? For example, if someone enters on
the form:
John Jill "Judy Smith"
and I run $termsarray = explode(" ", $_POST["terms"]);
it explodes into:
Array ( [0] => John [1] => Jill [2] => "Judy [3] => Smith" )
but I'd like it to explode into:
Array ( [0] => John [1] => Jill [2] => "Judy Smith" )
--- End Message ---
--- Begin Message ---
$var = "John \"Jill\" \"Judy Smith\"";
echo $var;
$var2=explode("\"",$var);
echo '<pre>';
print_r($var2);
echo '</pre>';
$tVar=count($var2);
for($i=0;$i<$tVar;$i++){if(strlen($var2[$i])<2){unset($var2[$i]);}else{$var2
[$i]=trim($var2[$i]);}}
$var2=array_values($var2);
echo '<pre>';
print_r($var2);
echo '</pre>';
Is that u want?
Zechim
SP/Brazil
-----Mensagem original-----
De: Adam Williams [mailto:[email protected]]
Enviada em: sexta-feira, 24 de abril de 2009 12:41
Para: PHP General list
Assunto: [PHP] help with explode()
I have a form where users submit search terms and it explodes the terms
into an array based upon spaces. But, how can I have explode() keep
words in quotation marks together? For example, if someone enters on
the form:
John Jill "Judy Smith"
and I run $termsarray = explode(" ", $_POST["terms"]);
it explodes into:
Array ( [0] => John [1] => Jill [2] => "Judy [3] => Smith" )
but I'd like it to explode into:
Array ( [0] => John [1] => Jill [2] => "Judy Smith" )
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--- End Message ---
--- Begin Message ---
2009/4/24 Adam Williams <[email protected]>:
> I have a form where users submit search terms and it explodes the terms into
> an array based upon spaces. But, how can I have explode() keep words in
> quotation marks together? For example, if someone enters on the form:
>
> John Jill "Judy Smith"
>
> and I run $termsarray = explode(" ", $_POST["terms"]);
>
> it explodes into:
>
> Array ( [0] => John [1] => Jill [2] => "Judy [3] => Smith" )
>
> but I'd like it to explode into:
>
> Array ( [0] => John [1] => Jill [2] => "Judy Smith" )
>
You could try it with regular expression matching..
for example:
<?php
preg_match_all('/([a-z]+|"[a-z ]+")/i', $searchstring, $resultarray);
?>
Regards
--- End Message ---
--- Begin Message ---
Jan G.B. wrote:
You could try it with regular expression matching..
for example:
<?php
preg_match_all('/([a-z]+|"[a-z ]+")/i', $searchstring, $resultarray);
?>
Regards
Thanks. That seems to create 2 duplicate arrays, though. Can it be
narrowed down to just array [0]?
preg_match_all('/([a-z]+|"[a-z ]+")/i', $_POST["terms"], $termsarray);
echo $_POST["terms"]."<br>";
print_r($termsarray);
displays:
John Jill "Judy Smith"
Array ( [0] => Array ( [0] => John [1] => Jill [2] => "Judy Smith" ) [1]
=> Array ( [0] => John [1] => Jill [2] => "Judy Smith" ) )
--- End Message ---
--- Begin Message ---
2009/4/24 Adam Williams <[email protected]>:
>
>
> Jan G.B. wrote:
>>
>> You could try it with regular expression matching..
>> for example:
>> <?php
>> preg_match_all('/([a-z]+|"[a-z ]+")/i', $searchstring, $resultarray);
>> ?>
>>
>>
>> Regards
>>
>
> Thanks. That seems to create 2 duplicate arrays, though. Can it be
> narrowed down to just array [0]?
>
> preg_match_all('/([a-z]+|"[a-z ]+")/i', $_POST["terms"], $termsarray);
> echo $_POST["terms"]."<br>";
> print_r($termsarray);
>
> displays:
>
> John Jill "Judy Smith"
> Array ( [0] => Array ( [0] => John [1] => Jill [2] => "Judy Smith" ) [1] =>
> Array ( [0] => John [1] => Jill [2] => "Judy Smith" ) )
>
Yes, preg_match_all returns all matches and the subpattern matches
(the "stuff" inside the brakes)
You can ommit stop it by using (?:) instead of ()..
So: preg_match_all('/(?:[a-z]+|"[a-z ]+")/i', $_POST["terms"], $termsarray)
You might want to check out the regular expression manuals on
http://www.php.net/manual/en/book.pcre.php
regards
>
--- End Message ---
--- Begin Message ---
Jan G.B. wrote:
Yes, preg_match_all returns all matches and the subpattern matches
(the "stuff" inside the brakes)
You can ommit stop it by using (?:) instead of ()..
So: preg_match_all('/(?:[a-z]+|"[a-z ]+")/i', $_POST["terms"], $termsarray)
You might want to check out the regular expression manuals on
http://www.php.net/manual/en/book.pcre.php
regards
Thanks, you've been a big help, that works great!
--- End Message ---
--- Begin Message ---
Hey all,
Anyone have any experience with Expression Engine? I have a
new client that wants me to use it to build a site and I must
say I am rather underwhelmed.
But I happen to be one of those people that believe in
developing your own lightweight framework you know yourself
inside and out and building upon that for new sites.
I find the learning curve, combined with inherent limitations
of systems like this to take all the fun out of coding and
project development... and make me want to become an insurance
salesman.
Thoughts on Expression Engine for those of you with exposure
to it?
Thanks,
Skip
--
====================================
Skip Evans
Big Sky Penguin, LLC
503 S Baldwin St, #1
Madison WI 53703
608.250.2720
http://bigskypenguin.com
------------------------------------
Those of you who believe in
telekinesis, raise my hand.
-- Kurt Vonnegut
--- End Message ---
--- Begin Message ---
On Apr 24, 2009, at 18:06, Skip Evans <[email protected]> wrote:
Hey all,
Anyone have any experience with Expression Engine? I have a new
client that wants me to use it to build a site and I must say I am
rather underwhelmed.
But I happen to be one of those people that believe in developing
your own lightweight framework you know yourself inside and out and
building upon that for new sites.
I find the learning curve, combined with inherent limitations of
systems like this to take all the fun out of coding and project
development... and make me want to become an insurance salesman.
Thoughts on Expression Engine for those of you with exposure to it?
Thanks,
Skip
--
====================================
Skip Evans
Big Sky Penguin, LLC
503 S Baldwin St, #1
Madison WI 53703
608.250.2720
http://bigskypenguin.com
------------------------------------
Those of you who believe in
telekinesis, raise my hand.
-- Kurt Vonnegut
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
I remember looking at it some time and the licensing seems restrictive
to what I wanted to do. I have at this point settled on using
codeigniter and ezcompoments has some cool stuff as well
--- End Message ---
--- Begin Message ---
I've been coding PHP for about a year, and I'm running out of things to code
that force me to learn new things. If you have any suggestions, I'd greatly
appreciate it.
--- End Message ---
--- Begin Message ---
Andrew Hucks wrote:
I've been coding PHP for about a year, and I'm running out of things to code
that force me to learn new things. If you have any suggestions, I'd greatly
appreciate it.
a: get paid to do it; pick up work on freelance sites and they'll give
you the ideas + you'll get paid to do it
b: see a
--- End Message ---
--- Begin Message ---
how about:
a replacement for mailman in php
a trac/redmine written in php
a better bugzilla replacement in php
On Fri, Apr 24, 2009 at 4:25 PM, Nathan Rixham <[email protected]> wrote:
> Andrew Hucks wrote:
>>
>> I've been coding PHP for about a year, and I'm running out of things to
>> code
>> that force me to learn new things. If you have any suggestions, I'd
>> greatly
>> appreciate it.
>>
>
> a: get paid to do it; pick up work on freelance sites and they'll give you
> the ideas + you'll get paid to do it
>
> b: see a
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
--- End Message ---
--- Begin Message ---
On Apr 24, 2009, at 19:00, Andrew Hucks <[email protected]> wrote:
I've been coding PHP for about a year, and I'm running out of things
to code
that force me to learn new things. If you have any suggestions, I'd
greatly
appreciate it.
What have you coded? How about a chat app? How about a simple db based
version control system?
--- End Message ---
--- Begin Message ---
Andrew Hucks wrote:
I've been coding PHP for about a year, and I'm running out of things to code
that force me to learn new things. If you have any suggestions, I'd greatly
appreciate it.
I'm currently writing an in-house PHP helpdesk ticket system. I looked
at all the open source ones i could find in a google search and they
didn't do what I need (some had few features, others didn't support
authentication against external sources (ldap, imap, etc)). the
commercial ones seemed like they'd do what I want, but the budget is
tight with my employer currently.
--- End Message ---
--- Begin Message ---
Frankly, I don't know what to look for or why something so weird would
happen:
I have pagination set up and the number for pages "next" has a link but
the "next" does not. I have experimented with all sorts of
configurations of the code but the only thing that works (and this is
totally "off the wall") is to do this
$Count = mysql_num_rows($results);
$Count1=$Count++; // without this, the "next" does not do the link---
but there is no other $Count1 in the code either in the original page or
the include page.
And this phenomenon was apparent in a similar page.
I'd be curious to understand how this could happen. I could post the
whole code, but that would be some 300 lines...
--
unheralded genius: "A clean desk is the sign of a dull mind. "
-------------------------------------------------------------
Phil Jourdan --- [email protected]
http://www.ptahhotep.com
http://www.chiccantine.com/andypantry.php
--- End Message ---
--- Begin Message ---
Is the $Count++..
-----Mensagem original-----
De: PJ [mailto:[email protected]]
Enviada em: sexta-feira, 24 de abril de 2009 21:14
Para: [email protected]
Assunto: [PHP] inexplicable behaviour
Frankly, I don't know what to look for or why something so weird would
happen:
I have pagination set up and the number for pages "next" has a link but
the "next" does not. I have experimented with all sorts of
configurations of the code but the only thing that works (and this is
totally "off the wall") is to do this
$Count = mysql_num_rows($results);
$Count1=$Count++; // without this, the "next" does not do the link---
but there is no other $Count1 in the code either in the original page or
the include page.
And this phenomenon was apparent in a similar page.
I'd be curious to understand how this could happen. I could post the
whole code, but that would be some 300 lines...
--
unheralded genius: "A clean desk is the sign of a dull mind. "
-------------------------------------------------------------
Phil Jourdan --- [email protected]
http://www.ptahhotep.com
http://www.chiccantine.com/andypantry.php
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--- End Message ---
--- Begin Message ---
How do I specify an actual SMTP server? (Like mail.host.com)
This is what I have so far:
mail($email, $subject, $message, $headers);
I was to http://ca2.php.net/manual/en/function.mail.php and saw this
syntax:
mail ( string $to , string $subject , string $message [, string
$additional_headers [, string $additional_parameters ]] )
Ronhttp://
--- End Message ---