php-general Digest 27 Apr 2010 04:54:58 -0000 Issue 6714

2010-04-26 Thread php-general-digest-help

php-general Digest 27 Apr 2010 04:54:58 - Issue 6714

Topics (messages 304619 through 304638):

Re: What's your game? (X-PHP)
304619 by: Dan Joseph
304620 by: Ashley Sheridan
304621 by: Dan Joseph
304623 by: Ashley Sheridan
304624 by: Dan Joseph
304626 by: Bob McConnell
304628 by: Williams, Dewey

Re: Weird problem with is_file()
304622 by: Michelle Konzack
304625 by: Peter Lind

Re: getting content exceprts from the database
304627 by: Nathan Rixham

Admin Panel Ebook
304629 by: Brandon Rampersad

Contact form
304630 by: Watson Blair
304631 by: Adam Richardson
304632 by: Dan Joseph
304633 by: Watson Blair
304634 by: Ashley Sheridan
304635 by: Watson Blair
304636 by: Brandon Rampersad

Re: CURL cannot connect to URL - IP address - after successful connection
304637 by: Tommy Pham

¡°Îå²½Á¬¹á¡±¹ÉȨ¼¤Àø·¨
304638 by: aopi

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---
On Mon, Apr 26, 2010 at 7:48 AM, Richard Quadling
rquadl...@googlemail.comwrote:

 On 25 April 2010 14:16, tedd t...@sperling.com wrote:
  What's your game?

 My wife and I play enjoy Baulder's Gate on the PS2 and I like the Lego
 (Star Wars, Batman, etc.) games on the PSP.

 The kids like to play Ice Age and Cars but crash a lot and end up
 shouting at each other.

Ice Age was a fine game!  I played that one a few years ago.  I'd like to
see another Diablo styled game come out in the modern setting.

-- 
-Dan Joseph

www.canishosting.com - Unlimited Hosting Plans start @ $3.95/month.  Promo
Code NEWTHINGS for 10% off initial order

http://www.facebook.com/canishosting
http://www.facebook.com/originalpoetry
---End Message---
---BeginMessage---
On Mon, 2010-04-26 at 12:41 -0400, Dan Joseph wrote:

 On Mon, Apr 26, 2010 at 7:48 AM, Richard Quadling
 rquadl...@googlemail.comwrote:
 
  On 25 April 2010 14:16, tedd t...@sperling.com wrote:
   What's your game?
 
  My wife and I play enjoy Baulder's Gate on the PS2 and I like the Lego
  (Star Wars, Batman, etc.) games on the PSP.
 
  The kids like to play Ice Age and Cars but crash a lot and end up
  shouting at each other.
 
 Ice Age was a fine game!  I played that one a few years ago.  I'd like to
 see another Diablo styled game come out in the modern setting.
 


Diablo 3 is out soon...

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


---End Message---
---BeginMessage---
On Mon, Apr 26, 2010 at 12:36 PM, Ashley Sheridan
a...@ashleysheridan.co.ukwrote:



 Diablo 3 is out soon...


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



oh cool, I did not realize.. have they set a release date yet?  I didn't see
one on gamestop.com...


-- 
-Dan Joseph

www.canishosting.com - Unlimited Hosting Plans start @ $3.95/month.  Promo
Code NEWTHINGS for 10% off initial order

http://www.facebook.com/canishosting
http://www.facebook.com/originalpoetry
---End Message---
---BeginMessage---
On Mon, 2010-04-26 at 12:48 -0400, Dan Joseph wrote:

 On Mon, Apr 26, 2010 at 12:36 PM, Ashley Sheridan
 a...@ashleysheridan.co.ukwrote:
 
 
 
  Diablo 3 is out soon...
 
 
Thanks,
  Ash
  http://www.ashleysheridan.co.uk
 
 
 
 oh cool, I did not realize.. have they set a release date yet?  I didn't see
 one on gamestop.com...
 
 


Not yet, but there's trailers on YouTube and it looks good so far. A few
more classes, different mobs, it looks good!

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


---End Message---
---BeginMessage---
On Mon, Apr 26, 2010 at 12:52 PM, Ashley Sheridan
a...@ashleysheridan.co.ukwrote:

 Not yet, but there's trailers on YouTube and it looks good so far. A few
 more classes, different mobs, it looks good!



The screenshots look great as well.  I am going to check YouTube for
trailers.  Maybe after they get Starcraft going they'll get this out.

-- 
-Dan Joseph

www.canishosting.com - Unlimited Hosting Plans start @ $3.95/month.  Promo
Code NEWTHINGS for 10% off initial order

http://www.facebook.com/canishosting
http://www.facebook.com/originalpoetry
---End Message---
---BeginMessage---
The last game I played was catch. My oldest grandson and I borrowed his
cousin's Harlem Globetrotters miniature basketball. I taught him how to
use spin to deflect the ball path when it bounced.

I actually don't recall the last time I played an electronic game.

Bob McConnell
---End Message---
---BeginMessage---
The only online games I play are Guild Wars and - now - Dungeons and
Dragons Online (FREE!).  I haven't played vgaplanets in ages - too few
servers to get a decent game. Not certain I can even install my original
3.5 inch disk anymore!


Re: [PHP] FPDF passing values into header and footer?

2010-04-26 Thread Angus Mann


- Original Message - 
From: Angus Mann angusm...@pobox.com

To: php-general php-general@lists.php.net
Sent: Monday, April 26, 2010 2:46 PM
Subject: [PHP] FPDF passing values into header and footer?


Hi all. Whilst this question relates to fpdf (www.fpdf.org) I think it 
really is a PHP question, because it involves passing values into classes 
and functions.


Here's the problem .. I need to pass a PHP variable like $number into the 
header of a PDF.

I have extended the FPDF class as follows

class PDF extends FPDF{
   function Header(){
   $this-SetFont('Arial','BU',12);
   $this-Cell(0,5,'User notes for invoice number '.$number,0,'1','L');
   }
}


I hate it when I ask a question prematurely, because I could have figured it 
out myself. Getter and Setter functions are the answer.


function setNumber($number){
   $this-number = $number;
}

$pdf-setNumber('12345');




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



Re: [PHP] Weird problem with is_file()

