[PHP] Re: annoying autoreplies

2004-08-08 Thread Chris Martin
Robby Russell wrote:
To all those who have auto-replys set for their email, please turn them
off. ;-)
We shouldn't have to opt-in to 3 different peoples spam email sites so
that we can post to the list. heh.
-Robby
Seriously, we shouldn't have to setup a new mail filter everytime we 
reply either!

At least they're not on PDXLUG!!!
--
Chris Martin
Web Developer
Open Source  Web Standards Advocate
http://www.chriscodes.com/
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Re: annoying autoreplies

2004-08-08 Thread Bjorn Sodergren
heh, i subscribe to a couple mailing lists for a product that i work
with (a rather large company). last month i got a record 43 out of
office  replies from a single message to their list.


On Sat, 07 Aug 2004 23:37:27 -0700, Chris Martin [EMAIL PROTECTED] wrote:
 Robby Russell wrote:
  To all those who have auto-replys set for their email, please turn them
  off. ;-)
 
  We shouldn't have to opt-in to 3 different peoples spam email sites so
  that we can post to the list. heh.
 
  -Robby
 
 
 Seriously, we shouldn't have to setup a new mail filter everytime we
 reply either!
 
 At least they're not on PDXLUG!!!
 
 --
 Chris Martin
 Web Developer
 Open Source  Web Standards Advocate
 http://www.chriscodes.com/
 
 
 
 --
 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] SQL Join query

2004-08-08 Thread Lenar Lõhmus
Mattias Thorslund wrote:

 Though, (regardless of SQL database platform) in a case like this, it
 MAY be both more straightforward and efficient to use two separate
 queries for the pictures and comments, given the one-to-many cardinality
 between them.  The above statement causes redundant data to be returned
 - it duplicates the pics record for each new comment.  If there are many
 large columns in the pics table and many comments to each record there's
 a lot of redundant data in a query like that.

No, I think you are wrong. There was GROUP BY pics.id so it won't return
duplicate data. And probable overhead is eliminated too I think - DBserver
will optimize and will join data from pic_comments only once for each
unique pics.id.

Lenar

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



[PHP] Re: Function Mail

