Re: [PHP] php exec()

2008-11-03 Thread cheesiong
hi ash,
 i tried you suggestion, with
lalala.txt');?>
the lalala.txt was created but the file is empty.

anymore suggestion?
thank you.

regards,-keo

On Mon, Nov 3, 2008 at 3:29 PM, Ashley Sheridan <[EMAIL PROTECTED]>wrote:

> On Mon, 2008-11-03 at 15:21 +0800, cheesiong wrote:
> > hi Chris,
> >  i found out that when execute ipkg, the return is before the header.
> >
> > root [ /srv/www/test ]# /program/php-5.2.6/bin/php-cgi ipkg.php
> > ipkg version 0.99.163
> > X-Powered-By: PHP/5.2.6
> > Content-type: text/html
> >
> > Array
> > (
> > )
> >
> >
> > which is different than the whoami program.
> > root [ /srv/www/test ]# /program/php-5.2.6/bin/php-cgi whoami.php
> > X-Powered-By: PHP/5.2.6
> > Content-type: text/html
> >
> > the result of execwhoami is
> > root
> >
> >
> > can you see the different?
> >
> > regards,-keo
> >
> >
> > On Mon, Nov 3, 2008 at 2:12 PM, cheesiong <[EMAIL PROTECTED]>
> wrote:
> >
> > > hi Chris,
> > >  i did try,
> > > below is the continouos output from prompt when i do su.
> > >
> > > root [ /srv/www/test ]# su daemon
> > > root [ /srv/www/test ]#
> > >
> > > i didnt manage to switch user.
> > > i will create an user... so that i can switch to it.
> > >
> > > i created a user call lfs into group lfs.
> > > able to execute ipkg-cl and /program//ipkg-ck --version.
> > >
> > > then i change the httpd.conf to start apache with lfs and execute the
> php
> > > script to exec ipkg-cl --version.
> > > basically it is not working.
> > >
> > > root [ /srv/www/test ]# groupadd lfs
> > > root [ /srv/www/test ]# useradd -s /bin/bash -g lfs -m -k /dev/null lfs
> > > root [ /srv/www/test ]# passwd lfs
> > > Changing password for lfs
> > > Enter the new password (minimum of 5, maximum of 127 characters)
> > > Please use a combination of upper and lower case letters and numbers.
> > > New password:
> > > Bad password: too short.
> > > Warning: weak password (enter it again to use it anyway).
> > > New password:
> > > Re-enter new password:
> > > Password changed.
> > > root [ /srv/www/test ]# su lfs
> > > bash-3.2$ ipkg-cl --version
> > > ipkg version 0.99.163
> > > bash-3.2$ /program/ipkg-0.99.163/bin/ipkg-cl --version
> > > ipkg version 0.99.163
> > > bash-3.2$
> > >
> > > lfs  13615  0.0  0.3   3684  1344 ?S14:06   0:00
> > > /program/httpd-2.2.9/bin/
> > > lfs  13616  0.0  0.3   3684  1344 ?S14:06   0:00
> > > /program/httpd-2.2.9/bin/
> > > lfs  13617  0.0  0.3   3684  1344 ?S14:06   0:00
> > > /program/httpd-2.2.9/bin/
> > > lfs  13618  0.0  0.3   3684  1344 ?S14:06   0:00
> > > /program/httpd-2.2.9/bin/
> > > lfs  13619  0.0  0.3   3684  1344 ?S14:06   0:00
> > > /program/httpd-2.2.9/bin/
> > >
> > >
> > > so not the user right problem, am i right ?
> > >
> > > regards,-keo
> > >
> > >
> > > On Mon, Nov 3, 2008 at 1:59 PM, Chris <[EMAIL PROTECTED]> wrote:
> > >
> > >> cheesiong wrote:
> > >>
> > >>> hi Chris,
> > >>>  my linux system is LFS that i build from scratch.
> > >>>  i cant su to daemon.
> > >>>
> > >>>  below is my /etc/passwd:
> > >>> root [ /srv/www/test ]# cat /etc/passwd
> > >>> root:x:0:0:root:/root:/bin/bash
> > >>> nobody:x:99:99:Unprivileged User:/dev/null:/bin/false
> > >>> sshd:x:50:50:sshd PrivSep:/var/lib/sshd:/bin/false
> > >>> daemon:x:6:6:daemon:/dev/null:/bin/false
> > >>>
> > >>
> > >> Change it, su, change it back. Looking at apache logs won't tell you
> much
> > >> if you don't try something.
> > >>
> > >> Are you running selinux?
> > >>
> > >>  ] /opt/ipkg-0.99.163/bin/ipkg-cl: Permission
> > >>> denied, referer: http://169.254.0.101/test/
> > >>>
> > >>
> > >> That one's pretty easy.
> > >>
> > >>
> > >> --
> > >> Postgresql & php tutorials
> > >> http://www.designmagick.com/
> > >>
> > >>
> > >
> What about making an exec call, but piping the results of that call to a
> text file. That way, it will be in a file that is easily accessed from
> other parts of your site. I'm not sure which is more expensive, a call
> to ifconfig, or a file read.
>
>
> Ash
> www.ashleysheridan.co.uk
>
>


Re: [PHP] php exec()

2008-11-03 Thread Zoltan Ormandi

Hi,

