Re: Fwd: [PHP] Re: usort(): The argument should be an array

2006-03-02 Thread Jochem Maas

Robert Cummings wrote:

On Wed, 2006-03-01 at 22:26, [EMAIL PROTECTED] wrote:






Is there a good reason for why you're clogging the mailing list with
your fancy shmancy HTML emails?


he's trying to cut down on the ammount of reading I do ;-)



Cheers,
Rob.


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



Re: [PHP] leading slash in SCRIPT_NAME variable

2006-03-02 Thread Roman Rumisek
In phpinfo page SCRIPT_NAME variable is set correctly.

What have effect this variable ? May be include_path setting ?

Rumisek

Chris wrote:

 Roman Rumisek wrote:
 Hi,
 
 i have configured apache 2.0.50 with mod_php 4.4.2 and
 $_SERVER['SCRIPT_NAME'] beginning with /// (three slash).
 
 Where have i a error ? (probably configuration)
 
 Application apache configuration:
 
 Alias /trsklad/ /.../projects/akce/src/html/
 Directory /.../projects/akce/src/html/
 AllowOverride All
 Order deny,allow
 Deny from all
 Allow from 127.0.0.1
 /Directory
 
 Thanks
 
 Rumisek
 
 
 I don't think it's apache.
 
 Are you seeing this in a phpinfo page or in your code somewhere?
 
 If you're not using a phpinfo page then create one and see if it's in
 there first.
 

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



Re: [PHP] Re: usort(): The argument should be an array

2006-03-02 Thread Robin Vickery
Remember14a wrote:

   $i = 0;
   while ($row = mysql_fetch_row($result)) {
$res[$i]['title'] = $row[2];
$res[$i]['url'] = $row[1];
if ($row[3] != null  $show_meta_description == 1)
 $res[$i]['fulltxt'] = $row[3];
else
$res[$i]['fulltxt'] = $row[4];


$res[$i]['size'] = $row[5];
$res[$i]['weight'] = $result_array[$row[0]];
$i++;
   }

  usort($res, cmp);

The var_dump($res) we asked you to insert output NULL. That means
that $res was undefined.

$res is only defined within your loop and your loop is only executed
if the search comes back with at least one result.

So what you need to do is make sure that $res is an array, even if
there are no results from your query. You do this by initialising $res
to an array before the loop, just like you've done to $i.

All you need to do is add one line, just before the start of the loop that says:

   $res = array();

-robin

(trying hard to remain patient)


Fwd: [PHP] Re: usort(): The argument should be an array

2006-03-02 Thread Remember14a



I agree, $res = array();

needs to be declared. I tried this at various level in the code of 300 lines, what happenes if error is suppresses, the search output is displayed in different manner.I have posted full code at this link.Can you inform where precisely I must include, so thatneither error is displayed or search output is displayed differetly.

$res = array(); in code posted at below link.

http://pastebin.com/579621
---BeginMessage---
Remember14a wrote:

   $i = 0;
   while ($row = mysql_fetch_row($result)) {
$res[$i]['title'] = $row[2];
$res[$i]['url'] = $row[1];
if ($row[3] != null  $show_meta_description == 1)
 $res[$i]['fulltxt'] = $row[3];
else
$res[$i]['fulltxt'] = $row[4];


$res[$i]['size'] = $row[5];
$res[$i]['weight'] = $result_array[$row[0]];
$i++;
   }

  usort($res, cmp);

The var_dump($res) we asked you to insert output NULL. That means
that $res was undefined.

$res is only defined within your loop and your loop is only executed
if the search comes back with at least one result.

So what you need to do is make sure that $res is an array, even if
there are no results from your query. You do this by initialising $res
to an array before the loop, just like you've done to $i.

All you need to do is add one line, just before the start of the loop that says:

   $res = array();

-robin

(trying hard to remain patient)
---End Message---
-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Re: usort(): The argument should be an array

2006-03-02 Thread Robin Vickery
On 02/03/06, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote:
 Can you inform where precisely I must include, so that neither error is
 displayed or search output is displayed differetly.

Oh, I give up. Where's my Little Book of Calm?...

  -robin


[PHP] Sendmail issue

2006-03-02 Thread Dave Goodchild
Hi all, I am trying to trigger a php script by sending an email to it. The
script commences with

#!/usr/local/bin/php

to run as a general cgi, and then proceeds to access the email by opening
php://stdin. I get all that.

However, I am editing the /etc/aliases file to create an email alias for the
script by inserting the following line:

agecon /|/home/agecon/dm/ac_incomingphp

...as per the usual process, the user where my files are is called agecon,
so I expect that when I send an email to [EMAIL PROTECTED] it will be passed
the the script. I ran sendmail -bi to update the alias after editing but
when I send the email nothing happens. Am I missing something.

I understand that this is a php/Linux question rather than a pure php
inquiry but wonder if anyone has tried to do the same thing.

Thanks in advance, dave goodchild (web-buddha.co.uk)


[PHP] How do I ...

2006-03-02 Thread Anthony Rodriguez

Hi!

How do I un-subscribe to this list?

Thank you!

Anthony (Tony) Rodriguez
([EMAIL PROTECTED])

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



[PHP] How do I ...

2006-03-02 Thread Anthony Rodriguez

Hi!

How do I un-subscribe to this list?

Thank you!

Anthony (Tony) Rodriguez
([EMAIL PROTECTED]) 


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



Re: [PHP] How do I ...

2006-03-02 Thread Stut

Anthony Rodriguez wrote:


Hi!

How do I un-subscribe to this list?

Thank you!

Anthony (Tony) Rodriguez
([EMAIL PROTECTED])



You open your eyes and look at the footer. Now go out and play with the 
other kids.


vv vv vv vv vv vv vv vv vv vv vv vv vv

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



Re: [PHP] Sendmail issue

2006-03-02 Thread Stut

Dave Goodchild wrote:


However, I am editing the /etc/aliases file to create an email alias for the
script by inserting the following line:

agecon /|/home/agecon/dm/ac_incomingphp
 



Shouldn't this read...

agecon: | /home/agecon/dm/ac_incomingphp


I'm not an expert at this stuff, but that's how mine look.

-Stut

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



Re: [PHP] How do I ...

2006-03-02 Thread Austin Denyer
Anthony Rodriguez wrote:
 Hi!
 
 How do I un-subscribe to this list?

There are three ways to do this.

1. Read the footer of every e-mail on this list - it contains the
instructions.

2. Read the headers of every e-mail on this list - they contain the
instructions.

3. Send $100,000 in low-denomination, used, unmarked bills to each
subscriber and we'll take care of it for you.

Regards,
Ozz.



signature.asc
Description: OpenPGP digital signature


Re: [PHP] PHP Calendar script

2006-03-02 Thread tedd

I have been trolling through hotscripts.com and google all night and
have tried out a couple of promising-looking PHP-based calendar
scripts with no luck, so I'm turning to the collective wisdom of the
list to help me out. I'm looking for a calendar script that I can plug
into a web site that can support color-coded categories and multiple
calendars per installation. Single user is fine, I just need something
that a web novice can use to enter in dates that properties are either
available or not available with color codes indicating tentative
reservations and confirmed reservations. I'm about ready to start
rolling my own, but before I do that, I'm hoping that one of you knows
of a script that is out there (preferably for free, but at least less
than $50) that I could use. Thanks, in advance, for your help!!

--
Robin Hastings


Robin:

I'm not representative of the collective wisdom of this group, but 
you might like to review:


http://www.weberdev.com/get_example-3306.html

http://www.weberdev.com/get_example-3133.html

http://www.weberdev.com/get_example-1780.html

tedd
--

http://sperling.com

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



Re: [PHP] How do I ...

2006-03-02 Thread John Nichel

