php-general Digest 26 Dec 2001 09:55:50 -0000 Issue 1074

Topics (messages 78731 through 78762):

phpbb and ikonboard forum scripts
        78731 by: Indera
        78734 by: LaserJetter
        78737 by: Jeff Lewis
        78741 by: Indera
        78742 by: Indera

Re: [PHP-WIN] Site running from MySQL
        78732 by: Svensson, B.A.T. (HKG)

Hosting advise
        78733 by: Indera
        78758 by: Boaz Yahav
        78762 by: Stephano Mariani

Re: Client side fatal PHP error
        78735 by: LaserJetter
        78744 by: James Cox
        78747 by: jjt
        78748 by: Philip Olson
        78749 by: Philip Olson
        78752 by: Ken
        78754 by: Andrew Brampton

Suggestion: Adding fmt like linebreak algorithm
        78736 by: Dominik Roettsches
        78738 by: Manuel Lemos
        78743 by: Brian Clark
        78750 by: Bogdan Stancescu

Re: Prev ... Next
        78739 by: Manuel Lemos

File Upload Question...
        78740 by: Anthony Ritter

Basic PHP PROGRAMMER needed
        78745 by: Peter Reck

Using html-style tags to define a variable
        78746 by: Kevin Keeler

4.10 New Vars Question
        78751 by: Edward Marczak
        78753 by: Philip Olson
        78755 by: David
        78756 by: Philip Olson
        78760 by: David

Reverse effect of htmlspecialchars
        78757 by: phantom
        78761 by: Philip Olson

