[PHP] mail() returns false but e-mail is sent ?

2006-06-25 Thread Leonidas Safran
Hello,

I'm wondering about the behavior of the mail() function.

$sent = mail($destination, $subject, $content, $headers);

I use some optional header parameters:
"From:[EMAIL PROTECTED]: 1.0\r\nContent-Type: text/plain; 
charset=ISO-8859-1\r\nContent-Transfer-Encoding: quoted-printable\r\n".

Can that be source of error? I can see no error in the apache error_log.

I have special caracters in the subject line, which are converted first on php 
side to comply with standard. Here also, no error on apache error_log.

The result of mail() is false but the e-mail is sent! Returning true, but 
e-mail doesn't reach destination can make sense; in this case, it's strange, 
isn't it?

I'm using PHP v. 5.04 on a Linux Fedora Core 4 distri with Postfix 2.2.2.

I'd be glad if somebody could explain me what to do in order to get correct 
response when e-mail is passed to MTA...


Thanks,
LS
-- 


Der GMX SmartSurfer hilft bis zu 70% Ihrer Onlinekosten zu sparen!
Ideal für Modem und ISDN: http://www.gmx.net/de/go/smartsurfer

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



[PHP] New install platform

2006-06-25 Thread Grae Wolfe - PHP
  It has become evident that I need some form of local testing environment 
so that I can figure out what is wrong with one of my $sql statements.
  Can anyone tell me what the easiest platform is to set up a PHP/MySQL 
system?  I have a PC and a Mac on OS X, and with the use of VirtualPC I have 
the ability to load most flavors of Linux as well.
  I hate to have to go through this to test a single error, but if anyone 
can help with this, I would truly appreciate it. 

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



Re: [PHP] New install platform

2006-06-25 Thread Larry Garfield
IME, any modern Linux distro will let you setup a viable Apache/PHP/MySQL 
configuration with a few clicks/commands in its package manager of choice.  I 
am partial to Debian and Ubuntu, as that's where most of my experience is.  
And it's very easy to setup a barebones system that you just put LAMP on, 
which is good if you're hosting it as a virtual machine image.

I would actually recommend against Red Hat, as their version numbers are all 
kinds of screwed up.  (They will take an old version, patch it with all the 
changes to be the modern version, but leave the version number as the old 
one.  So what they call PHP 4.3.9 is really PHP 4.3.11 or maybe 
4.4.something, I don't know, I don't know if THEY know.)

On Sunday 25 June 2006 09:08, Grae Wolfe - PHP wrote:
>   It has become evident that I need some form of local testing environment
> so that I can figure out what is wrong with one of my $sql statements.
>   Can anyone tell me what the easiest platform is to set up a PHP/MySQL
> system?  I have a PC and a Mac on OS X, and with the use of VirtualPC I
> have the ability to load most flavors of Linux as well.
>   I hate to have to go through this to test a single error, but if anyone
> can help with this, I would truly appreciate it.

-- 
Larry Garfield  AIM: LOLG42
[EMAIL PROTECTED]   ICQ: 6817012

"If nature has made any one thing less susceptible than all others of 
exclusive property, it is the action of the thinking power called an idea, 
which an individual may exclusively possess as long as he keeps it to 
himself; but the moment it is divulged, it forces itself into the possession 
of every one, and the receiver cannot dispossess himself of it."  -- Thomas 
Jefferson

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



Re: [PHP] New install platform

2006-06-25 Thread Joe Wollard

For a simple OS X install you can either modify the existing
Apache/PHP install and add MySQL or use entropy's package from
http://www.entropy.ch/software/macosx/php/



On 6/25/06, Grae Wolfe - PHP <[EMAIL PROTECTED]> wrote:

  It has become evident that I need some form of local testing environment
so that I can figure out what is wrong with one of my $sql statements.
  Can anyone tell me what the easiest platform is to set up a PHP/MySQL
system?  I have a PC and a Mac on OS X, and with the use of VirtualPC I have
the ability to load most flavors of Linux as well.
  I hate to have to go through this to test a single error, but if anyone
can help with this, I would truly appreciate it.