I'm not a Linux guru, so maybe my question is stupid, but are you sure 
the command prints its output to the *standard* output?


Z


cheesiong wrote:

hi ash,
 i tried you suggestion, with
lalala.txt');?>
the lalala.txt was created but the file is empty.

anymore suggestion?
thank you.

regards,-keo

On Mon, Nov 3, 2008 at 3:29 PM, Ashley Sheridan <[EMAIL PROTECTED]>wrote:

  

On Mon, 2008-11-03 at 15:21 +0800, cheesiong wrote:


hi Chris,
 i found out that when execute ipkg, the return is before the header.

root [ /srv/www/test ]# /program/php-5.2.6/bin/php-cgi ipkg.php
ipkg version 0.99.163
X-Powered-By: PHP/5.2.6
Content-type: text/html

Array
(
)


which is different than the whoami program.
root [ /srv/www/test ]# /program/php-5.2.6/bin/php-cgi whoami.php
X-Powered-By: PHP/5.2.6
Content-type: text/html

the result of execwhoami is
root


can you see the different?

regards,-keo


On Mon, Nov 3, 2008 at 2:12 PM, cheesiong <[EMAIL PROTECTED]>
  

wrote:


hi Chris,
 i did try,
below is the continouos output from prompt when i do su.

root [ /srv/www/test ]# su daemon
root [ /srv/www/test ]#

i didnt manage to switch user.
i will create an user... so that i can switch to it.

i created a user call lfs into group lfs.
able to execute ipkg-cl and /program//ipkg-ck --version.

then i change the httpd.conf to start apache with lfs and execute the


php


script to exec ipkg-cl --version.
basically it is not working.

root [ /srv/www/test ]# groupadd lfs
root [ /srv/www/test ]# useradd -s /bin/bash -g lfs -m -k /dev/null lfs
root [ /srv/www/test ]# passwd lfs
Changing password for lfs
Enter the new password (minimum of 5, maximum of 127 characters)
Please use a combination of upper and lower case letters and numbers.
New password:
Bad password: too short.
Warning: weak password (enter it again to use it anyway).
New password:
Re-enter new password:
Password changed.
root [ /srv/www/test ]# su lfs
bash-3.2$ ipkg-cl --version
ipkg version 0.99.163
bash-3.2$ /program/ipkg-0.99.163/bin/ipkg-cl --version
ipkg version 0.99.163
bash-3.2$

lfs  13615  0.0  0.3   3684  1344 ?S14:06   0:00
/program/httpd-2.2.9/bin/
lfs  13616  0.0  0.3   3684  1344 ?S14:06   0:00
/program/httpd-2.2.9/bin/
lfs  13617  0.0  0.3   3684  1344 ?S14:06   0:00
/program/httpd-2.2.9/bin/
lfs  13618  0.0  0.3   3684  1344 ?S14:06   0:00
/program/httpd-2.2.9/bin/
lfs  13619  0.0  0.3   3684  1344 ?S14:06   0:00
/program/httpd-2.2.9/bin/


so not the user right problem, am i right ?

regards,-keo


On Mon, Nov 3, 2008 at 1:59 PM, Chris <[EMAIL PROTECTED]> wrote:



cheesiong wrote:

  

hi Chris,
 my linux system is LFS that i build from scratch.
 i cant su to daemon.

 below is my /etc/passwd:
root [ /srv/www/test ]# cat /etc/passwd
root:x:0:0:root:/root:/bin/bash
nobody:x:99:99:Unprivileged User:/dev/null:/bin/false
sshd:x:50:50:sshd PrivSep:/var/lib/sshd:/bin/false
daemon:x:6:6:daemon:/dev/null:/bin/false



Change it, su, change it back. Looking at apache logs won't tell you
  

much


if you don't try something.

Are you running selinux?

 ] /opt/ipkg-0.99.163/bin/ipkg-cl: Permission
  

denied, referer: http://169.254.0.101/test/



That one's pretty easy.


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


  

What about making an exec call, but piping the results of that call to a
text file. That way, it will be in a file that is easily accessed from
other parts of your site. I'm not sure which is more expensive, a call
to ifconfig, or a file read.


Ash
www.ashleysheridan.co.uk





  


[PHP] Re: Write my own extensions‏

2008-11-03 Thread Gautier Di Folco



Ok thank you to Stut, Nathan Nobbe and Luppus Michaelis for your help, I take 
notes, I learn and I come back :)
_
Téléphonez gratuitement à tous vos proches avec Windows Live Messenger  !  
Téléchargez-le maintenant ! 
http://www.windowslive.fr/messenger/1.asp

Re: [PHP] take me off the list

2008-11-03 Thread Stut

On 3 Nov 2008, at 00:52, Dennison, Deborah wrote:

Sorry to have to do this to the list but I have tried 4 rimes to
unsubscribe from this list the suggested way yet I continue to get  
mail.

List Master please remove me.


There is no list master so you're out of luck there.

You're having an identity crisis. Your email came from  
Deborah.Dennison@ but you state your email address as...



email: [EMAIL PROTECTED]


...in your sig. My guess is that you subscribed with a different email  
address to the one you're trying to unsubscribe. Sort out who you are  
and the world might start to make sense.


-Stut

--
http://stut.net/

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



Re: [PHP] take me off the list

2008-11-03 Thread Jochem Maas
Stut schreef:
> On 3 Nov 2008, at 00:52, Dennison, Deborah wrote:

...

>  Sort out who you are
> and the world might start to make sense.

that deserve's it's own T-shirt :)

> -Stut
> 


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



[PHP] Problems with images..

2008-11-03 Thread Anders Norrbring
I've been staring myself blind, so now I don't get anywhere, please do
advice..

I have a web page printed with PHP, in a table I need to display images that
are stored in a SQL DB.
Getting the images into variables isn't an issue at all, but how do I output
it?
This is what I want to accomplish:

Current image: - THE IMAGE HERE - 

Starting to pull my hair..
Anders.


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



[PHP] Re: how to kill a session by closing window or tab clicking on X?

2008-11-03 Thread Martin Zvarík

Afan Pasalic napsal(a):

hi.
I'm sorry for posting this more javascript then php question, but it's 
somehow php related.
here is the issue: very often people close the window/tab without 
logging out. I need solution how to "recognize" when [x] is clicked (or 
File >> Close) and kill the session before the window/tab is closed.


few years ago, before firefox and tabs, I solved this by javascript and 
onClose() as a part of body tag. now, it doesn't work anymore.


any suggestion/opinion/experience?

thanks

afan


You might wanna check this out: http://cz2.php.net/ignore_user_abort

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



Re: [PHP] Mailing lists

2008-11-03 Thread Dotan Cohen
2008/11/3 Richard Heyes <[EMAIL PROTECTED]>:
>>> OMG Pwnies!
>>>
>> Fixed that for you.
>
> In my best Manuel voice (kinda topical)... Keh??
>

/. memes. You may be better off not knowing.

-- 
Dotan Cohen

http://what-is-what.com
http://gibberish.co.il
א-ב-ג-ד-ה-ו-ז-ח-ט-י-ך-כ-ל-ם-מ-ן-נ-ס-ע-ף-פ-ץ-צ-ק-ר-ש-ת

ä-ö-ü-ß-Ä-Ö-Ü


RE: [PHP] Problems with images..

2008-11-03 Thread Boyd, Todd M.
> -Original Message-
> From: Anders Norrbring [mailto:[EMAIL PROTECTED]
> Sent: Monday, November 03, 2008 7:44 AM
> To: php-general@lists.php.net
> Subject: [PHP] Problems with images..
> 
> I've been staring myself blind, so now I don't get anywhere, please do
> advice..
> 
> I have a web page printed with PHP, in a table I need to display
images
> that
> are stored in a SQL DB.
> Getting the images into variables isn't an issue at all, but how do I
> output
> it?
> This is what I want to accomplish:
> 
> Current image: - THE IMAGE HERE - 
> 
> Starting to pull my hair..

Current image:

If you don't have the proper INI setting to allow for the short-hand , you can replace it with:



If this made you pull your hair out, then perhaps you should go back and
get a fundamental understanding of HTML and PHP basics before trying to
combine the two. Just sayin'.

HTH,


Todd Boyd
Web Programmer

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



SV: [PHP] Problems with images..

2008-11-03 Thread Anders Norrbring
> > I've been staring myself blind, so now I don't get anywhere, please
> do
> > advice..
> >
> > I have a web page printed with PHP, in a table I need to display
> images
> > that
> > are stored in a SQL DB.
> > Getting the images into variables isn't an issue at all, but how do I
> > output
> > it?
> > This is what I want to accomplish:
> >
> > Current image: - THE IMAGE HERE - 
> >
> > Starting to pull my hair..
> 
> Current image: />
> 
> If you don't have the proper INI setting to allow for the short-hand
>  ?>, you can replace it with:
> 
> 
> 
> If this made you pull your hair out, then perhaps you should go back
> and
> get a fundamental understanding of HTML and PHP basics before trying to
> combine the two. Just sayin'.


Thank you for your wonderful sarcasm Todd. But the solution you suggest just
won't work, and as a programmer, you should be just about knowledgeable
enough to know that.

However, I got a tip about something that WILL work, so I prefer to listen
to that person instead. She said;


";
?>



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



SV: [PHP] Problems with images..

2008-11-03 Thread Anders Norrbring
> Anders Norrbring wrote:
> 
> > I've been staring myself blind, so now I don't get anywhere, please
> do
> > advice..
> >
> > I have a web page printed with PHP, in a table I need to display
> > images that are stored in a SQL DB.
> > Getting the images into variables isn't an issue at all, but how do I
> > output it?
> > This is what I want to accomplish:
> >
> > Current image: - THE IMAGE HERE - 
> >
> > Starting to pull my hair..
> > Anders.
> 
> 
> 
> fetchimg.php:
> 
> header('Content-Type: image/jpeg');
> $img=;
> print $img;


True Per, but I would prefer one single file in this case..

Anders.


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



[PHP] Time zones and $_ENV vs getenv

2008-11-03 Thread John Coppens
Hello people.

Argentina changed timezones (Oct 19th), just two weeks ago, and, as PHP
has a separate table, I forgot to change the zones both in my machine and
on the server. I did so yesterday, and have some problems. Here's what I
did:

1) Downloaded the latest timezonedb (2008.9), compiled and installed it
locally and on the server. Apparently no problem there.

