php-general Digest 31 Oct 2006 12:50:31 -0000 Issue 4432

Topics (messages 243918 through 243943):

Re: How do I get ini_set('output_handler', '') to work?!
        243918 by: Daevid Vincent
        243923 by: Ed Lazor

Re: Decide witch table within a union
        243919 by: Ed Lazor
        243926 by: Børge Holen

Re: only one at atime
        243920 by: Ed Lazor
        243934 by: Ahmad Al-Twaijiry
        243938 by: Ahmad Al-Twaijiry

Re: Run script every 30 seconds
        243921 by: Ed Lazor
        243937 by: Ahmad Al-Twaijiry

Re: str_replace on words with an array
        243922 by: Ed Lazor

help confirming a PDO_SQLITE bug
        243924 by: Rick Fletcher
        243925 by: Rick Fletcher

Re: Imagecopyresampled creates black pictures
        243927 by: Martin Hochreiter

Stupid question of the day (Editing text file in $HOME via web)
        243928 by: Google Kreme

IIS Rewrite or Mod_Rewrite
        243929 by: Kevin

PHP & Memory Allocation (checked via TOP)
        243930 by: Cabbar Duzayak
        243931 by: Cabbar Duzayak

Re: counting records in db
        243932 by: Ivo F.A.C. Fokkema
        243936 by: Roman Neuhauser
        243939 by: Robin Vickery

need help with foreach
        243933 by: melinem.earthlink.net
        243935 by: Dave Hamber

channels attribute value returns wrong
        243940 by: dhatri gmail

PHP IMAP with Attachments!?
        243941 by: Andy

No Error Messages
        243942 by: Sancar Saran
        243943 by: Jochem Maas

Administrivia:

To subscribe to the digest, e-mail:
        [EMAIL PROTECTED]

To unsubscribe from the digest, e-mail:
        [EMAIL PROTECTED]

To post to the list, e-mail:
        [email protected]


----------------------------------------------------------------------
--- Begin Message ---
Thank you for the reply Richard (and Tom). 

That news sucks however. Seems that the PHP pre-parser should handle this
better. It's not like it's a one-pass parser (like Ruby). 

<?php
ini_set('output_handler', 'mb_output_handler'); 
echo "\noutput_handler => " . ini_get('output_handler') . "\n";
?>

I suppose I could re-compile my command line version with a different
php.ini file, but that's kind of lame that I have to have two php.ini files
for what ini_set() SHOULD handle.

What other undocumented "gotchas" are there with ini_set() I wonder...

DÆVID  

> -----Original Message-----
> From: Richard Lynch [mailto:[EMAIL PROTECTED] 
> Sent: Sunday, October 29, 2006 9:25 PM
> To: Daevid Vincent
> Cc: [email protected]
> Subject: Re: [PHP] How do I get ini_set('output_handler', '') 
> to work?!
> 
> On Fri, October 27, 2006 3:46 pm, Daevid Vincent wrote:
> > What am I doing wrong...
> >
> > In my php.ini I have this for my web pages (and I want it):
> >
> >   output_handler = ob_gzhandler
> >
> > But this causes my command line script to not show output until the
> > very
> > end.
> >
> > I thought I could disable it at the top of a script, but it's not
> > working!?!
> >
> > #!/usr/bin/php -q
> > <?php
> >   ini_set('output_handler', 'mb_output_handler');
> 
> TOO LATE!
> 
> The ob_start() has already kicked in by this point.
> 
> ob_flush() until there are no more buffers.
> 
> -- 
> Some people have a "gift" link here.
> Know what I want?
> I want you to buy a CD from some starving artist.
> http://cdbaby.com/browse/from/lynch
> Yeah, I get a buck. So?
> 
> 

--- End Message ---
--- Begin Message ---

I suppose I could re-compile my command line version with a different
php.ini file, but that's kind of lame that I have to have two php.ini files
for what ini_set() SHOULD handle.

Would modifications via .htaccess work for you?
-Ed

--- End Message ---
--- Begin Message ---
Someone asked what it was to be used for.
It's for combining 4 forums into one witch shows the latest movement among
them. More like an introduction sort of...

Sounds cool.  Are you using a pre-made forum package?
-Ed

--- End Message ---
--- Begin Message ---
On Tuesday 31 October 2006 02:27, Ed Lazor wrote:
> > Someone asked what it was to be used for.
> > It's for combining 4 forums into one witch shows the latest
> > movement among
> > them. More like an introduction sort of...
>
> Sounds cool.  Are you using a pre-made forum package?

No 
Maby it'd been easier, I did that at first... But not much to learn using 
other ppls tools.

> -Ed

-- 
---
Børge
Kennel Arivene 
http://www.arivene.net
---

--- End Message ---
--- Begin Message ---

On Oct 30, 2006, at 10:14 AM, Ahmad Al-Twaijiry wrote:

Hi everyone,

I create a php script that will run every minute (by cronjob) and
update some database tables (php 5, database mysql 5, tables type
innodb)

the problem is that I want this script to run only one at atime (only
one process from this script can run )

for example, if the cronjob start the script and the script takes more
than one minute, then after this one minute the cronjob start another
process from this script, it should exit once it find there is an old
process of it running)

