Re: [PHP] sleep function

2005-05-13 Thread Richard Lynch
On Thu, May 12, 2005 8:38 pm, James Williams said:
 I just tried a couple of output_buffering on a test script I made and
 it won't work... It simply waits for 10 seconds then displays
 everything...  Kinda sucks.

If you're going to flush() and ob_flush() that much, you might as well not
use ob_start or output buffering at all.

Rip out all the ob_* stuff and see if it works under Windoze.

PS The one I looked at on your site worked just fine...

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

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



Re: [PHP] 'Require' and 'Select' lists

2005-05-13 Thread Richard Lynch
On Thu, May 12, 2005 8:41 pm, Andre Dubuc said:
 I've had some rather odd intermittent behavior with a select list drawn by
 a
 'require' on my production site. Sometimes, rather than displaying 'In
 USA/Canada' from the 'option selectedIn USA/Canada/option' code in the
 required file, it will display a blank. Yet, if I try to duplicate this
 behavior on the development box, it will display as coded.

 Since I use this text string as a validator for user input, it really
 messes
 up the database/code functions that rely on it.

In that case, your validation routines aren't very good.

You have to assume the data coming from the browser is completely messed
up in malicious ways.  If not providing that item in the menu will break
your script or hash your data, then that's really a bigger problem than
the one you think you have.

 ?php require(provcountry.sty); ?

 [snippet of 'require' text (provcountry.sty)]
 tr
 tdbState nbsp;/b/td
 tdSELECT NAME=selstate
   option selectedIn USA/Canada/option

I'd try using an html entity on the '/' in USA/Canada

   option value=AlabamaAlabama/option
 . . .
 /SELECT/td
 /tr

 [snippet of some validating code verifying $selstate that relies on
 $selstate]

 ?php
 if (($_POST['selstate'] != In USA/Canada)($_POST['typstate'] != ))
  die (h5brbrPlease choose from 'In USA/Canada' or type in 'Other
  State'.
 brDo not use bothbrbrClick 'Back' on your  browser to
  re-enter information/h5);
 ?

 Any ideas why this is happening?

It's quite possible that some sort of php.ini setting with Magic Quotes or
something is altering the '/' character as well.

