php-general Digest 9 Jun 2002 15:11:40 -0000 Issue 1395

Topics (messages 101306 through 101330):

Re: Removing ^M
        101306 by: Miguel Cruz
        101326 by: Michael Hall

Re: how to test if rewrite rule is working
        101307 by: Miguel Cruz

Function needed
        101308 by: Gaylen Fraley
        101321 by: Austin Marshall
        101325 by: Jason Wong

PHPMyAdmin Alternative?
        101309 by: John Taylor-Johnston
        101314 by: César L. Aracena
        101317 by: John Taylor-Johnston

Date?
        101310 by: Jeremy Bowen
        101311 by: John Taylor-Johnston
        101316 by: John Taylor-Johnston
        101319 by: Jason Wong

Re: Javascript & PHP cookies
        101312 by: John Taylor-Johnston

PHP function for listing number of columns in table
        101313 by: webmaster.tececo.com
        101318 by: hugh danaher

Re: PHP Compile with sun 5.7
        101315 by: Moussa Dahadha

error reporting
        101320 by: Scott 'INtense!' Reismanis
        101323 by: Jason Wong

populating list menus with mysql and for statements
        101322 by: electroteque
        101328 by: Andy

STDIN/STDOUT in PHP
        101324 by: Jimmy Lantz

using HTTP-PUT-Method problem
        101327 by: Wolfram Kriesing

Re: MyCC Problem
        101329 by: Andy

Re: restricting files
        101330 by: Justin French

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 ---
I don't think tr expects to receive a filename on the command line. Try:

   tr -d "\r" < oldfile.html > newfile.html

miguel