what I do now is that when the script start it will check for a tmp
file (/tmp/script.pid) and if it fine it it will exit.
if the file  (/tmp/script.pid) is not exists, it will create it and
start doing the database update
and when the script finish it will remove the file


any better idea ?

It sounds like how I'd approach it, but it depends somewhat on the type of updates your script is performing and how busy your website is. Plus, I'm curious, what kind of updates are needing to occur every 30 seconds? And, if your scripts are at risk of running for more than 30 seconds, does this mean that the volume of data you're working with end up building upon itself? Just wondering, because it sounds like you could end up hammering your database server.

-Ed

--- End Message ---
--- Begin Message ---
We have a virtual stock exchange site (for learning purpose) we put
all the bids and offers in  a table and every minute we run the php
script to make the exchange

but my customer want to make it less than 1 minute

On 10/31/06, Ed Lazor <[EMAIL PROTECTED]> wrote:

On Oct 30, 2006, at 10:14 AM, Ahmad Al-Twaijiry wrote:

> Hi everyone,
>
> I create a php script that will run every minute (by cronjob) and
> update some database tables (php 5, database mysql 5, tables type
> innodb)
>
> the problem is that I want this script to run only one at atime (only
> one process from this script can run )
>
> for example, if the cronjob start the script and the script takes more
> than one minute, then after this one minute the cronjob start another
> process from this script, it should exit once it find there is an old
> process of it running)
>
> what I do now is that when the script start it will check for a tmp
> file (/tmp/script.pid) and if it fine it it will exit.
> if the file  (/tmp/script.pid) is not exists, it will create it and
> start doing the database update
> and when the script finish it will remove the file
>
>
> any better idea ?

It sounds like how I'd approach it, but it depends somewhat on the
type of updates your script is performing and how busy your website
is.  Plus, I'm curious, what kind of updates are needing to occur
every 30 seconds?  And, if your scripts are at risk of running for
more than 30 seconds, does this mean that the volume of data you're
working with end up building upon itself?  Just wondering, because it
sounds like you could end up hammering your database server.

-Ed



--- End Message ---
--- Begin Message ---
BTW:

we use PDO functions to connect to the database and we also made the
tables innodb type

so if we use   $dbh->beginTransaction();

is it will be safe to run the script more than one in the same time ?


On 10/31/06, Ahmad Al-Twaijiry <[EMAIL PROTECTED]> wrote:
We have a virtual stock exchange site (for learning purpose) we put
all the bids and offers in  a table and every minute we run the php
script to make the exchange

but my customer want to make it less than 1 minute