Re: gd_installation......................... :(
        78759 by: EMIN CALIKLI

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

I am trying to decide between these two scripts and was wondering if anyone has either 
of them
installed. The one thing I need that I can't figure out if either of them have is 
whether or not, I
can hide categories (that contain the forums and topics) on the category page and 
based on a users
log-in have them enabled. If that is not possible is it possible to create 2 category 
pages and
store them in one database, (hosting company only allows one instance of a forum 
script to be
installed) one for the forums that everyone that comes to my site can see and another 
category page
that will actually only be available in the restricted members only page.

If it helps, here are the links
http://www.phpbb.com and http://www.ikonboard.com

I think I prefer the phpbb forum because ikonboard uses cgi scripts, or it least 
that's what it
looks like.

Any help would be greatly appreciated.

Thanks
Indera



--- End Message ---
--- Begin Message ---
Ikonboard has a very nice interface and I know that its very popular but, as
you thought, it is CGI based.
I've never managed to get it working - maybe because I couldnt get Active
Perl working properly (well, it was a 25MHz 486 with 8Mb RAM!!).
If you're more into PHP I'd go with phpbb as you'd find it easier to tinker
around with to get it looking how you wanted.



"Indera" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Hello,
>
> I am trying to decide between these two scripts and was wondering if
anyone has either of them
> installed. The one thing I need that I can't figure out if either of them
have is whether or not, I
> can hide categories (that contain the forums and topics) on the category
page and based on a users
> log-in have them enabled. If that is not possible is it possible to create
2 category pages and
> store them in one database, (hosting company only allows one instance of a
forum script to be
> installed) one for the forums that everyone that comes to my site can see
and another category page
> that will actually only be available in the restricted members only page.
>
> If it helps, here are the links
> http://www.phpbb.com and http://www.ikonboard.com
>
> I think I prefer the phpbb forum because ikonboard uses cgi scripts, or it
least that's what it
> looks like.
>
> Any help would be greatly appreciated.
>
> Thanks
> Indera
>
>
>


--- End Message ---
--- Begin Message ---
Never thought I'd see this pop on here :)  As mentined before, Ikonboard is
in fact Perl and up until recently was only flatfile.  Another you may want
to try is http://www.yabb.info (PHP/mySQL combo)

Jeff
----- Original Message -----
From: "Indera" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, December 25, 2001 4:49 PM
Subject: [PHP] phpbb and ikonboard forum scripts


> Hello,
>
> I am trying to decide between these two scripts and was wondering if
anyone has either of them
> installed. The one thing I need that I can't figure out if either of them
have is whether or not, I
> can hide categories (that contain the forums and topics) on the category
page and based on a users
> log-in have them enabled. If that is not possible is it possible to create
2 category pages and
> store them in one database, (hosting company only allows one instance of a
forum script to be
> installed) one for the forums that everyone that comes to my site can see
and another category page
> that will actually only be available in the restricted members only page.
>
> If it helps, here are the links
> http://www.phpbb.com and http://www.ikonboard.com
>
> I think I prefer the phpbb forum because ikonboard uses cgi scripts, or it
least that's what it
> looks like.
>
> Any help would be greatly appreciated.
>
> Thanks
> Indera



--- End Message ---
--- Begin Message ---
Hi Jeff,

Thank you for the link to another script. I had never heard of that one and will 
definitely check it
out.

Indera



Jeff Lewis wrote:

> Never thought I'd see this pop on here :)  As mentined before, Ikonboard is
> in fact Perl and up until recently was only flatfile.  Another you may want
> to try is http://www.yabb.info (PHP/mySQL combo)
>
> Jeff
> ----- Original Message -----
> From: "Indera" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Tuesday, December 25, 2001 4:49 PM
> Subject: [PHP] phpbb and ikonboard forum scripts
>
> > Hello,
> >
> > I am trying to decide between these two scripts and was wondering if
> anyone has either of them
> > installed. The one thing I need that I can't figure out if either of them
> have is whether or not, I
> > can hide categories (that contain the forums and topics) on the category
> page and based on a users
> > log-in have them enabled. If that is not possible is it possible to create
> 2 category pages and
> > store them in one database, (hosting company only allows one instance of a
> forum script to be
> > installed) one for the forums that everyone that comes to my site can see
> and another category page
> > that will actually only be available in the restricted members only page.
> >
> > If it helps, here are the links
> > http://www.phpbb.com and http://www.ikonboard.com
> >
> > I think I prefer the phpbb forum because ikonboard uses cgi scripts, or it
> least that's what it
> > looks like.
> >
> > Any help would be greatly appreciated.
> >
> > Thanks
> > Indera

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

Thank you. I think I want to stick with the php/mysql combo, so will take ikonboard 
off the list.

Indera



Laserjetter wrote:

> Ikonboard has a very nice interface and I know that its very popular but, as
> you thought, it is CGI based.
> I've never managed to get it working - maybe because I couldnt get Active
> Perl working properly (well, it was a 25MHz 486 with 8Mb RAM!!).
> If you're more into PHP I'd go with phpbb as you'd find it easier to tinker
> around with to get it looking how you wanted.
>
> "Indera" <[EMAIL PROTECTED]> wrote in message
> [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> > Hello,
> >
> > I am trying to decide between these two scripts and was wondering if
> anyone has either of them
> > installed. The one thing I need that I can't figure out if either of them
> have is whether or not, I
> > can hide categories (that contain the forums and topics) on the category
> page and based on a users
> > log-in have them enabled. If that is not possible is it possible to create
> 2 category pages and
> > store them in one database, (hosting company only allows one instance of a
> forum script to be
> > installed) one for the forums that everyone that comes to my site can see
> and another category page
> > that will actually only be available in the restricted members only page.
> >
> > If it helps, here are the links
> > http://www.phpbb.com and http://www.ikonboard.com
> >
> > I think I prefer the phpbb forum because ikonboard uses cgi scripts, or it
> least that's what it
> > looks like.
> >
> > Any help would be greatly appreciated.
> >
> > Thanks
> > Indera
> >
> >
> >

--- End Message ---
--- Begin Message ---
From: LaserJetter

>Out of interest, would it be possible to load a webpage as a record in a
>MySQL database, having another field as say a number or a unique name so
>that a whole site could be placed in a database with a couple of php files?
>Is there a limit on the size of a field in MySQL which would stop you doing
>this though and would it be noticeably slower that html / php files?
>I was only wondering as it would make full text searches an awful lot
>simpler!!!!

Of course it is possible. (Why would it not be?)

I've don it my self (stored ptrocedures that builds HTML pages),
and especially the full text search you were talking about.
--- End Message ---
--- Begin Message ---
Hello,

I need to find a new host that is relatively in-expensive and found these three. I was 
wondering if
anyone here has used them or thinks that they are a good company.

http://www.aletiahosting.com/

http://www.cobaltconnection.com/

http://www.primemaster.com/index2.html

Thanks
Indera



--- End Message ---
--- Begin Message ---
Check out : 

http://www.weberdev.com/index.php3?GoTo=phenominet/prices.htm

This is your one stop shop for hosting. WeberDev.com is hosted there
and I can tell you that their service is amazing. They are fast,
reliable
and more than anything, very professional (specially in PHP / MySQL).

Sincerely

      berber

Visit http://www.weberdev.com Today!!! 
To see where PHP might take you tomorrow.


-----Original Message-----
From: Indera [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, December 26, 2001 12:03 AM
To: [EMAIL PROTECTED]
Subject: [PHP] Hosting advise


Hello,

I need to find a new host that is relatively in-expensive and found
these three. I was wondering if
anyone here has used them or thinks that they are a good company.

http://www.aletiahosting.com/

http://www.cobaltconnection.com/

http://www.primemaster.com/index2.html

Thanks
Indera




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

--- End Message ---
--- Begin Message ---
> http://www.aletiahosting.com/
No idea!

> http://www.cobaltconnection.com/
Likewise!

> http://www.primemaster.com/index2.html
This is one to avoidat all costs!!!!!!


Stephano Mariani

-----Original Message-----
From: Indera [mailto:[EMAIL PROTECTED]] 
Sent: Tuesday, 25 December 2001 10:3
To: [EMAIL PROTECTED]
Subject: [PHP] Hosting advise


Hello,

I need to find a new host that is relatively in-expensive and found
these three. I was wondering if anyone here has used them or thinks that
they are a good company.

http://www.aletiahosting.com/

http://www.cobaltconnection.com/

http://www.primemaster.com/index2.html

Thanks
Indera




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED] To
contact the list administrators, e-mail: [EMAIL PROTECTED]



--- End Message ---
--- Begin Message ---
Is there a utility out there that checks for typos, like a spell check but
for code? They are the most annoying things ever and probably the hardest of
errors to find in scrips.
Something simple, even command line would be handy.

Also, its interesting that only one user of the script got the error. What
about all the others? Are they not as considerate as this one guy who
actually reported the problem?


"Philip Olson" <[EMAIL PROTECTED]> wrote in message
Pine.BSF.4.10.10112252053030.8996-100000@localhost">news:Pine.BSF.4.10.10112252053030.8996-100000@localhost...
> > "Call to unsupported or undefined function srtoupper() in.... on line
82."
>
> srt != str (typo).
>
> > if (strtoupper(substr($xmbrcode,11,1)) != "B" &&
> >     strtoupper(substr($xmbrcode,11,1)) != "P" &&
> >     srtoupper(substr($xmbrcode,11,1)) != "H" &&
> >     srtoupper(substr($xmbrcode,11,1)) != "O").... {
>
> See above.  Btw, consider something like:
>
>   $str = '123456789abcdef';
>   $bad = array('B','P','H','O');
>
>   if (in_array(strtoupper($str{11}),$bad)) {
>       echo 'boo';
>   }
>
> I can't believe people code on Christmas :)
>
> Warm regards,
> Philip Olson
>




--- End Message ---
--- Begin Message ---
Yeah,

I know it's executed client side, but if the buffer fills up because you
have a lot to send to the client (and the network connection is saturated),
then it might fail, since it cannot do the test. it is unlikely, but
possible. Also, that code you quoted is (out of context) inefficient, so
that might prove why.

Also, it's worth noting that only 1 in 10 people complain about something.
Thus, your one client reporting this error may mean there are 10 out there
:)

Best bet is to get his headers etc (set up a seperate log site? get him to
dump the page for you as you echo variables and debug info? -- you certainly
won't know which strtoupper it fails on if they are all on the same line :))
Also, get him to give you his cookies -- chances are there could be a
datatype incompatibility.

The bottom line i am getting across here is that there are so many
possibilities here for potential errors, (like in many things) that it is
hard to pinpoint what might be wrong.

If it helps, i am more than happy to look at your code and see if i can
break it.

Regards, and now christmas day is drawing to a close, merry new year :)

James Cox
--
[EMAIL PROTECTED]
Please always Cc to me when replying to me on the lists.

--- End Message ---
--- Begin Message ---
Ah yes... that would do it. How embarrassing! But another respondent brought
up an interesting question. Why does this error not show up every time? As
written, it is a basic syntactical error. I tested this thing up and down; I
test it in production every day.

Ah.... it's always something.... thanks much.


Philip Olson wrote in message ...
>> "Call to unsupported or undefined function srtoupper() in.... on line
82."
>
>srt != str (typo).
>
>> if (strtoupper(substr($xmbrcode,11,1)) != "B" &&
>>     strtoupper(substr($xmbrcode,11,1)) != "P" &&
>>     srtoupper(substr($xmbrcode,11,1)) != "H" &&
>>     srtoupper(substr($xmbrcode,11,1)) != "O").... {
>
>See above.  Btw, consider something like:
>
>  $str = '123456789abcdef';
>  $bad = array('B','P','H','O');
>
>  if (in_array(strtoupper($str{11}),$bad)) {
>      echo 'boo';
>  }
>
>I can't believe people code on Christmas :)
>
>Warm regards,
>Philip Olson
>


--- End Message ---
--- Begin Message ---
> Is there a utility out there that checks for typos, like a spell check but
> for code? They are the most annoying things ever and probably the hardest of
> errors to find in scrips.
> Something simple, even command line would be handy.

It's good to program with error_reporting turned all the way up, E_ALL,
which is configured with the error_reporting directive (see php.ini) or by
the error_reporting function:

  error_reporting(E_ALL);

Undefined variables, misspelled function names, and various typos will
most likely turn up an error (unless you find a undocumented feature :).
When an error says "undefined function" then it's either:

  a) Built-in PHP functions
    - A typo
    - PHP was not compiled with the given extension.  For example, 
      if mysql_connect is undefined, mysql wasn't compiled into PHP.
  b) User defined
    - A typo
    - Undefined, as in a function library wasn't includ()ed, etc.

If a variable is undefined, it could be a typo because all good little
programs make sure their variables are defined before use :)  Anyway this
rambling rant basically says turn up error_reporting and use Common Sense.
And, to keep in mind that error reporting isn't perfect.