--
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] New install platform

2006-06-25 Thread tedd
At 8:08 AM -0600 6/25/06, Grae Wolfe - PHP wrote:
>  It has become evident that I need some form of local testing environment
>so that I can figure out what is wrong with one of my $sql statements.
>  Can anyone tell me what the easiest platform is to set up a PHP/MySQL
>system?  I have a PC and a Mac on OS X, and with the use of VirtualPC I have
>the ability to load most flavors of Linux as well.
>  I hate to have to go through this to test a single error, but if anyone
>can help with this, I would truly appreciate it.

Grae :

Seems like a lot of trouble -- if the list will permit, what's the offending 
sql statement?

You might also try the mysql list, namely:

 http://lists.nyphp.org/mailman/listinfo/mysql

hth's

tedd

-- 

http://sperling.com  http://ancientstones.com  http://earthstones.com

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



Re: [PHP] New install platform

2006-06-25 Thread Johan Martin


On 25 Jun 2006, at 4:08 PM, Grae Wolfe - PHP wrote:

  It has become evident that I need some form of local testing  
environment

so that I can figure out what is wrong with one of my $sql statements.
  Can anyone tell me what the easiest platform is to set up a PHP/ 
MySQL
system?  I have a PC and a Mac on OS X, and with the use of  
VirtualPC I have

the ability to load most flavors of Linux as well.
  I hate to have to go through this to test a single error, but if  
anyone

can help with this, I would truly appreciate it.


http://www.apachefriends.org/en/xampp.html
They have complete php/apache/mysql packages for Windows, Mac OS X  
and Linux.



Johan Martin
Catenare LLC
534 Pacific Ave
San Francisco, CA. 94133

Mailing Address:
268 Bush Street #2826
San Francisco, Ca. 94104

Phone: (415) 834-9802
Fax: (415) 294-4495
http://www.catenare.com

AOL: catenarellc
Yahoo: martin_johan
GTalk: [EMAIL PROTECTED]

FreeWorldDialup  :716798  - http://www.freeworlddialup.com/
Gizmo Project: 747-627-9132 - http://www.gizmoproject.com/

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



[PHP] Problem Displaying Images

2006-06-25 Thread Prathaban Mookiah
I am trying to manage images with a web database application. It works fine 
with MySQL 5.0.17 and PHP 5.1.1.

But when I port it to another machine that runs MySQL 3.23.54 and PHP 4.2.2, I 
have problems viewing the images retrieved from the database in the browser. 

The relevant part of the code is:

$Result = mysql_fetch_array($Resource);

if (!empty($Result["data"]))
{
header("Content-Type: {$Result['mime']}");
echo $Result["data"];
}

But I see that some binary data is being echoed on to the client. But I guess 
it is corrupted in some way such that the browser cannot display it as an 
image. In fact I tried to save it as an image file, and the image viewer 
reported it as invalid format.

Hope someone can shed light on this.

Thanks in advance.

Cheers,

Prathap

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



Re: [PHP] mail() returns false but e-mail is sent ?

2006-06-25 Thread Chris

Leonidas Safran wrote:

Hello,

I'm wondering about the behavior of the mail() function.

$sent = mail($destination, $subject, $content, $headers);

I use some optional header parameters:
"From:[EMAIL PROTECTED]: 1.0\r\nContent-Type: text/plain; 
charset=ISO-8859-1\r\nContent-Transfer-Encoding: quoted-printable\r\n".

Can that be source of error? I can see no error in the apache error_log.

I have special caracters in the subject line, which are converted first on php 
side to comply with standard. Here also, no error on apache error_log.

The result of mail() is false but the e-mail is sent! Returning true, but 
e-mail doesn't reach destination can make sense; in this case, it's strange, 
isn't it?


Show us the full context of the code. The example you give us will work 
fine but that doesn't tell us what's really going on in your code.


--
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] Problem Displaying Images

2006-06-25 Thread Chris

Prathaban Mookiah wrote:
I am trying to manage images with a web database application. It works fine 
with MySQL 5.0.17 and PHP 5.1.1.