2010-04-26 Thread Peter Lind
On 25 April 2010 22:14, Michelle Konzack linux4miche...@tamay-dogan.net wrote:
 Hi,

 I have a code sniplet which does not work and I do not know why:

 8--
  $isfile=shell_exec(ls /tmp/tdphp-vserver/SESSION_ . 
 $_SERVER['REMOTE_ADDR'] . _ . $_COOKIE['VSERVER_AUTHUSER'] . _* |head 
 -n1);

  if (is_file($isfile)) {
 snip
 8--

 nothing special, and the file  is there, but the stuff with

    is_file($isfile)

 is not working...  If I enter the file in place of $isfile, then  it  is
 working.   Quoting of $isfile does not work too.

 What have a overseen?

var_dump($isfile);

Don't make assumptions of what the value is, just check it.

Regards
Peter


-- 
hype
WWW: http://plphp.dk / http://plind.dk
LinkedIn: http://www.linkedin.com/in/plind
Flickr: http://www.flickr.com/photos/fake51
BeWelcome: Fake51
Couchsurfing: Fake51
/hype

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



[PHP] Is the case of ?php important in any way?

2010-04-26 Thread Richard Quadling
Hi.

I've recently come across some third party code which uses ...

?PHP

as the PHP tag.

This is the first time I've seen PHP in upper case for the tag.

The code works in V5, so, from this, I can assume the tag is read case
insensitive.

Are there any issues with this when moving forward?

When Unicode support is re-committed to trunk, does case sensitivity
become part of this?

Regards,

Richard.

-- 
-
Richard Quadling
Standing on the shoulders of some very clever giants!
EE : http://www.experts-exchange.com/M_248814.html
EE4Free : http://www.experts-exchange.com/becomeAnExpert.jsp
Zend Certified Engineer : http://zend.com/zce.php?c=ZEND002498r=213474731
ZOPA : http://uk.zopa.com/member/RQuadling

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



RE: [PHP] CURL cannot connect to URL - IP address - after successful connection

2010-04-26 Thread Tommy Pham
 -Original Message-
 From: ioan...@btinternet.com [mailto:ioan...@btinternet.com]
 Sent: Sunday, April 25, 2010 6:18 AM
 To: php-general@lists.php.net
 Subject: [PHP] CURL cannot connect to URL - IP address - after successful
 connection
 
 I can return a target page - once, but then on refresh within a few hours
the
 script curl_error is that it cannot connect to the host and return is
empty.
 The target URL is an ip address, not a named url, so maybe it has
something
 to do with DNS.  I am on a shared server.  Any ideas on why this happens?
 
 John
 

Just to eliminate all possibilities, are you to open the same URL/URI in the
web pages repeatedly?  Also, what happens when you fake the user agent in
the web browser?  The target site may have some anti bot mechanism in place
to reduce stress/load on the server(s).

Regards,
Tommy


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



RE: [PHP] CURL cannot connect to URL - IP address - after successful connection

2010-04-26 Thread Tommy Pham
 -Original Message-
 From: Tommy Pham [mailto:tommy...@gmail.com]
 Sent: Monday, April 26, 2010 1:59 AM
 To: 'php-general@lists.php.net'
 Subject: RE: [PHP] CURL cannot connect to URL - IP address - after
successful
 connection
 
  -Original Message-
  From: ioan...@btinternet.com [mailto:ioan...@btinternet.com]
  Sent: Sunday, April 25, 2010 6:18 AM
  To: php-general@lists.php.net
  Subject: [PHP] CURL cannot connect to URL - IP address - after
  successful connection
 
  I can return a target page - once, but then on refresh within a few
  hours the script curl_error is that it cannot connect to the host and
return is
 empty.
  The target URL is an ip address, not a named url, so maybe it has
  something to do with DNS.  I am on a shared server.  Any ideas on why
this
 happens?
 
  John
 
 
 Just to eliminate all possibilities, are you to open the same URL/URI in
the
 web pages repeatedly?  Also, what happens when you fake the user agent in
 the web browser?  The target site may have some anti bot mechanism in
 place to reduce stress/load on the server(s).
 
 Regards,
 Tommy

One more thing, check it with cookies enabled/disabled in the web browser
too.


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



Re: [PHP] Weird problem with is_file()

2010-04-26 Thread Jan G.B.
2010/4/25 Michelle Konzack linux4miche...@tamay-dogan.net:
 Hi,

 I have a code sniplet which does not work and I do not know why:

 8--
  $isfile=shell_exec(ls /tmp/tdphp-vserver/SESSION_ . 
 $_SERVER['REMOTE_ADDR'] . _ . $_COOKIE['VSERVER_AUTHUSER'] . _* |head 
 -n1);


Hi Michelle,
I would recommend not to let any user input to your shell. This piece
of code is very insecure as any client may manipulate the shell
command at will.
You don't want people to take over your server that easily.

See http://www.php.net/escapeshellcmd and alike.

Regards

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



[PHP] getting content exceprts from the database

2010-04-26 Thread Ashley Sheridan
I've been thinking about this problem for a little while, and the thing
is, I can think of ways of doing it, but they're not very nice, and I
don't think they're going to be fast.

Basically, I have a load of HTML formatted content in a database that
get displayed onto the site. It's part of a rudimentary CMS.

Currently, the titles for each article are displayed on a page, and each
title links to the full article. However, that leaves me with a page
which is essentially a list of links, and that's not ideal for SEO. What
I wanted to do to enhance the page is to have a short excerpt of x
number of words/characters beneath each article title. The idea being
that search engines will find the page as more than a link farm, and
visitors won't have to just rely on the title alone for the content.

Here's the rub though. As the content is in HTML form, I can't just grab
the first 100 characters and display them as that could leave an open
tag  without a closing one, potentially breaking the page. I could use
strip_tags on the 100-character excerpt, but what if the excerpt itself
broke a tag in half (i.e. acronym title=something could become
acron )

The only solutions I can see are:


  * retrieve the entire article, perform a strip_tags and then take
the excerpt
  * use a regex inside of mysql to pull out only the text


The thing is, neither of these seems particularly pretty, and I am sure
there's a better way, but it's too early in the week for my brain to be
fully functional I think!

Does anyone have any ideas about what I could do, or do you think I'm
seeing problems where there are none?

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




[PHP] LDAP import a csv file from php

2010-04-26 Thread Manolis Vlachakis
Hallo there everyone..
first thing first i would like to thank
everyone for the help that this mailing list has provided me
throughout my project..
i have found many answers and got me out of black point many times!!!

now i am on my last step on my project
and i would like to see if there are any ideas on how to import a csv file
in my ldap server
via php


thank you again

-- 
Manolis Vlachakis


Re: [PHP] CURL cannot connect to URL - IP address - after successful connection

2010-04-26 Thread ioan...@btinternet.com




Just to eliminate all possibilities, are you to open the same URL/URI in

the

web pages repeatedly?  Also, what happens when you fake the user agent in
the web browser?  The target site may have some anti bot mechanism in
place to reduce stress/load on the server(s).

Regards,
Tommy


One more thing, check it with cookies enabled/disabled in the web browser
too.




Having deleted cookies on the browser and disabled them, it still does 
not like various user agents:


	$useragent = array('Mozilla','Opera','Microsoft Internet 
Explorer','ia_archiver');
	$os = array('Windows','Windows XP','Linux','Windows NT','Windows 
2000','OSX');

//random user agent code
	$agent = $useragent[rand(0,3)].'/'.rand(1,8).'.'.rand(0,9).' 
('.$os[rand(0,5)].' '.rand(1,7).'.'.rand(0,9).'; en-US;)';

//would give something like Mozilla/3.5 (Windows 5.4; en-US;)

-- OR --

	//$useragent='Google Image - Googlebot-Image/1.0 ( 
http://www.googlebot.com/bot.html)';
	//$useragent=MSN Live - msnbot-Products/1.0 
(+http://search.msn.com/msnbot.htm);


--  OR --
	//$agent = DocZilla/1.0 (Windows; U; WinNT4.0; en-US; rv:1.0.0) 
Gecko/20020804;


I am just calling the page manually, once at a time.  It is probable 
that there is some anti-bot measures.  Page would probably not want to 
be indexed as it is providing ever changing content.  How to use this 
for normal level of use for real user just in a different site?


John

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



Re: [PHP] CURL cannot connect to URL - IP address - after successful connection

2010-04-26 Thread Ashley Sheridan
On Mon, 2010-04-26 at 12:05 +0900, ioan...@btinternet.com wrote:

 
  Just to eliminate all possibilities, are you to open the same URL/URI in
  the
  web pages repeatedly?  Also, what happens when you fake the user agent in
  the web browser?  The target site may have some anti bot mechanism in
  place to reduce stress/load on the server(s).
 
  Regards,
  Tommy
 
  One more thing, check it with cookies enabled/disabled in the web browser
  too.
 
 
 
 Having deleted cookies on the browser and disabled them, it still does 
 not like various user agents:
 
   $useragent = array('Mozilla','Opera','Microsoft Internet 
 Explorer','ia_archiver');
   $os = array('Windows','Windows XP','Linux','Windows NT','Windows 
 2000','OSX');
   //random user agent code
   $agent = $useragent[rand(0,3)].'/'.rand(1,8).'.'.rand(0,9).' 
 ('.$os[rand(0,5)].' '.rand(1,7).'.'.rand(0,9).'; en-US;)';
   //would give something like Mozilla/3.5 (Windows 5.4; en-US;)
   
 -- OR --
 
   //$useragent='Google Image - Googlebot-Image/1.0 ( 
 http://www.googlebot.com/bot.html)';
   //$useragent=MSN Live - msnbot-Products/1.0 
 (+http://search.msn.com/msnbot.htm);
 
 --  OR --
   //$agent = DocZilla/1.0 (Windows; U; WinNT4.0; en-US; rv:1.0.0) 
 Gecko/20020804;
 
 I am just calling the page manually, once at a time.  It is probable 
 that there is some anti-bot measures.  Page would probably not want to 
 be indexed as it is providing ever changing content.  How to use this 
 for normal level of use for real user just in a different site?
 
 John
 


How frequently do you request the page? Maybe playing about with that
would resolve it? Is it possible to randomise the request frequency a
bit?

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




Re: [PHP] getting content exceprts from the database

2010-04-26 Thread Peter Lind
On 26 April 2010 12:52, Ashley Sheridan a...@ashleysheridan.co.uk wrote:
 I've been thinking about this problem for a little while, and the thing
 is, I can think of ways of doing it, but they're not very nice, and I
 don't think they're going to be fast.

 Basically, I have a load of HTML formatted content in a database that
 get displayed onto the site. It's part of a rudimentary CMS.

 Currently, the titles for each article are displayed on a page, and each
 title links to the full article. However, that leaves me with a page
 which is essentially a list of links, and that's not ideal for SEO. What
 I wanted to do to enhance the page is to have a short excerpt of x
 number of words/characters beneath each article title. The idea being
 that search engines will find the page as more than a link farm, and
 visitors won't have to just rely on the title alone for the content.

 Here's the rub though. As the content is in HTML form, I can't just grab
 the first 100 characters and display them as that could leave an open
 tag  without a closing one, potentially breaking the page. I could use
 strip_tags on the 100-character excerpt, but what if the excerpt itself
 broke a tag in half (i.e. acronym title=something could become
 acron )

 The only solutions I can see are:


      * retrieve the entire article, perform a strip_tags and then take
        the excerpt
      * use a regex inside of mysql to pull out only the text


 The thing is, neither of these seems particularly pretty, and I am sure
 there's a better way, but it's too early in the week for my brain to be
 fully functional I think!

 Does anyone have any ideas about what I could do, or do you think I'm
 seeing problems where there are none?

Use htmltidy or htmlpurifier to clean up things. I.e. grab the amount
of content you want, then use one of the tools to repair and clean the
html.

Regards
Peter

-- 
hype
WWW: http://plphp.dk / http://plind.dk
LinkedIn: http://www.linkedin.com/in/plind
Flickr: http://www.flickr.com/photos/fake51
BeWelcome: Fake51
Couchsurfing: Fake51
/hype

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



Re: [PHP] getting content exceprts from the database

2010-04-26 Thread Per Jessen
Ashley Sheridan wrote:

 Here's the rub though. As the content is in HTML form, I can't just
 grab the first 100 characters and display them as that could leave an
 open tag  without a closing one, potentially breaking the page. I
 could use strip_tags on the 100-character excerpt, but what if the
 excerpt itself broke a tag in half (i.e. acronym title=something
 could become acron )
 
 The only solutions I can see are:
 
 
   * retrieve the entire article, perform a strip_tags and then
   take the excerpt
   * use a regex inside of mysql to pull out only the text
 

- parse the HTML and extract the text elements.

If the HTML is well-formed, this is relatively easily done with XSL, if
not, you might need to use Beautiful Soup or similar.



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


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



Re: [PHP] getting content exceprts from the database

2010-04-26 Thread Ashley Sheridan
On Mon, 2010-04-26 at 13:20 +0200, Peter Lind wrote:

 On 26 April 2010 12:52, Ashley Sheridan a...@ashleysheridan.co.uk wrote:
  I've been thinking about this problem for a little while, and the thing
  is, I can think of ways of doing it, but they're not very nice, and I
  don't think they're going to be fast.
 
  Basically, I have a load of HTML formatted content in a database that
  get displayed onto the site. It's part of a rudimentary CMS.
 
  Currently, the titles for each article are displayed on a page, and each
  title links to the full article. However, that leaves me with a page
  which is essentially a list of links, and that's not ideal for SEO. What
  I wanted to do to enhance the page is to have a short excerpt of x
  number of words/characters beneath each article title. The idea being
  that search engines will find the page as more than a link farm, and
  visitors won't have to just rely on the title alone for the content.
 
  Here's the rub though. As the content is in HTML form, I can't just grab
  the first 100 characters and display them as that could leave an open
  tag  without a closing one, potentially breaking the page. I could use
  strip_tags on the 100-character excerpt, but what if the excerpt itself
  broke a tag in half (i.e. acronym title=something could become
  acron )
 
  The only solutions I can see are:
 
 
   * retrieve the entire article, perform a strip_tags and then take
 the excerpt
   * use a regex inside of mysql to pull out only the text
 
 
  The thing is, neither of these seems particularly pretty, and I am sure
  there's a better way, but it's too early in the week for my brain to be
  fully functional I think!
 
  Does anyone have any ideas about what I could do, or do you think I'm
  seeing problems where there are none?
 
 Use htmltidy or htmlpurifier to clean up things. I.e. grab the amount
 of content you want, then use one of the tools to repair and clean the
 html.
 
 Regards
 Peter
 
 -- 
 hype
 WWW: http://plphp.dk / http://plind.dk
 LinkedIn: http://www.linkedin.com/in/plind
 Flickr: http://www.flickr.com/photos/fake51
 BeWelcome: Fake51
 Couchsurfing: Fake51
 /hype
 


Would that work on content that stopped mid-tag? Assuming the original
copy is:

pThis is some sentence, with an abbr title=Abbreviationabbr/abbr
in the middle of it./p

If I was asking for only the first 50 characters, I'd get this:

pThis is some sentence, with an abbr title=Abb

Would either htmltidy or htmlpurifier be able to handle that? I don't
mind whether it tries to repair the tag or remove it completely, as long
as it does something to it.

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




Re: [PHP] getting content exceprts from the database

2010-04-26 Thread Peter Lind
On 26 April 2010 13:23, Ashley Sheridan a...@ashleysheridan.co.uk wrote:

 On Mon, 2010-04-26 at 13:20 +0200, Peter Lind wrote:

 On 26 April 2010 12:52, Ashley Sheridan a...@ashleysheridan.co.uk wrote:
  I've been thinking about this problem for a little while, and the thing
  is, I can think of ways of doing it, but they're not very nice, and I
  don't think they're going to be fast.
 
  Basically, I have a load of HTML formatted content in a database that
  get displayed onto the site. It's part of a rudimentary CMS.
 
  Currently, the titles for each article are displayed on a page, and each
  title links to the full article. However, that leaves me with a page
  which is essentially a list of links, and that's not ideal for SEO. What
  I wanted to do to enhance the page is to have a short excerpt of x
  number of words/characters beneath each article title. The idea being
  that search engines will find the page as more than a link farm, and
  visitors won't have to just rely on the title alone for the content.
 
  Here's the rub though. As the content is in HTML form, I can't just grab
  the first 100 characters and display them as that could leave an open
  tag  without a closing one, potentially breaking the page. I could use
  strip_tags on the 100-character excerpt, but what if the excerpt itself
  broke a tag in half (i.e. acronym title=something could become
  acron )
 
  The only solutions I can see are:
 
 
       * retrieve the entire article, perform a strip_tags and then take
         the excerpt
       * use a regex inside of mysql to pull out only the text
 
 
  The thing is, neither of these seems particularly pretty, and I am sure
  there's a better way, but it's too early in the week for my brain to be
  fully functional I think!
 
  Does anyone have any ideas about what I could do, or do you think I'm
  seeing problems where there are none?

 Use htmltidy or htmlpurifier to clean up things. I.e. grab the amount
 of content you want, then use one of the tools to repair and clean the
 html.

 Regards
 Peter

 --
 hype
 WWW: http://plphp.dk / http://plind.dk
 LinkedIn: http://www.linkedin.com/in/plind
 Flickr: http://www.flickr.com/photos/fake51
 BeWelcome: Fake51
 Couchsurfing: Fake51
 /hype


 Would that work on content that stopped mid-tag? Assuming the original copy 
 is:

 pThis is some sentence, with an abbr title=Abbreviationabbr/abbr in 
 the middle of it./p

 If I was asking for only the first 50 characters, I'd get this:

 pThis is some sentence, with an abbr title=Abb

 Would either htmltidy or htmlpurifier be able to handle that? I don't mind 
 whether it tries to repair the tag or remove it completely, as long as it 
 does something to it.

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


HTMLTidy should definitely do something to it, pretty sure it's able
to clean that up so you get working html. Same for HTMLPurifier (the
latter is not as much what you're looking for, it protects against
injections more than validating html - so disregard that I mentioned
that one for now :) ).

Regards
Peter


--
hype
WWW: http://plphp.dk / http://plind.dk
LinkedIn: http://www.linkedin.com/in/plind
Flickr: http://www.flickr.com/photos/fake51
BeWelcome: Fake51
Couchsurfing: Fake51
/hype

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



Re: [PHP] What's your game? (X-PHP)

2010-04-26 Thread Richard Quadling
On 25 April 2010 14:16, tedd t...@sperling.com wrote:
 What's your game?

My wife and I play enjoy Baulder's Gate on the PS2 and I like the Lego
(Star Wars, Batman, etc.) games on the PSP.

The kids like to play Ice Age and Cars but crash a lot and end up
shouting at each other.


-- 
-
Richard Quadling
Standing on the shoulders of some very clever giants!
EE : http://www.experts-exchange.com/M_248814.html
EE4Free : http://www.experts-exchange.com/becomeAnExpert.jsp
Zend Certified Engineer : http://zend.com/zce.php?c=ZEND002498r=213474731
ZOPA : http://uk.zopa.com/member/RQuadling

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



Re: [PHP] CURL cannot connect to URL - IP address - after successful connection

2010-04-26 Thread ioan...@btinternet.com



On 2010/04/26 20:01, Ashley Sheridan wrote:



How frequently do you request the page? Maybe playing about with that
would resolve it? Is it possible to randomise the request frequency a
bit?

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



Just manually for testing, and it would be used for human requests.  Say 
occasionally 5, 10, 30 minutes intervals etc.  There must be other 
parameters that are being passed so that the site can determine that the 
request is coming from the same user and through a script request, 
because it works normally from the browser so just refusing a second 
call from the same IP address (which could be a browser with static or 
unchanged IP address) is not what is happening.  It must be determining 
that it is through a server from another site via curl or similar.


John

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



Re: [PHP] getting content exceprts from the database

2010-04-26 Thread Phpster



On Apr 26, 2010, at 7:23 AM, Ashley Sheridan  
a...@ashleysheridan.co.uk wrote:



On Mon, 2010-04-26 at 13:20 +0200, Peter Lind wrote:

On 26 April 2010 12:52, Ashley Sheridan a...@ashleysheridan.co.uk  
wrote:
I've been thinking about this problem for a little while, and the  
thing
is, I can think of ways of doing it, but they're not very nice,  
and I

don't think they're going to be fast.

Basically, I have a load of HTML formatted content in a database  
that

get displayed onto the site. It's part of a rudimentary CMS.

Currently, the titles for each article are displayed on a page,  
and each

title links to the full article. However, that leaves me with a page
which is essentially a list of links, and that's not ideal for  
SEO. What

I wanted to do to enhance the page is to have a short excerpt of x
number of words/characters beneath each article title. The idea  
being

that search engines will find the page as more than a link farm, and
visitors won't have to just rely on the title alone for the content.

Here's the rub though. As the content is in HTML form, I can't  
just grab
the first 100 characters and display them as that could leave an  
open
tag  without a closing one, potentially breaking the page. I could  
use
strip_tags on the 100-character excerpt, but what if the excerpt  
itself

broke a tag in half (i.e. acronym title=something could become
acron )

The only solutions I can see are:


* retrieve the entire article, perform a strip_tags and then  
take

  the excerpt
* use a regex inside of mysql to pull out only the text


The thing is, neither of these seems particularly pretty, and I am  
sure
there's a better way, but it's too early in the week for my brain  
to be

fully functional I think!

Does anyone have any ideas about what I could do, or do you think  
I'm

seeing problems where there are none?


Use htmltidy or htmlpurifier to clean up things. I.e. grab the amount
of content you want, then use one of the tools to repair and clean  
the

html.

Regards
Peter

--
hype
WWW: http://plphp.dk / http://plind.dk
LinkedIn: http://www.linkedin.com/in/plind
Flickr: http://www.flickr.com/photos/fake51
BeWelcome: Fake51
Couchsurfing: Fake51
/hype




Would that work on content that stopped mid-tag? Assuming the original
copy is:

pThis is some sentence, with an abbr title=Abbreviationabbr/ 
abbr

in the middle of it./p

If I was asking for only the first 50 characters, I'd get this:

pThis is some sentence, with an abbr title=Abb

Would either htmltidy or htmlpurifier be able to handle that? I don't
mind whether it tries to repair the tag or remove it completely, as  
long

as it does something to it.

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




When looking at the performance side of things, couldn't you add  
another column to the table and do this work to tidy / strip tags  
during the insert going forward?


Any current data would need a one time script to clean / tidy the  
current data. you could run this on a nightly cron ( depending on how  
much data there is) until the new column is filled with clean data.


Bastien

Sent from my iPod

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



Re: [PHP] getting content exceprts from the database

2010-04-26 Thread Ashley Sheridan
On Mon, 2010-04-26 at 07:58 -0400, Phpster wrote:

 
 On Apr 26, 2010, at 7:23 AM, Ashley Sheridan  
 a...@ashleysheridan.co.uk wrote:
 
  On Mon, 2010-04-26 at 13:20 +0200, Peter Lind wrote:
 
  On 26 April 2010 12:52, Ashley Sheridan a...@ashleysheridan.co.uk  
  wrote:
  I've been thinking about this problem for a little while, and the  
  thing
  is, I can think of ways of doing it, but they're not very nice,  
  and I
  don't think they're going to be fast.
 
  Basically, I have a load of HTML formatted content in a database  
  that
  get displayed onto the site. It's part of a rudimentary CMS.
 
  Currently, the titles for each article are displayed on a page,  
  and each
  title links to the full article. However, that leaves me with a page
  which is essentially a list of links, and that's not ideal for  
  SEO. What
  I wanted to do to enhance the page is to have a short excerpt of x
  number of words/characters beneath each article title. The idea  
  being
  that search engines will find the page as more than a link farm, and
  visitors won't have to just rely on the title alone for the content.
 
  Here's the rub though. As the content is in HTML form, I can't  
  just grab
  the first 100 characters and display them as that could leave an  
  open
  tag  without a closing one, potentially breaking the page. I could  
  use
  strip_tags on the 100-character excerpt, but what if the excerpt  
  itself
  broke a tag in half (i.e. acronym title=something could become
  acron )
 
  The only solutions I can see are:
 
 
  * retrieve the entire article, perform a strip_tags and then  
  take
the excerpt
  * use a regex inside of mysql to pull out only the text
 
 
  The thing is, neither of these seems particularly pretty, and I am  
  sure
  there's a better way, but it's too early in the week for my brain  
  to be
  fully functional I think!
 
  Does anyone have any ideas about what I could do, or do you think  
  I'm
  seeing problems where there are none?
 
  Use htmltidy or htmlpurifier to clean up things. I.e. grab the amount
  of content you want, then use one of the tools to repair and clean  
  the
  html.
 
  Regards
  Peter
 
  -- 
  hype
  WWW: http://plphp.dk / http://plind.dk
  LinkedIn: http://www.linkedin.com/in/plind
  Flickr: http://www.flickr.com/photos/fake51
  BeWelcome: Fake51
  Couchsurfing: Fake51
  /hype
 
 
 
  Would that work on content that stopped mid-tag? Assuming the original
  copy is:
 
  pThis is some sentence, with an abbr title=Abbreviationabbr/ 
  abbr
  in the middle of it./p
 
  If I was asking for only the first 50 characters, I'd get this:
 
  pThis is some sentence, with an abbr title=Abb
 
  Would either htmltidy or htmlpurifier be able to handle that? I don't
  mind whether it tries to repair the tag or remove it completely, as  
  long
  as it does something to it.
 
  Thanks,
  Ash
  http://www.ashleysheridan.co.uk
 
 
 
 When looking at the performance side of things, couldn't you add  
 another column to the table and do this work to tidy / strip tags  
 during the insert going forward?
 
 Any current data would need a one time script to clean / tidy the  
 current data. you could run this on a nightly cron ( depending on how  
 much data there is) until the new column is filled with clean data.
 
 Bastien
 
 Sent from my iPod
 


That's not a bad idea actually, I hadn't thought of it! I'm kicking
myself now, because it's such an obvious solution!

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




Re: [PHP] getting content exceprts from the database

2010-04-26 Thread Phpster



On Apr 26, 2010, at 7:54 AM, Ashley Sheridan  
a...@ashleysheridan.co.uk wrote:



On Mon, 2010-04-26 at 07:58 -0400, Phpster wrote:



On Apr 26, 2010, at 7:23 AM, Ashley Sheridan
a...@ashleysheridan.co.uk wrote:

 On Mon, 2010-04-26 at 13:20 +0200, Peter Lind wrote:

 On 26 April 2010 12:52, Ashley Sheridan a...@ashleysheridan.co.uk
 wrote:
 I've been thinking about this problem for a little while, and the
 thing
 is, I can think of ways of doing it, but they're not very nice,
 and I
 don't think they're going to be fast.

 Basically, I have a load of HTML formatted content in a database
 that
 get displayed onto the site. It's part of a rudimentary CMS.

 Currently, the titles for each article are displayed on a page,
 and each
 title links to the full article. However, that leaves me with a  
page

 which is essentially a list of links, and that's not ideal for
 SEO. What
 I wanted to do to enhance the page is to have a short excerpt  
of x

 number of words/characters beneath each article title. The idea
 being
 that search engines will find the page as more than a link  
farm, and
 visitors won't have to just rely on the title alone for the  
content.


 Here's the rub though. As the content is in HTML form, I can't
 just grab
 the first 100 characters and display them as that could leave an
 open
 tag  without a closing one, potentially breaking the page. I  
could

 use
 strip_tags on the 100-character excerpt, but what if the excerpt
 itself
 broke a tag in half (i.e. acronym title=something could  
become

 acron )

 The only solutions I can see are:


 * retrieve the entire article, perform a strip_tags and then
 take
   the excerpt
 * use a regex inside of mysql to pull out only the text


 The thing is, neither of these seems particularly pretty, and I  
am

 sure
 there's a better way, but it's too early in the week for my brain
 to be
 fully functional I think!

 Does anyone have any ideas about what I could do, or do you think
 I'm
 seeing problems where there are none?

 Use htmltidy or htmlpurifier to clean up things. I.e. grab the  
amount

 of content you want, then use one of the tools to repair and clean
 the
 html.

 Regards
 Peter

 --
 hype
 WWW: http://plphp.dk / http://plind.dk
 LinkedIn: http://www.linkedin.com/in/plind
 Flickr: http://www.flickr.com/photos/fake51
 BeWelcome: Fake51
 Couchsurfing: Fake51
 /hype



 Would that work on content that stopped mid-tag? Assuming the  
original

 copy is:

 pThis is some sentence, with an abbr title=Abbreviationabbr/
 abbr
 in the middle of it./p

 If I was asking for only the first 50 characters, I'd get this:

 pThis is some sentence, with an abbr title=Abb

 Would either htmltidy or htmlpurifier be able to handle that? I  
don't

 mind whether it tries to repair the tag or remove it completely, as
 long
 as it does something to it.

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



When looking at the performance side of things, couldn't you add
another column to the table and do this work to tidy / strip tags
during the insert going forward?

Any current data would need a one time script to clean / tidy the
current data. you could run this on a nightly cron ( depending on how
much data there is) until the new column is filled with clean data.

Bastien

Sent from my iPod



That's not a bad idea actually, I hadn't thought of it! I'm kicking  
myself now, because it's such an obvious solution!


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




I always prefer simple solutions! It keeps things easy!

Bastien

Sent from my iPod



Re: [PHP] getting content exceprts from the database

2010-04-26 Thread tedd

At 11:52 AM +0100 4/26/10, Ashley Sheridan wrote:

-snip- SEO concerns

Does anyone have any ideas about what I could do, or do you think I'm
seeing problems where there are none?

Thanks,
Ash


Ash:

Not only do you have to consider SEO for content, but what about 
content for an internal Site Search?


I was confronted with the same problem (links to lot's of PDF files) 
and created a brief description of each article (PDF) that would be 
provided to SEO's and for Internal Searches. Sure, it's another 
field, but it works.


Not that it's bad, but I do everything I can to keep html out of my 
database. In my view, the database is there to deliver content not 
code. I have entire sites that spring from a single index.php page 
that is loaded with different content depending upon what the user 
wants -- the site looks big, but consists of a single page.


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] Updating cli executable on MS-Windows

2010-04-26 Thread Bob McConnell
From: Richard Quadling
 On 23 April 2010 02:34, Bob McConnell r...@cbord.com wrote:
 From: Richard Quadling
 On 22 April 2010 14:42, Bob McConnell r...@cbord.com wrote:
 I downloaded the MS-Windows cli from The PHP Group a while ago. It
 claims to be version 5.2.10. But now I can't find where I got it, nor
 where to get the updates. What is the easiest way to upgrade it to
 5.2.13?

  D:\Code\Testsphp --version
  PHP 5.2.10 (cli) (built: Jun 17 2009 16:16:57)
  Copyright (c) 1997-2009 The PHP Group
  Zend Engine v2.2.0, Copyright (c) 1998-2009 Zend Technologies

 You can get the latest V5.2.x from http://windows.php.net/download/

 Which one has just the cli installer? I don't want any server
 files installed on my workstation.

 Normally, you take the ZIP file and unzip it into C:\PHP5 (or wherever
 you want).
 
 That's the installation done.
 
 Then, you take a long look through the php.ini-production and
 php.ini-development to see what you need to setup.
 
 I'd recommend reading ...
 
 http://docs.php.net/manual/en/install.windows.manual.php
 and
 http://docs.php.net/manual/en/install.windows.commandline.php

Thank you for those links. I had missed them completely on my first and second 
times through the manual.

I did it the easy way by renaming D:\php to php.5.2.10 and creating a new 
D:\php to extract the new version into. It is working, but now I have to see 
about those setup options.

Thank you,

Bob McConnell

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



Re: [PHP] Is the case of ?php important in any way?

2010-04-26 Thread Daniel Brown
On Mon, Apr 26, 2010 at 04:51, Richard Quadling
rquadl...@googlemail.com wrote:
 Hi.

 I've recently come across some third party code which uses ...

 ?PHP

 as the PHP tag.

 This is the first time I've seen PHP in upper case for the tag.

 The code works in V5, so, from this, I can assume the tag is read case
 insensitive.

 Are there any issues with this when moving forward?

Glance through some of the user notes on the site and you'll see
that some folks prefer to use UPPER-CASE ?PHP as opposed to
lower-case ?php.  It's always worked just fine.  In fact, I remember
a PHP3 site that someone wrote (.phtml and .php3 files!) that used
UPPER-CASE in every file, including for variables and functions.  I
don't remember having to modify that part to work (but thinking how
much I'd love to break the person's CAPS LOCK off the keyboard
permanently).

 When Unicode support is re-committed to trunk, does case sensitivity
 become part of this?

From this, I gather you meant to send this to Internals, but
still, I wouldn't anticipate any change in case-sensitivity regarding
any part of the engine that hasn't yet required such.  Opening tags,
functions, operators, et cetera.  User-defined things like variables
will be case-sensitive, of course, but only the lamest of the lame
would appreciate otherwise.  ;-P

-- 
/Daniel P. Brown
daniel.br...@parasane.net || danbr...@php.net
http://www.parasane.net/ || http://www.pilotpig.net/
We now offer SAME-DAY SETUP on a new line of servers!

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



Re: [PHP] Updating cli executable on MS-Windows

2010-04-26 Thread Richard Quadling
On 26 April 2010 14:43, Bob McConnell r...@cbord.com wrote:
 From: Richard Quadling
 On 23 April 2010 02:34, Bob McConnell r...@cbord.com wrote:
 From: Richard Quadling
 On 22 April 2010 14:42, Bob McConnell r...@cbord.com wrote:
 I downloaded the MS-Windows cli from The PHP Group a while ago. It
 claims to be version 5.2.10. But now I can't find where I got it, nor
 where to get the updates. What is the easiest way to upgrade it to
 5.2.13?

  D:\Code\Testsphp --version
  PHP 5.2.10 (cli) (built: Jun 17 2009 16:16:57)
  Copyright (c) 1997-2009 The PHP Group
  Zend Engine v2.2.0, Copyright (c) 1998-2009 Zend Technologies

 You can get the latest V5.2.x from http://windows.php.net/download/

 Which one has just the cli installer? I don't want any server
 files installed on my workstation.

 Normally, you take the ZIP file and unzip it into C:\PHP5 (or wherever
 you want).

 That's the installation done.

 Then, you take a long look through the php.ini-production and
 php.ini-development to see what you need to setup.

 I'd recommend reading ...

 http://docs.php.net/manual/en/install.windows.manual.php
 and
 http://docs.php.net/manual/en/install.windows.commandline.php

 Thank you for those links. I had missed them completely on my first and 
 second times through the manual.

 I did it the easy way by renaming D:\php to php.5.2.10 and creating a new 
 D:\php to extract the new version into. It is working, but now I have to see 
 about those setup options.

 Thank you,

 Bob McConnell

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



Glad to have helped.

Make sure you come back if you have any problems.


-- 
-
Richard Quadling
Standing on the shoulders of some very clever giants!
EE : http://www.experts-exchange.com/M_248814.html
EE4Free : http://www.experts-exchange.com/becomeAnExpert.jsp
Zend Certified Engineer : http://zend.com/zce.php?c=ZEND002498r=213474731
ZOPA : http://uk.zopa.com/member/RQuadling

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



Re: [PHP] Is the case of ?php important in any way?

2010-04-26 Thread Richard Quadling
On 26 April 2010 15:08, Daniel Brown danbr...@php.net wrote:
 On Mon, Apr 26, 2010 at 04:51, Richard Quadling
 rquadl...@googlemail.com wrote:
 Hi.

 I've recently come across some third party code which uses ...

 ?PHP

 as the PHP tag.

 This is the first time I've seen PHP in upper case for the tag.

 The code works in V5, so, from this, I can assume the tag is read case
 insensitive.

 Are there any issues with this when moving forward?

    Glance through some of the user notes on the site and you'll see
 that some folks prefer to use UPPER-CASE ?PHP as opposed to
 lower-case ?php.  It's always worked just fine.  In fact, I remember
 a PHP3 site that someone wrote (.phtml and .php3 files!) that used
 UPPER-CASE in every file, including for variables and functions.  I
 don't remember having to modify that part to work (but thinking how
 much I'd love to break the person's CAPS LOCK off the keyboard
 permanently).

 When Unicode support is re-committed to trunk, does case sensitivity
 become part of this?

    From this, I gather you meant to send this to Internals, but
 still, I wouldn't anticipate any change in case-sensitivity regarding
 any part of the engine that hasn't yet required such.  Opening tags,
 functions, operators, et cetera.  User-defined things like variables
 will be case-sensitive, of course, but only the lamest of the lame
 would appreciate otherwise.  ;-P

 --
 /Daniel P. Brown
 daniel.br...@parasane.net || danbr...@php.net
 http://www.parasane.net/ || http://www.pilotpig.net/
 We now offer SAME-DAY SETUP on a new line of servers!


Thanks Dan.



-- 
-
Richard Quadling
Standing on the shoulders of some very clever giants!
EE : http://www.experts-exchange.com/M_248814.html
EE4Free : http://www.experts-exchange.com/becomeAnExpert.jsp
Zend Certified Engineer : http://zend.com/zce.php?c=ZEND002498r=213474731
ZOPA : http://uk.zopa.com/member/RQuadling

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



[PHP] php quiz script/tutorial

2010-04-26 Thread Paul Jinks
I'm considering my options for making quizzes mostly multiple choice
type of thing, but also 'filling in the gaps'. This is in support of
educational materials I'm working on. So far I've looked at Flash and
javascript but have concerns about accessibility for both of these.

Does anyone have any experience of writing quizzes with php and if so,
can you recommend any resources to get me started?

TIA

Paul

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



[PHP] Re: Weird problem with is_file()

2010-04-26 Thread Michelle Konzack
Hello Jan G.B.,

Am 2010-04-26 11:52:02, hacktest Du folgendes herunter:
 I would recommend not to let any user input to your shell. This piece
 of code is very insecure as any client may manipulate the shell
 command at will.

It is ony a simplified example...  The  original  shell_exec()  is  more
comlicate and I have no absolute pathes (they are mostly all dynamic).

 You don't want people to take over your server that easily.

:-)

 See http://www.php.net/escapeshellcmd and alike.

I know

Thanks, Greetings and nice Day/Evening
Michelle Konzack
Systemadministrator

-- 
# Debian GNU/Linux Consultant ##
   Development of Intranet and Embedded Systems with Debian GNU/Linux

itsyst...@tdnet France   itsyst...@tdnet UG (haftungsbeschränkt)
Gesch. Michelle Konzack  Gesch. Michelle Konzack

Apt. 917 (homeoffice)
50, rue de Soultz   Kinzigstraße 17
67100 Strasbourg/France 77694 Kehl/Germany
Tel: +33-6-61925193 mobil   Tel: +49-177-9351947 mobil
Tel: +33-9-52705884 fix

http://www.itsystems.tamay-dogan.net/  http://www.flexray4linux.org/
http://www.debian.tamay-dogan.net/ http://www.can4linux.org/

Jabber linux4miche...@jabber.ccc.de
ICQ#328449886

Linux-User #280138 with the Linux Counter, http://counter.li.org/


signature.pgp
Description: Digital signature


[PHP] Re: Weird problem with is_file()

2010-04-26 Thread Michelle Konzack
Hello Peter,

Am 2010-04-26 09:28:28, hacktest Du folgendes herunter:
 var_dump($isfile);
 
 Don't make assumptions of what the value is, just check it.

Yes and grmpf!

The filename has a space at the end but it can not removed even using

var_dump(str_replace(' ', '', $isfile);

if I put a '1' as search parameter all '1' are removed, but  WHY  can  I
not remove a space at the end?

Even if a do a

  mv the_file_not_recognized the_file_not_recognized\space

it is not detected... even if the var_dump() show me something like

  string(29) /tmp/the_file_not_recognized 

Simple to test

exec(touch /tmp/the_file_not_recognized);
$FILE=shell_exec(ls /tmp/the_file_not_* |head -n1);
var_dump($FILE);
echo br;
var_dump(str_replace(' ', '', $FILE);

Thanks, Greetings and nice Day/Evening
Michelle Konzack
Systemadministrator

-- 
# Debian GNU/Linux Consultant ##
   Development of Intranet and Embedded Systems with Debian GNU/Linux

itsyst...@tdnet France   itsyst...@tdnet UG (haftungsbeschränkt)
Gesch. Michelle Konzack  Gesch. Michelle Konzack

Apt. 917 (homeoffice)
50, rue de Soultz   Kinzigstraße 17
67100 Strasbourg/France 77694 Kehl/Germany
Tel: +33-6-61925193 mobil   Tel: +49-177-9351947 mobil
Tel: +33-9-52705884 fix

http://www.itsystems.tamay-dogan.net/  http://www.flexray4linux.org/
http://www.debian.tamay-dogan.net/ http://www.can4linux.org/

Jabber linux4miche...@jabber.ccc.de
ICQ#328449886

Linux-User #280138 with the Linux Counter, http://counter.li.org/


signature.pgp
Description: Digital signature


[PHP] Re: Weird problem with is_file()

2010-04-26 Thread Pete Ford

On 26/04/10 16:56, Michelle Konzack wrote:

Hello Peter,

Am 2010-04-26 09:28:28, hacktest Du folgendes herunter:

var_dump($isfile);

Don't make assumptions of what the value is, just check it.


Yes and grmpf!

The filename has a space at the end but it can not removed even using

 var_dump(str_replace(' ', '', $isfile);

if I put a '1' as search parameter all '1' are removed, but  WHY  can  I
not remove a space at the end?

Even if a do a

   mv the_file_not_recognized the_file_not_recognized\space

it is not detected... even if the var_dump() show me something like

   string(29) /tmp/the_file_not_recognized 

Simple to test

 exec(touch /tmp/the_file_not_recognized);
 $FILE=shell_exec(ls /tmp/the_file_not_* |head -n1);
 var_dump($FILE);
 echo br;
 var_dump(str_replace(' ', '', $FILE);

Thanks, Greetings and nice Day/Evening
 Michelle Konzack
 Systemadministrator



Is it possible that the space is a new-line (or a carriage-return) ?

What happens if you replace
   str_replace(' ', '', $FILE)
with
   preg_replace('/\s+$/','',$FILE);

?


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



Re: [PHP] Re: Weird problem with is_file()

2010-04-26 Thread Ashley Sheridan
On Mon, 2010-04-26 at 17:56 +0200, Michelle Konzack wrote:

 Hello Peter,
 
 Am 2010-04-26 09:28:28, hacktest Du folgendes herunter:
  var_dump($isfile);
  
  Don't make assumptions of what the value is, just check it.
 
 Yes and grmpf!
 
 The filename has a space at the end but it can not removed even using
 
 var_dump(str_replace(' ', '', $isfile);
 
 if I put a '1' as search parameter all '1' are removed, but  WHY  can  I
 not remove a space at the end?
 
 Even if a do a
 
   mv the_file_not_recognized the_file_not_recognized\space
 
 it is not detected... even if the var_dump() show me something like
 
   string(29) /tmp/the_file_not_recognized 
 
 Simple to test
 
 exec(touch /tmp/the_file_not_recognized);
 $FILE=shell_exec(ls /tmp/the_file_not_* |head -n1);
 var_dump($FILE);
 echo br;
 var_dump(str_replace(' ', '', $FILE);
 
 Thanks, Greetings and nice Day/Evening
 Michelle Konzack
 Systemadministrator
 


It's probably not a space but some other non-displayed character. Check
the ascii value of that actual character. A space is 32, anything else
can be replaced using str_replace(chr(x), '', $FILE) if you can't type
it with your keyboard.

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




Re: [PHP] What's your game? (X-PHP)

2010-04-26 Thread Kevin Kinsey

Richard Quadling wrote:

On 25 April 2010 14:16, tedd t...@sperling.com wrote:

What's your game?


Ooh, do we *have* to tell?

I've got interest in the AOE stuff, but haven't played in
a while.  Haven't purchased AOE3.  If I'm *really* bored,
I've got freecell.exe running on every O.S. I run

I'm also a Player Moderator in a large MMORPG, but
I'm not sure I should say which one ... Mods there
are big targets; suffice it to say it's a love/hate
relationship, and I either need counseling or to go
work on my combat skills RIGHT AWAY!!!

KDK

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



RE: [PHP] CURL cannot connect to URL - IP address - after successful connection

2010-04-26 Thread Tommy Pham
 -Original Message-
 From: ioan...@btinternet.com [mailto:ioan...@btinternet.com]
 Sent: Sunday, April 25, 2010 10:44 PM
 To: a...@ashleysheridan.co.uk; tommy...@gmail.com  Tommy Pham
 Subject: Re: [PHP] CURL cannot connect to URL - IP address - after
successful
 connection
 
 The answer I got from support desk on my shared server: 'You are trying to
 curl to a datapipe server, if it is rejecting the server name and port,
you will
 need to take that up with them.'
 
 John

I assume that you did full testing with the browser as I suggested?  If
everything works, one other thing to keep in mind is that the target also
may implement reverse DNS lookup in their anti-bot.  One good way to test
that is to remote in via SSH (if on Linux/Unix) to test with wget.
Otherwise, I'm pretty sure that target site have some anti-bot mechanisms in
place.  Microseconds of analyzing valid 'user' requests is better than
processing 2-3 seconds and sending the response which will consume
bandwidth.  What you could also try is setting different user-agents for
every request and use cookies in cURL should the target site have an
anti-bot mechanism.

Regards,
Tommy


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



Re: [PHP] What's your game? (X-PHP)

2010-04-26 Thread Dan Joseph
On Sun, Apr 25, 2010 at 9:16 AM, tedd t...@sperling.com wrote:

 My gamer tag is special tedd


Hey Tedd, I'm 'jakmo' on Live.  I'll have to give you an add next time I
jump on.

I've been playing Dragon Age and Lost Odyssey.  Both are great.

-- 
-Dan Joseph

www.canishosting.com - Unlimited Hosting Plans start @ $3.95/month.  Promo
Code NEWTHINGS for 10% off initial order

http://www.facebook.com/canishosting
http://www.facebook.com/originalpoetry


Re: [PHP] What's your game? (X-PHP)

2010-04-26 Thread Dan Joseph
On Mon, Apr 26, 2010 at 7:48 AM, Richard Quadling
rquadl...@googlemail.comwrote:

 On 25 April 2010 14:16, tedd t...@sperling.com wrote:
  What's your game?

 My wife and I play enjoy Baulder's Gate on the PS2 and I like the Lego
 (Star Wars, Batman, etc.) games on the PSP.

 The kids like to play Ice Age and Cars but crash a lot and end up
 shouting at each other.

Ice Age was a fine game!  I played that one a few years ago.  I'd like to
see another Diablo styled game come out in the modern setting.

-- 
-Dan Joseph

www.canishosting.com - Unlimited Hosting Plans start @ $3.95/month.  Promo
Code NEWTHINGS for 10% off initial order

http://www.facebook.com/canishosting
http://www.facebook.com/originalpoetry


Re: [PHP] What's your game? (X-PHP)

2010-04-26 Thread Ashley Sheridan
On Mon, 2010-04-26 at 12:41 -0400, Dan Joseph wrote:

 On Mon, Apr 26, 2010 at 7:48 AM, Richard Quadling
 rquadl...@googlemail.comwrote:
 
  On 25 April 2010 14:16, tedd t...@sperling.com wrote:
   What's your game?
 
  My wife and I play enjoy Baulder's Gate on the PS2 and I like the Lego
  (Star Wars, Batman, etc.) games on the PSP.
 
  The kids like to play Ice Age and Cars but crash a lot and end up
  shouting at each other.
 
 Ice Age was a fine game!  I played that one a few years ago.  I'd like to
 see another Diablo styled game come out in the modern setting.
 


Diablo 3 is out soon...

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




Re: [PHP] What's your game? (X-PHP)

2010-04-26 Thread Dan Joseph
On Mon, Apr 26, 2010 at 12:36 PM, Ashley Sheridan
a...@ashleysheridan.co.ukwrote:



 Diablo 3 is out soon...


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



oh cool, I did not realize.. have they set a release date yet?  I didn't see
one on gamestop.com...


-- 
-Dan Joseph

www.canishosting.com - Unlimited Hosting Plans start @ $3.95/month.  Promo
Code NEWTHINGS for 10% off initial order

http://www.facebook.com/canishosting
http://www.facebook.com/originalpoetry


[PHP] Re: Weird problem with is_file()

2010-04-26 Thread Michelle Konzack
Hello Pete,

Am 2010-04-26 17:04:32, hacktest Du folgendes herunter:
 Is it possible that the space is a new-line (or a carriage-return) ?

grmpf!  --  That it was...

preg_replace('/\s+$/','',$FILE);

Works now!

Thanks, Greetings and nice Day/Evening
Michelle Konzack
Systemadministrator

-- 
# Debian GNU/Linux Consultant ##
   Development of Intranet and Embedded Systems with Debian GNU/Linux

itsyst...@tdnet France   itsyst...@tdnet UG (haftungsbeschränkt)
Gesch. Michelle Konzack  Gesch. Michelle Konzack

Apt. 917 (homeoffice)
50, rue de Soultz   Kinzigstraße 17
67100 Strasbourg/France 77694 Kehl/Germany
Tel: +33-6-61925193 mobil   Tel: +49-177-9351947 mobil
Tel: +33-9-52705884 fix

http://www.itsystems.tamay-dogan.net/  http://www.flexray4linux.org/
http://www.debian.tamay-dogan.net/ http://www.can4linux.org/

Jabber linux4miche...@jabber.ccc.de
ICQ#328449886

Linux-User #280138 with the Linux Counter, http://counter.li.org/


signature.pgp
Description: Digital signature


Re: [PHP] What's your game? (X-PHP)

2010-04-26 Thread Ashley Sheridan
On Mon, 2010-04-26 at 12:48 -0400, Dan Joseph wrote:

 On Mon, Apr 26, 2010 at 12:36 PM, Ashley Sheridan
 a...@ashleysheridan.co.ukwrote:
 
 
 
  Diablo 3 is out soon...
 
 
Thanks,
  Ash
  http://www.ashleysheridan.co.uk
 
 
 
 oh cool, I did not realize.. have they set a release date yet?  I didn't see
 one on gamestop.com...
 
 


Not yet, but there's trailers on YouTube and it looks good so far. A few
more classes, different mobs, it looks good!

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




Re: [PHP] What's your game? (X-PHP)

2010-04-26 Thread Dan Joseph
On Mon, Apr 26, 2010 at 12:52 PM, Ashley Sheridan
a...@ashleysheridan.co.ukwrote:

 Not yet, but there's trailers on YouTube and it looks good so far. A few
 more classes, different mobs, it looks good!



The screenshots look great as well.  I am going to check YouTube for
trailers.  Maybe after they get Starcraft going they'll get this out.

-- 
-Dan Joseph

www.canishosting.com - Unlimited Hosting Plans start @ $3.95/month.  Promo
Code NEWTHINGS for 10% off initial order

http://www.facebook.com/canishosting
http://www.facebook.com/originalpoetry


RE: [PHP] What's your game? (X-PHP)

2010-04-26 Thread Bob McConnell
The last game I played was catch. My oldest grandson and I borrowed his
cousin's Harlem Globetrotters miniature basketball. I taught him how to
use spin to deflect the ball path when it bounced.

I actually don't recall the last time I played an electronic game.

Bob McConnell

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



[PHP] Re: getting content exceprts from the database

2010-04-26 Thread Nathan Rixham
Ashley Sheridan wrote:
 I've been thinking about this problem for a little while, and the thing
 is, I can think of ways of doing it, but they're not very nice, and I
 don't think they're going to be fast.
 
 Basically, I have a load of HTML formatted content in a database that
 get displayed onto the site. It's part of a rudimentary CMS.
 
 Currently, the titles for each article are displayed on a page, and each
 title links to the full article. However, that leaves me with a page
 which is essentially a list of links, and that's not ideal for SEO. What
 I wanted to do to enhance the page is to have a short excerpt of x
 number of words/characters beneath each article title. The idea being
 that search engines will find the page as more than a link farm, and
 visitors won't have to just rely on the title alone for the content.
 
 Here's the rub though. As the content is in HTML form, I can't just grab
 the first 100 characters and display them as that could leave an open
 tag  without a closing one, potentially breaking the page. I could use
 strip_tags on the 100-character excerpt, but what if the excerpt itself
 broke a tag in half (i.e. acronym title=something could become
 acron )
 
 The only solutions I can see are:
 
 
   * retrieve the entire article, perform a strip_tags and then take
 the excerpt
   * use a regex inside of mysql to pull out only the text
 
 
 The thing is, neither of these seems particularly pretty, and I am sure
 there's a better way, but it's too early in the week for my brain to be
 fully functional I think!
 
 Does anyone have any ideas about what I could do, or do you think I'm
 seeing problems where there are none?
 
 Thanks,
 Ash
 http://www.ashleysheridan.co.uk
 

/**
 * creates an abstract from any string, a nice one that stops at a full
 * stop or end of a word betwen 140-180 chars.
 *
 */
function createAbstract( $string )
{
$lines = explode( \n , $string );
if( count($lines)  1  strlen($lines[0])  140 ) {
$string = $lines[0];
}
if( strlen($string)  180 ) return $string;
$string = substr( $string , 0 , 180);
$chars = str_split( $string );
$string = '';
foreach( $chars as $char ) {
$string .= $char;
if( $char == '.'  strlen($string)  120 ) {
return $string;
}
}
$string = '';
foreach( $chars as $char ) {
$string .= $char;
if( $char == ' '  strlen($string)  140 ) {
return trim( $string ) . '...';
}
}
return $string;
}

/**
 * given an html (or fragment) tidy in to usable html
 * and strip back to text, new lines in tact
 *
 */
function htmlToText( $html )
{
  $html = str_replace( '' , 'amp;' , str_replace( 'amp;' , '' ,
$html ) );
  $config = array(
'clean' = true,
'drop-proprietary-attributes' = true,
'output-xhtml' = true,
'show-body-only' = true,
'word-2000' = true,
'wrap' = '0'
);
  $tidy = new tidy();
  $tidy-parseString($html, $config, 'utf8');
  $tidy-cleanRepair();
  $html = tidy_get_output($tidy);
  $text = str_replace( '' , 'amp;' , str_replace( 'amp;' , '' ,
$text ) );
  return strip_tags($text);
}

using those two together should do it; they're pretty basic and could do
with a tidy, but gets the job done (you'll probably want to change the
140 chars to something different)

Best,

Nathan

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



RE: [PHP] What's your game? (X-PHP)

2010-04-26 Thread Williams, Dewey
The only online games I play are Guild Wars and - now - Dungeons and
Dragons Online (FREE!).  I haven't played vgaplanets in ages - too few
servers to get a decent game. Not certain I can even install my original
3.5 inch disk anymore!

Dewey Williams

 -Original Message-
 From: tedd [mailto:t...@sperling.com]
 Sent: Sunday, April 25, 2010 9:16 AM
 To: php-general@lists.php.net
 Subject: [PHP] What's your game? (X-PHP)
 
 Hi gang:
 
 Considering we recently had several people mention what games they
 play, it might be interesting to see what everyone plays.
 
 As for me, I currently play Modern Warfare 2 on XBOX. It's the most
 recent in a long line of war games (i.e., Call of Duty, Ghost Recon,
 etc.).
 
 My gamer tag is special tedd
 
 What's your game?
 
 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


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



[PHP] Contact form....

2010-04-26 Thread Watson Blair
Hey guys, so ive coded a sucessfull contact form before, but for some reason
this bit of code is giving me the run-arroundl

so my HTML end is:


form action=send.php method=post enctype=multipart/form-data
 table border=0 cellspacing=2 cellpadding=0
   trtd style=text-align:left; Send E-mail to:
/td
tdinput type=radio name=to value=
bestudios...@gmail.comGeneral Information/td/tr
trtd/tdtdinput type=radio name=to value=
ajaga...@akwimemorial.orgFounder and President: Professor Ajagi Nji,
Ph.D/td/tr
trtd/tdtdinput type=radio name=to value=
dtanw...@akwimemorial.orgExecutive Secretary: Dorothy Tah
Tanwani/td/tr
   trtd style=text-align:left; Name: /td
tdinput type=text name=name size=40/tr/td
 trtd style=text-align:left;Subject: /td
tdinput type=text name=subject
size=40//td/tr
   trtd style=text-align:left;E-mail Address:
/td
tdinput type=text name=from size=40//td/tr
   trtd style=text-align:left;Message: /td
tdTEXTAREA NAME=message COLS=31
ROWS=7/TEXTAREA/td/tr
trtd/tdtd style=text-align:center;

/td/tr
   trtd colspan=2 style=text-align:right;input
type=submit value=Send E-mail name=submit //td/tr
 /form/table

and the file send.php is:

?php

$subject =$_POSTsubject;

$message=$_POSTmessage;

$name=$_POSTname;

$from=$_POSTfrom

$mail_from=$_POSTfrom;

$to =$_POSTto;

$header = From: {$name}  {$from} ;

$send_contact=mail($to,$subject,$message, $header);

if($send_contact){
echo Thank you for Contacting Us!;
}
else {
echo An error occurred while sending your message, review your information
and please try again.;
}
?

when i go to test it out all i get back is a blank screen with: ;
$send_contact=mail($to,$subject,$message, $header); if($send_contact){ echo
Thank you for Contacting Us!; } else { echo An error occured while
sending your message, review your information and please try again.; } ?
on it... when i take out the like 
$header = From: {$name}  {$from} ; i just get a blank screen, but it
dosen't send the e-mail i know i'm missing something really obvious, but
i just can't see it.
Thanks,
Watson


Re: [PHP] Contact form....

2010-04-26 Thread Adam Richardson
On Mon, Apr 26, 2010 at 3:16 PM, Watson Blair bestudios...@gmail.comwrote:

 Hey guys, so ive coded a sucessfull contact form before, but for some
 reason
 this bit of code is giving me the run-arroundl

 so my HTML end is:


 form action=send.php method=post enctype=multipart/form-data
 table border=0 cellspacing=2 cellpadding=0
   trtd style=text-align:left; Send E-mail to:
 /td
tdinput type=radio name=to value=
 bestudios...@gmail.comGeneral Information/td/tr
trtd/tdtdinput type=radio name=to value=
 ajaga...@akwimemorial.orgFounder and President: Professor Ajagi Nji,
 Ph.D/td/tr
trtd/tdtdinput type=radio name=to value=
 dtanw...@akwimemorial.orgExecutive Secretary: Dorothy Tah
 Tanwani/td/tr
   trtd style=text-align:left; Name: /td
tdinput type=text name=name size=40/tr/td
 trtd style=text-align:left;Subject: /td
tdinput type=text name=subject
 size=40//td/tr
   trtd style=text-align:left;E-mail Address:
 /td
tdinput type=text name=from size=40//td/tr
   trtd style=text-align:left;Message: /td
tdTEXTAREA NAME=message COLS=31
 ROWS=7/TEXTAREA/td/tr
trtd/tdtd style=text-align:center;

 /td/tr
   trtd colspan=2 style=text-align:right;input
 type=submit value=Send E-mail name=submit //td/tr
 /form/table

 and the file send.php is:

 ?php

 $subject =$_POSTsubject;

 $message=$_POSTmessage;

 $name=$_POSTname;

 $from=$_POSTfrom

 $mail_from=$_POSTfrom;

 $to =$_POSTto;

 $header = From: {$name}  {$from} ;

 $send_contact=mail($to,$subject,$message, $header);

 if($send_contact){
 echo Thank you for Contacting Us!;
 }
 else {
 echo An error occurred while sending your message, review your information
 and please try again.;
 }
 ?

 when i go to test it out all i get back is a blank screen with: ;
 $send_contact=mail($to,$subject,$message, $header); if($send_contact){ echo
 Thank you for Contacting Us!; } else { echo An error occured while
 sending your message, review your information and please try again.; } ?
 on it... when i take out the like 
 $header = From: {$name}  {$from} ; i just get a blank screen, but it
 dosen't send the e-mail i know i'm missing something really obvious,
 but
 i just can't see it.
 Thanks,
 Watson


Maybe you just miscopied, but are you missing the brackets on the post array
vars (e.g., $from=$_POST[from]) ?

Adam

-- 
Nephtali:  PHP web framework that functions beautifully
http://nephtaliproject.com


Re: [PHP] Contact form....

2010-04-26 Thread Watson Blair
I knew i was missing something although it still doesn't work... i'm
still getting :

; $send_contact=mail($to,$subject,$message, $header); if($send_contact){
echo Thank you for Contacting Us!; } else { echo An error occured while
sending your message, review your information and please try again.; } ?

would it make a difference that i'm running it off of my computer rather
than hosting it online?

Thanks,
Watson

On Mon, Apr 26, 2010 at 3:30 PM, Dan Joseph dmjos...@gmail.com wrote:

 Looks like you might have errors turned off.  I see:

 $subject =$_POSTsubject;

 Which should be:

  $subject =$_POST[subject];

 $_POST is an array, and that's how you access those elements.  check to see
 if errors are on, if not, you'll see errors in the log files.

 --
 -Dan Joseph

 www.canishosting.com - Unlimited Hosting Plans start @ $3.95/month.  Promo
 Code NEWTHINGS for 10% off initial order

 http://www.facebook.com/canishosting
 http://www.facebook.com/originalpoetry



Re: [PHP] Contact form....

2010-04-26 Thread Ashley Sheridan
On Mon, 2010-04-26 at 15:46 -0400, Watson Blair wrote:

 I knew i was missing something although it still doesn't work... i'm
 still getting :
 
 ; $send_contact=mail($to,$subject,$message, $header); if($send_contact){
 echo Thank you for Contacting Us!; } else { echo An error occured while
 sending your message, review your information and please try again.; } ?
 
 would it make a difference that i'm running it off of my computer rather
 than hosting it online?
 
 Thanks,
 Watson
 
 On Mon, Apr 26, 2010 at 3:30 PM, Dan Joseph dmjos...@gmail.com wrote:
 
  Looks like you might have errors turned off.  I see:
 
  $subject =$_POSTsubject;
 
  Which should be:
 
   $subject =$_POST[subject];
 
  $_POST is an array, and that's how you access those elements.  check to see
  if errors are on, if not, you'll see errors in the log files.
 
  --
  -Dan Joseph
 
  www.canishosting.com - Unlimited Hosting Plans start @ $3.95/month.  Promo
  Code NEWTHINGS for 10% off initial order
 
  http://www.facebook.com/canishosting
  http://www.facebook.com/originalpoetry
 


That might be it if you're running Windows, although a Linux system
would usually have sendmail installed by default.

Also, make sure you validate your inputs. Don't put the to address as a
field within the form, leave that hard coded in your app, just let the
radio buttons switch between an array of values in send.php. Putting
them in the form like that could let anyone use your form to send email
to anywhere they wanted. Also, it's very simple to modify the from field
to include as many cc or bcc fields as someone wants, and use your form
as a spam relay system.

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




Re: [PHP] Contact form....

2010-04-26 Thread Watson Blair
ya, i'm working on a walk around now, i just wanted to get the function up
and running in it's most basic before i started supping it up, as it were. i
was thinking about using a switch and assigning each of my radio buttons a
value from 1 to 3...

On Mon, Apr 26, 2010 at 4:35 PM, Benjamin Hawkes-Lewis 
bhawkesle...@googlemail.com wrote:

 [off-list]

 On Mon, Apr 26, 2010 at 8:16 PM, Watson Blair bestudios...@gmail.com
 wrote:
  the file send.php is:
 
  ?php
 
  $subject =$_POSTsubject;
 
  $message=$_POSTmessage;
 
  $name=$_POSTname;
 
  $from=$_POSTfrom
 
  $mail_from=$_POSTfrom;
 
  $to =$_POSTto;
 
  $header = From: {$name}  {$from} ;
 
  $send_contact=mail($to,$subject,$message, $header);
 
  if($send_contact){
  echo Thank you for Contacting Us!;
  }
  else {
  echo An error occurred while sending your message, review your
 information
  and please try again.;
  }
  ?

 Please note that code does not sanitize your inputs and would
 therefore be vulnerable to email header injection:

 http://www.nyphp.org/PHundamentals/8_Preventing-Email-Header-Injection

 --
 Benjamin Hawkes-Lewis



Re: [PHP] Contact form....

2010-04-26 Thread Brandon Rampersad
Ashley thank you for catching that, i caught it but then i saw your reply
further down.

On Mon, Apr 26, 2010 at 5:11 PM, Watson Blair bestudios...@gmail.comwrote:

 ya, i'm working on a walk around now, i just wanted to get the function up
 and running in it's most basic before i started supping it up, as it were.
 i
 was thinking about using a switch and assigning each of my radio buttons a
 value from 1 to 3...

 On Mon, Apr 26, 2010 at 4:35 PM, Benjamin Hawkes-Lewis 
 bhawkesle...@googlemail.com wrote:

  [off-list]
 
  On Mon, Apr 26, 2010 at 8:16 PM, Watson Blair bestudios...@gmail.com
  wrote:
   the file send.php is:
  
   ?php
  
   $subject =$_POSTsubject;
  
   $message=$_POSTmessage;
  
   $name=$_POSTname;
  
   $from=$_POSTfrom
  
   $mail_from=$_POSTfrom;
  
   $to =$_POSTto;
  
   $header = From: {$name}  {$from} ;
  
   $send_contact=mail($to,$subject,$message, $header);
  
   if($send_contact){
   echo Thank you for Contacting Us!;
   }
   else {
   echo An error occurred while sending your message, review your
  information
   and please try again.;
   }
   ?
 
  Please note that code does not sanitize your inputs and would
  therefore be vulnerable to email header injection:
 
  http://www.nyphp.org/PHundamentals/8_Preventing-Email-Header-Injection
 
  --
  Benjamin Hawkes-Lewis
 




-- 
A Brandon_R Production


RE: [PHP] CURL cannot connect to URL - IP address - after successful connection

2010-04-26 Thread Tommy Pham
 -Original Message-
 From: ioan...@btinternet.com [mailto:ioan...@btinternet.com]
 Sent: Monday, April 26, 2010 7:10 AM
 To: Tommy Pham
 Subject: Re: [PHP] CURL cannot connect to URL - IP address - after
successful
 connection
 
 
 
 On 2010/04/27 1:13, Tommy Pham wrote:
  -Original Message-
 
  I assume that you did full testing with the browser as I suggested?
  If everything works, one other thing to keep in mind is that the
  target also may implement reverse DNS lookup in their anti-bot.  One
  good way to test that is to remote in via SSH (if on Linux/Unix) to test
with
 wget.
  Otherwise, I'm pretty sure that target site have some anti-bot
  mechanisms in place.  Microseconds of analyzing valid 'user' requests
  is better than processing 2-3 seconds and sending the response which
  will consume bandwidth.  What you could also try is setting different
  user-agents for every request and use cookies in cURL should the
  target site have an anti-bot mechanism.
 
  Regards,
  Tommy
 
 
 Yes, I think I have tested with/without cookies on the browser, trying
 different user agents (code emailed previously using array and rand) and
 cookies are used in script/not used.

And it works on subsequent requests?

 
 I cannot work out how to use Putty/ssh/public private keys etc..wget...
 

Learning how to use that is easier than learning to code PHP, IMO.
 
 I read about some problems with curl setting the port and a required patch
 on the server.
 
 John

If cURL requires some kind of patch as you say, then it wouldn't have work
in the first place.  Perhaps it's better to post your (obfuscated personal
data) code.  Or try on your local PC on your local web server to eliminate
possibility of proxies, anti-bots, etc... problems to test that your code
works as intended and not cURL problem as you say.  I didn't have problems
using cURL before.  But then my targeted sites were very big companies and
didn't care about bots much.

Regards,
Tommy

PS:  Always reply to the list so others in the future can benefit unless
it's something personal.


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



[PHP] “五步连贯”股权激励法

2010-04-26 Thread aopi
下午 12:54:38


  《 “五步连贯”股权激励法--留驻核心人才  》

时 间:2010年5月29-30日(深 圳)  
时 间:2010年6月04-05日(上 海) 

  (股权激励第一人薛中行博士主讲)为企业建立最完善的股权激励方案

◆课程对象:企业总裁、董事长、总经理、决策者、人力资源总监、财务总监及薪
资福利经理、中高层管理人员、HR管理从业人员等。 

◆课--程--背--景: 
 * 如何让新员工入职后就有归属感?
 * 如何让老员工永具激情和创造力?
 * 如何让核心员工与企业同心同德?
 * 如何让公司高管与你不离不去?
 * 如何合理设计股权激励方案?◆如何能让激励达到长期有效?
 * 如何优化企业股权?
 * 如何在股权被稀释的同时保持控制权和经营权的统一?
 * 如何既保持企业股权激励的功能发挥,又能将其操作与法律风险控制到一个防火
墙内?…… 薛中行教授将在课上一一为您揭晓答案,手把手教您设计适合自身企业
的股权激励方案。 为您的企业打造“金手铐”,有效留住核心人才,增强企业凝聚
力;
  为您的企业打造“金钥匙”,彻底激发员工潜能,加速企业实现目标、发展壮大;
  为您的企业打造“金色降落伞”,圆满解决元老退出各大难题;
……目前,员工持股、年底分红等“股权激励”问题是众多企业最为关注的核心问题
,薛博士“手把手”教您运用股权期权这一独特的“创富机器”,为您的企业量身打
造一幅诱人的
   “金手铐”,开启人才价值的“金钥匙”。

◆课--程--收--益:
  咨询式培训--课程采取小班制授课方式,这样可以更好的保证授课效果,方便现场
咨询与互动,让学员真正的能够学到、悟到、得到进而可以做到。创新性与唯一性-
-国内首家系统性的股权激励培训,先后创造了业内五个第一。系统性与全面性--课
程从人力资本提升的角度出发结合当前的法律、法规、财务、税务等各方面内容从方
案设计到激励实施都进行系统而全面的阐述。真实性与实用性---课程中所讲的股权
设计模式都是薛博士在近十年来他亲自参与的各大中型企业的实际顾问案例中总结提
炼出来的,完全都能转化运用在学员企业上.并且分享。
  股权激励方面的众多经典案例,具有极高的学习和参考价值。个性化与专业性---
由薛博士亲自与学员在workshop中进行一对一的辅导与交流,运用其深厚专业的学术
知识与丰富的实战经验为学员“量体裁衣”,制定最佳方案。 

◆课--程--大--纲:
◇模块一 五步连贯股权激励法
(一)股权激励“前奏曲”
1、股权、股份与股票
2、实股、期股与期权
3、短期、中期与长期
4、赠与、购买与赊账
5、有形、无形与计量
思考:财聚人聚VS财散人聚?朝三暮四vs朝四暮三? 
(二)股“好的模式是成功的一半”
1、期权模式
2、限制性股票模式
3、股票增值权模式
4、虚拟股票模式
研讨:如何根据自身情况,选择合适的股权激励模式组合?
动态股权制的建构 
(三)人“重在人力资本投资”
1、对岗还是对人?
2、从精英到员工,多大范围股权激励才合适?
3、工作性质与股权激励:高管、核心技术人员,还是营销骨干?
4、定人三段论
5、股权激励留人的核心在哪里?
思考:《劳动合同法》下如何巧用股权激励达到激励和约束知识员工的目的?
(四)价“人力资本可计量”
1、如何给企业合理估值定价?上市公司的期权定价模型
2、如何给人员合理估值定价?
3、技术管理要素如何合理入股?
4、如何合理设计激励杠杆?
思考1:内部市场价格VS 外部评估价格?
思考2:唐骏的十亿身价与紫金矿业的高溢价发行有无联系?
(五)量“过犹不及、与时俱进”
1、你的蛋糕有多大?
2、从1%到10%
3、六十年后看你的企业
思考:如何合理分配股份、期权额度和数量?
既不缺乏激励力度,又避免过度激励,稀释股权。 股权激励的相对数论。
(六)时“嵌套与循环”
1、 生命周期vs行业特点
2、 股权激励的长周期与短周期
3、 延期支付与股权激励
4、 8年限制期
思考:如何选择“对的时间”来完成对的事?
研讨:金手铐是如何铸就的?

◇模块二 股权激励方案设计技巧
(一)股权激励成功的七个关键要素
1、如何评价一个股权激励的成功?
2、股权激励7要素 
(二)股权激励争议案例深度剖析
1、TCL的股权激励:从赞许到失望
2、光明乳业:股权激励四人行
3、海尔高管为何辞职? 
(三)股权激励的设计环节与流程
1、 股权激励整体设计流程
2、 股权激励三阶段论
3、 如何循序渐进发展股权激励
4、股权期权的会计处理及有关问题 
四、我们该如何设计股权激励方案? 

◇模块三 股权激励相关法律问题 
1、案例分析:股权激励四大争议案例
2、证监会关于股权激励的有关规定
3、上市公司股权激励案例分析
4、财政部 国税总局等有关股权激励的规定
5、会计准则中的股份支付 
思考:如何在股权激励的同时设计限制性条款? 

◇模块四 股本设计股权治理技巧
1、如何合理设计股权
2、影子股票、信托股票与虚拟股票的对比。
重点研讨:如何有效设计法律防火墙,避免股权纠纷,规避为上市造成障碍

◇模块五 股权激励实战案例讨论会 
与薛中行博士深入探讨自身企业设计与实施股权激励方案涉及的种种实际问题。 

◆讲--师--介--绍:
  薛中行博士:股权激励第一人;毕业于中国著名高等学府复旦大学,在复旦大学
经济管理学院接受现代经济学的培养,并多次应邀访学于英美等著名高等学府。同
时出于对中国优秀古典文化的热爱,中行博士亦潜心钻研《周易》二十余载,具有
现代商业经济与中国古典哲学的双重思维方式和文化底蕴。
◇中国证监会登记结算股权激励课题组组长
◇经济学博士、资深投资银行专家
◇中国股权激励第一人,国内实战派股权激励专家
◇企业“股权激励”领域的拓荒者、权威专家
◇担任近百家企业的首席咨询顾问
◇擅长讲授人力资源与资本运作各模块的课程,尤其是股权激励课程
◇中大、浙大等多家著名院校客座教授,主讲股权激励课程,满意度高达95%
◇先后创造了业内众多个第一:
第一家系统总结了各种股权激励案例,并在此基础上提炼出国内唯一成熟可行的“
五步连贯股权激励法”;
第一家采用“股权释兵权”,为浙江一福布斯上榜企业成功解决了“元老退出”难题;
第一家将“博弈论”的分析工具引入到中国企业咨询实际,帮助企业在战略制定、股
权分配、岗位评估、企业文化方面进行独特的应用;
第一家提出“人力资源股权化”、“人力资源证券化”概念,帮助大量企业解决员工
激励难题,实现了人力资源的资本化运作;
第一家帮助双家族企业解决了公司治理难题。
薛博士有近20年的从业经验,组织并成功实施过众多著名企业公司的咨询项目,
其中包括海尔集团、宝钢集团、中石化、中外运、交通银行、华泰证券、泰阳证券、
汉王科技、海南航空、天津电力、北仑电厂、苏源集团、苏通房地产、亿达集团、长
甲集团、圣马纸业、苏常柴、民丰特纸、江苏交科院、临淄信用社、鄞州银行等,在
业界具有相当知名度。早年中行博士曾经任职于上海实业、华泰证券、联合证券等企
业,具有丰富的企业管理、企业上市、重组并购,的实战经验;熟悉ESOP(员工持股
计划)、限制性股权、业绩股票、分红权、虚拟股权、增值权等长期激励机制,在绩
效评估,平衡积分卡,薪资体系方面有着成功的案例,先后为多家福布斯上榜企业提
供咨询。
●导师授课风格
◇具有一流的讲师风格,亲和力强,是位极具人格魅力的讲师。
◇在中山大学、浙江大学等EMAB主讲的股权激励课程授课满意度连续4年排名第1。
◇深厚的理论功底和10多年近100家企业首席咨询顾问的实操经验,使其讲授的课程理
论联系实际、深入浅出,与学员产生强烈共鸣;有实例、有工具,操作性极强。
◇倡导快乐学习。授课语言风趣幽默、注重互动、鼓励参与,深受客户和学员的欢迎。 
-
◆主-办-单-位:中--培--信--息--网

◆标-准-费-用: ¥4500元/人(含指定内部教材、午餐、茶点费等)

◆报-名-咨-询:T E L: (0755) 6128 0152(深 圳)

◆报-名-咨-询:T E L: (0 2 1) 5108 3290(上 海)
-
   [报  名  回  执  表] 

   F A X:(07 55) 6128 0153 或 (0 2 1) 5108 3296

我单位共人报名参加2010年___月日在□深圳、□上海举办的:“五步连贯”

股权激励法--留驻核心人才;

单位名称:___ 参会人数:_人 

联系人:___ 电 话:__ 传 真:

参会费用:¥:__元邮 件:_

参 会 人:___

付款方式:□1、现金□2、转帐

预订项目:□是、□否 住宿(请选择打“√”)

 备注:请您把报名回执回传我司,��确保您报名无误,请您再次电话确认!