php-general Digest 19 Sep 2008 08:24:41 -0000 Issue 5690

Topics (messages 280463 through 280483):

Re: ODBC Functions & MS SQL Server 2005
        280463 by: Micah Gersten
        280464 by: Dan Joseph
        280465 by: Micah Gersten
        280475 by: Dan Joseph
        280477 by: Thodoris

Error message
        280466 by: Terry J Daichendt
        280467 by: CanihoJR
        280468 by: Andrew Barnett
        280469 by: Jochem Maas
        280470 by: Jochem Maas
        280471 by: Terry J Daichendt
        280472 by: Micah Gersten
        280473 by: Jim Lucas
        280476 by: Eric Gorr
        280478 by: Jochem Maas

XHTML 移动概要 (XHTML MP) / WAP 2.0 教程
        280474 by: Shelley

ANSI to ISO-8859-2
        280479 by: Bc. Radek Krejca
        280480 by: Per Jessen
        280481 by: Robert Cummings
        280482 by: Bc. Radek Krejca

Adding encryption to passwords
        280483 by: Thodoris

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 ---
If you need abstraction, check this out:
http://us.php.net/pdo

Thank you,
Micah Gersten
onShore Networks
Internal Developer
http://www.onshore.com



Dan Joseph wrote:
> On Thu, Sep 18, 2008 at 3:36 PM, Dan Shirah <[EMAIL PROTECTED]> wrote:
>
>   
>> If you already have your results in an array, try using count($result);
>> That should count the number of results returned to your result array.
>>
>> Or you could try uncommenting the mssql extension in your php.ini file and
>> then try using:
>>
>> mssql_num_rows() ?
>>
>> Dan
>>
>>
>>
>>
>>     
> I don't have them in an array usually, I just cycle thru each row.
>
> I've thought about using the mssql_* functions.  My boss originally pushed
> me into odbc posing the question "What if we move to a different database
> server type?".
>
> I do have a class for handling all the database functions.  Maybe I'll just
> go that route.  If he changed to Oracle or something, I could modify my
> class easy enough.
>
> I'm assuming mssql_num_rows() works fine when calling a stored procedure?
>
>   

--- End Message ---
--- Begin Message ---
On Thu, Sep 18, 2008 at 4:35 PM, Micah Gersten <[EMAIL PROTECTED]> wrote:

> If you need abstraction, check this out:
> http://us.php.net/pdo
>
> Thank you,
> Micah Gersten
> onShore Networks
> Internal Developer
> http://www.onshore.com
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
I looked at PDO, and liked it, but it seems really buggy in the version of
php we're running.  I had to stop using it.  We're running 5.1.2.

-- 
-Dan Joseph

www.canishosting.com - Plans start @ $1.99/month.

"Build a man a fire, and he will be warm for the rest of the day.
Light a man on fire, and will be warm for the rest of his life."

--- End Message ---
--- Begin Message ---
You can't upgrade PHP?

Thank you,
Micah Gersten
onShore Networks
Internal Developer
http://www.onshore.com