On 10/31/06, Ed Lazor <[EMAIL PROTECTED]> wrote:
>
> On Oct 30, 2006, at 10:14 AM, Ahmad Al-Twaijiry wrote:
>
> > Hi everyone,
> >
> > I create a php script that will run every minute (by cronjob) and
> > update some database tables (php 5, database mysql 5, tables type
> > innodb)
> >
> > the problem is that I want this script to run only one at atime (only
> > one process from this script can run )
> >
> > for example, if the cronjob start the script and the script takes more
> > than one minute, then after this one minute the cronjob start another
> > process from this script, it should exit once it find there is an old
> > process of it running)
> >
> > what I do now is that when the script start it will check for a tmp
> > file (/tmp/script.pid) and if it fine it it will exit.
> > if the file  (/tmp/script.pid) is not exists, it will create it and
> > start doing the database update
> > and when the script finish it will remove the file
> >
> >
> > any better idea ?
>
> It sounds like how I'd approach it, but it depends somewhat on the
> type of updates your script is performing and how busy your website
> is.  Plus, I'm curious, what kind of updates are needing to occur
> every 30 seconds?  And, if your scripts are at risk of running for
> more than 30 seconds, does this mean that the volume of data you're
> working with end up building upon itself?  Just wondering, because it
> sounds like you could end up hammering your database server.
>
> -Ed
>
>



--

Ahmad
http://www.v-tadawul.com

--- End Message ---
--- Begin Message ---

On Oct 30, 2006, at 10:26 AM, Ahmad Al-Twaijiry wrote:
is it possible to link the script to my php interface (the one that
the users is using it) and if the php interface page will run the
script (IN background) if it didn't run for the last 30 seconds ? I
see  this is very hard and almost impossible , what do you think ?

PS: also I need to make sure no more than 1 process of the script is running :)

Hi Ahmad. Could you describe what your script is doing? What type of information are you wanting users to see? Is this some sort of status page? Is it some sort of semi-real-time monitoring?

-Ed

--- End Message ---
--- Begin Message ---
yes, I think you can call it ,semi-real-time monitoring

because we want the script when it run it should read some records in
database and update other records


On 10/31/06, Ed Lazor <[EMAIL PROTECTED]> wrote:

On Oct 30, 2006, at 10:26 AM, Ahmad Al-Twaijiry wrote:
> is it possible to link the script to my php interface (the one that
> the users is using it) and if the php interface page will run the
> script (IN background) if it didn't run for the last 30 seconds ? I
> see  this is very hard and almost impossible , what do you think ?
>
> PS: also I need to make sure no more than 1 process of the script
> is running :)

Hi Ahmad.  Could you describe what your script is doing?  What type
of information are you wanting users to see?  Is this some sort of
status page?  Is it some sort of semi-real-time monitoring?

-Ed




--

Ahmad
http://www.v-tadawul.com

--- End Message ---
--- Begin Message ---

On Oct 30, 2006, at 1:10 PM, Dotan Cohen wrote:

On 30/10/06, Stut <[EMAIL PROTECTED]> wrote:
Ed Lazor wrote:
> It looks like you guys are coming up with some cool solutions, but I
> have a question.  Wasn't the original purpose of this thread to
> prevent sql injection attacks in input from user forms?  If so,
> wouldn't mysql_real_escape_string be an easier solution?

Me thinkie nottie. From the OP...

"I need to remove the noise words from a search string."

Yes, that is also part of the aim.

How come? Not trying to be facetious here. I'm just wondering if you see a benefit that I don't. For example, say the hacker injects some sql and you use mysql_real_escape_string. You end up with something like this... actually, I'll do one step further and just use the quote_smart function described in the mysql_real_escape_string page of the php manual:

$query = sprintf("SELECT * FROM users WHERE user=%s AND password=%s",
                                quote_smart($_POST['username']),
                                quote_smart($_POST['password']) );

Say the user tried to inject sql in $_POST['username'] and it looked something like: root';drop all;

Having used quote_smart, the value of $query ends up

SELECT * FROM users WHERE user='root\'\;drop all\;' AND password='something'

The sql injection fails. The data is seen as a literal. The database is going to think there's no user with that name. That means that even if the user did include extra words, they're just part of the value that is checked against user names - rather than being see as potential commands.