2) I have a calendar on my pages
(http://www.jcoppens.com/kayak/peperina/agenda.php&uniz=1) which shows
the unix time stamp if the cursor is above a date (just to help
debugging). The stamps coincide till Oct 19th, then differ by one hour
(as compared to my PC).

At the remote server, the time seems correct (-0200), on my machine it
isn't (-0300). I _did_ restart my apache, and yes, the php.ini is correct.

One strange thing I noticed (on both my machine and the server) is that
$_ENV['TZ'] was empty, while getenv('TZ') was correctly set
(America/Argentina/Cordoba).

I'm confused... Can someone point me to some more tests I could do?

Thanks,
John

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



Re: [PHP] take me off the list

2008-11-03 Thread Daniel P. Brown
On Mon, Nov 3, 2008 at 4:36 AM, Stut <[EMAIL PROTECTED]> wrote:
>
> You're having an identity crisis. Your email came from Deborah.Dennison@ but
> you state your email address as...
>
>> email: [EMAIL PROTECTED]

I had noticed the same thing.  I unsubscribed her from the list
right after she wrote that first message, and haven't heard back
since.  So that was most likely the case.

-- 

http://www.parasane.net/
[EMAIL PROTECTED] || [EMAIL PROTECTED]
Ask me about our current hosting/dedicated server deals!

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



Re: [PHP] Problems with images..

2008-11-03 Thread Per Jessen
Anders Norrbring wrote:

> I've been staring myself blind, so now I don't get anywhere, please do
> advice..
> 
> I have a web page printed with PHP, in a table I need to display
> images that are stored in a SQL DB.
> Getting the images into variables isn't an issue at all, but how do I
> output it?
> This is what I want to accomplish:
> 
> Current image: - THE IMAGE HERE - 
> 
> Starting to pull my hair..
> Anders.



fetchimg.php:

header('Content-Type: image/jpeg');
$img=;
print $img;


/Per Jessen, Zürich


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



Re: [PHP] Mailing lists

2008-11-03 Thread Richard Heyes
>> OMG Pwnies!
>>
> Fixed that for you.

In my best Manuel voice (kinda topical)... Keh??

-- 
Richard Heyes

HTML5 Graphing for FF, Chrome, Opera and Safari:
http://www.rgraph.org (Updated November 1st)

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



Re: [PHP] php exec()

2008-11-03 Thread Stut

On 3 Nov 2008, at 08:06, cheesiong wrote:

i tried you suggestion, with
lalala.txt');?>
the lalala.txt was created but the file is empty.

anymore suggestion?


Try...

&1');?>

It's not uncommon for CLI utilities to output their banner on stderr  
so it doesn't get included when the output is piped elsewhere.


-Stut

--
http://stut.net/

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



Re: [PHP] Mailing lists

2008-11-03 Thread Robert Cummings
On Mon, 2008-11-03 at 09:37 -0500, Bill Guion wrote:
> At 11:00 AM -0400 11/1/08, tedd wrote:
> 
> 
> snip
> 
> >I used to have a theory that intelligence was inversely proportional 
> >to latitude. To prove my point, I would direct people to observe the 
> >Upper Peninsula of Michigan, where phrases like "Say ya to da UP, 
> >eh?" were common.
> >
> >When confronted with an discerning opinion, I would add even more 
> >evidence by telling them to look further north where pronunciation 
> >of "about" and "a boot" merged -- and thus that would usually win my 
> >argument.
> >
> >Now, that I am confronted with such a wide latitude (in both 
> >meanings) of diverse opinion, I must conclude that intelligence and 
> >ignorance are both amply distributed all over the globe irrespective 
> >of one's shortcomings in language skills -- thank God.
> >
> >Cheers,
> >
> >tedd
> >
> 
> I don't know, tedd. I believe it was my college physics instructor 
> who taught us that the two most abundant elements in the universe are 
> hydrogen and stupidity.

Bah... everyone worth their salt knows the most abundant stuff in the
universe is dark matter. Some people just have too much dark matter in
place of gray matter.

Cheer,
Rob.
-- 
http://www.interjinn.com
Application and Templating Framework for PHP


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



[PHP] proc_open and sockets

2008-11-03 Thread man_in_the_middle

I'm trying to build an interface in PHP to open prolog and feed it commands
and return answers without shutting it down. (I think you'd call this
running prolog as a daemon) The code below does two things. It opens prolog,
feeds in commands and pulls out the answers then closes the prolog. It then
opens a socket and listens for commands and prints out the command that was
sent until an 'END'  command is sent. However, if you try to do it in this
order... 

Open prolog
Open socket
while (command not 'END')
   Listen for commands
   Send command to prolog
   Return answers down socket
Close socket
Close prolog

It just hangs, won't open the socket unless prolog is closed. Does anyone
know loads about sockets and processes who have any ideas why that happens?
The below code works but not how I want it to.

 array("pipe", "r"),  
   1 => array("pipe", "w"),
   2 => array("pipe", "w") 
);

$cwd = null;
$env = array('options'=>'');

$process = proc_open('swipl', $descriptorspec, $pipes, $cwd, $env);