2004-08-08 Thread Torsten Roehr
Juan Pablo Herrera [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 Hi everybody,
 I have a cuestion about the features on function mail. I think that it
 send the email one to one address. Is it ok?.
 Regards,
 Juan Pablo

Hi Juan Pablo,

the manual says:

mail() automatically mails the message specified in message to the receiver
specified in to . Multiple recipients can be specified by putting a comma
between each address in to.

This should answer your question. Otherwise take a look at the manual page:
http://de2.php.net/manual/en/function.mail.php

Regards, Torsten Roehr

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



Re: [PHP] Local version works - production breaks

2004-08-08 Thread Torsten Roehr
 Robby,

 I just enabled log_errors locally. No errors (as I thought).

 Since I am hacking a previously written site, the problem seems to arise
most
 when accessing his pre-built functions across pages. For instance, he uses
a
 'cards.php' to store all display functions -- showleft() -- showcentre() ,
as
 well as the connect() function.


Hi Andre,

make sure to use require_once for all includes. This will make sure to only
include each file once and will trigger a fatal error if the file cannot be
found because of a wrong path or whatever.

Hope this helps, Torsten Roehr


 Since its a persistent connection -- he opens
 the db once, then performs various queries in it. However, since
'cards.php'
 has already been called once by a page that might require both showleft()
and
 showcentre() -- it barfs and says that it cannot 'redeclare' the
showleft()
 function that has already been declared??  That is really some weird --
 particularly when it works so well (as expected) locally - and also since
I'm
 not 'redeclaring' but calling it for use!

 I cannot fathom why the production site would give this error. Perhaps I
need
 to do absolute paths for all headers? But it doesn't make sense that a
 function cannot be called many times -- declaring it once, yes, but
calling
 its use?? If that were the case, then one might as well write it out
longhand
 for each use, and forget the concept of 'functions'.

 I think I should look at the error logs for the site -- maybe they will
clue
 me in where I should look.

 Thanks,
 Andre

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



[PHP] WYSIWyG

2004-08-08 Thread Me2resh






Hi
i am using WYSIWYG (_javascript_ editor) to enter the contents of online news website ,(PHP  MYSQL) 
everything works pretty good on my local server
but online 
when i enter a page
i find that the colors i choosed changed 
would this be a problem on my code or on something on the server or the _javascript_
i didn't know what part of my code to include here
so can anyone tell me where is the problem ?
code is available for discuss








 IncrediMail - Email has finally evolved - Click Here

Re: [PHP] safe_mode restriction

2004-08-08 Thread Kevin
 So after the directories are created, those are the actual permissions
that
 are on them? Did you actually check this or are you assuming it? If you
can,
 please show us the output of 'ls -al' of the directories in question.

Yes, I have seen the permission and its rwx-rwx-rwx i.e 777.

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



[PHP] php_check_syntax loads functions and classes

2004-08-08 Thread Michael Scholl
Hi,
I'm running PHP 5.0.0 with Apache 2.0.50 and have a problem with the
php_check_syntax function. When I use it, it loads all functions ans
classes. But I only want to check the syntax, not to load the files.
Is this a bug or a feature ?
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Bouncer Test

2004-08-08 Thread Aidan Lister
Please do not reply to this email, or you will be taken off the mailing list.

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



[PHP] PHP and Apache 2

2004-08-08 Thread Rosen
Hi,
What is the reason, thath in the installation manual of PHP writes:
WARNING:
Do not use Apache 2.0 and PHP in a production environment neither on Unix
nor on Windows. 

Thanks,
Rosen

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



Re: [PHP] WYSIWyG

2004-08-08 Thread raditha dissanayake
Please read the list newbie guide
--
Raditha Dissanayake.

http://www.radinks.com/sftp/ | http://www.raditha.com/megaupload
Lean and mean Secure FTP applet with | Mega Upload - PHP file uploader
Graphical User Inteface. Just 128 KB | with progress bar.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Re: PHP and Apache 2

2004-08-08 Thread Aidan Lister
Hi Rosen,

It doesn't hurt to use google you know.

[Q:]
Is there going to be a version of PHP 4.x which is declared stable for use
with Apache 2.x or, is this feature going to be reserved for PHP5?

[A:]
The development of the Apache 2 module is completely disconnected from the
PHP 5 efforts. I think that these efforts have slowed down to a halt, mostly
because of lack of interest in the PHP development community, mostly because
the only reliable way of using PHP and Apache 2 together is using the
prefork MPM, which is effectively very similar to Apache 1. Good Apache 2
connectivity is going to come at some point, but I'm not exactly sure when
it would be.


Basically PHP isn't threadsafe, and Apache2 uses threads.

I hope that helps.


Rosen [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 Hi,
 What is the reason, thath in the installation manual of PHP writes:
 WARNING:
 Do not use Apache 2.0 and PHP in a production environment neither on Unix
 nor on Windows. 

 Thanks,
 Rosen

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



Re: [PHP] Local version works - production breaks

2004-08-08 Thread Andre Dubuc
Thanks for the idea, Josh.

I will do this, but still this hack doesn't answer the question: Why does it 
work locally without hitch, yet totally barfs on a very similar configuration 
on the net?

As I mentioned, this is a re-write. I've learned my lesson: never try to patch 
another's code -- write it fresh! There is simply way too much weird behavior 
happening with the present code: sessions not passing, odd error messages 
about redeclaration, and conditionals where both are passed.

Time to dump it and start fresh!

Thanks (to everyone) for your help and pointers!
Andre


On Sunday 08 August 2004 09:19 am, Josh Acecool M wrote:
 Try adding
 if (!function_exists(function_name)) {
 function function_name ($blah) {
 // Function Code
 }
 }
 for each function.

 That will fix the redeclare problem which happens if you call your
 cards.php file in more than 1 file..

 Andre Dubuc [EMAIL PROTECTED] wrote in message
 news:[EMAIL PROTECTED]

  On Saturday 07 August 2004 10:11 pm, Robby Russell wrote:
   On Sat, 2004-08-07 at 19:00, Ed Lazor wrote:
It could be that you have local error reporting set to none.  It
could also be that you're using full paths when referencing files
which then breaks when moving files to a new server.  Basically,
there's a lot of possibilities and I'm not going to have much luck
helping unless you include error messages.  My guess is that
resolving a few errors will address a core problem and everything
will start working.
   
-Ed
  
   Yes, it's very possible that he isn't getting errors locally because
   his errors aren't on.
  
   Andre,
  
   You might check your error settings on your local server. You might
   even consider upgrading php on your local server to the same version
   and debugging.
  
   -Robby
  
   --
   /***
   * Robby Russell | Owner.Developer.Geek
   * PLANET ARGON  | www.planetargon.com
   * Portland, OR  | [EMAIL PROTECTED]
   * 503.351.4730  | blog.planetargon.com
   * PHP/PostgreSQL Hosting  Development
   /
 
  Robby,
 
  I just enabled log_errors locally. No errors (as I thought).
 
  Since I am hacking a previously written site, the problem seems to arise

 most

  when accessing his pre-built functions across pages. For instance, he
  uses

 a

  'cards.php' to store all display functions -- showleft() -- showcentre()
  ,

 as

  well as the connect() function. Since its a persistent connection -- he

 opens

  the db once, then performs various queries in it. However, since

 'cards.php'

  has already been called once by a page that might require both showleft()

 and

  showcentre() -- it barfs and says that it cannot 'redeclare' the

 showleft()

  function that has already been declared??  That is really some weird --
  particularly when it works so well (as expected) locally - and also since

 I'm

  not 'redeclaring' but calling it for use!
 
  I cannot fathom why the production site would give this error. Perhaps I

 need

  to do absolute paths for all headers? But it doesn't make sense that a
  function cannot be called many times -- declaring it once, yes, but

 calling

  its use?? If that were the case, then one might as well write it out

 longhand

  for each use, and forget the concept of 'functions'.
 
  I think I should look at the error logs for the site -- maybe they will

 clue

  me in where I should look.
 
  Thanks,
  Andre

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



Re: [PHP] SQL Join query

2004-08-08 Thread Curt Zirzow
* Thus wrote Lenar Lhmus:
 Mattias Thorslund wrote:
 
  Though, (regardless of SQL database platform) in a case like this, it
  MAY be both more straightforward and efficient to use two separate
  queries for the pictures and comments, given the one-to-many cardinality
  between them.  The above statement causes redundant data to be returned
  - it duplicates the pics record for each new comment.  If there are many
  large columns in the pics table and many comments to each record there's
  a lot of redundant data in a query like that.
 
 No, I think you are wrong. There was GROUP BY pics.id so it won't return
 duplicate data. And probable overhead is eliminated too I think - DBserver
 will optimize and will join data from pic_comments only once for each
 unique pics.id.

The results will be something like:

id submitter count pic_id comment
1  joe4  1comment1
1  joe4  1comment2
1  joe4  1comment3
1  joe4  1comment4
2  john   0  2NULL
3  jim5  3comment6
3  jim5  3comment7
3  jim5  3comment8
3  jim5  3comment9
3  jim5  3comment10



Curt
-- 
First, let me assure you that this is not one of those shady pyramid schemes
you've been hearing about.  No, sir.  Our model is the trapezoid!

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



Re: [PHP] Function Mail

2004-08-08 Thread John Holmes
Juan Pablo Herrera wrote:
I have a cuestion about the features on function mail. I think that it
send the email one to one address. Is it ok?.
Yes. It is all ok.
--
John Holmes
php|architect - The magazine for PHP professionals - http://www.phparch.com
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] php_check_syntax loads functions and classes

2004-08-08 Thread John Holmes
Michael Scholl wrote:
I'm running PHP 5.0.0 with Apache 2.0.50 and have a problem with the
php_check_syntax function. When I use it, it loads all functions ans
classes. But I only want to check the syntax, not to load the files.
Is this a bug or a feature ?
I'd say it was a bug, but since the function isn't really documented, 
it's hard to say what the intent of the function is.

There's already this bug regarding the second parameter: 
http://bugs.php.net/bug.php?id=29454

This function seems really screwy anyhow. If I have a function foo() in 
the file I'm checking and a function foo() in the main PHP file declared 
after I check the syntax... I'll get a failure for checking the syntax 
of the file... even though there isn't one.

test.php
?php
$b = php_check_syntax('test1.php');
if(!$b)
{ echo 'Error in syntax'; }
function foo()
{ echo 'test.php::foo'; }
foo();
?
test1.php
?php
function foo()
{ echo 'test1.php::foo'; }
?
I get the Error in syntax message although test1.php loads without 
error on it's own and the foo() call outputs test.php::foo...

I'm going to open up a bug report and go over some of this. Seems like a 
very handy function to have if it worked correctly.

--
John Holmes
php|architect - The magazine for PHP professionals - http://www.phparch.com
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] WYSIWyG

2004-08-08 Thread Matthew Sims
 Hi
 i am using WYSIWYG (javascript editor) to enter the contents of online
 news
 website ,(PHP  MYSQL)
 everything works pretty good on my local server
 but online
 when i enter a page
 i find that the colors i choosed changed
 would this be a problem on my code or on something on the server or the
 javascript
 i didn't know what part of my code to include here
 so can anyone tell me where is the problem ?
 code is available for discuss

And how does this relate to PHP??

-- 
--Matthew Sims
--http://killermookie.org

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



Re: [PHP] php_check_syntax loads functions and classes

2004-08-08 Thread John Holmes
Michael Scholl wrote:
I'm running PHP 5.0.0 with Apache 2.0.50 and have a problem with the
php_check_syntax function. When I use it, it loads all functions ans
classes. But I only want to check the syntax, not to load the files.
Is this a bug or a feature ?
Actually I found this bug (http://bugs.php.net/bug.php?id=27406) which 
has the answer we're all looking for: Don't misuse the function. Very 
helpful, eh? I added a comment to please enlighten us what the proper 
usage was, so maybe that'll help.

--
John Holmes
php|architect - The magazine for PHP professionals - http://www.phparch.com
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] php source management

2004-08-08 Thread Jordi Canals
CHAN YICK WAI wrote:
 if a project is worked by a small team of developers, is there a tool for source and 
 version management for php source code? e.g. check which part of source is modified!
 
 Thanks for information.
 
 
 Regards, Yw

If you're on windows I recommend using WinCVS and CVSnt. Also, you
should check for SubVersion and RapidSVN. I like them more, but have the
problem taht not intergrate with as many development tools as CVS.

On Linux, just check for CVS or Subversion. gCVS is also a nice
interface to CVS.

Regards.
Jordi

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



Re: [PHP] HOWTO run PHP4 and PHP5 on Apache/Linux

2004-08-08 Thread AJL
On Tue, Aug 03, 2004 at 10:04:11PM -0500, AJL wrote:
 
 I ran into so many problems trying to set this up that I thought I'd
 post my notes to hopefully save others some trouble.
 
 I found most of the information I needed at:
 http://rayh.co.uk/archives/13_PHP5__PHP4_side_by_side.html
 but the link doesn't seem to be working anymore, so here are my notes.
 
 Versions:
 PHP4.x module (already compiled and installed, this was
 straightforward in docs at www.php.net)
 PHP5.0.0 cgi
 RedHat linux 6.x
 Apache 1.3.22
 
 PHP5 configure command:
 ./configure \
 --prefix=/usr/local/php/php5.0.0 \
 --with-config-file-path=/usr/local/php/php5.0.0/ \
 --with-config-file=/usr/local/php/php5.0.0/php.ini \
 --enable-force-cgi-redirect \
 --disable-path-info-check \
 --enable-safe-mode \
 --disable-short-tags \
 --with-regex=system \
 --with-mysql \
 --enable-debug \
 --with-mcrypt \
 --enable-versioning \
 --disable-libxml
 
 NOTE: when I enabled '--enable-discard-path', pages would load blank.
 Don't use this unless you know what you are doing.  I don't understand
 exactly what this does.
 
 NOTE: The options '--with-apxs' and '--with-apache' tell configure to
 build apache module and CLI.  The absence of these tells it to build
 the CGI version.  So DO NOT USE them if you want the CGI version.
 
 make
 make test
 make install
 
 
 Add the following to httpd.conf (must be in the generic server
 settings, NOT in a virtual host):
 ScriptAlias /cgi-php5/ /usr/local/php/php5.0.0/bin/
 Directory /usr/local/php/php5.0.0/bin/
 Options +ExecCGI
 Allow From All
 /Directory
 
 
 Foreach virtual host you want to use php5 on:
 Create a directory named 'cgi-php5' one level above the document root.
 This will most likely be in the same directory that has the cgi-bin
 directory in it.
 
 
 Foreach directory that you want to us php5 for:
 Add the following to .htaccess file (or virtual host inside a
 Directory container):
 Action php5-script /cgi-php5/php
 AddHandler php5-script .php
 Options +ExecCGI
 
 This is an excellent solution because:
  - You only have to restart apache once.  After that, you can add
 .htaccess files to enable php5 interpretation whereever you want.
  - You can upgrade/downgrade php5 without touching apache.
  - You don't have clunky file extensions like .php5 or anything else
 that will be difficult to change later on down the road.
 
 PROBLEMS: So far, I cannot figure out why $_POST is empty when an html
 form is sent with method=post.  GET works fine.  In all my searching,
 I think it has something to do with how apache is setup; not with how
 php is configured.  I've tried the default php-dist ini file, I've tried
 many different variations of php configure commands.  None of them do
 the trick.  PHP bug list has some posts from people with the same problem
 and then they said they found a problem in apache setup that fixed it.
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php

PROBLEM RESOLUTION:  
I finally found the problem: It was the mod_bandwidth module in
Apache.  I was tipped off to this from bug report:
http://bugs.php.net/bug.php?id=16595
I disabled the module (commented the LoadModule and AddModule lines in
httpd.conf) and $_POST is populated as expected now.

The faq for mod_bandwidth at:
http://www.cohprog.com/v3/bandwidth/faq-en.html
indicates that if configured incorrectly, CGI may stop working.

--
Andy

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



[PHP] Re: Getting data from table as a tree

2004-08-08 Thread pt2002
Hi

Take a look at this array. It represents a simple tree. I need that because
the site i'm working on uses Smarty templates an there's a way to do output
the tree using  'Smarty functions'

$tpl-assign(tree,array(element=array(array(name= test1,
   element =
array(array(name  = test1.1),

array(name  = test1.2,

element = array(array(name  = test1.2.1),

array(name  = test1.2.2;


I took this example from smarty forum.
Greetings


Brian Kell [EMAIL PROTECTED] escreveu na mensagem
news:[EMAIL PROTECTED]
 On Thu, 5 Aug 2004 11:24:57 +0100, Pt2002 [EMAIL PROTECTED] wrote:

  Hi
 
  I have a table like this
  id, pid, name. When a item has no parent, pid = 0. There is no limit in
  depth.
  1, 0, Test 1
  2, 1, Test 1.1
  3, 1, Test 1.2
  4, 2, Test 1.1.1
  5, 1, Test 1.3
  6, 3, Test 1.2.1
 
  I need to read this table and return an array that represents the tree.
  Maybe using a recursive function but had no success.
 
  I just need someone to point in the right direction.
  TIA
 
  Greets
  pt2002

 Do you have an idea for representing a tree with arrays? I'm not sure how
 you want to do that. If you can provide an outline of what the finished
 array should look like, I can help you with some code ideas.

 Brian

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



Re: [PHP] Local version works - production breaks [SOLVED]

2004-08-08 Thread Andre Dubuc

On Sunday 08 August 2004 01:51 am, Jason Wong wrote:
 On Sunday 08 August 2004 09:38, Andre Dubuc wrote:
  That's what I thought. But the differences are glaring. Seems like none
  of the code wants to work. Navigation is a nightmare:
  header(location:...); usually brings an error message: function so and
  so -- include(xxx.php); has already been declared -- cannot redeclare
  (yet locally - absolutely no problem!) ??

 IIRC older versions of PHP allowed multiple declarations of a function.
 Somewhere along the line this was changed.

 --
 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
 --
 /*
 God isn't dead.  He just doesn't want to get involved.
 */

Hi Jason et al,

Thought I'd drop a note -- turning register_globals=off on the server in 
question magically made everything work.

Now I'll rasie the question that IP manager has asked: Having 
register_globals=of/on should not amke any difference to your site if you are 
using $_POST, $_SESSION etc. You must have a bug in your code.

Since exactly the same code works locally with register_globals=on or off, I 
suspect the proble is at his end, not in the code. Am I right in assuming 
this?

Regards, and thanks fro the help  sugegstions!
Andre

Hi Jason et al,

Thought I'd drop a note -- turning register_globals=off on the server in 
question magically made everything work.

Now I'll rasie the question that IP manager has asked: Having 
register_globals=of/on should not amke any difference to your site if you are 
using $_POST, $_SESSION etc. You must have a bug in your code.

Since exactly the same code works locally with register_globals=on or off, I 
suspect the proble is at his end, not in the code. Am I right in assuming 
this?

Regards, and thanks fro the help  sugegstions!
Andre


God isn't dead.  We just don't want to get involved.

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



Re: [PHP] PHP and Apache 2

2004-08-08 Thread Thomas Goyne
On Sun, 8 Aug 2004 16:20:55 +0300, Rosen [EMAIL PROTECTED] wrote:
Hi,
What is the reason, thath in the installation manual of PHP writes:
WARNING:
Do not use Apache 2.0 and PHP in a production environment neither on Unix
nor on Windows. 
Thanks,
Rosen
http://www.zend.com/lists/php-dev/200406/msg00291.html
--
Using M2, Opera's revolutionary e-mail client: http://www.opera.com/m2/
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Local version works - production breaks [SOLVED]

2004-08-08 Thread John Holmes
Andre Dubuc wrote:
Thought I'd drop a note -- turning register_globals=off on the server in 
question magically made everything work.

Now I'll rasie the question that IP manager has asked: Having 
register_globals=of/on should not amke any difference to your site if you are 
using $_POST, $_SESSION etc. You must have a bug in your code.
There's one exception to that theory as I've experienced: Sessions. 
Generally, anything written to work with register_globals OFF will work 
with them on. You may be introducing security holes, but it'll work.

However, sessions always seem to introduce problems when you go between 
the settings, or at least how I use them, it does. I always use 
unset($_SESSION['whatever']) to get rid of a session variable. If 
register_globals is on, then $whatever still exists and is still saved 
in the session at the end of the page. It may not work this way with 
every version of PHP, but I've experienced issues like that in the past.

There are other issues with sessions and switching register_globals 
settings, too, so if you're program relies upon them heavily, that may 
be the problem.

--
John Holmes
php|architect - The magazine for PHP professionals - http://www.phparch.com
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Local version works - production breaks [SOLVED]

2004-08-08 Thread Josh Acecool M
Glad to hear turning reg globals off made it work :-)
I had suspected that because people often use the same variables for
different things and with globals on, well it can overwrite other vars.

Josh Acecool M [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 That might be something, with reg globals ON, on your server, and say you
 try to get $_GET['id'] and $SESSION['id'] will be the same, they might be
 overwriting themselves.

 Try setting register globals to OFF on your server, its also more secure.


 Try setting register globals to OFF on your server, its also
 more secure.


Andre Dubuc [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]

 On Sunday 08 August 2004 01:51 am, Jason Wong wrote:
  On Sunday 08 August 2004 09:38, Andre Dubuc wrote:
   That's what I thought. But the differences are glaring. Seems like
none
   of the code wants to work. Navigation is a nightmare:
   header(location:...); usually brings an error message: function so
and
   so -- include(xxx.php); has already been declared -- cannot
redeclare
   (yet locally - absolutely no problem!) ??
 
  IIRC older versions of PHP allowed multiple declarations of a function.
  Somewhere along the line this was changed.
 
  --
  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
  --
  /*
  God isn't dead.  He just doesn't want to get involved.
  */

 Hi Jason et al,

 Thought I'd drop a note -- turning register_globals=off on the server in
 question magically made everything work.

 Now I'll rasie the question that IP manager has asked: Having
 register_globals=of/on should not amke any difference to your site if you
are
 using $_POST, $_SESSION etc. You must have a bug in your code.

 Since exactly the same code works locally with register_globals=on or off,
I
 suspect the proble is at his end, not in the code. Am I right in assuming
 this?

 Regards, and thanks fro the help  sugegstions!
 Andre

 Hi Jason et al,

 Thought I'd drop a note -- turning register_globals=off on the server in
 question magically made everything work.

 Now I'll rasie the question that IP manager has asked: Having
 register_globals=of/on should not amke any difference to your site if you
are
 using $_POST, $_SESSION etc. You must have a bug in your code.

 Since exactly the same code works locally with register_globals=on or off,
I
 suspect the proble is at his end, not in the code. Am I right in assuming
 this?

 Regards, and thanks fro the help  sugegstions!
 Andre


 God isn't dead.  We just don't want to get involved.

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



[PHP] PHP 5 - $_REQUEST undefined???

2004-08-08 Thread Marcus Bointon
I'm getting errors like this:

Notice: Undefined variable: _REQUEST in /var/www/html/index.php on line 57

This is truly weird - why on earth would this superglobal be undefined? (and
there is no unset($_REQUEST) lurking!) As far as I'm aware, there isn't even
an ini option to turn it off.

I'm in the process of upgrading from PHP4 to 5, and this script works ok in
4 - the error is just in 5.

Any ideas?

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] PHP 5 - $_REQUEST undefined???

2004-08-08 Thread John Holmes
Marcus Bointon wrote:
I'm getting errors like this:
Notice: Undefined variable: _REQUEST in /var/www/html/index.php on line 57
This is truly weird - why on earth would this superglobal be undefined? (and
there is no unset($_REQUEST) lurking!) As far as I'm aware, there isn't even
an ini option to turn it off.
I'm in the process of upgrading from PHP4 to 5, and this script works ok in
4 - the error is just in 5.
See if it's a mod_bandwidth problem like in the POST superglobal is 
empty thread we've been seeing all week.

--
John Holmes
php|architect - The magazine for PHP professionals - http://www.phparch.com
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Searching database with different languages?

2004-08-08 Thread Karl Timmermann
Hi,
Does anyone how I could accomplish this:
Basically, I have a MySQL database of names - some names have Spanish
accents in them. I want to build a web interface in PHP to search this
database. However, I want the names with Spanish accents to be shown
in the search results, regardless if the search was spelled without
the accents.
For example:
The database has Niño in it. I want it to be returned if the user
searched by using nino or niño.
Any ideas? Maybe somehow using regular expressions in PHP or in MySQL
using Unicode somehow?
It has to be fast and on the fly. Thanks!

[PHP] How PHP handles multiple inclusions of the same file?

2004-08-08 Thread Gambler ZG
Lets say I have function named render, which looks like this:
?php
function render($template, $vars){
extract($vars);
include(templates/.$template.'.php');
}
?
I also have template some_tmplt.php, which I need to render 100 times. 
Will PHP read, parse and compile this file 100 times, or will it 
remember file's content?

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


[PHP] Header list

2004-08-08 Thread Daniel Guerrier
I need to know what header to send when using readile
with real media and windows media.  Is there a list
that has all header when sending rich media and
images.

Thanks




__
Do you Yahoo!?
New and Improved Yahoo! Mail - 100MB free storage!
http://promotions.yahoo.com/new_mail 

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



Re: [PHP] Header list

2004-08-08 Thread John Holmes
Daniel Guerrier wrote:
I need to know what header to send when using readile
with real media and windows media.  Is there a list
that has all header when sending rich media and
images.
Install Firefox/Mozilla and then go here 
(http://livehttpheaders.mozdev.org/) to get LiveHTTPHeaders.

Then request your files and take note of what the content type headers 
are. Replicate them.

--
John Holmes
php|architect - The magazine for PHP professionals - http://www.phparch.com
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] urlencode - urldecode

2004-08-08 Thread PHP Gen
Hi,
I am using a header(location:) to send a
rawurlencod'ed string to another script...then I tried
decode it and use those values...but its not
working...

snippets of my code: 

// sending file:
$one=rawurlencode(dir_name=$dir_nameimgs_dir=$imgs_dirthumb_pre=$thumb_pretn_width=$tn_widthtn_height=$tn_heightwrite_text=$write_textcolors=$colorsx_pos=$x_posy_pos=$y_poslink1=$link1link2=$link2link3=$link3img_src1=$img_src1img_src2=$img_src2);
header(location: process.php?a=.$one);

Am totally confused as to how to use urldecode to get
back my values to do other operations in my script..

I tried the example from php.net: (example 1)
http://se2.php.net/manual/en/function.urldecode.php

but am unable to adapt it to give me my
variables/values.


The reason I am using rawurlencode is because $link1
and $link2 will contain html tags...

Thanks for your time.
-Mag

=
--
- The faulty interface lies between the chair and the keyboard.
- Creativity is great, but plagiarism is faster!
- Smile, everyone loves a moron. :-)