I'm not sure if I'm describing this well, so let me know what you think and I'll go from there.

-Ed

--- End Message ---
--- Begin Message --- I've just upgraded to Fedora Core 6 and my personal site broke. Along with the upgrade came PHP 5.1.6 and SQLite 3.3.6. After the upgrade any SELECT returns all its values with the last character missing.

I've filed a bug at pecl.php.net (http://pecl.php.net/bugs/bug.php?id=9191), but it doesn't look as though that's reviewed very often. I need help confirming that it is a PDO or SQLite bug so that I can begin upgrading or downgrading to avoid it.

If you have matching versions of PHP and/or SQLite, can you try out the test script below and see if it's broken in the same way?

Thanks,
Rick Fletcher

Reproduce code:
---------------
<?php
$dbh = new PDO( 'sqlite::memory:' );

$dbh->query( 'CREATE TABLE "things" ( name VARCHAR NOT NULL )');
$dbh->query( 'INSERT INTO things VALUES ( "thing one" )');

foreach( $dbh->query( 'SELECT * FROM things' ) as $row ) {
        print_r( $row );
}
$dbh = null;
?>

Expected result:
----------------
Array
(
    [name] => thing one
    [0] => thing one
)

Actual result:
--------------
Array
(
    [name] => thing on
    [0] => thing on
)

--- End Message ---
--- Begin Message --- Thanks to anyone who entertained my previous email, but I've solved my own problem.

It looks like the bug is in PDO_SQLITE 1.0.1. I've just compiled from that extension from CVS, changing nothing else, and the bug is gone.

--rick

Rick Fletcher wrote:
I've just upgraded to Fedora Core 6 and my personal site broke. Along with the upgrade came PHP 5.1.6 and SQLite 3.3.6. After the upgrade any SELECT returns all its values with the last character missing.

I've filed a bug at pecl.php.net (http://pecl.php.net/bugs/bug.php?id=9191), but it doesn't look as though that's reviewed very often. I need help confirming that it is a PDO or SQLite bug so that I can begin upgrading or downgrading to avoid it.

If you have matching versions of PHP and/or SQLite, can you try out the test script below and see if it's broken in the same way?

Thanks,
Rick Fletcher

Reproduce code:
---------------
<?php
$dbh = new PDO( 'sqlite::memory:' );

$dbh->query( 'CREATE TABLE "things" ( name VARCHAR NOT NULL )');
$dbh->query( 'INSERT INTO things VALUES ( "thing one" )');

foreach( $dbh->query( 'SELECT * FROM things' ) as $row ) {
    print_r( $row );
}
$dbh = null;
?>

Expected result:
----------------
Array
(
    [name] => thing one
    [0] => thing one
)

Actual result:
--------------
Array
(
    [name] => thing on
    [0] => thing on
)


--- End Message ---
--- Begin Message ---
tedd schrieb:
At 9:52 AM +0100 10/30/06, Martin Hochreiter wrote:
What is wrong here?

Martin:

Damn, that's a lot of code to do something pretty simple. I had no problems uploading and resampling your image with a lot less.

Try using ob_start() and ob_end() to grab your image.:

ob_start();  imagejpeg($new,$dir.'view/'.$name,85);
ob_end_clean();

hth's

tedd

"Damn, that's a lot of code to do something pretty simple"
... i am not a php professional - just hacking around to get
things run ...

Ok, thank you for your code - unfortunately the result is the same
(I added the picture as attachement)

Maybe php is not responsible for that - should I try another GD library
version or image Magik version?



--- End Message ---
--- Begin Message --- I have a text file on a server that I want someone to be able to edit via the web. I need it to have some modicum of security, but it's nothing particularly important and security is not the main concern. I am perfectly willing to simply http-auth it, if need be.

But it need to be easily editable using some sort of simple web form.

The file is unlikely to be much more than 20-100 lines of simple text, but there are a couple of things that are important.