if (is_resource($process)) {

fwrite($pipes[0], " ['/var/www/dev/tools/e2et'].");
fflush($pipes[2]);
fread($pipes[2],1024);
fwrite($pipes[0], " skip(1).");
fflush($pipes[2]);
$data = fread($pipes[2],1024);

fclose($pipes[0]);
fclose($pipes[1]);
fclose($pipes[2]);
proc_close($process); 

echo $data . "";

$socket = socket_create(AF_INET, SOCK_STREAM, 0) or die("Could not create
socket\n");
$result = socket_bind($socket, '127.0.0.1', 9993) or die("Could not bind to
socket\n");
$result = socket_listen($socket, 5) or die("Could not set up socket
listener\n");
$spawn = socket_accept($socket) or die("Could not accept incoming
connection\n");

do {
$input = socket_read($spawn, 8, PHP_NORMAL_READ) or
die(socket_close($spawn));
if (trim($input) == "END"){
socket_close($spawn);
break;
}
else {
echo $input;
}

} while (true);
socket_close($socket);

}
?>


I guess you're wondering why I'm bothering - it's just to avoid having to
recompile the prolog code that I want to run each time I want to query it
via a web server.
-- 
View this message in context: 
http://www.nabble.com/proc_open-and-sockets-tp20305352p20305352.html
Sent from the PHP - General mailing list archive at Nabble.com.


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



Re: [PHP] take me off the list

2008-11-03 Thread Jim Lucas
Daniel P. Brown wrote:
> On Mon, Nov 3, 2008 at 4:36 AM, Stut <[EMAIL PROTECTED]> wrote:
>> You're having an identity crisis. Your email came from Deborah.Dennison@ but
>> you state your email address as...
>>
>>> email: [EMAIL PROTECTED]
> 
> I had noticed the same thing.  I unsubscribed her from the list
> right after she wrote that first message, and haven't heard back
> since.  So that was most likely the case.
> 

You keep doing things for people, they are never going to learn... :)

-- 
Jim Lucas

   "Some men are born to greatness, some achieve greatness,
   and some have greatness thrust upon them."

Twelfth Night, Act II, Scene V
by William Shakespeare


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



Re: [PHP] take me off the list

2008-11-03 Thread Daniel P. Brown
On Mon, Nov 3, 2008 at 11:09 AM, Jim Lucas <[EMAIL PROTECTED]> wrote:
>
> You keep doing things for people, they are never going to learn... :)

True, but sometimes it's easier just to help someone along.  She
mentioned that she'd tried several times, so it doesn't hurt for me to
take a few seconds to click a link.

-- 

http://www.parasane.net/
[EMAIL PROTECTED] || [EMAIL PROTECTED]
Ask me about our current hosting/dedicated server deals!

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



Re: [PHP] take me off the list

2008-11-03 Thread Daniel P. Brown
On Mon, Nov 3, 2008 at 11:10 AM, Robert Cummings <[EMAIL PROTECTED]> wrote:
>
> Give a man some fish, he'll be back later for more!

Tell a man about your shortbread and he'll stay on your ass until
he gets the recipe, too.  Funny how it all works out, eh?

-- 

http://www.parasane.net/
[EMAIL PROTECTED] || [EMAIL PROTECTED]
Ask me about our current hosting/dedicated server deals!

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



RE: [PHP] Problems with images..

2008-11-03 Thread Boyd, Todd M.
> -Original Message-
> From: Anders Norrbring [mailto:[EMAIL PROTECTED]
> Sent: Monday, November 03, 2008 8:56 AM
> To: Boyd, Todd M.
> Cc: php-general@lists.php.net
> Subject: SV: [PHP] Problems with images..
> 
> > > I've been staring myself blind, so now I don't get anywhere,
please
> > do
> > > advice..
> > >
> > > I have a web page printed with PHP, in a table I need to display
> > images
> > > that
> > > are stored in a SQL DB.
> > > Getting the images into variables isn't an issue at all, but how
do
> I
> > > output
> > > it?
> > > This is what I want to accomplish:
> > >
> > > Current image: - THE IMAGE HERE - 
> > >
> > > Starting to pull my hair..
> >
> > Current image: > />
> >
> > If you don't have the proper INI setting to allow for the short-hand
> >  > ?>, you can replace it with:
> >
> > 
> >
> > If this made you pull your hair out, then perhaps you should go back
> > and
> > get a fundamental understanding of HTML and PHP basics before trying
> to
> > combine the two. Just sayin'.
> 
> 
> Thank you for your wonderful sarcasm Todd. But the solution you
suggest
> just
> won't work, and as a programmer, you should be just about
knowledgeable
> enough to know that.
> 
> However, I got a tip about something that WILL work, so I prefer to
> listen
> to that person instead. She said;
> 
> 
>ob_start();
>   echo $info['image'];
>   $data = base64_encode(ob_get_contents());
>   ob_end_clean();
>   echo "";
> ?>
> 

I was, in fact, NOT being sarcastic. Perhaps if you had been more
specific about "images in variables" (it looks like you're using BLOBs,
I had guessed you were using filenames and storing the images on disk...
which is another argument altogether), my answer (or sarcasm, in your
eyes) would have been more direct to your question.

As for my solution not working--for BLOBs, no. Of course not. My analogy
of your question, however, is a bit like this:

Q: "How do I turn on this light switch?"
A: "You flip it to the 'on' position."
...
Q: "No, I mean how do I route power from the solar panels on my roof to
produce a current that will be affected by this lightswitch?"

I don't see the reason for Base64 encoding anything, but I'm glad (also
not sarcastic) that you got the answer to your question that you were
looking for.

I also hope that you learned to be more specific when you're requesting
assistance, and not throwing someone's suggestions back in their face
when they were just trying to lend you a hand with what they understood
your question to be.


Todd Boyd
Web Programmer

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



Re: [PHP] Mailing lists

2008-11-03 Thread Daniel P. Brown
On Mon, Nov 3, 2008 at 11:03 AM, Robert Cummings <[EMAIL PROTECTED]> wrote:
>
> Bah... everyone worth their salt knows the most abundant stuff in the
> universe is dark matter. Some people just have too much dark matter in
> place of gray matter.

Dark matter, grey matter, fecal matter, it doesn't matter.

-- 

http://www.parasane.net/
[EMAIL PROTECTED] || [EMAIL PROTECTED]
Ask me about our current hosting/dedicated server deals!

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



[PHP] Sending mail with Outlook high priority

2008-11-03 Thread Edward Diener
Is there any PHP functionality for sending mail and attaching a high 
priority to the mail item ?


In Outlook ( and Outlook Express ) there is the notion of a high 
priority mail item, but I do not know if this corresponds to anything in 
an RFC for mail. Nor do I know how to mimic this in PHP. If anybody does 
or could point me to the right functionality, it would be appreciated. 
Currently I am using the mail() function that is standard in PHP.


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



Re: [PHP] Sending mail with Outlook high priority

2008-11-03 Thread Per Jessen
Edward Diener wrote:

> Is there any PHP functionality for sending mail and attaching a high
> priority to the mail item ?

printf() ? 

All you need to do is a add header like "X-Priority: High".  It's just a
line of text.

> In Outlook ( and Outlook Express ) there is the notion of a high
> priority mail item, but I do not know if this corresponds to anything
> in an RFC for mail. 

Not too my knowledge.  It's a Microsoft "standard". 


/Per Jessen, Zürich


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



Re: [PHP] take me off the list

2008-11-03 Thread Govinda

On Nov 3, 2008, at 6:37 AM, Jochem Maas wrote:



Sort out who you are
and the world might start to make sense.


that deserve's it's own T-shirt :)


-Stut


LOL!
:-)
That knowledge has earned more than a T-shirt!  It is Eternal; written  
in modern and ancient scripture since time immemorial.


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



Re: [PHP] Mailing lists

2008-11-03 Thread Dotan Cohen
2008/11/3 Daniel P. Brown <[EMAIL PROTECTED]>:
>Dark matter, grey matter, fecal matter, it doesn't matter.
>

It's all mind over matter. I've got no mind, and it doesn't seem to matter.

-- 
Dotan Cohen

http://what-is-what.com
http://gibberish.co.il
א-ב-ג-ד-ה-ו-ז-ח-ט-י-ך-כ-ל-ם-מ-ן-נ-ס-ע-ף-פ-ץ-צ-ק-ר-ש-ת

ä-ö-ü-ß-Ä-Ö-Ü


Re: [PHP] Mailing lists

2008-11-03 Thread Bill Guion

At 11:00 AM -0400 11/1/08, tedd wrote:


snip

I used to have a theory that intelligence was inversely proportional 
to latitude. To prove my point, I would direct people to observe the 
Upper Peninsula of Michigan, where phrases like "Say ya to da UP, 
eh?" were common.


When confronted with an discerning opinion, I would add even more 
evidence by telling them to look further north where pronunciation 
of "about" and "a boot" merged -- and thus that would usually win my 
argument.


Now, that I am confronted with such a wide latitude (in both 
meanings) of diverse opinion, I must conclude that intelligence and 
ignorance are both amply distributed all over the globe irrespective 
of one's shortcomings in language skills -- thank God.


Cheers,

tedd



I don't know, tedd. I believe it was my college physics instructor 
who taught us that the two most abundant elements in the universe are 
hydrogen and stupidity.


 -= Bill =-
--

"Half this game is ninety percent mental."
  -Philadelphia Phillies manager Danny Ozark
  



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



Re: [PHP] Mailing lists

2008-11-03 Thread Robert Cummings
On Mon, 2008-11-03 at 19:24 +0200, Dotan Cohen wrote:
> 2008/11/3 Daniel P. Brown <[EMAIL PROTECTED]>:
> >Dark matter, grey matter, fecal matter, it doesn't matter.
> >
> 
> It's all mind over matter. I've got no mind, and it doesn't seem to matter.

Hmmm... you sure it's not a case of you have no matter and you don't
really mind?

Cheers,
Rob.
-- 
http://www.interjinn.com
Application and Templating Framework for PHP


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



Re: [PHP] Sending mail with Outlook high priority

2008-11-03 Thread Edward Diener

Per Jessen wrote:

Edward Diener wrote:


Is there any PHP functionality for sending mail and attaching a high
priority to the mail item ?


printf() ? 


All you need to do is a add header like "X-Priority: High".  It's just a
line of text.


Thanks for pointing this header out. My search for "X-Priority" yields:

"X-Priority: 1"

or

"X-Priority: 1 (High)"

as the correct format(s).




In Outlook ( and Outlook Express ) there is the notion of a high
priority mail item, but I do not know if this corresponds to anything
in an RFC for mail. 


Not too my knowledge.  It's a Microsoft "standard". 


Well the X-Priority may do.

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



Re: [PHP] Sending mail with Outlook high priority

2008-11-03 Thread Edward Diener

Per Jessen wrote:

Edward Diener wrote:


Is there any PHP functionality for sending mail and attaching a high
priority to the mail item ?


printf() ? 


All you need to do is a add header like "X-Priority: High".  It's just a
line of text.


Thanks for pointing this header out. My search for "X-Priority" yields:

"X-Priority: 1"

or

"X-Priority: 1 (High)"

as the correct format(s).




In Outlook ( and Outlook Express ) there is the notion of a high
priority mail item, but I do not know if this corresponds to anything
in an RFC for mail. 


Not too my knowledge.  It's a Microsoft "standard". 


Well the X-Priority may do.

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



[PHP] Mail Function

2008-11-03 Thread Will W
Hello all,I did a search and did not find anything I was looking for.

What is the limitation of the max emails that the mail function can send to?

Thanks,
Will


Re: [PHP] take me off the list

2008-11-03 Thread Robert Cummings
On Mon, 2008-11-03 at 08:09 -0800, Jim Lucas wrote:
> Daniel P. Brown wrote:
> > On Mon, Nov 3, 2008 at 4:36 AM, Stut <[EMAIL PROTECTED]> wrote:
> >> You're having an identity crisis. Your email came from Deborah.Dennison@ 
> >> but
> >> you state your email address as...
> >>
> >>> email: [EMAIL PROTECTED]
> > 
> > I had noticed the same thing.  I unsubscribed her from the list
> > right after she wrote that first message, and haven't heard back
> > since.  So that was most likely the case.
> > 
> 
> You keep doing things for people, they are never going to learn... :)

