php-general Digest 2 Sep 2010 10:45:30 -0000 Issue 6922

2010-09-02 Thread php-general-digest-help

php-general Digest 2 Sep 2010 10:45:30 - Issue 6922

Topics (messages 307818 through 307821):

Re: require_once
307818 by: freeman3.centrum.cz

Re: error_log file error reporting level
307819 by: freeman3.centrum.cz

Re: Removing link on the fly, but leave link text
307820 by: Karl DeSaulniers

extract an image's elements by gd
307821 by: Tontonq Tontonq

Administrivia:

To subscribe to the digest, e-mail:
php-general-digest-subscr...@lists.php.net

To unsubscribe from the digest, e-mail:
php-general-digest-unsubscr...@lists.php.net

To post to the list, e-mail:
php-gene...@lists.php.net


--
---BeginMessage---
I think the files included just when you call it to include. How do you mean 
it later?
What's in that file? A class or direct code?

David Mehler wrote:

 Hello,
 I've got probably a simple question on require_once. I've got a file
 that has require_once at the top of it pulling in another file of
 functions. Later on in this file I've got another require_once
 bringing in a second file. In this second file I have a function call
 to a function defined in the first files' top require_once functions
 file. I'm getting a call to undefined function.
 Should I change he require_once to require at the top of the first
 file to fix? I thought require_once meant it was in that file and
 anything pulled in later?
 Thanks.
 Dave.

---End Message---
---BeginMessage---
I don't know that too.
I think the solution is to use your own error handler and save error in some 
another file.

hovnocuc wrote:

 Hello,
 
 [ Question ]
 How do I force error_log to log only errors specified in the
 error_reporting directive? Is it even possible or did I get something
 wrong? I have one old script which uses ereg and the awesome size of the
 error log is getting on my nerves.
 
 [ Current ini config ]
 error_reporting = E_ALL  ~E_DEPRECATED  ;;or E_ALL ^ E_DEPRECATED
 display_errors = Off
 log_errors = On
 error_log = /var/log/php-fpm/php-errors.log
 
 [ PHP ]
 5.3.3 + suhosin patch 5.3.3-0.9.10 + suhosin extension 0.9.32.1
 pecl: imagick-3.0.1RC1, APC-3.1.3p1, geoip-1.0.7, rar-2.0.0
 php configure: in the appendix
 
 [ Expected result ]
 php-errors.log containing all errors EXCEPT deprecated notices
 
 [ Actual result ]
 
  PHP Deprecated:  Function ereg() is deprecated in ...
 
 
 [ Notes ]
 I know which ini php loads, so yeah.. I'm actually using the same that
 I'm configuring.
 I'm not using syslog, but a file. See Current ini config above.
 
 
 Thank you for your time.
 
 [ Appendix ]
 ../configure --prefix=/usr --enable-fpm --disable-rpath --with-pear
 --disable-debug --with-openssl --with-pcre-regex --with-zlib
 --enable-bcmath --with-bz2 --enable-calendar --with-curl --enable-exif
 --enable-inline-optimization --with-gd --with-jpeg-dir --with-png-dir
 --with-freetype-dir --with-gettext --with-imap --with-imap-ssl
 --with-kerberos --enable-mbstring --enable-mbregex --with-mcrypt
 --with-mysql --with-mysqli --enable-pdo --with-pdo-mysql
 --with-pdo-pgsql --with-pgsql --enable-shmop --enable-soap
 --enable-sockets --enable-sqlite-utf8 --enable-sysvmsg --enable-sysvsem
 --enable-sysvshm --with-tidy --enable-wddx --with-xmlrpc --with-xsl
 --enable-zip --enable-ftp --enable-dom --enable-xmlwriter
 --enable-xmlreader --enable-tokenizer --enable-simplexml
 --enable-session --enable-posix --enable-phar --enable-libxml
 --enable-json --with-iconv --enable-filter --enable-fileinfo
 --enable-ctype

---End Message---
---BeginMessage---


On Aug 31, 2010, at 3:06 PM, Ashley Sheridan wrote:


On Tue, 2010-08-31 at 15:01 -0500, Karl DeSaulniers wrote:


On Aug 31, 2010, at 2:32 PM, Ashley Sheridan wrote:

 On Tue, 2010-08-31 at 14:31 -0500, Karl DeSaulniers wrote:

 Hi,
 Say I have some text.

 $text = 'You can logon here: a href=http://website.com/shop/
 index.php?username='.$username.'http://website.com/shop/ 
index.php?

 username='.$username.'/a. This link will take you to your web
 browser to login.'.$eol;

 I want to be able to strip the a href=http://website.com/shop/
 index.php?username='.$username.' and /a.
 Leaving just the http://website.com/shop/index.php?username='.
 $username.' text, so it would end up like.


 $text = 'You can logon here: http://website.com/shop/index.php?
 username='.$username.'. This link will take you to your web  
browser

 to login.'.$eol;

 I have tried MANY different ways and have no success.
 Can anyone help me?
 TIA


 Karl DeSaulniers
 Design Drumm
 http://designdrumm.com


 strip_tags() will do the job here.

 Thanks,
 Ash
 http://www.ashleysheridan.co.uk