1) it has to preserve spacing and 'extended' characters
2) it has to be kept readable to the uid of the directory it is in, and not just the webserver, however it can't be world readable without some authentication via the web. 3) the file is in $HOME and not in DocumentRoot, though it _could_ be moved.

I don't want to install some fancy word-processing sort of engine just to give a user access to this file, nor does the file need to be html-ized or anything. It is a very simple file:

(AAA) XXX-NNN, some descriptive text
(AAA) XXX-NNN, some other descriptive text
(AAA) XXX-NNN, some different descriptive text
(AAA) XXX-NNN, John Smith

etc.

So, do I whack up something where I just load the file into a HTML Textarea and then write it back (simple enough, though possibly rather dangerous), or is there something straightforward I should go ahead and use that might find use elsewhere on the server?

--
"Oh damn", said Maladict.

--- End Message ---
--- Begin Message ---
Hi,

I have created a website which is using the iis rewrite module to write the following:

index.php?tn_id=5&ln_id=4 to something like

/contact/directions.html and this works fine

however I have a link at the bottom which needs to pass another variable through the query string before it would simply be:

index.php?tn_id=5&ln_id=4&ts=75

however if i run

/contact/directions.html?ts=75 it doesn't work and comes up with a 404 page not found error.

Is there anyway around this?

Thanks

Kevin

--- End Message ---
--- Begin Message ---
Hi,

I have written a simple test program to see how php allocates memory.
Test code allocates ~10 Meg of RAM in an array within a loop till it
runs out of memory as:

 $str = rand(65, 95) . rand(65, 95) . rand(65, 95) . rand(65, 95) .
rand(65, 95);
 $aa[] = str_repeat($str, 2000000);

What I don't understand here is, for every 10 Meg memory it allocates,
mem usage goes up about 19 Megs when I look at this via top.
Basically, it allocates from physical memory in the beginning, starts
using swap when it is out of RES/Physical memory, which makes me
assume that garbage collection should kick in for temporary string
creations, and each new allocation increases the allocated memory size
by 19 Megs.

Any idea why this is happening, and why do you think memory allocation
is so expensive in PHP?

Thanks..


Results of TOP:

 PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND
21843 apache    17   0 19292 5232 3832 S  0.0  0.5   0:00.04 php
21843 apache    16   0 38824  24m 3908 S  0.0  2.4   0:00.10 php
21843 apache    15   0 58356  43m 3912 S  0.0  4.3   0:00.17 php
21843 apache    16   0 77888  62m 3912 S  0.0  6.2   0:00.22 php
21843 apache    15   0 97420  81m 3912 S  0.0  8.1   0:00.29 php
21843 apache    15   0  114m 100m 3912 S  0.0  9.9   0:00.35 php


Results of free -m:

            total       used       free     shared    buffers     cached
Mem:          1011        138        872          0          2         58
Swap:         2008        388       1619

Mem:          1011        158        852          0          2         58
Swap:         2008        388       1619

Mem:          1011        177        833          0          2         58
Swap:         2008        388       1619

Mem:          1011        196        814          0          2         58
Swap:         2008        388       1619

Mem:          1011        216        795          0          2         58
Swap:         2008        388       1619

Mem:          1011        234        776          0          2         58
Swap:         2008        388       1619

--- End Message ---
--- Begin Message ---
As a side note, even though user is shown as apache, this code was
executed from command line.

--- End Message ---
--- Begin Message ---
On Mon, 30 Oct 2006 12:28:29 +0100, Robin Vickery wrote:

> On 30/10/06, Ivo F.A.C. Fokkema <[EMAIL PROTECTED]> wrote:
>> On Sun, 29 Oct 2006 23:40:47 -0600, Richard Lynch wrote:
>> > On Fri, October 27, 2006 4:53 pm, Børge Holen wrote:
>> >> On Friday 27 October 2006 19:34, Richard Lynch wrote:
>> >>> And the header("Location: ...") requires a full URL.
>> >>
>> >> No it doesn't. but he's missing an ' at first glance
>> >
>> > Yes, it does:
>> > http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.30
>> >
>> > Note the use of 'absolute' within that section.
>>
>> Although I always use a full URL as well, doesn't absolute just mean
>> non-relative? As in:
>> Location: /Protocols/rfc2616/rfc2616-sec14.html#sec14.30
>> (absolute URI)
>>
>> Location: ./rfc2616-sec14.html#sec14.30
>> (relative URI)
> 
> If you need contextual information to make sense of the URI (such as
> the server name from a previous request) then it's not absolute.
> 
> RFC 2396: Uniform Resource Identifiers
> 
> "An absolute identifier refers to a resource independent of the
> context in which the identifier is used. In contrast, a relative
> identifier refers to a resource by describing the difference within a
> hierarchical namespace between the current context and an absolute
> identifier of the resource."

Ah, thanks. I was confusing it with absolute and relative paths.

--- End Message ---
--- Begin Message ---
# [EMAIL PROTECTED] / 2006-10-27 20:14:58 +0200:
> > And the header("Location: ...") requires a full URL.
> Why?

HTTP protocol specification[1] says:

14.30 Location

   The Location response-header field is used to redirect the recipient
   to a location other than the Request-URI for completion of the
   request or identification of a new resource. For 201 (Created)
   responses, the Location is that of the new resource which was created
   by the request. For 3xx responses, the location SHOULD indicate the
   server's preferred URI for automatic redirection to the resource. The
   field value consists of a single absolute URI.

       Location       = "Location" ":" absoluteURI

   An example is:

       Location: http://www.w3.org/pub/WWW/People.html

      Note: The Content-Location header field (section 14.14) differs
      from Location in that the Content-Location identifies the original
      location of the entity enclosed in the request. It is therefore
      possible for a response to contain header fields for both Location
      and Content-Location. Also see section 13.10 for cache
      requirements of some methods.

[1] ftp://ftp.rfc-editor.org/in-notes/rfc2616.txt

-- 
How many Vietnam vets does it take to screw in a light bulb?
You don't know, man.  You don't KNOW.
Cause you weren't THERE.             http://bash.org/?255991

--- End Message ---
--- Begin Message ---
On 30/10/06, Robert Cummings <[EMAIL PROTECTED]> wrote:
On Mon, 2006-10-30 at 12:28 +0100, Robin Vickery wrote:
> On 30/10/06, Ivo F.A.C. Fokkema <[EMAIL PROTECTED]> wrote:
> > On Sun, 29 Oct 2006 23:40:47 -0600, Richard Lynch wrote:
> >
> > > On Fri, October 27, 2006 4:53 pm, Børge Holen wrote:
> > >> On Friday 27 October 2006 19:34, Richard Lynch wrote:
> > >>> And the header("Location: ...") requires a full URL.
> > >>
> > >> No it doesn't. but he's missing an ' at first glance
> > >
> > > Yes, it does:
> > > http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.30
> > >
> > > Note the use of 'absolute' within that section.
> >
> > Although I always use a full URL as well, doesn't absolute just mean
> > non-relative? As in:
> > Location: /Protocols/rfc2616/rfc2616-sec14.html#sec14.30
> > (absolute URI)
> >
> > Location: ./rfc2616-sec14.html#sec14.30
> > (relative URI)
>
> If you need contextual information to make sense of the URI (such as
> the server name from a previous request) then it's not absolute.
>
> RFC 2396: Uniform Resource Identifiers
>
> "An absolute identifier refers to a resource independent of the
> context in which the identifier is used. In contrast, a relative
> identifier refers to a resource by describing the difference within a
> hierarchical namespace between the current context and an absolute
> identifier of the resource."

Please note you are quoting from an RFC with the following title:

    Uniform Resource Identifiers (URI): Generic Syntax

Pay special attention to "Generic Syntax" in the title.

The RFC linked by Richard clearly indicates that for the Location
response-header that "the field value consists of a single absolute
URI". This currently has the final word for the Location response-header
and therefore is the standard.

