|
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: Tue Jul 23 2002 - 20:09:19 CDT
php-general Digest 24 Jul 2002 01:09:19 -0000 Issue 1482
Topics (messages 109074 through 109181):
Script Testing Portal Connections...
109074 by: Kondwani Spike Mkandawire
109110 by: Michael Sweeney
109114 by: Kondwani Spike Mkandawire
Re: array_rand() and seed
109075 by: Naintara Jain
109077 by: Dan Hardiker
Re: PHP Security Advisory: Vulnerability in PHP versions 4.2.0 and 4.2.1
109076 by: Dan Hardiker
109112 by: Peter
Re: Comma question
109078 by: Joel Boonstra
109150 by: Richard Lynch
Where to set return-path for virtualhosts
109079 by: Joseph Koenig
Re: Pine config
109080 by: Joel Boonstra
need some help on stratagy... (php/mysql/javascript)
109081 by: Alexander Ross
control structure question
109082 by: Javier Montserat
109083 by: Martin Clifford
109085 by: Javier Montserat
PHP 4.2.2 install woe: cannot stat libs/libphp.so
109084 by: Reuben D. Budiardja
php benchmarking suite
109086 by: George Schlossnagle
Using PHP with MySQL - Can I supress MySQL errors?
109087 by: DonPro
109089 by: Justin French
109092 by: Tim Fountain
109097 by: Martin Clifford
Re: OO Programming - get practical
109088 by: Lee Doolan
109094 by: Mathieu Dumoulin
XML vs. PHP manual???
109090 by: Scott Fletcher
109095 by: Analysis & Solutions
109102 by: Scott Fletcher
Re: PHP Security Advisory: Vulnerability in PHP versions 4.2.0
109091 by: Scott Fletcher
109099 by: Scott Fletcher
109107 by: Matt Schroebel
109159 by: Ricky Dhatt
109164 by: Andrew Chase
Re: sessions
109093 by: Jas
Re: [ANNOUNCE] PHP Security Advisory: Vulnerability in PHP versions 4.2.0 and4.2.1
109096 by: Scott Fletcher
109104 by: Jason Wong
How to patch PHP 4.2.2 to PHP 4.2.1?
109098 by: Scott Fletcher
suscribe
109100 by: Tiempos de Nicaragua SA
Apache 2 support broken?
109101 by: Mitch Vincent
109126 by: Aaron Gould
Help installing Apache please
109103 by: Varsha Agarwal
109105 by: Jason Wong
PHP OOP list
109106 by: Mathieu Dumoulin
109108 by: Vail, Warren
109152 by: Manuel Lemos
Oracle persistent connection limit
109109 by: Eric Thelin
109116 by: Thies C. Arntzen
109119 by: Eric Thelin
Credit card checks?
109111 by: Jas
109113 by: Richard Baskett
109118 by: Jas
109120 by: Kristopher Yates
109122 by: Jas
109123 by: Mathieu Dumoulin
109127 by: Kristopher Yates
109128 by: Richard Baskett
109129 by: Jaime Bozza
109134 by: Lee Doolan
109176 by: Mark McCulligh
109179 by: Martin Towell
109180 by: Mark McCulligh
Re: does this mean ....
109115 by: Michael Sweeney
Filename is nothing
109117 by: Liam Gibbs
109121 by: Mathieu Dumoulin
109161 by: Liam Gibbs
Certificate information using php?
109124 by: Scott Fletcher
secure sockets
109125 by: Josh Levine
109146 by: Patrick Lynch
109171 by: Josh Levine
109172 by: Peter
109175 by: Evan Nemerson
109181 by: Josh Levine
Object problem
109130 by: Mathieu Dumoulin
parsing
109131 by: Dave at Sinewaves.net
109132 by: Peter
109136 by: Lee Doolan
109137 by: Kevin Stone
109140 by: Kevin Stone
Re: COM(CDO.Message)HTML vs TEXT
109133 by: Shane
Re: COM(CDO.Message)(SOLVED!!!)
109135 by: Shane
Re: imagecolortransparent()
109138 by: Nick
Re: Drop Down Box Question
109139 by: Jason Stechschulte
PHP creating table for HTML layout
109141 by: Briggsy
109142 by: Martin Clifford
109147 by: Vail, Warren
Getting the day if given a date
109143 by: Cirkit Braker
109144 by: Jason Stechschulte
109145 by: Reuben D. Budiardja
109156 by: Kevin Stone
Re: MySQL - PHP combined log
109148 by: Richard Lynch
109149 by: Richard Lynch
109155 by: Dave [Hawk-Systems]
Re: can there be a fax gateway?
109151 by: Briggsy
MySQL equivalent to append?
109153 by: Shane
109163 by: Jason Morehouse
PHP 4.2.2 release problems
109154 by: Daniel Thompson
109158 by: Jason Reid
Errors with 4.2.2
109157 by: Brian Paulson
What is a mysql link ressource
109160 by: Mathieu Dumoulin
Newbie: Reading unix directory information from PHP
109162 by: Paul Oh
109166 by: Jason Soza
109167 by: Peter
109169 by: Peter
GD Library for Windows
109165 by: Jadiel Flores
109170 by: Peter
Sorting db entries by Year-Month
109168 by: Andre Dubuc
109177 by: Evan Nemerson
109178 by: Andre Dubuc
Re: Formating datevariables...
109173 by: Ragnar
Compiling PHP on Linux
109174 by: Osman Omar
Administrivia:
To subscribe to the digest, e-mail:
php-general-digest-subscribe
lists.php.net
To unsubscribe from the digest, e-mail:
php-general-digest-unsubscribe
lists.php.net
To post to the list, e-mail:
php-general
lists.php.net
----------------------------------------------------------------------
attached mail follows:
I am trying to test a Script which I got online and
will modify later (its from devshed)... It fails to set
up a connection...
#!/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";
// 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";
attached mail follows:
Um...did you happen to modify this to have a valid IP address or host
name for $host and a valid port number for $port? It would also help to
have a valid path for $command that is going to talk to a daemon on the
port you specify (ie. making a connection to port 80 and asking for
/usr/games/fortune is not to going to get you far). If you have made
those modifications and it's still failing, some information about what
actually happens in the failure might be helpful.
..mike..
On Tue, 2002-07-23 at 06:10, Kondwani Spike Mkandawire wrote:
> I am trying to test a Script which I got online and
> will modify later (its from devshed)... It fails to set
> up a connection...
>
> #!/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";
>
> // 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";
>
>
>
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
attached mail follows:
"Michael Sweeney" <sweeney
verisity.com> wrote in message
news:1027447470.3349.28.camel
catalyst...
> Um...did you happen to modify this to have a valid IP address or host
> name for $host and a valid port number for $port? It would also help to
*Obviously* I modified it to be tested at a valid host and address the
IP address I have used for this post a dummy address in this post...
Obviously
I am not going to post a valid IP number from the Work Station on
which I am working on due to security issues... I am obviously not
going to test an IP number "1.2.3.4"
> have a valid path for $command that is going to talk to a daemon on the
> port you specify (ie. making a connection to port 80 and asking for
> /usr/games/fortune is not to going to get you far). If you have made
> those modifications and it's still failing, some information about what
> actually happens in the failure might be helpful.
It dies i.e it executes the die statement: "SetUp Failed!" as shown
in the code... I have got an accept statement after it but if its not
reaching this satement there was no point in posting it up...
Thanks for the response though...
Spike...
>
> ..mike..
>
> On Tue, 2002-07-23 at 06:10, Kondwani Spike Mkandawire wrote:
> > I am trying to test a Script which I got online and
> > will modify later (its from devshed)... It fails to set
> > up a connection...
> >
> > #!/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";
> >
> > // 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";
> >
> >
> >
> >
> >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
>
>
attached mail follows:
First I seed the generator with
mt_srand ((double) microtime() * 1000000);
-----Original Message-----
From: php-general-return-109073-naintara=del6.vsnl.net.in
lists.php.net
[mailto:php-general-return-109073-naintara=del6.vsnl.net.in
lists.php.ne
t]On Behalf Of Naintara Jain
Sent: Tuesday, July 23, 2002 6:36 PM
To: Php-General
Lists. Php. Net
Subject: [PHP] array_rand() and seed
Using Win2K Professional Server, IIS
PHP Version 4.2.1
mt_getrandmax() returned 2147483647
I have an array of 26 characters. I want three random values from the array,
I use the following:
$rand_al = array_rand ($arralpha, 3);
I get the same characters each and every time.
The way I am handling it right now is generating random values using
mt_rand(0,25)
and using those random values as the index of the array to retrieve the
value of.
Any ideas on this?
Thanks.
Naintara
attached mail follows:
Have you seeded the random generator?
Read up on srand and mt_srand.
- Dan
> Using Win2K Professional Server, IIS
> PHP Version 4.2.1
>
> mt_getrandmax() returned 2147483647
> I have an array of 26 characters. I want three random values from the
> array, I use the following:
> $rand_al = array_rand ($arralpha, 3);
>
> I get the same characters each and every time.
> The way I am handling it right now is generating random values using
> mt_rand(0,25)
> and using those random values as the index of the array to retrieve the
> value of.
>
> Any ideas on this?
>
> Thanks.
> Naintara
-- Dan Hardiker [dhardikerstaff.firstcreative.net] ADAM Software & Systems Engineer First Creative Ltd
attached mail follows:
Hi,
1. Every peice of software has bugs - PHP still bugs - it always will have. Deal with it.
2. It is no-one's responsibility other than your own to *test the software*. Anyone using any form of software in a production environment has at least one test bed to install new versions of software on to test for security.
3. You dont have to upgrade! You should, but you dont have to... its down to the system administrator to assess the need.
4. If your software requires register_globals to be set "On" in the php.ini then your software is badly coded and quite possiblty insecure in its own nature.
5. At the end of the day, we arent choosing YOU to use PHP... you chose PHP for your own reasons. If you dont like it - Microsoft will be happy to take chunks of money off your hands for a Win2k Server with IIS and ASP on it.
The grass it always greener huh.
- Dan
>> Who said anything about M$? I don't use their crappy products so I
>> don't have to deal with their security issues.
>
> I'm the one who brought up Microsoft, I'm saying it's a whole lot better
> then the alternatives.
>
>> If PHP 4.2 is unsafe then why is it listed at the top of the page for
>> download? There is not a shread of text saying do not use in
>> production, no unsafe warnings whatsoever. How am I supposed to
>> magically find the 'do not use' warnings?
>
> You have to magically find this by reading the messages on this list,
> not more then a month ago, someone asked was it considered stable for
> production use, and the answer was no. I was going to type a long rant
> about how you should test software or atleast wait a while for the kinks
> to be worked out of new versions instead of running cutting edge, but
> screw it, I'm not wasting any more time on this.
>
>> It's not about that.. It's about the hell I've already been through
>> with the new register_globals setting. Then two huge ass security
>> holes following in the next couple of months after that.
>
> I know, there such bastards for releasing security patches to fix the
> holes they know about instead of burrying the evidence and denying a
> hole exists.
>
>> If it doesn't bother you the hassles 'the php group' is putting me,
>> you, and alot of others through then I guess that's just you. I
>> can't help but get pissed about it. I did not have the time to do
>> these upgrades, but now I have to make time.
>
> You know your right, the PHP group (god bless them) is out to get you,
> individually, they intentionally put security holes into the software,
> so they can go back later and make you patch your "dozens of systems"
> and make your life a living hell. And it's not just me who doesn't mind
> upgrading, it's just you who can't handle it.
>
> Adam Voigt
> adam.voigt
cryptocomm.com
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
-- Dan Hardiker [dhardikerstaff.firstcreative.net] ADAM Software & Systems Engineer First Creative Ltd
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!
"Justin French" <justin
indent.com.au> wrote in message
news:B963167B.B11D%justin
indent.com.au...
> Greg,
>
> Your attitude stinks.
>
> PHP is a FREE scripting language. Think about the amount of money you are
> probably charging hosting clients, or charging in web or programming
> services, or making in site revenue, or whatever way you 'commercially
> function' through PHP.
>
> The register globals 'imposition' IS more secure and encourages better
> coding practices... would you prefer they made the change now, or in 5
years
> when you have 100's more sites to fix. Better late than later.
>
>
> If you want something that will never have a bug, never have a security
> hole, performs perfectly from day 1, never has an upgrade/change, and will
> never change for the better, you are utterly dreaming!
>
> The difference in this case is that the PHP Group aren't emptying your
> wallet.
>
>
> Sorry to hear that you'll have to do some more upgrading, but I'd keep the
> complaining to yourself -- "you get what you pay for" springs to mind, but
> in the case of PHP, we get a whole lot more.
>
>
> Justin French
>
>
>
>
>
>
>
>
>
> on 23/07/02 2:55 AM, Greg Donald (greg
destiney.com) wrote:
>
> > Not only did I get to re-write all my apps the past few months because
of
> > the new register_globals default that was imposed by `the php group`...
> >
> > Now I get to upgrade my PHP install once a month or so cause of new
> > security holes.. Yay!
> >
> > Wasn't this new register_globals setting supposed to enhance security?
> >
> > How would you like to be a sys admin with dozens of machines to upgrade
> > before you can proceed with anythign else?
> >
> > Can anyone say Ruby?
> >
>
attached mail follows:
Richard,
<snip> > This Programmer has actually read the Documentation and believed the > warnings that some day just plain old $strName might not be enough.
Where might these warnings be? I just perused this URL:
http://www.php.net/manual/en/language.types.string.php
especially where it talks about the {} syntax, but I see no such warnings of future deprecation. I also followed a provided link here:
http://www.zend.com/zend/tut/using-strings.php
but that also doesn't mention this warning. Is this in fact syntax that will no longer work in some future version? If so, I'll start using {} everywhere I embed variables in strings, but I was unaware that stuff like this:
"This is a $variable embedded in a string"
might no longer work. If you have URLs, I'd love to read up on this.
Thanks!
-- [ joel boonstra | jboonstragospelcom.net ]
attached mail follows:
>> This Programmer has actually read the Documentation and believed the >> warnings that some day just plain old $strName might not be enough. > >Where might these warnings be? I just perused this URL: > > http://www.php.net/manual/en/language.types.string.php > >especially where it talks about the {} syntax, but I see no such >warnings of future deprecation. I also followed a provided link here: > > http://www.zend.com/zend/tut/using-strings.php > >but that also doesn't mention this warning. Is this in fact syntax that >will no longer work in some future version? If so, I'll start using {} >everywhere I embed variables in strings, but I was unaware that stuff >like this: > > "This is a $variable embedded in a string" > >might no longer work. If you have URLs, I'd love to read up on this.
My bad.
It's the square brackets for an array that is deprecated.
http://www.php.net/manual/en/language.types.string.php
Right before Example 7-3.
I haven't quite got the hang of using {} inside of strings yet... It just looks so ugly :-)
-- Like Music? http://l-i-e.com/artists.htm
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 address
domain.com"
Can anyone give me a hint? Please CC me as I am not currently subscribed. Thanks,
Joe
attached mail follows:
[ straying even more off-topic... ]
> It's doing this as a favor to you. If it displayed the "From" you'd know > less about the message than you know this way.
I replied to Michael off-list, but since this popped up again...
Pine uses a value called 'index-format' (configurable in the main config screen) to determine how and what to display for your email. Each piece of information (date, subject, author, etc...) that shows up in your index is represented by a 'token'. Pine has a stock set of tokens that it uses, but you can change the format to appear however you want.
The default token is 'FROMORTO', which displays the 'from' address, unless 'From' is one of your own addresses (defined in pine's "alt-addresses" list); then it displays the 'To' value. To change this, simply define your own index-format, and use the 'FROM' token instead of 'FROMORTO'.
More info is available by going to Pine's config screen (m, s, c), searching for 'index-format' (w index-format <enter>), and hitting CTRL-G to bring up the help.
HTH!
-- [ joel boonstra | jboonstragospelcom.net ]
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.
Thanks
Alex Ross
alexross
bleen.net
attached mail follows:
is there a more programmatically elegant way of saying...
$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
attached mail follows:
For steps and sequences, I always use switches. Most commonly associated with the "action" variable, it would look like this:
switch($action) { default: // what to show if no variable exists, or is set to a value // that is not acceptable below break; case "add_file": // what to do in the even that a file needs to be added // to the database. break; case "remove_file": // what to do in the even that a file need sto be removed // from the database. break; }
Basically, whatever the value of $action, that is what section of code will execute. Hope that helps!
Martin Clifford Homepage: http://www.completesource.net Developer's Forums: http://www.completesource.net/forums/
>>> "Javier Montserat" <codareef
hotmail.com> 07/23/02 10:03AM >>>
is there a more programmatically elegant way of saying...
$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
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
attached mail follows:
So refering back, i re-wrote the original example using the switch syntax...
switch (true) { case doStep1(): case doStep2(): case doStep3(): error(); break; default: valid(); }
Each case expressions is evaluated, until one of them evaluates to a value equal (==) to the switch expression (in this case a boolean error flag).
The error() code will only be called if one of the doStep() evaluates to false.
And the valid() code will only be evaluated if the switch reached the default, which means that none of the above check returned false
I think for this example the switch syntax is more elegant than using a series of if() statements.
Thanks, Javier
>For steps and sequences, I always use switches. Most commonly associated
>with the "action" variable, it would look like this:
>
>switch($action) {
> default:
> // what to show if no variable exists, or is set to a value
> // that is not acceptable below
> break;
> case "add_file":
> // what to do in the even that a file needs to be added
> // to the database.
> break;
> case "remove_file":
> // what to do in the even that a file need sto be removed
> // from the database.
> break;
>}
>
>Basically, whatever the value of $action, that is what section of code will
>execute. Hope that helps!
>
>Martin Clifford
>Homepage: http://www.completesource.net
>Developer's Forums: http://www.completesource.net/forums/
>
>
> >>> "Javier Montserat" <codareef
hotmail.com> 07/23/02 10:03AM >>>
>is there a more programmatically elegant way of saying...
>
>$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
>
>
>--
>PHP General Mailing List (http://www.php.net/)
>To unsubscribe, visit: http://www.php.net/unsub.php
>
>
_________________________________________________________________ Chat with friends online, try MSN Messenger: http://messenger.msn.com
attached mail follows:
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
attached mail follows:
Is anyone aware of a php benchmarking suite comparable in functionality to perls Benchmark.pm?
// George Schlossnagle
// Principal Consultant
// OmniTI, Inc http://www.omniti.com
// (c) 240.460.5234 (e) george
omniti.com
// 1024D/1100A5A0 1370 F70A 9365 96C9 2F5E 56C2 B2B9 262F 1100 A5A0
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?
Thanks, Don
attached mail follows:
You can suppress the error messages of ANY function by placing an
in front
of the function call:
mysql_connect('blah')
$result =
mysql_query($sql);
etc etc
Justin French
on 24/07/02 2:08 AM, DonPro (donpro
lclcan.com) wrote:
> 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? > > Thanks, > Don > >
attached mail follows:
On Tuesday, July 23, 2002, DonPro wrote:
> I've noticed that it there is an error performing certain commands > like 'mysql_connect()'
> 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.
Assuming I understand you correctly, to surpress errors from PHP
functions simply put an '
' symbol before the function. This will
surpress the error message from PHP but will still execute your 'or'
statement, storing the message in your array, e.g.:
$result =
mysql_connect('blah','blah','blah') or
some_error_function();
or I guess you could also do:
$result =
mysql_connect('blah','blah','blah');
if (!$result)
{
$error_array[] = mysql_error();
...
}
-- Tim Fountain (timtfountain.co.uk) http://www.tfountain.co.uk/
attached mail follows:
Put an ampersat symbol (
) in front of the function name to suppress errors.
$link =
mysql_connect("host", "user", "pass");
Martin Clifford Homepage: http://www.completesource.net Developer's Forums: http://www.completesource.net/forums/
>>> "DonPro" <donpro
lclcan.com> 07/23/02 12:08PM >>>
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?
Thanks, Don
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
attached mail follows:
>>>>> "Paul" == Paul Dionne <PDionne
Speakeasy.net> writes:
[. . .]
Paul> So, I guess my point is that if people want to encourage use Paul> of OO programming, they need to use more examples in their Paul> books instead of what is "easy."
[. . .]
then again there is the time honored tradition of reading code. this is really not as hard as it seems. may i recommend this link?
http://phpclasses.optip.com/browse.html/browse.html
i'm sure that if you look around, you can find others. php is everywhere.
-- When the birdcage is open, | donate to causes I care about: the selfish bird flies away, | http://svcs.affero.net/rm.php?r=leed_25 but the virtuous one stays. |
attached mail follows:
If i can suggest...
I'm working on a project for the Quebec Junior Major Hockey league and i found out that objects can be quite usefull in a large scale web application like this one.
What i am doing is an object that connects to the database and stores pertinent information into it. Also, i have other objects called collections which read from the database in an uniform way. My junior programmers here don't understand the basics of OOP but they do like it, because it simplifies their work. They just need to know the object methods and properties, how to use it and they do. They don't even have to do complex request to the database anymore, all my objects do it for them.
My point is, OOP is great and it INDEED should be pushed much much more into our common day programming of anything, should it be webapps or normal executables.
If anyone is interested in developping a package of classes that could greatly benefit SQL Reading/Writting and Data manipulation i'd be ready to invest some time into it with other people so we can create a completly standalone reader/writter class for any situation, table and fields. That would be great.
(BTW, i'm on php4 and mysql, but welcome to new technologies like Orable<->php and ODBC<->php)
Insane Coder (Or almost insane =P)
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??
Thanks, FletchSOD
P.S. Is there a good XML / PHP manual for that?
attached mail follows:
On Tue, Jul 23, 2002 at 12:33:19PM -0400, Scott Fletcher wrote: > I read the useful document about XML in PHP on > http://www.analysisandsolutions.com/code/phpxml.html.
Thanks. But, you mean:
http://www.analysisandsolutions.com/code/phpxml.htm
> 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.
Programs do what you tell them to do. If you write something on the client and then tell it to get data from (or send data to) the credit bureau, why would you expect it to communicate with your server?
If you want it to send/receive from your server, then you need to tell the program to do that.
Also, PHP is a server side language, so, if you wrote something client side, what language did you write it in and you might be better off asking on a list for that language.
> 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??
Sure. Make an HTML form on your server where users type in the input.
You need to then design a script that handles the data the users submit. I don't know how you want the data formatted nor how data gets submitted to your credit bureau, so I can't state anything specific on the remaining steps.
Anyway, when you're writing your HTML form in the first step, the action attribute in the <form> tag should lead to that second script you made.
--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:
Ha ha, I'm so used to "html" instead of "htm". :-)
It have been my thought that I write a script as a post method to send data to the server then have hte PHP webserver do the dirty work. I haven't figure out how to get PHP to put in the xml stuffs into the data and send it to the credit bureau. The documentation said the data need to be in XML format when sending and receiving the data. Before, I use the serial stream of data with the format setting according to the guideline in the manual I got from the credit bureau.
Well, we don't want the customer to access that credit bureau site since they aren't a programmer, just somebody who want to see the inquiries. Lots of them don't know how to use SSLs. It doesn't seem to be a good idea to create a software and give it to the customers. Also, throught the server can I be able to tell if the data is a hit or not a hit, whether the add-on stuffs being used or not, etc. The person name in the inquiry, all together, would I be able to put into the database for billing purpose.
FletchSOD
"Analysis & Solutions" <danielc
analysisandsolutions.com> wrote in message
news:20020723165451.GA25064
panix.com...
> On Tue, Jul 23, 2002 at 12:33:19PM -0400, Scott Fletcher wrote:
> > I read the useful document about XML in PHP on
> > http://www.analysisandsolutions.com/code/phpxml.html.
>
> Thanks. But, you mean:
>
> http://www.analysisandsolutions.com/code/phpxml.htm
>
>
> > 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.
>
> Programs do what you tell them to do. If you write something on the
> client and then tell it to get data from (or send data to) the credit
> bureau, why would you expect it to communicate with your server?
>
> If you want it to send/receive from your server, then you need to tell the
> program to do that.
>
> Also, PHP is a server side language, so, if you wrote something client
> side, what language did you write it in and you might be better off asking
> on a list for that language.
>
>
> > 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??
>
> Sure. Make an HTML form on your server where users type in the input.
>
> You need to then design a script that handles the data the users submit.
> I don't know how you want the data formatted nor how data gets submitted
> to your credit bureau, so I can't state anything specific on the remaining
> steps.
>
> Anyway, when you're writing your HTML form in the first step, the action
> attribute in the <form> tag should lead to that second script you made.
>
> --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:
I don't know how to appy patches to the PHP software. I just finish upgrading the website to work with PHP 4.2.1 from PHP 4.0.6. And now this.... So, just patched it then configure openssl, mycrypt, curl, modssl then do the usual stuff for PHP then apache, right??
"Adam Alkins" <adam
rasadam.com> wrote in message
news:050a01c231c2$d483f770$aa9303c4
alkins...
> Any real programmer should know that almost nothing is bug free, even if
you
> test it beyond your imagination. Something is always going to elude you
and
> be found by someone experimenting down the road.
>
> For the widespread use of PHP, I'm rather impressed by the small amount of
> vunerabilities discovered in PHP so far.
>
> Some humans are just never ever satisfied...
>
> --------------
> Adam Alkins
> http://www.rasadam.com
> --------------
>
attached mail follows:
Amended to this recent posting. Already started a new posting from scratch.
"Scott Fletcher" <scott
abcoa.com> wrote in message
news:20020723164003.38582.qmail
pb1.pair.com...
> I don't know how to appy patches to the PHP software. I just finish
> upgrading the website to work with PHP 4.2.1 from PHP 4.0.6. And now
> this.... So, just patched it then configure openssl, mycrypt, curl,
modssl
> then do the usual stuff for PHP then apache, right??
>
> "Adam Alkins" <adam
rasadam.com> wrote in message
> news:050a01c231c2$d483f770$aa9303c4
alkins...
> > Any real programmer should know that almost nothing is bug free, even if
> you
> > test it beyond your imagination. Something is always going to elude you
> and
> > be found by someone experimenting down the road.
> >
> > For the widespread use of PHP, I'm rather impressed by the small amount
of
> > vunerabilities discovered in PHP so far.
> >
> > Some humans are just never ever satisfied...
> >
> > --------------
> > Adam Alkins
> > http://www.rasadam.com
> > --------------
> >
>
>
attached mail follows:
> From: Scott Fletcher [mailto:scott
abcoa.com]
> Sent: Tuesday, July 23, 2002 12:43 PM
> To: php-general
lists.php.net
> Subject: Re: [PHP] Re: PHP Security Advisory: Vulnerability
> in PHP versions 4.2.0
>
>
> I don't know how to appy patches to the PHP software. I just finish
> upgrading the website to work with PHP 4.2.1 from PHP 4.0.6. And now
> this.... So, just patched it then configure openssl,
> mycrypt, curl, modssl
> then do the usual stuff for PHP then apache, right??
Rebuilding from source: 1. download the new php source, extract it to whereever you do. 2. cd to php-4.2.2 copy config.nice from your existing php compile dir (this has your previous complies config command). 3. Run it: ./config.nice 4. make 5. apachectl stop 6. make install 7a. i. If php is a DSO: ii. apachectl start (you're done) 7b. i. If php is compiled into apache: ii. cd to apache compile dir iii. make clean iv. ./config.status v. make vi. make install vii. apachectl start (you're done)
attached mail follows:
"Ian Ball" <ian23
midori.shacknet.nu> wrote in message
news:200207221915.VAA17349
www.onlineloop.com...
> patch -p0 < php-4.2.1-to-4.2.2.patch > cd php-4.2.1 > ./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?
--Ricky
attached mail follows:
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:ricky
electricarrow.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:
You forgot the session_start(); call. You will have to do that before you can tap into registered vars. Hope that helps. Jas
"Alexander Ross" <alexross
bleen.net> wrote in message
news:20020710152354.7439.qmail
pb1.pair.com...
> I'm trying to understand sessions so I can set session variables. I set up
2
> very simple pages:
>
> Page 1:
>
> <?
> session_start();
> $test_var = "froggy";
> session_register('test_var');
> ?>
> <a href="page2.php">Click here</a>
>
>
> Page 2:
>
> <?
> print $test_var."!";
> ?>
>
>
> This doesn't seem to work though. $test_var doesn't seem to have a value
> when I go the second page. What am I missing. Thanks for helping a
newbie.
>
> Alex
>
>
attached mail follows:
Very cute! "Upgrade Now!" It will work well with PHP newbies. Not!
"Richard Lynch" <rich
phpbootcamp.com> wrote in message
news:php.general-108985
news.php.net...
> >Not being an expert in php..i couldnt understand the vulnerability.
> >Can someone shed some light here.
>
> Very short explanation:
>
> Upgrade.
> Now!
>
> Longer one:
>
> If your web-site has *ANY* FORM tags on it, and you have PHP
> ready-and-waiting to process those FORMs, then somebody could manage to
> create a really icky FORM page and POST to your site and break in.
>
> Actually, even if you do *NOT* have the FORM tags, but you're "allowing"
> them in httpd.conf, and PHP is there, they could break in.
>
> Presumably the precise details of what you'd have to slam into the FORM to
> break in are simply too complex to fit into an Announcement of this
nature.
> I imagine the Details could be dug out of Bugtrak and/or wherever the bug
> was first announced/discussed. Presumably PHP-Dev and e-matters would be
> good places to start digging for gory details.
>
> If Upgrading is impossible, *AND* you don't use FORMs with PHP in the
first
> place (highly unlikely) than you could just "turn off" POST (forms) in
your
> httpd.conf and nobody will be allowed to POST (send a form) anything to
your
> web-site, and then PHP won't ever see the data, since Apache stopped them,
> and the bug wouldn't kick in.
>
> Upgrade.
> Now!
>
> --
> Like Music? http://l-i-e.com/artists.htm
>
attached mail follows:
On Wednesday 24 July 2002 01:01, Scott Fletcher wrote: > Very cute! "Upgrade Now!" It will work well with PHP newbies. Not!
If 'PHP newbies' aren't able to perform the upgrade themselves, they should ask someone who can. If it was the 'PHP newbies' who originally did the php installation then the upgrade is just a matter of repeating the same steps as the original installation. There's nothing difficult about.
-- Jason Wong -> Gremlins Associates -> www.gremlins.com.hk Open Source Software Systems Integrators * Web Design & Hosting * Internet & Intranet Applications Development */* Hash table has woodworm */
attached mail follows:
Sorry about the old posting, didn't realize it was a yesterday posting.
Anyway, how do I apply the patch, php 4.2.2 to php 4.2.1?? I never done it before and yes, lots, lots of webpages use POST method. Isn't stress great?????
Thanks FletchSOD
attached mail follows:
-----------------------------------
Eynar Alberto Gaitán Rivas.
Sysop
Tiempos Nicaragua, S.A.
Managua, Nicaragua
Tel. 268-2945 ext. 22
http://www.tdm.com.ni
egaitan
tdm.com.ni
attached mail follows:
With php 4.2.2 I get this when trying to compile with apache 2 support:
Making all in apache2filter /bin/sh /usr/local/download/apache/php-4.2.2/libtool --silent --mode=compile gcc -I. -I/usr/local/download/apache/php-4.2.2/sapi/apache2filter -I/usr/local/download/apache/php-4.2.2/main -I/usr/local/download/apache/php-4.2.2 -I/usr/site/include -I/usr/local/download/apache/php-4.2.2/Zend -I/usr/local/include -I/usr/local/pgsql/include -I/usr/local/download/apache/php-4.2.2/ext/xml/expat -D_REENTRANT -D_THREAD_SAFE -I/usr/local/download/apache/php-4.2.2/TSRM -I/usr/local/include/pth -g -O2 -pthread -DZTS -prefer-pic -c php_functions.c php_functions.c:93: syntax error *** Error code 1
Stop in /usr/local/download/apache/php-4.2.2/sapi/apache2filter. *** Error code 1
Stop in /usr/local/download/apache/php-4.2.2/sapi/apache2filter. *** Error code 1
Stop in /usr/local/download/apache/php-4.2.2/sapi. *** Error code 1
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!
-Mitch
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
-- Aaron Gould agouldpartscanada.com Web Developer
----- Original Message ----- From: "Mitch Vincent" <mitch
unixprogramming.net> To: "php-general" <php-general
lists.php.net> Sent: Tuesday, July 23, 2002 1:16 PM Subject: [PHP] Apache 2 support broken?
> With php 4.2.2 I get this when trying to compile with apache 2 support: > > Making all in apache2filter > /bin/sh /usr/local/download/apache/php-4.2.2/libtool --silent --mode=compile > gcc -I. -I/usr/local/download/apache/php-4.2.2/sapi/apache2filter > -I/usr/local/download/apache/php-4.2.2/main > -I/usr/local/download/apache/php-4.2.2 -I/usr/site/include > -I/usr/local/download/apache/php-4.2.2/Zend -I/usr/local/include > -I/usr/local/pgsql/include > -I/usr/local/download/apache/php-4.2.2/ext/xml/expat -D_REENTRANT > -D_THREAD_SAFE -I/usr/local/download/apache/php-4.2.2/TSRM > -I/usr/local/include/pth -g -O2 -pthread -DZTS -prefer-pic -c > php_functions.c > php_functions.c:93: syntax error > *** Error code 1 > > Stop in /usr/local/download/apache/php-4.2.2/sapi/apache2filter. > *** Error code 1 > > Stop in /usr/local/download/apache/php-4.2.2/sapi/apache2filter. > *** Error code 1 > > Stop in /usr/local/download/apache/php-4.2.2/sapi. > *** Error code 1 > > > 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! > > -Mitch > > > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php
attached mail follows:
Hi, Someone please tell me how to install apache on redhat linux. -Varsha
__________________________________________________ Do You Yahoo!? Yahoo! Health - Feel better, live better http://health.yahoo.com
attached mail follows:
On Wednesday 24 July 2002 01:22, Varsha Agarwal wrote: > Hi, > Someone please tell me how to install apache on redhat > linux.
This is neither an Apache list, nor a Redhat list. Best ask on the relevant list.
-- Jason Wong -> Gremlins Associates -> www.gremlins.com.hk Open Source Software Systems Integrators * Web Design & Hosting * Internet & Intranet Applications Development */* Pyros of the world... IGNITE !!! */
attached mail follows:
Is there a newsgroup list for PHP and OOP? It would be great to split up this large topic and create an OOP specific list.
InsaneCoder
attached mail follows:
Try http://www.phpclasses.org;
Warren Vail Tools, Metrics & Quality Processes (415) 667-7814 Pager (877) 774-9891 215 Fremont 02-658
-----Original Message-----
From: Mathieu Dumoulin [mailto:mdumoulin
groupimage.com]
Sent: Tuesday, July 23, 2002 10:36 AM
To: php-general
lists.php.net
Subject: [PHP] PHP OOP list
Is there a newsgroup list for PHP and OOP? It would be great to split up this large topic and create an OOP specific list.
InsaneCoder
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
attached mail follows:
Hello,
On 07/23/2002 02:35 PM, Mathieu Dumoulin wrote: > Is there a newsgroup list for PHP and OOP? > It would be great to split up this large topic and create an OOP specific > list.
Sure, just send a message to php-objects-subscribe
egroups.com or
subscribe in this page:
http://groups.yahoo.com/group/php-objects/join
--Regards, Manuel Lemos
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?
Eric
attached mail follows:
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:
That is what I figured. The problem is that oracle doesn't even seem to have per-process limits.
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:
Just wondering if anyone has come across the need to develop a class to test a string of numbers based on a credit card type. If you have where would I be able to get information on what string of numbers is consistent with each of the different credit cards? Any help would be appreciated! Jas
attached mail follows:
Try this:
http://www.AnalysisAndSolutions.com/code/ccvs-ph.htm
Rick
A sense of humor can help you over look the unattractive, tolerate the unpleasant, cope with the unexpected, and smile through the unbearable. - Moshe Waldoks
> From: "Jas" <jlgerfen
hotmail.com>
> Date: Tue, 23 Jul 2002 12:09:48 -0600
> To: php-general
lists.php.net
> Subject: [PHP] Credit card checks?
>
> Just wondering if anyone has come across the need to develop a class to test
> a string of numbers based on a credit card type. If you have where would I
> be able to get information on what string of numbers is consistent with each
> of the different credit cards? Any help would be appreciated!
> Jas
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
attached mail follows:
Yeah, I have looked at that class file and I don't want someone elses example to use, I want to build my own but have no way of knowing what makes up a valid visa number etc.... Jas
"Richard Baskett" <php
baskettcase.com> wrote in message
news:B962EBBF.C22F%php
baskettcase.com...
> Try this:
>
> http://www.AnalysisAndSolutions.com/code/ccvs-ph.htm
>
> Rick
>
> A sense of humor can help you over look the unattractive, tolerate the
> unpleasant, cope with the unexpected, and smile through the unbearable. -
> Moshe Waldoks
>
> > From: "Jas" <jlgerfen
hotmail.com>
> > Date: Tue, 23 Jul 2002 12:09:48 -0600
> > To: php-general
lists.php.net
> > Subject: [PHP] Credit card checks?
> >
> > Just wondering if anyone has come across the need to develop a class to
test
> > a string of numbers based on a credit card type. If you have where
would I
> > be able to get information on what string of numbers is consistent with
each
> > of the different credit cards? Any help would be appreciated!
> > Jas
> >
> >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
>
attached mail follows:
You should contact Visa International Service Association to determine what constitues a "valid" credit card number. Just FYI, a valid format is 16 digits; aaaa-bbbb-cccc-dddd. I believe VISA normally begins with "41" as the first two digits, however, I am not a Visa Int. agent but I am a client. Ultimately, you would need a merchant account to verify its validity, AFTER you have verified its format for accuracy. HTH Kris
Jas wrote:
>Yeah, I have looked at that class file and I don't want someone elses
>example to use, I want to build my own but have no way of knowing what makes
>up a valid visa number etc....
>Jas
>
>"Richard Baskett" <php
baskettcase.com> wrote in message
>news:B962EBBF.C22F%php
baskettcase.com...
>
>
>>Try this:
>>
>>http://www.AnalysisAndSolutions.com/code/ccvs-ph.htm
>>
>>Rick
>>
>>A sense of humor can help you over look the unattractive, tolerate the
>>unpleasant, cope with the unexpected, and smile through the unbearable. -
>>Moshe Waldoks
>>
>>
>>
>>>From: "Jas" <jlgerfen
hotmail.com>
>>>Date: Tue, 23 Jul 2002 12:09:48 -0600
>>>To: php-general
lists.php.net
>>>Subject: [PHP] Credit card checks?
>>>
>>>Just wondering if anyone has come across the need to develop a class to
>>>
>>>
>test
>
>
>>>a string of numbers based on a credit card type. If you have where
>>>
>>>
>would I
>
>
>>>be able to get information on what string of numbers is consistent with
>>>
>>>
>each
>
>
>>>of the different credit cards? Any help would be appreciated!
>>>Jas
>>>
>>>
>>>
>>>--
>>>PHP General Mailing List (http://www.php.net/)
>>>To unsubscribe, visit: http://www.php.net/unsub.php
>>>
>>>
>>>
>
>
>
>
>
attached mail follows:
So there is no way to use some sort of string comparison to check the number then? I would have to have a merchant account? Sorry for being nieve, just never tried to work with credit card numbers etc. Jas
"Kristopher Yates" <kris
2binteractive.com> wrote in message
news:3D3DA374.8080206
2binteractive.com...
> You should contact Visa International Service Association to determine
> what constitues a "valid" credit card number. Just FYI, a valid format
> is 16 digits; aaaa-bbbb-cccc-dddd. I believe VISA normally begins with
> "41" as the first two digits, however, I am not a Visa Int. agent but I
> am a client. Ultimately, you would need a merchant account to verify its
> validity, AFTER you have verified its format for accuracy. HTH Kris
>
> Jas wrote:
>
> >Yeah, I have looked at that class file and I don't want someone elses
> >example to use, I want to build my own but have no way of knowing what
makes
> >up a valid visa number etc....
> >Jas
> >
> >"Richard Baskett" <php
baskettcase.com> wrote in message
> >news:B962EBBF.C22F%php
baskettcase.com...
> >
> >
> >>Try this:
> >>
> >>http://www.AnalysisAndSolutions.com/code/ccvs-ph.htm
> >>
> >>Rick
> >>
> >>A sense of humor can help you over look the unattractive, tolerate the
> >>unpleasant, cope with the unexpected, and smile through the
unbearable. -
> >>Moshe Waldoks
> >>
> >>
> >>
> >>>From: "Jas" <jlgerfen
hotmail.com>
> >>>Date: Tue, 23 Jul 2002 12:09:48 -0600
> >>>To: php-general
lists.php.net
> >>>Subject: [PHP] Credit card checks?
> >>>
> >>>Just wondering if anyone has come across the need to develop a class to
> >>>
> >>>
> >test
> >
> >
> >>>a string of numbers based on a credit card type. If you have where
> >>>
> >>>
> >would I
> >
> >
> >>>be able to get information on what string of numbers is consistent with
> >>>
> >>>
> >each
> >
> >
> >>>of the different credit cards? Any help would be appreciated!
> >>>Jas
> >>>
> >>>
> >>>
> >>>--
> >>>PHP General Mailing List (http://www.php.net/)
> >>>To unsubscribe, visit: http://www.php.net/unsub.php
> >>>
> >>>
> >>>
> >
> >
> >
> >
> >
>
>
>
attached mail follows:
Visa starts with 45 Mastercard starts with 51
=P
InsaneCoder
"Kristopher Yates" <kris
2binteractive.com> wrote in message
news:3D3DA374.8080206
2binteractive.com...
> You should contact Visa International Service Association to determine
> what constitues a "valid" credit card number. Just FYI, a valid format
> is 16 digits; aaaa-bbbb-cccc-dddd. I believe VISA normally begins with
> "41" as the first two digits, however, I am not a Visa Int. agent but I
> am a client. Ultimately, you would need a merchant account to verify its
> validity, AFTER you have verified its format for accuracy. HTH Kris
>
> Jas wrote:
>
> >Yeah, I have looked at that class file and I don't want someone elses
> >example to use, I want to build my own but have no way of knowing what
makes
> >up a valid visa number etc....
> >Jas
> >
> >"Richard Baskett" <php
baskettcase.com> wrote in message
> >news:B962EBBF.C22F%php
baskettcase.com...
> >
> >
> >>Try this:
> >>
> >>http://www.AnalysisAndSolutions.com/code/ccvs-ph.htm
> >>
> >>Rick
> >>
> >>A sense of humor can help you over look the unattractive, tolerate the
> >>unpleasant, cope with the unexpected, and smile through the
unbearable. -
> >>Moshe Waldoks
> >>
> >>
> >>
> >>>From: "Jas" <jlgerfen
hotmail.com>
> >>>Date: Tue, 23 Jul 2002 12:09:48 -0600
> >>>To: php-general
lists.php.net
> >>>Subject: [PHP] Credit card checks?
> >>>
> >>>Just wondering if anyone has come across the need to develop a class to
> >>>
> >>>
> >test
> >
> >
> >>>a string of numbers based on a credit card type. If you have where
> >>>
> >>>
> >would I
> >
> >
> >>>be able to get information on what string of numbers is consistent with
> >>>
> >>>
> >each
> >
> >
> >>>of the different credit cards? Any help would be appreciated!
> >>>Jas
> >>>
> >>>
> >>>
> >>>--
> >>>PHP General Mailing List (http://www.php.net/)
> >>>To unsubscribe, visit: http://www.php.net/unsub.php
> >>>
> >>>
> >>>
> >
> >
> >
> >
> >
>
>
>
attached mail follows:
Correct. Your first "parsing" of the credit card number could be done by the web server, just to check its length and format: you could use strlen() function in PHP to count the digits, to verify it is correct. You could strip the dashes with ereg_replace("-", "", $credit_card_number) then count its length.
To actually verify that the card submitted is a number assigned by VISA, your system would have to connect via LinkPoint, AuthorizeNet, or a service like that. They do address comparisson, bank assigner id comparison, and much much more. Without a merchant account, your PHP could only verify that it "appears" to be a valid credit card number. The only other option is to get your local bank to hook you up with a merchant account and transaction equipment, and you could just run the cards "by hand". That option doesnt sound very fun but some folks prefer doing biz that way.
I dont know about AuthorizeNet, but LinkPoint has an API written in PHP that is supposed to be inexpensive, and easilly integratable into any PHP apps. I heard it was only $125.00.. Not a bad price for a few hundred lines of code. I am in no way affiliated with or trying to advertise for these companies. Hope this helps, Kris
Jas wrote:
>So there is no way to use some sort of string comparison to check the number
>then? I would have to have a merchant account? Sorry for being nieve, just
>never tried to work with credit card numbers etc.
>Jas
>
>"Kristopher Yates" <kris
2binteractive.com> wrote in message
>news:3D3DA374.8080206
2binteractive.com...
>
>
>>You should contact Visa International Service Association to determine
>>what constitues a "valid" credit card number. Just FYI, a valid format
>>is 16 digits; aaaa-bbbb-cccc-dddd. I believe VISA normally begins with
>>"41" as the first two digits, however, I am not a Visa Int. agent but I
>>am a client. Ultimately, you would need a merchant account to verify its
>>validity, AFTER you have verified its format for accuracy. HTH Kris
>>
>>Jas wrote:
>>
>>
>>
>>>Yeah, I have looked at that class file and I don't want someone elses
>>>example to use, I want to build my own but have no way of knowing what
>>>
>>>
>makes
>
>
>>>up a valid visa number etc....
>>>Jas
>>>
>>>"Richard Baskett" <php
baskettcase.com> wrote in message
>>>news:B962EBBF.C22F%php
baskettcase.com...
>>>
>>>
>>>
>>>
>>>>Try this:
>>>>
>>>>http://www.AnalysisAndSolutions.com/code/ccvs-ph.htm
>>>>
>>>>Rick
>>>>
>>>>A sense of humor can help you over look the unattractive, tolerate the
>>>>unpleasant, cope with the unexpected, and smile through the
>>>>
>>>>
>unbearable. -
>
>
>>>>Moshe Waldoks
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>>From: "Jas" <jlgerfen
hotmail.com>
>>>>>Date: Tue, 23 Jul 2002 12:09:48 -0600
>>>>>To: php-general
lists.php.net
>>>>>Subject: [PHP] Credit card checks?
>>>>>
>>>>>Just wondering if anyone has come across the need to develop a class to
>>>>>
>>>>>
>>>>>
>>>>>
>>>test
>>>
>>>
>>>
>>>
>>>>>a string of numbers based on a credit card type. If you have where
>>>>>
>>>>>
>>>>>
>>>>>
>>>would I
>>>
>>>
>>>
>>>
>>>>>be able to get information on what string of numbers is consistent with
>>>>>
>>>>>
>>>>>
>>>>>
>>>each
>>>
>>>
>>>
>>>
>>>>>of the different credit cards? Any help would be appreciated!
>>>>>Jas
>>>>>
>>>>>
>>>>>
>>>>>--
>>>>>PHP General Mailing List (http://www.php.net/)
>>>>>To unsubscribe, visit: http://www.php.net/unsub.php
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>
>>>
>>>
>>>
>>>
>>
>>
>>
>
>
>
>
>
attached mail follows:
Ok how's this then?
http://www.beachnet.com/~hstiles/cardtype.html
Don't dismiss a good idea simply because you don't like the source. - Unknown
> From: "Jas" <jlgerfen
hotmail.com>
> Date: Tue, 23 Jul 2002 12:33:17 -0600
> To: php-general
lists.php.net
> Subject: Re: [PHP] Credit card checks?
>
> Yeah, I have looked at that class file and I don't want someone elses
> example to use, I want to build my own but have no way of knowing what makes
> up a valid visa number etc....
> Jas
>
> "Richard Baskett" <php
baskettcase.com> wrote in message
> news:B962EBBF.C22F%php
baskettcase.com...
>> Try this:
>>
>> http://www.AnalysisAndSolutions.com/code/ccvs-ph.htm
>>
>> Rick
>>
>> A sense of humor can help you over look the unattractive, tolerate the
>> unpleasant, cope with the unexpected, and smile through the unbearable. -
>> Moshe Waldoks
>>
>>> From: "Jas" <jlgerfen
hotmail.com>
>>> Date: Tue, 23 Jul 2002 12:09:48 -0600
>>> To: php-general
lists.php.net
>>> Subject: [PHP] Credit card checks?
>>>
>>> Just wondering if anyone has come across the need to develop a class to
> test
>>> a string of numbers based on a credit card type. If you have where
> would I
>>> be able to get information on what string of numbers is consistent with
> each
>>> of the different credit cards? Any help would be appreciated!
>>> Jas
>>>
>>>
>>>
>>> --
>>> 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:
This may help with the specific formats. (And how to calculate the check digit yourself to verify)
http://www.beachnet.com/~hstiles/cardtype.html
Jaime Bozza
-----Original Message-----
From: Kristopher Yates [mailto:kris
2binteractive.com]
Sent: Tuesday, July 23, 2002 1:42 PM
To: php-general
lists.php.net
Subject: Re: [PHP] Credit card checks?
You should contact Visa International Service Association to determine what constitues a "valid" credit card number. Just FYI, a valid format is 16 digits; aaaa-bbbb-cccc-dddd. I believe VISA normally begins with "41" as the first two digits, however, I am not a Visa Int. agent but I am a client. Ultimately, you would need a merchant account to verify its
validity, AFTER you have verified its format for accuracy. HTH Kris
Jas wrote:
>Yeah, I have looked at that class file and I don't want someone elses
>example to use, I want to build my own but have no way of knowing what
makes
>up a valid visa number etc....
>Jas
>
>"Richard Baskett" <php
baskettcase.com> wrote in message
>news:B962EBBF.C22F%php
baskettcase.com...
>
>
>>Try this:
>>
>>http://www.AnalysisAndSolutions.com/code/ccvs-ph.htm
>>
>>Rick
>>
>>A sense of humor can help you over look the unattractive, tolerate the
>>unpleasant, cope with the unexpected, and smile through the
unbearable. -
>>Moshe Waldoks
>>
>>
>>
>>>From: "Jas" <jlgerfen
hotmail.com>
>>>Date: Tue, 23 Jul 2002 12:09:48 -0600
>>>To: php-general
lists.php.net
>>>Subject: [PHP] Credit card checks?
>>>
>>>Just wondering if anyone has come across the need to develop a class
to
>>>
>>>
>test
>
>
>>>a string of numbers based on a credit card type. If you have where
>>>
>>>
>would I
>
>
>>>be able to get information on what string of numbers is consistent
with
>>>
>>>
>each
>
>
>>>of the different credit cards? Any help would be appreciated!
>>>Jas
>>>
>>>
>>>
>>>--
>>>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:
>>>>> "Kristopher" == Kristopher Yates <kris
2binteractive.com> writes:
[. . .]
Kristopher> I dont know about AuthorizeNet, but LinkPoint has an
Kristopher> API written in PHP that is supposed to be inexpensive,
Kristopher> and easilly integratable into any PHP apps. I heard
Kristopher> it was only $125.00.. Not a bad price for a few
Kristopher> hundred lines of code. I am in no way affiliated with
Kristopher> or trying to advertise for these companies. Hope this
Kristopher> helps, Kris
The linpoint API is, indeed, easy o integrate into a PHP app. <opinion> Linkpoint's level of service could use some improvement, however. </opinion>
-- When the birdcage is open, | donate to causes I care about: the selfish bird flies away, | http://svcs.affero.net/rm.php?r=leed_25 but the virtuous one stays. |
attached mail follows:
You could use an algorithms called mod10. Both Visa, MasterCard and I think most other credit cards use the mod10 algorithm. A credit card must pass a mod10 test to be a valid number(Like a Regular Expression test). It won't tell you if the number exist, but it will tell you if it could exist. I also know the mod10 is used for Canadian Social Security numbers (SIN).
Unfortunately I have never seen a PHP function for it, I only used mod10 in a language called Uniface by Compuware. I know there is another name for it also, but I can't remember it right now.
It is a great test, someone just typing in numbers at random will have a terrible time guessing a number right. I have never seen someone do it let. Then you can use the first character of the number to test the card type.
I will see if I can locate the algorithm and email it too you.
Mark
"Jas" <jlgerfen
hotmail.com> wrote in message
news:20020723181239.25134.qmail
pb1.pair.com...
> Just wondering if anyone has come across the need to develop a class to
test
> a string of numbers based on a credit card type. If you have where would
I
> be able to get information on what string of numbers is consistent with
each
> of the different credit cards? Any help would be appreciated!
> Jas
>
>
attached mail follows:
Try this:
function do_mod_10($num) { // The Luhn formula works right to left, so reverse the number. $num = strrev($num); $total = 0; for ($i = 0, $j = 1; $i < strlen($num); $i++, $j=3-$j) { $digit = $num[$i] * $j; if ($digit > 9) $digit -= 9; $total += $digit; }
return ($total % 10 == 0); }
-----Original Message-----
From: Mark McCulligh [mailto:mmcculli
sykescanada.com]
Sent: Wednesday, July 24, 2002 10:47 AM
To: php-general
lists.php.net
Subject: [PHP] Re: Credit card checks?
You could use an algorithms called mod10. Both Visa, MasterCard and I think most other credit cards use the mod10 algorithm. A credit card must pass a mod10 test to be a valid number(Like a Regular Expression test). It won't tell you if the number exist, but it will tell you if it could exist. I also know the mod10 is used for Canadian Social Security numbers (SIN).
Unfortunately I have never seen a PHP function for it, I only used mod10 in a language called Uniface by Compuware. I know there is another name for it also, but I can't remember it right now.
It is a great test, someone just typing in numbers at random will have a terrible time guessing a number right. I have never seen someone do it let. Then you can use the first character of the number to test the card type.
I will see if I can locate the algorithm and email it too you.
Mark
"Jas" <jlgerfen
hotmail.com> wrote in message
news:20020723181239.25134.qmail
pb1.pair.com...
> Just wondering if anyone has come across the need to develop a class to
test
> a string of numbers based on a credit card type. If you have where would
I
> be able to get information on what string of numbers is consistent with
each
> of the different credit cards? Any help would be appreciated!
> Jas
>
>
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
attached mail follows:
There is a credit card validating class on phpclasses.org under e-commerce.
"Martin Towell" <martin.towell
world.net> wrote in message
news:6416776FCC55D511BC4E0090274EFEF5034CFBAF
EXCHANGE...
> Try this:
>
> function do_mod_10($num)
> {
> // The Luhn formula works right to left, so reverse the number.
> $num = strrev($num);
> $total = 0;
> for ($i = 0, $j = 1; $i < strlen($num); $i++, $j=3-$j)
> {
> $digit = $num[$i] * $j;
> if ($digit > 9) $digit -= 9;
> $total += $digit;
> }
>
> return ($total % 10 == 0);
> }
>
> -----Original Message-----
> From: Mark McCulligh [mailto:mmcculli
sykescanada.com]
> Sent: Wednesday, July 24, 2002 10:47 AM
> To: php-general
lists.php.net
> Subject: [PHP] Re: Credit card checks?
>
>
> You could use an algorithms called mod10. Both Visa, MasterCard and I
think
> most other credit cards use the mod10 algorithm. A credit card must pass
a
> mod10 test to be a valid number(Like a Regular Expression test). It won't
> tell you if the number exist, but it will tell you if it could exist. I
> also know the mod10 is used for Canadian Social Security numbers (SIN).
>
> Unfortunately I have never seen a PHP function for it, I only used mod10
in
> a language called Uniface by Compuware. I know there is another name for
> it also, but I can't remember it right now.
>
> It is a great test, someone just typing in numbers at random will have a
> terrible time guessing a number right. I have never seen someone do it
let.
> Then you can use the first character of the number to test the card type.
>
> I will see if I can locate the algorithm and email it too you.
>
>
> Mark
>
> "Jas" <jlgerfen
hotmail.com> wrote in message
> news:20020723181239.25134.qmail
pb1.pair.com...
> > Just wondering if anyone has come across the need to develop a class to
> test
> > a string of numbers based on a credit card type. If you have where
would
> I
> > be able to get information on what string of numbers is consistent with
> each
> > of the different credit cards? Any help would be appreciated!
> > Jas
> >
> >
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
attached mail follows:
popen() opens a named pipe to a program - you can read and write to it if the program you're piping to supports that kind of interactivity (mostly you just read the output from the command). However, in this case, I don't think you want either popen() or fopen() (certainly not fopen() - that just opens a file and that's not at all what you want). You can use a system call or just backticks around the call to useradd (if it's on the same server as your web server). If it's not, you'll have to use sockets and or xmlrpc or some other messaging service.
BUT...you probably know that useradd requires root privs. So you either have your webserver running as root (a really really bad idea), or you have it configured to allow suid programs or you have useradd as suid root - also not really good ideas.
Maybe you want to take a look at a program called Webmin (http://www.webmin.com/) that already does what you are talking about. I haven't used it for several years, but as I remember, it was a pretty handy tool.
..mike..
On Mon, 2002-07-22 at 17:56, Peter wrote:
> > > i'm tring to run the useradd command (under Solaris) to add a user to the > system so i don't have to continueously remote log in and also make it > easier for myself to add users to the system(s).. maybe popen isn't the best > option for this .. though i don't think fopen will be able to do what i need > it to do.. maybe playing around with sockets would be better? > > > Cheers > > Peter
attached mail follows:
Basic scenario. There's really nothing else to tell except for that.
I'm trying to upload a file via a TYPE=FILE control in a form. When I press submit, my $uploadedfile is what it should be, but my $uploadedfile_name is blank. So is my $uploadedfile_size. Any reason?
__________________________________________________ Do You Yahoo!? Yahoo! Health - Feel better, live better http://health.yahoo.com
attached mail follows:
Check to make sure that your FORM tag has: enc-type=multpart-formdata
i had SOOOOO much trouble finding this out. hope it helps ya
InsaneCoder
"Liam Gibbs" <liamgibbs
yahoo.com> wrote in message
news:20020723183257.96785.qmail
web10008.mail.yahoo.com...
> Basic scenario. There's really nothing else to tell
> except for that.
>
> I'm trying to upload a file via a TYPE=FILE control in
> a form. When I press submit, my $uploadedfile is what
> it should be, but my $uploadedfile_name is blank. So
> is my $uploadedfile_size. Any reason?
>
> __________________________________________________
> Do You Yahoo!?
> Yahoo! Health - Feel better, live better
> http://health.yahoo.com
attached mail follows:
> i had SOOOOO much trouble finding this out. hope it > helps ya
Thanks for the help. This was the clincher. I knew that, too, and had it in some forms, but you just pointed out the one thing I was missing. Thanks!
__________________________________________________ Do You Yahoo!? Yahoo! Health - Feel better, live better http://health.yahoo.com
attached mail follows:
Hi!
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??
Thanks, FletchSOD
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'; $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
attached mail follows:
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-php
levindustries.com]
Sent: 23 July 2002 19:57
To: php-general
lists.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:
Thanks for the pointer! I had looked at it, but didn't see too much information on using CURL with a telnet type application. I'll take a closer look at it.
--Josh Levine
Patrick Lynch wrote:
>
> 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-php
levindustries.com]
> Sent: 23 July 2002 19:57
> To: php-general
lists.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:
josh just a query did u try it with https:// rather than ssl:// ?
> -----Original Message-----
> From: Josh Levine [mailto:joshl-php
levindustries.com]
> Sent: Wednesday, 24 July 2002 9:53 AM
> To: php-general
lists.php.net
> Subject: Re: [PHP] secure sockets
>
>
> Thanks for the pointer! I had looked at it, but didn't see too much
> information on using CURL with a telnet type application. I'll take a
> closer look at it.
>
> --Josh Levine
>
>
> Patrick Lynch wrote:
> >
> > 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-php
levindustries.com]
> > Sent: 23 July 2002 19:57
> > To: php-general
lists.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
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
>
attached mail follows:
Patrick is right in that you can use CURL to do this, but as of PHP 4.3.0, you can use https:// if you have compiled in OpenSSL support.
On Tuesday 23 July 2002 11:56 am, Josh Levine wrote: > 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
-- Think not those faithful who praise all thy words and actions, but those who kindly reprove thy faults.Socrates
attached mail follows:
The docs for fsockopen() say I should use ssl:// (the docs for fopen() say to use https:// for a secure HTTP 1.0, which I don't want). I can go ahead and try it, though...
--Josh Levine
Peter wrote:
>
> josh just a query did u try it with https:// rather than ssl:// ?
>
> > -----Original Message-----
> > From: Josh Levine [mailto:joshl-php
levindustries.com]
> > Sent: Wednesday, 24 July 2002 9:53 AM
> > To: php-general
lists.php.net
> > Subject: Re: [PHP] secure sockets
> >
> >
> > Thanks for the pointer! I had looked at it, but didn't see too much
> > information on using CURL with a telnet type application. I'll take a
> > closer look at it.
> >
> > --Josh Levine
> >
> >
> > Patrick Lynch wrote:
> > >
> > > 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-php
levindustries.com]
> > > Sent: 23 July 2002 19:57
> > > To: php-general
lists.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
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
> >
> >
attached mail follows:
I just wrote this message in the wrong list so i'll be short...
I have two classes: - mysql_connection - data_collection
data_collection REQUIRES a mysql_connection object to work. So i decided to pass this object in the constructor for the data_collection, but when i do so it seems it creates a copy of this object and doesn't use the object i had previously created...
I tried to do function data_collection(&$mysql_server){ ... }
But even the & sign like they say to use on the php.net web site doesn't work, it creates a copy of the object. The only way i found to bypass this problem is to do:
my_collection->mysql_server = &$mysql_server;
which will assign a reference of the mysql_collection object to my collection, but this means i need to modify something like 45 files of my web site and also i have to add some init settings because they where done in the constructor where you needed the connection...
please help me out!!!
InsaneCoder
attached mail follows:
Okay,
I want to know if anybody has a clue which is more efficient, processorwise/parsingwise:
this: ------ echo "<table><tr><td><b>".$somevar."</b><br>".$somevardesc."</td></tr></table>";
or this: ------ echo "<table><tr><td><b>{$somevar}</b><br>{$somevardesc}</td></tr></table>";
I almost always use the first method (just seems more readable to me), but with all of the discussion popping up about curly brackets, i was wondering if it really makes a difference? Any vets out there care to put in their $0.02?
Dave Tichy http://sinewaves.net/
attached mail follows:
try echo "<table><tr><td><b>$somevar</b><br>$somevardesc</td></tr></table>";
which is probably better than the other two but don't quote me on that! You can just include the variables because you have used " rather than ' (I think it works for echo as well as print)
"Dave At Sinewaves.Net" <eightrack
earthlink.net> wrote in message
news:ELENILOLLHIDAONECKONIEAPCFAA.eightrack
earthlink.net...
> Okay,
>
> I want to know if anybody has a clue which is more efficient,
> processorwise/parsingwise:
>
> this:
> ------
> echo
>
"<table><tr><td><b>".$somevar."</b><br>".$somevardesc."</td></tr></table>";
>
> or this:
> ------
> echo
"<table><tr><td><b>{$somevar}</b><br>{$somevardesc}</td></tr></table>";
>
>
> I almost always use the first method (just seems more readable to me), but
> with all of the discussion popping up about curly brackets, i was
wondering
> if it really makes a difference? Any vets out there care to put in their
> $0.02?
>
> Dave Tichy
> http://sinewaves.net/
>
attached mail follows:
>>>>> "Dave" == Dave At Sinewaves Net <eightrack
earthlink.net> writes:
Dave> Okay, I want to know if anybody has a clue which is more Dave> efficient, processorwise/parsingwise:
Dave> this: ------ echo Dave> "<table><tr><td><b>".$somevar."</b><br>".$somevardesc."</td></tr></table>";
Dave> or this: ------ echo Dave> "<table><tr><td><b>{$somevar}</b><br>{$somevardesc}</td></tr></table>";
Dave> I almost always use the first method (just seems more Dave> readable to me), but with all of the discussion popping up Dave> about curly brackets, i was wondering if it really makes a Dave> difference? Any vets out there care to put in their $0.02?
I bet that this would beat the pants off of both:
echo '<table><tr><td><b>'. $somevar . '</b><br>' . $somevardesc . '</td></tr></table>';
-- When the birdcage is open, | donate to causes I care about: the selfish bird flies away, | http://svcs.affero.net/rm.php?r=leed_25 but the virtuous one stays. |
attached mail follows:
I just benched it. If there is a difference in performance then it is too small to detect with microseconds. I'd say there's no need to parse the vars by hand unless the syntax requires it. -Kevin
----- Original Message -----
From: "Dave at Sinewaves.net" <eightrack
earthlink.net>
To: "PHPlist" <php-general
lists.php.net>
Sent: Tuesday, July 23, 2002 1:01 PM
Subject: [PHP] parsing
> Okay, > > I want to know if anybody has a clue which is more efficient, > processorwise/parsingwise: > > this: > ------ > echo > "<table><tr><td><b>".$somevar."</b><br>".$somevardesc."</td></tr></table>"; > > or this: > ------ > echo "<table><tr><td><b>{$somevar}</b><br>{$somevardesc}</td></tr></table>"; > > > I almost always use the first method (just seems more readable to me), but > with all of the discussion popping up about curly brackets, i was wondering > if it really makes a difference? Any vets out there care to put in their > $0.02? > > Dave Tichy > http://sinewaves.net/ > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php >
attached mail follows:
Lee, yes you're right. Using single quotes to denote a litteral string does speed things up a bit. My bench sped up by about .08 seconds over 10,000 echos. That's about 5 pages worth of text. Is .08 seconds worth worrying about? I'm gonna go out a limb here and say.. no. :) -Kevin
----- Original Message -----
From: "Lee Doolan" <lee
affero.com>
To: <php-general
lists.php.net>
Sent: Tuesday, July 23, 2002 1:40 PM
Subject: [PHP] Re: parsing
> >>>>> "Dave" == Dave At Sinewaves Net <eightrack
earthlink.net> writes:
>
> Dave> Okay, I want to know if anybody has a clue which is more
> Dave> efficient, processorwise/parsingwise:
>
> Dave> this: ------ echo
> Dave>
"<table><tr><td><b>".$somevar."</b><br>".$somevardesc."</td></tr></table>";
>
> Dave> or this: ------ echo
> Dave>
"<table><tr><td><b>{$somevar}</b><br>{$somevardesc}</td></tr></table>";
>
>
> Dave> I almost always use the first method (just seems more
> Dave> readable to me), but with all of the discussion popping up
> Dave> about curly brackets, i was wondering if it really makes a
> Dave> difference? Any vets out there care to put in their $0.02?
>
> I bet that this would beat the pants off of both:
>
> echo '<table><tr><td><b>'. $somevar . '</b><br>' . $somevardesc .
'</td></tr></table>';
>
>
> --
> When the birdcage is open, | donate to causes I care about:
> the selfish bird flies away, | http://svcs.affero.net/rm.php?r=leed_25
> but the virtuous one stays. |
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
attached mail follows:
Greetings PHPers. For those of you with MS COM experience or those who want to know how to send a MULTI MIME type message read on.
I'm trying to find out the syntax for sending an HTMLbody and TEXTbody in the same message thus making it a TRUE MULTI message. (see code)
This is what I have... what am I doing wrong??? Any Clues?
$message = new COM('CDO.Message');
$message->To = $myList[$i];
$message->From = 'blah
blah.com';
$message->Subject 'My Subject Line';
$message->TEXTBody = "This is my plain Text Body!"
$message->HTMLBody = "<html>HTML STRING HERE</html>";
$message->Send();
Do I need to declare the HTML body first? Do I have to set the AutoGeneratedTextBody property to false? Commenting out the TEXTBody line sends a auto generated text body by default, but I was hoping to be able to customize my TEXTBody with a bit more control.
Your comments are always GREATLY appreciated. Thanks gang! - NorthBayShane
attached mail follows:
Placing the line $message->TEXTBody = "This is my plain Text Body!" AFTER your HTMLBody tag did the trick.
Try it out!!!! Solved my own problem, but I hope this helps someone else out.
-----Original Message-----
From: Shane
Sent: Tuesday, July 23, 2002 12:21 PM
To: php-general
lists.php.net
Subject: [PHP] HELP: COM(CDO.Message)HTML vs TEXT
Greetings PHPers. For those of you with MS COM experience or those who want to know how to send a MULTI MIME type message read on.
I'm trying to find out the syntax for sending an HTMLbody and TEXTbody in the same message thus making it a TRUE MULTI message. (see code)
This is what I have... what am I doing wrong??? Any Clues?
$message = new COM('CDO.Message');
$message->To = $myList[$i];
$message->From = 'blah
blah.com';
$message->Subject 'My Subject Line';
$message->TEXTBody = "This is my plain Text Body!"
$message->HTMLBody = "<html>HTML STRING HERE</html>";
$message->Send();
Do I need to declare the HTML body first? Do I have to set the AutoGeneratedTextBody property to false? Commenting out the TEXTBody line sends a auto generated text body by default, but I was hoping to be able to customize my TEXTBody with a bit more control.
Your comments are always GREATLY appreciated. Thanks gang! - NorthBayShane
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
attached mail follows:
thanks it worked ^^
-Nick
"Tom Rogers" <trogers
kwikin.com> wrote in message
news:2735331183.20020723134503
kwikin.com...
> Hi,
>
> Tuesday, July 23, 2002, 5:16:43 AM, you wrote:
>
> N> "Tom Rogers" <trogers
kwikin.com> wrote in message
> N> news:16878540805.20020722210409
kwikin.com...
> >> Hello Nick,
> >>
> >> Monday, July 22, 2002, 8:47:39 PM, you wrote:
> >>
> >> N> i get php to allocate a colour then make it transparent using
> >> N> imagecolortransparent()
> >>
> >> N> instead of turning it transparent it becomes black.
> >>
> >> N> Is it something i'm doing wrong? can anyone help me?
> >>
> >> N> thanx in advance
> >>
> >> Post a bit of the code so we can see what you are doing
> >>
> >> --
> >> Tom
> >>
>
> N> $im = imagecreate($size, 21);
>
> N> $bgcolour =
> N>
imagecolorallocate($im,hexdec(substr($table[bg],0,2)),hexdec(substr($table[b
> N> g],2,2)),hexdec(substr($table[bg],4,2)));
> N> $fontcolour =
> N>
imagecolorallocate($im,hexdec(substr($table[fg],0,2)),hexdec(substr($table[f
> N> g],2,2)),hexdec(substr($table[fg],4,2)));
>
> N> if ($table[bg] == "no") {
> N> $trans = imagecolortransparent ($im,$bgcolour);
> N> }
>
> probably what you need is:
>
> $im = imagecreate($size, 21);
> if ($table[bg] == "no") {
> $bgcolour = imagecolorallocate($im,1,1,1);
> $trans = imagecolortransparent ($im,$bgcolour);
> }
> else{
> $bgcolour =
imagecolorallocate($im,hexdec(substr($table[bg],0,2)),hexdec(substr($table[b
g],2,2)),hexdec(substr($table[bg],4,2)));
> }
> $fontcolour =
imagecolorallocate($im,hexdec(substr($table[fg],0,2)),hexdec(substr($table[f
g],2,2)),hexdec(substr($table[fg],4,2)));
>
>
>
>
>
> --
> Best regards,
> Tom
>
attached mail follows:
On Sun, Jul 21, 2002 at 11:43:25AM -0400, WANDA HANSEN wrote: > Is there a way to handle data gathered from a drop down menu that > allows multiple selections using PHP?
Yes. The way I normally do this is to use HTML that looks something like:
<select multiple='multiple' name='test[]'> <option value='1'>Red</option> <option value='2'>Green</option> <option value='3'>Blue</option> </select>
Now in your PHP program, you can access them all with something like:
<?php foreach($_POST['test'] as $test) { echo "You selected $test<br />\n"; } ?>
-- Jason Stechschulte stechypisco.com http://www.ypisco.com -- History books which contain no lies are extremely dull.
attached mail follows:
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:
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" <shane
aru.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:
I have had some success with something similar to what you want to do, using frames. The bottom footer always remains at the bottom of the browser page with the upper body becoming scrollable when it fills up and no longer fits. Perhaps you can use some variation of this.
<HTML> <HEAD> <TITLE>My Form</TITLE> </HEAD> <!-- frames --> <!-- standard frameset --> <frameset rows="*,40" frameborder="0" framespacing="0" border="0" noresize> <frame name="CBody" src="Topbodyform.html" marginwidth="0" marginheight="0" scrolling="auto" frameborder="no" noresize> <frame name="CFoot" src="Smallbodyfoot.html" marginwidth="0" marginheight="0" scrolling="no" frameborder="no" noresize> </frameset>
hope this helps,
Warren Vail Tools, Metrics & Quality Processes
-----Original Message-----
From: Briggsy [mailto:shane
aru.org.nz]
Sent: Tuesday, July 23, 2002 1:11 PM
To: php-general
lists.php.net
Subject: [PHP] PHP creating table for HTML layout
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:
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.
attached mail follows:
On Tue, Jul 23, 2002 at 04:24:37PM -0800, Cirkit Braker wrote: > Is there any way to get the day of the week given a date.
Check out the date() function.
-- Jason Stechschulte stechypisco.com http://www.ypisco.com -- Campus sidewalks never exist as the straightest line between two points. -- M. M. Johnston
attached mail follows:
You can use the one or the combination of: date(); mktime(); strtotime();
eg: echo date("l", strtotime("22 July 2003"));
Check the php online doc for explanation of each function.
Rdb
On Tue, 2002-07-23 at 20:24, Cirkit Braker wrote: > 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. > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > >
attached mail follows:
A combination of the strtotime() function and date() or getdate() functions should do what you want.. http://www.php.net/manual/en/function.strtotime.php
-Kevin
----- Original Message -----
From: "Cirkit Braker" <cirkitbraker
hotmail.com>
To: <php-general
lists.php.net>
Sent: Tuesday, July 23, 2002 6:24 PM
Subject: [PHP] Getting the day if given a date
> 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. > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php >
attached mail follows:
><clip> >>>I want to be able to view a single log that contains the following: ><clip> >> >>http://php.net/error_log >> > >how about this curve... getting PHP to append a line to the apache log.
How about reading the documentation?
>would much rather pump the clf formatted log sting directly into the appropriate >apache log, but if I am not mistaken, using the above function would require >permissions for user nobody(www, whatever) on the log files, no?
Nope. PHP is running as part of Apache. PHP can ask Apache to write stuff into its own log. That's one of the features of http://php.net/error_log
NOTE: If you are running PHP as a CGI, this probably ain't gonna work, because, as noted, you need access to those logs, and PHP running as a CGI is a separate process and probably can't convince Apache that it's kosher to write into its log files. YMMV.
-- Like Music? http://l-i-e.com/artists.htm
attached mail follows:
>Thanks, but all these "methods" require modification of the scripts >already on the server, and it won't ensure any new script being written >by a user on my system to comply.
That is correct.
>Are you all saying that there are no logs kept by default of errors >generated on php/mysql pages at all unless specifically coded? Wouldn't >it be possible then in future PHP releases to have a "set_error_logging" >directive in the php.ini file that will automatically run a wrapper >function on all mysql_query() functions to do this kind of thing?
There *IS* a setting in php.ini to log every error.
However, it only logs PHP errors, not unreported MySQL errors.
I think you *MUST* write some PHP code to get MySQL errors to appear in the first place, and you'd have to write even more code to get them to be considered PHP errors -- I *THINK*. Never turned on this feature, so can't be 100% certain.
>How are people out there managing the scripts/script errors caused by >users on their systems? Or is it a case of "handling the crisis when it >happens"?
In most cases, dedicated applications *ARE* using a common 'include' file and the Project Manager or Lead Developer will kill you if you don't.
In a shared ISP sort of environment, you just have to educate your users, and be sure you make it easy for them to Do The Right Thing.
Does their default include_path have a non web-tree directory conveniently placed in their home directory for them to throw their db_connnect.inc file into it?
My ISP does that, but I dunno if the rest are that smart or not.
He called the directory 'php' instead of 'include' like I would have, but I can live with that. :-)
Actually, he provides a db class pre-built in a file in that directory, along with some custom pre-built PHP scripts like guestbook and Tour Calendar... But that's because he focuses on a particular market.
>You see, as administrator, I need to be able to quickly see who are >coding in such a way as to leave security holes, or even worse, cause >the server to crash due to poor coding. There are almost 1000 individual >php files on my server, and it wouldn't be possible for me to scrutinize >all of them to make sure they are OK.
You won't catch a security hole by logging anyway, I don't think...
Though I guess you could pull out the file names and make sure they aren't in the web-tree and aren't, say, world-writable (shudder).
1000 PHP files? That's not that many :-)
If you need to log every MySQL query specifically, that's *probably* gonna be a debugging feature (not recommended for production use) in /etc/my.conf, assuming a recent install following the instructions that come with MySQL. If you installed with Triad or an RPM or anything like that, you're on your own.
It's actually fairly hard to bring down the whole machine using PHP and MySQL -- You'd have to work at it, or do something incredibly stupid...
Locking up or killing off a single Apache child is less unlikely (still not common) but that usually takes care of itself with Apache children doomed to die within a certain time-frame or # of requests.
So you run enough Apache children that it doesn't matter if a few get locked up for awhile.
>Are there any admins out there that have policies about scripting >practices on their systems; ie, checking a script from a user before it >is allowed to be uploaded etc?
Possibly. But that's *GOT* to be very resource-intensive on the human side, and probably not useful for most situations.
I think the actual answer is that *MOST* admins are looking at the "big picture" and monitoring their machines rather than try to force users into a single channel or scrutinize every line of code.
If you try to force users into a single channel, you'll either make them all frustrated and drive them away, or there will be so many who find some work-around that it won't really be effective anyway.
I think we can safely say that scrutinizing every line of code is not an option for most.
Set up a monitoring system of your critical services (HTTP, MySQL) and just focus on quality of service, rather than perfection of your users.
While I understand your concerns, I think you're focusing too much on the details of what could go wrong, and missing the forest for the trees.
If something does go wrong, there will most likely be physical evidence (logs, error messages, top output) that you can use to find the problem quickly.
In the rare cases where it doesn't, be prepared to turn on logging and take the performance hit until you *CAN* find it.
Another suggestion: Provide a "development" setup for your users. If they have an easy place to put scripts/database calls and pound on it before it goes into Production to a live audience, they'll more likely use that and make sure the damn thing doesn't take down anything before going "live"
-- Like Music? http://l-i-e.com/artists.htm
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.
>http://php.net/error_log > >>would much rather pump the clf formatted log sting directly into the >appropriate >>apache log, but if I am not mistaken, using the above function would require >>permissions for user nobody(www, whatever) on the log files, no? > >Nope. >PHP is running as part of Apache. >PHP can ask Apache to write stuff into its own log. >That's one of the features of http://php.net/error_log >
error_log into the apache generated "httpd-error.log" (or whatever you like to have it named) works just fine. error_log($fEntry,0); #success, entry appears in httpd-error.log
What I am trying to do is to append an entry to the bottom of the "httpd-access.log" when the file upload succeeds to record the filesize etc... when attempting to do so a permission error is generated since uid nobody(web server) isn't allowed to write to the log file which is owned by the user (or root, or whomever) in this case (safe mode restriction, and file permissions)
the safe mode restriction and file permissions are bypassed when writing to the httpd-error.log file, as the command was evidently designed to do. It does not bypass when using error_log($fEntry,3,"/path/to/httpd-access.log"); even though both files have the same ownership and permissions(644)... the command simply succeeds on the httpd-error.log and doesn't on the httpd-access.log ...or more correctly on our server setup :)
Could remove safe mode and modify file permissions, but that requires opening up security (and log editing by clients) to accomplish it.
Or am I missing something?
Cheers,
Dave
attached mail follows:
Altn-N have a product called relayfax which is used with e-mail. You could use forms to send an email and have realyfax fax it
www.altn.com They have awesome support for their mailserver MDaemon so I would say realyfax would be equally as good
"Unknown Sender" <bogus
news.php.net> wrote in message
news:007d01bff8ae$7062bbe0$98519ac2
2112...
> Hello List,
> i guess that's a wrong place to ask this question, but...
> recently I received a web-site order for an
> online pizza ordering company, and they
> want their web-orders to be sent to their fax
> number.
> Does anyone if there is a way to make the server
> send info to a fax - or maybe some server addon that would allow
> e-mail messages be delivered to a fax??
>
> Thanks a lot,
> ~Peter
> ... tomorrow I will change,
> and today won't mean a thing ...
>
>
attached mail follows:
Greetings, is there a mySQL syntax command equivalent to appending information to a text record.
If I wanted to add an email value to a text record that already has an email value in it, is there a faster way to do this than reading the original value, combining the new value to it, and then running an UPDATE command?
- Thanks
attached mail follows:
update mytable set email = CONCAT(email,'gates
bluescreen.org');
On Wed, 24 Jul 2002 11:00:48 +1200, Jason Morehouse wrote:
> update mytable set email = CONCAT(email,'gates
bluescreen.org');
>
> On Wed, 24 Jul 2002 02:59:54 +1200, Shane wrote:
>
>> Greetings, is there a mySQL syntax command equivalent to appending information to a text record.
>>
>> If I wanted to add an email value to a text record that already has an email value in it, is there a faster way to do this than reading the original value, combining the new value to it, and then running an UPDATE command?
>>
>> - Thanks
-- Jason Morehouse (jm [] netconcepts [.] com) Netconcepts LTD - Auckland, New Zealand * Linux: Because rebooting is for adding hardware.
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
Here's what horror.php looks like -
lbar-highlight-color: #C20808; scrollbar-3dlight-color: #000000; scrollbar-darkshadow-color: #000000; scrollbar-track-color: #000000; scrollbar-arrow-color: #C20808; A {color:#C20808} A {text-decoration: none} A:active {text-decoration: none} A:active {color:#C20808;} A:visited {color:#C20808;} A:hover {text-decoration: underline overline} A:hover {color:#C20808} }
</style> <table width="100%" border="0"> <tr> <td rowspan="2" width="130" valign=top><? include("poll/menu.php") ?></td> <td width="*" height=104><center><img src=images/title.jpg width=450 height=104 border=0 valign=top></center></td> <td rowspan="2" width="150" valign=top><? include("right.php") ?></td> </tr> <tr> <td width="*" height="387" valign="top"> <br><? include("$page") ?> </td> </tr> </table>
Any help would be greatly recieved. Thanks in advance, Dan
attached mail follows:
Check if the $page variable has a value. I'm thinking they had 4.0.x before, or had register_globals enabled, and ur passing $page by querystring right?
Jason Reid
jason
achost.ca
-- AC Host Canada www.achost.ca----- Original Message ----- From: "Daniel Thompson" <dthompson
surfanytime.co.uk> To: <php-general
lists.php.net> Sent: Tuesday, July 23, 2002 10:41 AM Subject: [PHP] PHP 4.2.2 release problems
> 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 > > Here's what horror.php looks like - > > lbar-highlight-color: #C20808; > scrollbar-3dlight-color: #000000; > scrollbar-darkshadow-color: #000000; > scrollbar-track-color: #000000; > scrollbar-arrow-color: #C20808; > A {color:#C20808} > A {text-decoration: none} > A:active {text-decoration: none} > A:active {color:#C20808;} > A:visited {color:#C20808;} > A:hover {text-decoration: underline overline} > A:hover {color:#C20808} > } > > </style> > <table width="100%" border="0"> > <tr> > <td rowspan="2" width="130" valign=top><? include("poll/menu.php") > ?></td> > <td width="*" height=104><center><img src=images/title.jpg width=450 > height=104 border=0 valign=top></center></td> > <td rowspan="2" width="150" valign=top><? include("right.php") ?></td> > </tr> > <tr> > <td width="*" height="387" valign="top"> > <br><? include("$page") ?> > </td> > </tr> > </table> > > > Any help would be greatly recieved. Thanks in advance, > Dan > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php >
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
Thank You
Brian Paulson
Sr. Web Developer
bpaulson
chieftain.com
http://www.chieftain.com
attached mail follows:
Ok guys i got this problem here:
I got a class i made that creates a link ressource for a mysql database. Stores it inside of itself with different login and password and other params. Other functions are also available for usage.
When i start this class it connects fine, i can also use it no problem. BUT...At one point i start referencing this object to other objects so they can use one and only one connection.
If one of these alternate objects using the connection does an error, i can NO PROBLEM get the mysql_error() using the link ressource from inside the alternate object. If i try to get the error from outside that object in my top level script lets say, i use the one and only mysql_connection object and it still fails. it's like it doesn't see the error. (I think it's because the object is being copied, but i looked at my script several times 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.
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?
attached mail follows:
Hi, I'm just starting to learn PHP. I couldn't find how to execute unix command and read the result. Basically, I just want to execute "ls -lrt" and read and display the output.
This may be very simple question, but for some reason, I couldn't find any info on executing unix command from PHP.
Thanks.
-Paul
attached mail follows:
Maybe opendir() and readdir() would work for you?
opendir(): http://www.php.net/manual/en/function.opendir.php
readdir(): http://www.php.net/manual/en/function.readdir.php
Jason Soza
----- Original Message -----
From: "Paul Oh" <poh
cisco.com>
Date: Tuesday, July 23, 2002 3:03 pm
Subject: [PHP] Newbie: Reading unix directory information from PHP
> Hi, I'm just starting to learn PHP. I couldn't find how to > execute unix > command and read the result. Basically, I just want to execute > "ls -lrt" > and read and display the output. > > This may be very simple question, but for some reason, I couldn't > find any > info on executing unix command from PHP. > > Thanks. > > -Paul > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > >
attached mail follows:
Hi Paul,
this should help you out
<?php $LastLine = exec("ls -lrt", $AllOutput, $ReturnValue);
print("Last Line: $LastLine <BR>\n");
print("All Output:<BR>\n"); for ($index = 0; $index < count($AllOutput); $index++) { print("$AllOutput[$index] <BR>\n"); } print("<BR><BR>\n"); print("Return Value: $ReturnValue<BR>\n"); ?>
should work a treat for you ...
cheers Peter
> -----Original Message-----
> From: Paul Oh [mailto:poh
cisco.com]
> Sent: Wednesday, 24 July 2002 9:04 AM
> To: php-general
lists.php.net
> Subject: [PHP] Newbie: Reading unix directory information from PHP
>
>
> Hi, I'm just starting to learn PHP. I couldn't find how to execute unix
> command and read the result. Basically, I just want to execute "ls -lrt"
> and read and display the output.
>
> This may be very simple question, but for some reason, I couldn't find any
> info on executing unix command from PHP.
>
> Thanks.
>
> -Paul
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
>
attached mail follows:
on this you may want to have a look in the manual for exec(), the command I used in my example, or system() they both let you run applications on your server such as 'ls' and the like.
> -----Original Message-----
> From: Peter [mailto:php
vfsa.com.au]
> Sent: Wednesday, 24 July 2002 9:23 AM
> To: Paul Oh; php-general
lists.php.net
> Subject: RE: [PHP] Newbie: Reading unix directory information from PHP
>
>
> Hi Paul,
>
> this should help you out
>
> <?php
> $LastLine = exec("ls -lrt", $AllOutput, $ReturnValue);
>
> print("Last Line: $LastLine <BR>\n");
>
> print("All Output:<BR>\n");
> for ($index = 0; $index < count($AllOutput); $index++)
> {
> print("$AllOutput[$index] <BR>\n");
> }
> print("<BR><BR>\n");
> print("Return Value: $ReturnValue<BR>\n");
> ?>
>
> should work a treat for you ...
>
> cheers
> Peter
>
> > -----Original Message-----
> > From: Paul Oh [mailto:poh
cisco.com]
> > Sent: Wednesday, 24 July 2002 9:04 AM
> > To: php-general
lists.php.net
> > Subject: [PHP] Newbie: Reading unix directory information from PHP
> >
> >
> > Hi, I'm just starting to learn PHP. I couldn't find how to execute unix
> > command and read the result. Basically, I just want to execute
> "ls -lrt"
> > and read and display the output.
> >
> > This may be very simple question, but for some reason, I
> couldn't find any
> > info on executing unix command from PHP.
> >
> > Thanks.
> >
> > -Paul
> >
> >
> >
> > --
> > 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'm trying to develop a thumbnail creation module for a website but I can't get gd library to work in a Win2000 Advanced Server, PHP 4.2.1, IIS 5.
Does anybody has the php_gd.dll for this version??
Thanks.
Jadiel Flores
-------------------------
http://www.abargon.com
jflores
abargon.com
(52-55) 52-29-80-34
attached mail follows:
Jadiel,
i do that the file ur after and tried sending it to u but ur server rejected it.
> -----Original Message-----
> From: Jadiel Flores [mailto:jflores
abargon.com]
> Sent: Wednesday, 24 July 2002 9:03 AM
> To: php-general
lists.php.net
> Subject: [PHP] GD Library for Windows
>
>
> I'm trying to develop a thumbnail creation module for a website
> but I can't
> get gd library to work in a Win2000 Advanced Server, PHP 4.2.1, IIS 5.
>
> Does anybody has the php_gd.dll for this version??
>
> Thanks.
>
>
> Jadiel Flores
> -------------------------
> http://www.abargon.com
> jflores
abargon.com
> (52-55) 52-29-80-34
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
>
attached mail follows:
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
attached mail follows:
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 > > 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
-- If you pick up a starving dog and make him prosperous, he will not bite you; that is the principal difference between a dog and a man.Samuel Clemens
attached mail follows:
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:
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) )
-R
"Ragnar" <ragnar
chello.no> wrote in message
news:20020722234455.41274.qmail
pb1.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
>
>
attached mail follows:
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
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]