Anthony Rodriguez wrote:

Hi!

How do I un-subscribe to this list?



Look at the bottom of *every* email from this list.

--
John C. Nichel IV
Programmer/System Admin (ÜberGeek)
Dot Com Holdings of Buffalo
716.856.9675
[EMAIL PROTECTED]

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



Re: [PHP] Sendmail issue

2006-03-02 Thread John Nichel

Dave Goodchild wrote:

Hi all, I am trying to trigger a php script by sending an email to it. The
script commences with

#!/usr/local/bin/php

to run as a general cgi, and then proceeds to access the email by opening
php://stdin. I get all that.

However, I am editing the /etc/aliases file to create an email alias for the
script by inserting the following line:

agecon /|/home/agecon/dm/ac_incomingphp

...as per the usual process, the user where my files are is called agecon,
so I expect that when I send an email to [EMAIL PROTECTED] it will be passed
the the script. I ran sendmail -bi to update the alias after editing but
when I send the email nothing happens. Am I missing something.

I understand that this is a php/Linux question rather than a pure php
inquiry but wonder if anyone has tried to do the same thing.


if your script isn't even getting accessed, it's more of a 
sendmail/Linux question.  I do this for automating quite a few tasks, 
but with qmail...


.qmail-theaddress
|/path/to/php/script.php

You can read the contents of the email, line for line with...

while ( $line = fgets ( STDIN ) ) {
//  do stuff
}

--
John C. Nichel IV
Programmer/System Admin (ÜberGeek)
Dot Com Holdings of Buffalo
716.856.9675
[EMAIL PROTECTED]

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



[PHP] Where can I find nice Web icons for custom admin interface?

2006-03-02 Thread Nicolas Verhaeghe
I have a habit of designing pretty much everything myself as far as CMS
and admin areas, but I was wondering if anybody knew where to find Web
icons to make the result look very professional?

I am really not a graphical/layout guy!

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



RE: [PHP] Coordenates latitude / longitude on PHP

2006-03-02 Thread jblanchard
[snip]
I have to create some maps from a latitude / longitude points.

Do anyone know how to convert it to plane coordenates? (In order to show

it on a bitmat)

I have already found a function but does not work very well ...
[/snip]

Plain coordinates? You mean as in X, Y coordinates? If so, lat and long
are already configured that way.

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



[PHP] Coordenates latitude / longitude on PHP

2006-03-02 Thread Ruben Rubio Rey

Hi,

I have to create some maps from a latitude / longitude points.

Do anyone know how to convert it to plane coordenates? (In order to show 
it on a bitmat)


I have already found a function but does not work very well ...

Any help will be apreciated.
Thanks in advance

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



Re: [PHP] Where can I find nice Web icons for custom admin interface?

2006-03-02 Thread Chris Boget

I have a habit of designing pretty much everything myself as far as CMS
and admin areas, but I was wondering if anybody knew where to find Web
icons to make the result look very professional?
I am really not a graphical/layout guy!


This is OT but you can always take a look on 


http://www.deviantart.com/

thnx,
Chris

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



Re: [PHP] Coordenates latitude / longitude on PHP

2006-03-02 Thread Anas Mughal
Lat and long are all you need for rendering on an X,Y coordinate.

Keep in mind to adjust the ratio of lat and long depending on where you are
on the globe.

Good luck!
--
Anas Mughal


[PHP] Re: Where can I find nice Web icons for custom admin interface?

2006-03-02 Thread Barry

Nicolas Verhaeghe wrote:

I have a habit of designing pretty much everything myself as far as CMS
and admin areas, but I was wondering if anybody knew where to find Web
icons to make the result look very professional?

I am really not a graphical/layout guy!


www.icons-to-make-my-stuff-shiny-and-professional.com

You probably should get somone that is one, or learn it.

If the website above works, then there is one otherwise no.

--
Smileys rule (cX.x)C --o(^_^o)
Dance for me! ^(^_^)o (o^_^)o o(^_^)^ o(^_^o)

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



Re: [PHP] Coordenates latitude / longitude on PHP

2006-03-02 Thread Ruben Rubio Rey

Anas Mughal wrote:


Lat and long are all you need for rendering on an X,Y coordinate.

Keep in mind to adjust the ratio of lat and long depending on where 
you are on the globe.


Good luck!
--
Anas Mughal


any other details? I have tried to convert lat and long to x and y 
coordinate but it not worked very well.

Could give me any math form to apply, or function ...

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



Re: [PHP] Coordenates latitude / longitude on PHP

2006-03-02 Thread Satyam
It is a little hard to do, in fact there are several different 'projection 
systems' in existence.   Since the Earth is not flat and it is not even a 
perfect sphere, there are many ways to project latitude and longitude 
information.  You should check a GIS (Geographical Information Systems) for 
further info.  If the projection system of each separate source of 
information is different from the other, it is hard to make them match 
perfectly.  Some do plain Mercator, which is latitudes, converted into 
decimal numbers, go in the Y axis, longitudes into the X axis.  Other 
systems preserve the surface area.  Satellite pictures have their own set of 
problems.  The scale of what is in the center of each picture is different 
from what is at the edges (lots of trigonometry involved here) and 
contiguous pictures don't much unless suitably distorted.


Now, you are lucky if you are concerned about a small area (a small city or 
town) and all your data comes from the same source using the same projection 
system.  Otherwise, your question is far from trivial and there are whole 
PhD thesis written on the subject.


You might try Google maps, they have a programing interface to their maps, 
which is for free for non-comercial use but since your e-mail is of a real 
estate company, I'm afraid you can't.


See www.qdq.com and try the menu callejeros fotograficos, it is impresive

Satyam

- Original Message - 
From: Ruben Rubio Rey [EMAIL PROTECTED]

To: php-general@lists.php.net
Sent: Thursday, March 02, 2006 4:36 PM
Subject: [PHP] Coordenates latitude / longitude on PHP



Hi,

I have to create some maps from a latitude / longitude points.

Do anyone know how to convert it to plane coordenates? (In order to show 
it on a bitmat)


I have already found a function but does not work very well ...

Any help will be apreciated.
Thanks in advance

--
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] Re: Where can I find nice Web icons for custom admin interface?

2006-03-02 Thread Thorsten Suckow-Homberg



www.icons-to-make-my-stuff-shiny-and-professional.com

You probably should get somone that is one, or learn it.

If the website above works, then there is one otherwise no.


What a valuable response... oO

Nicolas, you should google for Linux-Themes (KDE etc.), most of the icon 
collections come with an appropriate license (Crystal theme came AFAICR 
with the GPL bundled)...


HTH


Thorsten

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



Re: [PHP] Re: Where can I find nice Web icons for custom admin interface?

2006-03-02 Thread Barry

Thorsten Suckow-Homberg wrote:



www.icons-to-make-my-stuff-shiny-and-professional.com

You probably should get somone that is one, or learn it.

If the website above works, then there is one otherwise no.


What a valuable response... oO

Nicolas, you should google for Linux-Themes (KDE etc.), most of the icon 
collections come with an appropriate license (Crystal theme came AFAICR 
with the GPL bundled)...


HTH


Thorsten

Sorry i just get mad that ppl are toOOooOoOo lazy to use google.

--
Smileys rule (cX.x)C --o(^_^o)
Dance for me! ^(^_^)o (o^_^)o o(^_^)^ o(^_^o)

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



RE: [PHP] Coordenates latitude / longitude on PHP

2006-03-02 Thread Nicolas Verhaeghe
Yes, but there is a projection issue involved.

The Earth is a sphere. Your screen is flat. What projection are you
using? Mercator? Lambert?

http://en.wikipedia.org/wiki/Map_projection