What *IS* in $_POST['selstate'] when it breaks?  Log it and see what the
data is.`

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

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



RE: [PHP] beginner needs help!

2005-05-13 Thread Kim Madsen

 -Original Message-
 From: Jay Blanchard [mailto:[EMAIL PROTECTED]
 Sent: Thursday, May 12, 2005 9:37 PM


  var $exportFile = Export. . date(mdy) . .txt;
 
  I seem to be able to use the date function is I am not starting the
  declaration with var, but then my program is not working correctly.
 [/snip]

 You may have to assemble it beforehand sort of ...
 
 $exportFileName = Export. . date(mdy) . .txt;
 var $exportFile = $exportFileName;

May? You _have_ to. This behavior was introduced in PHP4 as the only non-PHP3 
compatible OOP behavoir as far as I know. Nice spotted for a beginner Rochelle 
:-) I mean the I´m not allowed to use a function call while declaring with 
var. 

Explanation:
PHP3 allowed one to use a function call while declaring a variable:

var $welcome_text = Welcome  . get_username_from_db($loginname) . . Today is 
 . date(l) . , have a nice day;

As of PHP4 one _can´t_ use a function call when declaring a var, but _has_ to 
do as in Your example Jay:

var $welcome_text; 
$welcome_text = Welcome  . get_username_from_db($loginname) . . Today is  . 
date(l) . , have a nice day;


Pay attention to this though: You _not_ suppose to use var to declare a 
variable unless it´s inside a class. I never really tested that before, but 
outside a class this won´t work:

?
var $test = hello;
echo $test; // returns nothing
?

--
Med venlig hilsen / best regards
ComX Networks A/S
Kim Madsen
Systemudvikler/Systemdeveloper

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



Re: [PHP] Help!!! Cannot do Authentication

2005-05-13 Thread Richard Lynch
On Thu, May 12, 2005 9:27 am, K.S. TANG said:
 I have a page using the Basic HTTP Authentication and works well before.
 But this night, the server seems to not receiving any $_SERVER pass in
 from
 Web browsers.

   if ( (!isset($_SERVER['PHP_AUTH_USER'])) || ($_SERVER['PHP_AUTH_USER']
 !=
 netop) || ($_SERVER['PHP_AUTH_PW'] != cti63) ) {
header('WWW-Authenticate: Basic realm=Please enter User Name and
 Password:');
header('HTTP/1.0 401 Unauthorized');
echo 'Authentication error!!';

var_dump($_SERVER);

exit;
   }

 I've trial to put this on another server, it doesn't work too !! (but it
 works before also).

 I've trial to use the most simple code from php.net

   if (!isset($_SERVER['PHP_AUTH_USER'])) {
header('WWW-Authenticate: Basic realm=My Realm');
header('HTTP/1.0 401 Unauthorized');
echo 'Text to send if user hits Cancel button';

var_dump($_SERVER);

exit;
   } else {
echo pHello {$_SERVER['PHP_AUTH_USER']}./p;
echo pYou entered {$_SERVER['PHP_AUTH_PW']} as your password./p;
   }

 But it doesn't work too. The browser ask for the user name and password
 for
 three times and than echo the line Text to send if user hits...

 Please !!! Please help me.
 Thanks a lot.

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




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

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



Re: [PHP] protected too much!

2005-05-13 Thread Richard Lynch
On Thu, May 12, 2005 7:05 pm, Miguel Vaz said:

   I am having a weird problem with a simple file listing on one of my
 client's host.

   My code works perfectly on my host, but if i use the same code on his, 
 it
 only lists certain types of files. Heres the code: (i hate hosts that only
 allow php inside the cgi-bin dir, its crazy to code like this)

 #!/usr/local/bin/php
 ?
 $count = 0;
 $handle=opendir(/whu1/sites/op158006/public_html/clientes/adagio/);
 while (($file = readdir($handle)) !== false) {
   if ($file == . || $file == .. || $file == list.php) {
   } else {
   if (filetype($file) == file) {
   $size= filesize($file)/1000;
   print $file ($size KB)br;
   $count ++;
   }

   else{
 echo They filetype of $file is , filetype($file), br
/\n;
   }

   }
 }
 closedir($handle);
 print  b$count/b Ficheiro(s)br;
 ?

   This hoster only allows PHP inside the cgi-bin directory. And i can only
 list files properly if i list that dir (cgi-bin). I.E. if i use:

   $handle=opendir(/whu1/sites/op158006/cgi-bin/);

   it lists the dir perfectly, with images or whatever it might have in
 there. But if i try to list somje other dir outside the cgi-bin scope list
 comes out only with .txt and .php type of files, if i have an image in
 there it simply ignores it.
   Why does this happen? Its so frustrating!

Actually...

You need to provide the FULL PATH to filetype, almost for sure:
$dir = /really/long/path/I/should/have/copied/;
$handle = opendir($dir);
.
.
.
  if (filetype($dir/$file)){
.
.
.

It only works on the cgi/bin directory because that happens to be the
current working directory -- the directory you start in.

It probably isn't printing the filenames in the other directory -- The
filenames happen to match up, both in cgi/bin and the other directory, for
the files you see...

So the readdir() is giving you the filename in the other directory, but
filetype() is looking at the file in cgi/bin and acting on that one.

Any time files in PHP give you trouble, use the FULL PATH to the file.

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

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



Re: [PHP] Header Location redirection parameters fail to redirect

2005-05-13 Thread Deep
Hi,

  If the parameters are available at the url of
mysite.com. Then the parameters should be available
there in the page to echo. Instead of $_REQUEST try
$_GET

Try using this..

?php
echo h3mysite.com Homepage /h3 ;
$lang=$_GET['lang'];
$ctry=$_GET['ctry'];
echo Country= .$ctry. br Language= .$lang;
?

...Deeps...


--- Olav Drageset [EMAIL PROTECTED] wrote:
 I want url mysite.no to redirect to mysite.com with
 parameters lang=no 
 and ctry=no, but the parameters do not follow the
 redirection.
 
 mysite.no/index.php is
 
 ?
 Header ('Location:
 http://mysite.com/index.php?lang=noctry=no'  ) ;
 exit;
 ?
 
 
 mysite.com/index.php is
 
 ? echo h3mysite.com Homepage /h3 ;
 $lang = $_REQUEST['lang'];
 $ctry = $_REQUEST['ctry'];
 echo Country= $ctry br Language= $lang;
 ?
 
 When I browse mysite.no mysite.com homepage is shown
 with lang and ctry as blank
 When I browse mysite.com/index.php?lang=noctry=no
 parameters lang and ctry are set to no as I wish
 
 I have the server on my own laptop where I also do
 the browsing. I use 
 PHP 4.2.2
 
 I kindly got some answers yesterday that do not seem
 to solv the 
 question so I have made myself more specific. Do
 anyone have a clue why 
 the parameters are stripped from the redirection?
 (I am not very trained, but as far as I know the
 parameters should be 
 redirected??!!)
 
 Thanks
 Olav
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 
 


Yahoo! India Matrimony: Find your life partner online
Go to: http://yahoo.shaadi.com/india-matrimony

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



Re: [PHP] MySql injections (related question)

2005-05-13 Thread Marek Kilimajer
Richard Lynch wrote:
On Thu, May 12, 2005 4:43 pm, Chris Shiflett said:
From me:
The fact that it uses the character set of your current connection to
MySQL means that what your escaping function considers to be a single
quote is exactly what your database considers to be a single quote. If
these things don't match, your escaping function can miss something that
your database interprets, opening you up to an SQL injection attack.

Under the following pre-conditions:
1. C Locale / English in MySQL data
2. No intention to ever switch natural language, nor database.
is there any real benefit to spending man hours I really can't afford for
legacy code to switch from Magic Quotes to mysql_real_escape_string -- and
make no mistake, it would be a TON of man hours.
It will take less than five minutes to write a recursive function that 
will stripslashes() all incoming variables and use 
mysql_real_escape_string() instead.

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


[PHP] Finding current PHP sessions

2005-05-13 Thread Bogdan Stancescu
Hello all,
I guess this comes up once in a while, does anybody know how I can find 
the current PHP sessions' IDs? I don't mind if some have passed away, 
and the PHP gc hasn't run yet, because I'm doing a garbage collection of 
my own, for data identified by session ID -- it doesn't really matter if 
I keep a few obsolete files for a while, it only matters that I delete 
them at some point in the future.

I know I could read the session files themselves, but I'd very much 
rather use a proper way to retrieve the active sessions, which would 
work with alternate methods of storing session data, if there is any 
such proper way to do this.

I read the PHP documentation regarding sessions, and I checked out 
Google, with no luck. If you guys don't have a solution, it means that 
there is none -- in other words, you're my last hope, help! :-)

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


Re: [PHP] Re: Same sessions / different domains

2005-05-13 Thread Marek Kilimajer
Richard Lynch wrote:
On Thu, May 12, 2005 6:58 am, Shaun said:
$_SERVER['HTTP_HOST']
Mbneto [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
Hi,
I need to access a website (written in php) using two different
domains (www.foo.com and www.bar.com). I must see the same content.
Since the site uses session and cookie variables I was wondering if
(and how) it's possible to create a session id that is valid for the
domains I'll be using...

There is no built-in way to just tell the browser that it's okay for
cookie X to work for both foo.com and bar.com
You will have to write some code that passes the cookie name/value between
foo.com and bar.com
You might have a special script like 'propogate_cookie.php' something like:
?php
  $var = $_REQUEST['var'];
  $value = $_REQUEST['value'];
  setcookie($var, $value);
?
Put this on both servers, and then when somebody surfs to foo.com you do:
?php
  session_start();
  $file = file(http://bar.com/propogate_cookie.php?var=PHPSESSIDvalue=;
. session_id());
?
The above will deadlock. session_start() locks the session file, then 
you try to read from http://bar.com/propogate_cookie.php, this script 
will try to use the same session file, but it will be never unlocked.

Propagating session id in url when linking across domains and having 
common session storage is completely sufficient. If you are concerned 
user might browse to the other domain by other means than using a link 
from the first domain, you can use a 1x1 pixel image linking to the 
other domain with session id in url.

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


[PHP] Strange comparison behaviour

2005-05-13 Thread Erwin Kerk
Hi All,
Can anyone explain me why the following code:
if (info == 0) echo is 0\n; else echo not 0\n;
Results in: not 0
Whereas:
if (inf == 0) echo is 0\n; else echo not 0\n;
Results in: is 0

Notice the difference: info in the first sample, inf in the second sample.
The used PHP version is PHP 4.1.2 (CLI version)
Erwin Kerk
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Seeking decent domain registrar

2005-05-13 Thread Marcus Bointon
On 13 May 2005, at 01:11, Richard Lynch wrote:
On Thu, May 12, 2005 3:40 am, Marcus Bointon said:
Multilingual domain support e.g. café.com
Er.
Maybe they changed the rules, but I don't think that's a valid  
domain name
AT ALL.

So maybe the reason you are having trouble is you are looking for
something that cannot exist...
They did change the rules starting in November 2000, with RFCs  
(3454, 3490, 3491, 3492) finalised in 2003. See http:// 
www.verisign.com/products-services/naming-and-directory-services/ 
naming-services/internationalized-domain-names/index.html This page  
may be of interest too: http://www.imc.org/idna/. Also, have you  
tried going to www.café.com? It works just fine for me (if you're  
using an antique browser like IE6 it may not work, though verisign  
have a free plugin to enable it). http://www.1stdomain.net/ does  
international registrations (though does not handle .co.uk domains).  
From a PHP point of view, http://pear.php.net/package/Net_IDNA/  
what's needed.

Marcus
--
Marcus Bointon
Synchromedia Limited: Putting you in the picture
[EMAIL PROTECTED] | http://www.synchromedia.co.uk
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


RE: [PHP] sleep function

2005-05-13 Thread Mark Rees
You could try sending all the data to the client at once then achieving
the delay effect with JavaScript perhaps? That way, you are not reliant
on external factors like connection speed.

On Thu, May 12, 2005 8:38 pm, James Williams said:
 I just tried a couple of output_buffering on a test script I made and 
 it won't work... It simply waits for 10 seconds then displays 
 everything...  Kinda sucks.

If you're going to flush() and ob_flush() that much, you might as well
not use ob_start or output buffering at all.

Rip out all the ob_* stuff and see if it works under Windoze.

PS The one I looked at on your site worked just fine...

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

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

Gamma Global : Suppliers of HPCompaq, IBM, Acer, EPI, APC, Cyclades, D-Link, 
Cisco, Sun Microsystems, 3Com

GAMMA GLOBAL (UK) LTD IS A RECOGNISED 'INVESTOR IN PEOPLE' AND AN 'ISO 9001 
2000' REGISTERED COMPANY

**

CONFIDENTIALITY NOTICE:

This Email is confidential and may also be privileged. If you are not the
intended recipient, please notify the sender IMMEDIATELY; you should not
copy the email or use it for any purpose or disclose its contents to any
other person.

GENERAL STATEMENT:

Any statements made, or intentions expressed in this communication may not
necessarily reflect the view of Gamma Global (UK) Ltd. Be advised that no 
content
herein may be held binding upon Gamma Global (UK) Ltd or any associated company
unless confirmed by the issuance of a formal contractual document or
Purchase Order,  subject to our Terms and Conditions available from 
http://www.gammaglobal.com

EOE

**
**


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



Re: [PHP] Finding current PHP sessions

2005-05-13 Thread Marek Kilimajer
Bogdan Stancescu wrote:
Hello all,
I guess this comes up once in a while, does anybody know how I can find 
the current PHP sessions' IDs? I don't mind if some have passed away, 
and the PHP gc hasn't run yet, because I'm doing a garbage collection of 
my own, for data identified by session ID -- it doesn't really matter if 
I keep a few obsolete files for a while, it only matters that I delete 
them at some point in the future.

I know I could read the session files themselves, but I'd very much 
rather use a proper way to retrieve the active sessions, which would 
work with alternate methods of storing session data, if there is any 
such proper way to do this.

I read the PHP documentation regarding sessions, and I checked out 
Google, with no luck. If you guys don't have a solution, it means that 
there is none -- in other words, you're my last hope, help! :-)
Depends on where and how you store your session data. Default file 
storage simply reads all files in session.save_path (opendir() and 
readdir()), check if they match the pattern /sess_[0-9a-f]{32}/ and the 
modification time.

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


[PHP] Re: Strange comparison behaviour

2005-05-13 Thread Bogdan Stancescu
You probably mis-typed something:
[EMAIL PROTECTED] ~]$ php
?
if (info == 0) echo is 0\n; else echo not 0\n;
?
Content-type: text/html
X-Powered-By: PHP/4.3.11
is 0
Cheers,
Bogdan
Erwin Kerk wrote:
Hi All,
Can anyone explain me why the following code:
if (info == 0) echo is 0\n; else echo not 0\n;
Results in: not 0
Whereas:
if (inf == 0) echo is 0\n; else echo not 0\n;
Results in: is 0

Notice the difference: info in the first sample, inf in the second sample.
The used PHP version is PHP 4.1.2 (CLI version)
Erwin Kerk
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Problem with extending classes.

2005-05-13 Thread Shaw, Chris - Accenture

Hello,

Been playing around with classes in php5, extending a base class and using a
constructor etc..

But I seem to have a problem with getting the variables outside the class.
In test1.txt, I cannot anything when I access the public variables for the
class.

In test2, when I make $contact into $contactcontact, I get the values for the
variables, but it looks like all the variables in that class reference
$contactcontact when you try to access them outside the class.

Have I missed something or is there bugs with extending classes in php5?
Does this happen in php4.3?

Thanks for any help.

Chris.

 test1.txt  test2.txt




This message has been delivered to the Internet by the Revenue Internet e-mail 
service

*?php

class baseclass
{
public $name;
public $contact;
  
  function ksplit($text)
  {
echo br\nInside ksplit::;
$array = explode(':',$text);
echo $text,  - , $array[1];
return $array[1];
  }
}

class extendedclass extends baseclass
{
public $address;

function extendedclass($name, $contact, $address)
{
echo Extendedclass Entrybr\n;
echo $name,  - , $contact,  br\n, $address;
$this-$name = $this-ksplit($name);
$this-$contact = $this-ksplit($contact);
$this-$address = $this-ksplit($address);
echo br\nExtendedclass Exitbr\n;
echo $this-$name,  - , $this-$contact,  br\n, $this-$address;
}
}

$myclass = new extendedclass(Name:Bob, Contact:123456789, 
Address:abcdefghijklmnopqrstuvwxyz);

echo br\nOutside Classbr\n;
echo $myclass-$name,  - , $myclass-$contact,  br\n, $myclass-$address;

?

-HTML RESULTS---

Extendedclass Entry
Name:Bob - Contact:123456789 
Address:abcdefghijklmnopqrstuvwxyz
Inside ksplit::Name:Bob - Bob
Inside ksplit::Contact:123456789 - 123456789
Inside ksplit::Address:abcdefghijklmnopqrstuvwxyz - abcdefghijklmnopqrstuvwxyz
Extendedclass Exit
Bob - 123456789 
abcdefghijklmnopqrstuvwxyz
Outside Class
- 

?php

class baseclass
{
public $name;
public $contactcontact;
  
  function ksplit($text)
  {
echo br\nInside ksplit::;
$array = explode(':',$text);
echo $text,  - , $array[1];
return $array[1];
  }
}

class extendedclass extends baseclass
{
public $address;

function extendedclass($name, $contact, $address)
{
echo Extendedclass Entrybr\n;
echo $name,  - , $contact,  br\n, $address;
$this-$name = $this-ksplit($name);
$this-$contactcontact = $this-ksplit($contact);
$this-$address = $this-ksplit($address);
echo br\nExtendedclass Exitbr\n;
echo $this-$name,  - , $this-$contactcontact,  br\n, 
$this-$address;
}
}

$myclass = new extendedclass(Name:Bob, Contact:123456789, 
Address:abcdefghijklmnopqrstuvwxyz);

echo br\nOutside Classbr\n;
echo $myclass-$name,  - , $myclass-$contactcontact,  br\n, 
$myclass-$address;

?

--HTML RESULTS-

Extendedclass Entry
Name:Bob - Contact:123456789 
Address:abcdefghijklmnopqrstuvwxyz
Inside ksplit::Name:Bob - Bob
Inside ksplit::Contact:123456789 - 123456789
Inside ksplit::Address:abcdefghijklmnopqrstuvwxyz - abcdefghijklmnopqrstuvwxyz
Extendedclass Exit
Bob - 123456789 
abcdefghijklmnopqrstuvwxyz
Outside Class
123456789 - 123456789 
123456789 -- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Re: Strange comparison behaviour

2005-05-13 Thread Erwin Kerk
Bogdan Stancescu wrote:
You probably mis-typed something:
[EMAIL PROTECTED] ~]$ php
?
if (info == 0) echo is 0\n; else echo not 0\n;
?
Content-type: text/html
X-Powered-By: PHP/4.3.11
is 0
Tried that, but notice the PHP Version, it is failing in PHP 4.1.2!
Erwin Kerk
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Hello, I'm new...

2005-05-13 Thread brujah

Hi all, 

I have only recently started to look at php, I hope this list dose not
mind 'noob' questions.

I have got 'Programming PHP' by Rasmus Lerdorf, Kevin Tatroe and 'Web
Database Applications with PHP and MySQL' Hugh E. Williams, David Lane.
 

I would like to create a 'community' website and was wondering if there
was a framework available to get me started?

Thanks.

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



RE: [PHP] Problem with extending classes.

2005-05-13 Thread Kim Madsen

 -Original Message-
 From: Shaw, Chris - Accenture [mailto:[EMAIL PROTECTED]
 Sent: Friday, May 13, 2005 12:10 PM
 To: php-general@lists.php.net
 Subject: [PHP] Problem with extending classes.
 
 Have I missed something or is there bugs with extending classes in
php5?
 Does this happen in php4.3?

$this-$name = $this-ksplit($name);
$this-$contactcontact = $this-ksplit($contact);
$this-$address = $this-ksplit($address);

Regardless of inheriting or not it should be:

$this-name = $this-ksplit($name);
$this-contactcontact = $this-ksplit($contact);
$this-address = $this-ksplit($address);

--
Med venlig hilsen / best regards
ComX Networks A/S
Kim Madsen
Systemudvikler/Systemdeveloper

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



Re: [PHP] 'Require' and 'Select' lists

2005-05-13 Thread Andre Dubuc
On Friday 13 May 2005 02:20 am, Richard Lynch wrote:
 On Thu, May 12, 2005 8:41 pm, Andre Dubuc said:
  I've had some rather odd intermittent behavior with a select list drawn
  by a
  'require' on my production site. Sometimes, rather than displaying 'In
  USA/Canada' from the 'option selectedIn USA/Canada/option' code in
  the required file, it will display a blank. Yet, if I try to duplicate
  this behavior on the development box, it will display as coded.
 
  Since I use this text string as a validator for user input, it really
  messes
  up the database/code functions that rely on it.

 In that case, your validation routines aren't very good.

 You have to assume the data coming from the browser is completely messed
 up in malicious ways.  If not providing that item in the menu will break
 your script or hash your data, then that's really a bigger problem than
 the one you think you have.

  ?php require(provcountry.sty); ?
 
  [snippet of 'require' text (provcountry.sty)]
  tr
  tdbState nbsp;/b/td
  tdSELECT NAME=selstate
  option selectedIn USA/Canada/option

 I'd try using an html entity on the '/' in USA/Canada

  option value=AlabamaAlabama/option
  . . .
  /SELECT/td
  /tr
 
  [snippet of some validating code verifying $selstate that relies on
  $selstate]
 
  ?php
  if (($_POST['selstate'] != In USA/Canada)($_POST['typstate'] != ))
   die (h5brbrPlease choose from 'In USA/Canada' or type in 'Other
   State'.
  brDo not use bothbrbrClick 'Back' on your  browser to
   re-enter information/h5);
  ?
 
  Any ideas why this is happening?

 It's quite possible that some sort of php.ini setting with Magic Quotes or
 something is altering the '/' character as well.

 What *IS* in $_POST['selstate'] when it breaks?  Log it and see what the
 data is.`


