php-general Digest 21 May 2013 19:08:50 -0000 Issue 8240

Topics (messages 321162 through 321168):

Re: Question about session_id() and session_start()
        321162 by: Tim Schofield
        321165 by: 孟远涛

totally a newbie in sending phone number to a webserver
        321163 by: Negin Nickparsa
        321164 by: Farzan Dalaee

Re: A Good OOP Tutorial/Read?
        321166 by: Dan Joseph

Re: How do I remove a string from another string in a fuzzy way?
        321167 by: Tedd Sperling

Doing something wrong?
        321168 by: Lester Caine

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 ---
On 20/05/2013, Maciek Sokolewicz <maciek.sokolew...@gmail.com> wrote:
> On 20-5-2013 22:14, Tim Schofield wrote:
>> Matijn
>>
>> There are well over half a million lines of source code in PHP. It seems
>> a
>> little unhelpful to tell someone to go and read half a million lines of C
>> when you could just tell them the answer?
>>
>> Thanks
>> Tim
>>
>> Course View Towers,
>> Plot 21 Yusuf Lule Road,
>> Kampala
>> T +256 (0) 312 314 418
>> M +256 (0) 752 963 325
>> www.weberpafrica.com
>> Twitter: @TimSchofield2
>> Blog: http://weberpafrica.blogspot.co.uk
>> On May 20, 2013 6:24 PM, "Matijn Woudt" <tijn...@gmail.com> wrote:
>>
>>> On Mon, May 20, 2013 at 5:33 AM, 孟远涛 <yuantao.m...@gmail.com> wrote:
>>>
>>>> I find the Note in PHP document.
>>>> http://www.php.net/manual/en/function.session-id.php
>>>>
>>>> "Note: When using session cookies, specifying an id for session_id()
>>>> will
>>>> always send a new cookie when session_start() is called, regardless if
>>> the
>>>> current session id is identical to the one being set."
>>>>
>>>> I feel puzzled about this feature. Even if the current session id is
>>>> identical to the one one being set, session_start will send a new
>>> cookie. I
>>>> want to know why session_start behave in this way.
>>>>
>>>> Forgive my poor English. Thanks in advance.
>>>>
>>>
>>> You will find the answer in the PHP source code.
>>> If you don't want this to happen, check if the current session id
>>> matches
>>> with the value you want to set it to, and don't set if they match.
>>>
>>> - Matijn
>>>
>>
>
> Tim,
>
> first of all, please bottom-post on this list.

Tell that to the designers of the android gmail app :-)

> Secondly, a simple google search for "php c session_start" resulted in
> this:
> https://github.com/php/php-src/blob/master/ext/session/session.c#L1303

That wasn't the advice given. The advice given was to read the source
code. My point was that is not very helpful advice. With a few notable
exceptions the help given on this list has become less and less
friendly over the years I have been reading it. This can't be good for
the PHP community.

>
> - Tul
>
>

Tim

-- 
Course View Towers,
Plot 21 Yusuf Lule Road,
Kampala
T   +256 (0) 312 314 418
M +256 (0) 752 963 325
www.weberpafrica.com
@TimSchofield2
Blog: http://weberpafrica.blogspot.co.uk/

--- End Message ---
--- Begin Message ---
thank you.
I read the source code and it helps a lot, now I know the behavior
of the code is consistent with the NOTE.
I think the reason is that If the 'new' session_id we want to set
already exists on the server, but does not exist on the client's
cookie, the server must send a set-cookie header to the client.


On Tue, May 21, 2013 at 3:50 PM, Tim Schofield <t...@weberpafrica.com> wrote:

> On 20/05/2013, Maciek Sokolewicz <maciek.sokolew...@gmail.com> wrote:
> > On 20-5-2013 22:14, Tim Schofield wrote:
> >> Matijn
> >>
> >> There are well over half a million lines of source code in PHP. It seems
> >> a
> >> little unhelpful to tell someone to go and read half a million lines of
> C
> >> when you could just tell them the answer?
> >>
> >> Thanks
> >> Tim
> >>
> >> Course View Towers,
> >> Plot 21 Yusuf Lule Road,
> >> Kampala
> >> T +256 (0) 312 314 418
> >> M +256 (0) 752 963 325
> >> www.weberpafrica.com
> >> Twitter: @TimSchofield2
> >> Blog: http://weberpafrica.blogspot.co.uk
> >> On May 20, 2013 6:24 PM, "Matijn Woudt" <tijn...@gmail.com> wrote:
> >>
> >>> On Mon, May 20, 2013 at 5:33 AM, 孟远涛 <yuantao.m...@gmail.com> wrote:
> >>>
> >>>> I find the Note in PHP document.
> >>>> http://www.php.net/manual/en/function.session-id.php
> >>>>
> >>>> "Note: When using session cookies, specifying an id for session_id()
> >>>> will
> >>>> always send a new cookie when session_start() is called, regardless if
> >>> the
> >>>> current session id is identical to the one being set."
> >>>>
> >>>> I feel puzzled about this feature. Even if the current session id is
> >>>> identical to the one one being set, session_start will send a new
> >>> cookie. I
> >>>> want to know why session_start behave in this way.
> >>>>
> >>>> Forgive my poor English. Thanks in advance.
> >>>>
> >>>
> >>> You will find the answer in the PHP source code.
> >>> If you don't want this to happen, check if the current session id
> >>> matches
> >>> with the value you want to set it to, and don't set if they match.
> >>>
> >>> - Matijn
> >>>
> >>
> >
> > Tim,
> >
> > first of all, please bottom-post on this list.
>
> Tell that to the designers of the android gmail app :-)
>
> > Secondly, a simple google search for "php c session_start" resulted in
> > this:
> > https://github.com/php/php-src/blob/master/ext/session/session.c#L1303
>
> That wasn't the advice given. The advice given was to read the source
> code. My point was that is not very helpful advice. With a few notable
> exceptions the help given on this list has become less and less
> friendly over the years I have been reading it. This can't be good for
> the PHP community.
>
> >
> > - Tul
> >
> >
>
> Tim
>
> --
> Course View Towers,
> Plot 21 Yusuf Lule Road,
> Kampala
> T   +256 (0) 312 314 418
> M +256 (0) 752 963 325
> www.weberpafrica.com
> @TimSchofield2
> Blog: http://weberpafrica.blogspot.co.uk/
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

