php-general Digest 9 Apr 2010 19:15:22 -0000 Issue 6683

Topics (messages 303930 through 303950):

Forgot what to install
        303930 by: David McGlone
        303931 by: kranthi
        303932 by: viraj
        303934 by: shiplu
        303943 by: David McGlone
        303944 by: Bob McConnell

Re: No notices for undefined index
        303933 by: shiplu
        303937 by: Ashley Sheridan
        303942 by: Bob McConnell
        303945 by: Nathan Rixham
        303946 by: Nathan Rixham

another "useless" message.
        303935 by: Rene Veerman
        303939 by: Nilesh Govindarajan
        303940 by: Rene Veerman
        303941 by: Peter Lind
        303948 by: Dan Joseph

Sending e-mail through an SMTP with authentification
        303936 by: Andre Polykanine

Re: Beginner's question: How to run a PHP web application locally?
        303938 by: Rene Veerman

Re: Sort two coupled arrays [my solution]
        303947 by: tedd
        303949 by: Robert Cummings

Zend DB Table - WHERE as OR?
        303950 by: Dan Joseph

Administrivia:

To subscribe to the digest, e-mail:
        php-general-digest-subscr...@lists.php.net

To unsubscribe from the digest, e-mail:
        php-general-digest-unsubscr...@lists.php.net

To post to the list, e-mail:
        php-gene...@lists.php.net


----------------------------------------------------------------------
--- Begin Message ---
Hey guys, quick question. I had to re-install my Ubuntu, and I forgot
what package I needed so firefox will display the php files and not ask
me to if I want to download them. I've done installed PHP5, mysql, and
php-mysql. What did I miss. I know the package name, but it's completely
slipping my mind right now.

Thanks
David M.


--- End Message ---
--- Begin Message ---
you forgot httpd
KK.



On Fri, Apr 9, 2010 at 08:32, David McGlone <da...@dmcentral.net> wrote:
> Hey guys, quick question. I had to re-install my Ubuntu, and I forgot
> what package I needed so firefox will display the php files and not ask
> me to if I want to download them. I've done installed PHP5, mysql, and
> php-mysql. What did I miss. I know the package name, but it's completely
> slipping my mind right now.
>
> Thanks
> David M.
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

--- End Message ---
--- Begin Message ---
it's apache2 module for php

#apt-cache search php5 apache
libapache2-mod-php5 - server-side, HTML-embedded scripting language
(Apache 2 module)

~viraj

On Fri, Apr 9, 2010 at 8:32 AM, David McGlone <da...@dmcentral.net> wrote:
> Hey guys, quick question. I had to re-install my Ubuntu, and I forgot
> what package I needed so firefox will display the php files and not ask
> me to if I want to download them. I've done installed PHP5, mysql, and
> php-mysql. What did I miss. I know the package name, but it's completely
> slipping my mind right now.
>
> Thanks
> David M.
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

--- End Message ---
--- Begin Message ---
A tip for you. If you have internet access, type in
sudo apt-get install phpmyadmin
This will install all the dependencies and your server will be ready.

On 4/9/10, David McGlone <da...@dmcentral.net> wrote:
> Hey guys, quick question. I had to re-install my Ubuntu, and I forgot
> what package I needed so firefox will display the php files and not ask
> me to if I want to download them. I've done installed PHP5, mysql, and
> php-mysql. What did I miss. I know the package name, but it's completely
> slipping my mind right now.
>
> Thanks
> David M.
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

-- 
Sent from my mobile device

Shiplu Mokaddim
My talks, http://talk.cmyweb.net
Follow me, http://twitter.com/shiplu
SUST Programmers, http://groups.google.com/group/p2psust
Innovation distinguishes bet ... ... (ask Steve Jobs the rest)

--- End Message ---
--- Begin Message ---
On Fri, 2010-04-09 at 08:37 +0530, kranthi wrote:
> you forgot httpd
> KK.
> 
> 
> 
> On Fri, Apr 9, 2010 at 08:32, David McGlone <da...@dmcentral.net> wrote:
> > Hey guys, quick question. I had to re-install my Ubuntu, and I forgot
> > what package I needed so firefox will display the php files and not ask
> > me to if I want to download them. I've done installed PHP5, mysql, and
> > php-mysql. What did I miss. I know the package name, but it's completely
> > slipping my mind right now.