Thanks for the info, Richard.

The errant behavior is intermittent and hard to replicate, but it has forced 
me to recode this part completly. [This code was my first attempt at PHP two 
years ago, and it's a bad mix of html/php - I certainly wouldn't do it that 
way again.]

I've replaced the 'In USA/Canada' with 'In USA or Canada' eliminating the 
possibility of the slash causing problems.

However, the behavior continues intermittently. I've duplicated it one time. 
If I click on the 'State' dropdown list, allow the mouse to scan through it, 
but do not choose a value, and then immediately go to the previous or next 
field and click on it, the box where 'USA or Canada' appears will be blank 
(despite 'option selected value=In USA or CanadaIn USA or 
Canada/option'). For the life of me, I cannot figure why it's doing that.

As a hack, I've included a new routine checking for blank or null value for 
$selstate that snags problems before they hit the database. However, I'd 
rather know why this is happening.

Logging it - $_POST['selstate'] is blank (after it messes up as above) -- no 
surprise, since that is what the browser displays.

Any other ideas?

Regards,
Andre

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



Re: [PHP] auto_prepend_file in Apache Directory container

2005-05-13 Thread John Nichel
Richard Lynch wrote:
On Thu, May 12, 2005 12:48 pm, dan said:
I'm trying to override the value of php.ini's 'auto_prepend_file'
function, inside of an Apache Directory container.  I'm not having much
luck.  In fact, no luck at all.  This never happens.
So I'm wondering now, are functions set by 'php_value' inside of an
Apache config file only good for the entire VirtualHost in question, or
can they be applied on a per-directory basis using Apache's Directory
directive?

Certainly some php_value directives can be over-ridden in .htaccess,
regardless of whether they were set globally in httpd.conf or in a
VirtualHost or Directory block.
Equally certainly, some cannot be over-ridden.
I am almost 100% certain that php_value makes no distinction between
*where* in httpd.conf the setting comes from.  I daresay php_value in
.htaccess can't even tell the difference from one part of httpd.conf to
the other.
http://php.net/ has a page devoted to describing exactly which php_value
settings can be over-ridden where.  Check that.
It's also possible that once auto_prepend_file is set, it's set, and
that's it -- Regardless of where it is set, you're stuck with it at that
value.
snip
It's also possible that the webserver itself is not configured to allow 
.htaccess files to overwrite values.

--
John C. Nichel
ÜberGeek
KegWorks.com
716.856.9675
[EMAIL PROTECTED]
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Hello, I'm new...

2005-05-13 Thread Brian V Bonini
On Fri, 2005-05-13 at 07:10, [EMAIL PROTECTED] wrote:
 Hi all, 
 
 I have only recently started to look at php, I hope this list dose not
 mind 'noob' questions.
 
 I have got 'Programming PHP' by Rasmus Lerdorf, Kevin Tatroe and 'Web
 Database Applications with PHP and MySQL' Hugh E. Williams, David Lane.
  
 
 I would like to create a 'community' website and was wondering if there
 was a framework available to get me started?

Google for mambo or php nuke


-- 

s/:-[(/]/:-)/g


BrianGnuPG - KeyID: 0x04A4F0DC | Key Server: pgp.mit.edu
==
gpg --keyserver pgp.mit.edu --recv-keys 04A4F0DC
Key Info: http://gfx-design.com/keys
Linux Registered User #339825 at http://counter.li.org

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



[PHP] Re: Hello, I'm new...

2005-05-13 Thread Jason Barnett
[EMAIL PROTECTED] wrote:
Hi all, 

I have only recently started to look at php, I hope this list dose not
mind 'noob' questions.
I have got 'Programming PHP' by Rasmus Lerdorf, Kevin Tatroe and 'Web
Database Applications with PHP and MySQL' Hugh E. Williams, David Lane.
 

I would like to create a 'community' website and was wondering if there
was a framework available to get me started?
Thanks.
While it won't have everything, you will probably find that the PEAR 
repository has a lot of useful classes for you to explore.

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


Re: [PHP] Seeking decent domain registrar

2005-05-13 Thread Jason Barnett
Marcus Bointon wrote:
...
They did change the rules starting in November 2000, with RFCs  (3454, 
3490, 3491, 3492) finalised in 2003. See http:// 
www.verisign.com/products-services/naming-and-directory-services/ 
naming-services/internationalized-domain-names/index.html This page  may 
be of interest too: http://www.imc.org/idna/. Also, have you  tried 
going to www.café.com? It works just fine for me (if you're  using an 
http://www.café.com - I was redirected to http://www.xn--caf-dma.com/
http://www.whois.sc/www.café.com - http://www.whois.sc/www.caf%E9.com 
(which shows the entry for some site which I don't understand)
http://www.cafe.com - some wireless internet provider
http://www.whois.sc/www.cafe.com - wireless internet provider

What was it supposed to be exactly?
All of the above was through Firefox 1.0.4 / Win32.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] domxml problem

2005-05-13 Thread Georgi Ivanov
Hello,
I compiled PHP 5 with following ./configure line 

./configure \
--prefix=/usr/local/php5 \
--with-apxs2=/usr/sbin/apxs2-prefork \
--with-config-file-path=/etc/php5 \
--enable-mbstring \
--enable-mbregex \
--with-mysql \
--with-gd \
--enable-gd-imgstrttf \
--enable-gd-native-ttf \
--with-zlib-dir=/usr/lib \
--with-png-dir=/usr/lib \
--with-jpeg-dir=/usr/lib \
--with-tiff-dir=/usr/lib \
--with-ttf-dir=/usr/lib \
--with-freetype-dir=/usr/lib \
--enable-ftp \
--enable-memory-limit \
--enable-safe-mode \
--enable-bcmath \
--enable-calendar \
--enable-ctype \
--with-ftp \
--with-bz2 \
--enable-inline-optimization \
--with-iconv \
--with-xsl \
--with-bz2 \
--enable-soap \
--enable-sockets \
--enable-zend-multibyte \
--enable-magic-quotes \
--with-openssl \
--with-sqlite \
--enable-sqlite-utf8 \
--with-xmlrpc \
--enable-xslt \
--with-xslt-sablot \
--with-dom \
--with-dom-xslt \
--with-dom-exslt

phpinfo() say that i have DOM enabled 

DOM/XML enabled
DOM/XML API Version 20031129
libxml Version  2.6.17
HTML Supportenabled
XPath Support   enabled
XPointer Supportenabled
Schema Support  enabled
RelaxNG Support enabled


But it gives me error on this line :
$DomDocument = domxml_open_file($file);

Any ideas ?

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



Re: [PHP] Hello, I'm new...

2005-05-13 Thread Rory Browne
A community website. Explain. Decide what features you want this
community site to have. Once you've figured out(or explained) what
type of services you want to offer to your community, and then check
out hotscripts.com, or google.

Three scripts that come to mind, are phpgroupware, phpbb, and
phpnuke(or postnuke)

 I have only recently started to look at php, I hope this list dose not
 mind 'noob' questions.

Personally I don't like the term noob, but there are very few people
on this list that I've come across who object to beginners questions.
We were all beginners at some stage. On the other hand, quite a few of
us(myself included), object to stupid questions. An example of a
stupid question would be

I would like to create a 'community' website and was wondering if
there was a framework available to get me started?.

A better question would be:
I want to create a community website, where community members can
send each other messages, post to a publicly viewable bulletin board,
and share files. What frameworks are available for this..

Ok that wasn't that bad of a question(hey, I needed an example), but
once you've read ESR's guide to asking smart questions(
http://www.catb.org/~esr/faqs/smart-questions.html ), and/or the guide
for new members, that is regularly posted to this list. You can find
it here: 
http://apache2triad.net/forums/archive/o_t__t_3613__newbie-guide-for-the-benefit-of-new-posters.html

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



Re: [PHP] Re: Hello, I'm new...

2005-05-13 Thread Ryan A

On 5/13/2005 3:29:18 PM, Jason Barnett ([EMAIL PROTECTED]) wrote:
 [EMAIL PROTECTED] wrote:
  Hi all,
 
  I have only recently started to look at php, I hope this list dose not
  mind 'noob' questions.
 
  I have got 'Programming PHP' by Rasmus Lerdorf, Kevin Tatroe and
 'Web
  Database Applications with PHP and MySQL' Hugh E. Williams, David
 Lane.
 
 
  I would like to create a 'community' website and was wondering if there
  was a framework available to get me started?
 
  Thanks.


Hi,
If you do decide to make this from scratch and need help, you cant find a
better place than this list
if you are a noob or experienced.

I learnt nearly all I know from this list, there are some very very helpful
and knowledgeable guys here,
infact the guy who co-authored your book (and started PHP) Rasmus, sometimes
chips in...there are
many others of course:
John Holmes (RIP- he's not dead, just not on the list anymore :-D helped me
more than any book
ever could)
(in no particular order)
Jay,
Jason,
Chris
Chris (another Chris...not to be confused with the first :-p )
Marek
Tom
Richard
the list goes on

What I'm trying to say is, if you have a problem...try solving it (google:
best bet, second your own brain) if
neither works...post it here, I too try to help out whenever i can but the
other guys are usually quicker
on the draw...and more accurate :-p

Cheers,
Ryan




-- 
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.0.308 / Virus Database: 266.11.9 - Release Date: 5/12/2005

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



Re: [PHP] 'Require' and 'Select' lists

2005-05-13 Thread Brent Baisley
Sounds like it might be a browser behavior issue. I've seen some really 
weird behavior in browsers when a DOCTYPE is not declared at the start 
of the web page. The doctype declaration and the version declared in it 
are actually very important to the rendering and behavior of a web  
page. Over the years, browser behavior has changed and will render code 
and perform actions differently. The doctype declaration allows specify 
which version behavior you are targeting.

So, is the first line of your web page something like:
!DOCTYPE HTML PUBLIC -//W3C//DTD HTML 4.01 Transitional//EN
http://www.w3.org/TR/1999/REC-html401-19991224/loose.dtd;
On May 13, 2005, at 8:59 AM, Andre Dubuc wrote:
Thanks for the info, Richard.
The errant behavior is intermittent and hard to replicate, but it has 
forced
me to recode this part completly. [This code was my first attempt at 
PHP two
years ago, and it's a bad mix of html/php - I certainly wouldn't do it 
that
way again.]

I've replaced the 'In USA/Canada' with 'In USA or Canada' eliminating 
the
possibility of the slash causing problems.

However, the behavior continues intermittently. I've duplicated it one 
time.
If I click on the 'State' dropdown list, allow the mouse to scan 
through it,
but do not choose a value, and then immediately go to the previous or 
next
field and click on it, the box where 'USA or Canada' appears will be 
blank
(despite 'option selected value=In USA or CanadaIn USA or
Canada/option'). For the life of me, I cannot figure why it's doing 
that.

As a hack, I've included a new routine checking for blank or null 
value for
$selstate that snags problems before they hit the database. However, 
I'd
rather know why this is happening.

Logging it - $_POST['selstate'] is blank (after it messes up as above) 
-- no
surprise, since that is what the browser displays.

Any other ideas?
Regards,
Andre
--
Brent Baisley
Systems Architect
Landover Associates, Inc.
Search  Advisory Services for Advanced Technology Environments
p: 212.759.6400/800.759.0577
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Hello, I'm new...

2005-05-13 Thread Drewcore
i think that you're best bet would be to find some open source
community software and go with that. i built a community site from
scratch one time, and while it was a lot of fun, it proved to be much
more difficult that i had anticipated. so the next client that asked
for a similar site ended up with a modified version of the other site
with phpbb2 for a message board, another package for a photo gallery
(can't recall the name right now), etc.

so, in short, find some already written code, modify it a bit to suit
your needs, and go with that. it'll save you a lot of time.

On 5/13/05, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote:
 
 Hi all,
 
 I have only recently started to look at php, I hope this list dose not
 mind 'noob' questions.
 
 I have got 'Programming PHP' by Rasmus Lerdorf, Kevin Tatroe and 'Web
 Database Applications with PHP and MySQL' Hugh E. Williams, David Lane.
 
 I would like to create a 'community' website and was wondering if there
 was a framework available to get me started?
 
 Thanks.
 
 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 
 


-- 
dc .. drewcore.com

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



Re: [PHP] Re: Strange comparison behaviour

2005-05-13 Thread Drewcore
is upgrading your php out of the question? i would go with at least
4.3.x if not 5... unless you don't have root access on your server...
in which case, i have no advice...


On 5/13/05, Erwin Kerk [EMAIL PROTECTED] wrote:
 Bogdan Stancescu wrote:
  You probably mis-typed something:
 
  [EMAIL PROTECTED] ~]$ php
  ?
  if (info == 0) echo is 0\n; else echo not 0\n;
  ?
  Content-type: text/html
  X-Powered-By: PHP/4.3.11
 
  is 0
 Tried that, but notice the PHP Version, it is failing in PHP 4.1.2!
 
 Erwin Kerk
 
 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 
 


-- 
dc .. drewcore.com

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



Re: [PHP] sleep function

2005-05-13 Thread James Williams
Well the reason it worked on my site is because my webhost uses linux,
and my localhost is windows.

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



Re: [PHP] Re: Strange comparison behaviour

2005-05-13 Thread Brian V Bonini
On Fri, 2005-05-13 at 06:34, Erwin Kerk wrote:
 Bogdan Stancescu wrote:
  You probably mis-typed something:
  
  [EMAIL PROTECTED] ~]$ php
  ?
  if (info == 0) echo is 0\n; else echo not 0\n;
  ?
  Content-type: text/html
  X-Powered-By: PHP/4.3.11
  
  is 0
 Tried that, but notice the PHP Version, it is failing in PHP 4.1.2!
 
 Erwin Kerk

Same behavior on 5.x - I suspect something to do with the 'type' and
loose comparison operators. According to table 2:
http://us4.php.net/manual/en/types.comparisons.php is should evaluate as
true. Looking at the ordinal values revealed nothing to me...


?php

$string = info;
$len = strlen($string);
$lst = $string{strlen($string - 1)};
 
echo 'pre';
echo ($string == 0) ? is 0\n : not 0\n;
echo (rtrim($string, $lst) == 0) ? is 0\n : not 0\n;
echo ---\n;

for($i=0; $i$len; $i++) {
$ord_value =  ord($string[$i]);
echo chr($ord_value) . = . $ord_value . \n;
}

echo '/pre';

?

Anyway, I suspect using ($string === 0) will give you the expected
results.


-- 

s/:-[(/]/:-)/g


BrianGnuPG - KeyID: 0x04A4F0DC | Key Server: pgp.mit.edu
==
gpg --keyserver pgp.mit.edu --recv-keys 04A4F0DC
Key Info: http://gfx-design.com/keys
Linux Registered User #339825 at http://counter.li.org

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



Re: [PHP] cURL functions

2005-05-13 Thread Chris Bruce
I did look at your post on PATH_INFO which did not get me any closer to  
the solution. At this point, I am just trying to get an image using  
cURL and then force it to download to the computer. Here is the link:

http://205.207.224.90/getimage.php
and here is the code:
header(Content-type: image/jpg);
Header('Content-Disposition: attachment;  
file=tigershippingdashboard20050429.jpg');
$ch = curl_init(); // create cURL handle (ch)
if (!$ch) {
  die(Couldn't initialize a cURL handle);
 }
// set some cURL options
$ret = curl_setopt($ch, CURLOPT_URL,  
http://images.apple.com/home/2005/images/ 
tigershippingdashboard20050429.jpg);
$ret = curl_setopt($ch, CURLOPT_HEADER, 1);
$ret = curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
$ret = curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$ret = curl_setopt($ch, CURLOPT_BINARYTRANSFER, 1);
$ret = curl_setopt($ch, CURLOPT_TIMEOUT, 30);

// execute
$ret = curl_exec($ch);
if (empty($ret)) {
// some kind of an error happened
die(curl_error($ch));
curl_close($ch); // close cURL handler
}
else {
$info = curl_getinfo($ch);
curl_close($ch); // close cURL handler
if (empty($info['http_code'])) {
die(No HTTP code was returned);
}
else {
// load the HTTP codes
// echo results
echo The server responded: br /;
print pre;
print_r($info);
print /pre;
  }
 }
I have tried changing the values of the curl options to no avail. What  
ends up happening is the the PHP file is what gets downloaded with all  
the binary data for the image in it. I need to find a way of getting  
just the image to download.

In this example, I just want the image  
tigershippingdashboard20050429.jpg to download.

Any ideas?
Thanks
Chris
If you want to support older browsers, on more platforms, you would do
well to look at another thread from yesterday where I talk about about
PATH_INFO.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Hello, I'm new...

2005-05-13 Thread James Williams
On 5/13/05, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote:
 
 Hi all,
 
 I have only recently started to look at php, I hope this list dose not
 mind 'noob' questions.

no we don't mind it, we do mind poor spelling though ;) jk

 I have got 'Programming PHP' by Rasmus Lerdorf, Kevin Tatroe and 'Web
 Database Applications with PHP and MySQL' Hugh E. Williams, David Lane.
 
 I would like to create a 'community' website and was wondering if there
 was a framework available to get me started?

Are you looking for a framework for building you're application, or an
application that's already built for you that you just need to
customize?

IMO, I would start off with trying to write you're own application
from scratch, like maybe a guestbook or something simple.  Once you
get the basics down you can expand you're horizons into whatever you
feel like...

 Thanks.

You're very welcome... Good Luck!

-- 
jamwil.com

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



Re: [PHP] 'Require' and 'Select' lists

2005-05-13 Thread Andre Dubuc
That might be it ( a browser issue) since the behavior seems to occur most in 
Opera. I shudder to think what IE must be doing with it. And blush . . . I 
didn't have that declaration on the required page (since the page only 
contains that code snippet and I thought it unnecessary - guess I was wrong).

I'll give it whirl, and take it out for a test-drive.

Thanks,
Andre

On Friday 13 May 2005 10:51 am, you wrote:
 Sounds like it might be a browser behavior issue. I've seen some really
 weird behavior in browsers when a DOCTYPE is not declared at the start
 of the web page. The doctype declaration and the version declared in it
 are actually very important to the rendering and behavior of a web
 page. Over the years, browser behavior has changed and will render code
 and perform actions differently. The doctype declaration allows specify
 which version behavior you are targeting.

 So, is the first line of your web page something like:
 !DOCTYPE HTML PUBLIC -//W3C//DTD HTML 4.01 Transitional//EN
  http://www.w3.org/TR/1999/REC-html401-19991224/loose.dtd;

 On May 13, 2005, at 8:59 AM, Andre Dubuc wrote:
  Thanks for the info, Richard.
 
  The errant behavior is intermittent and hard to replicate, but it has
  forced
  me to recode this part completly. [This code was my first attempt at
  PHP two
  years ago, and it's a bad mix of html/php - I certainly wouldn't do it
  that
  way again.]
 
  I've replaced the 'In USA/Canada' with 'In USA or Canada' eliminating
  the
  possibility of the slash causing problems.
 
  However, the behavior continues intermittently. I've duplicated it one
  time.
  If I click on the 'State' dropdown list, allow the mouse to scan
  through it,
  but do not choose a value, and then immediately go to the previous or
  next
  field and click on it, the box where 'USA or Canada' appears will be
  blank
  (despite 'option selected value=In USA or CanadaIn USA or
  Canada/option'). For the life of me, I cannot figure why it's doing
  that.
 
  As a hack, I've included a new routine checking for blank or null
  value for
  $selstate that snags problems before they hit the database. However,
  I'd
  rather know why this is happening.
 
  Logging it - $_POST['selstate'] is blank (after it messes up as above)
  -- no
  surprise, since that is what the browser displays.
 
  Any other ideas?
 
  Regards,
  Andre

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



[PHP] problem with my recursive function

2005-05-13 Thread p80
you can check it out there: 
http://www.hashmysql.org/paste/viewentry.php?id=249

also here it is:
/*I'm trying to display messages on my forum recursively, each message can 
have answers, the id of the parent post is in parentmessageid, the problem is 
that it only displays post that don't have answers ie post that have 
parentmessageid null*/
 /* here is my table: 
 ++---+-+ 
 | id | title | parentmessageid | 
 ++---+-+ 
 |  1 | a|NULL | 
 |  2 | b|NULL | 
 |  3 | repa  |  1 | 
 ++---+-+ 
 as an example I only get 1 and 2
 */

function DisplayThread($realparentid=) {
$sql=select id,title,parentmessageid from message where parentmessageid;
  if ( $realparentid !==  ) {
//Root message do not have the ParentMessageID set
 $sql.==$realparentid;
  } else
   $sql.= IS NULL;

  $sql.= ORDER BY id ASC;
$Reply = false; //Did we find any messages
$query=mysql_query($sql);
while($row=mysql_fetch_array($query)){
$Reply = true; //Found at least one message
$parentid=$row['0'];
$title =$row['1'];
$Result.=$titlebr /$sqlbr /$parentidbr /;
DisplayThread($parentid);
}

  //Clear the statement handle
  mysql_free_result($query);

  if ($Reply) {
//At least one message was processed
return $Result;
  } else
return ;
}

echo DisplayThread();

thx in advance

Pat

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



[PHP] problem with my recursive function

2005-05-13 Thread p80
I'm trying to display messages on my forum recursively, each message can 
have answers, the id of the parent post is in parentmessageid, the problem is 
that it only displays post that don't have answers ie post that have 
parentmessageid null
 /* here is my table: 
 ++---+-+ 
 | id | title | parentmessageid | 
 ++---+-+ 
 |  1 | a|NULL | 
 |  2 | b|NULL | 
 |  3 | repa  |  1 | 
 ++---+-+ 
 as an example I only get 1 and 2
 */

function DisplayThread($realparentid=) {
$sql=select id,title,parentmessageid from message where parentmessageid;
  if ( $realparentid !==  ) {
//Root message do not have the ParentMessageID set
 $sql.==$realparentid;
  } else
   $sql.= IS NULL;

  $sql.= ORDER BY id ASC;
$Reply = false; //Did we find any messages
$query=mysql_query($sql);
while($row=mysql_fetch_array($query)){
$Reply = true; //Found at least one message
$parentid=$row['0'];
$title =$row['1'];
$Result.=$titlebr /$sqlbr /$parentidbr /;
DisplayThread($parentid);
}

  //Clear the statement handle
  mysql_free_result($query);

  if ($Reply) {
//At least one message was processed
return $Result;
  } else
return ;
}

echo DisplayThread();

thx in advance

Pat
ps:you can check it out there: 
http://www.hashmysql.org/paste/viewentry.php?id=249

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



[PHP] [php] Chrooting php...

2005-05-13 Thread Tony Di Croce
I'm trying to fully chroot my server. Right now, I have Apache running
in a chroot jail, and I need to get php5 working their too... Before I
dive in, I thought I'd just ask if anyone here has any experience
doing this...? Are their any known issues?

Also, I was going to chroot my postgres db, but now I'm not so sure.
It is not running as an exposed service (IE, its ports are not open to
the outside world. It's only used over the loopback interface by
PHP)... Is their any point to jailing it in this case?

td

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



[PHP] new security patch problem

2005-05-13 Thread K.S. TANG
Thanks you, There is no ['PHP_AUTH_USER'] nor ['PHP_AUTH_PW'] in var_dum()
I've asked the server administrator, He said he has installed a php security 
patch two days ago.

Could anyone tell me how to config the php server so that ['PHP_AUTH_USER'] 
and ['PHP_AUTH_PW'] can be access or avaliable to me and the web browser 


Thanks a lot
K.S.

Richard Lynch [EMAIL PROTECTED] 
???:[EMAIL PROTECTED]
 On Thu, May 12, 2005 9:27 am, K.S. TANG said:
 I have a page using the Basic HTTP Authentication and works well before.
 But this night, the server seems to not receiving any $_SERVER pass in
 from
 Web browsers.

   if ( (!isset($_SERVER['PHP_AUTH_USER'])) || ($_SERVER['PHP_AUTH_USER']
 !=
 netop) || ($_SERVER['PHP_AUTH_PW'] != cti63) ) {
header('WWW-Authenticate: Basic realm=Please enter User Name and
 Password:');
header('HTTP/1.0 401 Unauthorized');
echo 'Authentication error!!';

 var_dump($_SERVER);

exit;
   }

 I've trial to put this on another server, it doesn't work too !! (but it
 works before also).

 I've trial to use the most simple code from php.net

   if (!isset($_SERVER['PHP_AUTH_USER'])) {
header('WWW-Authenticate: Basic realm=My Realm');
header('HTTP/1.0 401 Unauthorized');
echo 'Text to send if user hits Cancel button';

 var_dump($_SERVER);

exit;
   } else {
echo pHello {$_SERVER['PHP_AUTH_USER']}./p;
echo pYou entered {$_SERVER['PHP_AUTH_PW']} as your password./p;
   }

 But it doesn't work too. The browser ask for the user name and password
 for
 three times and than echo the line Text to send if user hits...

 Please !!! Please help me.
 Thanks a lot.

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




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

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



[PHP] session wierd in Konqueror

2005-05-13 Thread Brian V Bonini
session_start();
header(Cache-control: private); // IE 6 Fix

$user_quotes = $_SESSION['user_quotes'];

if (!isset($user_quotes) || $user_quotes = count($quote_result) - 1) {
   $user_quotes = 0;
} else {
   $user_quotes++;
}

echo pre;
echo $_SESSION['user_quotes'] . \n;
print_r($_SESSION);
echo Session Id: . session_id();
echo /pre;

Gives this in Konqueror:

Array
(
)
Session Id:bfe78a51438a2e4620092f4333c9389a

and in firefox:

2
Array
(
[count] = 10
[user_quotes] = 2
)
Session Id:e8f10e77b0cbb6dc8650e365ed7352f6

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



Re: [PHP] Hello, I'm new...

2005-05-13 Thread john
 --
 jamwil.com

Also, when I hit reply to James' reply, the to field in my email
client was only sending to James, not to the list.

How so? I've noticed that before. How can sometimes the responses go
to the list, and other times to the person who sent the message?

And isn't there a correct protocol for this somewhere?

J

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



Re: [PHP] domxml problem

2005-05-13 Thread Brian V Bonini
On Fri, 2005-05-13 at 10:31, Georgi Ivanov wrote:
 But it gives me error on this line :
 $DomDocument = domxml_open_file($file);

What's the error?

Try:

$dom = dom_xml_file($file);


-- 

s/:-[(/]/:-)/g


BrianGnuPG - KeyID: 0x04A4F0DC | Key Server: pgp.mit.edu
==
gpg --keyserver pgp.mit.edu --recv-keys 04A4F0DC
Key Info: http://gfx-design.com/keys
Linux Registered User #339825 at http://counter.li.org

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



Re: [PHP] Hello, I'm new...

2005-05-13 Thread john
 I would like to create a 'community' website and was wondering if
 there
 was a framework available to get me started?

Well now I don't even know what a framework is. I was expecting
someone to say Oh, you should use model view controller or
something.

All the answers seem to be applications.

Are applications frameworks?

J

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



[PHP] Pfpro PHP

2005-05-13 Thread Rezk Mekhael
 Hi,

I am getting  this error when I try to run configure pfpro with PHP, any
idea?



 
mkdir: too few arguments
Try `mkdir --help' for more information.
configure: creating ./config.status
config.status: creating config.h
config.status: config.h is unchanged


Sincerely,
Rezk Mekhael


Incoming / Outgoing Mail scanned for known Viruses by CLUnet(R)

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



[PHP] php works in IE not Firefox?

2005-05-13 Thread Dustin Wish
Anyone run across an issue where a php script works in IE and not Firefox?
Christianboards.org is a PHP nuke site running on a Enism linux box that is
having this issue.


---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.859 / Virus Database: 585 - Release Date: 2/14/2005
 


Re: [PHP] Hello, I'm new...

2005-05-13 Thread Rory Browne
 
 Well now I don't even know what a framework is. I was expecting
 someone to say Oh, you should use model view controller or
 something.
 
 All the answers seem to be applications.

 Are applications frameworks?

I never checked the dict def of a framework, but I always considered
them to be pieces of sw that you can develop on top of. The only piece
of code(for php) that I can think of that advertises itself as a
framework, would be the horde framework. checkout www.horde.org



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



Fwd: [PHP] Pfpro PHP

2005-05-13 Thread Rory Browne
Forgot to cc to list

I'm assuming you're running ./configure, which should be a shell script.

I can't remember whether is's a /bin/sh or /bin/bash script, but if
it's /bin/sh try modding the first line, which should #!/bin/sh to
#!/bin/sh -x, similarly a /bin/bash script would be modded to show
#!/bin/bash -x. That will give you more error messages. Run the script
again with these mods, and report the error message back to us(unless
someone else answers in the mean time).

On 5/13/05, Rezk Mekhael [EMAIL PROTECTED] wrote:
  Hi,

 I am getting  this error when I try to run configure pfpro with PHP, any
 idea?

 mkdir: too few arguments
 Try `mkdir --help' for more information.
 configure: creating ./config.status
 config.status: creating config.h
 config.status: config.h is unchanged

 
 Sincerely,
 Rezk Mekhael

 Incoming / Outgoing Mail scanned for known Viruses by CLUnet(R)

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



Re: [PHP] Form handling

2005-05-13 Thread dan
Richard Lynch wrote:
On Thu, May 12, 2005 12:55 pm, dan said:
I was just looking for some sort of confirmity and ease of use.  I've
been experimenting with some of my own ways to handle form data.
There's nothing that I hate more than clutter, so that's why I wanted to
break the form apart inside of these smaller files.

I'm only suggesting that you take that farther -- break the form apart
into smaller files, with no super-structure trying to control them.
The value added of the central switch seems dubious to me.
Just my opinion.
Richard -
I want your opinion, which is why I'm taking a stab at the list ;)
What other methods would be good to use?  Using a giant if statement?
Thanks
-dant
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] auto_prepend_file in Apache Directory container

2005-05-13 Thread dan
Richard Lynch wrote:
On Thu, May 12, 2005 12:48 pm, dan said:
I'm trying to override the value of php.ini's 'auto_prepend_file'
function, inside of an Apache Directory container.  I'm not having much
luck.  In fact, no luck at all.  This never happens.
So I'm wondering now, are functions set by 'php_value' inside of an
Apache config file only good for the entire VirtualHost in question, or
can they be applied on a per-directory basis using Apache's Directory
directive?

Certainly some php_value directives can be over-ridden in .htaccess,
regardless of whether they were set globally in httpd.conf or in a
VirtualHost or Directory block.
Equally certainly, some cannot be over-ridden.
I am almost 100% certain that php_value makes no distinction between
*where* in httpd.conf the setting comes from.  I daresay php_value in
.htaccess can't even tell the difference from one part of httpd.conf to
the other.
http://php.net/ has a page devoted to describing exactly which php_value
settings can be over-ridden where.  Check that.
It's also possible that once auto_prepend_file is set, it's set, and
that's it -- Regardless of where it is set, you're stuck with it at that
value.
So it's more of a 'define' for a constant that some kind of variable you
can change on a whim.  Part of that could easily be to provide web host
administrators with a way to guarantee that some PHP code of theirs gets
run no matter what their clients may try to do...  Which I could see might
be handy for some hosts, and they'd not want it over-ridden.  These last
two paragraphs are pure speculation on my part.  But it could be true, and
it wouldn't really fit into that nifty chart in the manual.
Richard -
Yes, I agree with you.  I think it's an all-on or all-off sort of 
thing, and you cannot be terribly specific with it's usage.  THe only 
way I've found to combat this issue is to make a different virtualhost 
or some such, which is what I'm ging to end up doing.

I did take a look at php.net's page devoted to describing exactly which 
php_value settings can be over-ridden, and it does claim that this 
option can be set in a per-directory context.

Thanks for your time
-dant
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] changing php ini location

2005-05-13 Thread Faith Emre YILMAZ
anyone knows how to change php ini location?
I m using php5, apache 1.3 on  windows xp. 

thx in adv. 

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


[PHP] But where in a php-page shall i load classes

2005-05-13 Thread Oscar Andersson


But where in a php-page shall i load classes.
I know about the missing $. But that isent the problem. Here i have a 
simple, basic, webbpage. Shall i load my classes at the top like this or ???

My class is in class.inc

?php
include(class.inc);
?

html
head
title/title
meta http-equiv=Content-Type content=text/html; charset=iso-8859-1
/head
body bgcolor=#C0C0C0 link=#00 vlink=#00 alink=#00

/body
/html

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



RE: [PHP] php works in IE not Firefox?

2005-05-13 Thread Jim Moseby
I get the same message with firefox and IE:
 
There seems to be a problem with the MySQL server, sorry for the
inconvenience
JM

 -Original Message-
 From: Dustin Wish [mailto:[EMAIL PROTECTED]
 Sent: Friday, May 13, 2005 2:12 PM
 To: php-general@lists.php.net
 Subject: [PHP] php works in IE not Firefox?
 
 
 Anyone run across an issue where a php script works in IE and 
 not Firefox?
 Christianboards.org is a PHP nuke site running on a Enism 
 linux box that is
 having this issue.
 
 
 ---
 Outgoing mail is certified Virus Free.
 Checked by AVG anti-virus system (http://www.grisoft.com).
 Version: 6.0.859 / Virus Database: 585 - Release Date: 2/14/2005
  
 

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



Re: [PHP] php works in IE not Firefox?

2005-05-13 Thread John Nichel
Dustin Wish wrote:
Anyone run across an issue where a php script works in IE and not Firefox?
Christianboards.org is a PHP nuke site running on a Enism linux box that is
having this issue.
PHP is server side.  The browser is irrelevant to the execution of PHP.
--
John C. Nichel
berGeek
KegWorks.com
716.856.9675
[EMAIL PROTECTED]
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] php works in IE not Firefox?

2005-05-13 Thread Brent Baisley
PHP does not work in Firefox. It doesn't work in IE either, or any 
browser for  that matter. It works in Apache and can even work on the 
command line.

PHP can generate web pages. The resulting web code may not work right, 
but that's not php's fault. That's the fault of the developer who wrote 
the php code that generates web pages that don't work.
You could easily take php nuke and customize it so it ends up not 
working in FireFox. It could be something as simple as changing the 
style sheets, and probably is. Whoever is customizing php nuke should 
be aware of the differences between browsers. CSS is a pretty thorny 
area in IE. After all, it hasn't been updated in years.

On May 13, 2005, at 2:12 PM, Dustin Wish wrote:
Anyone run across an issue where a php script works in IE and not 
Firefox?
Christianboards.org is a PHP nuke site running on a Enism linux box 
that is
having this issue.

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.859 / Virus Database: 585 - Release Date: 2/14/2005

--
Brent Baisley
Systems Architect
Landover Associates, Inc.
Search  Advisory Services for Advanced Technology Environments
p: 212.759.6400/800.759.0577
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


RE: [PHP] php works in IE not Firefox?

2005-05-13 Thread Dustin Wish
Fixed it. Corrupted code in php nuke on FTP. Weird. And I understand that
PHP is a language that produces HTML code. Not sure if there was an issue
with Firefox and PHP based pages. 


-Original Message-
From: Brent Baisley [mailto:[EMAIL PROTECTED] 
Sent: Friday, May 13, 2005 3:00 PM
To: Dustin Wish
Cc: php-general@lists.php.net
Subject: Re: [PHP] php works in IE not Firefox?

PHP does not work in Firefox. It doesn't work in IE either, or any 
browser for  that matter. It works in Apache and can even work on the 
command line.

PHP can generate web pages. The resulting web code may not work right, 
but that's not php's fault. That's the fault of the developer who wrote 
the php code that generates web pages that don't work.
You could easily take php nuke and customize it so it ends up not 
working in FireFox. It could be something as simple as changing the 
style sheets, and probably is. Whoever is customizing php nuke should 
be aware of the differences between browsers. CSS is a pretty thorny 
area in IE. After all, it hasn't been updated in years.


On May 13, 2005, at 2:12 PM, Dustin Wish wrote:

 Anyone run across an issue where a php script works in IE and not 
 Firefox?
 Christianboards.org is a PHP nuke site running on a Enism linux box 
 that is
 having this issue.


 ---
 Outgoing mail is certified Virus Free.
 Checked by AVG anti-virus system (http://www.grisoft.com).
 Version: 6.0.859 / Virus Database: 585 - Release Date: 2/14/2005


-- 
Brent Baisley
Systems Architect
Landover Associates, Inc.
Search  Advisory Services for Advanced Technology Environments
p: 212.759.6400/800.759.0577


---
Incoming mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.859 / Virus Database: 585 - Release Date: 2/14/2005
 

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.859 / Virus Database: 585 - Release Date: 2/14/2005
 

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



[PHP] Re: new security patch problem

2005-05-13 Thread Jason Barnett
K.S. Tang wrote:
Thanks you, There is no ['PHP_AUTH_USER'] nor ['PHP_AUTH_PW'] in var_dum()
I've asked the server administrator, He said he has installed a php security 
patch two days ago.

Could anyone tell me how to config the php server so that ['PHP_AUTH_USER'] 
and ['PHP_AUTH_PW'] can be access or avaliable to me and the web browser 

By default the php.ini settings should enable all PHP scripts to use 
$_SERVER variables (i.e. values that are provided by Apache / IIS / 
whatever).  AFAIK you can limit this by changing the php.ini's 
variables_order so that it doesn't include 'E'; or you can use some 
combination of safe_mode, safe_mode_allowed_vars and / or 
safe_mode_protected_vars to accomplish this as well.  The manual says 
that all of these except for variables_order are PHP_INI_SYSTEM, so the 
only one of these settings that you can possibly change at runtime would be:

Within PHP it is sometimes possible to use getenv() to get the value of 
an environment variable.  I don't have the time to test this but you 
might be able to try:

?php
ini_set('variables_order', 'EGPCS');
$user = getenv('PHP_AUTH_USER');
$pw   = getenv('PHP_AUTH_PW');
/** search this output for PHP_AUTH_USER or PHP_AUTH_PW */
var_dump($GLOBALS);
?
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Re: php works in IE not Firefox?

2005-05-13 Thread Jason Barnett
Dustin Wish wrote:
Anyone run across an issue where a php script works in IE and not Firefox?
Christianboards.org is a PHP nuke site running on a Enism linux box that is
having this issue.
---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.859 / Virus Database: 585 - Release Date: 2/14/2005
 

The site came up for me.  Although it failed the first time around; 
perhaps the server is just overworked?  Or are you trying to ask about a 
specific script?

BTW, I denied the session cookie.  0:)
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] mod_rewirte loses POST data

2005-05-13 Thread Bart Seresia
Hi,

I'm currently developing a webapplication that uses mod_rewrite.

At some point i have to post data but i't seems to get lost, checking the 
web and some archives i've found that normaly mod_rewrite should preserver 
this data, but apparently it doesn't. Could anyone help me?

Im using:
Apache/2.0.52 (Unix) mod_ssl/2.0.52 OpenSSL/0.9.7b PHP/4.3.11 Server at 
host.mydomain.com Port 80

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



Re: [PHP] Hello, I'm new...

2005-05-13 Thread Jason Barnett
[EMAIL PROTECTED] wrote:
I would like to create a 'community' website and was wondering if
there
was a framework available to get me started?

Well now I don't even know what a framework is. I was expecting
someone to say Oh, you should use model view controller or
something.
All the answers seem to be applications.
Are applications frameworks?
J
I would call MVC a design pattern... but then again I never took a CS 
class in college so my knowledge of the lingo might be lacking.

In any case based on the responses others have given to the OP 
(including your own responses) there are really multiple questions that 
you need to address:

- what content / features do you want?
- what kind of user interface do you want?
- do you want a solution that is fully integrated?
  - If so, then also consider the licensing options for each solution.
- If you don't want the full integration then you get to other questions 
like:
  - what design pattern fits my overall application? (likely MVC)
  - what pre-existing code does the best job for each part of my site?
  - what amount of flexibility do I want to build into my application?
  - what can I do to make this code as easy as possible to understand 
in the future, because I or someone else will have to debug it later?

I'm missing a lot of questions out of my list, but it gets you started. 
 Really it comes down to having a good mental picture of what it is you 
want the site to do and how it will work / look / feel.  Then you get 
all of that down on paper and start finding code / packages / tutorials 
to fill in the blanks.

Based on the somewhat vague OP, you have somewhat vague (but somewhat 
useful) answers.  ;)

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


Re: [PHP] Form handling

2005-05-13 Thread Jason Barnett
Dan wrote:
Richard Lynch wrote:
...
The value added of the central switch seems dubious to me.
Just my opinion.
Richard -
I want your opinion, which is why I'm taking a stab at the list ;)
What other methods would be good to use?  Using a giant if statement?
Thanks
-dant
Nononono a giant if statement is still a case of you trying to 
control all form processing in one centralized location.  I won't 
venture a guess as to why Richard doesn't approve of the centralized 
approach, but rather just pointing out that if() is logically similar to 
switch().

Now going back to your original question... one easy to predict problem 
is that you've forgotten to handle form submission errors.  I mean 
surely you will want to validate the incoming data and do something 
sensible if the data doesn't match some regular expression(s).  If 
you're really trying to go for a centralized approach then I'd say this 
validation should be handled through this main script.

A simple alternative?  Each form has its target attribute set to 
itself.  You start out with invalid data.  Then when the form POSTs to 
itself you can validate the incoming data within the same script where 
the form elements are located.  This approach puts all of the business 
logic for one page *inside the one page*.  It makes debugging a lot 
simpler because, well, if you have a problem with page1.php then you 
know it lies somewhere in the script page1.php instead of any of the 
following:

- page1.php
- controller.php
- index.php
- page2.php
- etc.
One of the easiest ways to reduce maintenance is to make it easy to find 
your bugs.  I'm not being condescending to you, because we all have 
bugs.  But it sure is easier to fix them when you can find them.  :)

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


Re: [PHP] php works in IE not Firefox?

2005-05-13 Thread Brian V Bonini
On Fri, 2005-05-13 at 14:12, Dustin Wish wrote:
 Anyone run across an issue where a php script works in IE and not Firefox?
 Christianboards.org is a PHP nuke site running on a Enism linux box that is
 having this issue.

http://www.christianboards.org/ comes up fine for me; firefox/linux
however http://christianboards.org/ does not.. This is a DNS issue, not
PHP.  :) christianboards.org has no 'A' record. My guess is that IE
fills in the 'www' when you type in 'christianboards.org' whereas
firefox does not.

 snip 

$ dig christianboards.org

;  DiG 9.2.3rc2  christianboards.org
;; global options:  printcmd
;; Got answer:
;; -HEADER- opcode: QUERY, status: NOERROR, id: 53525
;; flags: qr rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 1, ADDITIONAL: 0

;; QUESTION SECTION:
;christianboards.org.   IN  A

;; AUTHORITY SECTION:
christianboards.org.10800   IN  SOA ns1.limedale.com.
indco.indco.net. 2005050601 3600 900 604800 86400

;; Query time: 237 msec
;; SERVER: 192.168.15.1#53(192.168.15.1)
;; WHEN: Fri May 13 16:34:35 2005
;; MSG SIZE  rcvd: 104

[EMAIL PROTECTED] ~/www]$ dig www.christianboards.org