__
Do you Yahoo!?
Yahoo! Mail - 50x more storage than other providers!
http://promotions.yahoo.com/new_mail

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



Re: [PHP] WYSIWyG

2004-08-08 Thread raditha dissanayake
Matthew Sims wrote:
And how does this relate to PHP??
 

Matthew,
you are now sure to be flamed by all those who believe off topic 
maililngs by those who do not read the newby guide should be allowed and 
encouraged.


--
Raditha Dissanayake.

http://www.radinks.com/sftp/ | http://www.raditha.com/megaupload
Lean and mean Secure FTP applet with | Mega Upload - PHP file uploader
Graphical User Inteface. Just 128 KB | with progress bar.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] How PHP handles multiple inclusions of the same file?

2004-08-08 Thread raditha dissanayake
Gambler ZG wrote:
Lets say I have function named render, which looks like this:
?php
function render($template, $vars){
extract($vars);
include(templates/.$template.'.php');
}
?
I also have template some_tmplt.php, which I need to render 100 
times. Will PHP read, parse and compile this file 100 times, or will 
it remember file's content?

not sure if i understnad your question. If you want to cache the 
compiled php script look at Turck MMCache. If you want to avoid the same 
file being included twice in your script look at include_once() or 
require_once()


--
Raditha Dissanayake.