What?

Pay special attention to what I wrote.

I wasn't disagreeing with Richard, or the RFC he quoted. The OP
expressed some confusion about what comprised an 'absolute URI' so I
quoted the section of the RFC that defined an 'absolute URI'.

There's no question that a Location header should contain an absolute
URI as its value.

-robin

--- End Message ---
--- Begin Message --- I want to tell the server to do 2 things when I click on the "jobType" link.

This is the code that I have now which displays the "art" when I click on "jobType"

foreach($row as $jobType)
                        {
                        $row = mysql_fetch_array($result2,MYSQL_ASSOC);
echo "<a href=client.php?art=".$row['pix']." border='0'>{$row ['jobType']}</a>\n";
                        }

I now want to, with the same click, also show the url if I have a url for that "jobType" in my database column called "url".

Thank you for any help.

--- End Message ---
--- Begin Message ---
Its not very clear what you want to achieve with that code snippet.

If you are pulling database rows out of your database with mysql_fetch_array(), then you do not need a foreach loop.

I think you may want something like this, but without knowing your database table structure and the query you have used it is only a guess.

while($row = mysql_fetch_array($result2,MYSQL_ASSOC)){

echo "<a href=client.php?art=".$row['pix']." border='0'>{$row['jobType']}</a>\n";
        if($row['url']!='')echo "html to use with ".$row['url'];

}


On 31/10/2006 10:09 [EMAIL PROTECTED] wrote:
I want to tell the server to do 2 things when I click on the "jobType" link.

This is the code that I have now which displays the "art" when I click on "jobType"

foreach($row as $jobType)
            {
            $row = mysql_fetch_array($result2,MYSQL_ASSOC);
echo "<a href=client.php?art=".$row['pix']." border='0'>{$row['jobType']}</a>\n";
            }

I now want to, with the same click, also show the url if I have a url for that "jobType" in my database column called "url".

Thank you for any help.

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




--- End Message ---
--- Begin Message ---
Hello,

using function getimagesize();

I am trying to get channels attribute value of image, it returns 3 for cmyk image actually it should return 4, can you tell me why it happens so?

regds.
dmt

--- End Message ---
--- Begin Message ---
Hi to all, 

I need a class that reads emails from a server and reads the attachments from 
the mail. 

The mailservers is an IMAP for mail reading. 

The attachment types can be: images/pdf/text documents. 

Any suggestions? 

On phpclasses.org did not find any which works well. 


Regards, 
Andy.

--- End Message ---
--- Begin Message ---
Hi, Recenly I face very disturbing problem.

If page has some errors it stop producing any error messages. Neither page nor 
syslog.

I get blank page.

System
Debian Unstable
Apache 2
Php 5.1.6

Apc
Memcached
Obhandler with gzip
and I store entire page output then printed out.

And I found if my error on first pages there was no problem, error message 
show in page and syslog and if that eroor is in included files. I get 
absolutely Nothing.

Does any one give any clue about it.

Regards

Sancar

--- End Message ---
--- Begin Message ---
Sancar Saran wrote:
> Hi, Recenly I face very disturbing problem.
> 
> If page has some errors it stop producing any error messages. Neither page 
> nor 
> syslog.
> 
> I get blank page.
> 
> System
> Debian Unstable
> Apache 2
> Php 5.1.6
> 
> Apc
> Memcached
> Obhandler with gzip
> and I store entire page output then printed out.
> 
> And I found if my error on first pages there was no problem, error message 
> show in page and syslog and if that eroor is in included files. I get 
> absolutely Nothing.
> 
> Does any one give any clue about it.

probably your error_reporting level or display_errors setting is not what you
think it is at the time the include occurs/runs.

alternatively something (3rd party) maybe setting an error handler that is
trapping your errors but not showing/logging them

lastly maybe your output buffer is the problem ... you might try a registering a
shutdown function that clears/outputs all buffers so that it is run
even if an error occurs.

> 
> Regards
> 
> Sancar
> 

--- End Message ---

Reply via email to