On Sat, 8 Jun 2002, Steve Buehler wrote:
> I get this when running that command:
> tr: only one string may be given when deleting without squeezing repeats
> 
> 
> I looked at the tr man pages and it didn't help much.  I also tried using 
> '\r' and `\r` and just \r , but always get the same result.
> 
> Steve
> 
> At 11:07 PM 6/8/2002 +0200, you wrote:
> >why not just run
> >     tr -d "\r" htmlfile.htm
> >
> >
> >----- Original Message -----
> >From: "Michael Hall" <[EMAIL PROTECTED]>
> >To: "PHP List" <[EMAIL PROTECTED]>
> >Sent: Sunday, June 09, 2002 2:40 AM
> >Subject: [PHP] Removing ^M
> >
> >
> > >
> > >
> > > I am trying remove ^M characters (some kind of newline character) from an
> > > HTML file. I've tried all sorts of ereg_replace and sed possibilities
> > > but the
> > > things just won't go away. Does anyone have a way of removing such
> > > characters?
> > >
> > > TIA
> > >
> > > Mick
> > >
> > >
> > >
> > >
> > > --
> > > PHP General Mailing List (http://www.php.net/)
> > > To unsubscribe, visit: http://www.php.net/unsub.php
> > >
> > >
> >
> >
> >--
> >PHP General Mailing List (http://www.php.net/)
> >To unsubscribe, visit: http://www.php.net/unsub.php
> >
> >
> >--
> >This message has been scanned for viruses and
> >dangerous content by MailScanner, and is
> >believed to be clean.
> >ow3
> 
> 
> 
> 

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

As a result of my original request, I now have half a dozen ways of doing
this using php, perl, python and tr :)

I guess this is sort of on topic because there may be PHP
programmers who want to do this without writing a PHP script that
probably has to be run by a web server.

Anyway, someone on the Python list suggested this variety of tr:

tr -d '\015' <infile >outfile

I haven't tested this. 015 is the numeric code for "\r".

Mick


On Sat, 8 Jun 2002, Steve Buehler wrote:

> I get this when running that command:
> tr: only one string may be given when deleting without squeezing repeats
> 
> 
> I looked at the tr man pages and it didn't help much.  I also tried using 
> '\r' and `\r` and just \r , but always get the same result.
> 
> Steve
> 
> At 11:07 PM 6/8/2002 +0200, you wrote:
> >why not just run
> >     tr -d "\r" htmlfile.htm
> >
> >
> >----- Original Message -----
> >From: "Michael Hall" <[EMAIL PROTECTED]>
> >To: "PHP List" <[EMAIL PROTECTED]>
> >Sent: Sunday, June 09, 2002 2:40 AM
> >Subject: [PHP] Removing ^M
> >
> >
> > >
> > >
> > > I am trying remove ^M characters (some kind of newline character) from an
> > > HTML file. I've tried all sorts of ereg_replace and sed possibilities
> > > but the
> > > things just won't go away. Does anyone have a way of removing such
> > > characters?
> > >
> > > TIA
> > >
> > > Mick
> > >
> > >
> > >
> > >
> > > --
> > > PHP General Mailing List (http://www.php.net/)
> > > To unsubscribe, visit: http://www.php.net/unsub.php
> > >
> > >
> >
> >
> >--
> >PHP General Mailing List (http://www.php.net/)
> >To unsubscribe, visit: http://www.php.net/unsub.php
> >
> >
> >--
> >This message has been scanned for viruses and
> >dangerous content by MailScanner, and is
> >believed to be clean.
> >ow3
> 
> 
> 
> 

-- 
--------------------------------
n   i   n   t   i  .   c   o   m
php-python-perl-mysql-postgresql
--------------------------------
Michael Hall     [EMAIL PROTECTED]
--------------------------------

--- End Message ---
--- Begin Message ---
On Sat, 8 Jun 2002, Nicole Lallande wrote:
> I have created the following htaccess file using rewrite rules  for the 
> purpose of having search engine friendly files created from my dynamic 
> files.  
> 
> RewriteEngine On
> RewriteRule ^index-(.*),(.*)\.html$ index.php?section=$1&page=$2
> RewriteRule ^nav-(.*),(.*)\.html$ nav.php?section=$1&page=$2
> 
> How do I test to see if this is working from a search engine robot 
> standpoint?  I don't see anything in my log files and I don't see that 
> the URI in the address bar has changed.  Am I doing something wrong?

This isn't a PHP question.

If you don't have the rule do a redirect [R] then you won't see a change 
in the address bar.

The obvious way to test it in any case is to supply a URL like 
index-1,2.html or whatever and see if you get to the right place.

miguel

--- End Message ---
--- Begin Message ---
I am in need of a function/script that will take a directory and search all
filenames, recursively down, for a given file.  Can anyone point me to a
source?  Thanks.



--- End Message ---
--- Begin Message ---
Gaylen Fraley wrote:
> I am in need of a function/script that will take a directory and search all
> filenames, recursively down, for a given file.  Can anyone point me to a
> source?  Thanks.
> 
> 
> 

$result=`grep -r 'expression' ./`;

--- End Message ---
--- Begin Message ---
On Sunday 09 June 2002 17:17, Austin Marshall wrote:
> Gaylen Fraley wrote:
> > I am in need of a function/script that will take a directory and search
> > all filenames, recursively down, for a given file.  Can anyone point me
> > to a source?  Thanks.
>
> $result=`grep -r 'expression' ./`;

This searches for strings within a file.

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.com.hk
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *

/*
Earth -- mother of the most beautiful women in the universe.
                -- Apollo, "Who Mourns for Adonais?" stardate 3468.1
*/

--- End Message ---
--- Begin Message ---
Are there alternatives to PHPMyAdmin available?
www.mysql.com/ is supposed to have one, no?

--
John Taylor-Johnston
-----------------------------------------------------------------------------
   -     Université de Sherbrooke:


--- End Message ---
--- Begin Message ---
Look in http://www.mysql.com/downloads/gui-mycc.html and download the
latest version of MyCC, which helped me to manage the DBs on the server.
I found a problem with the current version, but one of it's developers
told me to wait 'till next week when the new release is available.

The problem is that you can't issue multiple SQL queries, but that will
be solved.


César Aracena
IS / MCSE+I
Neuquén, NQN
(0299) 156-356688
(0299) 446-6621

> -----Mensaje original-----
> De: John Taylor-Johnston [mailto:[EMAIL PROTECTED]]
> Enviado el: Domingo, 09 de Junio de 2002 01:33 a.m.
> Para: [EMAIL PROTECTED]
> Asunto: [PHP] PHPMyAdmin Alternative?
> 
> Are there alternatives to PHPMyAdmin available?
> www.mysql.com/ is supposed to have one, no?
> 
> --
> John Taylor-Johnston
>
------------------------------------------------------------------------
--
> ---
>    -     Université de Sherbrooke:
> 
> 
> 
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php


--- End Message ---
--- Begin Message ---
This a binary? I was hoping for a web-based (PHP, Perl, ASP, etc.) alternative - like 
PHPMyAdmin - to analyse.

"César l . aracena" wrote:

> Look in http://www.mysql.com/downloads/gui-mycc.html and download the
> The problem is that you can't issue multiple SQL queries, but that will
> be solved.

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

I am having nothing but trouble with the date function. I want it to print
out a date like this: Saturday June 8, 2002 but as soon as I put spaces or
comma's in the string I get parse errors. I can get it to print
SaturdayJune082002 with  <? echo date (lFdY); ?> I have tried escaping with
\ but it seems to make no difference.

Any ideas?

Thanks,

Jeremy

--- End Message ---
--- Begin Message ---
<? echo date (l.", ".F." ".d.", ".Y); ?>
Sunday, June 09, 2002

But I would use:

<?php echo date (l.", ".F." ".d.", ".Y); ?>

Don't know why, but someone told me once it had something to do with versions.

John

Jeremy Bowen wrote:

> I am having nothing but trouble with the date function. I want it to print
> out a date like this: Saturday June 8, 2002 but as soon as I put spaces or
> comma's in the string I get parse errors. I can get it to print
> SaturdayJune082002 with  <? echo date (lFdY); ?> I have tried escaping with
> \ but it seems to make no difference.
>

--- End Message ---
--- Begin Message ---
I added a comment to the FAQ:
http://www.php.net/manual/en/function.date.php

--- End Message ---
--- Begin Message ---
On Sunday 09 June 2002 12:49, John Taylor-Johnston wrote:
> <? echo date (l.", ".F." ".d.", ".Y); ?>
> Sunday, June 09, 2002
>
> But I would use:
>
> <?php echo date (l.", ".F." ".d.", ".Y); ?>

or simply:

echo date ("l F d, Y");

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.com.hk
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *

/*
Condense soup, not books!
*/

--- End Message ---
--- Begin Message ---
Absolutely. I've done it. Cookies are cookies.

What I don't like is that the cookie is not saved unitl after a submit.

In Javascript, I have JS code that will assign a value and save it to a cookie and 
then recall the cookie value and document.write(myvalue), over and
over if I want, without EVER submitting. It works as the page loads.

Need JS code?


> [EMAIL PROTECTED]
> www.tececo.com
--- End Message ---
--- Begin Message ---
Pardon the probably stupid question but,

Is there a PHP function for listing number of columns in a mySQL table?

Thanks in advance

JJ Harrison
[EMAIL PROTECTED]
www.tececo.com

--- End Message ---
--- Begin Message ---
try
mysql_num_fields()
Hugh
----- Original Message ----- 
From: <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Saturday, June 08, 2002 9:54 PM
Subject: [PHP] PHP function for listing number of columns in table


Pardon the probably stupid question but,

Is there a PHP function for listing number of columns in a mySQL table?

Thanks in advance

JJ Harrison
[EMAIL PROTECTED]
www.tececo.com



--- End Message ---
--- Begin Message ---
Any News ??


Moussa Dahadha wrote:

>
>
>
>        Hi, i know that this question was asked many times but i still
>        can't find any solution :-(
>
>        When i try to compile php
>
>
>        I alweys recive this error:
>
> Making all in .
> make[1]: Entering directory `/root/php-4.2.1'
> /bin/sh /root/php-4.2.1/libtool --silent --mode=link gcc  -I. 
> -I/root/php-4.2.1/ -I/root/php-4.2.1/main -I/root/php-4.2.1 
> -I/www/include -I/root/php-4.2.1/Zend 
> -I/root/php-4.2.1/ext/mysql/libmysql -I/root/php-4.2.1/ext/xml/expat  
> -D_POSIX_PTHREAD_SEMANTICS -DSOLARIS2=270 -DUSE_EXPAT 
> -I/root/php-4.2.1/TSRM -g -O2 -prefer-pic   -o libphp4.la -rpath 
> /root/php-4.2.1/libs -avoid-version -L/usr/ucblib  -R /usr/ucblib 
> stub.lo  Zend/libZend.la sapi/apache/libsapi.la main/libmain.la 
> regex/libregex.la /root/php-4.2.1/ext/ctype/libctype.la 
> /root/php-4.2.1/ext/mysql/libmysql.la 
> /root/php-4.2.1/ext/pcre/libpcre.la 
> /root/php-4.2.1/ext/posix/libposix.la 
> /root/php-4.2.1/ext/session/libsession.la 
> /root/php-4.2.1/ext/standard/libstandard.la 
> /root/php-4.2.1/ext/xml/libxml.la TSRM/libtsrm.la -lpam -lcrypt 
> -lresolv -lresolv -lm -ldl -lsocket -lsocket -lcrypt -ldl
> /usr/local/sparc-sun-solaris2.7/bin/ld: 
> /root/php-4.2.1/ext/mysql/.libs/libmysql.al(libmysql.lo): Relocations 
> in generic ELF (EM: 3)
> /root/php-4.2.1/ext/mysql/.libs/libmysql.al(libmysql.lo): could not 
> read symbols: File in wrong format
> make[1]: *** [libphp4.la] Error 1
> make[1]: Leaving directory `/root/php-4.2.1'
> make: *** [all-recursive] Error 1
>
>
>        So maybe anyone know how can i fix it?
>
>

-- 




--- End Message ---
--- Begin Message ---
Hey all,
 
I recently installed Apache2, PHP4.2 on my win2k box as a module. It
works fine however say a script has a syntax error all that happens is a
blank screen is displayed. No errors are shown and thus it is very hard
to debug when I don't know what the error is, and what line it occurs
on. Have I missed some setting when installing apache? I have tried
changing the error reporting levels to no avail. Any more suggestions?
 
Regards, Scott
 
--- End Message ---
--- Begin Message ---
On Monday 10 June 2002 09:42, Scott 'INtense!' Reismanis wrote:
> Hey all,
>
> I recently installed Apache2, PHP4.2 on my win2k box as a module. It
> works fine however say a script has a syntax error all that happens is a
> blank screen is displayed. No errors are shown and thus it is very hard
> to debug when I don't know what the error is, and what line it occurs
> on. Have I missed some setting when installing apache? I have tried
> changing the error reporting levels to no avail. Any more suggestions?

Read php.ini, the section on error reporting and its comments. And the manual 
too.

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.com.hk
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *

/*
"And I doubt complaining to the author gets you anything but a free procmail
 rule."

        - Alan Cox on asking authors to document their code
*/

--- End Message ---
--- Begin Message ---
hi i am populating a list menu with mysql , i would like to find a way to
populate a form with more than one of the same list menus in a for loop

 <select name="type[]">
       <?
       while ($sample = $result->fetchRow(DB_FETCHMODE_ASSOC)) {
       $typeID=$sample["typeID"];
       $description=$sample["description"];
    $sample_type[$sample['typeID']] = $sample["description"];
    echo "\n<option value=\"$typeID\" $selected>$description</option>";
    }
    ?>
    </select>

i have this within a for loop but the list only shows up once and the second
one is empty because the select from the database is finished ,

is there a way to put the information from mysql into arrays so i can use it
more than once and then i could do multiple populated list boxes ? let me
know




--- End Message ---
--- Begin Message ---
seperate your layers. Create a database, display and action layer. For
example:

include qry_users.inc;
include dsp_users.inc;

in qry_users.inc get your data and store them into an array var:

while($row->user)
    user[] = $row->user;
}

Then in dsp_users get them out again:

foreach ($user AS $value)
    echo $value;
}

Of course you have to built your code around the foreach in dsp_user;

Hope this helps

Andy

--
----------------------------------------------------
http://www.globosapiens.net
Global Travellers Network!





"Electroteque" <[EMAIL PROTECTED]> schrieb im Newsbeitrag
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> hi i am populating a list menu with mysql , i would like to find a way to
> populate a form with more than one of the same list menus in a for loop
>
>  <select name="type[]">
>        <?
>        while ($sample = $result->fetchRow(DB_FETCHMODE_ASSOC)) {
>        $typeID=$sample["typeID"];
>        $description=$sample["description"];
>     $sample_type[$sample['typeID']] = $sample["description"];
>     echo "\n<option value=\"$typeID\" $selected>$description</option>";
>     }
>     ?>
>     </select>
>
> i have this within a for loop but the list only shows up once and the
second
> one is empty because the select from the database is finished ,
>
> is there a way to put the information from mysql into arrays so i can use
it
> more than once and then i could do multiple populated list boxes ? let me
> know
>
>
>
>


--- End Message ---
--- Begin Message ---
I've been looking for a way to work with stdin/stdout for a mod_rewrite's 
rewritemap.

There's a working example in Perl, (just returning the input)

#!/usr/bin/perl
$| = 1;
while (<STDIN>) {
       print $_;
}

I've been trying to achieve this with fopen() read and write the 
php://stdin & php://stdout .

#!/usr/local/bin/php -q
<?php
$fp = fopen("php://stdin", "r");
while (($buf = fgets($fp)) != false) {
         $input .= $buf;
}
fclose($fp);
$fp = fopen("php://stdout", "w");
         fputs($fp, "$input\n");
fclose($fp);
?>


But no success.
In the apache man they say
Avoid one common mistake: never do buffered I/O on stdout! This will cause 
a deadloop!
Hence the ``$|=1'' in the above example

Could sommone give  some pointers how I could achieve the perl script above 
in php?

TIA
Jim.

--- End Message ---
--- Begin Message ---
does someone have an example of a _working_ PUT-script?
i was trying $PHP_PUT_FILENAME and even trying to dump all the GLOBALS
but i couldnt find a filename which points to the PUT'-filename
how does it work? obviously not as it is in the manual :-(
    copy(  $PHP_PUT_FILENAME , $PATH_TRANSLATED );
$PHP_PUT_FILENAME is always empty.
i am using the amaya to PUT, apache 1.3.19 and php 4.2.1

any ideas?

-- 
Wolfram

 ... translating template system ...
http://sourceforge.net/projects/simpletpl

... authentication system ....
  http://sf.net/projects/auth



--- End Message ---
--- Begin Message ---
maybe you do not have the propper rights set. Check your grant privillegs on
the db.

Andy

--
----------------------------------------------------
http://www.globosapiens.net
Global Travellers Network!



"César l . aracena" <[EMAIL PROTECTED]> schrieb im Newsbeitrag
002a01c20e80$743a3650$14ed0dd1@gateway">news:002a01c20e80$743a3650$14ed0dd1@gateway...
Hi all. I know that this isn't probably the best place to make this
question, but I uses that some of you uses MyCC to connect to a remote
MySQL DB. My connection is no problem, but when I issue a SQL command,
which tells the DB to INSERT multiple rows into one table, It gives me
an error every time. Imagine what it takes to pass a 1000 rows to the
"live" DB one each time. Does anyone who uses MyCC had this problem
before? Know how to solve this?

Thanks in advance,

Cesar <mailto:[EMAIL PROTECTED]>  Aracena
CE / MCSE+I
Neuquen, Argentina
+54.299.6356688
+54.299.4466621




--- End Message ---
--- Begin Message ---
Have you got a link for somewhere to look for a base set of functions for me
to build on?

Thx,
Justin


on 08/06/02 5:39 PM, Miguel Cruz ([EMAIL PROTECTED]) wrote:

> On Sat, 8 Jun 2002, Justin French wrote:
>> When you say serve the files through a script, I assume you mean
>> "download.php" force-feeds an MP3 (or whatever) to the browser.
>> 
>> Is this correct?
>> 
>> I read people have lots of problems with this...
> 
> Only until they get it working (I should hope). We use it for many, many
> sites and I can't think of any problems it's caused.
> 
> miguel
> 

--- End Message ---

Reply via email to