;  DiG 9.2.3rc2  www.christianboards.org
;; global options:  printcmd
;; Got answer:
;; -HEADER- opcode: QUERY, status: NOERROR, id: 43722
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 2, ADDITIONAL: 2

;; QUESTION SECTION:
;www.christianboards.org.   IN  A

;; ANSWER SECTION:
www.christianboards.org. 86400  IN  A   66.139.178.33

;; AUTHORITY SECTION:
christianboards.org.86400   IN  NS  ns1.limedale.com.
christianboards.org.86400   IN  NS  ns2.limedale.com.

;; ADDITIONAL SECTION:
ns1.limedale.com.   160305  IN  A   64.216.172.1
ns2.limedale.com.   160305  IN  A   66.139.178.1

;; Query time: 139 msec
;; SERVER: 192.168.15.1#53(192.168.15.1)
;; WHEN: Fri May 13 16:34:42 2005
;; MSG SIZE  rcvd: 137

 /snip 


-- 

s/:-[(/]/:-)/g


BrianGnuPG - KeyID: 0x04A4F0DC | Key Server: pgp.mit.edu
==
gpg --keyserver pgp.mit.edu --recv-keys 04A4F0DC
Key Info: http://gfx-design.com/keys
Linux Registered User #339825 at http://counter.li.org

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