Hi Ash,
I tried that, but it did not work.
I do not want it to strip all tags, just the a href=/a. so if
there was a p or br /. I don't want those removed.
There is more text than just what I posted.

This is what I am trying currently.
This is someones code from a forum that I am trying to 

[PHP] extract an image's elements by gd

2010-09-02 Thread Tontonq Tontonq
Hi!
as first i want you look at this image http://i56.tinypic.com/2zic001.png

i can read all pixels , make picture black and white,add length of black
pixel's to array like (from 300x 20y to 320x to 20y).

I can dump coordinates blue square as easily but i cant say this for yellow
ellipse.

So there are 2 questions
How can i export an image's a part that i know x,y coordinates and save it
as image
All of you should know mspaint's free-form select,for able to export yellow
ellipse i will need something like that so how can i export an image's a
part like at mspaint's free-form select function

are these possible with gd library?


Re: [PHP] Re: require_once

2010-09-02 Thread Jangita

On 01/09/2010 10:56 p, freem...@centrum.cz wrote:

I think the files included just when you call it to include. How do you mean
it later?
What's in that file? A class or direct code?

David Mehler wrote:


Hello,
I've got probably a simple question on require_once. I've got a file
that has require_once at the top of it pulling in another file of
functions. Later on in this file I've got another require_once
bringing in a second file. In this second file I have a function call
to a function defined in the first files' top require_once functions
file. I'm getting a call to undefined function.
Should I change he require_once to require at the top of the first
file to fix? I thought require_once meant it was in that file and
anything pulled in later?
Thanks.
Dave.





If i get you correctly

file1.php has a require_once to file2.php
then file 1.php has a require_once to file3.php
but file3.php calls a function in file2.php

answer would be to require_onec file2.php in file3.php

or?

--
Jangita | +256 76 91 8383 | Y!  MSN: jang...@yahoo.com
Skype: jangita | GTalk: jangita.nyag...@gmail.com

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



Re: [PHP] Re: require_once

2010-09-02 Thread Peter Lind
On 2 September 2010 12:55, Jangita jang...@jangita.com wrote:
 On 01/09/2010 10:56 p, freem...@centrum.cz wrote:

 I think the files included just when you call it to include. How do you
 mean
 it later?
 What's in that file? A class or direct code?

 David Mehler wrote:

 Hello,
 I've got probably a simple question on require_once. I've got a file
 that has require_once at the top of it pulling in another file of
 functions. Later on in this file I've got another require_once
 bringing in a second file. In this second file I have a function call
 to a function defined in the first files' top require_once functions
 file. I'm getting a call to undefined function.
 Should I change he require_once to require at the top of the first
 file to fix? I thought require_once meant it was in that file and
 anything pulled in later?
 Thanks.
 Dave.



 If i get you correctly

 file1.php has a require_once to file2.php
 then file 1.php has a require_once to file3.php
 but file3.php calls a function in file2.php

 answer would be to require_onec file2.php in file3.php

Which wouldn't do anything seeing as file2.php has already been
included by file1.php.

Regards
Peter

-- 
hype
WWW: http://plphp.dk / http://plind.dk
LinkedIn: http://www.linkedin.com/in/plind
BeWelcome/Couchsurfing: Fake51
Twitter: http://twitter.com/kafe15
/hype

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



Re: [PHP] Re: require_once

2010-09-02 Thread Jangita

On 02/09/2010 12:59 p, Peter Lind wrote:

Which wouldn't do anything seeing as file2.php has already been
included by file1.php.
Amazing! I didn't think that once you include a file; any other file 
included also includes any earlier included files (if that makes any sence)


I've always thought includes are local; I.e in order to use a function 
from another file explicitly include that other file.


--
Jangita | +256 76 91 8383 | Y!  MSN: jang...@yahoo.com
Skype: jangita | GTalk: jangita.nyag...@gmail.com

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



[PHP] DICOM and PHP

2010-09-02 Thread Juan Rodríguez Monti
Hi guys,
I would like to develop an Application in PHP to manage DICOM images. The
idea is that the application should be able to receive images from different
devices connected through a local switch.
The application should act as a server, always listening, and then when some
of the devices send an image, receive it, and also the app should know who
sent the image, receive some data, and so on.
Of course, also the App should be able to show the images, store them
locally o remotely, print them, and other activities.

AFAIK, PHP has some implementations to work with DICOM to work with the
images, sort them, print them, and so on. However, I think PHP doesnt
support sending and receiving DICOM images through network. And the App do
need to do this.

Do you know something that might be useful for this Project?, or even
better: do you have any experience working with an application like this
one?.

Best,
Juan


[PHP] HTTPS SSL

2010-09-02 Thread Jordan Jovanov

Hello everybody

I need me a little help.
I have one web page with hhtp protocol, but i need to change in https.
Somebody tell me that I need to create some SSL certificate.
I  use some Apache server.
Do you somebody know does is easy and can i do?
Does need to write some php scripts or anything?