But when I port it to another machine that runs MySQL 3.23.54 and PHP 4.2.2, I 
have problems viewing the images retrieved from the database in the browser. 


The relevant part of the code is:

$Result = mysql_fetch_array($Resource);

if (!empty($Result["data"]))
{
header("Content-Type: {$Result['mime']}");
echo $Result["data"];
}

But I see that some binary data is being echoed on to the client. But I guess 
it is corrupted in some way such that the browser cannot display it as an 
image. In fact I tried to save it as an image file, and the image viewer 
reported it as invalid format.


How are you putting it into the database? Are you using 
mysql_real_escape_string or mysql_escape_string, or are you using 
addslashes or something else?


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

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



[PHP] Protoeditor 1.0 (PHP editor)

2006-06-25 Thread Thiago Silva
Hello,
I've just released version 1.0 of Protoeditor.

Protoeditor is a small KDE text editor (so, for GNU/Linux desktops) developed 
for debugging scripts interactively. Currently you can use it to edit and 
debug PHP scripts interactively, with step into/over/out, breakpoints, 
inspecting variables, function call stack, etc.
It supports the debuggers DBG, Xdebug and Gubed.

More information can be found at: 
http://protoeditor.sourceforge.net

or sending an email to me: thiago.silva AT kdemail.net

Thanks,
Thiago Silva

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



Re: [PHP] Problem Displaying Images

2006-06-25 Thread Prathaban Mookiah
Oh sorry. I use addslashes().


-- Original Message ---
From: Chris <[EMAIL PROTECTED]>
To: Prathaban Mookiah <[EMAIL PROTECTED]>
Cc: "php-general@lists.php.net" 
Sent: Mon, 26 Jun 2006 07:14:42 +1000
Subject: Re: [PHP] Problem Displaying Images

> Prathaban Mookiah wrote:
> > I am trying to manage images with a web database application. It works 
fine 
> > with MySQL 5.0.17 and PHP 5.1.1.
> > 
> > But when I port it to another machine that runs MySQL 3.23.54 and PHP 4.2.
2, I 
> > have problems viewing the images retrieved from the database in the 
browser. 
> > 
> > The relevant part of the code is:
> > 
> > $Result = mysql_fetch_array($Resource);
> > 
> > if (!empty($Result["data"]))
> > {
> > header("Content-Type: {$Result['mime']}");
> > echo $Result["data"];
> > }
> > 
> > But I see that some binary data is being echoed on to the client. But I 
guess 
> > it is corrupted in some way such that the browser cannot display it as an 
> > image. In fact I tried to save it as an image file, and the image viewer 
> > reported it as invalid format.
> 
> How are you putting it into the database? Are you using 
> mysql_real_escape_string or mysql_escape_string, or are you using 
> addslashes or something else?
> 
> -- 
> Postgresql & php tutorials
> http://www.designmagick.com/
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
--- End of Original Message ---

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



Re: [PHP] Problem Displaying Images

2006-06-25 Thread Chris

Prathaban Mookiah wrote:

Oh sorry. I use addslashes().


Then you'll probably need to use stripslashes before printing out the data.

echo stripslashes($Result["data"]);

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

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



[PHP] CLI - php shell script worked under php4, breaks under php5

2006-06-25 Thread weston
A while back I wrote a little read-eval-print loop that essentially constituted 
a very basic php shell:

http://weston.canncentral.org/misc/phpsh.txt

This has almost always run fine for me with the cgi versions of php 4, and 
often proves to be a great help in quickly testing various snippets of code. 

However, I just recently tried to use this with PHP 5.1.2, and found that it 
doesn't work. Specifically, it seems to wait for input to be typed without 
issuing a prompt. Upon entering a line, there's no response, until one presses 
ctrl-d. At this point, it throws a parse error:

syntax error, unexpected ')' in phpsh5(23): eval()'d code on line 1

regardless of whether or not there are in fact any unmatched parenths (or any 
parenths at all) on the entered line. And it apparently doesn't execute any of 
the code at all until one enters "exit" as a command.