[PHP] why are session only working with cookies?

2005-05-13 Thread Brian V Bonini
Everything in php.ini seems to be correct. Is there soem thign I'm
supposed to pass to 'configure' at compile time?

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



[PHP] solved::session wierd in Konqueror

2005-05-13 Thread Brian V Bonini
This is solved...

--original--

session_start();
header(Cache-control: private); // IE 6 Fix

$user_quotes = $_SESSION['user_quotes'];

if (!isset($user_quotes) || $user_quotes = count($quote_result) - 1) {
   $user_quotes = 0;
} else {
   $user_quotes++;
}

echo pre;
echo $_SESSION['user_quotes'] . \n;
print_r($_SESSION);
echo Session Id: . session_id();
echo /pre;

Gives this in Konqueror:

Array
(
)
Session Id:bfe78a51438a2e4620092f4333c9389a

and in firefox:

2
Array
(
[count] = 10
[user_quotes] = 2
)
Session Id:e8f10e77b0cbb6dc8650e365ed7352f6

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



Re: [PHP] Pfpro PHP

2005-05-13 Thread Rory Browne
There is nothing there about mkdir. The error message you mentioned
isn't in output.txt

you may have to do a: ./configure 2stderr.txt  output.txt, and send
us stderr.txt, instead as well as stdout.txt