Thanks a lot.

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



Re: [PHP] Re: require_once

2010-09-02 Thread Peter Lind
On 2 September 2010 13:20, Jangita jang...@jangita.com wrote:
 On 02/09/2010 12:59 p, Peter Lind wrote:

 Which wouldn't do anything seeing as file2.php has already been
 included by file1.php.

 Amazing! I didn't think that once you include a file; any other file
 included also includes any earlier included files (if that makes any sence)

 I've always thought includes are local; I.e in order to use a function from
 another file explicitly include that other file.

You're thinking about it from the wrong perspective. It's not a
question of a file including another file into it's own space, it's a
question of scope. If you're in the global scope, any file included
will get included into the global scope. If you're in a local scope
however, then other rules apply: variables in the file (that would
normally be in the global scope if you just executed the file) will be
in the local scope only, while classes and functions in the included
file will be imported into the global scope.

Also, require_once will require a file once only. Using it to require
the same file again from anywhere else will fail to include the file -
that's the whole point of _once.

Regards
Peter

-- 
hype
WWW: http://plphp.dk / http://plind.dk
LinkedIn: http://www.linkedin.com/in/plind
BeWelcome/Couchsurfing: Fake51
Twitter: http://twitter.com/kafe15
/hype

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



Re: [PHP] HTTPS SSL

2010-09-02 Thread Bostjan Skufca
You should look up something like openssl how to create self signed
certificate on google. Once cert is created, you should look up apache ssl
howto. The rest is just following instructions intelligently. Or use a
consulting company.

b.

PS: This has nothing to do with PHP, in case you haven't noticed :)


On 2 September 2010 13:51, Jordan Jovanov jovanovj...@gmail.com wrote:

 Hello everybody

 I need me a little help.
 I have one web page with hhtp protocol, but i need to change in https.
 Somebody tell me that I need to create some SSL certificate.
 I  use some Apache server.
 Do you somebody know does is easy and can i do?
 Does need to write some php scripts or anything?

 Thanks a lot.

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




Re: [PHP] problem retrieving variables.

2010-09-02 Thread Jim Lucas
Paul Halliday wrote:
 I think I just might be missing the logic here.
 
 I have a page that is created and within this page, I include an
 iframe like this:
 
 $qp = urlencode($when $wFilter $aFilter);
 echo \rtrtd id=links colspan=2 style=\display:none; padding-left: 
 12px;\
   \rIFRAME id=\links-frame\ name=\links-frame\
 src=\edv.php?qp=$qp\ width=100% height=1000 frameborder=0
 scrolling=no/IFRAME
   \r/td
   \r/tr;
 
 When I call edv.php though, I can't $qp = $_REQUEST['qp'];
 
 What am I missing?
 
 Thanks.
 

Just below your urlencode() call in the parent script place echo $qp; to see if
the value is what you expect?

Then within edv.php add this

var_dump($_REQUEST);

and see if $_REQUEST['qp'] is there, and what it is.

Jim



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



Re: [PHP] problem retrieving variables.

2010-09-02 Thread Paul Halliday
On Thu, Sep 2, 2010 at 5:43 PM, Jim Lucas li...@cmsws.com wrote:
 Paul Halliday wrote:
 I think I just might be missing the logic here.

 I have a page that is created and within this page, I include an
 iframe like this:

 $qp = urlencode($when $wFilter $aFilter);
 echo \rtrtd id=links colspan=2 style=\display:none; padding-left: 
 12px;\
           \rIFRAME id=\links-frame\ name=\links-frame\
 src=\edv.php?qp=$qp\ width=100% height=1000 frameborder=0
 scrolling=no/IFRAME
           \r/td
           \r/tr;

 When I call edv.php though, I can't $qp = $_REQUEST['qp'];

 What am I missing?

 Thanks.


 Just below your urlencode() call in the parent script place echo $qp; to see 
 if
 the value is what you expect?

 Then within edv.php add this

 var_dump($_REQUEST);

 and see if $_REQUEST['qp'] is there, and what it is.

 Jim




I think I see what I am doing wrong..

...
createlink function up here then...

?php $qp = $_REQUEST['qp'];?
html
body
form id=edv method=post action=edv.php
table width=100% border=0 cellpadding=1 cellspacing=0trtd align=left
input onMouseOver=style.backgroundColor='#ff';
onMouseOut=style.backgroundColor='#DD'; id=links name=links
type=submit value=create link graph style=font-size: 9px; border:
none; border: .5pt solid #00; background:#DD;
/td
?php
echo $qp;
if ($_REQUEST['links']) {
CreateLink($qp);
}
?
/form
/body
/html

I can't do what I am trying to do. Do I need to put it in a hidden
field within the form and then re-request?

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



Re: [PHP] SSI not working on PHP files with Apache

2010-09-02 Thread Per Jessen
Michael Alaimo wrote:

 Does special configuration have to take place with PHP to let apache
 process server side include files that are HTML documents?
 

PHP doesn't care, but you will need to configure apache to do both SSI
and PHP processing. 



-- 
Per Jessen, Zürich (17.8°C)


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