http://www.radinks.com/sftp/ | http://www.raditha.com/megaupload
Lean and mean Secure FTP applet with | Mega Upload - PHP file uploader
Graphical User Inteface. Just 128 KB | with progress bar.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] urlencode - urldecode

2004-08-08 Thread John Holmes
PHP Gen wrote:
// sending file:
$one=rawurlencode(dir_name=$dir_nameimgs_dir=$imgs_dirthumb_pre=$thumb_pretn_width=$tn_widthtn_height=$tn_heightwrite_text=$write_textcolors=$colorsx_pos=$x_posy_pos=$y_poslink1=$link1link2=$link2link3=$link3img_src1=$img_src1img_src2=$img_src2);
header(location: process.php?a=.$one);
Am totally confused as to how to use urldecode to get
back my values to do other operations in my script..
You don't have to decode it on the other end. Everything as you've got 
above (that whole string) will be in $_GET['a'] on process.php.

Since you asked, though, you use urldecode() like this:
$decoded = urldecode($_GET['a']);
That's a lot of information to be sending through the URL, btw. I think 
there's a max of 1024 characters, generally, although each browser is 
different. Just something to note. Maybe sessions would be better?

--
John Holmes
php|architect - The magazine for PHP professionals - http://www.phparch.com
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] urlencode - urldecode