Give a man some fish, he'll be back later for more!

Cheers,
Rob.
-- 
http://www.interjinn.com
Application and Templating Framework for PHP


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



Re: [PHP] Mail Function

2008-11-03 Thread Daniel P. Brown
On Mon, Nov 3, 2008 at 12:56 PM, Will W <[EMAIL PROTECTED]> wrote:
>
> What is the limitation of the max emails that the mail function can send to?

That's limited by three things:

1.) Server resource availability (RAM, CPU, bandwidth).
2.) Server configuration.
3.) Your ISP (some, such as GoDaddy, have a cap each month).

-- 

http://www.parasane.net/
[EMAIL PROTECTED] || [EMAIL PROTECTED]
Ask me about our current hosting/dedicated server deals!

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



Re: [PHP] Mail Function

2008-11-03 Thread Andrew Ballard
On Mon, Nov 3, 2008 at 1:19 PM, Daniel P. Brown
<[EMAIL PROTECTED]> wrote:
> On Mon, Nov 3, 2008 at 12:56 PM, Will W <[EMAIL PROTECTED]> wrote:
>>
>> What is the limitation of the max emails that the mail function can send to?
>
>That's limited by three things:
>
>1.) Server resource availability (RAM, CPU, bandwidth).
>2.) Server configuration.
>3.) Your ISP (some, such as GoDaddy, have a cap each month).