If an error stumps someone, searching the archives (or google) for the
error can be helpful.  For example:

  http://marc.theaimsgroup.com/?l=php-general&s=headers+already+sent
  http://www.google.com/search?q=php+%22headers+already+sent%22

Anyway, what was the question again? :)

Regards,
Philip Olson


--- End Message ---
--- Begin Message ---
> Ah yes... that would do it. How embarrassing! But another respondent brought
> up an interesting question. Why does this error not show up every time? As
> written, it is a basic syntactical error. I tested this thing up and down; I
> test it in production every day.

This error will happen every time.  Check your error_reporting setting
*shrugs* See the email I just posted.

> Ah.... it's always something.... thanks much.

Yep :)

Regards,
Philip Olson

--- End Message ---
--- Begin Message ---
At 08:53 PM 12/25/01 -0500, jjt wrote:
>Why does this error not show up every time?

It will show up every time PHP attempts to call the (incorrect) function.  But the 
functions won't be called every time.

For example, due to short-circuit evaluation, if the string is "B" or "P", the error 
will never happen.

Also, if your if statement isn't always reached, then the error will not happen.  
Finally, not all users will report the error when they get it.  But you can deal with 
that by looking at your PHP error log file.

I believe there is a way to call PHP from the command line and do a "syntax check" on 
a given file.  But I have never tried it and I have no idea if it really works.  Check 
the manual.

