Re: [PHP] [PHP5RC3] echo " $this->db->host " not work

2004-07-11 Thread Chris
Try enclosing the variable in Curly Braces echo " {$this->db->host} "; Otherwise, the string parser sees $this->db as the variable you're referring to. Chris Tomasen wrote: assume $this->db is an object. $db->host is a string "localhost". ehco $this->db->host; // will output localhost but ehco "

Re: [PHP] [PHP5RC3] echo " $this->db->host " not work

2004-07-11 Thread Michal Migurski
> echo $this->db->host; > // will output > localhost > > but > echo " $this->db->host "; > // whill output > Object id #2->host > > is that a bug. or just have to workout by myself? http://www.php.net/manual/en/language.types.string.php#language.types.string.parsing.complex --

[PHP] [PHP5RC3] echo " $this->db->host " not work

2004-07-11 Thread Tomasen
assume $this->db is an object. $db->host is a string "localhost". ehco $this->db->host; // will output localhost but ehco " $this->db->host "; // whill output Object id #2->host is that a bug. or just have to workout by myself? Thanks for all your good work Tomasen -- PHP General Mailing List

[PHP] unset empty elements in an array

2004-07-11 Thread Justin French
Hi, Looking for a one-liner to delete all empty elements in an array. I know I can do it with a foreach loop, but I'm hoping that I've missed an existing function in the manual which may already do this, or a simple one-liner to replace the foreach. $v) { if(empty($v)) {

[PHP] Re: search string / query format

2004-07-11 Thread Jason Barnett
You might try checking out the Codewalkers.com previous contests. They did one a while back that was for accessing google through PHP scripts. I doubt any of them would have database support built-in, but it would give you a head start on the input fields. -- PHP General Mailing List (http://

Re: [PHP] MySQL/PHP Tunneling

2004-07-11 Thread Karam Chand
Hello, Well, I know there are issues regarding this (security as well as others). But tools like MySQL-Front and DBTools are just doing that and it just happens that the project i am working on needed something like that, so I was just asking :) Regards, Karam --- Curt Zirzow <[EMAIL PROTECTED]>

[PHP] installing 4.3.x and 5.x

2004-07-11 Thread Alex Duggan
Hello, Is it possible to build php-4.3.x and php-5.0.0RC3 both as static modules into apache-1.3? If so, can the two version of php be installed in the same prefix? or should they be installed in /usr/local/php4 and /usr/local/php5? Thanks, Alex -- PHP General Mailing List (http://www.php.net

Re: [PHP] usort e & é together

2004-07-11 Thread John Taylor-Johnston
Sorry, doesn't work either. http://compcanlit.usherbrooke.ca/new1/db/index.php?ausenquiry=e does not contain those that start with é: http://compcanlit.usherbrooke.ca/new1/db/index.php?ausenquiry=é function usort_callback($a, $b) { $a = str_replace(array('à', 'é'), array('a', 'e'), strtolow

Re: [PHP] usort e & é together

2004-07-11 Thread John Taylor-Johnston
Thanks! What does var_dump do? (I didn't really understand the manual.) "Miroslav Hudak (php/ml)" wrote: > Pardon me for the strtolower line, i've just forgot there... it's 4:30AM > here in Slovakia... :/ > > correct listing follows... > > $authors = array('élen', 'Élen', 'Elison', 'ámadeus', 'a

[PHP] Re: [Q] Why does my php file gets displayed instead of executed

2004-07-11 Thread Michael T. Peterson
Per request, here are the two other source files that get executed prior to the invocation of validate_member_login.php, index.php and init.php. But first, here's a simple restatement of the problem: (1) Direct the browser to open index.php (2) init.php is included by index.php. (3) index.php dis

Re: [PHP] usort e & é together

2004-07-11 Thread Miroslav Hudak (php/ml)
Pardon me for the strtolower line, i've just forgot there... it's 4:30AM here in Slovakia... :/ correct listing follows... $authors = array('élen', 'Élen', 'Elison', 'ámadeus', 'albert', 'alfred', 'amadeus', 'elen'); function usort_callback($a, $b) { $a = str_replace(array('á', 'é'), array

Re: [PHP] usort e & é together

2004-07-11 Thread Miroslav Hudak (php/ml)
this is slightly changed function of yours, written for better readability... $authors = array('élen', 'Élen', 'Elison', 'ámadeus', 'albert', 'alfred', 'amadeus', 'elen'); function usort_callback($a, $b) { $a = strtolower($a); $b = strtolower($b); $a = str_replace(array('á', 'é'), arra

Re: [PHP] usort e & é together

2004-07-11 Thread John Taylor-Johnston
http://compcanlit.usherbrooke.ca/new1/db/index.php?ausenquiry=e http://compcanlit.usherbrooke.ca/new1/db/index.php?ausenquiry=é It still sorts "é" and "e" separately, but without a parse error: $first = array('à', 'é'); $second = array('a', 'e'); usort($authors, create_function('$a,$b','

Re: [PHP] parse error: [PHP] usort e & é together

2004-07-11 Thread Miroslav Hudak (php/ml)
Dunno the original question, but this obviously should be escaped... So the correct code follows... usort($authors, create_function('$a,$b',' $a = str_replace(array(\'é\', \'a\'), array(\'e\', \'a\'), $a); $b = str_replace(array(\'é\', \'a\'), array(\'e\', \'a\'), $b); return strc

Re: [PHP] parse error: [PHP] usort e & é together

2004-07-11 Thread John Taylor-Johnston
Sorry. Still getting a parse error on line 40: 39> usort($authors, create_function('$a,$b',' 40> $a = str_replace(array('é', 'à'), array('e', 'a'), $a); 41> $b = str_replace(array('é', 'à'), array('e', 'a'), $b); 42> return strcasecmp($a,$b);')); Can you have two arrays

Re: [PHP] Re: [Q] Why does my php file gets displayed instead of executed

2004-07-11 Thread Tom Rogers
Hi, Monday, July 12, 2004, 10:28:59 AM, you wrote: MTP> Here is some additional info: MTP> My other PHP scripts execute just fine, including the php script init.php MTP> which uses header(...) to dispatch to the member_login.htm page. Recall that MTP> the problem arises when validate_member_login

Re: [PHP] Re: [Q] Why does my php file gets displayed instead of executed

2004-07-11 Thread Miroslav Hudak (php/ml)
this all seems just fine to me, aren't you sending some Header: Content-type -s? could you post that init.php script source? and is that apache server working well for other scripts that are called from the forms? AND ... just to be sure,... are you calling that html which contains the form thru

[PHP] Re: [Q] Why does my php file gets displayed instead of executed

2004-07-11 Thread Michael T. Peterson
Here is some additional info: My other PHP scripts execute just fine, including the php script init.php which uses header(...) to dispatch to the member_login.htm page. Recall that the problem arises when validate_member_login.php is invoked from member_login.htm. When validate_member_login.php is

Re: [PHP] [Q] Why does my php file gets displayed instead of executed

2004-07-11 Thread Michal Migurski
> The problem is that the php script, validate_member_login.php, is > displayed in the browser rather than being executed. Are you running an Apache server? If so, be sure you have the appropriate AddType lines in your configuration, as described in http://www.php.net/manual/en/install.apache.php

[PHP] [Q] Why does my php file gets displayed instead of executed

2004-07-11 Thread Michael T. Peterson
When a user first comes to my site, the user's session id is checked and validated. If no session id is present or the validation fails, the user is vectored to a second page containing a login form. When the user enters the username and password and then clicks the submit button the info is forwa

Re: [PHP] storage of encrypted data

2004-07-11 Thread Curt Zirzow
* Thus wrote klaus: > Hi all, > > I want to store PHP-encrypted (Rijndael_256) data in MySQL. > > The problem is: > If the encrypted string includes " the MySQL-query is influenced. > > Therefore the question: > Is it possible to define characters n o tto be used by the > crypto-function?

Re: [PHP] Where should I put my mysql database???

2004-07-11 Thread Curt Zirzow
* Thus wrote Levis Li: > Hi friends > I am now using the college's virtual web space. I have my working directary on that > SunOS/apache/PhP/Oracle/MySQL server. The question is that : > Can i create the Mysql database in my working directary??How?Also if > I dont want to set the password, who wil

RE: [PHP] CMS solution + web sites in CVS.

2004-07-11 Thread Ed Lazor
Hey Lukasz, I had a similar situation. Documents are now stored in MySQL. Authors can log in and add or edit their own documents. I control the look and feel of the main site. You can see an example by creating an account on AtFantasy.com and logging in. It takes advantage of modules from Int

Re: [PHP] Re: displaying database results with forward and back buttons

2004-07-11 Thread Curt Zirzow
* Thus wrote John Taylor-Johnston: > Finally something I can give back, made by my little lonesome with no help :) heh.. we all started somewhere. > > > I have a query that returns lots of rows so I want to display the results in > > blocks of 25 or so on my web page and have forward and back b

Re: [PHP] parse =?unknown-8bit?q?error=3A_?==?unknown-8bit?q?=5BPHP=5D_usort_e_&_=E9?= together

2004-07-11 Thread Curt Zirzow
* Thus wrote John Taylor-Johnston: > I went with this, but am getting a parse error. > > usort($authors, create_function('$a,$b',' > $a = str_replace(array('é', 'à'), array('e', 'a'), $a); > $b = str_replace(array('é', 'à'), array('e', 'a'), $b); > return strcasecmp($a,$b);

[PHP] storage of encrypted data

2004-07-11 Thread klaus
Hi all, I want to store PHP-encrypted (Rijndael_256) data in MySQL. The problem is: If the encrypted string includes " the MySQL-query is influenced. Therefore the question: Is it possible to define characters n o tto be used by the crypto-function? Greetings Klaus -- PHP General Mailin

Re: [PHP] MySQL/PHP Tunneling

2004-07-11 Thread Curt Zirzow
* Thus wrote Karam Chand: > --- Curt Zirzow <[EMAIL PROTECTED]> wrote: > > Now, many of the ISPs blokc 3306 for security reason > and you cannot access MySQL from a 3rd party tool and > have to use phpMyAdmin which is able to access the > MySQL server as it is running on the same box. > Sometimes,

Re: [PHP] MySQL/PHP Tunneling

2004-07-11 Thread Jason Wong
On Sunday 11 July 2004 13:07, Karam Chand wrote: > Sorry. But I just didnt remember the email addy so I > took that way :). Can't resist picking on this one. All posts to the list should/would have the list address in the To: header. It's not that hard to copy paste the address into a *new* mai

Re: [PHP] Re: displaying database results with forward and back buttons

2004-07-11 Thread i sidhu
The main part of code i m using for Forward and Backward is, if($page > 1) { $prev = ($page - 1); echo "< "; } for($i = 1; $i <= $total_pages; $i++) { if(($page) == $i) { echo "$i "; } else { echo "$i "; } } // Build Next Link if($page < $total_

Re: [PHP] parse error: [PHP] usort e & é together

2004-07-11 Thread Marek Kilimajer
I'm sorry, I used unescaped single quotes inside single quoted string, this is right: usort($authors, create_function('$a,$b',' $a = str_replace(array("é", "à"), array("e", "a"), $a); $b = str_replace(array("é", "à"), array("e", "a"), $b); return strcasecmp($a,$b);')); Joh

Re: [PHP] Re: sort() - Where did I go wrong?

2004-07-11 Thread Marek Kilimajer
John Taylor-Johnston wrote: Like this? ".preg_replace ('/('.preg_quote($searchenquiry).')/i' , "$1", $mydata->JR)."  Still getting the unknown modifier error. No, like this: preg_quote($searchenquiry, '/') so also the delimiter - /, is quoted $searchenquiry = "1.0.1 Retrospective bibliographies

[PHP] Re: displaying database results with forward and back buttons

2004-07-11 Thread John Taylor-Johnston
Finally something I can give back, made by my little lonesome with no help :) > I have a query that returns lots of rows so I want to display the results in blocks > of 25 or so on my web page and have forward and back buttons to navigate the results. include it first: include("settings_limit.i

[PHP] Re: Where should I put my mysql database???

2004-07-11 Thread John Taylor-Johnston
In my c«ase, it was built into redhat. Installing it in a local user account? Can't do that, but I'm no expert. You would need root-lvel access to change variables on the server too, no? In php.ini for one. Ask your sysadmin for an account. Levis li wrote: > Hi friends > I am now using the coll

[PHP] Re: Passing Variables

2004-07-11 Thread John Taylor-Johnston
To go back to a previous conversation, I would not put it on the action=. You are using METHOD=post? I wold use or to really hide them use session variables so they are completely hidden. Or use a cookie (but that is not the most secure way). Harlequin wrote: > I'm just working on my syntax

[PHP] Re: mail problem

2004-07-11 Thread John Taylor-Johnston
You don't need sendmail. In php.ini you need to add something. SMTP = [EMAIL PROTECTED] is not right? You want an address, not an email. SMTP = smtp.uol.com.br is more likely the correct address. Joao Gomes wrote: > Hi, > > I am a beginner in php and I am trying to send emails from my machinne

Re: [PHP] Re: sort() - Where did I go wrong?

2004-07-11 Thread John Taylor-Johnston
Like this? ".preg_replace ('/('.preg_quote($searchenquiry).')/i' , "$1", $mydata->JR)."  Still getting the unknown modifier error. > > $searchenquiry = "1.0.1 Retrospective bibliographies and checklists / > > bibliographies et répertoires rétrospectifs"; > > > > preg_replace ('/('.$searchenqu

[PHP] parse error: [PHP] usort e & é together

2004-07-11 Thread John Taylor-Johnston
I went with this, but am getting a parse error. usort($authors, create_function('$a,$b',' $a = str_replace(array('é', 'à'), array('e', 'a'), $a); $b = str_replace(array('é', 'à'), array('e', 'a'), $b); return strcasecmp($a,$b);')); Anyone see it? I've got headaches from sq

[PHP] Where should I put my mysql database???

2004-07-11 Thread Levis Li
Hi friends I am now using the college's virtual web space. I have my working directary on that SunOS/apache/PhP/Oracle/MySQL server. The question is that : Can i create the Mysql database in my working directary??How?Also if I dont want to set the password, who will be helping me? Thanks!! Levis

Re: [PHP] displaying database results with forward and back buttons

2004-07-11 Thread Larry E . Ullman
I have a query that returns lots of rows so I want to display the results in blocks of 25 or so on my web page and have forward and back buttons to navigate the results. Can someone point me in the right directions please I have tried to look around for something using google but cant think of

[PHP] displaying database results with forward and back buttons

2004-07-11 Thread Matthew Oatham
Hi, I have a query that returns lots of rows so I want to display the results in blocks of 25 or so on my web page and have forward and back buttons to navigate the results. Can someone point me in the right directions please I have tried to look around for something using google but cant think

[PHP] Re: Passing Variables

2004-07-11 Thread Harlequin
Thanks Tim. Solved the problem. -- - Michael Mason Arras People www.arraspeople.co.uk - "Harlequin" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > I'm just working on my syntax for passing a variable "UserID" from one page

[PHP] Re: Passing Variables

2004-07-11 Thread Tim Van Wassenhove
In article <[EMAIL PROTECTED]>, Harlequin wrote: > I'm just working on my syntax for passing a variable "UserID" from one page > to the next and it works a little like this so far: > > As you seem to have _many_ problems, i can only advise you to read the manual.. and read it again.. and again...

[PHP] Re: [PHP-DB] Table locking

2004-07-11 Thread Miles Thompson
Rosen, You've got your insertion order backwards. Insert in table1 Grab the key with mysql_insert_id - assuming you have an autoincrement field as primary key on that table. Call it something like master_key. Insert the detail records in table2, with the key you just grabbed from table1 (master_k

[PHP] Passing Variables

2004-07-11 Thread Harlequin
I'm just working on my syntax for passing a variable "UserID" from one page to the next and it works a little like this so far: On my form I have: " Generates: for example: ['\"JDoe\"'] Which part of my syntax is incorrect...? -- - Michael Mason Arras People ww

[PHP] Re: mail problem

2004-07-11 Thread Tim Van Wassenhove
In article <[EMAIL PROTECTED]>, Joao Gomes wrote: > [mail function] > ; For Win32 only. > SMTP = [EMAIL PROTECTED] I don't think [EMAIL PROTECTED] is a valid hostname. -- Tim Van Wassenhove -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: h

Re: [PHP] Re: sort() - Where did I go wrong?

2004-07-11 Thread Marek Kilimajer
John Taylor-Johnston wrote: I'm having a similar problem here if I pass a numeral inside $searchenquiry $searchenquiry = "1.0.1 Retrospective bibliographies and checklists / bibliographies et répertoires rétrospectifs"; preg_replace ('/('.$searchenquiry.')/i' , "$1", $mydata->RB) error: Unknown mo

Re: [PHP] usort e & é together

2004-07-11 Thread Marek Kilimajer
John Taylor-Johnston wrote: I think my problem lies in usort. I have a big honker of an array which I usort. $ausenquiry = "e"; and $ausenquiry = "e"; give a separate result. I want to conjoin them. Possible? The same would be true for "a" and "à". usort distinguishes between é and e. Any way aroun

Re: [PHP] mail problem

2004-07-11 Thread Aidan Lister
> Is it not true that $HTTP_POST_VARS is more secure than $_POST, even though > the latter is a superglobal? Doesn't the former acount for un-updated > server versions? > If it isn't, what disadvantage is there to using $HTTP_POST_VARS? Why > should one use $_POST instead? No, $HTTP_xxx is not

[PHP] Re: sort() - Where did I go wrong?

2004-07-11 Thread Aidan Lister
I don't see how these questions are related, please ask each question separately next time. If you want to put variables in your regex's, you must use preg_quote. "John Taylor-Johnston" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Ok. This is not a numeral problem? strval did no

Re: [PHP] mail problem

2004-07-11 Thread Dennis Seavers
Jason, et al: Is it not true that $HTTP_POST_VARS is more secure than $_POST, even though the latter is a superglobal? Doesn't the former acount for un-updated server versions? If it isn't, what disadvantage is there to using $HTTP_POST_VARS? Why should one use $_POST instead? (P.S.: Aidan Li

Re: [PHP] mail problem

2004-07-11 Thread Justin Patrin
You should also be using $_POST instead of $HTTP_POST_VARS. $_POST is a superglobal, so you can use it anywehere, it's shorter ;-), and it's the "official" way to access post vars. On Sun, 11 Jul 2004 08:52:54 +0800, Jason Wong <[EMAIL PROTECTED]> wrote: > On Sunday 11 July 2004 08:33, Joao Gomes

[PHP] Re: sort() - Where did I go wrong?

2004-07-11 Thread John Taylor-Johnston
Ok. This is not a numeral problem? strval did not make a difference. I have, however, solved the immediate problem with: # if((strtolower(substr($enquiry, 0, 1)) == $rbenquiry)) if((strtolower(substr($enquiry, 0, strlen($rbenquiry))) == $rbenquiry)) However, preg_replace ('/('.$searchenquiry.')/i