Dan Joseph wrote:
> On Thu, Sep 18, 2008 at 4:35 PM, Micah Gersten <[EMAIL PROTECTED]> wrote:
>
>   
>> If you need abstraction, check this out:
>> http://us.php.net/pdo
>>
>> Thank you,
>> Micah Gersten
>> onShore Networks
>> Internal Developer
>> http://www.onshore.com
>>
>> --
>> PHP General Mailing List (http://www.php.net/)
>> To unsubscribe, visit: http://www.php.net/unsub.php
>>
>>
>>     
> I looked at PDO, and liked it, but it seems really buggy in the version of
> php we're running.  I had to stop using it.  We're running 5.1.2.
>
>   

--- End Message ---
--- Begin Message ---
On Thu, Sep 18, 2008 at 5:35 PM, Micah Gersten <[EMAIL PROTECTED]> wrote:

> You can't upgrade PHP?
>
> Thank you,
> Micah Gersten
> onShore Networks
> Internal Developer
> http://www.onshore.com
>
>
>
> Dan Joseph wrote:
> > On Thu, Sep 18, 2008 at 4:35 PM, Micah Gersten <[EMAIL PROTECTED]>
> wrote:
> >
> >
> >> If you need abstraction, check this out:
> >> http://us.php.net/pdo
> >>
> >> Thank you,
> >> Micah Gersten
> >> onShore Networks
> >> Internal Developer
> >> http://www.onshore.com
> >>
> >> --
> >> PHP General Mailing List (http://www.php.net/)
> >> To unsubscribe, visit: http://www.php.net/unsub.php
> >>
> >>
> >>
> > I looked at PDO, and liked it, but it seems really buggy in the version
> of
> > php we're running.  I had to stop using it.  We're running 5.1.2.
> >
> >
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
No, unfortunately not.  My boss is opposed to it (or atleast was a while
back).  He wasn't sure how some of his stuff would react to the upgarde.

-- 
-Dan Joseph

www.canishosting.com - Plans start @ $1.99/month.

"Build a man a fire, and he will be warm for the rest of the day.
Light a man on fire, and will be warm for the rest of his life."

--- End Message ---
--- Begin Message ---

On Thu, Sep 18, 2008 at 4:35 PM, Micah Gersten <[EMAIL PROTECTED]> wrote:

If you need abstraction, check this out:
http://us.php.net/pdo

Thank you,
Micah Gersten
onShore Networks
Internal Developer
http://www.onshore.com

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


I looked at PDO, and liked it, but it seems really buggy in the version of
php we're running.  I had to stop using it.  We're running 5.1.2.

Well from my experience with PDO the does the job pretty well and although I use it for mysql I haven't noticed any obvious bug. Update is always needed and since I despise development is M$ windowz I don't know if there are bugs there.

Well using PDO will do the magic for you if you plan to migrate to another database. Since you are writing in an object oriented way as far as I can tell then data objects is more suited to your style.

--
Thodoris


--- End Message ---
--- Begin Message --- I'm pasting this code from the example at php.net and getting these errors. Can anyone determine what I'm doing wrong?

<?php
// page1.php

session_start();

echo 'Welcome to page #1';

$_SESSION['favcolor'] = 'green';
$_SESSION['animal']   = 'cat';
$_SESSION['time']     = time();

// Works if session cookie was accepted
echo '<br /><a href="page2.php">page 2</a>';

// Or maybe pass along the session id, if needed
echo '<br /><a href="page2.php?' . SID . '">page 2</a>';
?>


Warning: session_start() [function.session-start]: Cannot send session cookie - headers already sent by (output started at /home/terryswe/public_html/hisdailybread/session.php:6) in /home/terryswe/public_html/hisdailybread/session.php on line 9

Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /home/terryswe/public_html/hisdailybread/session.php:6) in /home/terryswe/public_html/hisdailybread/session.php on line 9
Welcome to page #1

Terry


--- End Message ---
--- Begin Message ---
No puedes tener ningun espacio en blanco delante de session_start();

Sorry for my english:
you cant have any blank spaccing before SESSION_START()


Prueba:
TRY:

<?php
session_start();

echo 'Welcome to page #1';

$_SESSION['favcolor'] = 'green';
$_SESSION['animal']   = 'cat';
$_SESSION['time']     = time();

// Works if session cookie was accepted
echo '<br /><a href="page2.php">page 2</a>';

// Or maybe pass along the session id, if needed
echo '<br /><a href="page2.php?' . SID . '">page 2</a>';
?>

--- End Message ---
--- Begin Message ---
It sounds like there is a space or output before the <?php line. It
should be the very first line on a PHP page, and have no spaces before
it.

Andrew

2008/9/19 CanihoJR <[EMAIL PROTECTED]>:
> No puedes tener ningun espacio en blanco delante de session_start();
>
> Sorry for my english:
> you cant have any blank spaccing before SESSION_START()
>
>
> Prueba:
> TRY:
>
> <?php
> session_start();
>
> echo 'Welcome to page #1';
>
> $_SESSION['favcolor'] = 'green';
> $_SESSION['animal']   = 'cat';
> $_SESSION['time']     = time();
>
> // Works if session cookie was accepted
> echo '<br /><a href="page2.php">page 2</a>';
>
> // Or maybe pass along the session id, if needed
> echo '<br /><a href="page2.php?' . SID . '">page 2</a>';
> ?>
>

--- End Message ---
--- Begin Message ---
Terry J Daichendt schreef:
I'm pasting this code from the example at php.net and getting these

which example might that be, with 1000's of built in functions you
can imagine there is probably more than one.

errors. Can anyone determine what I'm doing wrong?


yes. but can your read? the error message tells you what is wrong.

"output started at /home/terryswe/public_html/hisdailybread/session.php:6"

basically the body of a http request must come after the http headers,
sessions make use of cookies. the first echo (or print) statement effectively
starts the output of the http request body after which no headers can be sent
anymore.

what is also plainly obvious is that the example code you posted is *NOT*
the code your trying to run:

there is no session_start() called on line 9 in the example you gave.

<?php
// page1.php

session_start();

echo 'Welcome to page #1';

$_SESSION['favcolor'] = 'green';
$_SESSION['animal']   = 'cat';
$_SESSION['time']     = time();

// Works if session cookie was accepted
echo '<br /><a href="page2.php">page 2</a>';

// Or maybe pass along the session id, if needed
echo '<br /><a href="page2.php?' . SID . '">page 2</a>';

don't bother with the above line, it's shite. which is a
short way of saying that you have no idea as to the security
ramifications so best not to even go there.

?>


Warning: session_start() [function.session-start]: Cannot send session cookie - headers already sent by (output started at /home/terryswe/public_html/hisdailybread/session.php:6) in /home/terryswe/public_html/hisdailybread/session.php on line 9

Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /home/terryswe/public_html/hisdailybread/session.php:6) in /home/terryswe/public_html/hisdailybread/session.php on line 9
Welcome to page #1

