Re: [PHP] Negative Look Ahead Regex - Code Mistake or Bug?

2008-08-18 Thread Cameron B. Prince
caffoh6jaeapkke35qpp87;?)/', 'http://www.domain.com$1?PHPSESSID=t9gksvpdcuobsnqt98qloe6lg4;', $buffer); (not tested) Simcha Younger -Original Message- From: Cameron B. Prince [mailto:[EMAIL PROTECTED] Sent: Monday, August 18, 2008 12:56 AM To: php-general@lists.php.net Subject: [PHP

Re: [PHP] Re: Negative Look Ahead Regex - Code Mistake or Bug?

2008-08-18 Thread Cameron B. Prince
preg_quote() do it. Cameron B. Prince wrote: Hello, I¹ve run into a problem with a regex and need help determining if this is my mistake or a bug. The regex is for inserting a SID into every link in the buffer before it¹s flushed, but only when each link doesn¹t already have a SID

[PHP] Negative Look Ahead Regex - Code Mistake or Bug?

2008-08-17 Thread Cameron B. Prince
Hello, I¹ve run into a problem with a regex and need help determining if this is my mistake or a bug. The regex is for inserting a SID into every link in the buffer before it¹s flushed, but only when each link doesn¹t already have a SID. An example of the code is here: $buffer =

Re: [PHP] Negative Look Ahead Regex - Code Mistake or Bug?

2008-08-17 Thread Cameron B. Prince
Hi Ash, As far as I can tell, you have an error in your syntax. You're using a - (hyphen) character in the first match, but Regex uses this to define a range of characters. It seems that if you don't escape it, the whole thing behaves a little strangely. For example, using your URL as the

RE: [PHP] PHP On Solaris 9 - MySQL Problem

2004-03-18 Thread Cameron B. Prince
Hi Tom, This was a good idea... You might try an fsockopen() to port 3306 on the dbserver and see if it works. If not, you get a reasonably descriptive error. I just tried a couple of known servers and bogus addresses with this code: ?php $ipaddr = localhost; # substitute the IP

RE: [PHP] PHP On Solaris 9 - MySQL Problem

2004-03-18 Thread Cameron B. Prince
Hi Tom, Ah, that's good. Then it is just a problem of MySQL. Have you tried accessing a remote machine running MySQL 3.2x instead of 4.0? That seems like an obvious potential culprit. I just finished doing that on a third machine that didn't have a previous MySQL installation. I

RE: [PHP] PHP On Solaris 9 - MySQL Problem

2004-03-18 Thread Cameron B. Prince
I just finished doing that on a third machine that didn't have a previous MySQL installation. I installed the same version that the webserver has. I had the same results. I'm losing track here -- are you saying you can't connect to another machine running MySQL 3.x from PHP but you

[PHP] MySQL Connect Problem

2004-03-17 Thread Cameron B. Prince
Hey guys, I've been developing my site on a dev server with MySQL locally installed. I've now moved the site to the production webserver and setup my databases on the production dbserver, which are two different machines. I have begin updating my connection variables and now I find I can't

RE: [PHP] MySQL Connect Problem

2004-03-17 Thread Cameron B. Prince
Hi Adam, What happens when you try to use the mysql client on the web machine, to connect to the production database server? It works: bash-2.05# pwd /usr/local/mysql/bin bash-2.05# ./mysql -h 192.168.1.44 -u web -P 3306 -p Enter password: Welcome to the MySQL monitor. Commands end with ;

RE: [PHP] MySQL Connect Problem

2004-03-17 Thread Cameron B. Prince
So what error prints out when you try and connect from PHP? Could not connect : Can't connect to MySQL server on '192.168.1.44' (2) Not very helpful huh? Any ideas? Cameron -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

RE: [PHP] MySQL Connect Problem

2004-03-17 Thread Cameron B. Prince
Change your server address, to leave off the port number. Any different? $DBhost = 192.168.1.44; $DBuser = web; $DBpwd = user; $DBreg = registration; $DBconf = config; # setup database handle and load configuration data $dbh = mysql_connect($DBhost, $DBuser, $DBpwd) or die(Could not

RE: [PHP] MySQL Connect Problem - Client Lib / Server Version Skew