Thanks everyone for the suggestions. Last night before I went to bed I
replied to my own question to let everyone know that all I needed to do
was restart apache, but what I didn't realize until I got up this
morning was when I hit reply, I replied to myself so only I got the
message.


--- End Message ---
--- Begin Message ---
From: David McGlone

> On Fri, 2010-04-09 at 08:37 +0530, kranthi wrote:
>> you forgot httpd
>> KK.
>> 
>> On Fri, Apr 9, 2010 at 08:32, David McGlone <da...@dmcentral.net>
wrote:
>> > Hey guys, quick question. I had to re-install my Ubuntu, and I
forgot
>> > what package I needed so firefox will display the php files and not
ask
>> > me to if I want to download them. I've done installed PHP5, mysql,
and
>> > php-mysql. What did I miss. I know the package name, but it's
completely
>> > slipping my mind right now.
> 
> Thanks everyone for the suggestions. Last night before I went to bed I
> replied to my own question to let everyone know that all I needed to
do
> was restart apache, but what I didn't realize until I got up this
> morning was when I hit reply, I replied to myself so only I got the
> message.

Sometimes that's all that matters. But thanks for letting us know you
solved your problem.

Bob McConnell

--- End Message ---
--- Begin Message ---
Hello Shawn,
Why dont you report a bug? When we know the expected behavior or the
way it SHOULD behave. and its not behaving that way. Its certainly a
bug.. Only then we can know the real reason why the novicas are not
showing up.

On 4/8/10, Shawn McKenzie <nos...@mckenzies.net> wrote:
> So the first two print statements generate NO notices, while the second
> obviously generates:
>
> Notice: Undefined offset:  1 in /home/shawn/www/test.php on line 11
>
> Notice: Undefined index:  test in /home/shawn/www/test.php on line 12
>
> This sucks.  A bug???
>
> error_reporting(E_ALL);
> ini_set('display_errors', '1');
>
>
> $a = 5;
> print $a[1];
> print $a['test'];
>
> $a = array();
> print $a[1];
> print $a['test'];
>
> --
> Thanks!
> -Shawn
> http://www.spidean.com
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

-- 
Sent from my mobile device

Shiplu Mokaddim
My talks, http://talk.cmyweb.net
Follow me, http://twitter.com/shiplu
SUST Programmers, http://groups.google.com/group/p2psust
Innovation distinguishes bet ... ... (ask Steve Jobs the rest)

--- End Message ---
--- Begin Message ---
On Fri, 2010-04-09 at 07:52 +0530, kranthi wrote:

> >> print $a[0];   // prints 5
> >> print $a[100]; // Notice: Uninitialized string offset:  100
> Yup, this should happen when 5 is treated as an array of characters.
> In other words as a string.
> $a = '5';
> echo $a[0];
> echo $a[100];
> gives you the expected result
> 
> regarding the original question, i think that the interpreter is
> prefilling the variable with null
> 
> $a = 5;
> var_dump(isset($a[0]));
> var_dump($a[0]);
> 
> since $a[0] is already assigned (to null) the interpreter is not
> throwing a notice
> 
> $b = null;
> var_dump(isset($b));
> var_dump($b);
> 


If $a is treated as an array of characters, then $a[0] is always the
first character, not null.

Thanks,
Ash
http://www.ashleysheridan.co.uk



--- End Message ---
--- Begin Message ---
From: Shawn McKenzie

> Bob McConnell wrote:
>> In the first case, $a=5 creates a multi-typed variable. The
interpreter
>> makes its best guess how the next two expressions should be
interpreted.
>> In both cases, they look a lot like an index into a character array
>> (string), and 'test' evaluates numerically to zero. Both are valid
>> offsets for a string, so no messages are generated.
>> 
>> In the second case, $a is explicitly declared as an array. This give
the
>> interpreter a lot more detail to work from. The two expressions are
now
>> an index and a key for the array. But both of them evaluate to
offsets
>> that have not been assigned, which raises a flag and creates the
>> warnings.
>> 
>> Such are the joys of loosely typed languages.
> 
> Yes, this is what I was thinking as well, however:
> 
> $a=5;
> print $a[0];   // if it is index 0 then it should print 5 yes?
> print $a[100]; // there is no index 100 so why no notice?

I'm assuming that the PHP interpreter works much like a C compiler. i.e.
It doesn't keep track of the size of strings. It knows that $a maps to a
memory location, and $a[100] maps to that location plus 100 characters.
As long as that is still a valid memory address for this process, it
doesn't see anything wrong. If it is outside the process memory, you are
more likely to get a General Protection Fault, or the equivalent OS
error.