2004-08-08 Thread PHP Gen Newbie
Hi,

Thanks again John, point taken...will not trust the
browser, will use sessions :-)

Cheers,
-Mag



--- John Holmes [EMAIL PROTECTED] wrote:

 PHP Gen wrote:
 
  // sending file:
 

$one=rawurlencode(dir_name=$dir_nameimgs_dir=$imgs_dirthumb_pre=$thumb_pretn_width=$tn_widthtn_height=$tn_heightwrite_text=$write_textcolors=$colorsx_pos=$x_posy_pos=$y_poslink1=$link1link2=$link2link3=$link3img_src1=$img_src1img_src2=$img_src2);
  header(location: process.php?a=.$one);
  
  Am totally confused as to how to use urldecode to
 get
  back my values to do other operations in my
 script..
 
 You don't have to decode it on the other end.
 Everything as you've got 
 above (that whole string) will be in $_GET['a'] on
 process.php.
 
 Since you asked, though, you use urldecode() like
 this:
 
 $decoded = urldecode($_GET['a']);
 
 That's a lot of information to be sending through
 the URL, btw. I think 
 there's a max of 1024 characters, generally,
 although each browser is 
 different. Just something to note. Maybe sessions
 would be better?
 
 -- 
 
 John Holmes
 
 php|architect - The magazine for PHP professionals -
 http://www.phparch.com
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 
 