I've tried switching from /dev/stdin to php://stdin, tried adding -f or -a to 
the processing options nothing seems to make a difference. I also tried 
removing my "_readln()" function, and simple entering a default expression. 
This produces the expected (if repetetive and ultimately practically useless) 
results, so I assume it's something in my _readln() function that throws it 
off. 

Any ideas how to get this to work with PHP 5?

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



[PHP] xmldoc issue

2006-06-25 Thread weetat

Hi all ,

  I have two server .

  In first server , which PHP version 4.3.2, the code below is ok :

  function validatexmlfile($xmlfilename)
{
$_logger = new Log4jLogger();
$_logger->logdebug("starting validate xml");
$_logger->logdebug("starting validate xml 
xmlfilename:",$xmlfilename);


if (!$doc = xmldocfile($xmlfilename)) {
die("Error in XML");
$this->xml_error = TRUE;
}
// version check
else if ($doc->version > 1.0) {
die("Unsupported XML version");
$this->xml_error = TRUE;
} else {
$this->xml_error = FALSE;
}


  However in second server , it did not get past the xmldocfile() at all.
Anybody have any ideas what is happening ? I have set the 
error_reporting to E_ALL , but it did not display any error at all.


Thanks

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



Re: [PHP] xmldoc issue

2006-06-25 Thread Chris

weetat wrote:

Hi all ,

  I have two server .

  In first server , which PHP version 4.3.2, the code below is ok :

  function validatexmlfile($xmlfilename)
{
$_logger = new Log4jLogger();
$_logger->logdebug("starting validate xml");
$_logger->logdebug("starting validate xml 
xmlfilename:",$xmlfilename);


if (!$doc = xmldocfile($xmlfilename)) {
die("Error in XML");
$this->xml_error = TRUE;
}
// version check
else if ($doc->version > 1.0) {
die("Unsupported XML version");
$this->xml_error = TRUE;
} else {
$this->xml_error = FALSE;
}


  However in second server , it did not get past the xmldocfile() at all.
Anybody have any ideas what is happening ? I have set the 
error_reporting to E_ALL , but it did not display any error at all.


xmldocfile probably isn't a valid function because you don't have the 
xml extensions installed.


try:



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

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



[PHP] Array to String

2006-06-25 Thread weetat

Hi all,

I have the error below in my PHP version 4.3.2:

PHP Notice:  Array to string conversion in /data/html/library/config.php 
on line 45


If i have turned "on" the magic_quotes in php.ini, it is ok .
Any ideas?

It cause by the code below:

  if (!get_magic_quotes_gpc()) {
if (isset($_POST)) {
foreach ($_POST as $key => $value) {
$_POST[$key] = trim(addslashes($value));
}
}

if (isset($_GET)) {
foreach ($_GET as $key => $value) {
$_GET[$key] = trim(addslashes($value));
}
}
}

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



Re: [PHP] Array to String

2006-06-25 Thread Chris
You are probably passing some variables into POST or GET using the array 
notation:


/mypage.php?var[]=fred&var[]=wilma

$_GET['var'] will be an array inside mypage.php, You should probably 
check to see if it's an array then, if it is, loop through each element 
of the var array


Chris

weetat wrote:

Hi all,

I have the error below in my PHP version 4.3.2:

PHP Notice:  Array to string conversion in 
/data/html/library/config.php on line 45


If i have turned "on" the magic_quotes in php.ini, it is ok .
Any ideas?

It cause by the code below:

  if (!get_magic_quotes_gpc()) {
if (isset($_POST)) {
foreach ($_POST as $key => $value) {
$_POST[$key] = trim(addslashes($value));
}
}

if (isset($_GET)) {
foreach ($_GET as $key => $value) {
$_GET[$key] = trim(addslashes($value));
}
}
}



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



Re: [PHP] CLI - php shell script worked under php4, breaks under php5

2006-06-25 Thread David Tulloh
[EMAIL PROTECTED] wrote:
> A while back I wrote a little read-eval-print loop that essentially 
> constituted a very basic php shell:
> 
> http://weston.canncentral.org/misc/phpsh.txt
> 
> This has almost always run fine for me with the cgi versions of php 4, and 
> often proves to be a great help in quickly testing various snippets of code. 
> 
> However, I just recently tried to use this with PHP 5.1.2, and found that it 
> doesn't work. Specifically, it seems to wait for input to be typed without 
> issuing a prompt. Upon entering a line, there's no response, until one 
> presses ctrl-d. At this point, it throws a parse error:
> 
>   syntax error, unexpected ')' in phpsh5(23): eval()'d code on line 1
> 
> regardless of whether or not there are in fact any unmatched parenths (or any 
> parenths at all) on the entered line. And it apparently doesn't execute any 
> of the code at all until one enters "exit" as a command.
> 
> I've tried switching from /dev/stdin to php://stdin, tried adding -f or -a to 
> the processing options nothing seems to make a difference. I also tried 
> removing my "_readln()" function, and simple entering a default expression. 
> This produces the expected (if repetetive and ultimately practically useless) 
> results, so I assume it's something in my _readln() function that throws it 
> off. 
> 
> Any ideas how to get this to work with PHP 5?
> 

Works for me, PHP 5.1.4.  Prehaps you have some kind of output buffering
enabled.  Using the -n command line switch will disable your php.ini
which should stop anything like that.

The syntax error you are getting is caused by not entering any input.
Your line 23 becomes:
$returnval = eval("return();");
Return expects some value to be provided, hence the syntax error.


David

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



[PHP] Sad PHP Poem

2006-06-25 Thread Martin Alterisio



A sad poem of an algorithm where solitude brought excessive use of cpu
cycles and memory allocation for redundant data (it copied over and over
again the same image till all memory was filled with it)

--

$timeWaiting = 0;
while (!$you->near($me)) {
 $me->thinkAbout($you);

 switch (true) {
   case $timeWaiting < 5:
 $me->wait($you);
 break;

   case $timeWaiting < 10:
 $me->worry();
 break;

   case $timeWaiting < 20:
 $me->lookFor($you);
 break;

   case $timeWaiting < 40:
 $me->worry();
  $me->lookFor($you);
 break;

   case $timeWaiting < 80:
 $me->worry();
  $me->cry();
  $me->lookFor($you);
  $me->lookFor($you);
  $me->lookFor($you);
 break;

   case $timeWaiting < 160:
 $me->worry();
  $me->cry();
  $me->drink();
  $me->lookFor($you);
  $me->lookFor($you);
  $me->lookFor($you);
 $me->thinkAbout($you);
 $me->thinkAbout($you);
 $me->cry();
  $me->lookFor($you);
  $me->lookFor($you);
  $me->drink();
  $me->drink();
 break;

   default:
 throw new CantLiveWithoutYou();
 die("alone");
 }

 $timeWaiting++;
}

$me->happy = true;

--

I hope you enjoyed the poem and the fact that I didn't ask you to fix it or
find the bug in it =D

PD: Run in your web server at your own risk.




RE: [PHP] xmldoc issue

2006-06-25 Thread Yeo Wee Tat
Thanks you are right.

Btw, I have another question:

How to modified value in xml file using php ?

Thanks.

Yeo Wee Tat 
Tel: +65-62730049   Fax: +65-62734934
Cxrus Solutions Pte Ltd (Singapore . Thailand)
1003 Bukit Merah Central #05-20 Singapore 159836
System Integration . Business Solutions . Linux Simplified
-Original Message-
From: Chris [mailto:[EMAIL PROTECTED] 
Sent: Monday, June 26, 2006 10:52 AM
To: weetat
Cc: php-general@lists.php.net
Subject: Re: [PHP] xmldoc issue

weetat wrote:
> Hi all ,
> 
>   I have two server .
> 
>   In first server , which PHP version 4.3.2, the code below is ok :
> 
>   function validatexmlfile($xmlfilename)
> {
> $_logger = new Log4jLogger();
> $_logger->logdebug("starting validate xml");
> $_logger->logdebug("starting validate xml 
> xmlfilename:",$xmlfilename);
> 
> if (!$doc = xmldocfile($xmlfilename)) {
> die("Error in XML");
> $this->xml_error = TRUE;
> }
> // version check
> else if ($doc->version > 1.0) {
> die("Unsupported XML version");
> $this->xml_error = TRUE;
> } else {
> $this->xml_error = FALSE;
> }
> 
> 
>   However in second server , it did not get past the xmldocfile() at all.
> Anybody have any ideas what is happening ? I have set the 
> error_reporting to E_ALL , but it did not display any error at all.

xmldocfile probably isn't a valid function because you don't have the 
xml extensions installed.

try:



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




-- 
No virus found in this incoming message.
Checked by AVG Free Edition.
Version: 7.1.394 / Virus Database: 268.9.4/375 - Release Date: 6/25/2006

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



Re: [PHP] Sad PHP Poem

2006-06-25 Thread Robert Cummings
On Mon, 2006-06-26 at 00:25, Martin Alterisio wrote:
>
> I hope you enjoyed the poem and the fact that I didn't ask you to fix it or
> find the bug in it =D

That's great, thanks for the laugh.

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



Re: [PHP] xmldoc issue

2006-06-25 Thread Chris

Yeo Wee Tat wrote:

Thanks you are right.

Btw, I have another question:

How to modified value in xml file using php ?


http://www.php.net/manual/en/ref.xmlwriter.php


--
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] Problem Displaying Images

2006-06-25 Thread Prathaban Mookiah
I wish it would work. But id doesn't. But this time I do get a heavily 
distorted image being displayed.

But as I said earlier, in combination of MySQL 5 and PHP 5 works good. The 
problem is with PHP4 and MySQL 5.

Thanks.

Prathap

-- Original Message ---
From: Chris <[EMAIL PROTECTED]>
To: Prathaban Mookiah <[EMAIL PROTECTED]>
Cc: "php-general@lists.php.net" 
Sent: Mon, 26 Jun 2006 11:56:31 +1000
Subject: Re: [PHP] Problem Displaying Images

> Prathaban Mookiah wrote:
> > Oh sorry. I use addslashes().
> 
> Then you'll probably need to use stripslashes before printing out 
> the data.
> 
> echo stripslashes($Result["data"]);
> 
> -- 
> Postgresql & php tutorials
> http://www.designmagick.com/
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
--- End of Original Message ---

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



Re: [PHP] Problem Displaying Images

2006-06-25 Thread Chris

Prathaban Mookiah wrote:
I wish it would work. But id doesn't. But this time I do get a heavily 
distorted image being displayed.


But as I said earlier, in combination of MySQL 5 and PHP 5 works good. The 
problem is with PHP4 and MySQL 5.


I doubt the php5/php4 thing is an issue, I think it's a problem with 
different settings on your servers.


I think any of the magic_quotes_* stuff will make a difference. Start 
there I guess.


--
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] Sad PHP Poem

2006-06-25 Thread Ligaya Turmelle

Martin Alterisio wrote:



A sad poem of an algorithm where solitude brought excessive use of cpu
cycles and memory allocation for redundant data (it copied over and over
again the same image till all memory was filled with it)

--

$timeWaiting = 0;
while (!$you->near($me)) {
 $me->thinkAbout($you);

 switch (true) {
   case $timeWaiting < 5:
 $me->wait($you);
 break;

   case $timeWaiting < 10:
 $me->worry();
 break;

   case $timeWaiting < 20:
 $me->lookFor($you);
 break;

   case $timeWaiting < 40:
 $me->worry();
  $me->lookFor($you);
 break;

   case $timeWaiting < 80:
 $me->worry();
  $me->cry();
  $me->lookFor($you);
  $me->lookFor($you);
  $me->lookFor($you);
 break;

   case $timeWaiting < 160:
 $me->worry();
  $me->cry();
  $me->drink();
  $me->lookFor($you);
  $me->lookFor($you);
  $me->lookFor($you);
 $me->thinkAbout($you);
 $me->thinkAbout($you);
 $me->cry();
  $me->lookFor($you);
  $me->lookFor($you);
  $me->drink();
  $me->drink();
 break;

   default:
 throw new CantLiveWithoutYou();
 die("alone");
 }

 $timeWaiting++;
}

$me->happy = true;

--

I hope you enjoyed the poem and the fact that I didn't ask you to fix it or
find the bug in it =D

PD: Run in your web server at your own risk.




See we do have a softer side.  Outstanding!

--

life is a game... so have fun.

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

Re: [PHP] Sad PHP Poem

2006-06-25 Thread Martin Alterisio

2006/6/26, Ligaya Turmelle <[EMAIL PROTECTED]>:


Martin Alterisio wrote:
> 
>
> A sad poem of an algorithm where solitude brought excessive use of cpu
> cycles and memory allocation for redundant data (it copied over and over
> again the same image till all memory was filled with it)
>
> --
>
> $timeWaiting = 0;
> while (!$you->near($me)) {
>  $me->thinkAbout($you);
>
>  switch (true) {
>case $timeWaiting < 5:
>  $me->wait($you);
>  break;
>
>case $timeWaiting < 10:
>  $me->worry();
>  break;
>
>case $timeWaiting < 20:
>  $me->lookFor($you);
>  break;
>
>case $timeWaiting < 40:
>  $me->worry();
>   $me->lookFor($you);
>  break;
>
>case $timeWaiting < 80:
>  $me->worry();
>   $me->cry();
>   $me->lookFor($you);
>   $me->lookFor($you);
>   $me->lookFor($you);
>  break;
>
>case $timeWaiting < 160:
>  $me->worry();
>   $me->cry();
>   $me->drink();
>   $me->lookFor($you);
>   $me->lookFor($you);
>   $me->lookFor($you);
>  $me->thinkAbout($you);
>  $me->thinkAbout($you);
>  $me->cry();
>   $me->lookFor($you);
>   $me->lookFor($you);
>   $me->drink();
>   $me->drink();
>  break;
>
>default:
>  throw new CantLiveWithoutYou();
>  die("alone");
>  }
>
>  $timeWaiting++;
> }
>
> $me->happy = true;
>
> --
>
> I hope you enjoyed the poem and the fact that I didn't ask you to fix it
or
> find the bug in it =D
>
> PD: Run in your web server at your own risk.
>
> 
>
See we do have a softer side.  Outstanding!



I was a hard man till she threw me a ImNotSoSureAnymore exception =S

PD: I'm on fire today, maybe AJAX and the greek muses are behind my
inspiration

--


life is a game... so have fun.





Re: [PHP] Problem Displaying Images

2006-06-25 Thread Prathaban Mookiah
Yes, turning off the magic_quotes_runtime directive makes a difference. But 
the image is still distorted. All three magic_quotes directives are now set to 
the same value in both the servers.

Are there any other settings I should look out for?

Thanks.

Prathap


-- Original Message ---
From: Chris <[EMAIL PROTECTED]>
To: Prathaban Mookiah <[EMAIL PROTECTED]>
Cc: "php-general@lists.php.net" 
Sent: Mon, 26 Jun 2006 14:52:39 +1000
Subject: Re: [PHP] Problem Displaying Images

> Prathaban Mookiah wrote:
> > I wish it would work. But id doesn't. But this time I do get a heavily 
> > distorted image being displayed.
> > 
> > But as I said earlier, in combination of MySQL 5 and PHP 5 works good. The 
> > problem is with PHP4 and MySQL 5.
> 
> I doubt the php5/php4 thing is an issue, I think it's a problem with 
> different settings on your servers.
> 
> I think any of the magic_quotes_* stuff will make a difference. 
> Start there I guess.
> 
> -- 
> Postgresql & php tutorials
> http://www.designmagick.com/
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
--- End of Original Message ---

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



Re: [PHP] Problem Displaying Images

2006-06-25 Thread Chris

Prathaban Mookiah wrote:
Yes, turning off the magic_quotes_runtime directive makes a difference. But 
the image is still distorted. All three magic_quotes directives are now set to 
the same value in both the servers.


Are there any other settings I should look out for?


Try a CTRL+F5 to make sure it's not the browser caching the bad image, 
or alternatively clear your cache and try again or try on a different 
computer.


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

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