In security parlance, this is what is known as a buffer overflow error.
The application programmer is responsible for keeping track of string
sizes and insuring that indexes don't move past the end of the allocated
space. It is also why functions like snprintf should be used instead of
sprintf.

Bob McConnell

--- End Message ---
--- Begin Message ---
Ashley Sheridan wrote:
> can't find anything in the manual that explains what should happen when
> you treat a string like an array in PHP. 

http://www.php.net/manual/en/language.types.string.php#language.types.string.substr

:)

--- End Message ---
--- Begin Message ---
Ashley Sheridan wrote:
> can't find anything in the manual that explains what should happen when
> you treat a string like an array in PHP. 

http://www.php.net/manual/en/language.types.string.php#language.types.string.substr

:)

--- End Message ---
--- Begin Message ---
Service Announcement :))

htmlMicroscope on http://mediabeez.ws/ is down because of technical
difficulties, not-related to the body of the owner of the machine that
runs mediabeez.ws atm.
That mediabeez.ws runs on a home PC (ubuntu karmic), but i'm away from
home atm, travelling around, and the thing has died on me too many
times, so i'm not even going to try to ssh to it atm..

Please apologize my earlier -way out of line for a list like this-
remarks about "letting programmers hit me, and me taking them down
without any effort". I was _STRESSED_ when i wrote that.

Again, please take this as: mediabeez.ws will be back up, with the 3
open-source gifts i have.
If you need the "latest" development copy of htmlMicroscope (something
to look at very large arrays in a browser with), then google for
"htmlmicroscope" and use the googlecode.com(?) link.

My other components, visCanvasLoaderGraphic/Icon and buttonAnimated
(jQuery based), are not available online anywhere.
But you may pass them around of course, as per open source contract styles..

Good luck,
and take care of your loved ones, as i am doing atm.

Greetings,
 Rene Veerman
 Somewhere in .nl, nice weather atm.

--- End Message ---
--- Begin Message ---
Somebody ban this person. He/she is creating nuisance here. ^)

--
Nilesh Govindarajan
Site & Server Administrator
www.itech7.com
मेरा भारत महान !
मम भारत: महत्तम भवतु !

--- End Message ---
--- Begin Message ---
lolz.... :)) u try to be nice, and this is what u get?!?! :-D


On Fri, Apr 9, 2010 at 11:52 AM, Nilesh Govindarajan <li...@itech7.com> wrote:
> Somebody ban this person. He/she is creating nuisance here. ^)
>
> --
> Nilesh Govindarajan
> Site & Server Administrator
> www.itech7.com
> मेरा भारत महान !
> मम भारत: महत्तम भवतु !
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

--- End Message ---
--- Begin Message ---
On 9 April 2010 12:20, Rene Veerman <rene7...@gmail.com> wrote:
> lolz.... :)) u try to be nice, and this is what u get?!?! :-D
>

Rene, it's nice of you to post messages on the availability of some OS
tools. However, you should also be aware that it's a minority of
people on this list that use those tools - which in effect means that
you're posting stuff that at best is irrelevant to a lot of people and
at worst is seen as spam by those people.

That said, there can be little doubt that the response you got went a
tad too far - some netiquette lessons would be useful, I think.


-- 
<hype>
WWW: http://plphp.dk / http://plind.dk
LinkedIn: http://www.linkedin.com/in/plind
Flickr: http://www.flickr.com/photos/fake51
BeWelcome: Fake51
Couchsurfing: Fake51
</hype>

--- End Message ---
--- Begin Message ---
On Fri, Apr 9, 2010 at 6:28 AM, Peter Lind <peter.e.l...@gmail.com> wrote:

> That said, there can be little doubt that the response you got went a
> tad too far - some netiquette lessons would be useful, I think.
>
>

In defense of the people that react harshly, there has been a lot of people
who just spam the list over the years.  Its a natural reaction.

You may want to put that kind of thing in your signature also.  Rather than
making announcements that bother people, when you participate, your message
will go out.  Although, don't make it 100 lines long...

-- 
-Dan Joseph

www.canishosting.com - Unlimited Hosting Plans start @ $3.95/month.  Promo
Code "NEWTHINGS" for 10% off initial order

http://www.facebook.com/canishosting
http://www.facebook.com/originalpoetry