=
--
- The faulty interface lies between the chair and the keyboard.
- Creativity is great, but plagiarism is faster!
- Smile, everyone loves a moron. :-)



__
Do you Yahoo!?
New and Improved Yahoo! Mail - Send 10MB messages!
http://promotions.yahoo.com/new_mail 

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



Re: [PHP] How PHP handles multiple inclusions of the same file?

2004-08-08 Thread Gambler ZG
 If you want to cache the
 compiled php script look at Turck MMCache.
Thanks for the info, but I'll probably just use create_function() for 
caching.

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


[PHP] Re: Getting data from table as a tree

2004-08-08 Thread Brian Kell
Well, first off, a little bit of formatting (line numbers added for  
clarity):

 1 $tpl-assign(tree,
 2 array(
 3 element = array(
 4 array(
 5 name = test1,
 6 element = array(
 7 array(
 8 name = test1.1
 9 ),
10 array(
11 name = test1.2,
12 element = array(
13 array(
14 name = test1.2.1
15 ),
16 array(
17 name  = test1.2.2
18 )
19 )
20 )
21 )
22 )
23 )
24 )
25 );
It appears that each node is represented as an array. This array contains  
a name and, if the node has any children, another array called element  
that contains the child nodes. In addition, the root node is an element of  
some superroot, which is the array starting on line 2. (So if you want  
to have multiple trees, you can; just define multiple nodes with a pid of  
0.)

I think the following functions should do approximately what you want. I'm  
assuming MySQL here, since that's what I'm used to. If you're not using  
MySQL, you should be able to adapt this to your database easily enough.