Terry




--- End Message ---
--- Begin Message ---
Andrew Barnett schreef:
It sounds like there is a space or output before the <?php line. It
should be the very first line on a PHP page, and have no spaces before
it.

a blank space before the <?php tag ... on LINE 6???

Andrew

2008/9/19 CanihoJR <[EMAIL PROTECTED]>:
No puedes tener ningun espacio en blanco delante de session_start();

Sorry for my english:
you cant have any blank spaccing before SESSION_START()


Prueba:
TRY:

<?php
session_start();

echo 'Welcome to page #1';

$_SESSION['favcolor'] = 'green';
$_SESSION['animal']   = 'cat';
$_SESSION['time']     = time();

// Works if session cookie was accepted
echo '<br /><a href="page2.php">page 2</a>';

// Or maybe pass along the session id, if needed
echo '<br /><a href="page2.php?' . SID . '">page 2</a>';
?>




--- End Message ---
--- Begin Message ---
You have a real attitude problem, please don't bother with me again.


"Jochem Maas" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED]
Terry J Daichendt schreef:
I'm pasting this code from the example at php.net and getting these

which example might that be, with 1000's of built in functions you
can imagine there is probably more than one.

errors. Can anyone determine what I'm doing wrong?


yes. but can your read? the error message tells you what is wrong.

"output started at /home/terryswe/public_html/hisdailybread/session.php:6"

basically the body of a http request must come after the http headers,
sessions make use of cookies. the first echo (or print) statement effectively starts the output of the http request body after which no headers can be sent
anymore.

what is also plainly obvious is that the example code you posted is *NOT*
the code your trying to run:

there is no session_start() called on line 9 in the example you gave.

<?php
// page1.php

session_start();

echo 'Welcome to page #1';

$_SESSION['favcolor'] = 'green';
$_SESSION['animal']   = 'cat';
$_SESSION['time']     = time();

// Works if session cookie was accepted
echo '<br /><a href="page2.php">page 2</a>';

// Or maybe pass along the session id, if needed
echo '<br /><a href="page2.php?' . SID . '">page 2</a>';

don't bother with the above line, it's shite. which is a
short way of saying that you have no idea as to the security
ramifications so best not to even go there.

?>


Warning: session_start() [function.session-start]: Cannot send session cookie - headers already sent by (output started at /home/terryswe/public_html/hisdailybread/session.php:6) in /home/terryswe/public_html/hisdailybread/session.php on line 9

Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /home/terryswe/public_html/hisdailybread/session.php:6) in /home/terryswe/public_html/hisdailybread/session.php on line 9
Welcome to page #1

Terry





--- End Message ---
--- Begin Message ---
Si, puedes tener espacio en blanco delante de session_start(), pero no
puedes tener espacio delante de '<?php'.

Thank you,
Micah Gersten
onShore Networks
Internal Developer
http://www.onshore.com