On 5/13/05, Rezk Mekhael [EMAIL PROTECTED] wrote:
 
 I change the /bin/sh to /bin/sh -x and I dump the out put to a file
 output.txt
 
 Can you please see the file and tell me what is the problem?
 
 --
 Sincerely,
 Rezk Mekhael
 
 -Original Message-
 From: Rory Browne [mailto:[EMAIL PROTECTED]
 Sent: Friday, May 13, 2005 12:04 PM
 To: Rezk Mekhael
 Subject: Re: [PHP] Pfpro PHP
 
 I'm assuming you're running ./configure, which should be a shell script.
 
 I can't remember whether is's a /bin/sh or /bin/bash script, but if it's
 /bin/sh try modding the first line, which should #!/bin/sh to #!/bin/sh -x,
 similarly a /bin/bash script would be modded to show #!/bin/bash -x. That
 will give you more error messages. Run the script again with these mods, and
 report the error message back to us(unless someone else answers in the mean
 time).
 
 On 5/13/05, Rezk Mekhael [EMAIL PROTECTED] wrote:
   Hi,
 
  I am getting  this error when I try to run configure pfpro with PHP,
  any idea?
 
  mkdir: too few arguments
  Try `mkdir --help' for more information.
  configure: creating ./config.status
  config.status: creating config.h
  config.status: config.h is unchanged
 
  
  Sincerely,
  Rezk Mekhael
 
  Incoming / Outgoing Mail scanned for known Viruses by CLUnet(R)
 
  --
  PHP General Mailing List (http://www.php.net/) To unsubscribe, visit:
  http://www.php.net/unsub.php
 
 
 Incoming / Outgoing Mail scanned for known Viruses by CLUnet(R)
 


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



Re: [PHP] php works in IE not Firefox?

2005-05-13 Thread Brandon Ryan
It makes no difference what browser you are using... that site seems
to be down even with IE.

On 5/13/05, Jim Moseby [EMAIL PROTECTED] wrote:
 I get the same message with firefox and IE:
 
 There seems to be a problem with the MySQL server, sorry for the
 inconvenience
 JM
 
  -Original Message-
  From: Dustin Wish [mailto:[EMAIL PROTECTED]
  Sent: Friday, May 13, 2005 2:12 PM
  To: php-general@lists.php.net
  Subject: [PHP] php works in IE not Firefox?
 
 
  Anyone run across an issue where a php script works in IE and
  not Firefox?
  Christianboards.org is a PHP nuke site running on a Enism
  linux box that is
  having this issue.
 
 
  ---
  Outgoing mail is certified Virus Free.
  Checked by AVG anti-virus system (http://www.grisoft.com).
  Version: 6.0.859 / Virus Database: 585 - Release Date: 2/14/2005
 
 
 
 --
 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



Re: [PHP] cURL functions

2005-05-13 Thread Jason Wong
On Friday 13 May 2005 23:19, Chris Bruce wrote:
 I did look at your post on PATH_INFO which did not get me any closer to
 the solution. At this point, I am just trying to get an image using
 cURL and then force it to download to the computer. Here is the link:

This should work:

 $ch = curl_init(); // create cURL handle (ch)
 if (!$ch) {
die(Couldn't initialize a cURL handle);
 }
 // set some cURL options
 $ret = curl_setopt($ch, CURLOPT_URL,
 http://images.apple.com/home/2005/images/
 tigershippingdashboard20050429.jpg);
 $ret = curl_setopt($ch, CURLOPT_HEADER, 0);
 $ret = curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
 $ret = curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
 $ret = curl_setopt($ch, CURLOPT_BINARYTRANSFER, 1);
 $ret = curl_setopt($ch, CURLOPT_TIMEOUT, 30);

 // execute
 $ret = curl_exec($ch);
 header(Content-type: image/jpg);
 Header('Content-Disposition: attachment;
 file=tigershippingdashboard20050429.jpg');
 echo $ret;


-- 
Jason Wong - Gremlins Associates - www.gremlins.biz
Open Source Software Systems Integrators
* Web Design  Hosting * Internet  Intranet Applications Development *
--
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
--
New Year Resolution: Ignore top posted posts

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



Re: [PHP] Hello, I'm new...

2005-05-13 Thread Brian A Anderson
Think he means a CMS || Forumpackage || Portal package?

www.opensourcecms.com

-brian

- Original Message - 
From: Jason Barnett [EMAIL PROTECTED]
To: php-general@lists.php.net
Sent: Friday, May 13, 2005 3:20 PM
Subject: Re: [PHP] Hello, I'm new...


 [EMAIL PROTECTED] wrote:
 I would like to create a 'community' website and was wondering if
 there
 was a framework available to get me started?
  
  
  Well now I don't even know what a framework is. I was expecting
  someone to say Oh, you should use model view controller or
  something.
  
  All the answers seem to be applications.
  
  Are applications frameworks?
  
  J
 
 I would call MVC a design pattern... but then again I never took a CS 
 class in college so my knowledge of the lingo might be lacking.
 
 In any case based on the responses others have given to the OP 
 (including your own responses) there are really multiple questions that 
 you need to address:
 
 - what content / features do you want?
 - what kind of user interface do you want?
 - do you want a solution that is fully integrated?
- If so, then also consider the licensing options for each solution.
 - If you don't want the full integration then you get to other questions 
 like:
- what design pattern fits my overall application? (likely MVC)
- what pre-existing code does the best job for each part of my site?
- what amount of flexibility do I want to build into my application?
- what can I do to make this code as easy as possible to understand 
 in the future, because I or someone else will have to debug it later?
 
 
 I'm missing a lot of questions out of my list, but it gets you started. 
   Really it comes down to having a good mental picture of what it is you 
 want the site to do and how it will work / look / feel.  Then you get 
 all of that down on paper and start finding code / packages / tutorials 
 to fill in the blanks.
 
 Based on the somewhat vague OP, you have somewhat vague (but somewhat 
 useful) answers.  ;)
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 
 

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



[PHP] Re: why are session only working with cookies?

2005-05-13 Thread Jason Barnett
Brian V Bonini wrote:
Everything in php.ini seems to be correct. Is there soem thign I'm
supposed to pass to 'configure' at compile time?
Session support is now built-in by default, so unless you specifically 
compile without it then you should have support for sessions in your 
build.  Although yes, there are several php.ini settings that can modify 
cookie behavior:

?php
/**
http://php.net/manual/en/ref.session.php#ini.session.use-only-cookies
Don't force PHP to only use cookie propagation for session
*/
ini_set('session.use_only_cookies', 0);
/**
http://php.net/manual/en/ref.session.php#ini.session.use-trans-sid
Optional, may not even work for your version of PHP
*/
ini_set('session.use_trans_sid', 1);
?
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] curl_multi_* function documentation

2005-05-13 Thread Alex Duggan
Is there any documentation about the curl_multi_* functions?

Alex

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



Re: [PHP] Form handling

2005-05-13 Thread dan
Jason Barnett wrote:
Dan wrote:
Richard Lynch wrote:
...
The value added of the central switch seems dubious to me.
Just my opinion.
Richard -
I want your opinion, which is why I'm taking a stab at the list ;)
What other methods would be good to use?  Using a giant if statement?
Thanks
-dant

Nononono a giant if statement is still a case of you trying to 
control all form processing in one centralized location.  I won't 
venture a guess as to why Richard doesn't approve of the centralized 
approach, but rather just pointing out that if() is logically similar to 
switch().

Now going back to your original question... one easy to predict problem 
is that you've forgotten to handle form submission errors.  I mean 
surely you will want to validate the incoming data and do something 
sensible if the data doesn't match some regular expression(s).  If 
you're really trying to go for a centralized approach then I'd say this 
validation should be handled through this main script.

A simple alternative?  Each form has its target attribute set to 
itself.  You start out with invalid data.  Then when the form POSTs to 
itself you can validate the incoming data within the same script where 
the form elements are located.  This approach puts all of the business 
logic for one page *inside the one page*.  It makes debugging a lot 
simpler because, well, if you have a problem with page1.php then you 
know it lies somewhere in the script page1.php instead of any of the 
following:

- page1.php
- controller.php
- index.php
- page2.php
- etc.
One of the easiest ways to reduce maintenance is to make it easy to find 
your bugs.  I'm not being condescending to you, because we all have 
bugs.  But it sure is easier to fix them when you can find them.  :)


Jason -
Very valueable input, I appreciate that.
I did not forget about error checking.  Error checking (or currently 
lack thereof) is the reason why I sent a message to this list.

However, since I'm anal, I want the entire page to be named index.php, 
which is why I am stuck on the idea of making each page's target set 
to index.php WITH $_SESSION['step'] being set to 1, 2, 3, whichever is 
the next step in the process.  If this is bad, what are my alternatives now?

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


Re: [PHP] cURL functions

2005-05-13 Thread Chris Bruce
This should work:
 $ch = curl_init(); // create cURL handle (ch)
 if (!$ch) {
die(Couldn't initialize a cURL handle);
 }
 // set some cURL options
 $ret = curl_setopt($ch, CURLOPT_URL,
 http://images.apple.com/home/2005/images/
 tigershippingdashboard20050429.jpg);
 $ret = curl_setopt($ch, CURLOPT_HEADER, 0);
 $ret = curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
 $ret = curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
 $ret = curl_setopt($ch, CURLOPT_BINARYTRANSFER, 1);
 $ret = curl_setopt($ch, CURLOPT_TIMEOUT, 30);
 // execute
 $ret = curl_exec($ch);
 header(Content-type: image/jpg);
 Header('Content-Disposition: attachment;
 file=tigershippingdashboard20050429.jpg');
 echo $ret;
Did you try this Jason? When I try it, it just downloads the 
getimage.php file with the binary content of the image in the file.

Chris

[PHP] phpMyAdmin authentication error

2005-05-13 Thread Sam Smith

On OS X 10.3 I installed the latest MySQL from dev.mysql.com for OS X 10.3.
It was a Apple style installer package with a binary of the server and the
client.

The docs weren't exactly written for OS X but I survived the set up and am
able to login as the root  MySQL user with the command line MySQL client.

From version tracker I got phpMyAdmin-2.6.2-pl1.tar.bz2 which is just a .tar
of a bunch of files you drop into the web server path.

But phpMyAdmin gives the error, Client does not support authentication
protocol requested by server; consider upgrading MySQL client. I don't see
a way to change the auth protocol in the phpMyAdmin conf file:
config.inc.php.

If I create a MySQL user with no password phpMyAdmin works.

Because the install was from mysql.com I don't want to believe the client is
out of date. I also don't know how to install another client.

Any one have any ideas?

Thanks

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



[PHP] lib ssh2 functions

2005-05-13 Thread Oscar Gosdinski
Hello everybody:

I need my PHP application connects through SSH to other server for
getting some info to display and i tried the following code to test
lib ssh2:

$server = ...;
$user = ...;
$passwd = ...;

$con = ssh2_connect($server, 22);
if (ssh2_auth_password($con, $user, $passwd)) {
   $s = ssh2_exec($con, 'ls -l');
   $file = fopen(/tmp/test, w);
   while ($line = stream_get_line($s, 1024)) {
   fwrite($file, $line);
   fflush($file);
   }
   fclose($file);
} else {
   echo Authentication Error;
}

The file /tmp/test was created but it does not have any data. I can
connect to the server using a normal ssh session in my laptop and the
'ls -l' command returns me information.
I think that i installed correctly the ssh2 functions because if a put
an incorrect password i get the Authentication Error message.

I searched the web for info about similar problems and no results.
Please, anyone can help me with this problem because i have been
spending three days with this.

Thanks in advance for your answers.

-- 
Saludos / Regards
Oscar

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



Re: [PHP] strpos with array?

2005-05-13 Thread Marek Kilimajer
Burhan Khalid wrote:
Merlin wrote:
Burhan Khalid wrote:
Merlin wrote:
Hi there,
I am wondering if there is a function (I could not find) which does 
the same thing like strpos does, but with an array.

For example:
$replace = array(picture, pics);
$pos = strpos ($term, $replace);
//if ($pos !== false) {

  if (in_array($term,$replace)) {
   $term = str_replace($replace, , $term);
   echo 'term without the word:'.$term;
}


http://www.php.net/in_array

Actually this did not solve the problem, since this function is 
searching for the exact phrase, but not within a string.

I solved it that way:
// try pictures
$replace = array(pictures, picture, bilder, bild, pic, 
pics, pix);
foreach($replace AS $try){
$pos = strpos ($term, $try);
if ($pos !== false) {
$term = str_replace($try, , $term);
   #echo 'yes'.$term.$pos; exit;
   HEADER(Location:/index.php?search_for=.$term.); exit;

1. All functions in PHP are lowercase. Do not UPPERCASE your functions. 
Its Just Not Right.
Case in function names does not matter. It does matter in variable names.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] MySQL: Collation?

2005-05-13 Thread Sam Smith

I need a new book?

What's up with this filtering thing, Collation in phpMyAdmin?

It's defaulting to latin1_swdish_ci. What can I just set it to to forget
about it till I can read up on it?

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



Re: [PHP] cURL functions

2005-05-13 Thread Jason Wong
On Saturday 14 May 2005 06:45, Chris Bruce wrote:
  This should work:

[code snipped]

 Did you try this Jason? 

Yes, I've tried the code that I posted (using my own URL for the image), 
works for me.

 When I try it, it just downloads the 
 getimage.php file with the binary content of the image in the file.

If by 'getimage.php' you mean the above, and you're getting the contents 
of the above (ie the raw PHP code) AND the binary content of the image 
then your webserver is seriously out of whack.

If you mean that the browser downloads the image binary data correctly BUT 
saves it in a file called 'getimage.php' then that is most likely a 
problem with your browser. Double check that you have 
Content-Disposition header correctly formatted, look at the user notes 
in the online manual for the header() function for loads of examples and 
suggestions. Also check the archives for Richard Lynch's posts where he 
rants (quite rightly) about IE's poor handling of forcing a download to 
be saved to file and ways to circumvent it.

-- 
Jason Wong - Gremlins Associates - www.gremlins.biz
Open Source Software Systems Integrators
* Web Design  Hosting * Internet  Intranet Applications Development *
--
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
--
New Year Resolution: Ignore top posted posts

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



Re: [PHP] MySQL: Collation?

2005-05-13 Thread Chris
Sam Smith wrote:
I need a new book?
What's up with this filtering thing, Collation in phpMyAdmin?
It's defaulting to latin1_swdish_ci. What can I just set it to to forget
about it till I can read up on it?
 

This is a PHP mailing list, not a phpMyAdmin or MySQL ... (just needed 
to get that off my chest)

That's the Character Set / Collation for the MySQL client I imagine.
Leave it latin1_swedish_ci , unless you know your database is using 
UTF-8, or something else. MySQL defaults .to latin1 / latin1_swedish_ci, 
if you start seeing question marks in data you retrieve from the 
database, that would be an indication that you're using the wrong 
character set.

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


Re: [PHP] Re: why are session only working with cookies?

2005-05-13 Thread Brian V Bonini
On Fri, 2005-05-13 at 17:51, Jason Barnett wrote:
 Brian V Bonini wrote:
  Everything in php.ini seems to be correct. Is there soem thign I'm
  supposed to pass to 'configure' at compile time?
 
 Session support is now built-in by default, so unless you specifically 
 compile without it then you should have support for sessions in your 
 build.  Although yes, there are several php.ini settings that can modify 
 cookie behavior:

Yeah, I know session support is there and I DO NOT have it set to use
ONLY cookies. But if I disable cookies in the browser stuff relying on
sessions stops working. I'm using 5.0.3

phpinfo() session data:

Session Support 
enabled 

Registered save handlers 
files user sqlite 

Registered serializer handlers 
php php_binary 

session.auto_start
Off
Off

session.bug_compat_42
On
On

session.bug_compat_warn
On
On

session.cache_expire
180
180

session.cache_limiter
nocache
nocache

session.cookie_domain
no value
no value

session.cookie_lifetime
0
0

session.cookie_path
/
/

session.cookie_secure
Off
Off

session.entropy_file
no value
no value

session.entropy_length
0
0

session.gc_divisor
100
100

session.gc_maxlifetime
1440
1440

session.gc_probability
1
1

session.hash_bits_per_character
4
4

session.hash_function
0
0

session.name
PHPSESSID
PHPSESSID

session.referer_check
no value
no value

session.save_handler
files
files

session.save_path
/tmp
/tmp

session.serialize_handler
php
php

session.use_cookies
On
On

session.use_only_cookies
Off
Off

session.use_trans_sid
0
0

-- 

s/:-[(/]/:-)/g


BrianGnuPG - KeyID: 0x04A4F0DC | Key Server: pgp.mit.edu
==
gpg --keyserver pgp.mit.edu --recv-keys 04A4F0DC
Key Info: http://gfx-design.com/keys
Linux Registered User #339825 at http://counter.li.org

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



Re: [PHP] Form handling

2005-05-13 Thread Rory Browne
  What other methods would be good to use?  Using a giant if statement?
Did you read my code for this? It consisted of two lines, which
basicly did the same thing as your massive ugly switch statment. It
also does a limited amount of error-checking, in that it checks to
make sure that the file actually exists.


 However, since I'm anal, I want the entire page to be named index.php,
 which is why I am stuck on the idea of making each page's target set
 to index.php WITH $_SESSION['step'] being set to 1, 2, 3, whichever is
 the next step in the process.  If this is bad, what are my alternatives now?

If you ask for alternatives, and then turn them down on the basis that
you're anal, well, I give up.

You could also place the step in form hidden values.

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



[PHP] error display problem

2005-05-13 Thread hima
Hi all,

can any one plesae help me as I am a learner. I am
working on a Mac OS x machine and I want to see the
errors displayed to the browser. I had changed
display_errors option On in  
the php.ini file but still cannot see them displayed.

Any pointers as how to display errors to browser while
working on Mac machine, really appreciated.

Thanks,
H



__ 
Yahoo! Mail Mobile 
Take Yahoo! Mail with you! Check email on your mobile phone. 
http://mobile.yahoo.com/learn/mail 

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



RE: [PHP] phpMyAdmin authentication error

2005-05-13 Thread Bagus Nugroho
I have experience with this on windows, and solved by change my root password 
on mySQL.
I don't know, if this wil work on your OS X

rgds

-Original Message-
From: Sam Smith [mailto:[EMAIL PROTECTED]
Sent: Saturday, May 14, 2005 5:57 AM
To: PHP
Subject: [PHP] phpMyAdmin authentication error



On OS X 10.3 I installed the latest MySQL from dev.mysql.com for OS X 10.3.
It was a Apple style installer package with a binary of the server and the
client.

The docs weren't exactly written for OS X but I survived the set up and am
able to login as the root  MySQL user with the command line MySQL client.

From version tracker I got phpMyAdmin-2.6.2-pl1.tar.bz2 which is just a .tar
of a bunch of files you drop into the web server path.

But phpMyAdmin gives the error, Client does not support authentication
protocol requested by server; consider upgrading MySQL client. I don't see
a way to change the auth protocol in the phpMyAdmin conf file:
config.inc.php.

If I create a MySQL user with no password phpMyAdmin works.

Because the install was from mysql.com I don't want to believe the client is
out of date. I also don't know how to install another client.

Any one have any ideas?

Thanks

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

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



Re: [PHP] error display problem

2005-05-13 Thread Richard Lynch
On Fri, May 13, 2005 6:49 pm, hima said:
 can any one plesae help me as I am a learner. I am
 working on a Mac OS x machine and I want to see the
 errors displayed to the browser. I had changed
 display_errors option On in
 the php.ini file but still cannot see them displayed.

Did you re-start Apache?
Apache reads php.ini when it starts up, and won't read it again unless you
re-start Apache.

If you can't figure out how to re-start Apache, you could just re-boot... 
Kinda like using a cannon on ye olde fly, but it would work.

 Any pointers as how to display errors to browser while
 working on Mac machine, really appreciated.

Maybe your code is perfect? :-)

Also use View Source in the browser in case your error messages are
buried inside of HTML tags -- then they won't show up because the browser
is trying to use your error message as ATTRIBUTES on the HTML tag.

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

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



Re: [PHP] phpMyAdmin authentication error

2005-05-13 Thread Richard Lynch
On Fri, May 13, 2005 3:56 pm, Sam Smith said:
 Because the install was from mysql.com I don't want to believe the client
 is
 out of date. I also don't know how to install another client.

Most likely, it's Apple that's a bit behind the curve...

So your phpMyAdmin is probably trying to use the mysqli client, but your
MySQL server from Apple can only handle mysql client.

See if you can get phpMyAdmin for the version of MySQL you have.

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

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



Re: [PHP] cURL functions

2005-05-13 Thread Richard Lynch
On Fri, May 13, 2005 3:45 pm, Chris Bruce said:
  header(Content-type: image/jpg);
  Header('Content-Disposition: attachment;
  file=tigershippingdashboard20050429.jpg');
  echo $ret;

 Did you try this Jason? When I try it, it just downloads the
 getimage.php file with the binary content of the image in the file.

Content-Disposition only works on some browsers.

The ONLY way to get EVERY browser to behave is to make your URL end in
tigershippingdashboard20050429.jpg -- and ideally to not have any other
extension (.php or .htm or .html or .shtml or ...) in the URL and also, if
you want it to work for various other multi-media (PDF, SWF, etc) you
might as well set up to use $_SERVER['PATH_INFO'] instead of $_GET

Whew.  That was my rant boiled down to one run-on sentence. :-)
HOW to do all that is in the archives with my name and PATH_INFO on it
most recently, though I really just stole all the bits and pieces from
everybody else.

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

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



Re: [PHP] error display problem

2005-05-13 Thread Jason Wong
On Saturday 14 May 2005 09:49, hima wrote:

 can any one plesae help me as I am a learner. I am
 working on a Mac OS x machine and I want to see the
 errors displayed to the browser. I had changed
 display_errors option On in
 the php.ini file but still cannot see them displayed.

Did you restart the webserver?

 Any pointers as how to display errors to browser while
 working on Mac machine, really appreciated.

Anyway, putting the following at the beginning of your code will allow you 
to see all errors regardless of the server setting:

error_reporting(E_ALL);
ini_set('display_errors', TRUE);

-- 
Jason Wong - Gremlins Associates - www.gremlins.biz
Open Source Software Systems Integrators
* Web Design  Hosting * Internet  Intranet Applications Development *
--
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
--
New Year Resolution: Ignore top posted posts

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



Re: [PHP] Re: why are session only working with cookies?

2005-05-13 Thread Jason Wong
On Saturday 14 May 2005 09:42, Brian V Bonini wrote:

 Yeah, I know session support is there and I DO NOT have it set to use
 ONLY cookies. But if I disable cookies in the browser stuff relying on
 sessions stops working. I'm using 5.0.3

 session.use_trans_sid
 0
 0

Set that to 1. Sessions *are* cookies, they're cookies that have been set 
to expire when the browsing session finishes (ie when the browser is 
closed).

-- 
Jason Wong - Gremlins Associates - www.gremlins.biz
Open Source Software Systems Integrators
* Web Design  Hosting * Internet  Intranet Applications Development *
--
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
--
New Year Resolution: Ignore top posted posts

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



[PHP] Shopping Cart, security concerns

2005-05-13 Thread mayo
I'm making my first shopping cart in PHP.  I'm concerned about the
security of my session variables, concerned about people altering data
(lowering the price). Is there anything I should pay attention to.
 
I've worked extensively with CF, this is my first foray into PHP.
 
Thanks


Re: [PHP] new security patch problem

2005-05-13 Thread Richard Lynch
On Fri, May 13, 2005 9:49 am, K.S. TANG said:
 Thanks you, There is no ['PHP_AUTH_USER'] nor ['PHP_AUTH_PW'] in var_dum()
 I've asked the server administrator, He said he has installed a php
 security
 patch two days ago.

 Could anyone tell me how to config the php server so that
 ['PHP_AUTH_USER']
 and ['PHP_AUTH_PW'] can be access or avaliable to me and the web browser
 

Those don't really come from PHP...

The browser sends them.

The web server passes them on to PHP.

PHP pretty much just gives you what it gets.

If PHP ain't getting them, the web server isn't giving them (or the
browser isn't sending them, which is quite unlikely in modern GUI
browsers.)

You'll have to get your admin to examine web server settings.

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

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



Re: [PHP] changing php ini location

2005-05-13 Thread Richard Lynch
On Fri, May 13, 2005 12:20 pm, Faith Emre YILMAZ said:
 anyone knows how to change php ini location?
 I m using php5, apache 1.3 on  windows xp.

Re-compile.

Since that's not practical for most users, you just have to use whatever
phpinfo says is the right directory.

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

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