function build_tree() {
$subtree = build_subtree(0);
if ($subtree !== NULL)
return array(element = $subtree);
else
return NULL;
}
function build_subtree($pid) {
$result = mysql_query(SELECT id, name FROM tbl WHERE pid='$pid');
if (!$result)
die(Can't query for pid $pid: .mysql_error());
if (mysql_num_rows($result)) {
$subtree = array();
while ($row = mysql_fetch_assoc($result)) {
$node = array();
$node['name'] = $row['name'];
$element = build_subtree($row['id']);
if ($element !== NULL)
$node['element'] = $element;
array_push($subtree, $node);
}
return $subtree;
} else
return NULL;
}
Be careful with this, because I didn't actually test this at all. Run it  
on a few test cases and make sure it gives you what you want.

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


[PHP] any javascript gurus?

2004-08-08 Thread Aris Santillan
i need help on this


html
head
script language=JavaScript
/script
titleCompute quantity/title
meta http-equiv=Content-Type content=text/html; charset=iso-8859-1
/head

body
form name=test
  table width=53% border=0
tr 
  td height=21 colspan=2nbsp;/td
  td width=28%div align=centerstrongfont size=1 face=Verdana, Arial, 
Helvetica, sans-serifQty 
  1/font/strong/div/td
  td width=28%div align=centerstrongfont size=1 face=Verdana, Arial, 
Helvetica, sans-serifQty 
  2/font/strong/div/td
  td width=28%div align=centerstrongfont size=1 face=Verdana, Arial, 
Helvetica, sans-serifFinal 
  Qty for (Qty1 amp; Qty2)/font/strong/div/td
/tr
tr 
  td width=10% height=30font size=1 face=Geneva, Arial, Helvetica, 
sans-serifITEM 
ONE/font/td
  td width=6% input type=checkbox name=checkbox[] value=check 
  /td
  td width=28% input type=text name=entry1[] /td
  td width=28%input  type=text name=entry2[] /td
  td width=28%input  type=text name=entry3[] /td
/tr
tr 
  td height=24font size=1 face=Geneva, Arial, Helvetica, sans-serifITEM 
TWO/font/td
  tdinput type=checkbox name=checkbox[] value=check/td
  tdinput type=text name=entry1[]/td
  tdinput type=text name=entry2[]/td
  tdinput  type=text name=entry3[] /td
/tr
tr 
  td  colspan=5 div align=center 
  input type=button name=Submit value=Calculate
/div/td
/tr
  /table
/form
/body
/html




Re: [PHP] any javascript gurus?

2004-08-08 Thread Jason Davidson
what is it that you need... for it to calculate the fields... 
just get the value of the fields with.. 
document.FORMNAME.FIELDNAME.value
make sure your dealing with integers for doing the math, the value will
be a string initially.. use parseInt or parseDouble or something .. 

Jason

Aris  Santillan [EMAIL PROTECTED] wrote: 
 
 i need help on this
 
 
 html
 head
 script language=JavaScript
 /script
 titleCompute quantity/title
 meta http-equiv=Content-Type content=text/html; charset=iso-8859-1
 /head
 
 body
 form name=test
   table width=53% border=0
 tr 
   td height=21 colspan=2 /td
   td width=28%div align=centerstrongfont size=1 face=Verdana,
 Arial, Helvetica, sans-serifQty 
   1/font/strong/div/td
   td width=28%div align=centerstrongfont size=1 face=Verdana,
 Arial, Helvetica, sans-serifQty 
   2/font/strong/div/td
   td width=28%div align=centerstrongfont size=1 face=Verdana,
 Arial, Helvetica, sans-serifFinal 
   Qty for (Qty1  Qty2)/font/strong/div/td
 /tr
 tr 
   td width=10% height=30font size=1 face=Geneva, Arial, Helvetica,
 sans-serifITEM 
 ONE/font/td
   td width=6% input type=checkbox name=checkbox[] value=check 
   /td
   td width=28% input type=text name=entry1[] /td
   td width=28%input  type=text name=entry2[] /td
   td width=28%input  type=text name=entry3[] /td
 /tr
 tr 
   td height=24font size=1 face=Geneva, Arial, Helvetica,
 sans-serifITEM 
 TWO/font/td
   tdinput type=checkbox name=checkbox[] value=check/td
   tdinput type=text name=entry1[]/td
   tdinput type=text name=entry2[]/td
   tdinput  type=text name=entry3[] /td
 /tr
 tr 
   td  colspan=5 div align=center 
   input type=button name=Submit value=Calculate
 /div/td
 /tr
   /table
 /form
 /body
 /html
 
 
 

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



Re: [PHP] any javascript gurus?

2004-08-08 Thread John Holmes
Aris Santillan wrote:
i need help on this
Okay...
script language=JavaScript
/script
You have an empty script tag here...
font size=1 face=Verdana, Arial, Helvetica, sans-serif
and the font tag is depreciated. You should use CSS.
Oh... WTF is your problem that you need help on and what's this got to 
do with PHP???

--
John Holmes
php|architect - The magazine for PHP professionals - http://www.phparch.com
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] How PHP handles multiple inclusions of the same file?

2004-08-08 Thread raditha dissanayake
Gambler ZG wrote:
 If you want to cache the
 compiled php script look at Turck MMCache.
Thanks for the info, but I'll probably just use create_function() for 
caching.
what do you mean by that?

--
Raditha Dissanayake.

http://www.radinks.com/sftp/ | http://www.raditha.com/megaupload
Lean and mean Secure FTP applet with | Mega Upload - PHP file uploader
Graphical User Inteface. Just 128 KB | with progress bar.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] any javascript gurus?

2004-08-08 Thread raditha dissanayake
Aris Santillan wrote:
i need help on this
 

ask in a javascript group. read the list newby guide before posting.
--
Raditha Dissanayake.

http://www.radinks.com/sftp/ | http://www.raditha.com/megaupload
Lean and mean Secure FTP applet with | Mega Upload - PHP file uploader
Graphical User Inteface. Just 128 KB | with progress bar.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] ImageColorTransparent Problem

2004-08-08 Thread Kevin
Hi,

I am having PHP Version 4.3.4 with GD 2.0.15 compatible and PNG support
enabled.

My problem with the following code is that the image produced be this code
is not transparent. It has a black background. I have viewed it in IE 6 and
its not transparent.

Can someone help me how to make this image transparent?

?php

// imagecolorallocate ( resource image, int red, int green, int blue)
// imagettftext ( resource image, float size, float angle, int x, int y, int
color, string fontfile, string text)
// imagepng ( resource image [, string filename])
// imagecreatetruecolor ( int x_size, int y_size)
// imagecolortransparent ( resource image [, int color])

