Re: [PHP] PHP live chat

2009-12-14 Thread Ghodmode
I've played around with CraftySyntax LiveHelp, but I haven't deployed it 
in a production environment.  It definitely looks like it's worth a try, 
though.


http://www.craftysyntax.com/

On 14/12/09 21:14, Angelo Zanetti wrote:

Hi all,
I know there are a lot of scripts that one can pay for, for "live chat" -
website support.

Are there are any free open source ones that work well?

I found: www.phplivechat.com

But still waiting to evaluate it.

Please send you comments, good or bad and what you would recommend or not
recommend and why

Thanks in advance.

Angelo


http://www.wapit.co.za
http://www.elemental.co.za
   


--
*Vince Aggrippino*
a.k.a. Ghodmode
www.ghodmode.com 


RE: [PHP] PHP live chat

2009-12-14 Thread Angelo Zanetti


-Original Message-
From: Philip Thompson [mailto:philthath...@gmail.com] 
Sent: 15 December 2009 12:01 AM
To: Angelo Zanetti
Cc: php-general@lists.php.net
Subject: Re: [PHP] PHP live chat

On Dec 14, 2009, at 2:14 AM, Angelo Zanetti wrote:

> Hi all, 
> 
> I know there are a lot of scripts that one can pay for, for "live chat" -
> website support.
> 
> Are there are any free open source ones that work well?
> 
> I found: www.phplivechat.com
> 
> But still waiting to evaluate it.
> 
> Please send you comments, good or bad and what you would recommend or not
> recommend and why
> 
> Thanks in advance.
> 
> Angelo

We used phplivechat at my last company. I'm pretty sure I was the one who
set it up, and I don't remember hating it. It seemed to work pretty reliably
and our customers seemed to have enjoyed it. I'd recommend it.

~Philip=


Thanks Philip. 
I will look into it!

Regards
Angelo

http://www.elemental.co.za
http://www.wapit.co.za


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



Re: [PHP] MySQL Appeal from Monty

2009-12-14 Thread Lester Caine

Philip Thompson wrote:

On Dec 14, 2009, at 12:51 AM, Lester Caine wrote:


Lenin wrote:

You might also like this:
Come on Monty - Lukas Smith http://bit.ly/5lmwwD

I've been watching some of this debate with interest, but I'll stay with a 
database that has none of the baggage that MySQL has always had, and IS 
currently replacing Oracle in many large sites :)

--
Lester Caine - G8HFL


Do share your db of interest... (and please don't say MSSQL).


It's on my sig 
Firebird
It was Jim Starkey who wrote the original code for it and who MySQL poached to 
try and create a version of MySQL with the same power. Something which has not 
been completed.

I've been running Firebird since it's closed source Interbase days last century!

--
Lester Caine - G8HFL
-
Contact - http://lsces.co.uk/wiki/?page=contact
L.S.Caine Electronic Services - http://lsces.co.uk
EnquirySolve - http://enquirysolve.com/
Model Engineers Digital Workshop - http://medw.co.uk//
Firebird - http://www.firebirdsql.org/index.php

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



Re: [PHP] MySQL Appeal from Monty

2009-12-14 Thread Joseph Masoud
On 14 Dec 2009, at 22:01, Ashley Sheridan   
wrote:



On Mon, 2009-12-14 at 15:59 -0600, Philip Thompson wrote:


On Dec 14, 2009, at 12:51 AM, Lester Caine wrote:


Lenin wrote:

You might also like this:
Come on Monty - Lukas Smith http://bit.ly/5lmwwD


I've been watching some of this debate with interest, but I'll  
stay with a database that has none of the baggage that MySQL has  
always had, and IS currently replacing Oracle in many large sites :)


--
Lester Caine - G8HFL