--- End Message ---
--- Begin Message ---
Hello everyone,
Sorry, don't remember who exactly needed this functionality. My class
is finally ready and approved by the site admins)
http://www.phpclasses.org/package/6128

-- 
With best regards from Ukraine,
Andre
Http://oire.org/ - The Fantasy blogs of Oire
Skype: Francophile; Wlm&MSN: arthaelon @ yandex.ru; Jabber: arthaelon @ 
jabber.org
Yahoo! messenger: andre.polykanine; ICQ: 191749952
Twitter: http://twitter.com/m_elensule


--- End Message ---
--- Begin Message ---
cmon, just search for "ubuntu install lamp" via google..

or google for "download ubuntu", select the stable branch (karmic),
install it, and then type this into a terminal window:

sudo apt-get install apache2 mysql5 php5

from there, running LAMP development on linux should be a breeze for you.


On Thu, Apr 8, 2010 at 1:42 PM, Bastien Helders <eldroskan...@gmail.com> wrote:
> Hi List,
>
> The other day, I read an article that mentioned about a tool that would
> permit to simulate a web environment for PHP, so that testing could be made
> before uploading the page on the server. Unfortunately, I don't seem to find
> the article again.
>
> So here am I with this question: What should I need to set my test
> environment? I'm working on Windows, but I'm all ears for solution on Linux
> systems.
>
> Best Regards,
> Bastien
>

--- End Message ---
--- Begin Message ---
At 10:26 AM -0400 4/8/10, Robert Cummings wrote:
tedd wrote:
At 8:28 AM -0400 4/8/10, Andrew Ballard wrote:
On Wed, Apr 7, 2010 at 6:46 PM, Ryan Sun <ryansu...@gmail.com> wrote:

 >
 rsort(array_combine(array2, array1));

 you should expect array(
  'Personal Email' => 75,
  'USPS mail' => 40,
  'Personal Phone' => 31,
  'Web site' => 31,
  'Text Message' => 31
 )

 logically, the items are your key but not the count of votes

That's the ticket. The solution is pretty simple now that we
understand the nature of the problem.  :-)

Andrew

Andrew:

Half the solution is understanding the problem.

However, the above solution only solves half the problem.

Maybe I'm confused... but can't the following be used?

<?php

    array_multisort( $votes, SORT_DESC, $items, SORT_DESC );
    $final = array_combine( $items, $votes );

    print_r( $final );

?>

Cheers,
Rob.

Rob:

You're never confused because you are always right.

Congrats, you were the first to solve this problem this simply.

To tell the truth, I didn't fully understand how array_multisort() worked until I reviewed your solution. I thought array_multisort() was to sort multi-dimensional arrays and simply overlooked the description that it could also sort several arrays at once. Duh -- sometimes my reading/comprehension skills suck.

Many thanks for your time.

Cheers,

tedd


--
-------
http://sperling.com  http://ancientstones.com  http://earthstones.com

--- End Message ---
--- Begin Message ---
tedd wrote:
Rob:

You're never confused because you are always right.

I should have you mention this to my wife... I'll provide the helmet >:)

Congrats, you were the first to solve this problem this simply.

To tell the truth, I didn't fully understand how array_multisort() worked until I reviewed your solution. I thought array_multisort() was to sort multi-dimensional arrays and simply overlooked the description that it could also sort several arrays at once. Duh -- sometimes my reading/comprehension skills suck.

Many thanks for your time.

No prob... was the first time I read up on multisort too :)

Cheers,
Rob.
--
http://www.interjinn.com
Application and Templating Framework for PHP

--- End Message ---
--- Begin Message ---
Hi Everyone,

I'm trying to figure out if something is even an option with the Zend
Framework.  We use the DB Table stuff.  I don't see it in the manual, so I
figured I'd ask you all...

I have:

$select = $table->select()->where( "home_team_id = ?", $home_team_id )
                                  ->where( "away_team_id = ?", $away_team_id
);

This translates the where's to "home_team_id = 12 AND away_team_id = 15"...

What I'd like to have is "home_team_id = 12 OR away_team_id = 15".

Is this possible?  Or would I just need to build them all into a single
where() manually?

-- 
-Dan Joseph

www.canishosting.com - Unlimited Hosting Plans start @ $3.95/month.  Promo
Code "NEWTHINGS" for 10% off initial order

http://www.facebook.com/canishosting
http://www.facebook.com/originalpoetry

--- End Message ---

Reply via email to