header(Content-type: image/png);
$im = imagecreatetruecolor(400,600); // i have used imagecreatetruecolor in
place of imagecreate()
$bg = imagecolorallocate($im, 0, 0, 0);
imagecolortransparent($im, $bg); // this function makes the color
transparent specified in $bg.

$j=0;
$k = 0;
$r = 1;
$g = 100;
$b = 20;

for($i=1;$i=50;$i++)
{
 if($r  255)
  $r = 1;
 if($g  255)
  $g = 100;
 if($b  255)
  $b = 20;

 $textcolor = imagecolorallocate($im, $r, $g, $b);
 $r = $r * 3;
 $g = $g + 10;
 $b = $b + 20;

 imagettftext($im, 10, 0, 0, $j, $textcolor, fonts/2.ttf, Row number
: $i | Color =  . $textcolor);
 $j=$j+12;
}
imagepng($im,kk.png);
?

Thanks a lot for reading this far.
-- 
Kevin

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



Re: [PHP] ImageColorTransparent Problem

2004-08-08 Thread Jason Davidson
Does IE even support PNG transparncy properly anyways??? maybe thats the
issue here?

Jason
Kevin [EMAIL PROTECTED] wrote: 
 
 Hi,
 
 I am having PHP Version 4.3.4 with GD 2.0.15 compatible and PNG support
 enabled.
 
 My problem with the following code is that the image produced be this code
 is not transparent. It has a black background. I have viewed it in IE 6 and
 its not transparent.
 
 Can someone help me how to make this image transparent?
 
 ?php
 
 // imagecolorallocate ( resource image, int red, int green, int blue)
 // imagettftext ( resource image, float size, float angle, int x, int y, int
 color, string fontfile, string text)
 // imagepng ( resource image [, string filename])
 // imagecreatetruecolor ( int x_size, int y_size)
 // imagecolortransparent ( resource image [, int color])
 
 header(Content-type: image/png);
 $im = imagecreatetruecolor(400,600); // i have used imagecreatetruecolor in
 place of imagecreate()
 $bg = imagecolorallocate($im, 0, 0, 0);
 imagecolortransparent($im, $bg); // this function makes the color
 transparent specified in $bg.
 
 $j=0;
 $k = 0;
 $r = 1;
 $g = 100;
 $b = 20;
 
 for($i=1;$i=50;$i++)
 {
  if($r  255)
   $r = 1;
  if($g  255)
   $g = 100;
  if($b  255)
   $b = 20;
 
  $textcolor = imagecolorallocate($im, $r, $g, $b);
  $r = $r * 3;
  $g = $g + 10;
  $b = $b + 20;
 
  imagettftext($im, 10, 0, 0, $j, $textcolor, fonts/2.ttf, Row number
 : $i | Color =  . $textcolor);
  $j=$j+12;
 }
 imagepng($im,kk.png);
 ?
 
 Thanks a lot for reading this far.
 -- 
 Kevin
 
 -- 
 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] ImageColorTransparent Problem

2004-08-08 Thread Matthew Runo
Have you tried it in other browsers? IE 6 / windows PNG support leaves 
much to be desired, even more so when we want them to be transparent.

Try it in Firefox, or some other similar browser. Same results?
Matthew Runo
http://www.quabbo.com
Quabbo Internet Services
The only host with the Zend Performance Suite!
On Aug 8, 2004, at 9:32 PM, Kevin wrote:
Hi,
I am having PHP Version 4.3.4 with GD 2.0.15 compatible and PNG support
enabled.
My problem with the following code is that the image produced be this 
code
is not transparent. It has a black background. I have viewed it in IE 
6 and
its not transparent.

Can someone help me how to make this image transparent?
?php
// imagecolorallocate ( resource image, int red, int green, int blue)
// imagettftext ( resource image, float size, float angle, int x, int 
y, int
color, string fontfile, string text)
// imagepng ( resource image [, string filename])
// imagecreatetruecolor ( int x_size, int y_size)
// imagecolortransparent ( resource image [, int color])

header(Content-type: image/png);
$im = imagecreatetruecolor(400,600); // i have used 
imagecreatetruecolor in
place of imagecreate()
$bg = imagecolorallocate($im, 0, 0, 0);
imagecolortransparent($im, $bg); // this function makes the color
transparent specified in $bg.

$j=0;
$k = 0;
$r = 1;
$g = 100;
$b = 20;
for($i=1;$i=50;$i++)
{
 if($r  255)
  $r = 1;
 if($g  255)
  $g = 100;
 if($b  255)
  $b = 20;
 $textcolor = imagecolorallocate($im, $r, $g, $b);
 $r = $r * 3;
 $g = $g + 10;
 $b = $b + 20;
 imagettftext($im, 10, 0, 0, $j, $textcolor, fonts/2.ttf, Row 
number
: $i | Color =  . $textcolor);
 $j=$j+12;
}
imagepng($im,kk.png);
?

Thanks a lot for reading this far.
--
Kevin
--
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] ImageColorTransparent Problem

2004-08-08 Thread Kevin

Jason Davidson [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 Does IE even support PNG transparncy properly anyways??? maybe thats the
 issue here?

Yes, I have tried making the image with imagecreate() function and it was
transparent. Using imagecreate() function I was only able to make 256 colors
but the image was transparent. I want real colors so I used
imagecreatetruecolor() and now the same is not transparent.

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



Re: [PHP] [Newbie Guide] For the benefit of new members

2004-08-08 Thread raditha dissanayake
Me thinks a note about 'if you don't follow these guidelines your 
questions will not be answered' is a good idea.

keep up the good work siva kumar.

--
Raditha Dissanayake.

http://www.radinks.com/sftp/ | http://www.raditha.com/megaupload
Lean and mean Secure FTP applet with | Mega Upload - PHP file uploader
Graphical User Inteface. Just 128 KB | with progress bar.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php