Do share your db of interest... (and please don't say MSSQL).

~Philip





MSSQL has nearly brought me to tears and could have easily made me  
bald

through hair pulling!

I have to say, I do like MySQL, it's very flexible and fast, and being
able to choose different storage engines for different tables in the
same DB is brilliant! I really don't think there's anything to overly
worry about from Oracle, as the two DB's have different audiences.

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


Unfortunately, I do not share your optimism.  I believe that Oracle  
taking over MySQL would be a disaster of epic proportions.


The "different audiences" theory has been bought up several times but  
I haven't [to date] seen a sound justification for it. Oracle wants  
everyone to use ... Oracle, I can't see how this "different audiences"  
theory is going to make Oracle promote MySQL, perhaps someone can tell  
me?


I don't think the EU would be able to do anything about it.  The  
powerful companies almost always get what they want.


I don't think Monty wouldn't be doing this unless he felt that  
something [put mildly] bad is coming.


What has happened, has happened.  Trying to figure out who is to blame  
for this mess is pointless. Ideally, It would be nice if Oracle took  
its claws off MySQL and found another project to ruin.


Note: I am *not* trying to spread FUD

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



Re: [PHP] PHP + ODBC

2009-12-14 Thread James McLean
On Tue, Dec 15, 2009 at 10:03 AM, Philip Thompson
 wrote:
> My head hurts from hitting it on my desk all day, so I thought I'd turn to a 
> fresher set of eyes. The issue I'm having is getting PHP to connect ODBC. I 
> can get it to work using isql from the command line. Can you verify my 
> settings:
>
[snipped]
>
> I've tried the above DSNs and many other versions of it ad nauseum. The 
> specific error I'm getting is... "[unixODBC][Driver Manager]Data source name 
> not found, and no default driver specified." I really have searched high and 
> low for a solution, but to no avail. Any thoughts?

Why not just use the built in MySQL libraries or PDO?

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



Re: [PHP] Class not functioning

2009-12-14 Thread Nirmalya Lahiri
--- On Tue, 12/15/09, Allen McCabe  wrote:

> From: Allen McCabe 
> Subject: [PHP] Class not functioning
> To: "phpList" 
> Date: Tuesday, December 15, 2009, 6:17 AM
> Hey everyone, I just delved into
> classes recently and have been having
> moderate success so far.
> 
> I have a puzzler though.
> 
> I have the following class decalred and instantiated:
> 
> class Notify {
>  var $q = array();
> 
>  public function addtoQ($string, $class)
>  {
>   $message = ''.
> $string .'';
>   $this->q[] = $message;
>  }
> 
>  public function printQ()
>  {
>   if (isset($q))
>   {
>    echo ' class="notification">';
>    foreach($this->q as $msg)
>    {
>     echo $msg ."\n";
>    }
>    echo '';
>   }
> 
>   return;
>  }
> 
>  function __destruct()
>  {
>   if (isset($q))
>   {
>    unset($this->q);
>   }
>  }
> } // END CLASS Notify
> 
> 
> And in my script, I call it like so:
> $Notif = new Notify;
> 
> I have run other statements in other classes that should be
> adding to the $q
> array (ie. Notify::addtoQ('ERROR! There Was An Error
> Updating The
> Database!', 'error');)
> 
> However, when I try to get my webpage to display them
> using:
> 
> $Notify->printQ();
> 
> it does not seem to want to loop through this array (and
> print the
> messages). I am getting NO error message, in fact
> everything 'looks' fine,
> I'm just not seeing the appropriate message.
> 
> Any help would be appreicated!
> 

Allen,
 You have made a small typing mistake in function printQ() where you would like 
to checked the array for its existence. By mistake you have wrote "if 
(isset($q))". But your array variable is not an freely accessible array,the 
array is embedded into an object. So, you have to write the like "if 
(isset($this->q))".

 Another point, you can't add a message into the array by calling the member 
function addtoQ() using scope resolution operator "::". If you really want to 
add message into the array, you have to call the member function from within 
the object. (ie. $Notif->addtoQ('ERROR! There Was An Error Updating The 
Database!', 'error');).

---
নির্মাল্য লাহিড়ী [Nirmalya Lahiri]
+৯১-৯৪৩৩১১৩৫৩৬ [+91-9433113536]





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



[PHP] Class not functioning

2009-12-14 Thread Allen McCabe
Hey everyone, I just delved into classes recently and have been having
moderate success so far.

I have a puzzler though.

I have the following class decalred and instantiated:

class Notify {
 var $q = array();

 public function addtoQ($string, $class)
 {
  $message = ''. $string .'';
  $this->q[] = $message;
 }

 public function printQ()
 {
  if (isset($q))
  {
   echo '';
   foreach($this->q as $msg)
   {
echo $msg ."\n";
   }
   echo '';
  }

  return;
 }

 function __destruct()
 {
  if (isset($q))
  {
   unset($this->q);
  }
 }
} // END CLASS Notify


And in my script, I call it like so:
$Notif = new Notify;

I have run other statements in other classes that should be adding to the $q
array (ie. Notify::addtoQ('ERROR! There Was An Error Updating The
Database!', 'error');)

However, when I try to get my webpage to display them using:

$Notify->printQ();

it does not seem to want to loop through this array (and print the
messages). I am getting NO error message, in fact everything 'looks' fine,
I'm just not seeing the appropriate message.

Any help would be appreicated!


[PHP] strip tags but preserve title attributes

2009-12-14 Thread Ashley Sheridan
I'm looking for a way to strip HTML tags out of some text content
(sourced from a web page) to leave just the text which I'll be running
some basic analysis on. The thing is, I want to preserve text that is in
alt and title attributes. I can't use any DOM functions, as I can't
guarantee that the content will be valid XHTML, although it should be
valid HTML.

I'm happy doing this with string functions and regular expressions, but
I was wondering if something for this already existed? The server I plan
on putting this on does not have access to the shell (although it is a
Linux server) so I won't be able to have Lynx or Elinks parse the
content for me either :(

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




[PHP] PHP + ODBC

2009-12-14 Thread Philip Thompson
Hello all.

My head hurts from hitting it on my desk all day, so I thought I'd turn to a 
fresher set of eyes. The issue I'm having is getting PHP to connect ODBC. I can 
get it to work using isql from the command line. Can you verify my settings:

/etc/odbc.ini:

[MySQL]
Description = MySQL 3.51 ODBC driver
Driver  = MySQL
Host= s-irv-web02
Server  = s-irv-web02
UID = user
Password= pass
Database= clients
Port= 3306

/etc/odbcinst.ini:

[MySQL]
Description = ODBC 3.51 for MySQL
Driver  = /usr/lib/libmyodbc3.so
Setup   = /usr/lib/libodbcmyS.so
FileUsage   = 1
UsageCount  = 2

Again, isql allows me to connect with the same settings as above: isql MySQL 
user pass

I've tried several settings in PHP to attempt to connect to it. All have been 
fruitless:



I've tried the above DSNs and many other versions of it ad nauseum. The 
specific error I'm getting is... "[unixODBC][Driver Manager]Data source name 
not found, and no default driver specified." I really have searched high and 
low for a solution, but to no avail. Any thoughts?

Thanks in advance,
~Philip
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] MySQL Appeal from Monty

2009-12-14 Thread Ashley Sheridan
On Mon, 2009-12-14 at 15:59 -0600, Philip Thompson wrote:

> On Dec 14, 2009, at 12:51 AM, Lester Caine wrote:
> 
> > Lenin wrote:
> >> You might also like this:
> >> Come on Monty - Lukas Smith http://bit.ly/5lmwwD
> > 
> > I've been watching some of this debate with interest, but I'll stay with a 
> > database that has none of the baggage that MySQL has always had, and IS 
> > currently replacing Oracle in many large sites :)
> > 
> > -- 
> > Lester Caine - G8HFL
> 
> Do share your db of interest... (and please don't say MSSQL).
> 
> ~Philip
> 
> 


MSSQL has nearly brought me to tears and could have easily made me bald
through hair pulling!

I have to say, I do like MySQL, it's very flexible and fast, and being
able to choose different storage engines for different tables in the
same DB is brilliant! I really don't think there's anything to overly
worry about from Oracle, as the two DB's have different audiences.

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




Re: [PHP] Best ajax library

2009-12-14 Thread Philip Thompson
On Dec 14, 2009, at 4:27 AM, Ali Asghar Toraby Parizy wrote:

> Hi
> I think the best choice is jquery until now.
> But, is it reasonable to combine jquery and other library to client
> side and server side scripting respectively?
> By the way, where i can find good lessons about jquery and php?

I really like this js library.

http://mootools.net/

It's based off of jquery or prototype... I can't remember.

~Philip

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



Re: [PHP] PHP live chat

2009-12-14 Thread Philip Thompson
On Dec 14, 2009, at 2:14 AM, Angelo Zanetti wrote:

> Hi all, 
> 
> I know there are a lot of scripts that one can pay for, for "live chat" -
> website support.
> 
> Are there are any free open source ones that work well?
> 
> I found: www.phplivechat.com
> 
> But still waiting to evaluate it.
> 
> Please send you comments, good or bad and what you would recommend or not
> recommend and why
> 
> Thanks in advance.
> 
> Angelo

We used phplivechat at my last company. I'm pretty sure I was the one who set 
it up, and I don't remember hating it. It seemed to work pretty reliably and 
our customers seemed to have enjoyed it. I'd recommend it.

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



Re: [PHP] MySQL Appeal from Monty

2009-12-14 Thread Philip Thompson

On Dec 14, 2009, at 12:51 AM, Lester Caine wrote:

> Lenin wrote:
>> You might also like this:
>> Come on Monty - Lukas Smith http://bit.ly/5lmwwD
> 
> I've been watching some of this debate with interest, but I'll stay with a 
> database that has none of the baggage that MySQL has always had, and IS 
> currently replacing Oracle in many large sites :)
> 
> -- 
> Lester Caine - G8HFL

Do share your db of interest... (and please don't say MSSQL).

~Philip


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



[PHP] Problem with LDAP functions in PHP

2009-12-14 Thread Lic. Eduardo Ricardo Hernandez Osorio
Hello:
I am trying to accomplish searches in a Windows active directory through
LDAP functions in PHP, but the function ldap_search and ldap_get_entries are
out of service, they give the following error messages 

Warning: ldap_search() [function.ldap-search]: Search: Operations error in
C:\xampp\htdocs\asesor\ldaptest.php on line 20

Warning: ldap_get_entries(): supplied argument is not a valid ldap result
resource in C:\xampp\htdocs\asesor\ldaptest.php on line 22

Here I send you the PHP code:
$r=ldap_bind($ds, 'iespaloma\\poweruser', 'dfku34*+); //
Autentificacion anonima, habitual de los accesos de solo lectura
echo "El resultado de la autentificacion es ".$r."";
$persona = 'Ad';
$dn = "dc=iespaloma,dc=com";
$filtro="(givenname=$persona*)";
$solonecesito = array( "ou", "sn", "givenname", "mail");
$sr=ldap_search($ds, $dn, $filtro, $solonecesito);
$info = ldap_get_entries($ds, $sr); 
I believe that the error occur due a bad DN that I am passing to the
function, Could anyone help me to solve this problem?


 
Aeropuerto Internacional Frank País García de Holguín.





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



[PHP] can't retrieve more than 1 record at the time still

2009-12-14 Thread Catherine Madsen

Hi Again,

Following the suggestions I received from a earlier post, I've closed 
the statement

while ($stmt->fetch(PDO::FETCH_BOUND))
before $stmt = NULL;
I don't get an error anymore, but still retrieve only one record.

To check that the array was being filled correctly, I inserted in several places 
$ncand = count($_SESSION['numberCand']);

$ndocid = count($_SESSION['DOCIDs']);
and the count is always 0 for $ndocid and 1 for $ncand.
Now I believe that the array is not being filled, and that's why only the last record gets processed. 
Can anybody see what I'm doing wrong in the for each statement?  The updated code is below.
Thank you for your help.  


Catherine


Earlier message:
I'm really in need of help.  I'm not a PHP programmer, but I've been 
given the privilege of customizing a script written by somebody else and 
can't get it to work right.  I have to query 2 different tables in 2 
different Oracle 10G DBs, one's mine (my_schema.my_table), the other 
(otherdb.other_table) belongs to another department.  In my_table, I 
have the doc_id and the app_id for a record.  In other_table there's the 
doc_id and pdf  to retrieve.  The goal is to make a PDF file from each 
BLOB in other_table and store them in the right directory under 
hash(app_id).  PDO has been installed and working, and I can connect to 
both DBs without a problem.  If my query limits the retrieval to one 
record, the script works, but if I try to run it for all records, one 
pdf  file is correctly created in the right directory then  I get the 
following error: PHP Fatal error:  Call to a member function fetch() on 
a non-object in /my_location/my_script.php on line 154.  It the "while 
($stmt->fetch(PDO::FETCH_BOUND))" line.  I've pasted my script below.  I 
thought my problem was that maybe I was in the wrong directory after 
creation of the first pdf, but  several tries changing the directory 
didn't make a difference.  Right now, I'm running the script at the 
command line.  Soon I'm going to have a few hundred records to deal with 
and cannot do it one by one!  Any help would be very much appreciated.  
Thank you!


getMessage());
   exit;
}


if (empty($_SESSION['docIDs']))
{
$_SESSION['DOCIDs'] = array();
$_SESSION['msgs'] = array();

$sql = "SELECT COUNT(*) all_rec FROM myschema.mytable
where academic_year = 2010";

$_SESSION['numberCand'] = 0;  /* initialize ctr for stack popping */
$_SESSION['PHPulled'] = 0; /* number new personal histories pulled */

if ($res = $dbh1->query($sql))

{

/* Check the number of rows that match the SELECT statement */
  if ($res->fetchColumn() > 0)
{
/* Issue the real SELECT statement and work with the 
results */
 $sql = "select doc_id, app_id
from myschema.mytable
where academic_year = 2010";

   foreach ($dbh1->query($sql) as $row)
   {

$cand = array();
$cand['DOC_ID']= $row['DOC_ID'];
$cand['APP_ID'] = $row['APP_ID'];
$_SESSION['DOC_IDS'][] = $cand;

   }
  }
$ncand = count($_SESSION['numberCand']);
$ndocid = count($_SESSION['DOCIDs']);
print "Cand Number: " .  $ncand . "\n";
print "DOCid Number: " .  $ndocid . "\n";
}
}

if (!empty($_SESSION['DOC_IDS']) and $_SESSION['numberCand'] < 
count($_SESSION['DOC_IDS']))
{   
$ncand = count($_SESSION['numberCand']);
$ndocid = count($_SESSION['DOCIDs']);
print "Cand Number: " .  $ncand . "\n";
print "DOCid Number: " .  $ndocid . "\n";

   /* if have doc_IDs, pick next one off array  */
   $cand = $_SESSION['DOC_IDS'][$_SESSION['numberCand']];

   if ($cand['DOC_ID'] == 0)
   {  /*  redirect to self to get next candidate with updated numberCand */
   $_SESSION['numberCand'] = $_SESSION['numberCand'] + 1;
   exit;
   }

$dirname = md5($cand['APP_ID']);
$curdir = '/my_location/'.$dirname;

print "App_id/Dir: " .  $row['APP_ID'] . $curdir . "\n";

 if (!(is_dir($curdir)))

  {
  if (!mkdir($curdir,0775))
  print "error: " . $curdir . "\n";
  exit;
  }

/* Second Oracle DB connection  info removed */

try
{
$dbh2 = new 
PDO("oci:dbname=".$tns2,$db2_username,$db2_password);

}

catch(PDOException $e)
{
echo ($e->getMessage());
exit;
}


$stmt = $dbh2->prepare('select PERSONAL_HIST_PDF_CONTENT from 
otherdb.other_table
where DOC_ID = :id');

$stmt->bindParam(':id', $cand['DOC_ID'], PDO::PARAM_INT);
$stmt->bindColumn(1, $PDF, PDO::PARAM_LOB);

$stmt->execute();


Re: [PHP] Problem with XPath query

2009-12-14 Thread Jim Lucas
Lester Caine wrote:
> 
> I often find that it's quicker to ask - because invariably the answer
> presents itself the second you hit send ;)
> 

Isn't that the truth!

Jim

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



Re: [PHP] Problem with XPath query

2009-12-14 Thread Lester Caine

Christoph Boget wrote:

You are missing a quote after widgetType:


Yeah, I realized that about 2 minutes after I sent the message.  Man,
I'm dumb. :p  I was banging my head against the wall for a while
because of that.  I guess when you bring your stupidity public, you'll
find the solution yourself that much quicker. ;)


I often find that it's quicker to ask - because invariably the answer presents 
itself the second you hit send ;)


--
Lester Caine - G8HFL
-
Contact - http://lsces.co.uk/wiki/?page=contact
L.S.Caine Electronic Services - http://lsces.co.uk
EnquirySolve - http://enquirysolve.com/
Model Engineers Digital Workshop - http://medw.co.uk//
Firebird - http://www.firebirdsql.org/index.php

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



Re: [PHP] Problem with XPath query

2009-12-14 Thread Christoph Boget
> You are missing a quote after widgetType:

Yeah, I realized that about 2 minutes after I sent the message.  Man,
I'm dumb. :p  I was banging my head against the wall for a while
because of that.  I guess when you bring your stupidity public, you'll
find the solution yourself that much quicker. ;)

thnx,
Christoph

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



Re: [PHP] Problem with XPath query

2009-12-14 Thread Jonathan Tapicer
Hi,

You are missing a quote after widgetType:

[...@alias="widgetType and @value="system"]

should be

[...@alias="widgetType" and @value="system"]

Regards,

Jonathan

On Mon, Dec 14, 2009 at 1:52 PM, Christoph Boget
 wrote:
> Given the following XML:
>
> 
>  
>    
>      
>    
>  
> 
>
> I'm using the following query:
>
> $oXPath->query( '//DisplayRef/paramet...@alias="widgetType and
> @value="system"]' );
>
> and I'm getting the following error:
>
> Warning: DOMXPath::query() [function.DOMXPath-query]: Invalid predicate
>
> If I remove this part of the query
>
> [...@alias="widgetType and @value="system"]
>
> the error goes away.
>
> As far as I can tell from googling around, the query is valid.  If
> that's the case, I don't understand what's causing the error.
> Could someone explain to me what I'm doing wrong?
>
> thnx,
> Christoph
>
> --
> 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] Problem with XPath query

2009-12-14 Thread Christoph Boget
Given the following XML:


  

  

  


I'm using the following query:

$oXPath->query( '//DisplayRef/paramet...@alias="widgetType and
@value="system"]' );

and I'm getting the following error:

Warning: DOMXPath::query() [function.DOMXPath-query]: Invalid predicate

If I remove this part of the query

[...@alias="widgetType and @value="system"]

the error goes away.

As far as I can tell from googling around, the query is valid.  If
that's the case, I don't understand what's causing the error.
Could someone explain to me what I'm doing wrong?

thnx,
Christoph

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



Re: [PHP] Highlighting image map on load

2009-12-14 Thread tedd

At 4:37 AM -0800 12/14/09, leledumbo wrote:

I have image map with dynamic circle areas whose coordinates stored in
database. I'd like to colorize these areas so that it's obvious to see them.
Most solutions I found on the net highlights the area on mouse hover, while
my needs is to do it once when the window is loaded. Any idea?


Idea?

Yes, this is a server-side function -- as such, you'll need a 
server-side language.


I think the problem has been solved. If it was me, I would start with 
jQuery. Here's an example of a mouseover hover effect.


http://sexy.hohli.com/

Apologies for the content, but the effect I think is similar to what 
you wanted.


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] file_get_contents ($file) works -- file_get_contents ($url) returns false

2009-12-14 Thread Ashley Sheridan
On Mon, 2009-12-14 at 17:03 +0200, Cafer Şimşek wrote:

> René Fournier  writes:
> 
> > On 2009-12-14, at 10:44 PM, Cafer Şimşek wrote:
> >
> >> René Fournier  writes:
> >> 
> >>> 4.as per php.ini, allow_url_fopen On
> >> 
> >> Look at from phpinfo() the settings is already "On".
> >
> > Yes, I know.
> >
> > Which is why it's odd that the function fails on URLs.
> 
> try to get url content from any browser or (if you use Linux / Unix)
> curl.
> 
> -- 
> Cafer Şimşek
> DEV Staff Leader
> http://pazar.com/
> 


He already said Curl works, and changing the browser won't affect what
PHP is doing.

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




Re: [PHP] file_get_contents ($file) works -- file_get_contents ($url) returns false

2009-12-14 Thread Cafer Şimşek
René Fournier  writes:

> On 2009-12-14, at 10:44 PM, Cafer Şimşek wrote:
>
>> René Fournier  writes:
>> 
>>> 4.  as per php.ini, allow_url_fopen On
>> 
>> Look at from phpinfo() the settings is already "On".
>
> Yes, I know.
>
> Which is why it's odd that the function fails on URLs.

try to get url content from any browser or (if you use Linux / Unix)
curl.

-- 
Cafer Şimşek
DEV Staff Leader
http://pazar.com/

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



Re: [PHP] Strange MySQL Problem

2009-12-14 Thread tedd

At 1:12 PM +0330 12/14/09, Parham Doustdar wrote:

Thank you, everyone. All fixed.



Really?!?

I think you would be well advised to sanitize the values coming into 
from a public $_POST.


That habit allows MySQL injection problems.

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] file_get_contents ($file) works -- file_get_contents ($url) returns false

2009-12-14 Thread René Fournier

On 2009-12-14, at 10:44 PM, Cafer Şimşek wrote:

> René Fournier  writes:
> 
>> 4.   as per php.ini, allow_url_fopen On
> 
> Look at from phpinfo() the settings is already "On".

Yes, I know.

Which is why it's odd that the function fails on URLs.


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



Re: [PHP] file_get_contents ($file) works -- file_get_contents ($url) returns false

2009-12-14 Thread Cafer Şimşek
René Fournier  writes:

> 4.as per php.ini, allow_url_fopen On

Look at from phpinfo() the settings is already "On".

Best Regards.

-- 
Cafer Şimşek
DEV Staff Leader
http://pazar.com/

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



Re: [PHP] file_get_contents ($file) works -- file_get_contents ($url) returns false

2009-12-14 Thread René Fournier
Well thanks for trying. For anyone reading this, who wants to be a hero and 
solve the impossible:

1.  file_get_contents ($url) doesn't work -- (on remote URLs or local URLs)
2.  file_get_contents ($file) works.
3.  CURL works (on remote and local URLs).
4.  as per php.ini, allow_url_fopen On

Xserve
- OS X Server 10.6.2
- PHP 5.3 (default)


So... it's as if PHP is not respecting the allow_url_fopen direction in 
php.ini. If that directive were set to Off, everything would make sense (files 
load, urls don't (local or remote)).

Anyone have anything to add? Anyone, anyone?

Bueller?


On 2009-12-14, at 10:05 PM, Gaurav Kumar wrote:

> Sorry buddy, I cant think of anything else which is going on wrong.
> 
> 
> 2009/12/14 René Fournier 
> 
> PHP Version   5.3.0
> 
> Directive Local Value Master Value
> allow_call_time_pass_referenceOff Off
> allow_url_fopen   On
> 
> 
> On 2009-12-14, at 12:26 AM, Gaurav Kumar wrote:
> 
>> What is the value for "allow_url_fopen" in your php.ini? It should be 1.
>> 
>> 
>> 
>> 
>> 
>> 2009/12/13 René Fournier 
>> CURL works (remote and local)
>> file_get_contents() doesn't work (remote or local).
>> 
>> 
>> 
>> On 2009-12-13, at 4:39 PM, Gaurav Kumar wrote:
>> 
>>> Ok Agreed. 
>>> 
>>> Lets do one last chance to ensure that your system is allowing external 
>>> connections or connection to other systems in the network-
>>> 
>>> Use Curl to get in the file contents. Check your PHP that Curl is enabled. 
>>> Through phpinfo();
>>> 
>>> If the script output the google page then this means that there is nothing 
>>> that is stopping you form getting in the content externally.
>>> 
>>> >> // $str =  file_get_contents ('http://www.google.com');
>>> // echo $str;
>>> 
>>> 
>>> // create a new cURL resource
>>> $ch = curl_init();
>>> 
>>> // set URL and other appropriate options
>>> curl_setopt($ch, CURLOPT_URL, "http://www.google.co.in";); 
>>> //http://www.google.com
>>> curl_setopt($ch, CURLOPT_HEADER, 0);
>>> 
>>> // grab URL and pass it to the browser
>>> curl_exec($ch);
>>> 
>>> // close cURL resource, and free up system resources
>>> curl_close($ch);
>>> 
>>> ?>
>>> 
>>> Thanks,
>>> 
>>> Gaurav Kumar
>>> 
>>> 
>>> 
>>> 2009/12/13 René Fournier 
>>> The thing is, the file_get_contents() fails the same way on local URLs -- 
>>> that is, web sites hosted on the same machine. Or even using the machine's 
>>> own IP address.
>>> 
>>> On 2009-12-13, at 4:00 AM, Gaurav Kumar wrote:
>>> 
 Hi Rene,
 
 The only thing which is a hurdle is that your system/computer is not 
 allowing external connections. There seems to be nothing else wrong.
 
 I strongly suggest check your system firewall, any central server settings 
 through which your system gets internet access, any antivirus s/w 
 installed etc.. this can be the only reason. Something is stopping you to 
 access external connection.
 
 Let me know when your problem is fixed.
 Also I tried the below code and it works fine-
 
 >>> $str =  file_get_contents ('http://www.google.com');
 echo $str;
 ?>
 
 Thanks,
 
 Gaurav Kumar
 
 
 
 2009/12/11 René Fournier 
 Hi Gaurav,
 
 On 2009-12-11, at 2:55 PM, Gaurav Kumar wrote:
 
> A very typical problem. Good you sent the error message.
> 
> This problem can be caused due to one of the following-
> 
> 1. I have faced similar problem due to local firewall settings.
 
 Don't think this is it, since (1) the firewall settings haven't changed, 
 and (2) other machines on the same network can execute this same code and 
 function (but they aren't running OS X Server 10.6.
 
> 2. Try some other domain; i.e. other than google com. Try some of the 
> local area website with a particular page like 
> www.somedomain.com/somefile.html
 
 I've tried many different external and local web sites, and they all fail.
 
> 3. Some times the remote host does not allow you to connect to get the 
> file contents.
 
 (Also not the cause -- as explained above.)
 
 
> 4. # 3 can be either way round from both the ends a) you host server does 
> not allow external connections b) Remote host does not allow anonymous 
> connection.
 
 Thanks for the options. I don't think they apply in this case. If you have 
 any other suggestions on what to do, I would welcome them.
 
 
 
> Gaurav Kumar
> blog.oswebstudio.com
> 
> 
> 
> On Thu, Dec 10, 2009 at 9:01 PM, René Fournier  
> wrote:
> I thought error_reporting would display them, but I guess php.ini had 
> them suppressed. Anyway, with:
> 
>  
> error_reporting(-1);
> ini_set('display_errors', 1);
> set_time_limit(0);
> var_dump (file_get_contents ('http://www.google.com'));
> 
> ?>
> 
> I get:
> 
> Wa

Re: [PHP] file_get_contents ($file) works -- file_get_contents ($url) returns false

2009-12-14 Thread Gaurav Kumar
Sorry buddy, I cant think of anything else which is going on wrong.


2009/12/14 René Fournier 

>
> PHP Version 5.3.0
>
> Directive Local Value Master Value
> allow_call_time_pass_reference Off Off
> allow_url_fopen On
>
>
> On 2009-12-14, at 12:26 AM, Gaurav Kumar wrote:
>
> What is the value for 
> "allow_url_fopen"
> in your php.ini? It should be 1.
>
>
>
>
>
> 2009/12/13 René Fournier 
>
>> CURL works (remote and local)
>> file_get_contents() doesn't work (remote or local).
>>
>>
>>
>> On 2009-12-13, at 4:39 PM, Gaurav Kumar wrote:
>>
>> Ok Agreed.
>>
>> Lets do one last chance to ensure that your system is allowing external
>> connections or connection to other systems in the network-
>>
>> Use Curl to get in the file contents. Check your PHP that Curl is enabled.
>> Through phpinfo();
>>
>> If the script output the google page then this means that there is nothing
>> that is stopping you form getting in the content externally.
>>
>> > // $str =  file_get_contents ('http://www.google.com');
>> // echo $str;
>>
>>
>> // create a new cURL resource
>> $ch = curl_init();
>>
>> // set URL and other appropriate options
>> curl_setopt($ch, CURLOPT_URL, "http://www.google.co.in";); //
>> http://www.google.com
>> curl_setopt($ch, CURLOPT_HEADER, 0);
>>
>> // grab URL and pass it to the browser
>> curl_exec($ch);
>>
>> // close cURL resource, and free up system resources
>> curl_close($ch);
>>
>> ?>
>>
>> Thanks,
>>
>> Gaurav Kumar
>>
>>
>>
>> 2009/12/13 René Fournier 
>>
>>> The thing is, the file_get_contents() fails the same way on local URLs --
>>> that is, web sites hosted on the same machine. Or even using the machine's
>>> own IP address.
>>>
>>> On 2009-12-13, at 4:00 AM, Gaurav Kumar wrote:
>>>
>>> Hi Rene,
>>>
>>> The only thing which is a hurdle is that your system/computer is not
>>> allowing external connections. There seems to be nothing else wrong.
>>>
>>> I strongly suggest check your system firewall, any central server
>>> settings through which your system gets internet access, any antivirus s/w
>>> installed etc.. this can be the only reason. Something is stopping you to
>>> access external connection.
>>>
>>> Let me know when your problem is fixed.
>>> Also I tried the below code and it works fine-
>>>
>>> >> $str =  file_get_contents ('http://www.google.com');
>>> echo $str;
>>> ?>
>>>
>>> Thanks,
>>>
>>> Gaurav Kumar
>>>
>>>
>>>
>>> 2009/12/11 René Fournier 
>>>
 Hi Gaurav,

 On 2009-12-11, at 2:55 PM, Gaurav Kumar wrote:

 A very typical problem. Good you sent the error message.

 This problem can be caused due to one of the following-

 1. I have faced similar problem due to local firewall settings.


 Don't think this is it, since (1) the firewall settings haven't changed,
 and (2) other machines on the same network can execute this same code and
 function (but they aren't running OS X Server 10.6.

 2. Try some other domain; i.e. other than google com. Try some of the
 local area website with a particular page like
 www.somedomain.com/somefile.html


 I've tried many different external and local web sites, and they all
 fail.

 3. Some times the remote host does not allow you to connect to get the
 file contents.


 (Also not the cause -- as explained above.)


 4. # 3 can be either way round from both the ends a) you host server
 does not allow external connections b) Remote host does not allow anonymous
 connection.


 Thanks for the options. I don't think they apply in this case. If you
 have any other suggestions on what to do, I would welcome them.



 Gaurav Kumar
 blog.oswebstudio.com



 On Thu, Dec 10, 2009 at 9:01 PM, René Fournier 
 wrote:

> I thought error_reporting would display them, but I guess php.ini had
> them suppressed. Anyway, with:
>
> 
> error_reporting(-1);
> ini_set('display_errors', 1);
> set_time_limit(0);
> var_dump (file_get_contents ('http://www.google.com'));
>
> ?>
>
> I get:
>
> Warning: file_get_contents(http://www.google.com): failed to open
> stream: Operation now in progress in //.php on line 7 bool(false)
>
> Does that help with the diagnosis?
>
>
> On 2009-12-10, at 12:28 AM, Richard Quadling wrote:
>
> > 2009/12/9 René Fournier :
> >> It is, and I use curl elsewhere in the same script to fetch remote
> content.
> >> This exact same function works fine on my MacBook Pro (10.6 client,
> PHP 5.3), and *was* previously working fine under Server 10.4.11 and PHP
> 5.3,
> >>
> >> On 2009-12-09, at 11:10 PM, laruence wrote:
> >>
> >>> try
> >>> wget http://www.google.com in your command line to see whether the
> network is reacha

Re: [PHP] Strange MySQL Problem

2009-12-14 Thread Floyd Resler
You're missing a tick in the query.  There should be a tick before the 
$_POST[ISBN].

Take care,
Floyd

On Dec 14, 2009, at 3:41 AM, Parham Doustdar wrote:

> Hello there,
> Here's a short PHP script a friend has written, and given to me to test.
> However, I am getting a MySQL error saying that the syntax error, on the
> line that contains mysql_connect(); is wrong, near '')'
> (note that it is not a PHP error, but a MySQL error.)
> Here's the code:
> 
> [code]
>  $username = "root";
> $password = "abc";
> $con = mysql_connect("", $username, $password);
> mysql_select_db ("test", $con);
> $sql = "INSERT INTO BOOK(bookname, authorsname, ISBN) VALUES
> ('$_POST[bookname]', '$_POST[authorsname]', $_POST[ISBN]')";
> if (!mysql_query($sql, $con))
> {
> die( 'error: ' . mysql_error());
>  }
> echo "1 record added";
> mysql_close($con)
> ?>
> [/code]
> 
> 
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php


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



Re: [PHP] Highlighting image map on load

2009-12-14 Thread Ashley Sheridan
On Mon, 2009-12-14 at 04:37 -0800, leledumbo wrote:

> I have image map with dynamic circle areas whose coordinates stored in
> database. I'd like to colorize these areas so that it's obvious to see them.
> Most solutions I found on the net highlights the area on mouse hover, while
> my needs is to do it once when the window is loaded. Any idea?
> -- 
> View this message in context: 
> http://old.nabble.com/Highlighting-image-map-on-load-tp26777088p26777088.html
> Sent from the PHP - General mailing list archive at Nabble.com.
> 
> 


I'm not sure if you can use CSS alone to highlight, but if you can, just
give the area a class as you output it with PHP.

Otherwise, you could try and output the SVG/VML you'd need on that area
depending on the browser.

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




[PHP] Highlighting image map on load

2009-12-14 Thread leledumbo

I have image map with dynamic circle areas whose coordinates stored in
database. I'd like to colorize these areas so that it's obvious to see them.
Most solutions I found on the net highlights the area on mouse hover, while
my needs is to do it once when the window is loaded. Any idea?
-- 
View this message in context: 
http://old.nabble.com/Highlighting-image-map-on-load-tp26777088p26777088.html
Sent from the PHP - General mailing list archive at Nabble.com.


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



RE: [PHP] ip-to-country

2009-12-14 Thread Angelo Zanetti

-Original Message-
From: John Black [mailto:s...@network-technologies.org] 
Sent: 19 October 2009 11:03 AM
To: php-general@lists.php.net
Subject: Re: [PHP] ip-to-country

SED wrote:
> How can I access an index for IP to a country (or a more detailed
location)?
> I have not yet found a function for that in PHP nor a free to use website
> that offers a remote search.

http://www.hostip.info/ is free, provides a database to download and 
even allows you to query the database via GET.
Downside is that it is not very accurate but it is GPL so it is improved 
by user and visitors of the site.

The most accurate database I have seen so far is the paid database from 
maxmind.com

-- 
John


Thanks for the link John!

Angelo

http://www.elemental.co.za
http://www.wapit.co.za



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



RE: [PHP] ip-to-country

2009-12-14 Thread Angelo Zanetti


-Original Message-
From: George Langley [mailto:george.lang...@shaw.ca] 
Sent: 19 October 2009 01:38 AM
To: php-general@lists.php.net
Subject: Re: [PHP] ip-to-country

On 18-Oct-09, at 1:03 PM, SED wrote:
>
> How can I access an index for IP to a country (or a more detailed  
> location)?



has both free and various paid services.

George


Hi George, 

How accurate are the free ones compared to the paid ones?

Regards
Angelo

http://www.elemental.co.za
http://www.wapit.co.za



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



RE: [PHP] all local sites stopped working ... [SOLVED]

2009-12-14 Thread Angelo Zanetti


-Original Message-
From: cr.vege...@gmail.com [mailto:cr.vege...@gmail.com] 
Sent: 17 October 2009 02:20 PM
To: Tommy Pham; general php
Subject: Re: [PHP] all local sites stopped working ... [SOLVED]

- Original Message - 
From: "Tommy Pham" 
To: "general php" 
Sent: Saturday, October 17, 2009 2:03 PM
Subject: Re: [PHP] all local sites stopped working ...


> From: "cr.vege...@gmail.com" 
> To: Tommy Pham ; general php 
> 
> Sent: Sat, October 17, 2009 4:49:53 AM
> Subject: Re: [PHP] all local sites stopped working ...
>
>
> - Original Message - From: "Tommy Pham" 
> To: "general php" 
> Sent: Saturday, October 17, 2009 1:29 PM
> Subject: Re: [PHP] all local sites stopped working ...
>
>
>> - Original Message 
>>> From: "cr.vege...@gmail.com" 
>>> To: Tommy Pham ; general php 
>>> 
>>> Sent: Sat, October 17, 2009 4:19:17 AM
>>> Subject: Re: [PHP] all local sites stopped working ...
>>>
>>> - Original Message - From: "Tommy Pham"
>>> To: "general php"
>>> Sent: Saturday, October 17, 2009 1:02 PM
>>> Subject: Re: [PHP] all local sites stopped working ...
>>>
>>>
>>> > - Original Message 
>>> >> From: "cr.vege...@gmail.com"
>>> >> To: Tommy Pham ; general php
>>> >> Sent: Sat, October 17, 2009 3:57:48 AM
>>> >> Subject: Re: [PHP] all local sites stopped working ...
>>> >>
>>> >> - Original Message - From: "Tommy Pham"
>>> >> To: "general php"
>>> >> Sent: Saturday, October 17, 2009 12:21 PM
>>> >> Subject: Re: [PHP] all local sites stopped working ...
>>> >>
>>> >>
>>> >> > - Original Message 
>>> >> >> From: "cr.vege...@gmail.com"
>>> >> >> To: John Black
>>> >> >> Cc: php-general@lists.php.net
>>> >> >> Sent: Sat, October 17, 2009 3:17:22 AM
>>> >> >> Subject: Re: [PHP] all local sites stopped working ...
>>> >> >>
>>> >> >> - Original Message - From: "John Black"
>>> >> >> To:
>>> >> >> Cc:
>>> >> >> Sent: Saturday, October 17, 2009 11:53 AM
>>> >> >> Subject: Re: [PHP] all local sites stopped working ...
>>> >> >>
>>> >> >>
>>> >> >> > cr.vege...@gmail.com wrote:
>>> >> >> >> In php.ini I defined: error_log = >> >> >> 
>>> >> >> >> C:\Inetpub\wwwroot\PHPError.log
>>> >> >> >> then restarted the server with iisreset.exe
>>> >> >> >> then started with IE: http://127.0.0.1/.../phpinfo.php
>>> >> >> >> and after 10 minutes still "Connecting / Waiting for >> >>
>>> .../phpinfo.php"
>>> >> >> >> and still no C:\Inetpub\wwwroot\PHPError.log created ...
>>> >> >> >> Other suggestions ?
>>> >> >> >> TIA, Cor
>>> >> >> >
>>> >> >> > So it is not just .php files which will not work? If you have >>

>>> >> >> >  >> >> >  >
>>> trouble >
>>> >> with
>>> >> >> .html files as well then it almost sounds like a firewall issue >>

>>> >> >>  >> since >>
>>> your
>>> >> >> connection "hangs" until timeout.
>>> >> >> >
>>> >> >> > Try this to see if the webserver is accepting a connection:
>>> >> >> > telnet 127.0.0.1 80
>>> >> >> > Then type the two lines below, ending each one with the enter 
>>> >> >> > key >> >> >  >> >
>>> (new >
>>> >> line)
>>> >> >> > HEAD / HTTP/1.1
>>> >> >> > Host: 127.0.0.1
>>> >> >> > (hit enter once more)
>>> >> >> >
>>> >> >> > And you should get an answer from your server, mine looks like 
>>> >> >> >  >> >> > this:
>>> >> >> > HTTP/1.1 200 OK
>>> >> >> > Date: Sat, 17 Oct 2009 09:49:16 GMT
>>> >> >> > Server: Apache/2.2.13 (Unix) mod_ssl/2.2.13 OpenSSL/0.9.8k DAV/2

>>> >> >> >  >> >> >  >
>>> >> SVN/1.6.5
>>> >> >> PHP/5.3.0 with Suhosin-Patch
>>> >> >> > Content-Type: text/html;charset=ISO-8859-1
>>> >> >> > Connection closed by foreign host.
>>> >> >> >
>>> >> >> >
>>> >> >> > Does this work?
>>> >> >>
>>> >> >> John,
>>> >> >> Opening a *.HTM file from Windows Explorer goes well.
>>> >> >
>>> >> > It's not the same thing as using your web browser and try to view 
>>> >> >  >> > the >
>>> *.HTM
>>> >> file(s) through IIS.  Notice the protocol difference file:// vs >> 
>>> >> http://.
>>> >> >
>>> >> >> So the webserver is accepting a connection ...
>>> >> >> Nevertheless, where should I enter: telnet 127.0.0.1 80 ?
>>> >> >> From the OS prompt C:\  ?
>>> >> >
>>> >> > In a command prompt.  Directory path doesn't matter.
>>> >> >
>>> >> From the C:\ prompt, I did:
>>> >> telnet 127.0.0.1 80[Enter]
>>> >> HEAD / HTTP/1.1[Enter]
>>> >> Host: 127.0.0.1 [Enter]
>>> >> [Enter]
>>> >> but all I get is a black window ...
>>> >
>>> > Looks like John was right about the firewall.  What service pack did >

>>> > you have
>>> before your recent windows update?  You'll need to disable the firewall 
>>> in
>>> services and try the telnet again.
>>> >
>>>
>>> Tommy,
>>> I did and do have Windows XP SP3. My firewall was turned off.
>>> I turned it On, but http://127.0.0.1/.../phpinfo.php is not working.
>>> I turned it Off, and http://127.0.0.1/.../phpinfo.php is not working
>>> and telnet commands don't show anything ...
>>> Any other idea ?
>>> TIA, Cor
>>
>
>> 1) Did you run that command for granting permission o

RE: [PHP] avoid Denial of Service

2009-12-14 Thread Angelo Zanetti


-Original Message-
From: Ashley Sheridan [mailto:a...@ashleysheridan.co.uk] 
Sent: 08 October 2009 04:20 PM
To: Gaurav Kumar
Cc: Gerardo Benitez; php-general@lists.php.net
Subject: Re: [PHP] avoid Denial of Service

On Thu, 2009-10-08 at 19:40 +0530, Gaurav Kumar wrote:

> Not sure what exactly you are looking for.
> 
> Anyways, some common practice are request for API key, username / password
> tokens before providing access to a service.
> 
> Thanks,
> 
> Gaurav Kumar
> 
> 
> On Thu, Oct 8, 2009 at 7:06 PM, Gerardo Benitez
wrote:
> 
> > Hi everybody!
> >
> >
> > I want to get some tips about how avoid a attack of Denial of service.
May
> > be somebody can about your experience with Php o some configuration of
> > apache, o other software that help in these case.
> >
> >
> > Thanks in advance.
> >
> >
> > --
> > Gerardo Benitez
> >


If you are using Apache there are a bunch of different DoS modules that
you can use:

http://www.google.co.uk/search?q=apache
+dos&ie=utf-8&oe=utf-8&aq=t&rls=org.mozilla:en-US:official&client=firefox-a

Also, if you are in full control of the server, you may be able to
configure firewalls for this sort of thing.

It gets more complex when you're attacked with a DDoS (Distributed
Denial of Service) as there's no real hard-and-fast way to prevent them,
as they could genuinely be legitimate requests to your server and not
attacks. As a distributed attack comes from many sources, you can't
reliably differentiate the valid requests from the malicious ones.



And then you don't want to block the legitimate requests as you would be
denying visitors your service...

Angelo

http://www.elemental.co.za
http://www.wapit.co.za



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



RE: [PHP] Re: what is php4 popularity?

2009-12-14 Thread Angelo Zanetti


-Original Message-
From: Eric Bauman [mailto:baum...@livejournal.dk] 
Sent: 08 October 2009 02:39 PM
To: php-general@lists.php.net; Paul M.
Subject: [PHP] Re: what is php4 popularity?

On 8/10/2009 4:28 PM, Paul M. wrote:
> Hey guys, does anyone have a good link for an article where php4
> popularity trends are examined? The best way for me to know php4 % and
> php5 %. I appreciate any good suggestions.

Here's a pretty graph comparing PHP version usage and time: 
http://www.nexen.net/images/stories/phpversion/200810/evolution.milieu.png

Source (French): http://www.nexen.net/chiffres_cles/phpversion/

Thanks for the graph Eric, I know a lot of servers don't support PHP4. but
it of course depends on the hosting company.

Angelo

http://www.elemental.co.za
http://www.wapit.co.za



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



RE: [PHP] How to pronounce PHP code over the phone?

2009-12-14 Thread Angelo Zanetti
LOL, 

This post really has so many replies. If only all the questions had as many
answers this post!

I enjoyed the laugh...

cheers

Angelo

http://www.elemental.co.za
http://www.wapit.co.za



-Original Message-
From: Dotan Cohen [mailto:dotanco...@gmail.com] 
Sent: 24 October 2009 11:12 AM
To: Kim Madsen
Cc: php-general.
Subject: Re: [PHP] How to pronounce PHP code over the phone?

> There is... It's called a Fax ;-)
>

Again, I am interested in knowing the proper terminology for PHP
constructs and code. We have a name for a small sweer green fruit from
the vine, and we have a name for the alcoholic beverage that is
derived from it. Knowing these names helps one communicate verbally,
even when one could simply fax a photo of a grape and a glass of wine.

-- 
Dotan Cohen

http://what-is-what.com
http://gibberish.co.il

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


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



Re: [PHP] Re: ErrorException and set_exception_handler()

2009-12-14 Thread Richard Quadling
2009/12/11 Hannes Magnusson :
> On Fri, Dec 11, 2009 at 23:39, Randall Girard  
> wrote:
>> Okay, my mistake.
>>
>>
>> E_USER_WARNING and E_USER_NOTICE are supposed to continue execution,
>> correct?
>
> Correct.
>
>
>> Then  I will restate what I previously said. throwing ErrorException from an
>
> No no. Stop there. Exceptions are *totally* different from E_*.
>
>
>> ERROR_HANDLER(...) is useless iwht E_USER_WARNING and E_USER_NOTICE. Why?
>> Because when you throw the exception from the ERROR_HANDLER, presumably it
>> may NOT get caught in a try/catch block. Therefor the execution cannot
>> continue.
>
> Exactly. And that is the point.
> Why would you be turning E_USER_* into exceptions if you don't want to
> bail out of the current scope?
>
> If you throw an exception from the error handler, what exactly do you
> expect to happen?
> I gave several reasons for why that simply is impossible, but I am
> curious: what exactly are you expecting?
>
>
>
>> Therefor, I think that either a check to see if the TRY/CATCH has been
>> initiated further up the call stack, or a function to call from within the
>> EXCEPTION_HANDLER that will return execution to the previous scope.
>>
>>
>> I don't see how this is difficult to understand.
>
> So you expect a scripting language to scroll up the entire execution
> chain to see if there is a catch() block at all, and if there is no
> catch() block, the simply ignore the exception and continue?
> If thats your expectations then you are severely misunderstanding the
> concept of exceptions.
>
>
> Please do "reply-all". And please do not top-post.
>
>
> -Hannes
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

In support of Hannes, and hopefully providing a simpler script to show
what is happening.

---script
getMessage(), PHP_EOL;
}

function uncaught_error_handler($i_ErrNo, $s_Error, $s_File, $i_Line,
$a_Context) {
  echo 'A PHP error has been generated. It will be turned into an
exception.', PHP_EOL;
  switch($i_ErrNo) {
case 0 : $s_ErrNo = '@'; return True; break;
case 1 : $s_ErrNo = 'E_ERROR'; break;
case 2 : $s_ErrNo = 'E_WARNING'; break;
case 4 : $s_ErrNo = 'E_PARSE'; break;
case 8 : $s_ErrNo = 'E_NOTICE'; break;
case16 : $s_ErrNo = 'E_CORE_ERROR'; break;
case32 : $s_ErrNo = 'E_CORE_WARNING'; break;
case64 : $s_ErrNo = 'E_COMPILE_ERROR'; break;
case   128 : $s_ErrNo = 'E_COMPILE_WARNING'; break;
case   256 : $s_ErrNo = 'E_USER_ERROR'; break;
case   512 : $s_ErrNo = 'E_USER_NOTICE'; break;
case  1024 : $s_ErrNo = 'E_USER_NOTICE'; break;
case  2048 : $s_ErrNo = 'E_STRICT'; break;
case  4096 : $s_ErrNo = 'E_RECOVERABLE_ERROR'; break;
case  8192 : $s_ErrNo = 'E_DEPRECATED'; break;
case 16384 : $s_ErrNo = 'E_USER_DEPRECATED'; break;
  }
  throw new Exception("PHP Error : $s_Error ($s_ErrNo) in $s_File at
Line $i_Line", $i_ErrNo);

  // Never reached as execution continues in the "catch" clause or by
a uncaught exception handler.
  echo 'The exception has been thrown.', PHP_EOL;
}

set_error_handler('uncaught_error_handler');
set_exception_handler('uncaught_exception_handler');

try {
echo 'About to divide by zero inside a try/catch.', PHP_EOL;
$a = 1 / 0;
} catch(Exception $e) {
echo 'Caught : ', $e->getMessage(), PHP_EOL;
}

echo 'Caught divide by zero E_WARNING.', PHP_EOL, PHP_EOL;

echo 'About to divide by zero without a safety net.', PHP_EOL;
$b = 1 / 0;

// Never reached as we are not catching the execption thrown by the
uncaught error handler
echo 'Un-caught divide by zero E_WARNING.', PHP_EOL;
?>
---script

outputs ...

output-
About to divide by zero inside a try/catch.
A PHP error has been generated. It will be turned into an exception.
Caught : PHP Error : Division by zero (E_WARNING) in Z:\test_error.php
at Line 36
Caught divide by zero E_WARNING.

About to divide by zero without a safety net.
A PHP error has been generated. It will be turned into an exception.
Exception : PHP Error : Division by zero (E_WARNING) in
Z:\test_error.php at Line 44
output-


The whole issue is that you are using the (and I can't stress this
enough) _UNCAUGHT_ handlers.

These are the last ditch attempt / safety net for your code. It is
STILL your responsibility to pre-detect the potential errors and code
around them.

A try/catch block will be enough, as demonstrated - I successfully
capture a divide by zero.

Richard.
-- 
-
Richard Quadling
"Standing on the shoulders of some very clever giants!"
EE : http://www.experts-exchange.com/M_248814.html
Zend Certified Engineer : http://zend.com/zce.php?c=ZEND002498&r=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] Best ajax library

2009-12-14 Thread Ali Asghar Toraby Parizy
Hi
I think the best choice is jquery until now.
But, is it reasonable to combine jquery and other library to client
side and server side scripting respectively?
By the way, where i can find good lessons about jquery and php?


On Mon, Dec 14, 2009 at 1:16 PM, Angelo Zanetti  wrote:
>
>>  On Sat, 2009-12-12 at 15:34 +0330, shahrzad khorrami wrote:
>>
>> salam ;)
>>
>> JQuery is good one.
>>
>>
>>
>
>
> Yes I agree with JQuery but you also get JQuery UI (user interface).
>
> You can also check out extjs.com. good luck.
>
> Angelo
> http://www.elemental.co.za
> http://www.wapit.co.za
>
>
>
>>
>>
>> JQuery is good for client-side, did you want something for the server?
>>
>>   Thanks,
>> Ash
>> http://www.ashleysheridan.co.uk
>>
>>
>>
>
>

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



RE: [PHP] Re: Learning PHP

2009-12-14 Thread Angelo Zanetti


-Original Message-
From: news [mailto:n...@ger.gmane.org] On Behalf Of Robert H
Sent: 13 December 2009 10:46 PM
To: php-general@lists.php.net
Subject: [PHP] Re: Learning PHP

On 12/13/09 8:50 AM, tedd wrote:
>
> As such, the best book I've read lately has been "PHP, MySQL &
> Javascript" by Nixon published by O'Reilly. You can buy it on Amazon for
> less than $27.00 and it's well worth the price.
>
> Cheers,
>
> tedd

Thanks Tedd,

Bob


Yes that's a good book. Also check out the Zend certification material
(focuses a lot on security).

Also just doing tutorials and trying stuff yourself always helps.

Remember to get a PHP5 book! 

Cheers

Angelo

http://www.elemental.co.za
http://www.wapit.co.za


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



RE: [PHP] Best ajax library

2009-12-14 Thread Angelo Zanetti

>  On Sat, 2009-12-12 at 15:34 +0330, shahrzad khorrami wrote:
>
> salam ;)
>
> JQuery is good one.
>
>
>


Yes I agree with JQuery but you also get JQuery UI (user interface).

You can also check out extjs.com. good luck.

Angelo
http://www.elemental.co.za
http://www.wapit.co.za



>
>
> JQuery is good for client-side, did you want something for the server?
>
>   Thanks,
> Ash
> http://www.ashleysheridan.co.uk
>
>
>


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



Re: [PHP] Strange MySQL Problem

2009-12-14 Thread Parham Doustdar
Thank you, everyone. All fixed.
"metastable"  wrote in message 
news:4b260641.80...@metastable-services.net...
> Parham Doustdar wrote:
>> Hi there,
>> Does it differ? I thought when in quotations, variables like that would 
>> be
>> automatically interpreted?
>> Also, the MySQL is meant to connect to localhost. I had emptied it for
>> testing purposes. With or without it, I get the same error.
>> "Jochen Schultz"  wrote in message
>> news:4b25fb8e.3040...@sportimport.de...
>>
>>> Hello Parham,
>>>
>>> i think you should change this:
>>>
>>> $sql = "INSERT INTO BOOK(bookname, authorsname, ISBN) VALUES
>>>  ('$_POST[bookname]', '$_POST[authorsname]', $_POST[ISBN]')";
>>>
>>> to this:
>>>
>>> $sql = "INSERT INTO BOOK(bookname, authorsname, ISBN) VALUES
>>> ('".$_POST[bookname]."', '".$_POST[authorsname]."', 
>>> '".$_POST[ISBN]."')";
>>>
>>>
>>> best regards
>>> Jochen
>>>
>>>
>>> Parham Doustdar schrieb:
>>>
 Hello there,
 Here's a short PHP script a friend has written, and given to me to 
 test.
 However, I am getting a MySQL error saying that the syntax error, on 
 the
 line that contains mysql_connect(); is wrong, near '')'
 (note that it is not a PHP error, but a MySQL error.)
 Here's the code:

 [code]
 >>> $username = "root";
 $password = "abc";
 $con = mysql_connect("", $username, $password);
 mysql_select_db ("test", $con);
 $sql = "INSERT INTO BOOK(bookname, authorsname, ISBN) VALUES
 ('$_POST[bookname]', '$_POST[authorsname]', $_POST[ISBN]')";
 if (!mysql_query($sql, $con))
  {
 die( 'error: ' . mysql_error());
   }
 echo "1 record added";
 mysql_close($con)
 ?>
 [/code]




>>
>>
>>
> Exactly the opposite. Use double quotes for interpolation.
> Moreover, you would still get an error, as mysql requires text columns
> to be escaped. Use Jochens code.
> Also: SQL injection ! --> http://en.wikipedia.org/wiki/SQL_injection
>
>
> HTH,
>
> Stijn 



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



Re: [PHP] Strange MySQL Problem

2009-12-14 Thread metastable
Parham Doustdar wrote:
> Hi there,
> Does it differ? I thought when in quotations, variables like that would be 
> automatically interpreted?
> Also, the MySQL is meant to connect to localhost. I had emptied it for 
> testing purposes. With or without it, I get the same error.
> "Jochen Schultz"  wrote in message 
> news:4b25fb8e.3040...@sportimport.de...
>   
>> Hello Parham,
>>
>> i think you should change this:
>>
>> $sql = "INSERT INTO BOOK(bookname, authorsname, ISBN) VALUES
>>  ('$_POST[bookname]', '$_POST[authorsname]', $_POST[ISBN]')";
>>
>> to this:
>>
>> $sql = "INSERT INTO BOOK(bookname, authorsname, ISBN) VALUES
>> ('".$_POST[bookname]."', '".$_POST[authorsname]."', '".$_POST[ISBN]."')";
>>
>>
>> best regards
>> Jochen
>>
>>
>> Parham Doustdar schrieb:
>> 
>>> Hello there,
>>> Here's a short PHP script a friend has written, and given to me to test.
>>> However, I am getting a MySQL error saying that the syntax error, on the
>>> line that contains mysql_connect(); is wrong, near '')'
>>> (note that it is not a PHP error, but a MySQL error.)
>>> Here's the code:
>>>
>>> [code]
>>> >> $username = "root";
>>> $password = "abc";
>>> $con = mysql_connect("", $username, $password);
>>> mysql_select_db ("test", $con);
>>> $sql = "INSERT INTO BOOK(bookname, authorsname, ISBN) VALUES
>>> ('$_POST[bookname]', '$_POST[authorsname]', $_POST[ISBN]')";
>>> if (!mysql_query($sql, $con))
>>>  {
>>> die( 'error: ' . mysql_error());
>>>   }
>>> echo "1 record added";
>>> mysql_close($con)
>>> ?>
>>> [/code]
>>>
>>>
>>>
>>>   
>
>
>   
Exactly the opposite. Use double quotes for interpolation.
Moreover, you would still get an error, as mysql requires text columns
to be escaped. Use Jochens code.
Also: SQL injection ! --> http://en.wikipedia.org/wiki/SQL_injection


HTH,

Stijn

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



Re: [PHP] Strange MySQL Problem

2009-12-14 Thread shahrzad khorrami
Salaaam

$sql = "INSERT INTO BOOK(bookname, authorsname, ISBN) VALUES
('".$_POST[bookname]."'' , '".$_POST[authorsname]."',''".$_POST[ISBN]."')";

above line is correct, your code is wrong ,$_POST[ISBN]')";

and add
$host = 'localhost';
$con = mysql_connect($host, $username, $password);

you can also check this page:
http://php.net/manual/en/function.mysql-connect.php

Regards,
Shahrzad


Re: [PHP] Strange MySQL Problem

2009-12-14 Thread Parham Doustdar
Hi there,
Does it differ? I thought when in quotations, variables like that would be 
automatically interpreted?
Also, the MySQL is meant to connect to localhost. I had emptied it for 
testing purposes. With or without it, I get the same error.
"Jochen Schultz"  wrote in message 
news:4b25fb8e.3040...@sportimport.de...
> Hello Parham,
>
> i think you should change this:
>
> $sql = "INSERT INTO BOOK(bookname, authorsname, ISBN) VALUES
>  ('$_POST[bookname]', '$_POST[authorsname]', $_POST[ISBN]')";
>
> to this:
>
> $sql = "INSERT INTO BOOK(bookname, authorsname, ISBN) VALUES
> ('".$_POST[bookname]."', '".$_POST[authorsname]."', '".$_POST[ISBN]."')";
>
>
> best regards
> Jochen
>
>
> Parham Doustdar schrieb:
>> Hello there,
>> Here's a short PHP script a friend has written, and given to me to test.
>> However, I am getting a MySQL error saying that the syntax error, on the
>> line that contains mysql_connect(); is wrong, near '')'
>> (note that it is not a PHP error, but a MySQL error.)
>> Here's the code:
>>
>> [code]
>> > $username = "root";
>> $password = "abc";
>> $con = mysql_connect("", $username, $password);
>> mysql_select_db ("test", $con);
>> $sql = "INSERT INTO BOOK(bookname, authorsname, ISBN) VALUES
>> ('$_POST[bookname]', '$_POST[authorsname]', $_POST[ISBN]')";
>> if (!mysql_query($sql, $con))
>>  {
>> die( 'error: ' . mysql_error());
>>   }
>> echo "1 record added";
>> mysql_close($con)
>> ?>
>> [/code]
>>
>>
>> 


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



Re: [PHP] Strange MySQL Problem

2009-12-14 Thread Jochen Schultz

Hello Parham,

i think you should change this:

$sql = "INSERT INTO BOOK(bookname, authorsname, ISBN) VALUES
 ('$_POST[bookname]', '$_POST[authorsname]', $_POST[ISBN]')";

to this:

$sql = "INSERT INTO BOOK(bookname, authorsname, ISBN) VALUES
('".$_POST[bookname]."', '".$_POST[authorsname]."', '".$_POST[ISBN]."')";


best regards
Jochen


Parham Doustdar schrieb:

Hello there,
Here's a short PHP script a friend has written, and given to me to test.
However, I am getting a MySQL error saying that the syntax error, on the
line that contains mysql_connect(); is wrong, near '')'
(note that it is not a PHP error, but a MySQL error.)
Here's the code:

[code]

[/code]






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



[PHP] Strange MySQL Problem

2009-12-14 Thread Parham Doustdar
Hello there,
Here's a short PHP script a friend has written, and given to me to test.
However, I am getting a MySQL error saying that the syntax error, on the
line that contains mysql_connect(); is wrong, near '')'
(note that it is not a PHP error, but a MySQL error.)
Here's the code:

[code]

[/code]




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



[PHP] PHP live chat

2009-12-14 Thread Angelo Zanetti
Hi all, 

I know there are a lot of scripts that one can pay for, for "live chat" -
website support.

Are there are any free open source ones that work well?

I found: www.phplivechat.com

But still waiting to evaluate it.

Please send you comments, good or bad and what you would recommend or not
recommend and why

Thanks in advance.

Angelo


http://www.wapit.co.za

http://www.elemental.co.za 




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