CanihoJR wrote:
> No puedes tener ningun espacio en blanco delante de session_start();
>
> Sorry for my english:
> you cant have any blank spaccing before SESSION_START()
>
>
> Prueba:
> TRY:
>
> <?php
> session_start();
>
> echo 'Welcome to page #1';
>
> $_SESSION['favcolor'] = 'green';
> $_SESSION['animal']   = 'cat';
> $_SESSION['time']     = time();
>
> // Works if session cookie was accepted
> echo '<br /><a href="page2.php">page 2</a>';
>
> // Or maybe pass along the session id, if needed
> echo '<br /><a href="page2.php?' . SID . '">page 2</a>';
> ?>
>
>   

--- End Message ---
--- Begin Message ---
Terry J Daichendt wrote:
> You have a real attitude problem, please don't bother with me again.
> 
> 
> "Jochem Maas" <[EMAIL PROTECTED]> wrote in message
> news:[EMAIL PROTECTED]
>> Terry J Daichendt schreef:
>>> I'm pasting this code from the example at php.net and getting these
>>
>> which example might that be, with 1000's of built in functions you
>> can imagine there is probably more than one.
>>
>>> errors. Can anyone determine what I'm doing wrong?
>>>
>>
>> yes. but can your read? the error message tells you what is wrong.
>>
>> "output started at
>> /home/terryswe/public_html/hisdailybread/session.php:6"
>>
>> basically the body of a http request must come after the http headers,
>> sessions make use of cookies. the first echo (or print) statement
>> effectively
>> starts the output of the http request body after which no headers can
>> be sent
>> anymore.
>>
>> what is also plainly obvious is that the example code you posted is *NOT*
>> the code your trying to run:
>>
>> there is no session_start() called on line 9 in the example you gave.
>>
>>> <?php
>>> // page1.php
>>>
>>> session_start();
>>>
>>> echo 'Welcome to page #1';
>>>
>>> $_SESSION['favcolor'] = 'green';
>>> $_SESSION['animal']   = 'cat';
>>> $_SESSION['time']     = time();
>>>
>>> // Works if session cookie was accepted
>>> echo '<br /><a href="page2.php">page 2</a>';
>>>
>>> // Or maybe pass along the session id, if needed
>>> echo '<br /><a href="page2.php?' . SID . '">page 2</a>';
>>
>> don't bother with the above line, it's shite. which is a
>> short way of saying that you have no idea as to the security
>> ramifications so best not to even go there.
>>
>>> ?>
>>>
>>>
>>> Warning: session_start() [function.session-start]: Cannot send
>>> session cookie - headers already sent by (output started at
>>> /home/terryswe/public_html/hisdailybread/session.php:6) in
>>> /home/terryswe/public_html/hisdailybread/session.php on line 9
>>>
>>> Warning: session_start() [function.session-start]: Cannot send
>>> session cache limiter - headers already sent (output started at
>>> /home/terryswe/public_html/hisdailybread/session.php:6) in
>>> /home/terryswe/public_html/hisdailybread/session.php on line 9
>>> Welcome to page #1
>>>
>>> Terry
>>>
>>>
>>
> 
> 

He was simply trying to point to the fact that you showing us something that
is different then what you trying to run that IS causing the problems.

And a side note:  the answer to your question,
                "Can anyone determine what I'm doing wrong?"

He told you that the answer to that question was in your own email.

        headers already sent

where

        in the file /home/terryswe/public_html/hisdailybread/session.php

        on line 6

Everything Jochem's said was facts based on the information that you gave us
in your original email.

My suggestion, remove your session_start() in the above example, because it is
causing the problem.

-- 
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


--- End Message ---
--- Begin Message ---
On Sep 18, 2008, at 5:52 PM, Terry J Daichendt wrote:

I'm pasting this code from the example at php.net and getting these errors. Can anyone determine what I'm doing wrong?

<?php
// page1.php

session_start();

echo 'Welcome to page #1';

$_SESSION['favcolor'] = 'green';
$_SESSION['animal']   = 'cat';
$_SESSION['time']     = time();

// Works if session cookie was accepted
echo '<br /><a href="page2.php">page 2</a>';

// Or maybe pass along the session id, if needed
echo '<br /><a href="page2.php?' . SID . '">page 2</a>';
?>

Well, this is weird. When I copied your text and tried it myself, the error I got was:

Parse error: syntax error, unexpected T_STRING in /Users/ericgorr/ Sites/page1.php on line 9

Now, of course, there is nothing visibly wrong with line 9 ($_SESSION['animal'] = 'cat';). But, when I had my text editor show invisible characters, there were some on that line and line 10.

Do you have a text editor that can show invisible characters?

On the Mac, the one I really like (and is free) is TextWrangler (http://www.barebones.com/products/textwrangler/ ) and has this capability. This may be part of your problem. Once I got rid of the invisible characters, the example worked without any problems.

Also, are you certain there are no spaces or anything (even invisible characters) before <?php?

Whenever I've gotten a similar error in the past, that was nearly always the problem. You are welcome to compress the text file and send it to me directly so I can see exactly what it contains.


--- End Message ---
--- Begin Message ---
Terry J Daichendt schreef:
You have a real attitude problem, please don't bother with me again.


actually it's you who has a problem with my attitude, not me. although I'll
grant you that people like you are usually 'bother' ... and I won't anymore.



--- End Message ---
--- Begin Message ---
各位好.

XHTML 移动概要 (XHTML MP) / WAP 2.0 教程:
http://www.phparch.cn/index.php/web/66-mobile/188

正在编写中,已完成部分已加链接。
欢迎大家多提意见或建议并留下你的想法供大家交流。

谢谢。

-- 
With best regards,
Shelley Shyan
http://phparch.cn

--- End Message ---
--- Begin Message ---
Hello,

  I get from webservice strings like this:

  &#x10C;esko anglick&#xE9; gymn&#xE1;zium

  I think, that is ANSI, but how to convert it to something else (the
  best is iso-8859-2). I am trying iconv function, but ANSI parameter
  is not supported.

  Thank you
  Radek

-- 
Regards,
 Bc. Radek Krejca
 ICQ: 65895541 



--- End Message ---
--- Begin Message ---
Bc. Radek Krejca wrote:

> Hello,
> 
>   I get from webservice strings like this:
> 
>   &#x10C;esko anglick&#xE9; gymn&#xE1;zium
> 
>   I think, that is ANSI, but how to convert it to something else (the
>   best is iso-8859-2). I am trying iconv function, but ANSI parameter
>   is not supported.

ANSI is not a character set, it's a standards organisation.  You may
have meant ASCII, and the string does look as if it could be ASCII. 
The sequences like &#xNNN are HTML-style symbolic entities.  Take a
look at htmlentities().


/Per Jessen, Zürich


--- End Message ---
--- Begin Message ---
On Fri, 2008-09-19 at 09:39 +0200, Per Jessen wrote:
> Bc. Radek Krejca wrote:
> 
> > Hello,
> > 
> >   I get from webservice strings like this:
> > 
> >   &#x10C;esko anglick&#xE9; gymn&#xE1;zium
> > 
> >   I think, that is ANSI, but how to convert it to something else (the
> >   best is iso-8859-2). I am trying iconv function, but ANSI parameter
> >   is not supported.
> 
> ANSI is not a character set, it's a standards organisation.  You may
> have meant ASCII, and the string does look as if it could be ASCII. 
> The sequences like &#xNNN are HTML-style symbolic entities.  Take a
> look at htmlentities().

http://en.wikipedia.org/wiki/ANSI_art

You may be too young to have known ;)

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


--- End Message ---
--- Begin Message ---
Hello,

PJ> ANSI is not a character set, it's a standards organisation.  You may
PJ> have meant ASCII, and the string does look as if it could be ASCII. 
PJ> The sequences like &#xNNN are HTML-style symbolic entities.  Take a
PJ> look at htmlentities().

Yes, youre right, my mistake, of course that ASCII. I go try you hint
and I will write result.

Thank you, Radek

-- 
S pozdravem,
 Bc. Radek Krejca
 ICQ: 65895541



--- End Message ---
--- Begin Message --- Hi guys I have developed an intranet web interface with user access. I am storing the passwords into a mysql table as raw text (I know not so secure). So I am adding group access features and I am thinking to encrypt the passwords because this seems to grow as a project although it started as a simple web tool.

So what do you think is the best way to use crypt, mcrypt, hash or perhaps md5 and what are really the differences because I am not sure if I get it right.

--
Thodoris


--- End Message ---

Reply via email to