Most shared hosting plans I've tried have a limit per hour.

Andrew

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



[PHP] COM and VARIANT types

2008-11-03 Thread Alex Bovey
Hi,

I am playing around with some COM interfaces and getting my head
around VARIANTs.

I have a method that is returning a VARIANT and using variant_get_type
returns the type as 9.  How do I find out what type 9 relates to?  The
manual page for variant_get_type isn't much...

Thanks all,

Alex

--
Alex Bovey
Web Developer | Alex Bovey Consultancy Ltd
Registered in England & Wales no. 6471391 | VAT no. 934 8959 65
PHP | MySQL | AJAX | XHTML | CSS | Javascript | XML | W3C Accessibility

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



[PHP] OT? my own posts are invisible to me. How to decloak?

2008-11-03 Thread Govinda

Hi all

this may be a matter of settings on my own software, and so OT for  
this list, but I have sincerely looked more than once and still can't  
find it, so I ask?


Does anyone know why can't I ever see my own posts to this list (or  
another list I subscribe to)?  I want to.


-Govinda

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



Re: [PHP] OT? my own posts are invisible to me. How to decloak?

2008-11-03 Thread Andrew Ballard
On Mon, Nov 3, 2008 at 1:33 PM, Govinda <[EMAIL PROTECTED]> wrote:
> Hi all
>
> this may be a matter of settings on my own software, and so OT for this
> list, but I have sincerely looked more than once and still can't find it, so
> I ask?
>
> Does anyone know why can't I ever see my own posts to this list (or another
> list I subscribe to)?  I want to.
>
> -Govinda

You're using Gmail. They won't be visible (in your Inbox) until
someone replies to them. They should be in your Sent Mail folder
though.

Andrew

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



Re: [PHP] OT? my own posts are invisible to me. How to decloak?

2008-11-03 Thread Daniel Brown
On Mon, Nov 3, 2008 at 1:33 PM, Govinda <[EMAIL PROTECTED]> wrote:
> Hi all
>
> this may be a matter of settings on my own software, and so OT for this
> list, but I have sincerely looked more than once and still can't find it, so
> I ask?
>
> Does anyone know why can't I ever see my own posts to this list (or another
> list I subscribe to)?  I want to.

That's a combination of the list software configuration and Gmail.
 With some lists, unless you set your subscription (where applicable)
to send you a copy, it won't.  And as for Gmail, it keeps your posts
hidden until a thread is created by receiving a reply from someone.

You can, however, see your posts in the archives almost
instantaneously.  You can check the following links if you're ever
concerned that a message didn't get through to this list:

http://news.php.net/
http://marc.info/?l=php-general
(GMANE link would go here if GMANE wasn't down right now.)

-- 

http://www.parasane.net/
[EMAIL PROTECTED] || [EMAIL PROTECTED]
Ask me about our current hosting/dedicated server deals!

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



Re: [PHP] COM and VARIANT types

2008-11-03 Thread Andrew Ballard
On Mon, Nov 3, 2008 at 1:33 PM, Alex Bovey <[EMAIL PROTECTED]> wrote:
> Hi,
>
> I am playing around with some COM interfaces and getting my head
> around VARIANTs.
>
> I have a method that is returning a VARIANT and using variant_get_type
> returns the type as 9.  How do I find out what type 9 relates to?  The
> manual page for variant_get_type isn't much...
>
> Thanks all,
>
> Alex
>

I think this may be what you are looking for, but I don't know how
much it helps:

http://www.marin.clara.net/COM/variant_type_definitions.htm

Andrew

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



Re: SV: [PHP] Problems with images..

2008-11-03 Thread Ashley Sheridan
On Mon, 2008-11-03 at 15:56 +0100, Anders Norrbring wrote:
> > Anders Norrbring wrote:
> > 
> > > I've been staring myself blind, so now I don't get anywhere, please
> > do
> > > advice..
> > >
> > > I have a web page printed with PHP, in a table I need to display
> > > images that are stored in a SQL DB.
> > > Getting the images into variables isn't an issue at all, but how do I
> > > output it?
> > > This is what I want to accomplish:
> > >
> > > Current image: - THE IMAGE HERE - 
> > >
> > > Starting to pull my hair..
> > > Anders.
> > 
> > 
> > 
> > fetchimg.php:
> > 
> > header('Content-Type: image/jpeg');
> > $img=;
> > print $img;
> 
> 
> True Per, but I would prefer one single file in this case..
> 
> Anders.
> 
> 
You can have the image script as part of the same PHP file, by checking
to see if it is being called for an image rather than a normal page, but
it just makes things more convoluted. Also, the base64 method will not
work in IE. I had a similar problem at work that could only be solved by
using a separate script to output the image. It can't be streamed inline
in a consistent manner.


Ash
www.ashleysheridan.co.uk


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



Re: [PHP] OT? my own posts are invisible to me. How to decloak?

2008-11-03 Thread Govinda


   That's a combination of the list software configuration and Gmail.


Thanks a lot guys.

Looking forward to more interaction here in coming weeks as I  
gradually/hopefully shift more of my time into PHP from other software.

-G

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



Re: [PHP] take me off the list

2008-11-03 Thread Jay Moore

Daniel P. Brown wrote:

On Mon, Nov 3, 2008 at 11:10 AM, Robert Cummings <[EMAIL PROTECTED]> wrote:

Give a man some fish, he'll be back later for more!


Tell a man about your shortbread and he'll stay on your ass until
he gets the recipe, too.  Funny how it all works out, eh?



So, about that recipe...

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



Re: [PHP] Mailing lists

2008-11-03 Thread tedd

At 9:37 AM -0500 11/3/08, Bill Guion wrote:
I don't know, tedd. I believe it was my college physics instructor 
who taught us that the two most abundant elements in the universe 
are hydrogen and stupidity.



Good point.

The difference between stupidity and Genius is that one has its limits.

Cheers,

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] take me off the list

2008-11-03 Thread tedd

At 11:10 AM -0500 11/3/08, Robert Cummings wrote:

Give a man some fish, he'll be back later for more!



Yeah, but teach him to fish and you'll have to listen to all his fish stories.

Cheers,

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] Mailing lists

2008-11-03 Thread Daniel P. Brown
On Mon, Nov 3, 2008 at 4:11 PM, tedd <[EMAIL PROTECTED]> wrote:
>
> The difference between stupidity and Genius is that one has its limits.

Which is why it's always best to remember one thing, especially in
programming: never underestimate the power of stupidity.

-- 

http://www.parasane.net/
[EMAIL PROTECTED] || [EMAIL PROTECTED]
Ask me about our current hosting/dedicated server deals!

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



[PHP] Grouping records

2008-11-03 Thread Matthew Halpin


Hi,

I have transactional records with the following structure

Rowid   TimePerson  TimediffGroupid

1   20:22:49Bob
2   20:22:49Bob 0
3   20:22:50Bob 1   
4   20:22:55Bob 5
6   20:24:55Bob 120
7   20:24:56Bob 1
8   20:30:56Kevin   360
9   20:30:57Kevin   1
10  20:33:57Kevin   180

(hope the formatting turns out)

What I would like to do is update the Groupid column with a number
starting at zero and increment where the timediff is greater than 60,
also starting from 0 again when the Person changes. Ending up with the
below.

Rowid   TimePerson  TimediffGroupid

1   20:22:49Bob
0
2   20:22:49Bob 0
0
3   20:22:50Bob 1
0
4   20:22:55Bob 5
0
6   20:24:55Bob 120
1
7   20:24:56Bob 1
1
8   20:30:56Kevin   360
0
9   20:30:57Kevin   1
0
10  20:33:57Kevin   180
1

Anyone got any ideas?
There will usually be more the 2 different people (number of people can
differ)
The number of groups can and will vary per person.

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