OSEC

Neohapsis is currently accepting applications for employment. For more information, please visit our website www.neohapsis.com or email hr@neohapsis.com
 
php-general-digest-help_at_lists.php.net
Date: Wed Jul 24 2002 - 08:18:26 CDT

  • Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]

    php-general Digest 24 Jul 2002 13:18:26 -0000 Issue 1483

    Topics (messages 109182 through 109296):

    Mail programme that uses .htpasswd to verify username/password
            109182 by: The Doctor
            109241 by: Richard Lynch

    Re: Question to 'DIR'
            109183 by: David Robley

    Re: PHP 4.2.2 install woe: cannot stat libs/libphp.so
            109184 by: David Robley
            109287 by: Reuben D. Budiardja
            109291 by: Ian Ball
            109293 by: Reuben D. Budiardja

    Re: secure sockets
            109185 by: Mike Mannakee
            109237 by: Richard Lynch
            109255 by: Josh Levine
            109256 by: Josh Levine

    Re: PHP creating table for HTML layout
            109186 by: Justin French
            109259 by: Briggsy

    Re: Formating datevariables...
            109187 by: John Holmes
            109195 by: Cameron McKay
            109201 by: John Holmes
            109284 by: Ragnar

    Re: Sorting db entries by Year-Month
            109188 by: John Holmes
            109190 by: Andre Dubuc
            109191 by: John Holmes
            109196 by: Evan Nemerson
            109243 by: Andre Dubuc

    Re: Credit card checks?
            109189 by: Matt
            109242 by: Analysis & Solutions

    install to unix... hastles
            109192 by: Peter
            109193 by: Peter
            109248 by: David Robley
            109250 by: Peter
            109252 by: David Robley

    Re: Sorting db Entries by Year-Month -- Solved
            109194 by: Andre Dubuc

    MySQL Backup and Restore
            109197 by: kip
            109199 by: Peter
            109202 by: John Holmes
            109207 by: Justin French

    Re: Errors with 4.2.2
            109198 by: Jason Wong
            109238 by: Richard Lynch

    Accessing upper directory of public_html directory
            109200 by: Sailom
            109204 by: John Holmes
            109208 by: Justin French

    How do you make a directory
            109203 by: Roger Lewis
            109205 by: Jason Wong
            109206 by: Tech Support
            109258 by: Roger Lewis

    Banner Ad Serving...
            109209 by: Dave at Sinewaves.net
            109210 by: Martin Towell
            109211 by: Jason Wong
            109212 by: Dave at Sinewaves.net
            109213 by: Cal Evans
            109214 by: Dave at Sinewaves.net
            109261 by: Jason Wong
            109262 by: Justin French
            109265 by: Dave at Sinewaves.net

    Re: Headers already sent (Sometimes)
            109215 by: Richard Lynch

    Re: Simple question I guess.
            109216 by: Richard Lynch

    Re: How to store an image into a mysql database using php language?
            109217 by: Richard Lynch

    Re: returning form variables to previous page
            109218 by: Richard Lynch

    Re: number of files in a dir vs. performace
            109219 by: Richard Lynch

    Re: redirecting after login
            109220 by: Richard Lynch

    Re: OO Programming - get practical
            109221 by: Richard Lynch
            109269 by: Paul Dionne

    Re: How to add new user to the domain
            109222 by: Richard Lynch
            109247 by: Jason Reid
            109279 by: Rick Widmer

    Re: PHP input and variables dynamic :)
            109223 by: Richard Lynch

    Re: PHP Security Advisory: Vulnerability in PHP versions4.2.0 and 4.2.1
            109224 by: Richard Lynch

    Re: Script Testing Portal Connections...
            109225 by: Richard Lynch
            109283 by: Kondwani Spike Mkandawire

    Re: Where to set return-path for virtualhosts
            109226 by: Richard Lynch

    Re: need some help on stratagy... (php/mysql/javascript)
            109227 by: Richard Lynch

    Re: control structure question
            109228 by: Richard Lynch

    Re: Using PHP with MySQL - Can I supress MySQL errors?
            109229 by: Richard Lynch

    Re: XML vs. PHP manual???
            109230 by: Richard Lynch

    Re: PHP 4.2.2 release problems
            109231 by: Richard Lynch

    Re: [ANNOUNCE] PHP Security Advisory: Vulnerability in PHP versions 4.2.0 and4.2.1
            109232 by: Richard Lynch

    Re: Apache 2 support broken?
            109233 by: Richard Lynch

    Re: Help installing Apache please
            109234 by: Richard Lynch

    Re: Oracle persistent connection limit
            109235 by: Richard Lynch
            109257 by: Thies C. Arntzen

    Re: Certificate information using php?
            109236 by: Richard Lynch

    Re: What is a mysql link ressource
            109239 by: Richard Lynch

    Re: Getting the day if given a date
            109240 by: Richard Lynch

    Re: Using fopen()/fread()/fscanf()
            109244 by: Jason Soza

    Installing PHP 4.2.1 troubles on Solaris
            109245 by: Peter

    Re: MySQL - PHP combined log
            109246 by: Richard Lynch

    Spambot Defense Code
            109249 by: Jason Soza

    Newman and his session management.
            109251 by: Philip J. Newman
            109253 by: David Robley
            109263 by: Justin French
            109290 by: Edward Marczak

    Newman and sessions.
            109254 by: Philip J. Newman
            109260 by: Philip J. Newman
            109264 by: Justin French

    probelm : delete files using PHP
            109266 by: umesh
            109281 by: Simon Ritchie

    Inserting Processed Data from One Table 2 Another!
            109267 by: Thomas Edison Jr.
            109270 by: Wouter van Vliet

    Re: Question about using if elseif ...
            109268 by: Fargo Lee

    Quick Question
            109271 by: Nicholas Mercier
            109272 by: Jason Wong

    Creating a calender / diary
            109273 by: Craig

    Authentication session problem (php/server implementation?)
            109274 by: Jacob Dorman

    trim away x > 1 number of spaces from a strin
            109275 by: Victor Spång Arthursson
            109276 by: Andrey Hristov
            109277 by: Evan Nemerson

    Deleteing Something???
            109278 by: Dale
            109280 by: Marek Kilimajer

    Re: PHP Security Advisory: Vulnerability in PHP versions 4.2.0
            109282 by: Ian Ball

    Newbie needs help
            109285 by: ctan
            109286 by: Neil Freeman
            109288 by: Johan Holst Nielsen

    Sessions don't work?
            109289 by: Alexander Deruwe

    Re: After PHP-Apache wont Start
            109292 by: Campbell, Steve V.

    Re: Compiling PHP on Linux
            109294 by: Aaron Gould

    create object from variable class.
            109295 by: Karel de groot
            109296 by: Karel de groot

    Administrivia:

    To subscribe to the digest, e-mail:
            php-general-digest-subscribelists.php.net

    To unsubscribe from the digest, e-mail:
            php-general-digest-unsubscribelists.php.net

    To post to the list, e-mail:
            php-generallists.php.net

    ----------------------------------------------------------------------

    attached mail follows:


    Does anyone know of such a programme?

    -- 
    Member - Liberal International	On 11 Sept 2001 the WORLD was violated.
    This is doctornl2k.ab.ca	Ici doctornl2k.ab.ca
    Society MUST be saved! Extremists must dissolve.  
    Beware of defining as intelligent only those who share your opinions
    

    attached mail follows:


    >Does anyone know of such a programme?

    Untested code:

    <?php $lines = file('/full/path/to/.htpasswd') or die("Could not read .htpasswd file"); while (list(,$line) = each($lines)){ $line = explode(':', $line); $username = $line[0]; $password = $line[1]; $passwords[$username] = $password; } # Assuming HTTP Basic Authentication here... if (!isset($passwords[$PHP_AUTH_USER])){ echo "Invalid Username<BR>\n"; } elseif (crypt($PHP_AUTH_PW, $passwords[$HTTP_AUTH_USER]) != $HTTP_AUTH_PW){ echo "Invalid Password<BR>\n"; } else{ # Continue script here. } ?>

    -- 
    Like Music?  http://l-i-e.com/artists.htm
    I'm looking for a PRO QUALITY two-input sound card supported by Linux (any
    major distro).  Need to record live events (mixed already) to stereo
    CD-quality.  Soundcard Recommendations?
    Software to handle the recording? Don't need fancy mixer stuff.  Zero (0)
    post-production time.  Just raw PCM/WAV/AIFF 16+ bit, 44.1KHz, Stereo
    audio-to-disk.
    

    attached mail follows:


    In article <000801c231e3$414d08e0$7897fea9N4N8U9>, blimpmail.ru says... > It´s a silly question, but how can I create a directory on web? > > Using PHP? mkdir() is the function - but beware that the user your web server runs as may not have permissions to create directories in some places.

    -- 
    David Robley
    Temporary Kiwi!
    

    Quod subigo farinam

    attached mail follows:


    In article <1027434902.5338.20.camelarcturus.phys.utk.edu>, reubendbinnovativethought.com says... > > I tried to upgrade from PHP 4.2.1 to 4.2.2 due to the security bug > announce in the web site. When I do make install, it stopped with > errors. The following are the last few lines from the output: > > [activating module `php4' in /usr/local/apache/conf/httpd.conf] > cp libs/libphp4.so /usr/local/apache/libexec/libphp4.so > cp: cannot stat `libs/libphp4.so': No such file or directory > apxs:Break: Command failed with rc=1 > make[1]: *** [install-sapi] Error 1 > make[1]: Leaving directory `/usr/src/php-4.2.2' > make: *** [install-recursive] Error 1 > > When I checked the directory libs, there are only files > libphp4.a libphp4.la > > I tried to make symlink called libphp4.so to one of this files, and then > the make install run without error. But then when I started my apache, > it gives me: > > bash $> /usr/local/apache/bin/apachectl start > Syntax error on line 205 of /usr/local/apache/conf/httpd.conf: > Cannot load /usr/local/apache/libexec/libphp4.so into server: > /usr/local/apache/libexec/libphp4.so: invalid ELF header > /usr/local/apache/bin/apachectl start: httpd could not be started > > Any help on this would be greatly appreciated. Thanks in advance. > Reuben D. Budiardja > > Did you do 'make install' as root?

    -- 
    David Robley
    Temporary Kiwi!
    

    Quod subigo farinam

    attached mail follows:


    On Tue, 2002-07-23 at 21:35, David Robley wrote: > In article <1027434902.5338.20.camelarcturus.phys.utk.edu>, > reubendbinnovativethought.com says... > > > > I tried to upgrade from PHP 4.2.1 to 4.2.2 due to the security bug > > announce in the web site. When I do make install, it stopped with > > errors. The following are the last few lines from the output: > > > > [activating module `php4' in /usr/local/apache/conf/httpd.conf] > > cp libs/libphp4.so /usr/local/apache/libexec/libphp4.so > > cp: cannot stat `libs/libphp4.so': No such file or directory > > apxs:Break: Command failed with rc=1 > > make[1]: *** [install-sapi] Error 1 > > make[1]: Leaving directory `/usr/src/php-4.2.2' > > make: *** [install-recursive] Error 1 > >

    > Did you do 'make install' as root?

    yes, I did everything (from configure to make install) as root.

    Rdb

    > -- > David Robley > Temporary Kiwi! > > Quod subigo farinam > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > >

    attached mail follows:


    Assuming you are installing from your php-4.2.2 directory, it would appear the libphp4.so hasn't actually been made, which would point to a possible error in the configuration parameters. I am also assuming your php 4.2.1 made OK which would mean all necessary libraries etc are available on your system. What are you using for the configure? On my system it was ./configure --with-mysql --with-apxs=/usr/local/apache/bin/apxs I did have ldap in there too, but for most people this is not necessary.

    If a fresh run from the start fails, then without further information, my best suggestion is to completely delete the php-4.2.2 directory and ocntents, and start again with the tar -zxf php-4.2.2.whatever, ./configure......

    Ian

    On Wednesday 24 July 2002 14:13, Reuben D. Budiardja wrote: > On Tue, 2002-07-23 at 21:35, David Robley wrote: > > In article <1027434902.5338.20.camelarcturus.phys.utk.edu>, > > reubendbinnovativethought.com says... > > > > > I tried to upgrade from PHP 4.2.1 to 4.2.2 due to the security bug > > > announce in the web site. When I do make install, it stopped with > > > errors. The following are the last few lines from the output: > > > > > > [activating module `php4' in /usr/local/apache/conf/httpd.conf] > > > cp libs/libphp4.so /usr/local/apache/libexec/libphp4.so > > > cp: cannot stat `libs/libphp4.so': No such file or directory > > > apxs:Break: Command failed with rc=1 > > > make[1]: *** [install-sapi] Error 1 > > > make[1]: Leaving directory `/usr/src/php-4.2.2' > > > make: *** [install-recursive] Error 1 > > > > Did you do 'make install' as root? > > yes, I did everything (from configure to make install) as root. > > Rdb > > > -- > > David Robley > > Temporary Kiwi! > >

    attached mail follows:


    On Wed, 2002-07-24 at 08:29, Ian Ball wrote: > Assuming you are installing from your php-4.2.2 directory, it would appear > the libphp4.so hasn't actually been made, which would point to a possible > error in the configuration parameters. I am also assuming your php 4.2.1 > made OK which would mean all necessary libraries etc are available on your > system. What are you using for the configure? On my system it was > ./configure --with-mysql --with-apxs=/usr/local/apache/bin/apxs > I did have ldap in there too, but for most people this is not necessary.

    Here is my configure line. Yes, my prev php 4.2.1 made and install fine with the same configure line. I did exactly the same steps as when I install 4.2.1

    /configure --with-mysql --enable-track-var --disable-debug --prefix=/usr/local/apache/php --with-config-file-path=/usr/local/apache/lib --with-apxs=/usr/local/apache/bin/apxs --with-gd --with-zlib

    > > If a fresh run from the start fails, then without further information, my > best suggestion is to completely delete the php-4.2.2 directory and ocntents, > and start again with the tar -zxf php-4.2.2.whatever, ./configure......

    I did that already, deleting the php-4.2.2 and start with un-tar the download. Many times. But still no luck.

    Thanks. Rdb

    > Ian > > On Wednesday 24 July 2002 14:13, Reuben D. Budiardja wrote: > > On Tue, 2002-07-23 at 21:35, David Robley wrote: > > > In article <1027434902.5338.20.camelarcturus.phys.utk.edu>, > > > reubendbinnovativethought.com says... > > > > > > > I tried to upgrade from PHP 4.2.1 to 4.2.2 due to the security bug > > > > announce in the web site. When I do make install, it stopped with > > > > errors. The following are the last few lines from the output: > > > > > > > > [activating module `php4' in /usr/local/apache/conf/httpd.conf] > > > > cp libs/libphp4.so /usr/local/apache/libexec/libphp4.so > > > > cp: cannot stat `libs/libphp4.so': No such file or directory > > > > apxs:Break: Command failed with rc=1 > > > > make[1]: *** [install-sapi] Error 1 > > > > make[1]: Leaving directory `/usr/src/php-4.2.2' > > > > make: *** [install-recursive] Error 1 > > > > > > Did you do 'make install' as root? > > > > yes, I did everything (from configure to make install) as root. > > > > Rdb > > > > > -- > > > David Robley > > > Temporary Kiwi! > > > > >

    attached mail follows:


    I have not done this but have studied enough tcp/ip to know that ssl is not a protocol. The opening portion would refer to your protocol, like http or ftp. One would access via ssl using https://, not ssl:// Try that.

    Curl would be your other option, and that should work just fine for most uses. I don't know how you have the app set up but that may be what you need.

    Mike

    "Patrick Lynch" <Patrick.Lynchoptip.com> wrote in message news:!~!UENERkVCMDkAAQACAAAAAAAAAAAAAAAAABgAAAAAAAAAM/+wtTlkR0mNI0OgSgYDtcKA AAAQAAAAgb2pZ5EesE2YrvpeE0lkswEAAAAAoptip.com... > Hi Josh, > > I have not done this myself but afaik, you can use curl to so this. > http://www.php.net/manual/en/ref.curl.php > > Best Regards, > Patrick Lynch. > > Optip Ltd, Internet & Mobile Development > Co. Clare, Ireland. > http://www.optip.com/ > > > -----Original Message----- > From: Josh Levine [mailto:joshl-phplevindustries.com] > Sent: 23 July 2002 19:57 > To: php-generallists.php.net > Subject: [PHP] secure sockets > > > I'm trying to connect to a Java application that's listening on a socket > using SSL. I am trying to use fsockopen with the address beginning with > ssl://, but it doesn't work. There's no error message that I can find, > it just doesn't create the file-handler. > > Here's some sample code: > > <? > $hostname = 'ssl://155.246.211.23'; > $portnumb = '60324'; > > $sock = fsockopen($hostname, $portnumb, $errno, $errstr); > > fwrite($sock, "9\n"); > print ( fgets($sock,6) ); > print $errno; > print $errstr; > fclose($sock); > ?> > > That returns: > > Warning: fwrite(): supplied argument is not a valid File-Handle resource > in /usr/home/research/htdocs/tests/secure.php on line 8 > > Warning: fgets(): supplied argument is not a valid File-Handle resource > in /usr/home/research/htdocs/tests/secure.php on line 10 0 > Warning: fclose(): supplied argument is not a valid File-Handle resource > in /usr/home/research/htdocs/tests/secure.php on line 20 > > Thanks in advance for any help, > Josh Levine > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > >

    attached mail follows:


    >I'm trying to connect to a Java application that's listening on a socket >using SSL. I am trying to use fsockopen with the address beginning with >ssl://, but it doesn't work. There's no error message that I can find, >it just doesn't create the file-handler. > >Here's some sample code: > ><? > $hostname = 'ssl://155.246.211.23';

    You have to be running PHP 4.3.0 (IE, CVS or snapshot) to use 'ssl://' with fsockopen, according to the manual.

    You may have to use cURL for now, or develop in 4.3.0 and deploy when it's ready, or...

    It will be pretty cool when the SSL stuff can be done as transparently as http:// can right now!

    -- 
    Like Music?  http://l-i-e.com/artists.htm
    I'm looking for a PRO QUALITY two-input sound card supported by Linux (any
    major distro).  Need to record live events (mixed already) to stereo
    CD-quality.  Soundcard Recommendations?
    Software to handle the recording? Don't need fancy mixer stuff.  Zero (0)
    post-production time.  Just raw PCM/WAV/AIFF 16+ bit, 44.1KHz, Stereo
    audio-to-disk.
    

    attached mail follows:


    Richard Lynch wrote: > > >Here's some sample code: > > > ><? > > $hostname = 'ssl://155.246.211.23'; > > You have to be running PHP 4.3.0 (IE, CVS or snapshot) to use 'ssl://' with > fsockopen, according to the manual. > > You may have to use cURL for now, or develop in 4.3.0 and deploy when it's > ready, or... > > It will be pretty cool when the SSL stuff can be done as transparently as > http:// can right now!

    Can't believe I missed the version thing - thanks! I guess I'll try using cURL for now until 4.3.0 comes out...it'll definitely make things very nice.

    --Josh Levine

    attached mail follows:


    Mike Mannakee wrote: > > I have not done this but have studied enough tcp/ip to know that ssl is not > a protocol. The opening portion would refer to your protocol, like http or > ftp. One would access via ssl using https://, not ssl:// Try that.

    According to the docs, 4.3.0 will support such a call (I just didn't notice the version number). > Curl would be your other option, and that should work just fine for most > uses. I don't know how you have the app set up but that may be what you > need.

    That's what I'll try next.

    --Josh Levine

    attached mail follows:


    PHP can't help here -- you should do a search on the web for "liquid" website designs, or check out / borrow some code from other sites you've seen work.

    Although not valid, I've seen height="100%" work on 1000's of sites. Combined with a CSS statement, you should be able to cover all browsers.

    Justin

    on 24/07/02 6:10 AM, Briggsy (shanearu.org.nz) wrote:

    > I am hoping someone can help me with a desperate problem I am having > > I know nothing about PHP and hoping that it might be able to solve a problem > I have with HTML tables. > > I want my web background to cover the entire screen regardless of screen > size. The background has a header, a left side nav and a footer. I want the > footer to be on the bottom of the screen or bottom of the text, which ever > is greater. If you go to www.v3.aru.org.nz you will get an idea of what I'm > talking about. If you are using IE 5.x or greater it should show correctly. > > I used the HTML table tag height=100%, however this is not a valid tag and > therefore Netscape ignores it. Also if I use it it wont validate as a true > complaint code, which I want it to. > > So can I use PHP to create a table or place the background images to create > a header, side nav and footer with the middle white section adjusting to > screen size. > > I don't want to have to greater multiple sites for different resolutions and > would rather have one template that all pages call by an include statement > (That's the ASP command, think I saw the same command in PHP) > > Any help or solution would be appreciated as I have been searching the net > and working on this for weeks and I'm getting nowhere. > > Thanks > > Shane. > > > >

    attached mail follows:


    Thanks to all those who replied here and directly. I have realised PHP isn't going to do what I want and have gone back to researching using CSS and float tags.

    Thanks for all the suggestions.

    Shane

    "Martin Clifford" <MLC1nrc.gov> wrote in message news:sd3d80c2.029nrcgwia.nrc.gov... PHP is server-side, so it can't do anything that would help with the layout of HTML on the client-side. You might want to look into Cascading Style Sheets (CSS) to format the page so that it validates the way you want it to :o)

    HTH!

    Martin Clifford Homepage: http://www.completesource.net Developer's Forums: http://www.completesource.net/forums/

    >>> "Briggsy" <shanearu.org.nz> 07/23/02 04:10PM >>> I am hoping someone can help me with a desperate problem I am having

    I know nothing about PHP and hoping that it might be able to solve a problem I have with HTML tables.

    I want my web background to cover the entire screen regardless of screen size. The background has a header, a left side nav and a footer. I want the footer to be on the bottom of the screen or bottom of the text, which ever is greater. If you go to www.v3.aru.org.nz you will get an idea of what I'm talking about. If you are using IE 5.x or greater it should show correctly.

    I used the HTML table tag height=100%, however this is not a valid tag and therefore Netscape ignores it. Also if I use it it wont validate as a true complaint code, which I want it to.

    So can I use PHP to create a table or place the background images to create a header, side nav and footer with the middle white section adjusting to screen size.

    I don't want to have to greater multiple sites for different resolutions and would rather have one template that all pages call by an include statement (That's the ASP command, think I saw the same command in PHP)

    Any help or solution would be appreciated as I have been searching the net and working on this for weeks and I'm getting nowhere.

    Thanks

    Shane.

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

    attached mail follows:


    > Thanx for the help.. > > I ended up with this solution ;) > > $dag = substr ( $row['endret_dato'], 7, 2 ); > $mnd = substr ( $row['endret_dato'], 4, 2 ); > $aar = substr ( $row['endret_dato'], 0, 4 ); > > date ("dmY", mktime(0,0,0,$mnd,$dag,$aar) )

    Did you even read the replies? Why are you going to do a bunch of string manipulation, mktime, and date calls in PHP when you can just use DATE_FORMAT() in your query and get exactly what you want without any additional work by PHP?

    Take a little time and Read Chapter 6 of the MySQL manual. It will save you a ton of work later on...

    ---John Holmes...

    > -R > > "Ragnar" <ragnarchello.no> wrote in message > news:20020722234455.41274.qmailpb1.pair.com... > > I have a column in a mysql table with a timestamp. The value of this > column > > is for instance: > > > > 20020722185242 > > > > How do i change the format on this to "DDMMYYYY" (22072002) in php? > > > > Thanx > > > > -R > > > > > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php

    attached mail follows:


    Sure using MySQL specific calls is faster but makes you more dependant on MySQL and thus makes your application less portable to other databases.

    Cameron

    John Holmes wrote: > > > Did you even read the replies? Why are you going to do a bunch of string > manipulation, mktime, and date calls in PHP when you can just use > DATE_FORMAT() in your query and get exactly what you want without any > additional work by PHP? > > Take a little time and Read Chapter 6 of the MySQL manual. It will save > you a ton of work later on... > > ---John Holmes... > > >

    attached mail follows:


    > Sure using MySQL specific calls is faster but makes you more dependant > on MySQL and thus makes your application less portable to other databases. > > Cameron

    Of course. It depends on your application. I know I'm only going to use MySQL for the programs I'm doing now, so I can use this _faster_ method.

    I felt weird about saying it was faster before, so I did some benchmarking to make sure I could back up what I was saying. Using these two functions:

    function sql_method() { $query = "SELECT DATE_FORMAT(date_column,'%d%m%Y') FROM benchmark"; $result = mysql_query($query); while($row = mysql_fetch_row($result)) { $field = $row[0]; }

    return; }

    function php_method() { $query = "SELECT date_column+0 FROM benchmark"; $result = mysql_query($query); while($row = mysql_fetch_row($result)) { $dag = substr ( $row[0], 6, 2 ); $mnd = substr ( $row[0], 4, 2 ); $aar = substr ( $row[0], 0, 4 );

    $field = date ("dmY", mktime(0,0,0,$mnd,$dag,$aar)); }

    return; }

    There were 1000 rows in the one column table, the single column being a random date in the standard MySQL format. Each function was run 10 times.

    Results:

    SQL/PHP Date Manipulation total time average iteration time 100% SQL Method 18ms 0.0175564 279% PHP Method 49ms 0.0489336

    Your results may vary. I used some benchmark class by Sebastian Bergmann.

    ---John Holmes...

    attached mail follows:


    Hi, i dont know if im always going to use mysql, thow your solution to my problem will be something like this:

    SELECT DATE_FORMAT( endret_dato, \"%d%m%Y\" ) as endret_dato , headline , news from rnr_news order by endret_dato desc limit " . $index . "," . ($index+10));

    Thanx for your help!

    -R

    "John Holmes" <holmes072000charter.net> wrote in message news:000001c232b4$11419d10$b402a8c0mango... > > Thanx for the help.. > > > > I ended up with this solution ;) > > > > $dag = substr ( $row['endret_dato'], 7, 2 ); > > $mnd = substr ( $row['endret_dato'], 4, 2 ); > > $aar = substr ( $row['endret_dato'], 0, 4 ); > > > > date ("dmY", mktime(0,0,0,$mnd,$dag,$aar) ) > > Did you even read the replies? Why are you going to do a bunch of string > manipulation, mktime, and date calls in PHP when you can just use > DATE_FORMAT() in your query and get exactly what you want without any > additional work by PHP? > > Take a little time and Read Chapter 6 of the MySQL manual. It will save > you a ton of work later on... > > ---John Holmes... > > > > -R > > > > "Ragnar" <ragnarchello.no> wrote in message > > news:20020722234455.41274.qmailpb1.pair.com... > > > I have a column in a mysql table with a timestamp. The value of this > > column > > > is for instance: > > > > > > 20020722185242 > > > > > > How do i change the format on this to "DDMMYYYY" (22072002) in php? > > > > > > Thanx > > > > > > -R > > > > > > > > > > > > > > -- > > PHP General Mailing List (http://www.php.net/) > > To unsubscribe, visit: http://www.php.net/unsub.php > >

    attached mail follows:


    Isn't there a MONTH function in PG?

    SELECT * FROM your_table WHERE MONTH(NOW()) = MONTH(your_column) ??

    Or if PG stores dates in the Unix timestamp format, is the an equivalent to date() that you can extract the month from the column and compare them??

    ---John Holmes...

    > -----Original Message----- > From: Andre Dubuc [mailto:aajdubucwebhart.net] > Sent: Tuesday, July 23, 2002 7:26 PM > To: php-generallists.php.net > Subject: [PHP] Sorting db entries by Year-Month > > Apache 1.3.23 + PHP 4.1.2 + PostgreSQl 7.2 > > I have a guestbook that I would like to display the current month's > entries. > I can display all the entries before the current month, but i can't seem > to > figure out how to extract the currrent month's. > > Although the code below is a db issue, I don't know whether I should write > code to extract the info before or after the db connection. Should I: > > 1. Set up the parameters beforehand in PHP, and then do a query; > 2. Within the query itself (as the code I tried [and didn't work] > below); > 3. Or, somehow in PHP, after I get all the results [obviously > without the > db WHERE clause]. > > <?php > // lots of code > > $db = pg_connect("dbname=rap user=postgres"); > $query = "SELECT * FROM guest WHERE pdate = "{$_SESSION['pdate'] == > date('Y-m')"; // pdate is formatted ('Y-m-d') > > // etc, etc. . . > ?> > > I know this is a simple question -- but my mind's totally blotto after a > day's coding. > > Any help, pointers of where to look, or admonitions will be gratefully > accepted. > > Tia, > Andre > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php

    attached mail follows:


    Hi John,

    further research indicates that for PG I could trysomething like:

    SELECT EXTRACT(MONTH FROM TIMESTAMP)

    Big John has offered some advice using:

    $today = getdate();  $start = $today['year'] . '-' . $today['mon'] . '-' . '01';  $end  =  $today['year'] . '-' . $today['mon'] . '-' . '31';

    "SELECT * FROM guest WHERE pdate BETWEEN {$start} AND {$end}";

    but PG doesn't like my format of $pdate as type date, since the result for $start and $end seems to result in type integer. Sigh.

    What a pain. Such a simple task, and . . .

    Thanks for your advice. I'll keep hacking away at it, and maybe I'll get it to work.

    Regards, Andre

    On Tuesday 23 July 2002 09:52 pm, you wrote: > Isn't there a MONTH function in PG? > > SELECT * FROM your_table WHERE MONTH(NOW()) = MONTH(your_column) ?? > > Or if PG stores dates in the Unix timestamp format, is the an equivalent > to date() that you can extract the month from the column and compare > them?? > > ---John Holmes... > > > -----Original Message----- > > From: Andre Dubuc [mailto:aajdubucwebhart.net] > > Sent: Tuesday, July 23, 2002 7:26 PM > > To: php-generallists.php.net > > Subject: [PHP] Sorting db entries by Year-Month > > > > Apache 1.3.23 + PHP 4.1.2 + PostgreSQl 7.2 > > > > I have a guestbook that I would like to display the current month's > > entries. > > I can display all the entries before the current month, but i can't > > seem > > > to > > figure out how to extract the currrent month's. > > > > Although the code below is a db issue, I don't know whether I should > > write > > > code to extract the info before or after the db connection. Should I: > > > > 1. Set up the parameters beforehand in PHP, and then do a > > query; > > > 2. Within the query itself (as the code I tried [and didn't > > work] > > > below); > > 3. Or, somehow in PHP, after I get all the results [obviously > > without the > > db WHERE clause]. > > > > <?php > > // lots of code > > > > $db = pg_connect("dbname=rap user=postgres"); > > $query = "SELECT * FROM guest WHERE pdate = "{$_SESSION['pdate'] == > > date('Y-m')"; // pdate is formatted ('Y-m-d') > > > > // etc, etc. . . > > ?> > > > > I know this is a simple question -- but my mind's totally blotto after > > a > > > day's coding. > > > > Any help, pointers of where to look, or admonitions will be gratefully > > accepted. > > > > Tia, > > Andre > > > > > > > > -- > > PHP General Mailing List (http://www.php.net/) > > To unsubscribe, visit: http://www.php.net/unsub.php

    attached mail follows:


    > further research indicates that for PG I could trysomething like: > > SELECT EXTRACT(MONTH FROM TIMESTAMP)

    I'm sure there is a NOW() or TIME() function in PG that returns the current date/time. Then you could do this:

    SELECT * FROM your_table WHERE EXTRACT(MONTH FROM your_column) = EXTRACT(MONTH FROM PG_CURRENT_TIME_FUNCTION());

    > $today = getdate(); >  $start = $today['year'] . '-' . $today['mon'] . '-' . '01'; >  $end  =  $today['year'] . '-' . $today['mon'] . '-' . '31'; > > "SELECT * FROM guest WHERE pdate BETWEEN {$start} AND {$end}"; > > but PG doesn't like my format of $pdate as type date, since the result for > $start and $end seems to result in type integer. Sigh.

    I think PG uses the unix timestamp format, the number of seconds since Jan 1, 1970 or something. You could use a combination of date() and mktime() and maybe even strtotime() to figure the unix timestamp of the current month's start and end, then use the BETWEEN SQL given above...

    ---John Holmes...

    attached mail follows:


    Yeah. Apache is vulneralbe to a buffer overflow in the chunked-encoding, and PHP has (i think) a buffer overflow in the multipart/form-data POST form handling. It might be a format string though... that just came out this week. yesterday, i think.

    For dev you might want to consider using the CVS version- that's what I do. And if you set up a script for the cron-tab or something you could get the latest version overnight... Unfortunatly, Apache CVS is not open to the public.

    On Tuesday 23 July 2002 17:58 pm, you wrote: > Well, that would be nice! Sort of 'completes-my-day' :> > So, both are vulnerable, eh? Great. > > Thanks for the warning -- but I'm using them for design only. Once the site > is on-line, I'll be sure to use the upgraded versions. From what I read > on-list, however, the current 'upgrades' have their problems too. Luckily, > I'll be on-line later in the fall, so enough time might pass for the new > PHP to stabilize. > > Regards, Andre > > On Tuesday 23 July 2002 08:47 pm, you wrote: > > What do you guys think? Should we tell him he's running a vulnerable > > version of PHP _and_ of Apache??? > > > > On Tuesday 23 July 2002 16:26 pm, Andre Dubuc wrote: > > > Apache 1.3.23 + PHP 4.1.2 + PostgreSQl 7.2 > > <snipped>

    -- 
    He who learns must suffer.
    

    Aeschylus

    attached mail follows:


    Simply wonderful news:>

    But again, for design work, it isn't worth the trouble. I'm using SESSION variables $_POST, $_SESSION, and as long as they don't change, there's little point upgrading until the site is on-line. However, I will inform my IP to use all the latest versions.

    I'm running Linux-Mandrake 8.2 and the distro's Apache, PHP, and PostgeSQL. I've rolled my own, but the distro's added features persuaded to use them. When the site is finished, I will 'roll-my-own' and upgrade. Unfortunately, PostgreSQL and PHP tend to like spreding themselves all over my hardrive. It took me quite a bit of time to get my first versions working together.

    So, as long as they haven't changed the functions, the vulnerablities are a moot point at this time. Good to be aware of them, however.

    Thanks for your concern.

    Regards, Andre

    On Tuesday 23 July 2002 10:42 pm, you wrote: > Yeah. Apache is vulneralbe to a buffer overflow in the chunked-encoding, > and PHP has (i think) a buffer overflow in the multipart/form-data POST > form handling. It might be a format string though... that just came out > this week. yesterday, i think. > > For dev you might want to consider using the CVS version- that's what I do. > And if you set up a script for the cron-tab or something you could get the > latest version overnight... Unfortunatly, Apache CVS is not open to the > public. > > On Tuesday 23 July 2002 17:58 pm, you wrote: > > Well, that would be nice! Sort of 'completes-my-day' :> > > So, both are vulnerable, eh? Great. > > > > Thanks for the warning -- but I'm using them for design only. Once the > > site is on-line, I'll be sure to use the upgraded versions. From what I > > read on-list, however, the current 'upgrades' have their problems too. > > Luckily, I'll be on-line later in the fall, so enough time might pass for > > the new PHP to stabilize. > > > > Regards, Andre > > > > On Tuesday 23 July 2002 08:47 pm, you wrote: > > > What do you guys think? Should we tell him he's running a vulnerable > > > version of PHP _and_ of Apache??? > > > > > > On Tuesday 23 July 2002 16:26 pm, Andre Dubuc wrote: > > > > Apache 1.3.23 + PHP 4.1.2 + PostgreSQl 7.2 > > > > <snipped>

    attached mail follows:


    From: "Mark McCulligh" <mmccullisykescanada.com> Sent: Tuesday, July 23, 2002 8:47 PM Subject: [PHP] Re: Credit card checks?

    > You could use an algorithms called mod10.

    Mod 10 catches keying errors. It's use is to prevent digits from being swapped. So if you key 133791 instead of 137391, the mod 10 will catch it. It works for all single keying errors except 0 and 9, since reversing those two numbers will result in the same check digit. It fails to catch multiple keying errors, so if more than one pair of digits is swapped, or if the swapped digits are not contiguous, there is a likely chance of validating fine.

    It's actually very useful in numeric keys to dbs such as address book entries and skus. If you don't use an auto-increment, and instead maintain the next numbers yourself, you can calc and append the check digit to the next number. You end up with a db whose keys are all based on Mod 10, so if someone does a single keying error, it won't be in the db. In other words, you really only need to calc the Mod 10 when doing the insert, because invalid keys won't be in the db, and thus won't be found.

    attached mail follows:


    On Tue, Jul 23, 2002 at 11:17:19AM -0700, Richard Baskett wrote: > > http://www.AnalysisAndSolutions.com/code/ccvs-ph.htm

    Rick, thanks for the plug.

    Allow me to plug it further...

    I updated that page just this minute. So, whomever looked at it in the past (prior to 12:00 am 24 July 2002 EST) should check it out again. These changes make the checks easier to integrate into your own programs.

    This function, now a class, is the most comprehensive, flexible and easy to use credit card validation script I've seen.

    Also, I've now integrated this function into my Form Solution class: http://www.FormSolution.info/

    Enjoy,

    --Dan

    -- 
                   PHP classes that make web design easier
            SQL Solution  |   Layout Solution   |  Form Solution
        sqlsolution.info  | layoutsolution.info |  formsolution.info
     T H E   A N A L Y S I S   A N D   S O L U T I O N S   C O M P A N Y
     4015 7 Av #4AJ, Brooklyn NY     v: 718-854-0335     f: 718-854-0409
    

    attached mail follows:


    Hiya,

    I'm new to installing php onto unix i can get the ./configure command to run with out error (well any that are obvious) but when i do the make it comes up with

    # make Making all in Zend make[1]: Entering directory `/usr/local/php-4.2.1/Zend' /bin/sh ../libtool --silent --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I../main -D_POSIX_PTHREAD_SEMANTICS -I../TSRM -g -O2 -prefer-non-pic -static -c -o zend_language_parser.lo `test -f zend_language_parser.c || echo './'`zend_language_parser.c In file included from zend_compile.h:24, from zend_language_parser.c:147: zend.h:55:19: unix.h: No such file or directory make[1]: *** [zend_language_parser.lo] Error 1 make[1]: Leaving directory `/usr/local/php-4.2.1/Zend' make: *** [all-recursive] Error 1

    now i understand that it can't find unix.h and am assuming that this is why it doesn't work ...

    does any one have any ideas for me .... php ver is 4.2.1 for now... though will upgrade to 4.2.2 soon..

    Cheers

    Peter "the only dumb question is the one that wasn't asked"

    attached mail follows:


    sorry forgot to say that I've tried to locate the unix.h file in other distribs etc but wif no luck

    > -----Original Message----- > From: Peter [mailto:phpvfsa.com.au] > Sent: Wednesday, 24 July 2002 12:33 PM > To: php_gen > Subject: [PHP] install to unix... hastles > > > Hiya, > > I'm new to installing php onto unix i can get the ./configure > command to run > with out error (well any that are obvious) > but when i do the make it comes up with > > # make > Making all in Zend > make[1]: Entering directory `/usr/local/php-4.2.1/Zend' > /bin/sh ../libtool --silent --mode=compile > gcc -DHAVE_CONFIG_H -I. -I. -I../main > -D_POSIX_PTHREAD_SEMANTICS -I../TSRM > -g -O2 -prefer-non-pic -static -c -o zend_language_parser.lo `test -f > zend_language_parser.c || echo './'`zend_language_parser.c > In file included from zend_compile.h:24, > from zend_language_parser.c:147: > zend.h:55:19: unix.h: No such file or directory > make[1]: *** [zend_language_parser.lo] Error 1 > make[1]: Leaving directory `/usr/local/php-4.2.1/Zend' > make: *** [all-recursive] Error 1 > > now i understand that it can't find unix.h and am assuming that > this is why > it doesn't work ... > > does any one have any ideas for me .... php ver is 4.2.1 for now... though > will upgrade to 4.2.2 soon.. > > Cheers > > Peter > "the only dumb question is the one that wasn't asked" > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > >

    attached mail follows:


    In article <DPEPKCNEFOKBCNNANCIPCELPCGAA.phpvfsa.com.au>, phpvfsa.com.au says... > sorry forgot to say that I've tried to locate the unix.h file in other > distribs etc but wif no luck > > > -----Original Message----- > > From: Peter [mailto:phpvfsa.com.au] > > Sent: Wednesday, 24 July 2002 12:33 PM > > To: php_gen > > Subject: [PHP] install to unix... hastles > > > > > > Hiya, > > > > I'm new to installing php onto unix i can get the ./configure > > command to run > > with out error (well any that are obvious) > > but when i do the make it comes up with > > > > # make > > Making all in Zend > > make[1]: Entering directory `/usr/local/php-4.2.1/Zend' > > /bin/sh ../libtool --silent --mode=compile > > gcc -DHAVE_CONFIG_H -I. -I. -I../main > > -D_POSIX_PTHREAD_SEMANTICS -I../TSRM > > -g -O2 -prefer-non-pic -static -c -o zend_language_parser.lo `test -f > > zend_language_parser.c || echo './'`zend_language_parser.c > > In file included from zend_compile.h:24, > > from zend_language_parser.c:147: > > zend.h:55:19: unix.h: No such file or directory > > make[1]: *** [zend_language_parser.lo] Error 1 > > make[1]: Leaving directory `/usr/local/php-4.2.1/Zend' > > make: *** [all-recursive] Error 1 > > > > now i understand that it can't find unix.h and am assuming that > > this is why > > it doesn't work ... > > > > does any one have any ideas for me .... php ver is 4.2.1 for now... though > > will upgrade to 4.2.2 soon..

    Sounds like you are missing the system header files - what 'unix' are you using?

    Cheers

    -- 
    David Robley
    Temporary Kiwi!
    

    Quod subigo farinam

    attached mail follows:


    > > Hiya, > > > > > > I'm new to installing php onto unix i can get the ./configure > > > command to run > > > with out error (well any that are obvious) > > > but when i do the make it comes up with > > > > > > # make > > > Making all in Zend > > > make[1]: Entering directory `/usr/local/php-4.2.1/Zend' > > > /bin/sh ../libtool --silent --mode=compile > > > gcc -DHAVE_CONFIG_H -I. -I. -I../main > > > -D_POSIX_PTHREAD_SEMANTICS -I../TSRM > > > -g -O2 -prefer-non-pic -static -c -o > zend_language_parser.lo `test -f > > > zend_language_parser.c || echo './'`zend_language_parser.c > > > In file included from zend_compile.h:24, > > > from zend_language_parser.c:147: > > > zend.h:55:19: unix.h: No such file or directory > > > make[1]: *** [zend_language_parser.lo] Error 1 > > > make[1]: Leaving directory `/usr/local/php-4.2.1/Zend' > > > make: *** [all-recursive] Error 1 > > > > > > now i understand that it can't find unix.h and am assuming that > > > this is why > > > it doesn't work ... > > > > > > does any one have any ideas for me .... php ver is 4.2.1 for > now... though > > > will upgrade to 4.2.2 soon.. > > Sounds like you are missing the system header files - what 'unix' are you > using? > > Cheers > -- > David Robley > Temporary Kiwi! > am using Solaris 9 ....

    attached mail follows:


    In article <DPEPKCNEFOKBCNNANCIPGEMMCGAA.phpvfsa.com.au>, phpvfsa.com.au says... > > > Hiya, > > > > > > > > I'm new to installing php onto unix i can get the ./configure > > > > command to run > > > > with out error (well any that are obvious) > > > > but when i do the make it comes up with > > > > > > > > # make > > > > Making all in Zend > > > > make[1]: Entering directory `/usr/local/php-4.2.1/Zend' > > > > /bin/sh ../libtool --silent --mode=compile > > > > gcc -DHAVE_CONFIG_H -I. -I. -I../main > > > > -D_POSIX_PTHREAD_SEMANTICS -I../TSRM > > > > -g -O2 -prefer-non-pic -static -c -o > > zend_language_parser.lo `test -f > > > > zend_language_parser.c || echo './'`zend_language_parser.c > > > > In file included from zend_compile.h:24, > > > > from zend_language_parser.c:147: > > > > zend.h:55:19: unix.h: No such file or directory > > > > make[1]: *** [zend_language_parser.lo] Error 1 > > > > make[1]: Leaving directory `/usr/local/php-4.2.1/Zend' > > > > make: *** [all-recursive] Error 1 > > > > > > > > now i understand that it can't find unix.h and am assuming that > > > > this is why > > > > it doesn't work ... > > > > > > > > does any one have any ideas for me .... php ver is 4.2.1 for > > now... though > > > > will upgrade to 4.2.2 soon.. > > > > Sounds like you are missing the system header files - what 'unix' are you > > using? > > > > Cheers > > -- > > David Robley > > Temporary Kiwi! > > > am using Solaris 9 ....

    Had a feeling you were going to say the Sun word :-) It sounds like you are missing a bunch of system header files, used for compiling any programs. IIRC they live in something like /usr/include (at least on a slackware linux) or /usr/src/[architecture]/include.

    Either that or they are located somewhere where the compiler can't find them; does 'locate unix.h' return anything - assuming locate is up2date on your system.

    If not, unless there is a Sun guru here, you might want to check on a Sun- specific list about exactly what you need to get and how.

    Cheers

    -- 
    David Robley
    Temporary Kiwi!
    

    Quod subigo farinam

    attached mail follows:


    Thanks to BigDog and John Holmes for their suggestions.

    I figured it out: it was rather easy, in hindsight, of course:

    <?php $today = getdate(); $month = $today['mon']; . . . $query = "SELECT * FROM guest WHERE pdate ~ '{$month}'"; . . . ?>

    Works as expected. Regards, Andre

    attached mail follows:


    Hi,

    Can you tell me the steps of backup and restore the databases in Mysql?

    And can i specific a path for the backup file?

    Futhermore, i have installed the MySQL in Win2000 but i don't know how to restore the database of MySQL from a Linux server to Win2000 MySQL.

    Thanks

    attached mail follows:


    grab ur self a copy of myphpadmin or use mysqldump or just simply make a copy of the data dir or grab ur self a copy of mysql_front

    > -----Original Message----- > From: kip [mailto:kenny_iphotmail.com] > Sent: Wednesday, 24 July 2002 12:58 PM > To: php-generallists.php.net > Subject: [PHP] MySQL Backup and Restore > > > Hi, > > Can you tell me the steps of backup and restore the databases in Mysql? > > And can i specific a path for the backup file? > > Futhermore, i have installed the MySQL in Win2000 but i don't know how to > restore the database of MySQL from a Linux server to Win2000 MySQL. > > Thanks > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > >

    attached mail follows:


    Second the MySQL Front recommendation. That's one heck of a tool that makes things really easy.

    Otherwise, use mysqldump like Peter recommended.

    To dump the databases, use this from the system prompt:

    mysqldump -uuser -ppassword database_name > filename.sql

    To import, create the database and use this:

    mysql -uuser -ppassword database_name < filename.sql

    ---John Holmes...

    > -----Original Message----- > From: Peter [mailto:phpvfsa.com.au] > Sent: Tuesday, July 23, 2002 11:04 PM > To: kip; php-generallists.php.net > Subject: RE: [PHP] MySQL Backup and Restore > > grab ur self a copy of myphpadmin or use mysqldump or just simply make a > copy of the data dir or grab ur self a copy of mysql_front > > > -----Original Message----- > > From: kip [mailto:kenny_iphotmail.com] > > Sent: Wednesday, 24 July 2002 12:58 PM > > To: php-generallists.php.net > > Subject: [PHP] MySQL Backup and Restore > > > > > > Hi, > > > > Can you tell me the steps of backup and restore the databases in Mysql? > > > > And can i specific a path for the backup file? > > > > Futhermore, i have installed the MySQL in Win2000 but i don't know how > to > > restore the database of MySQL from a Linux server to Win2000 MySQL. > > > > Thanks > > > > > > > > -- > > 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

    attached mail follows:


    Can highly recommend doing it (and a whole lot more) with phpMyAdmin (http://phpMyAdmin.net)

    Justin French

    on 24/07/02 1:04 PM, Peter (phpvfsa.com.au) wrote:

    > grab ur self a copy of myphpadmin or use mysqldump or just simply make a > copy of the data dir or grab ur self a copy of mysql_front > >> -----Original Message----- >> From: kip [mailto:kenny_iphotmail.com] >> Sent: Wednesday, 24 July 2002 12:58 PM >> To: php-generallists.php.net >> Subject: [PHP] MySQL Backup and Restore >> >> >> Hi, >> >> Can you tell me the steps of backup and restore the databases in Mysql? >> >> And can i specific a path for the backup file? >> >> Futhermore, i have installed the MySQL in Win2000 but i don't know how to >> restore the database of MySQL from a Linux server to Win2000 MySQL. >> >> Thanks >> >> >> >> -- >> PHP General Mailing List (http://www.php.net/) >> To unsubscribe, visit: http://www.php.net/unsub.php >> >> >> >

    attached mail follows:


    On Wednesday 24 July 2002 06:24, Brian Paulson wrote: > I have been running 4.1.1 due to any time I upgraded to 4.2.0 I would > get emalloc errors. Now that this upgrade to 4.2.2 I am getting the same > errors and this is a must upgrade.

    Why is it a 'must' upgrade? The recently announced vulnerability only affects 4.2.0 & 4.2.1 so if you're happy with 4.1.1 stick with it.

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

    /* Your talents will be recognized and suitably rewarded. */

    attached mail follows:


    >I have been running 4.1.1 due to any time I upgraded to 4.2.0 I would >get emalloc errors. Now that this upgrade to 4.2.2 I am getting the same >errors and this is a must upgrade. If any one can help with finding out >why I am getting these errors I would appreciate it. > > >[This is from my error_log file] > >FATAL: emalloc(): Unable to allocate -273464 bytes >FATAL: emalloc(): Unable to allocate -272312 bytes >[Tue Jul 23 16:27:36 2002] [notice] child pid 26650 exit signal >Segmentation fault (11) >[Tue Jul 23 16:27:36 2002] [notice] child pid 26612 exit signal >Segmentation fault (11) > >I get this on some pages, but not all pages

    If no answer is forthcoming, use the directions at http://bugs.php.net/ to generate a backtrace and post a bug report there.

    You may want to consider down-grading to before the Security bug for now, if that's a viable option.

    -- 
    Like Music?  http://l-i-e.com/artists.htm
    I'm looking for a PRO QUALITY two-input sound card supported by Linux (any
    major distro).  Need to record live events (mixed already) to stereo
    CD-quality.  Soundcard Recommendations?
    Software to handle the recording? Don't need fancy mixer stuff.  Zero (0)
    post-production time.  Just raw PCM/WAV/AIFF 16+ bit, 44.1KHz, Stereo
    audio-to-disk.
    

    attached mail follows:


    I bought a web host service from a company named easyspace.com. I have tried to ask them this question many times but until now there is no response from them at all. According to the security issue of placing password in script I brought up days ago, some one on this news group suggested me to place such script in directory above %public_html directory. The problem is I do not know how to access such directory. Is it because the service I bought does not allow me to do it? or if it is accessible, how to do it?

    I know this is a silly question but please help me.

    Sailom

    attached mail follows:


    > I bought a web host service from a company named easyspace.com. I have > tried to ask them this question many times but until now there is no > response from them at all. > According to the security issue of placing password in script I brought > up > days ago, some one on this news group suggested me to place such script in > directory above %public_html directory. The problem is I do not know how > to > access such directory. Is it because the service I bought does not allow > me > to do it? or if it is accessible, how to do it?

    Just use include() or require() to "include" the file into your script. You can provide a full path to the file (above the web root) or use a relative path according to the file that's doing the including. Say you using a script in your webroot and you want to include a db.php file that's in an include/ directory above your web root. You can use:

    include("/home/full/path/to/your/dir/include/db.php");

    Or

    include("../include/db.php");

    ---John Holmes...

    attached mail follows:


    If they don't allow you to store the file outside (above) the public_html directory, then you may want to try the following:

    - name your password files with .inc extension - a .htaccess file (assuming apache) to Deny all requests for *.inc files from the server

    This means that any file you name .inc will cannot be served to the browser via http... it just spits out an error (500 I think).

    This is a copy of my .htaccess file, stored at the top of my document root (public_html):

    <Files ~ "\.inc$"> Order Allow,Deny Deny from all </Files>

    As far as USING the password.inc file, just include() it in all your PHP scripts that require it.

    If your ISP doesn't allow you to use .htaccess files in this way, AND can't provide you with a directory outside the document root for placing sensitive files, then I'd recommend switching hosts, because they clearly don't have an understanding of what you need.

    FYI, having a .htaccess file, or storing items above your doc root WILL NOT PREVENT other users on the server accessing your files. You need to ask your ISP what sort of prevention methods they have in place for preventing another user on your server gaining access to your files.

    Justin French

    on 24/07/02 1:07 PM, Sailom (amorndetcolorado.edu) wrote:

    > I bought a web host service from a company named easyspace.com. I have > tried to ask them this question many times but until now there is no > response from them at all. > According to the security issue of placing password in script I brought up > days ago, some one on this news group suggested me to place such script in > directory above %public_html directory. The problem is I do not know how to > access such directory. Is it because the service I bought does not allow me > to do it? or if it is accessible, how to do it? > > I know this is a silly question but please help me. > > Sailom > >

    attached mail follows:


    I'm trying to learn to create a directory in php, and from everything I've read I created this simple test that I put into the file add_user_dir.php. Unfortunately I can't get it to work. I am getting the error message:

    Warning: MkDir failed (Permission denied) in /home/sites/home/users/demo/web/Admin/add_user_dir.php on line 20.

    Obviously, it has something to do with permissions. I have chmod for the directory 'userforum' set to 0777. I tried playing around with umask, and changing the chmod, but I can't get anything to work.

    I am using PHP 4.0.6 with Apache 1.3.20

    Here is the script:

    <form action="<? echo $PHP_SELF; ?>" method="post" name="FormName"> <p>User Name<input type="text" name="username" size="24" border="0"> <input type="submit" name="submitButtonName" value="Make Directory" border="0"></p> </form>

    <?php $dirpath = "/home/sites/home/users/demodocs/web/userforum" . $username; mkdir($dirpath, 0777); ?>

    Can anyone see what I am doing wrong? Thanks.

    Roger Lewis

    attached mail follows:


    On Wednesday 24 July 2002 11:12, Roger Lewis wrote: > I'm trying to learn to create a directory in php, and from everything I've > read I created this simple test that I put into the file add_user_dir.php. > Unfortunately I can't get it to work. I am getting the error message: > > Warning: MkDir failed (Permission denied) in > /home/sites/home/users/demo/web/Admin/add_user_dir.php on line 20. > > Obviously, it has something to do with permissions. I have chmod for the > directory 'userforum' set to 0777. I tried playing around with umask, and > changing the chmod, but I can't get anything to work.

    [snip]

    > <?php > $dirpath = "/home/sites/home/users/demodocs/web/userforum" . $username; > mkdir($dirpath, 0777); > ?>

    Assuming $username is 'tom', are you trying to create:

    a) /home/sites/home/users/demodocs/web/userforumtom

    or:

    b) /home/sites/home/users/demodocs/web/userforum/tom

    Your code is trying to do (a). In any case whatever you're trying to do, you need both the following:

    i) Have execute permissions ('x') on all the directories in the path leading down to where you wish to create your directory

    ii) Have write permission ('w') on the directory in which you are creating your directory

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

    /* "I will make no bargains with terrorist hardware." -- Peter da Silva */

    attached mail follows:


    How about a trailing slash after the directory name ;-)

    like this: $dirpath = "/home/sites/home/users/demodocs/web/userforum/" . $username;

    you had: $dirpath = "/home/sites/home/users/demodocs/web/userforum" . $username; which would try to create a new directory inside the web directory.

    die("$dirpath"); // excellent for debugging :-)

    Jim Grill Support Web-1 Hosting http://www.web-1hosting.net ----- Original Message ----- From: "Roger Lewis" <re.lewisattbi.com> To: "Php-General" <php-generallists.php.net> Sent: Tuesday, July 23, 2002 10:12 PM Subject: [PHP] How do you make a directory

    > I'm trying to learn to create a directory in php, and from everything I've > read I created this simple test that I put into the file add_user_dir.php. > Unfortunately I can't get it to work. I am getting the error message: > > Warning: MkDir failed (Permission denied) in > /home/sites/home/users/demo/web/Admin/add_user_dir.php on line 20. > > Obviously, it has something to do with permissions. I have chmod for the > directory 'userforum' set to 0777. I tried playing around with umask, and > changing the chmod, but I can't get anything to work. > > I am using PHP 4.0.6 with Apache 1.3.20 > > Here is the script: > > <form action="<? echo $PHP_SELF; ?>" method="post" name="FormName"> > <p>User Name<input type="text" name="username" size="24" border="0"> > <input type="submit" name="submitButtonName" value="Make Directory" > border="0"></p> > </form> > > <?php > $dirpath = "/home/sites/home/users/demodocs/web/userforum" . $username; > mkdir($dirpath, 0777); > ?> > > Can anyone see what I am doing wrong? Thanks. > > Roger Lewis > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > >

    attached mail follows:


    On Wednesday 24 July 2002 11:12, Roger Lewis wrote: > I'm trying to learn to create a directory in php, and from everything I've > read I created this simple test that I put into the file add_user_dir.php. > Unfortunately I can't get it to work. I am getting the error message: > > Warning: MkDir failed (Permission denied) in > /home/sites/home/users/demo/web/Admin/add_user_dir.php on line 20. > > Obviously, it has something to do with permissions. I have chmod for the > directory 'userforum' set to 0777. I tried playing around with umask, and > changing the chmod, but I can't get anything to work.

    [snip]

    > <?php > $dirpath = "/home/sites/home/users/demodocs/web/userforum" . $username; > mkdir($dirpath, 0777); > ?>

    Assuming $username is 'tom', are you trying to create:

    a) /home/sites/home/users/demodocs/web/userforumtom

    or:

    b) /home/sites/home/users/demodocs/web/userforum/tom

    Your code is trying to do (a). In any case whatever you're trying to do, you need both the following:

    i) Have execute permissions ('x') on all the directories in the path leading down to where you wish to create your directory

    ii) Have write permission ('w') on the directory in which you are creating your directory

    Jason and TechSupport,

    Jeeze, do I feel stupid. One slash and that's all it took. Thanks much.

    Re the permissions, I have userforum set to 0777. php creates the new directory as 0775. Presumably this is because of the effect of umask, right? When I upload files to the new directory using php uploading script, they go in as 0600, with owner - httpd, and group - root. (The owner/group on my machine is httpd/httpd). I can link to and read the files on the browser OK so I'm happy. Are there any security issues I should be concerned with here.

    Thanks again, Roger Lewis

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

    attached mail follows:


    Is there any way of automatically adding a certain bit of code to every page on a web server (or within a given directory)?

    As in, is there any kind of Apache-specific PHP stuff that will add a banner ad or copyright notice to pages (without editing the actual pages themselves and without changing their file names)? I've looked around a bit, and I can't seem to brainstorm how it could be done.

    Any help will be greatly appreciated (with good karma to boot). :)

    Dave

    attached mail follows:


    use the auto_append or auto_prepend directives in the php.ini file

    -----Original Message----- From: Dave at Sinewaves.net [mailto:eightrackearthlink.net] Sent: Wednesday, July 24, 2002 1:48 PM To: PHPlist Subject: [PHP] Banner Ad Serving...

    Is there any way of automatically adding a certain bit of code to every page on a web server (or within a given directory)?

    As in, is there any kind of Apache-specific PHP stuff that will add a banner ad or copyright notice to pages (without editing the actual pages themselves and without changing their file names)? I've looked around a bit, and I can't seem to brainstorm how it could be done.

    Any help will be greatly appreciated (with good karma to boot). :)

    Dave

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

    attached mail follows:


    On Wednesday 24 July 2002 11:47, Dave at Sinewaves.net wrote: > Is there any way of automatically adding a certain bit of code to every > page on a web server (or within a given directory)?

    php.ini --> auto_prepend_file, auto_append_file

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

    /* An eye in a blue face Saw an eye in a green face. "That eye is like this eye" Said the first eye, "But in low place, Not in high place." */

    attached mail follows:


    That works fine for files with .php extensions, but I need something to add code to html pages as well... Any ideas???

    Dave

    -----Original Message----- From: Jason Wong [mailto:php-generalgremlins.com.hk] Sent: Tuesday, July 23, 2002 8:55 PM To: php-generallists.php.net Subject: Re: [PHP] Banner Ad Serving...

    On Wednesday 24 July 2002 11:47, Dave at Sinewaves.net wrote: > Is there any way of automatically adding a certain bit of code to every > page on a web server (or within a given directory)?

    php.ini --> auto_prepend_file, auto_append_file

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

    /* An eye in a blue face Saw an eye in a green face. "That eye is like this eye" Said the first eye, "But in low place, Not in high place." */

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

    attached mail follows:


    Tell apache that .html files are to be served through php

    * * Cal Evans * The Virtual CIO * http://www.calevans.com *

    -----Original Message----- From: Dave at Sinewaves.net [mailto:eightrackearthlink.net] Sent: Tuesday, July 23, 2002 11:00 PM To: php-generallists.php.net Subject: RE: [PHP] Banner Ad Serving...

    That works fine for files with .php extensions, but I need something to add code to html pages as well... Any ideas???

    Dave

    -----Original Message----- From: Jason Wong [mailto:php-generalgremlins.com.hk] Sent: Tuesday, July 23, 2002 8:55 PM To: php-generallists.php.net Subject: Re: [PHP] Banner Ad Serving...

    On Wednesday 24 July 2002 11:47, Dave at Sinewaves.net wrote: > Is there any way of automatically adding a certain bit of code to every > page on a web server (or within a given directory)?

    php.ini --> auto_prepend_file, auto_append_file

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

    /* An eye in a blue face Saw an eye in a green face. "That eye is like this eye" Said the first eye, "But in low place, Not in high place." */

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

    attached mail follows:


    I think you may have it on that one! You get the gold star! :)

    Thanks for the help -- I probably would have banged my head against my keyboard for another week or so before I thought of that!

    Dave

    -----Original Message----- From: Cal Evans [mailto:calcalevans.com] Sent: Tuesday, July 23, 2002 9:06 PM To: Dave at Sinewaves.net; php-generallists.php.net Subject: RE: [PHP] Banner Ad Serving...

    Tell apache that .html files are to be served through php

    * * Cal Evans * The Virtual CIO * http://www.calevans.com *

    -----Original Message----- From: Dave at Sinewaves.net [mailto:eightrackearthlink.net] Sent: Tuesday, July 23, 2002 11:00 PM To: php-generallists.php.net Subject: RE: [PHP] Banner Ad Serving...

    That works fine for files with .php extensions, but I need something to add code to html pages as well... Any ideas???

    Dave

    -----Original Message----- From: Jason Wong [mailto:php-generalgremlins.com.hk] Sent: Tuesday, July 23, 2002 8:55 PM To: php-generallists.php.net Subject: Re: [PHP] Banner Ad Serving...

    On Wednesday 24 July 2002 11:47, Dave at Sinewaves.net wrote: > Is there any way of automatically adding a certain bit of code to every > page on a web server (or within a given directory)?

    php.ini --> auto_prepend_file, auto_append_file

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

    /* An eye in a blue face Saw an eye in a green face. "That eye is like this eye" Said the first eye, "But in low place, Not in high place." */

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

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

    attached mail follows:


    On Wednesday 24 July 2002 12:07, Dave at Sinewaves.net wrote: > I think you may have it on that one! You get the gold star! :) > > Thanks for the help -- I probably would have banged my head against my > keyboard for another week or so before I thought of that!

    Or you can use something called mod_layout.

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

    /* I'm not even going to *______bother* comparing C to BASIC or FORTRAN. -- L. Zolman, creator of BDS C */

    attached mail follows:


    on 24/07/02 2:00 PM, Dave at Sinewaves.net (eightrackearthlink.net) wrote:

    > That works fine for files with .php extensions, but I need something to add > code to html pages as well... Any ideas???

    Well, this IS a php list :P

    If you have control over the apache config, you can specify all .html files to be parsed in the same way as .php -- although there will be some kind of performance hit.

    There is mod_ssi (server-side includes) which works on .shtml pages (or all .html pages if you specify it in the apache config.

    But in both cases, you want the "bit of code" (a banner I guess) to appear after the BODY tag, and possible after some other code, like tables n stuff, so auto-prepending will not work, and realistically, *total automation* of this process will be impossible to achieve in standard HTML files, due to the nature of WHERE you need to position the banner, and the fact that the HTML before the banner will be different on a page-by-page basis.

    I'd have a bunch of php files which all have a snippet of code in them for the banner.

    <HTML> <HEAD> <TITLE>something</TITLE> </HEAD> <BODY> ... some layout stuff ... <? include('inc/getRandomBanner.php'); ?> .. the page content here ... </BODY> </HTML>

    getRandomBanner.php would be a small file which get a random (or specific) banner from a database or directory, and returns the appropriate HTML code (an anchor and an IMG tag) in the correct place.

    SSI would have similar structure, but with different limitations.

    attached mail follows:


    Here's the URL for mod_layout if anybody's interested...

    http://software.tangent.org/projects.pl?view=mod_layout

    It's powerful, but just a little heftier than what I want. Since all I need is .html and .htm support, I think I'm just going to end up modifying my http.conf - I'd rather mess with Apache a little versus giving PHP another mod to stress over.

    PHP makes a good pipe. :D

    Thanks again, everybody. I love this list!

    Dave

    -----Original Message----- From: Jason Wong [mailto:php-generalgremlins.com.hk] Sent: Tuesday, July 23, 2002 11:13 PM To: php-generallists.php.net Subject: Re: [PHP] Banner Ad Serving...

    On Wednesday 24 July 2002 12:07, Dave at Sinewaves.net wrote: > I think you may have it on that one! You get the gold star! :) > > Thanks for the help -- I probably would have banged my head against my > keyboard for another week or so before I thought of that!

    Or you can use something called mod_layout.

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

    /* I'm not even going to *______bother* comparing C to BASIC or FORTRAN. -- L. Zolman, creator of BDS C */

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

    attached mail follows:


    >Im getting Warnings about headers being already sent. But not on my local >web server > >Im sending the headers (to try and make the page not cache) before anything >is echoed to the browser.

    Somebody somewhere is sending *SOMETHING* to the browser -- possibly a NEWLINE at the tail end of one of your include files.

    The error message you get tells you *EXACTLY* where the output happened.

    >I set the error reporting to E_ALL at the top of the script, turning error >reporting off suppresses the warnings.

    Well, yes, you can make the messages be swallowed up into the Black Hole... Doesn't fix anything, though :-)

    -- 
    Like Music?  http://l-i-e.com/artists.htm
    

    attached mail follows:


    >I have a site with all my movies and stuff stored in a database. And I have >made a admin page where I can add, delete and update records. When I add new >records, I have made a listbox for the category (ex. action, comedy etc.) so >I dont have to write it every time I add a new record. But when I push the >update button and the data thats stored in the database is printed its >printed just in a textarea. I know its possible to list the data in a >listbox, but how do I get the right category selected for the movie I >choose?

    You probably need to have some variant of:

    <SELECT NAME=category SIZE=5 MULTIPLE> <OPTION>action</OPTION> <OPTION>comedy</OPTION> <OPTION>etc</OPTION> </SELECT>

    instead of whatever you have now.

    -- 
    Like Music?  http://l-i-e.com/artists.htm
    

    attached mail follows:


    >I want to store image data into mysql table using BLOB

    Why?

    It's just going to clog up your database, increase the risk of your database self-destructing, and you can't *DO* anything with the data in that blob.

    Unless you're actually de-constructing the image pixels with SQL and doing photo comparisons by machine or something, the BLOB gains you nothing, and risks a lot.

    Just store the image in a highly-optimized, specialized database specifically designed for large chunks of text, commonly known as a "file" in the "OS" :-)

    >but I don't know how >to read it after. To record the image, I doesn't have any problem, but to >read the file after and to view the image, I can't do anything the variable >show only comment like this: memobin24.bin > >So how can I do? > >This was the script. > ><? > >Include("connect.inc") ; > >$fp = fopen("image/photo.jpg","r") ; > >if ($fp) { > >$code2 = "" ; > >while (!feof($fp)) { > >$buffer = fgets($fp, 4096); > >$code2 = $code2.$buffer; > >} > >} > >$code2 = addslashes($code2) ; > >$table = 'image' ; > >$instruction = mysql_query("INSERT into $table values ('','fichier >inage','$code2','') or die("FATAL ERROR") ; > >?>

    You'll need to have *TWO* files:

    File 1: index.php <HTML><BODY><IMG SRC=image.php/photo.jpg?filename=photo.jpg></BODY></HTML>

    File 2: image.php <?php $filename = $_GET['filename']; # Comment out for older versions of PHP. $query = "select nameofblobfieldgoeshere from image where somethinggoeshere = '$filename'"; $data = mysql_query($query) or error_log(mysql_error()); $image = mysql_result($data, 0, 0); $len = strlen($image); header("Content-type: image/jpg"); header("Content-length: $len"); echo $image; ?>

    This will work -- It's just silly[*] to use MySQL BLOBs to store images.

    [*] In very high-traffic servers where you have *MAYBE* done some serious performance testing, you *MIGHT* be able to prove that mysql_connect is faster than a file access. Or, if you don't know where the file is located without firing up the database anyway, *MAYBE* a second query and getting a BLOB will be faster. But you've *GOT* to be very desperate for CPU cycles for this to be relevant.

    -- 
    Like Music?  http://l-i-e.com/artists.htm
    

    attached mail follows:


    >hi i am trying to implement error handling in a join page, i would like to >try and use one page if possible and then go through in steps like ?step=1 >etc , i would like to be able to return form variables to the previous step >if there is an error, how could i do this ?

    Honestly, I've always found it easier to just have distinct pages/files for the steps, and to break the data up into human-comprehensible pages...

    You have several options:

    1. Pass every field around in an INPUT TYPE=HIDDEN tag on every page.

    2. Use sessions. http://php.net/session_start

    3. Store each "partial" record into some tiny "temporary" table as you go, and then move it to the *real* table only when it's all filled in correctly.

    1. is probably easiest for the Newbie. 2. is probably easiest once you understand sessions -- a small but non-zero learning curve 3. doesn't really have anything in particular to recommend it, but doesn't suck.

    -- 
    Like Music?  http://l-i-e.com/artists.htm
    I'm looking for a PRO QUALITY two-input sound card supported by Linux (any
    major distro).  Need to record live events (mixed already) to stereo
    CD-quality.  Soundcard Recommendations?
    Software to handle the recording? Don't need fancy mixer stuff.  Zero (0)
    post-production time.  Just raw PCM/WAV/AIFF 16+ bit, 44.1KHz, Stereo
    audio-to-disk.
    

    attached mail follows:


    >I'm using mysql to hold references to image files then served on my pages >via PHP. > >I have typically a set of two files: > >thumb and a large original, on occasion there is also a variant inreasing >the set to 3 per image > >currently I am holding all of the files in 1 directory since the DB can >keep track of them, however their number has grown to over 400 at this >point > >my issue is whether it would be worth it (performance wise) to split them >into thumbs and works thus having 200+ files per directory as opposed to >so many, I am expecting the number of images to double in the future.

    Are you noticing a slow-down with the 400 images in a single directory?...

    If you're on Windoze, well, I suppose that might happen...

    I wouldn't expect it under Un*x, but anything is possible, I guess...

    If you're not actually *having* a problem, leave it alone :-)

    And, if there is a problem, be *SURE* it's the number of files in the directory causing it. Move all the files but a couple out for a minute and pound the site and see if it's better.

    I wouldn't recommend going to thumbnail versus full-size, though, if you are having problems. That only puts the problem off for another few months or a year...

    Perhaps have a directory for each initial letter of the image filenames: /images/ /a/ andi.jpg arntzen.jpg /b/ beki.jpg bambi.jpg /c/ charlie.jpg . . .

    That should divide your problem down quite nicely, and you won't have to worry about it for a loooong time, assuming a reasonable distrobution of filenames.

    -- 
    Like Music?  http://l-i-e.com/artists.htm
    I'm looking for a PRO QUALITY two-input sound card supported by Linux (any
    major distro).  Need to record live events (mixed already) to stereo
    CD-quality.  Soundcard Recommendations?
    Software to handle the recording? Don't need fancy mixer stuff.  Zero (0)
    post-production time.  Just raw PCM/WAV/AIFF 16+ bit, 44.1KHz, Stereo
    audio-to-disk.
    

    attached mail follows:


    >I've got the login part working perfectly, and I can turn the URL into a >link on the page, but I'd rather have the script just automatically forward >the person to the page they're login gives them access to. > >I've tried using header(), but since the redirection takes place about >mid-script, it doesn't work. I've also tried using <meta> tag redirects, >but those don't seem to accept the PHP/MySQL combo.

    Choice 1. Re-structure your HTML/PHP so that the user registration and the department lookup *IS* at the top of the script. It's logically impossible for this to be "impossible" -- You have all the inputs at the top of the page that you do half-way down. Your code will probably end up being more maintainable once you separate this login logic from the rest of your page anyway.

    Choice 2. The META tags *SHOULD* work, and they should not give a [bleep] about the PHP/MySQL part of it. But they also *MUST* be in the HEAD tag for it to work reliably on most/all browsers. Show us the parts of your code where you think the META tags care about PHP/MySQL.

    Choice 3. Don't re-direct at all. Use include. <?php switch($department){ case 'Accounting': case 'Programming': include "$department.inc"; break; default: # Error. Either you are missing a Department file, or somebody's trying to fool your server into serving up a file you don't want them to see break; } ?>

    -- 
    Like Music?  http://l-i-e.com/artists.htm
    I'm looking for a PRO QUALITY two-input sound card supported by Linux (any
    major distro).  Need to record live events (mixed already) to stereo
    CD-quality.  Soundcard Recommendations?
    Software to handle the recording? Don't need fancy mixer stuff.  Zero (0)
    post-production time.  Just raw PCM/WAV/AIFF 16+ bit, 44.1KHz, Stereo
    audio-to-disk.
    

    attached mail follows:


    >I want to point something out to aspiring authors. The truth is, that few >books and web pages out there show examples using OO methods. For example, >the book I use as my primary reference has one chapter on OO PHP and that >is it. The rest of the examples in the book are in regular functions. And >the one example they give is used to create a web page, with the Title , >KeyWords, Styles, Header, Menu... as the objects. > >So, I guess my point is that if people want to encourage use of OO >programming, they need to use more examples in their books instead of what >is "easy." Otherwise, if the reader doesn't "get" the one example, they >don't have other examples to try. Furthermore, one cannot encourage people >to think about how they can program using OO methods if they don't use such >methods in their teaching of the subject matter.

    Basically, a "Simple OO Example" is an oxymoron, or a Bad Example (apologies to Ralph Covert).

    OO really only shows its strength when you have a certain set of pre-conditions:

    1. Multiple programmers working on large-scale project -- OO safely sub-divides functionality so that they can code with less risk of screwing each other up.

    2. "Library" release code (eg PHPLib) -- OO allows you to have minimal impact on the main application's variables/constants etc by providing a separate name-space

    3. "Real-World Object" being modeled in complex/interesting ways -- OO provides a more "natural" coding style for this in some cases.

    None of these pre-conditions is met in a "Simple Example"

    That said, there are a zillion PHP OO applications/solutions "out there" for you to look at. Some even have comments. A few even have *GOOD* comments. :-)

    It is entirely possible, however, that you don't even *NEED* OO for anything you're doing. If your project doesn't meet any of the above three pre-conditions, chances are Really Good that OO would be like swatting a fly with a cannon. You can do it. And if a cannon is all you know how to work properly, maybe that's the best answer. But it's usually not the "best" answer in a general sense.

    NOTE: I'm an old-school Lisp hacker. I *LOVE* Object-Oriented systems. Yet I rarely feel a need for OO in my PHP scripts. YMMV.

    -- 
    Like Music?  http://l-i-e.com/artists.htm
    I'm looking for a PRO QUALITY two-input sound card supported by Linux (any
    major distro).  Need to record live events (mixed already) to stereo
    CD-quality.  Soundcard Recommendations?
    Software to handle the recording? Don't need fancy mixer stuff.  Zero (0)
    post-production time.  Just raw PCM/WAV/AIFF 16+ bit, 44.1KHz, Stereo
    audio-to-disk.
    

    attached mail follows:


    Thanks Richard, actually your comments really help. As I said to a few others who replied directly, I feel like it is something I ought to be doing. But most of my development is small-scale and I work alone. There is no "external" pressure to do so. Furthermore, I fear that if I were to use OO methods that someone who might no be so skilled would come in behind me and make a mess.

    Hey, it feels good to feel stupid...today is a good day <grin>.

    Paul

    Richard Lynch wrote:

    >>I want to point something out to aspiring authors. The truth is, that few >>books and web pages out there show examples using OO methods. For >>example, the book I use as my primary reference has one chapter on OO PHP >>and that >>is it. The rest of the examples in the book are in regular functions. >>And the one example they give is used to create a web page, with the Title >>, KeyWords, Styles, Header, Menu... as the objects. >> >>So, I guess my point is that if people want to encourage use of OO >>programming, they need to use more examples in their books instead of what >>is "easy." Otherwise, if the reader doesn't "get" the one example, they >>don't have other examples to try. Furthermore, one cannot encourage >>people to think about how they can program using OO methods if they don't >>use such methods in their teaching of the subject matter. > > Basically, a "Simple OO Example" is an oxymoron, or a Bad Example > (apologies to Ralph Covert). > > OO really only shows its strength when you have a certain set of > pre-conditions: > > 1. Multiple programmers working on large-scale project -- OO safely > sub-divides functionality so that they can code with less risk of screwing > each other up. > > 2. "Library" release code (eg PHPLib) -- OO allows you to have minimal > impact on the main application's variables/constants etc by providing a > separate name-space > > 3. "Real-World Object" being modeled in complex/interesting ways -- OO > provides a more "natural" coding style for this in some cases. > > None of these pre-conditions is met in a "Simple Example" > > That said, there are a zillion PHP OO applications/solutions "out there" > for > you to look at. Some even have comments. A few even have *GOOD* > comments. > :-) > > It is entirely possible, however, that you don't even *NEED* OO for > anything > you're doing. If your project doesn't meet any of the above three > pre-conditions, chances are Really Good that OO would be like swatting a > fly > with a cannon. You can do it. And if a cannon is all you know how to > work > properly, maybe that's the best answer. But it's usually not the "best" > answer in a general sense. > > NOTE: > I'm an old-school Lisp hacker. I *LOVE* Object-Oriented systems. Yet I > rarely feel a need for OO in my PHP scripts. YMMV. >

    attached mail follows:


    >Any one please let me know how to use PHP to add new user to a domain for >using mail (sendmail).

    You mean like a *REAL* user with a login and everything?

    Yikes!

    DANGER, WILL ROBINSON DANGER!

    You *REALLY* shouldn't do this unless you *REALLY* understand Un*x permissions and system security. HIGHLY DANGEROUS.

    1st. Draw up a security diagram of *WHO* can access this page and *HOW* they can access it and make damn sure *NOBODY* you don't trust can't access it. You'll want this happening over SSL (HTTPS) so your communication is secure.

    2nd. You'll have to muck with the /etc/passwd and shadow password files directly, almost for sure. The password routines for "user_add" and so on require a TTY connection (IE, a "real" login) and PHP ain't got one.

    3rd. You'll need to have sudo scripts running to do 2. Or, *MAYBE* a PHP CGI running via suExec as "root" and all the scripts are root-owned and not world-readable, much less world-writable nor world-executable, but *NOT* *NOT* *NOT* if *OTHER* people can use the same web-server and upload their *OWN* PHP scripts that will get executed as 'root' Bad Idea.

    4th. Make sure those sudo scripts can *ONLY* be run by people you trust.

    You *MIGHT* be able to more easily allow sendmail to send emails or create some kind of "virtual" user that doesn't have an actual login, even though they have a directory for their mailbox, and then give them a web-interface to read that email or something. This would be infinitely more secure, if it's possible.

    Letting PHP create shell logins is just plain DANGEROUS.

    Did I mention it was DANGEROUS? It is.

    >And also any funtions to check the availibility of a >domain name.

    Search code archives for "whois" or try this out: <?php exec("/usr/bin/whois $domainname", $results, $error); echo implode("<BR>\n", $results); if ($error){ echo "OS Error $error. Usually path/permissions. Read 'man errno' to be sure.<BR>"; } ?>

    -- 
    Like Music?  http://l-i-e.com/artists.htm
    I'm looking for a PRO QUALITY two-input sound card supported by Linux (any
    major distro).  Need to record live events (mixed already) to stereo
    CD-quality.  Soundcard Recommendations?
    Software to handle the recording? Don't need fancy mixer stuff.  Zero (0)
    post-production time.  Just raw PCM/WAV/AIFF 16+ bit, 44.1KHz, Stereo
    audio-to-disk.
    

    attached mail follows:


    http://www.mricon.com/SM/guide

    he has a tutorial (for both redhat, and freebsd) that details exactly howto setup a full mail server, using virtual domains/users. step by step. should be what is needed here. I use it personally for my servers.

    Jason Reid jasonachost.ca

    --
    AC Host Canada
    www.achost.ca
    

    ----- Original Message ----- From: "Richard Lynch" <richphpbootcamp.com> To: "Anan" <ananetcyber.net> Cc: <php-generallists.php.net> Sent: Tuesday, July 23, 2002 8:35 PM Subject: [PHP] Re: How to add new user to the domain

    > >Any one please let me know how to use PHP to add new user to a domain for > >using mail (sendmail). > > You mean like a *REAL* user with a login and everything? > > Yikes! > > DANGER, WILL ROBINSON DANGER! > > You *REALLY* shouldn't do this unless you *REALLY* understand Un*x > permissions and system security. HIGHLY DANGEROUS. > > 1st. Draw up a security diagram of *WHO* can access this page and *HOW* they > can access it and make damn sure *NOBODY* you don't trust can't access it. > You'll want this happening over SSL (HTTPS) so your communication is secure. > > 2nd. You'll have to muck with the /etc/passwd and shadow password files > directly, almost for sure. The password routines for "user_add" and so on > require a TTY connection (IE, a "real" login) and PHP ain't got one. > > 3rd. You'll need to have sudo scripts running to do 2. Or, *MAYBE* a PHP > CGI running via suExec as "root" and all the scripts are root-owned and not > world-readable, much less world-writable nor world-executable, but *NOT* > *NOT* *NOT* if *OTHER* people can use the same web-server and upload their > *OWN* PHP scripts that will get executed as 'root' Bad Idea. > > 4th. Make sure those sudo scripts can *ONLY* be run by people you trust. > > You *MIGHT* be able to more easily allow sendmail to send emails or create > some kind of "virtual" user that doesn't have an actual login, even though > they have a directory for their mailbox, and then give them a web-interface > to read that email or something. This would be infinitely more secure, if > it's possible. > > Letting PHP create shell logins is just plain DANGEROUS. > > Did I mention it was DANGEROUS? It is. > > >And also any funtions to check the availibility of a > >domain name. > > Search code archives for "whois" or try this out: > <?php > exec("/usr/bin/whois $domainname", $results, $error); > echo implode("<BR>\n", $results); > if ($error){ > echo "OS Error $error. Usually path/permissions. Read 'man errno' to > be sure.<BR>"; > } > ?> > > -- > Like Music? http://l-i-e.com/artists.htm > I'm looking for a PRO QUALITY two-input sound card supported by Linux (any > major distro). Need to record live events (mixed already) to stereo > CD-quality. Soundcard Recommendations? > Software to handle the recording? Don't need fancy mixer stuff. Zero (0) > post-production time. Just raw PCM/WAV/AIFF 16+ bit, 44.1KHz, Stereo > audio-to-disk. > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php >

    attached mail follows:


    At 09:35 PM 7/23/02 -0500, Richard Lynch wrote: > >Any one please let me know how to use PHP to add new user to a domain for > >using mail (sendmail).

    Remember what Richard said... mucking around with real users is DANGEROUS!

    I solved the problem with Qmail, vchkpw and qmailadmin. No coding on my part at all, just install a few packages.

    http://inter7.com/freesoftware/

    http://www.qmail.org

    Some people have hundreds of domains and tens of thousands of users on a small cluster of servers.

    Rick

    attached mail follows:


    ><INPUT TYPE = "HIDDEN" NAME = "status[0]" value = "collapse"> > >onclick = "document.all['tree'].status[<?=$i?>].value='expand';

    No matter what you do, JavaScript will *NEVER* accept the [ or ] character as part of a field's NAME.

    Those are RESERVED keys in JavaScript.

    You'll have to refer to the INPUT by NUMBER, rather htan name.

    onClick = "document.all.tree.5.value='expand'";

    Only 5 is probably not correct...

    You'll have to count your INPUTs.

    Ooooooh. *OR*, I think you can give the INPUT thingies an *ID* in HTML, and use the *ID* (not NAME) in JavaScript.

    Never did that, myself, but I hear it works.

    -- 
    Like Music?  http://l-i-e.com/artists.htm
    I'm looking for a PRO QUALITY two-input sound card supported by Linux (any
    major distro).  Need to record live events (mixed already) to stereo
    CD-quality.  Soundcard Recommendations?
    Software to handle the recording? Don't need fancy mixer stuff.  Zero (0)
    post-production time.  Just raw PCM/WAV/AIFF 16+ bit, 44.1KHz, Stereo
    audio-to-disk.
    

    attached mail follows:


    >Well, I'm not sure about the 'you get what you pay for'. Some paid for >software has less support and documentation than PHP!

    In my experience, *ALL* paid-for software has less support and documentation than PHP.

    This is excluding support contracts for software you paid for -- Once you pay Oracle enough money for Support Contracts, they have pretty good support, from what I hear... :-)

    -- 
    Like Music?  http://l-i-e.com/artists.htm
    I'm looking for a PRO QUALITY two-input sound card supported by Linux (any
    major distro).  Need to record live events (mixed already) to stereo
    CD-quality.  Soundcard Recommendations?
    Software to handle the recording? Don't need fancy mixer stuff.  Zero (0)
    post-production time.  Just raw PCM/WAV/AIFF 16+ bit, 44.1KHz, Stereo
    audio-to-disk.
    

    attached mail follows:


    >#!/usr/local/bin/php -q ><? >// don't timeout! >set_time_limit(0); > >// set some variables >$host = "1.2.3.4..."; >$port = 1234; >$command = "/usr/games/fortune";

    # I must be missing something, cuz I don't see where this $command is used...

    >// create socket >$socket = socket(AF_INET, SOCK_STREAM, 0) or die("Could not create >socket\n"); > >// bind socket to port >$result = bind($socket, $host, $port) or die("Could not bind to >socket\n"); > >/* start listening for connections >* My Script Fails here... > * Any suggestions why it fails the Socket SetUp... > * Should I screw around with the port numbers? > */ >$result = listen($socket, 3) or die("Set up Failed!"); >echo "Waiting for connections...\n";

    You do realize that it's *SUPPOSED* to just sit there waiting for somebody to connect at this point, right?...

    It it saying "Set up Failed!"?

    I mean, it may *LOOK* like it "hangs" but it's really just "waiting..."

    You'll need to open another shell window and poke at the port it's listening to to get any action.

    Oh, and you probably need to use socket_listen, and not just "listen", I think... Or are these the old function names?...

    -- 
    Like Music?  http://l-i-e.com/artists.htm
    I'm looking for a PRO QUALITY two-input sound card supported by Linux (any
    major distro).  Need to record live events (mixed already) to stereo
    CD-quality.  Soundcard Recommendations?
    Software to handle the recording? Don't need fancy mixer stuff.  Zero (0)
    post-production time.  Just raw PCM/WAV/AIFF 16+ bit, 44.1KHz, Stereo
    audio-to-disk.
    

    attached mail follows:


    "Richard Lynch" <richphpbootcamp.com> wrote in message news:php.general-109225news.php.net... > >#!/usr/local/bin/php -q > ><? > >// don't timeout! > >set_time_limit(0); > > > >// set some variables > >$host = "1.2.3.4..."; > >$port = 1234; > >$command = "/usr/games/fortune"; > > # I must be missing something, cuz I don't see where this $command is > used...

    $command is used further down in the script I din't post the whole thing coz it dies when it reaches the statement:

    $result = listen($socket, 3) or die("Set up Failed!");

    i.e. output: Setup Failed! > >// create socket > >$socket = socket(AF_INET, SOCK_STREAM, 0) or die("Could not create > >socket\n"); > > > >// bind socket to port > >$result = bind($socket, $host, $port) or die("Could not bind to > >socket\n"); > > > >/* start listening for connections > >* My Script Fails here... > > * Any suggestions why it fails the Socket SetUp... > > * Should I screw around with the port numbers? > > */ > >$result = listen($socket, 3) or die("Set up Failed!"); > >echo "Waiting for connections...\n"; > > You do realize that it's *SUPPOSED* to just sit there waiting for somebody > to connect at this point, right?... > > It it saying "Set up Failed!"? > > I mean, it may *LOOK* like it "hangs" but it's really just "waiting..." > > You'll need to open another shell window and poke at the port it's listening > to to get any action. > > Oh, and you probably need to use socket_listen, and not just "listen", I > think... Or are these the old function names?...

    I tested the Script on PHP 4.1.2 it does not have a definition for the functions socket_listen or socket_create hence you can only use socket() and listen()

    Thanks for the response...

    Spike...

    attached mail follows:


    >I saw a comment in the online docs about setting the return-path for >sendmail for virtualhosts. However, the note did not say WHERE to put the >line - I attempted to put it into apache's virtual host tag and that failed. >The line was: > >php_admin_value return-path "/usr/sbin/sendmail -t -i -f addressdomain.com" > >Can anyone give me a hint? Please CC me as I am not currently subscribed.

    <?php $headers = "From: joejwebmedia.com\r\n"; $headers .= "Reply-to: joejwebmedia.com\r\n"; $success = mail('joejwebmedia.com', 'Talking...', '...to myself', $headers); if ($success){ echo "Queued email.<BR>\n"; } else{ echo "Sendmail refused to queue my email!<BR>\n"; } ?>

    -- 
    Like Music?  http://l-i-e.com/artists.htm
    I'm looking for a PRO QUALITY two-input sound card supported by Linux (any
    major distro).  Need to record live events (mixed already) to stereo
    CD-quality.  Soundcard Recommendations?
    Software to handle the recording? Don't need fancy mixer stuff.  Zero (0)
    post-production time.  Just raw PCM/WAV/AIFF 16+ bit, 44.1KHz, Stereo
    audio-to-disk.
    

    attached mail follows:


    >I have an embedded object in my webpage which will play a DVD movie right in >the page (provided you have a disc in teh dvdrom drive). One of the >javascript methods attached to this object returns the current time. OK, on >to the php/mysql part. I have a mysql database which has a table to catalog >camera shots digramed like so: >___________ >|*shot_num | >| start_time | >| end_time | >|__________| * = primary key > >During play, I have a javascript function which continuously gets teh >current time and puts it in an input field called cur_time (clever huh?). >So my question is... what is the best way to have a second field called >shot_num which is continuously changing? It can't be good to query the >database continuously, even if it is a small query, can it? What is a good >stratagy to work with here? I'm still a bit of a novice with php/mysql, so >be gentle.

    If you have only a *FEW* (like, under a hundred) "shot_num" in a single movie, just do this:

    <?php $query = "select shot_num, start_time from whatever order by shot_num"; $shots = mysql_query($query) or error_log(mysql_error()); echo "<SCRIPT LANGUAGE=JavaScript>\n"; while (list($shot_num, $start_time) = mysql_fetch_row($shots)){ echo " shot_num[$shot_num] = $start_time;\n"; } echo "</SCRIPT>\n"; ?>

    Now you can just look up the shot_num in JavaScript. You may want to switch the array around or whatever it takes to make JavaScript capable of finding/searching the shot_num/start_time lookup.

    -- 
    Like Music?  http://l-i-e.com/artists.htm
    I'm looking for a PRO QUALITY two-input sound card supported by Linux (any
    major distro).  Need to record live events (mixed already) to stereo
    CD-quality.  Soundcard Recommendations?
    Software to handle the recording? Don't need fancy mixer stuff.  Zero (0)
    post-production time.  Just raw PCM/WAV/AIFF 16+ bit, 44.1KHz, Stereo
    audio-to-disk.
    

    attached mail follows:


    >is there a more programmatically elegant way of saying...

    One option would be to just exit; when you get an error if the rest of the script isn't going to execute and send out some closing tags you need anyway.

    Future versions of PHP might have a try/catch mechanism, but that doesn't help you right now.

    You may want to look into http://php.net/trigger_error and see if you can't arrange for all your closing tags to be spit out by a function that you can call inside that, and then have the exit; there.

    What you're doing is "fine" though, if you can live with it.

    Or, you might be able to get your "error" problems into functions separate from the "do" parts:

    if (!($error = something1()) && !($error = something2()) && !($error = something3())){ # Okay to proceed with all 3 steps. } else{ echo "Error $error<BR>\n"; }

    The error line can get kinda long there, but you can make it three lines, or just leave it alone -- It's really not that big a deal if you "play nice" and have *ONLY* more of the same stuff in the rest of the (). How often do you need to scroll right to see the same damn thing repeated when trying to debug?

    > >$isError = ""; > >function main() { > > doStep1(); > > if (!$isError) { > doStep2(); > } > > if (!$isError) { > doStep3(); > } > // etc. etc. >} > >function doStep1() { > if ($something) { > $isError = 1; > } >} > >function doStep2() { > if ($something) { > $isError = 1; > } >} > >_________________________________________________________________ >Join the world’s largest e-mail service with MSN Hotmail. >http://www.hotmail.com >

    -- 
    Like Music?  http://l-i-e.com/artists.htm
    I'm looking for a PRO QUALITY two-input sound card supported by Linux (any
    major distro).  Need to record live events (mixed already) to stereo
    CD-quality.  Soundcard Recommendations?
    Software to handle the recording? Don't need fancy mixer stuff.  Zero (0)
    post-production time.  Just raw PCM/WAV/AIFF 16+ bit, 44.1KHz, Stereo
    audio-to-disk.
    

    attached mail follows:


    >Hi, > >I'm using PHP to connect and perform queries with a MySQL database. I've >noticed that it there is an error performing certain >commands like 'mysql_connect()', I'll get a warning message in the browser. > >I'd like to suppress these messages as I am storing the error, >mysql_error(), in an array. So if there is an error, I would simply >display the contents of the array in a nice format. > >Is this possible?

    <?php $connection = mysql_connect(...) or $errors[] = mysql_error(); ?>

    The symbol will suppress *ALL* error messages. Even if you screw up and type myslq_connect or something equally bone-headed. Be aware of that.

    Code first without the 's, and then sprinkle them in as needed. :-)

    -- 
    Like Music?  http://l-i-e.com/artists.htm
    I'm looking for a PRO QUALITY two-input sound card supported by Linux (any
    major distro).  Need to record live events (mixed already) to stereo
    CD-quality.  Soundcard Recommendations?
    Software to handle the recording? Don't need fancy mixer stuff.  Zero (0)
    post-production time.  Just raw PCM/WAV/AIFF 16+ bit, 44.1KHz, Stereo
    audio-to-disk.
    

    attached mail follows:


    >I read the useful document about XML in PHP on >http://www.analysisandsolutions.com/code/phpxml.html. I still haven't made >much progress on XML. I'm still confuse about XML. I had to write XML >stuffs on the client-side with the build-in XML request and it doesn't make >sense that the client brower should be communicating to credit bureau >network without going to my company's PHP webserver to that credit bureau. >So, it meant I have to use the post request that would send the data to my >company's PHP webserver and somehow convert it into xml and send it to that >credit bureau by cURL. Is there a way to do that??

    As I recall, only the DOM model can easily add/alter "nodes" to an XML document. SAX would be not useful... (Or was it the other way around...?)

    Anyway, you may be trying too hard :-)

    Unless your credit bureau is incredibly different from all the rest, it will *PROBABLY* be easiest to just do something not unlike:

    <?php # import expected $_POST variables if register_globals is off. $xml = <<<ENDOFXML <XML> <NAME>$name</NAME> <ADDRESS>$address</ADDRESS> . . . </XML> ENDOFXML; $result = posttohost('http://yourcreditbureau.com', $xml); ?>

    I mean, really, do you want to make life all complicated by trying to create some giant XML data structure when all you really need is one stupid little never-changing string with the data in it?

    If you're building a complex application to *TRADE* tons of info with your credit bureau, you'd want to "scale up" and generalize your XML-creation with complex data structures so you can easily alter it when they change the DTD out from under you or whatever.

    But if you are just sending the one kind of XML request off to the credit bureau, don't make your life complicated for no real reason.

    Just my opinion.

    -- 
    Like Music?  http://l-i-e.com/artists.htm
    I'm looking for a PRO QUALITY two-input sound card supported by Linux (any
    major distro).  Need to record live events (mixed already) to stereo
    CD-quality.  Soundcard Recommendations?
    Software to handle the recording? Don't need fancy mixer stuff.  Zero (0)
    post-production time.  Just raw PCM/WAV/AIFF 16+ bit, 44.1KHz, Stereo
    audio-to-disk.
    

    attached mail follows:


    >After my host recently upgraded to the latest version after reading the >recent advisory I have got an error that won't load one of my php pages and >I can't see why not. Here's the error I get - > >Warning: Failed opening '' for inclusion >(include_path='.:/usr/lib/apache/php') in /home/sites/site41/web/horror.php >on line 28

    > <br><? include("$page") ?>

    $page is probably empty because of register_globals being OFF by default now.

    You'll need something like:

    $page = $_GET['page'] at the top of your script.

    Oh, and it's a *REALLY* BAD IDEA to do what you are doing!

    What if I put in this:

    http://yourserver.com/yourpage.php?page=/etc/passwd

    You've just given me your entire /etc/passwd file which I can now use against my dictionary to search for somebody's password.

    Even if your computer won't give me /etc/passwd, I'll bet there are some files I can get ahold of that you don't want me to.

    Odds are really good that $page should be from a finite set of values -- Make sure the $page I ask for is what you expect.

    If you really cannot predict what $page will be, make sure I don't use '../' in my $page, and then use the full path to the $page files so I can't "break out" of that directory: <?php if (strstr('..', $page)){ $page = 'badperson.htm'; } <?php include "/full/path/to/$page"?>

    -- 
    Like Music?  http://l-i-e.com/artists.htm
    I'm looking for a PRO QUALITY two-input sound card supported by Linux (any
    major distro).  Need to record live events (mixed already) to stereo
    CD-quality.  Soundcard Recommendations?
    Software to handle the recording? Don't need fancy mixer stuff.  Zero (0)
    post-production time.  Just raw PCM/WAV/AIFF 16+ bit, 44.1KHz, Stereo
    audio-to-disk.
    

    attached mail follows:


    >Very cute! "Upgrade Now!" It will work well with PHP newbies. Not!

    If you are on Windoze, just download and run the installer or whatever you did last time that actually worked, as much as anything on Windoze works.

    If on Un*x:

    Download 4.2.2 from http://php.net and save it in /usr/src or where-ever you find convenient.

    cd to the directory where php-4.2.2.tar.gz lives.

    Untar it: tar -xzf php-4.2.2.tar.gz

    Copy the configure settings you used before: cp php-4.1.0/config.nice php-4.2.2

    Move into the new PHP directory: cd php-4.2.2

    Do the config.nice (it's what you used last time): ./config.nice

    Pay attention to the crap that scrolls by, if you can read that fast :-) Or, instead of just ./config.nice, use: ./config.nice 2&>1 > config.output & Then you can use: tail -f config.output to see what's happening as it goes (type control-C to quit tail), or less config.output after you come back from your coffee-break.

    Compile PHP: make

    (Maybe time for another coffee-break.)

    Install PHP: make install

    Stop Apache: *** /usr/local/apache/bin/apachectl stop

    Start Apache: /usr/local/apache/bin/apachectl start

    Confirm the new PHP is working by surfing to a file with: <?php phpinfo();?> in it.

    Remove that file phpinfo() file.

    Even for a newbie, this should probably take, like, a half hour? if everything goes well.

    Assuming a decently-powered box. If you're installing on a Pentium1 laptop or something, those coffee-breaks could turn into lunch and dinner breaks or something.

    *** There may be a better/different way to stop/start Apache on your server. Just make 100% sure you stopped it and started it again.

    -- 
    Like Music?  http://l-i-e.com/artists.htm
    I'm looking for a PRO QUALITY two-input sound card supported by Linux (any
    major distro).  Need to record live events (mixed already) to stereo
    CD-quality.  Soundcard Recommendations?
    Software to handle the recording? Don't need fancy mixer stuff.  Zero (0)
    post-production time.  Just raw PCM/WAV/AIFF 16+ bit, 44.1KHz, Stereo
    audio-to-disk.
    

    attached mail follows:


    >With php 4.2.2 I get this when trying to compile with apache 2 support: > >I grabbed a CVS version of PHP and during configure it lets me know that I >need apache 2.0.40 -- since the latest release of Apache 2 is 2.0.39 I'm not >sure what to do there.. Does that mean the latest apache 2 devel source? > >Someone toss me a clue stick please!

    Yes, if you want Apache 2.0 you have to be on the bleeding edge (CVS) of both PHP and Apache.

    Not for the faint-hearted.

    YMMV. (There might be some kind of 2.0.40 snapshot somewhere of Apache, but I know for sure you need PHP CVS or it ain't gonna work.)

    -- 
    Like Music?  http://l-i-e.com/artists.htm
    I'm looking for a PRO QUALITY two-input sound card supported by Linux (any
    major distro).  Need to record live events (mixed already) to stereo
    CD-quality.  Soundcard Recommendations?
    Software to handle the recording? Don't need fancy mixer stuff.  Zero (0)
    post-production time.  Just raw PCM/WAV/AIFF 16+ bit, 44.1KHz, Stereo
    audio-to-disk.
    

    attached mail follows:


    >Hi, >Someone please tell me how to install apache on redhat >linux.

    Download the web-server that is named apache-1.3.xx (highest xx) and ends in .tar.gz from: http://apache.org/

    Save it in /usr/src or somewhere convenient.

    cd to that directory: cd /usr/src

    Untar it: tar -xzf apache-1.3.xx.tar.gz (Replace xx with the right thing. "tab" key may be useful after you've typed 'apa' part.)

    Move into the Apache directory: cd apache-1.3.xx (See above)

    Read any files named INSTALL and/or README and/or inside a directory that looks like it might be documentation (docs, documentation, etc) Follow the instructions in those files carefully.

    -- 
    Like Music?  http://l-i-e.com/artists.htm
    I'm looking for a PRO QUALITY two-input sound card supported by Linux (any
    major distro).  Need to record live events (mixed already) to stereo
    CD-quality.  Soundcard Recommendations?
    Software to handle the recording? Don't need fancy mixer stuff.  Zero (0)
    post-production time.  Just raw PCM/WAV/AIFF 16+ bit, 44.1KHz, Stereo
    audio-to-disk.
    

    attached mail follows:


    >Is there a way to limit the total number of persistent connection to an >oracle database? I know this functionality exists for MySQL through a >setting in the php.ini but I haven't found it for oracle. I am in an >environment where we have about 10 users that connect to oracle from >each of 10 webservers that each have about 20 apache processes and I >would like to use persistent connections but the resulting 2000 >connections would overwhelm oracle. I am looking at reducing the number >of users but that will be a large undertaking to go through the entire >codebase. Any ideas?

    It's really an Oracle question, I think. The setting in php.ini for limiting MySQL is, I think, not *quite* the same as the setting in MySQL's /etc/my.conf that limits how many MySQL will accept... Not sure on that though.

    Still, it's probably one of Oracles two zillion environment variables.

    I have to assume that Oracle can do that -- for the price you paid it had better :-)

    Make sure you have a few spare connections that you never use. When you need to do something in a panic from the shell and all the connections are already tied up, it's not pretty...

    Your code-base had better be ready for the failed connections... I mean, if you didn't write good solid error-checking in all 2000 connection points, you're going to see a lot of applications dying horribly...

    -- 
    Like Music?  http://l-i-e.com/artists.htm
    I'm looking for a PRO QUALITY two-input sound card supported by Linux (any
    major distro).  Need to record live events (mixed already) to stereo
    CD-quality.  Soundcard Recommendations?
    Software to handle the recording? Don't need fancy mixer stuff.  Zero (0)
    post-production time.  Just raw PCM/WAV/AIFF 16+ bit, 44.1KHz, Stereo
    audio-to-disk.
    

    attached mail follows:


    On Tue, Jul 23, 2002 at 11:39:20AM -0700, Eric Thelin wrote: > That is what I figured. The problem is that oracle doesn't even seem to > have per-process limits.

    the oci-driver will only open one server-connection per TNS-name/process.

    so if you use

    $a = ociplogon("scott", "tiger", "prod");

    and later (different script)

    $a = ociplogon("system", "manager", "prod");

    you will still only see one server connection (one "shadow") but you will have two sessions which share the one server-connection.

    so if you have more that one oracle-user that's used in your scriots you have to do:

    oracle-connections = MaxChilds oracle-session = MaxChilds * distinct oracle-logins

    now, if you limit the persistent connections per apache-child some logins would be fast whereby others would be slow, i really dislike this kind of unpredictable behaviour.

    if you have the need to connect more than one oracle-user i would either:

    - have different apaches running (one per oracle-user) - only use ociplogon for one of the users (starting a new session over an already established link is still fast) - not use oracle (just kidding;-)

    or, do you have any better ideas?

    re, tc

    > > Eric > > On Tue, 23 Jul 2002, Thies C. Arntzen wrote: > > > On Tue, Jul 23, 2002 at 11:00:43AM -0700, Eric Thelin wrote: > > > Is there a way to limit the total number of persistent connection to an > > > oracle database? I know this functionality exists for MySQL through a > > > setting in the php.ini but I haven't found it for oracle. I am in an > > > environment where we have about 10 users that connect to oracle from > > > each of 10 webservers that each have about 20 apache processes and I > > > would like to use persistent connections but the resulting 2000 > > > connections would overwhelm oracle. I am looking at reducing the number > > > of users but that will be a large undertaking to go through the entire > > > codebase. Any ideas? > > > > even the mysql-limits are _per_ apache-process. so if you > > want to limit the simutainious connections to any php > > supported database is to set MaxClients (in httpd.conf) or > > disable persistent connections completely. > > > > re, > > tc > >

    attached mail follows:


    >I have a challenging part to this project. Let's say the PHP webserver >establish a connection to a different website and received the ssl >connection from there. How do I get the certificate information from that >website and display it? I can use print_r($GLOBALS) but it only display the >certificate from this PHP webserver. So, how do I get the certificate >information from that website??

    I don't really know the answer, but...

    Check the output of <?php phpinfo();?> to see if there are any leads.

    Maybe cURL has a way to request the certificate information.

    You can't get like their whole certificate, though, right? I mean, there's definitely a part of that which is "private" like the "private" half of a PGP key, right?... It may not be possible to access what you think you want to access.

    -- 
    Like Music?  http://l-i-e.com/artists.htm
    I'm looking for a PRO QUALITY two-input sound card supported by Linux (any
    major distro).  Need to record live events (mixed already) to stereo
    CD-quality.  Soundcard Recommendations?
    Software to handle the recording? Don't need fancy mixer stuff.  Zero (0)
    post-production time.  Just raw PCM/WAV/AIFF 16+ bit, 44.1KHz, Stereo
    audio-to-disk.
    

    attached mail follows:


    >and i never see any copy.) My only guess is that a mysql_link resssource is >also an object and gets copied or lost somewhere in the middle.

    In the old days, a MySQL link resource was just an integer.

    It is now a 'Resource' type internal to PHP.

    I don't *think* it will get copied on assignment... That would be pretty icky.

    >Can anybody tell me what i could do??? > >(PS i didn't post all the source and the real login info...tehre is too much >to paste and also, it's too improtant to reveal anything) > >SOURCE: >class mysql_connection{ > //Variables > var $mysql_link; > var $mysql_username; > var $mysql_password; > var $mysql_database; > > //Constructor(Establishes the connection) > function mysql_connection($hostname, $username, $password, $database){ > //Connection to database > $this->mysql_link = mysql_connect("$hostname", "$username", "$password"); > if(!$this->mysql_link){ > //Display an error message > exit("Error connecting to mysql server, contact web administrator or try >again later!"); > } > //Select the database > if(!mysql_select_db("$database", $this->mysql_link)){ > //Display an error message > exit("Error selecting database on mysql server, contact web administrator >or try again later!"); > } > } >} > >class arenas{ > > //System objects > var $mysql_server; > var $item; > > //Variables/Arrays > var $indexes = array(); > var $curindex = 0; > > //Constructor > function arenas(&$mysql_server){ > //Store the server > $this->mysql_server = &$mysql_server; > //Build the index > $this->refresh(); > } >} > >$mysql_server = new mysql_connection("localhost", "username", "password", >"database"); > >//Get the arenas and the current item >$arenas = new arenas($mysql_server); > >//At this point i would do a sql query from inside my arenas class that >would raise an error >//If i echo the error from inside the class using >//echo mysql_error($this->mysql_server->mysql_link); >//it works > >//if i echo from the script itself like here it doesn't work >echo mysql_error($mysql_server->mysql_link); > >//The first one will show something, the second will never show the error, >any clue why?

    echo out $mysql_server at various places, and $mysql_server->mysql_link and see what PHP thinks they are.

    -- 
    Like Music?  http://l-i-e.com/artists.htm
    I'm looking for a PRO QUALITY two-input sound card supported by Linux (any
    major distro).  Need to record live events (mixed already) to stereo
    CD-quality.  Soundcard Recommendations?
    Software to handle the recording? Don't need fancy mixer stuff.  Zero (0)
    post-production time.  Just raw PCM/WAV/AIFF 16+ bit, 44.1KHz, Stereo
    audio-to-disk.
    

    attached mail follows:


    >Is there any way to get the day of the week given a date. > >For example if the date is the 22nd July 2003 I want to know if it will be a >Monday or Wednesday, etc.. > >Any help appreciated.

    http://php.net/date/

    Also look at the strfromtime or whatever the heck it is.

    -- 
    Like Music?  http://l-i-e.com/artists.htm
    I'm looking for a PRO QUALITY two-input sound card supported by Linux (any
    major distro).  Need to record live events (mixed already) to stereo
    CD-quality.  Soundcard Recommendations?
    Software to handle the recording? Don't need fancy mixer stuff.  Zero (0)
    post-production time.  Just raw PCM/WAV/AIFF 16+ bit, 44.1KHz, Stereo
    audio-to-disk.
    

    attached mail follows:


    I must be dumb because I still can't get it to work.

    Using the following instead of my previous preg_match_all statement: preg_match_all("|<font face=\"Verdana\" size=\"3\"><b>(.*)</b></font>|i", $contents, $out);

    Gives me only the -last- 3 headlines on http://www.kinyradio.com/juneaunews/latest_juneau_news.html. I've looked at the source and there are indeed more matching tags than are being returned. I've tried placing "r+" in my fopen() statement to put the pointer at the beginning of the file, but no luck there. I've also tried a bigger filesize constant in fread(), still nothing.

    Actually, I just noticed what the difference is with those last three - their lines don't break in the source. The other lines have breaks, so the </b></font> land on the following line. Is there anything I can do to have preg_match_all 'connect' the lines?

    Any help would be great. Thanks!

    Jason Soza

    -----Original Message----- From: Jason Wong [mailto:php-generalgremlins.com.hk] Sent: Tuesday, July 23, 2002 1:20 AM To: php-generallists.php.net Subject: Re: [PHP] Re: Using fopen()/fread()/fscanf()

    On Tuesday 23 July 2002 15:38, Jason Soza wrote: > Alright, I see that this is probably the way to go, but I'm dying here. I > have this: > > $filename = > fopen("http://www.kinyradio.com/juneaunews/latest_juneau_news.html", "r"); > $contents = fread($filename, 1000000); > preg_match_all("|<font face=\"Verdana\" size=\"3\"><b>+[-a-zA-Z0-9,. > ]+|i", $contents, $out); > print_r($out);

    Assuming that the <font> and <b> tags are closed and you want everything in between then try this:

    preg_match_all("|<font face=\"Verdana\" size=\"3\"><b>(.*)</b></font>|i", $contents, $out);

    > The manual entries for preg_match and preg_match_all pretty much assume you > have a working knowledge of reg expressions, which I don't, and a google > search turned up a bunch of pages, none of which I could understand enough > to be of help. So, any pointers would be appreciated. Thanks!

    You want to read up on "Pattern Modifiers" and "Pattern Syntax", that's where all the regex black magic is explained.

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

    /* He's dead, Jim. -- McCoy, "The Devil in the Dark", stardate 3196.1 */

    attached mail follows:


    hi am getting this error

    # make Making all in Zend make[1]: Entering directory `/usr/local/php-4.2.1/Zend' /bin/sh ../libtool --silent --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I../main -D_POSIX_PTHREAD_SEMANTICS -I../TSRM -g -O2 -prefer-non-pic -static -c -o zend_language_parser.lo `test -f zend_language_parser.c || echo './'`zend_language_parser.c In file included from zend_compile.h:24, from zend_language_parser.c:147: zend.h:55:19: unix.h: No such file or directory make[1]: *** [zend_language_parser.lo] Error 1 make[1]: Leaving directory `/usr/local/php-4.2.1/Zend' make: *** [all-recursive] Error 1

    does any one know where i can get unix.h from?????????? I've tried to find it but have had no luck.. and got no reply to an earlier post

    Cheers

    Peter "the only dumb question is the one that wasn't asked"

    attached mail follows:


    ><clipped> >>>how about this curve... getting PHP to append a line to the apache log. >> >>How about reading the documentation? > >Deserved that for not being clear enough... see below.

    My apologies if I missed the word "access log" or even assumed you meant "error log" when you just said "log." I shouldn't have.

    You're right, you can't do that, without opening up security more than you want to.

    *ACTUALLY*...

    There *probably* is an Apache function for access logs just like the error logging one that PHP is using, and you could *PROBABLY* patch PHP with some dead-easy copy&paste to use it, and you could even submit that worthy patch to the PHP Group. I suspect it's not there only because nobody really saw a need for it.

    It's kinda icky that you'd almost have to use 4 (the next unused number) for "Apache access log" with 0 being "Apache error log" and 1,2,3 being other stuff between... Maybe -1 for "access log"? Ewwwww. That's not 'right' either, but maybe it's 'less wrong' than 4.

    Damn things shouldn't have been magic numbers in the first place. Should be constants. Hey, while you're in there, make up some decent constant names and let's migrate to them and then deprecate the magic numbers and fix it right :-)

    Another option might involve some sort of nasty named pipe stuff and redirection and whatnot, and you *MIGHT* be able to have a "file" that you error_log into, but it really just ends up going into the Apache log... There may be some risk of corrupting your access log, however, if any incredibly *HUGE* entry over-steps the atomicity threshold for file appending in Linux...

    Not so sure it's a Good Idea anyway to have two programs trying to write to the same file at once if it can be avoided.

    -- 
    Like Music?  http://l-i-e.com/artists.htm
    I'm looking for a PRO QUALITY two-input sound card supported by Linux (any
    major distro).  Need to record live events (mixed already) to stereo
    CD-quality.  Soundcard Recommendations?
    Software to handle the recording? Don't need fancy mixer stuff.  Zero (0)
    post-production time.  Just raw PCM/WAV/AIFF 16+ bit, 44.1KHz, Stereo
    audio-to-disk.
    

    attached mail follows:


    Worked on this a bit tonight, thought it might help someone out there! I looked at the bottomw of phpclasses.org at what they'd done to obfuscate their e-mail address using JavaScript. While theirs is much more complex, I couldn't figure a way to do it their way when you don't know the exact userdomain of people in your database. I thought this might do the trick, at least to some extent, by separating the user and domain in the source code and not put them together until the mailto: link is clicked. Sorry if something like this has been posted before - if so, here it is again! :)

    <script language="JavaScript"> <!-- <?php

    $email = "soljagci.net"; //replace with e-mail addy from db $new_email = explode("", $email); //separate into two sections based on the ""

    print "function hide_me()\n"; print "{\n"; print "var usr= '$new_email[0]';\n"; //the user of userdomain print "var dom= '$new_email[1]';\n"; //the domain of userdomain

    print "window.location=\"mailto:\"+usr+\"\"+dom;\n"; //print JS to recombine the parts print "}\n"; ?> //--!> </script> <a href="javascript:hide_me()">E-mail me</A>

    attached mail follows:


    I have started a session on the server, and now would like to add a user name and password, and some other information to the session to carry it across all the other pages that are in this session. Any hints on where to start?

    --- Philip J. Newman. PhilipNZ.com Design Solutions http://www.philipnz.com/ infophilipnz.com

    Mob: +64 (25) 6144012. Tele: +64 (25) 6144012.

    Personal Site: Philip J. Newman Internet Developer http://www.philipsdomain.com/ newmanpjphilipsdomain.com

    attached mail follows:


    In article <004c01c232d3$9a600ef0$0401a8c0philip>, phpphilipnz.com says... > I have started a session on the server, and now would like to add a user > name and password, and some other information to the session to carry it > across all the other pages that are in this session. Any hints on where to > start?

    session_register() ?

    Cheers

    -- 
    David Robley
    Temporary Kiwi!
    

    Quod subigo farinam

    attached mail follows:


    on 24/07/02 3:38 PM, David Robley (robleydparadise.net.nz) wrote:

    > In article <004c01c232d3$9a600ef0$0401a8c0philip>, phpphilipnz.com > says... >> I have started a session on the server, and now would like to add a user >> name and password, and some other information to the session to carry it >> across all the other pages that are in this session. Any hints on where to >> start? > > session_register() ?

    Or, if using PHP >= 4.1, $_SESSION['user'] = 'fred';

    You could've at least *tried looking* at the session pages

    Justin French

    attached mail follows:


    On 7/24/02 1:33 AM, "Philip J. Newman" <phpphilipnz.com> wrote:

    > I have started a session on the server, and now would like to add a user > name and password, and some other information to the session to carry it > across all the other pages that are in this session. Any hints on where to > start?

    $_SESSION['username'] = "philipn"; $_SESSION['password'] = $password;

    Etc.

    -- 
    Ed Marczak
    marczakusa.net
    

    attached mail follows:


    I have started a session on the server, and now would like to add a user name and password, and some other information to the session to carry it across all the other pages that are in this session. Any hints on where to start?

    ---
    Philip J. Newman.
    PhilipNZ.com Design Solutions
    http://www.philipnz.com/
    infophilipnz.com
    

    Mob: +64 (25) 6144012. Tele: +64 (25) 6144012.

    Personal Site: Philip J. Newman Internet Developer http://www.philipsdomain.com/ newmanpjphilipsdomain.com

    attached mail follows:


    so how would i get the $username and $password into the session

    session_register('$username','$password');

    ??

    ----- Original Message ----- From: "Wee Keat" <weekeatamorphosium.com> To: "Philip J. Newman" <newmanpjphilipnz.com> Sent: Wednesday, July 24, 2002 5:43 PM Subject: Re: [PHP] Newman and sessions.

    > I got this from the Internet... but could not remember from where... > > Have a look and see if this helps you... > > > ----- Original Message ----- > From: "Philip J. Newman" <newmanpjphilipnz.com> > To: <php-generallists.php.net> > Sent: Wednesday, July 24, 2002 3:30 PM > Subject: [PHP] Newman and sessions. > > > > I have started a session on the server, and now would like to add a user > > name and password, and some other information to the session to carry it > > across all the other pages that are in this session. Any hints on where > to > > start? > > > > --- > > Philip J. Newman. > > PhilipNZ.com Design Solutions > > http://www.philipnz.com/ > > infophilipnz.com > > > > Mob: +64 (25) 6144012. > > Tele: +64 (25) 6144012. > > > > Personal Site: > > Philip J. Newman > > Internet Developer > > http://www.philipsdomain.com/ > > newmanpjphilipsdomain.com > > > > > > > > > > -- > > PHP General Mailing List (http://www.php.net/) > > To unsubscribe, visit: http://www.php.net/unsub.php >

    attached mail follows:


    on 24/07/02 4:04 PM, Philip J. Newman (newmanpjphilipnz.com) wrote:

    > so how would i get the $username and $password into the session > > session_register('$username','$password');

    READ THE MANUAL!!!!

    php.net/session_register tells you EVERYTHING you need to know, including examples and user contributed notes.

    please try and research stuff before posting

    Justin French

    attached mail follows:


    Hi Gurus,

    I am using PHP 4.1.1, Postgresql 7.2 and Perl 5.6.0 on Linux.

    I want to delete files in a directory,which were created 15 days back.

    I can not do it, with PHP filesystem and directory functions, as PHP runs as "nobody" user.

    Can anybody pls. help me ?

    Thanking you all in anticipation.

    Regards

    Umesh. ***************************** Umesh A. Deshmukh. Manas Solutions Pvt. Ltd. umeshmanas-solutions.com http://www.manas-solutions.com Ph. : 91+020+4006358,4223991/92 *****************************

    attached mail follows:


    > I am using PHP 4.1.1, Postgresql 7.2 and Perl 5.6.0 on Linux. > > I want to delete files in a directory,which were created 15 days back. > > I can not do it, with PHP filesystem and directory functions, as > PHP runs as > "nobody" user.

    To delete a file the user running the web server needs to be able to write to the directory containing the file. Either the directory should be owned by the user nobody and writable by its owner, or in the group nobody and writable by group, or (the most dangerous choice) writable by any user. To change the ownership, you need to be able to log in as the user root.

    Simon

    Download my introduction to PHP for $25: http://merrowinternet.com/downloads?source=ml

    attached mail follows:


    Ok i have simple issue, i'm stuck at one point.

    I have a table "Clientdetails" which contains ClientID. I have created another table "Authentication" with 2 fields, "ClientID" and "Password".

    I want to pick up the ClientID from table "Clientdetails" and insert "ClientID" and a Password i have generated using a code, into "Authentication".

    So if there are 13000 ClientID's in "Clientdetails", as, many rows with the ClientID & it's corresponding password should be Inserted into table "Authentication".

    I'm using the following code which i know is wrong, what would be correct?

    <? $db = mysql_connect("localhost","user","pwd"); mysql_select_db("myDB",$db);

    $result = mysql_query("SELECT * FROM clientdetails",$db); if ($myrow = mysql_fetch_array($result)) { do {

    $some = $myrow[clientid] $newid = eregi_replace('100', '', $myrow[clientid]); $date = date("dn"); $stuff = $newid.def.$date;

    $sql = "INSERT INTO authentication VALUES('$some','$stuff')"; $result = mysql_query($sql); echo "All Done!";

    } while ($myrow = mysql_fetch_array($result)); }

    ?>

    Thanks, T. Edison Jr.

    __________________________________________________ Do You Yahoo!? Yahoo! Health - Feel better, live better http://health.yahoo.com

    attached mail follows:


    I don't see why your code is so wrong .... but neither do I see what it reall does. YOu are changing the clientID with some simple function into a password? As in everybody can do that trick by himself and login as whoever he wants ..

    What I'll mostly do for such things, is use this self written function to generate a random string and use this as generated password. it takes an integer as argument, and gives back a random code with only [A-Z][a-z] characters of a length of the given argument.

    And then, I'd just use the loop to roll through the ID's and insert a random code password.

    function generateRandomString($length) { srand ((float) microtime() * 1000000); for ($i=65;$i<91;$i++) { $chars[] = chr($i); }; for ($i=97;$i<122;$i++) { $chars[] = chr($i); }; $chrs = count($chars) - 1; for ($i=0; $i<$length; $i++) { $asc = rand(0, $chrs); $code .= $chars[$asc]; }; return $code; };

    $result = mysql_query("SELECT clientid FROM Clientdetails"); while ($myrow = mysql_fetch_assoc($result)) { $code = generateRandomString(8); mysql_query("INSERT INTO authentication (id, pass) VALUES ($myrow[clientid], '".$code."'"); };

    Hope this helped you !

    Greetz, Wouter

    -----Oorspronkelijk bericht----- Van: Thomas Edison Jr. [mailto:thomasedisonjryahoo.com] Verzonden: woensdag 24 juli 2002 9:02 Aan: php-generallists.php.net Onderwerp: [PHP] Inserting Processed Data from One Table 2 Another!

    Ok i have simple issue, i'm stuck at one point.

    I have a table "Clientdetails" which contains ClientID. I have created another table "Authentication" with 2 fields, "ClientID" and "Password".

    I want to pick up the ClientID from table "Clientdetails" and insert "ClientID" and a Password i have generated using a code, into "Authentication".

    So if there are 13000 ClientID's in "Clientdetails", as, many rows with the ClientID & it's corresponding password should be Inserted into table "Authentication".

    I'm using the following code which i know is wrong, what would be correct?

    <? $db = mysql_connect("localhost","user","pwd"); mysql_select_db("myDB",$db);

    $result = mysql_query("SELECT * FROM clientdetails",$db); if ($myrow = mysql_fetch_array($result)) { do {

    $some = $myrow[clientid] $newid = eregi_replace('100', '', $myrow[clientid]); $date = date("dn"); $stuff = $newid.def.$date;

    $sql = "INSERT INTO authentication VALUES('$some','$stuff')"; $result = mysql_query($sql); echo "All Done!";

    } while ($myrow = mysql_fetch_array($result)); }

    ?>

    Thanks, T. Edison Jr.

    __________________________________________________ Do You Yahoo!? Yahoo! Health - Feel better, live better http://health.yahoo.com

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

    attached mail follows:


    Thanks!

    attached mail follows:


    I'm currently developing a Remote CMS for a site.

    I'm working on the image upload and want to create a smaller thumbnail type image (thought >200x>180 instead of >50x>50) I know I'm going to need either imagecopyresize() or imagecopyresample(). I don't know which would be better for this purpose or what the main difference is in terms of quality and run time. Any comments or assistance is gladly welcome.

    Thank you in advance for your time,

    Nicholas D. Mercier

    attached mail follows:


    On Wednesday 24 July 2002 15:48, Nicholas Mercier wrote: > I'm currently developing a Remote CMS for a site. > > I'm working on the image upload and want to create a smaller thumbnail type > image (thought >200x>180 instead of >50x>50) > I know I'm going to need either imagecopyresize() or imagecopyresample(). I > don't know which would be better for this purpose or what the main > difference is in terms of quality and run time. Any comments or assistance > is gladly welcome.

    imagecopyresample() gives better results but probably takes a tad longer to perform. Presumably your thumbnails will be produced on a one-off basis (ie not generated on-the-fly each time it is needed) so the extra time taken by using imagecopyresample() is more than made up for by the better quality.

    Of course the best thing is to try both and see which is better for your needs.

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

    /* Did you know that if you took all the economists in the world and lined them up end to end, they'd still point in the wrong direction? */

    attached mail follows:


    i am using dreamweaver mx and want to acheive the following

    9:00 task 1 9:30 task 2 10:00 task 3 task 4 task 5 10:30 task 6

    i have a recordset that displays the tasks ordered by the time but what i dont want is to display the time for every item, or if an entry is at 10:15 for example.

    Any ideas???

    Craig

    attached mail follows:


    I have a user authentication system using sessions it checks username and password against a database. if correct it sets a variable in the session cookie (via $_SESSION) and redirects to the protected page which checks for that variable. if the user/pass is wrong it redirects to an error page. if it gets to the protected page and the variable isnt set it redirects back to the login page.

    it works when uploaded to a server Linux, Apache/1.3.24, PHP 4.1.2. register_globals=on

    but on my local server Windows NT, Apache/2.0.39, PHP 4.2.1 using a patched Apache 2.0 Filter, register_globals=on. It seems to redirect back to the login page.

    thanks

    attached mail follows:


    Hi!

    Could someone help me with a replace that takes all occurances of " ", that is space more than one, and replaces them with ""…?

    Sincerely

    Victor

    attached mail follows:


    $new = preg_replace('/[ ]{2,}/',""$old);

    HTH Andrey

    ----- Original Message ----- From: "Victor Spång Arthursson" <scooterbabemac.com> To: <php-generallists.php.net> Sent: Wednesday, July 24, 2002 12:05 PM Subject: [PHP] trim away x > 1 number of spaces from a strin

    Hi!

    Could someone help me with a replace that takes all occurances of " ", that is space more than one, and replaces them with ""…?

    Sincerely

    Victor

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

    attached mail follows:


    php.net/str_replace

    On Wednesday 24 July 2002 02:05 am, Victor Spång Arthursson wrote: > Hi! > > Could someone help me with a replace that takes all occurances of " ", > that is space more than one, and replaces them with ""…? > > Sincerely > > Victor

    -- 
    Go to Heaven for the climate, Hell for the company.
    

    Samuel Clemens

    attached mail follows:


    I've currently made a signature uploader.

    I know the code that shows a drectory's contents but whats the code to delete something?

    - Dale

    attached mail follows:


    unlink()

    Dale wrote:

    >I've currently made a signature uploader. > >I know the code that shows a drectory's contents but whats the code to >delete something? > > - Dale > > > > >

    attached mail follows:


    Hmmm, interesting.... I didn't know about this and didn't see it in the docs. So now I know for my next upgrade.

    Anyway, my upgrade is in, and through the mails it should be clear to those who thought how terribly difficult and time consuming it is/was to do the upgrades that it was in fact not difficult at all, and seemingly even easier that the way I did it.

    Ian

    On Wednesday 24 July 2002 01:03, Andrew Chase wrote: > If all you're doing is applying the patch (not adding/removing any > extensions), you should be able to use > > ./config.nice > > which will use all of the configuration commands from your last compile > (This is an extremely handy thing if your GD/Freetype setup was > particularly ornery the first time around! ;) ) > > -Andy > > > -----Original Message----- > > From: Ricky Dhatt [mailto:rickyelectricarrow.com] > > > > ./configure --with-mysql --with-apxs=/usr/local/apache/bin/apxs > > --with-ldap > > > > > make > > > make install > > > /usr/local/apache/bin/apachectl restart > > > > Hmm...is the configure step really necessary?

    attached mail follows:


    Whats the difference between 'mysql_db_query' and 'mysql_query'?

    attached mail follows:


    mysql_db_query has been depreciated since PHP 4.0.6

    ctan wrote: > ************************************************************************** > This Message Was Virus Checked With : SAVI 3.59 May 2002 > Last Updated 8th July 2002 > ************************************************************************** > > Whats the difference between 'mysql_db_query' and 'mysql_query'? >

    -- 
    ----------------------
      www.curvedvision.com
    ----------------------
    

    attached mail follows:


    Neil Freeman wrote: > mysql_db_query has been depreciated since PHP 4.0.6 >

    Yep.. but thats not the only different...

    mysql_db_query() have an extra parameter that is what Database you want to execute your query in...

    mysql_query() just use the database you have selected with f.ex. mysql_select_db()

    But do NOT use mysql_db_query...

    Regards,

    Johan

    attached mail follows:


    Hewwo all,

    (please be so kind as to CC me in replies as I am not a subscriber to this mailing list (yet))

    The following code snippet always outputs "You have visited this page 1 times!". What am I doing wrong?

    " <?php

    session_start();

    if (!isset($HTTP_SESSION_VARS['counter'])) { $HTTP_SESSION_VARS['counter'] = 1; } else { $HTTP_SESSION_VARS['counter']++; }

    echo(sprintf("You have visited this page %d times!", $HTTP_SESSION_VARS['counter']));

    ?> "

    I realise I could use $_SESSION, and I actually prefer it, but I have to write code that will run on 4.0.6.

    Versions and the like: PHP 4.2.2 Apache/1.3.26 (Unix) Debian GNU/Linux

    All this on Linux ppc (benh kernel) 2.4.19

    Thanks in advance,

    -- 
    Alexander Deruwe
    AQS-CarControl
    

    attached mail follows:


    Hello

    Newbie here that can't seem to find a workaround for the following problem.

    I am running Apache on a Mac OS X.1

    When I try to start up, I receive the following error:

    Multiple definitions of symbol _XML_DefaultCurrent

    All of this started right after I installed php4. I have installed php on a windows machine and it's running fine, so I know it has to be something that I have screwed up somewhere.

    I have checked the error log finding it empty. I have tried to start from the "sharing" control in the system preferences and it still won't start.

    Any help would be appreciated.

    Steve Campbell OU Physicians

    attached mail follows:


    Here's how to get it to work (thanks to somebody on Google Groups)...

    1. Open up the file php_functions.c in /sapi/apache2filter/ 2. Change MODULE_MAGIC_AT_LEAST to AP_MODULE_MAGIC_AT_LEAST (Note the addition of "AP_") 3. Save the php_functions.c file and try running configure again

    Keep in mind this is experimental and thus should not be used on production web sites (even though we've been using Apache 2.0.39+PHP 4.2.1/4.2.2 for a few weeks without issues on two of our servers).

    --
    Aaron Gould
    agouldpartscanada.com
    Web Developer
    

    ----- Original Message ----- From: "Osman Omar" <osmansem.my.sony.com.sg> To: "PHP" <php-generallists.php.net> Sent: Tuesday, July 23, 2002 8:35 PM Subject: [PHP] Compiling PHP on Linux

    > Hi > > I try to compile php and got error message > any idea? > > > system: > Redhat 7.2 > Apache 2.0.39 (for redhat 7.0 from apache website) > php 4.2.2 > > error messages > --- > /bin/sh /usr/tmp/php-4.2.2/libtool --silent --mode=compile gcc -I. > -I/usr/tmp/php-4.2.2/sapi/apache2filter -I/usr/tmp/php-4.2.2/main > -I/usr/tmp/php-4.2.2 -I/usr/local/apache2-39/include > -I/usr/tmp/php-4.2.2/Zend -I/usr/include/freetype2/freetype > -I/usr/tmp/gd-2.0.1/ -I/usr/tmp/php-4.2.2/ext/mysql/libmysql > -I/usr/tmp/php-4.2.2/ext/xml/expat -D_REENTRANT > -I/usr/tmp/php-4.2.2/TSRM -DTHREAD=1 -g -O2 -pthread -DZTS -prefer-pic > -c php_functions.c > php_functions.c:93:27: missing binary operator before '!' > make[3]: *** [php_functions.lo] Error 1 > make[3]: Leaving directory `/var/tmp/php-4.2.2/sapi/apache2filter' > make[2]: *** [all-recursive] Error 1 > make[2]: Leaving directory `/var/tmp/php-4.2.2/sapi/apache2filter' > make[1]: *** [all-recursive] Error 1 > make[1]: Leaving directory `/var/tmp/php-4.2.2/sapi' > make: *** [all-recursive] Error 1 > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php

    attached mail follows:


    Is it possible to create an object from a clas which name is in a variable.

    Example: (doesn't work) $object = new ${$classname};

    attached mail follows:


    Thx for quick reply,

    If I use the following: $object = new {classname};

    I get this a parse error: Parse error: parse error, expecting `T_STRING' or `T_VARIABLE' or `'$'' in /home/sites/projects.virtuosys.nl/web/cm/includes/class_crm.inc.php on line 29

    From that I conclude that with this method its not possible to create an object from a variable class name

    Michiel ten Hagen mtenhagenvirtuosys.nl 06-54673863

    -----Oorspronkelijk bericht----- Van: Mathieu Dumoulin [mailto:mdumoulingroupimage.com] Verzonden: Wednesday, July 24, 2002 3:11 PM Aan: mtenhagenvirtuosys.nl Onderwerp: Re: create object from variable class.

    Simple, you made an error here You are telling the new operator to look into a variable to get the classname, to specify the class name as a string do this:

    $object = new {$classname};

    InsaneCoder

    Ps: I never tried this, but I think it is actually going to work, you got nthing to lose anyway I guess, takes two seconds to try.

    "Karel De Groot" <mtenhagenvirtuosys.nl> wrote in message news:<20020724130121.64455.qmailpb1.pair.com>... > Is it possible to create an object from a clas which name is in a > variable. > > Example: (doesn't work) > $object = new ${$classname}; > > > >