In this case, I would not spend too much time reinventing the wheel and
borrow or purchase an existing solution, and add it to the bottom line
for my client.

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 
Sent: Thursday, March 02, 2006 8:50 AM
To: [EMAIL PROTECTED]; php-general@lists.php.net
Subject: RE: [PHP] Coordenates latitude / longitude on PHP


[snip]
I have to create some maps from a latitude / longitude points.

Do anyone know how to convert it to plane coordenates? (In order to show

it on a bitmat)

I have already found a function but does not work very well ... [/snip]

Plain coordinates? You mean as in X, Y coordinates? If so, lat and long
are already configured that way.

-- 
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] Where can I find nice Web icons for custom admin interface?

2006-03-02 Thread Nicolas Verhaeghe
Thanks, Chris, this does not look too bad!


-Original Message-
From: Chris Boget [mailto:[EMAIL PROTECTED] 
Sent: Thursday, March 02, 2006 9:03 AM
To: Nicolas Verhaeghe; php-general@lists.php.net
Subject: Re: [PHP] Where can I find nice Web icons for custom admin
interface?


I have a habit of designing pretty much everything myself as far as CMS

and admin areas, but I was wondering if anybody knew where to find Web

icons to make the result look very professional?  I am really not a 
graphical/layout guy!

This is OT but you can always take a look on 

http://www.deviantart.com/

thnx,
Chris

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



RE: [PHP] Where can I find nice Web icons for custom admin interface?

2006-03-02 Thread Nicolas Verhaeghe
I should have googled this before posting this here, sorry.

I found a site but if I post the URL someone will accuse me of sham
advertising.


-Original Message-
From: Chris Boget [mailto:[EMAIL PROTECTED] 
Sent: Thursday, March 02, 2006 9:03 AM
To: Nicolas Verhaeghe; php-general@lists.php.net
Subject: Re: [PHP] Where can I find nice Web icons for custom admin
interface?


I have a habit of designing pretty much everything myself as far as CMS

and admin areas, but I was wondering if anybody knew where to find Web

icons to make the result look very professional?  I am really not a 
graphical/layout guy!

This is OT but you can always take a look on 

http://www.deviantart.com/

thnx,
Chris

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



RE: [PHP] Sendmail issue

2006-03-02 Thread t20040727 . 1430
  -Original Message-
  From: Dave Goodchild [mailto:[EMAIL PROTECTED] 
  Sent: Thursday, March 02, 2006 1:07 PM
  To: php-general@lists.php.net
  Subject: [PHP] Sendmail issue
  
  
  Hi all, I am trying to trigger a php script by sending an 
  email to it. The
  script commences with
  
  #!/usr/local/bin/php
  
  to run as a general cgi, and then proceeds to access the 
  email by opening
  php://stdin. I get all that.
  
  However, I am editing the /etc/aliases file to create an 
  email alias for the
  script by inserting the following line:
  
  agecon /|/home/agecon/dm/ac_incomingphp
  
  ...as per the usual process, the user where my files are is 
  called agecon,
  so I expect that when I send an email to [EMAIL PROTECTED] it 
  will be passed
  the the script. I ran sendmail -bi to update the alias after 
  editing but
  when I send the email nothing happens. Am I missing something.
  
  I understand that this is a php/Linux question rather than a pure php
  inquiry but wonder if anyone has tried to do the same thing.
  
  Thanks in advance, dave goodchild (web-buddha.co.uk)


Hi Dave,

ensure, that your script has sufficent permissons in sight of the MTA
daemon.
Lets say your sendmail daemon is running under user name sendmail.
Then make shure, that /home/agecon/dm/ac_incomingphp also is owned by user
sendmail an has the
chmod u+rx /home/agecon/dm/ac_incomingphp
execute permission set, so the #!. in the first line of your script can
get involved.

Maybe this helps.
Ciao.

-- 
Echte DSL-Flatrate dauerhaft für 0,- Euro*!
Feel free mit GMX DSL! http://www.gmx.net/de/go/dsl

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



[PHP] System Administrator replies

2006-03-02 Thread tedd

Hi gang:

Is anyone else getting these:

System Administrator [EMAIL PROTECTED]

 Undeliverable: whatever


Every time I send something to this list, my email get's posted, but 
then I also receive an email from the System Administrator telling 
me that my email did not reach:


did not reach the following recipient(s):
[EMAIL PROTECTED] on Thu Mar 02 09:55:08 2006

  The e-mail account does not exist at the organization this message
 was sent to.  Check the e-mail address, or contact the recipient
 directly to find out the correct address.
  genghis.richmond.allegroconsultants.com #5.1.1

---

What's with this?

I'm I doing something wrong?

Thanks.

tedd

--

http://sperling.com

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



[PHP] echo'ing a variable and cat'ing text

2006-03-02 Thread Adam Williams
I have a file called userlist.  I'm trying to read the file, and then 
echo their name and add @mdah.state.ms.us with it.  In the file 
userlist, it looks like:


userabc
userdef
userxyz

and I have the following code:

?php
$filename = userlist;
$fp = fopen($filename, r) or die (Couldn't open $filename);
if ($fp)
{
while (!feof($fp))
   {
   $thedata = fgets($fp);
   if ($thedata != )
   {
   echo $thedata.@mdah.state.ms.us;
   }
   }
fclose($fp);
}
?


But when I run it, I get:

@mdah.state.ms.ususerabc
@mdah.state.ms.ususerdef
@mdah.state.ms.ususerxyz

and I am expecting to get:

[EMAIL PROTECTED]
[EMAIL PROTECTED]
[EMAIL PROTECTED]

So can someone look at my code and let me know why I'm not getting my 
expected output?


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



RE: [PHP] echo'ing a variable and cat'ing text

2006-03-02 Thread jblanchard
[snip]
echo $thedata.@mdah.state.ms.us;
[/snip]

Try echo $thedata.'@mdah.state.ms.us';

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



Re: [PHP] System Administrator replies

2006-03-02 Thread John Nichel

tedd wrote:

Hi gang:

Is anyone else getting these:

System Administrator [EMAIL PROTECTED]

 Undeliverable: whatever


Every time I send something to this list, my email get's posted, but 
then I also receive an email from the System Administrator telling me 
that my email did not reach:


did not reach the following recipient(s):
[EMAIL PROTECTED] on Thu Mar 02 09:55:08 2006

  The e-mail account does not exist at the organization this message
 was sent to.  Check the e-mail address, or contact the recipient
 directly to find out the correct address.
  genghis.richmond.allegroconsultants.com #5.1.1

---

What's with this?

I'm I doing something wrong?



It's a bounce from an email address subscribed to the list.  Filter it out.

can of worms
Not that we need a list admin to take care of this or anything.
/can of worms

--
John C. Nichel IV
Programmer/System Admin (ÜberGeek)
Dot Com Holdings of Buffalo
716.856.9675
[EMAIL PROTECTED]

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



Re: [PHP] echo'ing a variable and cat'ing text

2006-03-02 Thread John Nichel

Adam Williams wrote:
I have a file called userlist.  I'm trying to read the file, and then 
echo their name and add @mdah.state.ms.us with it.  In the file 
userlist, it looks like:


userabc
userdef
userxyz

and I have the following code:

?php
$filename = userlist;
$fp = fopen($filename, r) or die (Couldn't open $filename);
if ($fp)
{
while (!feof($fp))
   {
   $thedata = fgets($fp);
   if ($thedata != )
   {
   echo $thedata.@mdah.state.ms.us;
   }
   }
fclose($fp);
}
?


But when I run it, I get:

@mdah.state.ms.ususerabc
@mdah.state.ms.ususerdef
@mdah.state.ms.ususerxyz

and I am expecting to get:

[EMAIL PROTECTED]
[EMAIL PROTECTED]
[EMAIL PROTECTED]

So can someone look at my code and let me know why I'm not getting my 
expected output?




Well, you're not telling fgets how much to read for one, and I'd do this 
a different way to begin with...


if ( $file = file ( $filename ) ) {
foreach ( $file as $line ) {
if ( $file !=  ) {
echo ( $line . @mdah.state.ms.us );
}
}
} else {
echo ( Couldn't open $filename );
}

--
John C. Nichel IV
Programmer/System Admin (ÜberGeek)
Dot Com Holdings of Buffalo
716.856.9675
[EMAIL PROTECTED]

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



Re: [PHP] echo'ing a variable and cat'ing text

2006-03-02 Thread Adam Williams
Hi, I just tried that, didn't make a difference, still not getting my 
expected output.


[EMAIL PROTECTED] wrote:

[snip]
echo $thedata.@mdah.state.ms.us;
[/snip]

Try echo $thedata.'@mdah.state.ms.us';

  


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



RE: [PHP] echo'ing a variable and cat'ing text

2006-03-02 Thread jblanchard
[snip]
Hi, I just tried that, didn't make a difference, still not getting my 
expected output.

 Try echo $thedata.'@mdah.state.ms.us';
[/snip]

Ooops, my bad, try

echo $thedata .'@mdah.state.ms.us';

And please do not top post.

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



Re: [PHP] echo'ing a variable and cat'ing text

2006-03-02 Thread John Nichel

John Nichel wrote:

Adam Williams wrote:
I have a file called userlist.  I'm trying to read the file, and then 
echo their name and add @mdah.state.ms.us with it.  In the file 
userlist, it looks like:


userabc
userdef
userxyz

and I have the following code:

?php
$filename = userlist;
$fp = fopen($filename, r) or die (Couldn't open $filename);
if ($fp)
{
while (!feof($fp))
   {
   $thedata = fgets($fp);
   if ($thedata != )
   {
   echo $thedata.@mdah.state.ms.us;
   }
   }
fclose($fp);
}
?


But when I run it, I get:

@mdah.state.ms.ususerabc
@mdah.state.ms.ususerdef
@mdah.state.ms.ususerxyz

and I am expecting to get:

[EMAIL PROTECTED]
[EMAIL PROTECTED]
[EMAIL PROTECTED]

So can someone look at my code and let me know why I'm not getting my 
expected output?




Well, you're not telling fgets how much to read for one, and I'd do this 
a different way to begin with...


if ( $file = file ( $filename ) ) {
foreach ( $file as $line ) {
if ( $file !=  ) {


Oops, should be...

  if ( $line !=  ) {


echo ( $line . @mdah.state.ms.us );
}
}
} else {
echo ( Couldn't open $filename );
}




--
John C. Nichel IV
Programmer/System Admin (ÜberGeek)
Dot Com Holdings of Buffalo
716.856.9675
[EMAIL PROTECTED]

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



Re: [PHP] Coordenates latitude / longitude on PHP

2006-03-02 Thread tedd
It is a little hard to do, in fact there are several different 
'projection systems' in existence.   Since the Earth is not flat and 
it is not even a perfect sphere, there are many ways to project 
latitude and longitude information.  You should check a GIS 
(Geographical Information Systems) for further info.  If the 
projection system of each separate source of information is 
different from the other, it is hard to make them match perfectly. 
Some do plain Mercator, which is latitudes, converted into decimal 
numbers, go in the Y axis, longitudes into the X axis.  Other 
systems preserve the surface area.  Satellite pictures have their 
own set of problems.  The scale of what is in the center of each 
picture is different from what is at the edges (lots of trigonometry 
involved here) and contiguous pictures don't much unless suitably 
distorted.


Now, you are lucky if you are concerned about a small area (a small 
city or town) and all your data comes from the same source using the 
same projection system.  Otherwise, your question is far from 
trivial and there are whole PhD thesis written on the subject.


You might try Google maps, they have a programing interface to their 
maps, which is for free for non-comercial use but since your e-mail 
is of a real estate company, I'm afraid you can't.


See www.qdq.com and try the menu callejeros fotograficos, it is impresive

Satyam


Yes, Satyan is absolutely correct. The Earth is an Oblate Spheroid 
with positive and negative features and taking coordinates from lat 
logs is certainly not trivial. There are all sorts of projection 
methods to take a three dimensional x-y-z surface and remove the z 
portion to project the calculated result onto a flat x-y plane. Even 
at a local scale this can be very complicated.


For example, I worked on mapping project re Michigan via a host of 
USGS topographic maps and found that many were produced using 
different projection methods and some of those projections were 80+ 
years old and the formulas used had been lost. To do the project 
right would have required the resurvey of several entire counties.


However, the detail depends upon the need. For example, if the data 
is to be used to find the local shopping mall, that's one thing. But 
if it's to determine if your neighbor's fence is on your property, 
it's quite another matter.


tedd

--

http://sperling.com

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



Re: [PHP] echo'ing a variable and cat'ing text

2006-03-02 Thread Adam Williams

John Nichel wrote:
Well, you're not telling fgets how much to read for one, and I'd do 
this a different way to begin with...


if ( $file = file ( $filename ) ) {
foreach ( $file as $line ) {
if ( $file !=  ) {
echo ( $line . @mdah.state.ms.us );
}
}
} else {
echo ( Couldn't open $filename );
}


When I do that, I get:

userabc
@mdah.state.ms.ususerdef
@mdah.state.ms.ususerxyz
@mdah.state.ms.us


so looks like I need to strip out the end-of-line (EOL) character somehow.

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



Re: [PHP] echo'ing a variable and cat'ing text

2006-03-02 Thread John Nichel

Adam Williams wrote:

John Nichel wrote:
Well, you're not telling fgets how much to read for one, and I'd do 
this a different way to begin with...


if ( $file = file ( $filename ) ) {
foreach ( $file as $line ) {
if ( $file !=  ) {
echo ( $line . @mdah.state.ms.us );
}
}
} else {
echo ( Couldn't open $filename );
}


When I do that, I get:

userabc
@mdah.state.ms.ususerdef
@mdah.state.ms.ususerxyz
@mdah.state.ms.us


so looks like I need to strip out the end-of-line (EOL) character somehow.



echo ( rtrim ( $line ) . @mdah.state.ms.us\n );

Take notice of the '\n' too.

--
John C. Nichel IV
Programmer/System Admin (ÜberGeek)
Dot Com Holdings of Buffalo
716.856.9675
[EMAIL PROTECTED]

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



Re: [PHP] echo'ing a variable and cat'ing text

2006-03-02 Thread Adam Williams

got it!  i had to have my block of code look like this:

if ( $file = file ( $filename ) ) {
   foreach ( $file as $line ) {
   if ( $line !=  ) {
   $line = trim($line);
   echo ( $line . @mdah.state.ms.us );
   echo \n;
   }
   }
} else {
   echo ( Couldn't open $filename );
}

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



Re: [PHP] System Administrator replies

2006-03-02 Thread Stut

John Nichel wrote:


can of worms
Not that we need a list admin to take care of this or anything.
/can of worms



Good job you closed that tag, these can be a nightmare!

-Stut

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



[PHP] supressing warnings in error_log

2006-03-02 Thread Jason Gerfen
I would like to know how to suppress Warning error_log entries dealing 
with undefined vars: eg.
Undefined index:  del_pxe in /test.php on line 33, referer: 
http://website.com/index.php


--
Jason Gerfen
Student Computing Labs, University Of Utah
[EMAIL PROTECTED]

J. Willard Marriott Library
295 S 1500 E, Salt Lake City, UT 84112-0860
801-585-9810

When asked what love is:
Love is the Jager talking.
~Craig Baldo

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



Re: [PHP] supressing warnings in error_log

2006-03-02 Thread John Nichel

Jason Gerfen wrote:
I would like to know how to suppress Warning error_log entries dealing 
with undefined vars: eg.
Undefined index:  del_pxe in /test.php on line 33, referer: 
http://website.com/index.php




There is that pesky manual thing online...

http://us2.php.net/ini_set
http://us2.php.net/manual/en/ini.php#ini.list

--
John C. Nichel IV
Programmer/System Admin (ÜberGeek)
Dot Com Holdings of Buffalo
716.856.9675
[EMAIL PROTECTED]

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



Re: [PHP] supressing warnings in error_log

2006-03-02 Thread John Nichel

Jason Gerfen wrote:

John Nichel wrote:


Jason Gerfen wrote:

I would like to know how to suppress Warning error_log entries 
dealing with undefined vars: eg.
Undefined index:  del_pxe in /test.php on line 33, referer: 
http://website.com/index.php




There is that pesky manual thing online...

http://us2.php.net/ini_set
http://us2.php.net/manual/en/ini.php#ini.list

Yeah I was looking at that.  I suppose what I am looking for is a way to 
suppress those warnings without modifying the php.ini for all files etc.




Please reply to the list.

http://us2.php.net/ini_set

--
John C. Nichel IV
Programmer/System Admin (ÜberGeek)
Dot Com Holdings of Buffalo
716.856.9675
[EMAIL PROTECTED]

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



Re: [PHP] supressing warnings in error_log

2006-03-02 Thread Robert Cummings
On Thu, 2006-03-02 at 13:47, Jason Gerfen wrote:
 I would like to know how to suppress Warning error_log entries dealing 
 with undefined vars: eg.
 Undefined index:  del_pxe in /test.php on line 33, referer: 
 http://website.com/index.php

The best way is to write clean code that checks for the existence of the
index first. Understandably it may not be your case in which case you
should consult the manual, especially as it concerns error reporting.
That said, if it is YOUR code, quit being a slob, someday someone other
than you might have to maintain it.

Cheers,
Rob.
-- 
..
| InterJinn Application Framework - http://www.interjinn.com |
::
| An application and templating framework for PHP. Boasting  |
| a powerful, scalable system for accessing system services  |
| such as forms, properties, sessions, and caches. InterJinn |
| also provides an extremely flexible architecture for   |
| creating re-usable components quickly and easily.  |
`'

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



[PHP] Backend selection (ADOdb lib)

2006-03-02 Thread Olivier Cant

Hi list,

I'm writing some code at the moment, and I'm trying to make it as 
detached as possible from the database used behind.  So I already found 
ADOdb abstraction layer, which I find conienient.  But still the fact is 
that I need to connect to and select a database at the begining of somes 
script, and the connection to the database are the only thing that 
remain database-specific. 
My project has a somewhat classical conf.inc.php file in its root folder 
and I do database backend select in there.  According to the type of 
backend I generate some php code to be stored in à constant called 
CONNECTION_CODE which can in turn be passed to the eval() function into 
the script that need connection to the database can call 
eval(CONNECTION_CODE) and proceed connected to the database


I'm wondering if this is a decent approach to the abstraction problem, 
if it features any security risk (I don't like the eval() call) that 
I've missed.  Any suggestion welcome, code sample follows


Thanks folks.

config.inc.php :

/* Database Baclend selection */
/*  Now only MySQL backend is supported */
define(DB_BACKEND,mysql);

/*  Fill out these info if you selected MySQL Backend */
define (DB_MYSQL_SERVER,);
define (DB_MYSQL_USER,);
define (DB_MYSQL_PWD,);
define (DB_MYSQL_DATABASE,);
switch (DB_BACKEND) {
   case mysql :
   $connectCode = \$dbHandle = ADONewConnection(\mysql\);\n 
\$dbHandle-Connect(\ .
   DB_MYSQL_SERVER . \, \ . DB_MYSQL_USER . \, \ . 
DB_MYSQL_PWD . \, \ .

   DB_MYSQL_DATABASE . \);;
   define(CONNECTION_CODE, $connectCode);
   break;
}

and in any script that needs db connection :

eval(CONNECTION_CODE);
  
   $menuItems = $dbHandle-Execute('SELECT * FROM yeast_menu0_items');


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



[PHP] LDAP confusion

2006-03-02 Thread jblanchard
I am trying to work through connecting to and using LDAP with PHP. Thus
far I am able to connect and bind, but I cannot search.

$sr=ldap_search($ds, CN=configuration,DC=onecall,DC=local, cn=*);  

Gives me

Warning: ldap_search(): Search: Operations error in
/srv/www/htdocs/test/ldapTest.php on line 29

The dn is correct, it would seem that the search filter is the issue.
Can someone please enlighten me?

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



[PHP] APC and PHP 5.1.2

2006-03-02 Thread steve
I can't get APC 3.0.8 to work on anything, at all. On Windows, it
crashes the server, and on Linux, it can't handle objects. For
example:

?php

class abc {
}

$a = new abc;

var_dump($a);

?

Gives:

NULL

Any idea on what is going on?

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



RE: [PHP] LDAP confusion

2006-03-02 Thread jblanchard
[snip]
I am trying to work through connecting to and using LDAP with PHP. Thus
far I am able to connect and bind, but I cannot search.

$sr=ldap_search($ds, CN=configuration,DC=onecall,DC=local, cn=*);  

Gives me

Warning: ldap_search(): Search: Operations error in
/srv/www/htdocs/test/ldapTest.php on line 29

The dn is correct, it would seem that the search filter is the issue.
Can someone please enlighten me?
[/snip]

Aha! It may not be me. The LDAP server is Win2003 and has some known
problems when searching LDAP. I haven't located a solution, but if you
are privy to one or two or ten could you let me know?

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



Re: [PHP] APC and PHP 5.1.2

2006-03-02 Thread Rasmus Lerdorf

steve wrote:

I can't get APC 3.0.8 to work on anything, at all. On Windows, it
crashes the server, and on Linux, it can't handle objects. For
example:

?php

class abc {
}

$a = new abc;

var_dump($a);

?

Gives:

NULL

Any idea on what is going on?


Use the CVS version.  I need to push a new version out soon.

cvs -d :pserver:[EMAIL PROTECTED]:/repository login
Password: phpfi
cvs -d :pserver:[EMAIL PROTECTED]:/repository co pecl/apc
cd pecl/apc
phpize
./configure --enable-apc-mmap --with-apxs=/usr/local/bin/apxs \
--with-php-config=/usr/local/bin/php-config
make
make install

(and restart your web server)

-Rasmus

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



Re: [PHP] APC and PHP 5.1.2

2006-03-02 Thread steve
OK, will try. Does this work in the CVS version?

?php
error_reporting(E_ALL);
class A
{
public $_t = 'something';
public function __get($name)
{
$getter='get'.$name;
if(method_exists($this,$getter))
{
// getting a property
return $this-$getter();
}
}

public function getTest()
{
return 'OK';
}
}
$result='';
$one = new A();
var_dump($one);
echo BRTest \$one-getTest(): ;
echo $one-getTest();
echo BRTest \$one-Test: ;
echo $one-Test;
echo BRTest with eval: ;
eval ('$result = $one-Test; ');
echo $result;
echo BRTesting done.;



On 3/2/06, Rasmus Lerdorf [EMAIL PROTECTED] wrote:
 steve wrote:
  I can't get APC 3.0.8 to work on anything, at all. On Windows, it
  crashes the server, and on Linux, it can't handle objects. For
  example:
 
  ?php
 
  class abc {
  }
 
  $a = new abc;
 
  var_dump($a);
 
  ?
 
  Gives:
 
  NULL
 
  Any idea on what is going on?

 Use the CVS version.  I need to push a new version out soon.

 cvs -d :pserver:[EMAIL PROTECTED]:/repository login
 Password: phpfi
 cvs -d :pserver:[EMAIL PROTECTED]:/repository co pecl/apc
 cd pecl/apc
 phpize
 ./configure --enable-apc-mmap --with-apxs=/usr/local/bin/apxs \
  --with-php-config=/usr/local/bin/php-config
 make
 make install

 (and restart your web server)

 -Rasmus


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



Re: [PHP] APC and PHP 5.1.2

2006-03-02 Thread Rasmus Lerdorf

steve wrote:

OK, will try. Does this work in the CVS version?

?php
error_reporting(E_ALL);
class A
{
public $_t = 'something';
public function __get($name)
{
$getter='get'.$name;
if(method_exists($this,$getter))
{
// getting a property
return $this-$getter();
}
}

public function getTest()
{
return 'OK';
}
}
$result='';
$one = new A();
var_dump($one);
echo BRTest \$one-getTest(): ;
echo $one-getTest();
echo BRTest \$one-Test: ;
echo $one-Test;
echo BRTest with eval: ;
eval ('$result = $one-Test; ');
echo $result;
echo BRTesting done.;


It outputs:
object(A)#1 (1) { [_t]=  string(9) something }
Test $one-getTest(): OK
Test $one-Test: OK
Test with eval: OK
Testing done.

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



Re: [PHP] APC and PHP 5.1.2

2006-03-02 Thread steve
:)

On 3/2/06, Rasmus Lerdorf [EMAIL PROTECTED] wrote:
 steve wrote:
  OK, will try. Does this work in the CVS version?
 
  ?php
  error_reporting(E_ALL);
  class A
  {
  public $_t = 'something';
  public function __get($name)
  {
  $getter='get'.$name;
  if(method_exists($this,$getter))
  {
  // getting a property
  return $this-$getter();
  }
  }
 
  public function getTest()
  {
  return 'OK';
  }
  }
  $result='';
  $one = new A();
  var_dump($one);
  echo BRTest \$one-getTest(): ;
  echo $one-getTest();
  echo BRTest \$one-Test: ;
  echo $one-Test;
  echo BRTest with eval: ;
  eval ('$result = $one-Test; ');
  echo $result;
  echo BRTesting done.;

 It outputs:
 object(A)#1 (1) { [_t]=  string(9) something }
 Test $one-getTest(): OK
 Test $one-Test: OK
 Test with eval: OK
 Testing done.



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



Re: [PHP] binding adodb

2006-03-02 Thread Raúl Castro Marín

Hello I could resolve the problem, I'm rewrote query:

$query = SELECT munici_mun, UPPER(nombre_mun)
   FROM MUNI
   WHERE departa_dpt = ?
AND munici_mun = 994
 AND UPPER(nombre_mun) LIKE ?

then I only change the variable definition like:

$bind[] = '%'.$key.'%';

thanks

- Original Message - 
From: Chris [EMAIL PROTECTED]

To: Raúl Castro Marín [EMAIL PROTECTED]
Cc: php-general@lists.php.net
Sent: Wednesday, March 01, 2006 7:25 PM
Subject: Re: [PHP] binding adodb




Raúl Castro Marín wrote:
I got a little question, I just start to use binding adodb but I got a 
problem: my primary query on Oracle is:


$query = SELECT munici_mun, UPPER(nombre_mun) FROM MUNI WHERE 
departa_dpt = ? AND munici_mun = 994;


It is execute with any problem, but when I add another clause with 
keyword:


AND UPPER(nombre_mun) LIKE '%?%'   then next sentence is execute but no 
record is returned
$query = SELECT munici_mun, UPPER(nombre_mun) FROM MUNI WHERE 
departa_dpt = ? AND munici_mun = 994 AND UPPER(nombre_mun) LIKE '%?%' I 
think that adodbd doesn't parse ? like a variable on clause LIKE '%?%'. 
What can I do to write this sentence correctly?


thanks for your help!


Hi,

You might get a quicker response on their mailing list:

http://adodb.sourceforge.net/#mail

It might not pick it up because it's in quotes but they will be able to 
tell you for sure.


--
Postgresql  php tutorials
http://www.designmagick.com/

--=neXtPaRt_1141258927
Content-Type: text/plain;

Este correo se ha verificado por el Firewall de la CDMB

--=neXtPaRt_1141258927-- 


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



[PHP] Only 4 of 5...

2006-03-02 Thread Gustav Wiberg

Hi there!

What's wrong here??

?php
...
open db...


$sql = SELECT IDPic, picNameSmall FROM tbpics;

$querys = mysql_query($sql);
$dbArray = mysql_fetch_array($querys);


if (intval($frmIDModel)0) {

?
bVisa telefonbilder för ?php echo $dbModelName;?:/bbr
?php
}
else if (intval($frmIDManufacturer)0) {

   $dbNameManufacturer = $dbArray[nameManufacturer];

 ?
 bVisa telefonbilder för ?php echo $dbNameManufacturer;?:/bbr
 ?php
}
else {
?
bAlla telefonbilder i arkivet:/bbr
?php


   while ($dbArray = mysql_fetch_array($querys)) {
 $dbIDPic = $dbArray[IDPic];
 $dbPicNameSmall = $dbArray[picNameSmall];
 ?
 img src=phonepics/?php echo $idModel;?_?php echo 
$dbPicNameSmall;? alt=testbild från mobil border=1 width=120 
height=130

 ?php

   }

}
   ?

I have 5 posts in the table, but the images shown are only four! Why?

/G

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



RE: [PHP] Only 4 of 5...

2006-03-02 Thread jblanchard
[snip]
I have 5 posts in the table, but the images shown are only four! Why?
[/snip]

Are you counting starting with 1 or 0?

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



Re: [PHP] APC and PHP 5.1.2

2006-03-02 Thread steve
OK, got it and installed it (checked the output of phpinfo to
confirm), and I get this on both the first load (uncached) and later
loads (cached):

NULL
Test $one-getTest():

With an error in the error log telling me I'm a dope for dereferencing
a null object.

Why does the weird stuff always happen to me?

Without APC it runs fine. I'm using Fastcgi version if that matters.

-steve--


On 3/2/06, Rasmus Lerdorf [EMAIL PROTECTED] wrote:
 steve wrote:
  I can't get APC 3.0.8 to work on anything, at all. On Windows, it
  crashes the server, and on Linux, it can't handle objects. For
  example:
 
  ?php
 
  class abc {
  }
 
  $a = new abc;
 
  var_dump($a);
 
  ?
 
  Gives:
 
  NULL
 
  Any idea on what is going on?

 Use the CVS version.  I need to push a new version out soon.

 cvs -d :pserver:[EMAIL PROTECTED]:/repository login
 Password: phpfi
 cvs -d :pserver:[EMAIL PROTECTED]:/repository co pecl/apc
 cd pecl/apc
 phpize
 ./configure --enable-apc-mmap --with-apxs=/usr/local/bin/apxs \
  --with-php-config=/usr/local/bin/php-config
 make
 make install

 (and restart your web server)

 -Rasmus


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



Re: [PHP] APC and PHP 5.1.2

2006-03-02 Thread Rasmus Lerdorf

steve wrote:

OK, got it and installed it (checked the output of phpinfo to
confirm), and I get this on both the first load (uncached) and later
loads (cached):

NULL
Test $one-getTest():

With an error in the error log telling me I'm a dope for dereferencing
a null object.

Why does the weird stuff always happen to me?

Without APC it runs fine. I'm using Fastcgi version if that matters.


It probably does.  I have never tried it against the Fastcgi sapi.  Try 
it with the Apache module version to rule this out.


-Rasmus

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



Re: [PHP] Only 4 of 5...

2006-03-02 Thread Gustav Wiberg


- Original Message - 
From: [EMAIL PROTECTED]

To: [EMAIL PROTECTED]; php-general@lists.php.net
Sent: Thursday, March 02, 2006 11:05 PM
Subject: RE: [PHP] Only 4 of 5...


[snip]
I have 5 posts in the table, but the images shown are only four! Why?
[/snip]

Are you counting starting with 1 or 0?

Don't understand your question... I have 5 posts in the table, but I'll only 
retrieve 4 posts when going through the array... like this...


while ($dbArray = mysql_fetch_array($querys)) {
 $dbIDPic = $dbArray[IDPic];
 $dbPicNameSmall = $dbArray[picNameSmall];
 ?
 img src=phonepics/?php echo $idModel;?_?php echo
$dbPicNameSmall;? alt=testbild från mobil border=1 width=120
height=130
 ?php

   }


/G
. 


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



Re: [PHP] Only 4 of 5...

2006-03-02 Thread Thorsten Suckow-Homberg

Because of this:


$dbArray = mysql_fetch_array($querys);


This will fill $dbArray with the first row fetched from the table. 4 are 
left which you are calling in your loop at the end of your code example. 
What's your reason anyway to call mysql_fetch_array() here?

Delete this line and I'd bet you're getting your 5 results ;)

HTH

Thorsten

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



RE: [PHP] Only 4 of 5...

2006-03-02 Thread jblanchard
[snip]
 while ($dbArray = mysql_fetch_array($querys)) {
  $dbIDPic = $dbArray[IDPic];
  $dbPicNameSmall = $dbArray[picNameSmall];
  ?
  img src=phonepics/?php echo $idModel;?_?php echo
$dbPicNameSmall;? alt=testbild från mobil border=1 width=120
height=130
  ?php
[/snip]

Is $dbIDPic an integer? Does it start with 0 or 1?

Try 
$dbArray = mysql_fetch_array($querys);
For($i = 0, $i  count($dbArray), $i++){
echo $dbArray[0] . \t . $dbArray[1] . \n;
}

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



RE: [PHP] LDAP confusion

2006-03-02 Thread jblanchard
[snip]
Aha! It may not be me. The LDAP server is Win2003 and has some known
problems when searching LDAP. I haven't located a solution, but if you
are privy to one or two or ten could you let me know?
[/snip]

Well, I thought that I had escaped the hell of a Windows world when I
accepted this position, and now it is just not true. We have all of our
users authenticating through AD on a W2003Server, so I thought I'd use
LDAP for web authentication as well.

It doesn't work.

For some cockamaimee reason there are problems using PHP/LDAP with
W2003Server. To be sure, I found plenty of evidence that all was well
prior to W2003Server, there are many posts web wide about how well it
was working with W2KServer, etc.

Does anyone know how I can fix this without having our Windows folks do
something to the server which will undoubtedly hose things up?

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



Re: [PHP] Only 4 of 5...

2006-03-02 Thread Gustav Wiberg


- Original Message - 
From: [EMAIL PROTECTED]

To: [EMAIL PROTECTED]; php-general@lists.php.net
Sent: Thursday, March 02, 2006 11:15 PM
Subject: RE: [PHP] Only 4 of 5...


[snip]
while ($dbArray = mysql_fetch_array($querys)) {
 $dbIDPic = $dbArray[IDPic];
 $dbPicNameSmall = $dbArray[picNameSmall];
 ?
 img src=phonepics/?php echo $idModel;?_?php echo
$dbPicNameSmall;? alt=testbild från mobil border=1 width=120
height=130
 ?php
[/snip]

Is $dbIDPic an integer? Does it start with 0 or 1?

Try
$dbArray = mysql_fetch_array($querys);
For($i = 0, $i  count($dbArray), $i++){
echo $dbArray[0] . \t . $dbArray[1] . \n;
}


It gives exactly the same resultset... and it should do right?
but as I understand it For-each is faster?

/G



--
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] Only 4 of 5...

2006-03-02 Thread Gustav Wiberg


- Original Message - 
From: Thorsten Suckow-Homberg [EMAIL PROTECTED]
To: Gustav Wiberg [EMAIL PROTECTED]; PHP General 
php-general@lists.php.net

Sent: Thursday, March 02, 2006 11:13 PM
Subject: Re: [PHP] Only 4 of 5...



Because of this:


$dbArray = mysql_fetch_array($querys);


This will fill $dbArray with the first row fetched from the table. 4 are 
left which you are calling in your loop at the end of your code example. 
What's your reason anyway to call mysql_fetch_array() here?

Delete this line and I'd bet you're getting your 5 results ;)

HTH

Thorsten


Aha, this seems reasonable! Thanx, this solved it!

/G

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



[PHP] Displaying Form Errors

2006-03-02 Thread Paul Goepfert
Hello all,

I am building a web page and I don't know how to display the errors
that the user may enter.  OK this is how I have my web page setup:

I first do a isset check on $submit.  And I am not sure about this.  I
believe that this variable is set when i click on the submit button. 
I don't have a $submit variable assigned to anything in my web page. 
What I would like is to have $submit assigned to the submit button. 
How do I do that?

In the if block I do my validation of the web form.  In the else block
I have the contents of the page.

I have posted this question before and I got some good pointers on how
I should go about doing my validation but I have not yet figured out
how to display the errors on the page.  Could someone help me with
that.  I am doing the validation on the same page as the web page.  I
don't forward to a new page to do the validation.

Thanks

Paul

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



Re: [PHP] LDAP confusion

2006-03-02 Thread Chris

[EMAIL PROTECTED] wrote:

[snip]
Aha! It may not be me. The LDAP server is Win2003 and has some known
problems when searching LDAP. I haven't located a solution, but if you
are privy to one or two or ten could you let me know?
[/snip]

Well, I thought that I had escaped the hell of a Windows world when I
accepted this position, and now it is just not true. We have all of our
users authenticating through AD on a W2003Server, so I thought I'd use
LDAP for web authentication as well.

It doesn't work.

For some cockamaimee reason there are problems using PHP/LDAP with
W2003Server. To be sure, I found plenty of evidence that all was well
prior to W2003Server, there are many posts web wide about how well it
was working with W2KServer, etc.

Does anyone know how I can fix this without having our Windows folks do
something to the server which will undoubtedly hose things up?



I vaguely recall you couldn't do an anonymous bind to an active 
directory system - you had to properly authenticate before you could do 
a search.


You didn't include the bind stuff so I can't tell if that's the problem :)


--
Postgresql  php tutorials
http://www.designmagick.com/

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



Re: [PHP] Displaying Form Errors

2006-03-02 Thread Anthony Ettinger
On 3/2/06, Paul Goepfert [EMAIL PROTECTED] wrote:
 Hello all,

 I am building a web page and I don't know how to display the errors
 that the user may enter.  OK this is how I have my web page setup:

 I first do a isset check on $submit.  And I am not sure about this.  I
 believe that this variable is set when i click on the submit button.
 I don't have a $submit variable assigned to anything in my web page.
 What I would like is to have $submit assigned to the submit button.
 How do I do that?

 In the if block I do my validation of the web form.  In the else block
 I have the contents of the page.

 I have posted this question before and I got some good pointers on how
 I should go about doing my validation but I have not yet figured out
 how to display the errors on the page.  Could someone help me with
 that.  I am doing the validation on the same page as the web page.  I
 don't forward to a new page to do the validation.

 Thanks

 Paul

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




post it to itself ie - action=submit.php, and your data will end up
in $_request[name1];
validate these, if an error occurs, I would add class=error to the
html element, and use css to display it as red. And dump an error
message above the form, make sure you validate all fields before
breaking out, track them in an $errors = array(); ...makes for a
better user experience.

Typically, there is a hidden field called run or mode indicating
what flow you're in.

form action=controller.php method=post id=login
input type=hidden name=run value=login/
fieldset
  legendLogin/legend
labelUsername:/label input type=text name=username/
labelPassword:/label input type=password name=password/
/fieldset
/form


--
Anthony Ettinger
Signature: http://chovy.dyndns.org/hcard.html

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



Re: [PHP] leading slash in SCRIPT_NAME variable

2006-03-02 Thread Chris

Roman Rumisek wrote:

In phpinfo page SCRIPT_NAME variable is set correctly.

What have effect this variable ? May be include_path setting ?


That means something in your script is modifying it.

Without seeing code nobody's going to be able to help much more than that.

If it's a lot of code, every 50 lines echo out $_SERVER['SCRIPT_NAME'], 
or if you're using functions then print it out in every function call - 
see where it breaks then work backwards.



Rumisek

Chris wrote:



Roman Rumisek wrote:


Hi,

i have configured apache 2.0.50 with mod_php 4.4.2 and
$_SERVER['SCRIPT_NAME'] beginning with /// (three slash).

Where have i a error ? (probably configuration)

Application apache configuration:

Alias /trsklad/ /.../projects/akce/src/html/
Directory /.../projects/akce/src/html/
   AllowOverride All
   Order deny,allow
   Deny from all
   Allow from 127.0.0.1
/Directory

Thanks

Rumisek



I don't think it's apache.

Are you seeing this in a phpinfo page or in your code somewhere?

If you're not using a phpinfo page then create one and see if it's in
there first.







--
Postgresql  php tutorials
http://www.designmagick.com/

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



Re: [PHP] leading slash in SCRIPT_NAME variable

2006-03-02 Thread Chris

Chris wrote:

Roman Rumisek wrote:


In phpinfo page SCRIPT_NAME variable is set correctly.

What have effect this variable ? May be include_path setting ?



That means something in your script is modifying it.

Without seeing code nobody's going to be able to help much more than that.

If it's a lot of code, every 50 lines echo out $_SERVER['SCRIPT_NAME'], 
or if you're using functions then print it out in every function call - 
see where it breaks then work backwards.


I should also say don't post all of your code to the list - use 
http://www.pastebin.com and send us a url.


--
Postgresql  php tutorials
http://www.designmagick.com/

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



Re: [PHP] APC and PHP 5.1.2

2006-03-02 Thread steve
You know not what you ask!! I'm going to have to wait a bit before I
do that. Currently using Apache 2, and the config files would need to
be different, etc., so I'll have to choose a webserver I can take down
for a longer time. :(

What I did try was different versions of PHP (All using FastCGI 
APC-dev) (if this even helps):

5.1.2 -- Failed
5.1.1 -- Failed
5.0.5 -- Success

-steve--

On 3/2/06, Rasmus Lerdorf [EMAIL PROTECTED] wrote:
 It probably does.  I have never tried it against the Fastcgi sapi.  Try
 it with the Apache module version to rule this out.

 -Rasmus


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



[PHP] Re: APC and PHP 5.1.2

2006-03-02 Thread Jens Kleikamp

steve wrote:

You know not what you ask!! I'm going to have to wait a bit before I
do that. Currently using Apache 2, and the config files would need to
be different, etc., so I'll have to choose a webserver I can take down
for a longer time. :(

What I did try was different versions of PHP (All using FastCGI 
APC-dev) (if this even helps):

5.1.2 -- Failed
5.1.1 -- Failed
5.0.5 -- Success

-steve--

On 3/2/06, Rasmus Lerdorf [EMAIL PROTECTED] wrote:

It probably does.  I have never tried it against the Fastcgi sapi.  Try
it with the Apache module version to rule this out.

-Rasmus





Your script works fine for me on linux, php 5.1.2 FastCGI + apc-dev.

Jens

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



Re: [PHP] Only 4 of 5...

2006-03-02 Thread John Nichel

Gustav Wiberg wrote:

Hi there!

What's wrong here??

?php
...
open db...


$sql = SELECT IDPic, picNameSmall FROM tbpics;

$querys = mysql_query($sql);
$dbArray = mysql_fetch_array($querys);


You're pulling the first row here


if (intval($frmIDModel)0) {

?
bVisa telefonbilder för ?php echo $dbModelName;?:/bbr
?php
}
else if (intval($frmIDManufacturer)0) {

   $dbNameManufacturer = $dbArray[nameManufacturer];

 ?
 bVisa telefonbilder för ?php echo $dbNameManufacturer;?:/bbr
 ?php
}
else {
?
bAlla telefonbilder i arkivet:/bbr
?php



So now there are only 4 rows left when you loop thru them here.


   while ($dbArray = mysql_fetch_array($querys)) {
 $dbIDPic = $dbArray[IDPic];
 $dbPicNameSmall = $dbArray[picNameSmall];
 ?
 img src=phonepics/?php echo $idModel;?_?php echo 
$dbPicNameSmall;? alt=testbild från mobil border=1 width=120 
height=130

 ?php

   }

}
   ?

I have 5 posts in the table, but the images shown are only four! Why?

/G




--
By-Tor.com
...it's all about the Rush
http://www.by-tor.com

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



[PHP] Problems with file()

2006-03-02 Thread Julius Hacker
Hi,

I've some problems with the file()-function:
I call the function with the argument
http://www.azubo.de/api/csv.cfm?PartnerID=17PartnerPass=28O2NGC3result=end,auctionid,url,title,cat,price,bids,currency,image;
and only get an array of empty strings.

With other addresses as argument it works just fine.

Can anybody help me here?

Thanks :)

-- 
Regards
Julius Hacker

http://www.julius-hacker.de
[EMAIL PROTECTED]

OpenPGP-Key-ID: 0x4B4A486E

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



Re: [PHP] binding adodb

2006-03-02 Thread Brian V Bonini
On Wed, 2006-03-01 at 19:25, Chris wrote:
 Raúl Castro Marín wrote:
  I got a little question, I just start to use binding adodb but I got a 
  problem: my primary query on Oracle is:
  
  $query = SELECT munici_mun, UPPER(nombre_mun) 
  FROM MUNI 
  WHERE departa_dpt = ? AND 
  munici_mun = 994;
  
  It is execute with any problem, but when I add another clause with keyword:
  
  AND UPPER(nombre_mun) LIKE '%?%'   then next sentence is execute but no 
  record is returned
  $query = SELECT munici_mun, UPPER(nombre_mun) 
  FROM MUNI 
  WHERE departa_dpt = ? 
  AND munici_mun = 994 
  AND UPPER(nombre_mun) LIKE '%?%' 
  
  I think that adodbd doesn't parse ? like a variable on clause LIKE '%?%'. 
  What can I do to write this sentence correctly?

Does it return anything if you run it directly against the DB?



-- 

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] Problems with file()

2006-03-02 Thread Chris

Julius Hacker wrote:

Hi,

I've some problems with the file()-function:
I call the function with the argument
http://www.azubo.de/api/csv.cfm?PartnerID=17PartnerPass=28O2NGC3result=end,auctionid,url,title,cat,price,bids,currency,image;
and only get an array of empty strings.

With other addresses as argument it works just fine.

Can anybody help me here?

Thanks :)



Is safe-mode on or allow_url_fopen off ?

Check a phpinfo page.

--
Postgresql  php tutorials
http://www.designmagick.com/

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



Re: [PHP] Where can I find nice Web icons for custom admin interface?

2006-03-02 Thread Grant Young

Hi Nicolas.

I've collected some pointers over the past few months to royalty free 
icons and designers at:

http://del.icio.us/braquin/icons

HTH.

Regards, Grant

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