--- End Message ---
--- Begin Message ---
I registered a SMS web service and I have username and password
and there are methods as follow which I can use:

balance
receive
send
send to all
send advanced
status
status advanced

suppose I have a form and I will get the phone number from user
also I have user name,pass and url of the web service
like $phone['number'],$user,$pass,$url

I don't know what exactly I should do to force the php code read from the
functions of the web service does including the url enough?
I am totally mixed up.

can someone tell me what is happening in this procedure?

is there any tutorial so that I can understand it?
I tried to use sample codes but they were different from which I wanted.

Thanks in Advance.

--- End Message ---
--- Begin Message ---
    require_once('nusoap/nusoap.php');
    $client = new nusoap_client('http://smsprovider.com/post/send.asmx?wsdl'
);

    $err = $client->getError();

    if ($err)
    {

        echo 'Constructor error' . $err;

    }

$parameters['username'] = "";
$parameters['password'] = "";
$parameters['to'] = "";
$parameters['from'] = "";
$parameters['text'] ="test";
$parameters['isflash'] =false;


    $result = $client->call('send', $parameters);
    print_r($result);


On Tue, May 21, 2013 at 1:46 PM, Negin Nickparsa <nickpa...@gmail.com>wrote:

> I registered a SMS web service and I have username and password
> and there are methods as follow which I can use:
>
> balance
> receive
> send
> send to all
> send advanced
> status
> status advanced
>
> suppose I have a form and I will get the phone number from user
> also I have user name,pass and url of the web service
> like $phone['number'],$user,$pass,$url
>
> I don't know what exactly I should do to force the php code read from the
> functions of the web service does including the url enough?
> I am totally mixed up.
>
> can someone tell me what is happening in this procedure?
>
> is there any tutorial so that I can understand it?
> I tried to use sample codes but they were different from which I wanted.
>
> Thanks in Advance.
>

--- End Message ---
--- Begin Message ---
Hey guys, thanks again for the talk and education.  I've purchased the
book, and started reading thru the links given.  Take care!

-Dan


On Sun, May 19, 2013 at 12:28 PM, Tedd Sperling <t...@sperling.com> wrote:

> To all:
>
> Thanks to Stuart, I finally got it.
>
> The concept of Interface is a bit difficult to explain, but his excellent
> console made the concept clear.
>
> Many thanks to all for their efforts to educate me.
>
> Cheers,
>
> tedd
>
>
> _____________________
> t...@sperling.com
> http://sperling.com
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>


-- 
-Dan Joseph

http://www.danjoseph.me
http://www.dansrollingbbq.com
http://www.youtube.com/DansRollingBBQ

--- End Message ---
--- Begin Message ---
On May 20, 2013, at 10:17 PM, Daevid Vincent <dae...@daevid.com> wrote:
Initially I was thinking that somehow I could use a simple regex on the
> needle and haystacks to strip out all white space and str_ireplace() them
> that way, but then I don't have a way to put the whitespace back that I can
> see.

Daevid:

Go ahead and strip out the whitespace, but replace it with a delimiter string 
that is unique and then don't consider that delimiter when comparing strings to 
strings.

Afterwards, if you want to keep the string (instead of deleting it), then 
reverse the process adding back in the whitespace and removing the delimiter.

Also, you may want to look into using array_unique() for comparing groupings of 
several strings (i.e., paragraphs) to other groupings. It works pretty slick 
for me.

Cheers,

tedd

_____________________
tedd.sperl...@gmail.com
http://sperling.com


--- End Message ---
--- Begin Message --- I've got a new machine set up with SUSE12.3 but while it has PHP5.4, Apache is still stuck at 2.2, so I've downloaded and built 2.4.4 and PHP5.4.15 along with the modules I need but I'm having trouble actually getting it to load the 'Additional' .ini files. phpinfo is showing the change of location of the php.ini file, but nothing for the 'Scan this dir for additional .ini files' while the Configure shows '--with-config-file-scan-dir=/opt/apache2/conf/php5.d'
What am I missing?
It's working on the other machines and loading all the extra modules happily.

--
Lester Caine - G8HFL
-----------------------------
Contact - http://lsces.co.uk/wiki/?page=contact
L.S.Caine Electronic Services - http://lsces.co.uk
EnquirySolve - http://enquirysolve.com/
Model Engineers Digital Workshop - http://medw.co.uk
Rainbow Digital Media - http://rainbowdigitalmedia.co.uk

--- End Message ---

Reply via email to