- Ken
[EMAIL PROTECTED]

> >> if (strtoupper(substr($xmbrcode,11,1)) != "B" &&
> >>     strtoupper(substr($xmbrcode,11,1)) != "P" &&
> >>     srtoupper(substr($xmbrcode,11,1)) != "H" &&
> >>     srtoupper(substr($xmbrcode,11,1)) != "O").... {

--- End Message ---
--- Begin Message ---
because the way && is evaluated.

if the first part of the && expression is false, then it doesn't even
attempt to look at the second part, meaning you get a fastest evaluation
:)...

I think its called Lazy Logic or something, I know its in the PHP Manual
somewhere :)

Andrew
----- Original Message -----
From: "jjt" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, December 26, 2001 1:53 AM
Subject: Re: [PHP] Client side fatal PHP error


> Ah yes... that would do it. How embarrassing! But another respondent
brought
> up an interesting question. Why does this error not show up every time? As
> written, it is a basic syntactical error. I tested this thing up and down;
I
> test it in production every day.
>
> Ah.... it's always something.... thanks much.
>
>
> Philip Olson wrote in message ...
> >> "Call to unsupported or undefined function srtoupper() in.... on line
> 82."
> >
> >srt != str (typo).
> >
> >> if (strtoupper(substr($xmbrcode,11,1)) != "B" &&
> >>     strtoupper(substr($xmbrcode,11,1)) != "P" &&
> >>     srtoupper(substr($xmbrcode,11,1)) != "H" &&
> >>     srtoupper(substr($xmbrcode,11,1)) != "O").... {
> >
> >See above.  Btw, consider something like:
> >
> >  $str = '123456789abcdef';
> >  $bad = array('B','P','H','O');
> >
> >  if (in_array(strtoupper($str{11}),$bad)) {
> >      echo 'boo';
> >  }
> >
> >I can't believe people code on Christmas :)
> >
> >Warm regards,
> >Philip Olson
> >
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>
>

--- End Message ---
--- Begin Message ---
Hi there,

I've been searching for a PHP implementation of the GNU textformatting tool 
fmt (http://www.gnu.org/software/textutils/textutils.html) which provides an 
almost optimal linebreak for your text.

I'm not skilled in enough in C programming to implement such a feature for 
PHP but I'd really appreciate having this algorithm available in a simple 
PHP function.

My question is, if there's anyone who is interested in implementing this for 
PHP, so that we can see it in one of the next releases?

I think, the function would be very useful to do some pretty reformatting of 
text when for example sending mail or in general doing text formatted 
output.

Thanks for your replies in advance,

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

Dominik Roettsches wrote:
> 
> Hi there,
> 
> I've been searching for a PHP implementation of the GNU textformatting tool
> fmt (http://www.gnu.org/software/textutils/textutils.html) which provides an
> almost optimal linebreak for your text.
> 
> I'm not skilled in enough in C programming to implement such a feature for
> PHP but I'd really appreciate having this algorithm available in a simple
> PHP function.
> 
> My question is, if there's anyone who is interested in implementing this for
> PHP, so that we can see it in one of the next releases?
> 
> I think, the function would be very useful to do some pretty reformatting of
> text when for example sending mail or in general doing text formatted
> output.

I have implemented exactly what you need in this class to compose and
send MIME messages as it is important that messages to not have more
than 75 characters per line.

http://phpclasses.UpperDesign.com/browse.html/package/9

Regards,
Manuel Lemos
--- End Message ---
--- Begin Message ---
* Manuel Lemos ([EMAIL PROTECTED]) [Dec 25. 2001 17:37]:

> > I think, the function would be very useful to do some pretty reformatting of
> > text when for example sending mail or in general doing text formatted
> > output.

> I have implemented exactly what you need in this class to compose and
> send MIME messages as it is important that messages to not have more
> than 75 characters per line.

> http://phpclasses.UpperDesign.com/browse.html/package/9

For 4.0.2 or greater, there's also:

<http://www.php.net/manual/en/function.wordwrap.php>

-- 
Brian Clark | Avoiding the general public since 1805!
Fingerprint: 07CE FA37 8DF6 A109 8119 076B B5A2 E5FB E4D0 C7C8
It's been lovely, but I have to scream now.

--- End Message ---
--- Begin Message ---
You may use these two and not have to bother what version of PHP your
script runs on.

Note that you may have to edit wordwrap if you need to chop exceedingly
long words (this code allows long lines in this case).

Please let me know if you use/optimize this.

HTH

Bogdan

------------------------------
  // Function to determine if the current version of PHP is
  // at least the one specified as a string in the parameter.
  // This is needed because string comparison isn't always accurate:
  // "4.0.2">"4.0.12" as strings, although that's not true when
  // speaking of comparing versions.

  // Usage example:
  // if (!isphpver("4.0.2"))
  // {
  //   [do something]
  // }

  // Bogdan Stancescu <[EMAIL PROTECTED]>, November 2001

  function isphpver($minver)
  {
    $itis=2; // That is, undecided
    $minimum=explode(".",$minver);
    $current=explode(".",phpversion());
    for ($i=0;(($i<sizeof($current)) && ($i<sizeof($minimum)));$i++)
    {
      if ($current[$i]>$minimum[$i])
      {
        $itis=true; // In this case, we have a winner
        break;
      }
      if ($current[$i]<$minimum[$i]) // >
      {
        $itis=false; // In this case, we have a loser
        break;
      }
    }
    if ($itis==2) // This would only happen if all the common version
                  // components are identical. But there are may be
                  // differences:
                  // Example 1: comparing "4.0.1" with "4.0" would be
                  //            identical for now, but the condition
                  //            is satisfied;
                  // Example 2: comparing "4.0" with "4.0.1" - identical
                  //            for now, but the condition is NOT
                  //            satisfied
    {
      if (sizeof($current)>=sizeof($minimum))
      {
        $itis=true;
      }
      else
      {
        // Ok, only one more chance: if for example the user
        // specified "4.0.0" and phpversion returned "4.0".
        for ($i=sizeof($current)-1;$i<sizeof($minimum);$i++) // >
        {
          if ($minimum[$i])
          {
            $itis=false;
          }
        }
        if ($itis==2)
        {
          $itis=true;
        }
      }
    }
    return($itis);
  }

  // Bogdan Stancescu <[EMAIL PROTECTED]>, November 2001
  if (!isphpver("4.0.2"))
  {
    // Word-wrap $string at $width chars
    // Already available in PHP 4.0.2 and later
    function wordwrap($string,$width=75)
    {
      // So, this is how we're going to go about wrapping the incoming
      // text:
      // We first break the text into natural lines:
      $tm_str=explode("\n",$string);
      for ($i=0;$i<sizeOf($tm_str);$i++)
      {
        // Then we move each line into a temporary string we'll start
        // chopping until we finish it.
        $temp_str=$tm_str[$i];
        $line_st="";
        while ($temp_str)
        {
          // Now let's see if the incoming string (or what's left of it)
          // isn't already shorter than the desired length.
          if (($line_len=strlen($temp_str))>$width)
          {
            // If it isn't, we'll just chop a piece of the ideal width
            // for starters.
            $wrapped_st=substr($temp_str,0,$width);

            // We'll start looking for a space in order to break the
            // line there.

            // (searching backwards!)
            if ($wrapping_len=strrpos($wrapped_st," "))
            {
              // If there is one (it usually is) then we'll retrieve its
              // position and use it
              $line_len=$wrapping_len;
            }
            else
            {
              // Otherwise (i.e. a LOOONG word) then we'll just have to
              // look where it ends and use that.
              $line_len=strpos($temp_str," ");
            }
          }
          // Now that we have the proper line ending we'll chop the
          // temporary string and add the chopped
          // part to the final (wrapped) string, along with a line
          // break.
          // Obviously, we'll do that in
          // reversed order than described here.
          $line_st.=substr($temp_str,0,$line_len)."\n";
          $temp_str=substr($temp_str,$line_len);

          // Making sure we don't leave spaces at the beginning of the
          // next line
          if (substr($temp_str,0,1)==" ")
          {
            $temp_str=substr($temp_str,1);
          }
        } // while
        // We need this for incoming empty lines:
        if (!strlen($line_st))
        {
          $final_st.="\n";
        }
        else
        {
          $final_st.=$line_st;
        }
      } // for
      return($final_st);
    } // function
  } // if phpver
------------------------------

Dominik Roettsches wrote:

> Hi there,
>
> I've been searching for a PHP implementation of the GNU textformatting tool
> fmt (http://www.gnu.org/software/textutils/textutils.html) which provides an
> almost optimal linebreak for your text.
>
> I'm not skilled in enough in C programming to implement such a feature for
> PHP but I'd really appreciate having this algorithm available in a simple
> PHP function.
>
> My question is, if there's anyone who is interested in implementing this for
> PHP, so that we can see it in one of the next releases?
>
> I think, the function would be very useful to do some pretty reformatting of
> text when for example sending mail or in general doing text formatted
> output.
>
> Thanks for your replies in advance,
>
> Dominik
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
--- End Message ---
--- Begin Message ---
Hello,

Rambo Amadeus wrote:
> 
> Hi,
> I have about 100 names in mysql. How can i display them in groups of 10, and
> have next and previous links.

You may want to try this PHP Class that displays HTML tables with query
results that may be limited per page. In that case it display links to
go to the next, previous, last, first and some intermediate pages that
you may configure. See the HTML example page. This class works with
MySQL and many other databases:

http://phpclasses.UpperDesign.com/browse.html/package/130

Regards,
Manuel Lemos
--- End Message ---
--- Begin Message ---
Merry Christmas everybody.

I am using MS Windows 98 with Apache and following an example in Julie
Meloni's "PHP - Fast and Easy" (Chapter 10) in which she describes file
uploading using PHP on page 168-174.

She has two files:
1) an html form to receive the input from the user for the file to be
uploaded
2) a .php script to accept the variable and use the copy() function.
.............................................................

The scripts are as follows:
(html form)

<HTML>
<HEAD>
<TITLE>Upload a File</TITLE>
</HEAD>
<BODY>

<H1>Upload a File</H1>

<FORM METHOD="post" ACTION="do_upload.php" ENCTYPE="multipart/form-data">

<p><strong>File to Upload:</strong><br>
<INPUT TYPE="file" NAME="img1" SIZE="30"></p>

<P><INPUT TYPE="submit" NAME="submit" VALUE="Upload File"></p>

</FORM>

</BODY>
</HTML>
................................................
(.php script)

<?
if ($img1_name != "") {

@copy("$img1", "c:/Program Files/Apache Group/Apache/htdocs/$img1_name")
or die("Couldn't copy the file.");

} else {

die("No input file specified");

 }

?>

<HTML>
<HEAD>
<TITLE>Successful File Upload</TITLE>
</HEAD>
<BODY>

<H1>Success!</H1>

<P>You sent: <? echo "$img1_name"; ?>, a <? echo "$img1_size"; ?>
byte file with a mime type of <? echo "$img1_type"; ?>.</P>

</BODY>
</HTML>
......................................................

My questions:
I am able to upload a file from My Documents  to the Apache server however
in her book, she describes that the user can verify that the file was
uploaded to the server by going to:

File/ Open Page / in ones web browser to navigate through their filesystem
to
find the file that was uploaded.  There is a screenshot in the book that
shows the .jpeg file on the screen with the browser at:
file:///C/Apache/htdocs/blahblah.jpg

I can't seem to verify that the file exists using this method.

The only way I can verify that the file was indeed uploaded is to go into
the folder within Apache that was specified in the path and check there.

*How can I check by going through the browser window?*

Next question:

When I check that the file was uploaded, the file is saved in:
C:/Program Files/Apache Group/Apache/htdocs/$img1_name

as the *regular *.jpeg name I originally gave it - not the variable - $img1.

Is this correct? Or, should the file be saved as:
img1?

And the last question:
This is the line I received upon sending the file:

You sent: KewpieSmall.jpeg, a 3127 byte file with a mime type of
image/pjpeg.

In her book, it says:
image/jpeg.

What is:
image/pjpeg.?

Many thanks and best wishes to all for a happy and healthy new year.
Tony Ritter





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

Dear Listmembers,

I just started to structure WEBPRESENCE SERVICES in a way of generating
income for those participating in the venture. We're still building a
portfolio and just finished this site:
http://www.150plusidea.com/

On the "registration" link you see a contact information collection form,
which is connected to a MySQL db on the server via a PHP4 script.

Our GOAL is to develop that CONTACT INFORMATION/REGISTRATION FORM and its
management into a "COOKIE CUTTER" feature for our future clients. The
person which has handled the php scripting is no longer working with us,
hence we're looking for a new programmer who would like to play with us!

Please direct your response to:

mailto:[EMAIL PROTECTED]

Mele Kalikimaka [Merry Xmas],

Peter
Aloha Web Presence

--- End Message ---
--- Begin Message ---
I recall seeing a thread along these lines previously, but the search
functionality at lists.php.net is currently  offline, and try as I might
to save messages that may prove useful to me in the future, I cannot get
them all.

So I apologize that this may be found elsewhere, or may be rehash for most
of you.

That given, I'm looking for the ability (using regex, i'm sure) to put
something like <foo>booger</foo> into a database (via a form), and have it
translate to $foo="booger" when php sucks it back out.

the eventual use of this will allow me to type  something like:

that's very <m-w>tenacious</m-w> of you ...

and have the end output be ereg_replaced (or such) to:

that's very <a
href=http://www.m-w.com/cgi-bin/dictionary?va=tenacious>tenacious</a> of
you ...

so i need to take whatever is within the <mw> tag, define that as
$word, and then replace the whole string (tags and word) with:

<a href="http://www.m-w.com/cgi-bin/dictionary?va=$word>$word</a>

follow me?

a simple answer will do, or a point towards an appropriate turorial may
serve me better in the long run

thanks in advance


        --kevin

--- End Message ---
--- Begin Message ---
Hello!

Two items in the new 4.10 change-log caught my attention:

*    Introduced a new $_REQUEST array, which includes any GET, POST or
COOKIE variables. Like the other new variables, this variable is also
available regardless of the context. (Andi & Zeev)
*    Introduced $_GET, $_POST, $_COOKIE, $_SERVER and $_ENV variables, which
deprecate the old $HTTP_*_VARS arrays. In addition to be much shorter to
type - these variables are also available regardless of the scope, and
there's no need to import them using the 'global' statement. (Andi & Zeev)

However, I can't seem to find any documentation regarding these variables on
the php.net site.  Any pointers?  Am I missing something obvious?  Thanks!

-- 
Ed Marczak
[EMAIL PROTECTED]

--- End Message ---
--- Begin Message ---
because they are not documented yet, but, will be.  there really is
nothing else to say besides what you quoted, they act like their
counterparts except these new ones are global.

by counterparts i mean _GET == HTTP_GET_VARS so the manual entries on
those will apply.  see the predefined variables section of manual and
phpinfo().

regards,
Philip Olson


On Tue, 25 Dec 2001, Edward Marczak wrote:

> Hello!
> 
> Two items in the new 4.10 change-log caught my attention:
> 
> *    Introduced a new $_REQUEST array, which includes any GET, POST or
> COOKIE variables. Like the other new variables, this variable is also
> available regardless of the context. (Andi & Zeev)
> *    Introduced $_GET, $_POST, $_COOKIE, $_SERVER and $_ENV variables, which
> deprecate the old $HTTP_*_VARS arrays. In addition to be much shorter to
> type - these variables are also available regardless of the scope, and
> there's no need to import them using the 'global' statement. (Andi & Zeev)
> 
> However, I can't seem to find any documentation regarding these variables on
> the php.net site.  Any pointers?  Am I missing something obvious?  Thanks!
> 
> -- 
> Ed Marczak
> [EMAIL PROTECTED]
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
> 

--- End Message ---
--- Begin Message ---
 hmm, now that i\'m trying to program with register_globals=off, what is the new 
$HTTP_SESSION_VARS?

maybe there should be a page in the online manual describing these new variables for 
easy reference after all, i can\'t find reference to them other than those on the 
changelog too.

thanks
David
>
>Two items in the new 4.10 change-log caught my attention: 
>
>* Introduced a new $_REQUEST array, which includes any >GET, POST or 
>COOKIE variables. Like the other new variables, this >variable is also 
>available regardless of the context. (Andi & Zeev) 
>* Introduced $_GET, $_POST, $_COOKIE, $_SERVER and $_ENV >variables, which 
>deprecate the old $HTTP_*_VARS arrays. In addition to be >much shorter to type - 
>these variables are also available >regardless of the scope, and there\'s no need to 
>import >them using the \'global\' statement. (Andi & Zeev) 
>
>However, I can\'t seem to find any documentation regarding >these variables on the 
>php.net site. Any pointers? Am I >missing something obvious? Thanks! 
--- End Message ---
--- Begin Message ---
> hmm, now that i\'m trying to program with register_globals=off, what
> is the new $HTTP_SESSION_VARS?

$HTTP_SESSION_VARS works, as will $_SESSION (after 4.1.0).  These
"special" PHP variables are described in the manual:

  http://www.php.net/manual/en/language.variables.predefined.php

Some words specific to $_SESSION are available within here:

  http://www.php.net/release_4_1_0.php

An excerpt:


Another neat trick is that creating new entries in the $_SESSION array
will automatically register them as session variables, as if you called
session_register(). This trick is limited to the session module only - for
example, setting new entries in $_ENV will *not* perform an implicit
putenv().

 
> maybe there should be a page in the online manual describing these new 
> variables for easy reference after all, i can\'t find reference to
> them other than those on the changelog too.

The new vars will be listed and described in the manual eventually (fairly
soon).  For now, read the above release notes.


Regards,
Philip Olson

--- End Message ---
--- Begin Message ---
 ok, thanks Phillips!

>The new vars will be listed and described in the manual >eventually (fairly soon). 
>For now, read the above release >notes. 

--- End Message ---
--- Begin Message ---
Anyway to reverse the effect of htmlspecialchars?

Reason: to send an email message where &quot; is shown as " and not 
&quot; LOL

Thanks.


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

> Anyway to reverse the effect of htmlspecialchars?

See the docs found here:

  http://www.php.net/manual/en/function.get-html-translation-table.php

Shown there is a way to do this.

Regards,
Philip Olson

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

Hi Brian ,
I don't have any file like ph_gd.dll .



                                                                                       
                             
                    Brian Clark                                                        
                             
                    <brianj@fusion        To:     "PHP is not a drug." 
<[EMAIL PROTECTED]>                  
                    werks.com>            cc:                                          
                             
                                          Subject:     Re: [PHP] 
gd_installation......................... :(        
                    25.12.2001                                                         
                             
                    18:45                                                              
                             
                                                                                       
                             
                                                                                       
                             




* EMIN CALIKLI ([EMAIL PROTECTED]) [Dec 25. 2001 05:20]:

> Hi Brian ,

Hiya.

> Thanks for your requests . I 'm using php 4.0.6 + IIS 4.0 (Web Server) . I tried 
>many verisons of
GD
> library and failed. Did anyone tried php-4.1.0 verison on IIS 4.0 ? By the way Brian 
>I configured
my
> local workstation with Apache 1.3.22 + php 4.0.6 and it works fine. I can use it GD 
>extension. But
I
> must run GD on IIS don 't ask me why ? This is companies strategy . So I think I 
>must work hard to
> solve it.
> Thanks again.

What happened when you renamed the ph_gd.dll file to php_gd.dll? Did you
try that?

--
Brian Clark | Avoiding the general public since 1805!
Fingerprint: 07CE FA37 8DF6 A109 8119 076B B5A2 E5FB E4D0 C7C8
The beatings will continue until morale improves.


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]





--- End Message ---

Reply via email to