2004-03-17 Thread Cameron B. Prince
What does your MySQL error log say on your production database server? It should be in the var directory named something .err. These are SunFire 210 Solaris boxes. The MySQL is installed from binary. It doesn't write a log by default as best I can tell, but I did find something. The MySQL on

RE: [PHP] MySQL Connect Problem - Client Lib / Server Version Skew

2004-03-17 Thread Cameron B. Prince
I would think the mysqlclient library would be backwards compatible, but it's possible I guess. I'm kind of out of ideas, as the can't connect error without something like a bad username or password message, seems to indicate a TCP/IP communication failure. Well, after thinking more

[PHP] PHP On Solaris 9 - MySQL Problem

2004-03-17 Thread Cameron B. Prince
Hey guys, I'm back again after trying many more things to solve this problem. If you weren't following the previous thread with Adam, I moved my site from a single development machine to the production environment which consists of a separate webserver and dbserver. At that point, PHP could no

RE: [PHP] PHP On Solaris 9 - MySQL Problem

2004-03-17 Thread Cameron B. Prince
: Cameron B. Prince [mailto:[EMAIL PROTECTED] Sent: Wednesday, March 17, 2004 4:55 PM To: [EMAIL PROTECTED] Subject: [PHP] PHP On Solaris 9 - MySQL Problem Hey guys, I'm back again after trying many more things to solve this problem. If you weren't following the previous thread with Adam

[PHP] Undefined Index Errors

2004-02-06 Thread Cameron B. Prince
Hey guys, Here's a chunk of code from the top of a multi-function page I converted from Perl to PHP: $userid = $_REQUEST['USERID'];# USERID = selected userid $dlist= $_REQUEST['DLIST']; # DLIST = indicates who to display $action = $_REQUEST['ACTION'];# ACTION =

RE: [PHP] Undefined Index Errors

2004-02-06 Thread Cameron B. Prince
1. put @ in front of each variable, e.g. $adminID = @$_ENV['HTTP_REMOTE_USER']; This worked very nicely... Thank you! Hey guys, Here's a chunk of code from the top of a multi-function page I converted from Perl to PHP: $userid = $_REQUEST['USERID'];# USERID =

[PHP] Pattern Capture

2004-01-13 Thread Cameron B. Prince
Ok, I feel really lame for asking this, but I can I do this in PHP: $userid =~ /([\D]+)/; $baseName = $1; It seems like Pattern Capture is not the right term for the similar function in PHP. I'm not sure what to search for. Thanks, Cameron -- PHP General Mailing List (http://www.php.net/) To

[PHP] Array Key Test

2004-01-12 Thread Cameron B. Prince
Hi, How would I go about determining if a specific key exists in an array? I want to see if $conf['hOpt'] is defined. is_array only works at the $conf level. I tried count(array_keys($conf, 'hOpt')), but always get 0. What am I doing wrong here? Thanks, Cameron -- PHP General Mailing List

[PHP] Dynamically Created Arrays

2004-01-09 Thread Cameron B. Prince
Hey guys, I'm making progress on my perl to PHP conversion project but I need some help... I have a configuration table in MySQL made up like this: CREATE TABLE config ( code mediumint(9) NOT NULL auto_increment, site varchar(32) NOT NULL default '', name varchar(64) NOT NULL default '',

RE: [PHP] Dynamically Created Arrays

2004-01-09 Thread Cameron B. Prince
Message- From: Marek Kilimajer [mailto:[EMAIL PROTECTED] Sent: Friday, January 09, 2004 11:06 AM To: Cameron B. Prince Cc: [EMAIL PROTECTED] Subject: Re: [PHP] Dynamically Created Arrays This should be what you need: if(!is_array($conf[$name])) $conf[$name] = array($val); else $conf[$name

[PHP] PHP Compile w/ Sun ONE Directory Server

2003-12-23 Thread Cameron B. Prince
Hi, I am trying to compile PHP with LDAP support via the Sun ONE Directory Server. I am running into a problem where some functions aren't being found in the include or shared libraries. Here's my configure command: export

[PHP] PHP Template Function

2003-12-18 Thread Cameron B. Prince
Hello, I have just been assigned to a project to convert a large static site to PHP. I have used PHP for small jobs in the past, but most of my work has been with Perl. One feature I've used and liked very much was provided by a package called Embperl. In particular, Embperl::Object, which allows