php-general Digest 14 Dec 2009 12:37:09 -0000 Issue 6487
Topics (messages 300462 through 300481):
Re: MySQL Appeal from Monty
300462 by: Lenin
300463 by: Lester Caine
PHP live chat
300464 by: Angelo Zanetti
Strange MySQL Problem
300465 by: Parham Doustdar
300466 by: Jochen Schultz
300467 by: Parham Doustdar
300468 by: shahrzad khorrami
300469 by: metastable
300470 by: Parham Doustdar
Re: Best ajax library
300471 by: Angelo Zanetti
300473 by: Ali Asghar Toraby Parizy
Re: Learning PHP
300472 by: Angelo Zanetti
Re: ErrorException and set_exception_handler()
300474 by: Richard Quadling
Re: How to pronounce PHP code over the phone?
300475 by: Angelo Zanetti
Re: what is php4 popularity?
300476 by: Angelo Zanetti
Re: avoid Denial of Service
300477 by: Angelo Zanetti
Re: all local sites stopped working ... [SOLVED]
300478 by: Angelo Zanetti
Re: ip-to-country
300479 by: Angelo Zanetti
300480 by: Angelo Zanetti
Highlighting image map on load
300481 by: leledumbo
Administrivia:
To subscribe to the digest, e-mail:
[email protected]
To unsubscribe from the digest, e-mail:
[email protected]
To post to the list, e-mail:
[email protected]
----------------------------------------------------------------------
--- Begin Message ---
You might also like this:
Come on Monty - Lukas Smith http://bit.ly/5lmwwD
--- End Message ---
--- Begin Message ---
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
-----------------------------
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
--- End Message ---
--- Begin Message ---
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
--- End Message ---
--- Begin Message ---
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]
<?php
$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]
--- End Message ---
--- Begin Message ---
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]
<?php
$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]
--- End Message ---
--- Begin Message ---
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" <[email protected]> wrote in message
news:[email protected]...
> 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]
>> <?php
>> $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]
>>
>>
>>
--- End Message ---
--- Begin Message ---
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
--- End Message ---
--- Begin Message ---
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" <[email protected]> wrote in message
> news:[email protected]...
>
>> 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]
>>> <?php
>>> $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
--- End Message ---
--- Begin Message ---
Thank you, everyone. All fixed.
"metastable" <[email protected]> wrote in message
news:[email protected]...
> 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" <[email protected]> wrote in message
>> news:[email protected]...
>>
>>> 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]
>>>> <?php
>>>> $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
--- End Message ---
--- Begin Message ---
> 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
>
>
>
--- End Message ---
--- Begin Message ---
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 <[email protected]> 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
>>
>>
>>
>
>
--- End Message ---
--- Begin Message ---
-----Original Message-----
From: news [mailto:[email protected]] On Behalf Of Robert H
Sent: 13 December 2009 10:46 PM
To: [email protected]
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
--- End Message ---
--- Begin Message ---
2009/12/11 Hannes Magnusson <[email protected]>:
> On Fri, Dec 11, 2009 at 23:39, Randall Girard <[email protected]>
> 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------------
<?php
function uncaught_exception_handler(Exception $e) {
echo 'Exception : ', $e->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;
case 16 : $s_ErrNo = 'E_CORE_ERROR'; break;
case 32 : $s_ErrNo = 'E_CORE_WARNING'; break;
case 64 : $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
--- End Message ---
--- Begin Message ---
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:[email protected]]
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
--- End Message ---
--- Begin Message ---
-----Original Message-----
From: Eric Bauman [mailto:[email protected]]
Sent: 08 October 2009 02:39 PM
To: [email protected]; 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
--- End Message ---
--- Begin Message ---
-----Original Message-----
From: Ashley Sheridan [mailto:[email protected]]
Sent: 08 October 2009 04:20 PM
To: Gaurav Kumar
Cc: Gerardo Benitez; [email protected]
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
<[email protected]>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
--- End Message ---
--- Begin Message ---
-----Original Message-----
From: [email protected] [mailto:[email protected]]
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" <[email protected]>
To: "general php" <[email protected]>
Sent: Saturday, October 17, 2009 2:03 PM
Subject: Re: [PHP] all local sites stopped working ...
> From: "[email protected]" <[email protected]>
> To: Tommy Pham <[email protected]>; general php
> <[email protected]>
> Sent: Sat, October 17, 2009 4:49:53 AM
> Subject: Re: [PHP] all local sites stopped working ...
>
>
> ----- Original Message ----- From: "Tommy Pham" <[email protected]>
> To: "general php" <[email protected]>
> Sent: Saturday, October 17, 2009 1:29 PM
> Subject: Re: [PHP] all local sites stopped working ...
>
>
>> ----- Original Message ----
>>> From: "[email protected]" <[email protected]>
>>> To: Tommy Pham <[email protected]>; general php
>>> <[email protected]>
>>> 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: "[email protected]"
>>> >> 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: "[email protected]"
>>> >> >> To: John Black
>>> >> >> Cc: [email protected]
>>> >> >> 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 ...
>>> >> >>
>>> >> >>
>>> >> >> > [email protected] 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 of NETWORK SERVICE
>> for the c:\tmp? and restart IIS?
> A: yes, I did restart IIS after every change in php.ini
>
>> 2) run 'netstat -ano' without the single quote in the command prompt and
>> show me what you see.
> Active Connections
>
> Proto Local Address Foreign Address State PID
> TCP 0.0.0.0:80 0.0.0.0:0 LISTENING 1808
> TCP 0.0.0.0:135 0.0.0.0:0 LISTENING 848
> TCP 0.0.0.0:443 0.0.0.0:0 LISTENING 1808
> TCP 0.0.0.0:445 0.0.0.0:0 LISTENING 4
> TCP 0.0.0.0:1950 0.0.0.0:0 LISTENING 1808
> TCP 0.0.0.0:3306 0.0.0.0:0 LISTENING 1544
> TCP 127.0.0.1:80 127.0.0.1:1952 CLOSE_WAIT 1808
> TCP 127.0.0.1:80 127.0.0.1:1954 CLOSE_WAIT 1808
> TCP 127.0.0.1:1025 0.0.0.0:0 LISTENING 1352
> TCP 127.0.0.1:1029 0.0.0.0:0 LISTENING 2940
> TCP 127.0.0.1:1056 0.0.0.0:0 LISTENING 3960
> TCP 127.0.0.1:1288 127.0.0.1:1025 CLOSE_WAIT 908
> TCP 127.0.0.1:5354 0.0.0.0:0 LISTENING 1116
> TCP 192.168.1.33:139 0.0.0.0:0 LISTENING 4
> UDP 0.0.0.0:445 *:* 4
> UDP 0.0.0.0:500 *:* 612
> UDP 0.0.0.0:1026 *:* 1116
> UDP 0.0.0.0:3456 *:* 1808
> UDP 0.0.0.0:4500 *:* 612
> UDP 127.0.0.1:123 *:* 916
> UDP 127.0.0.1:1900 *:* 1088
> UDP 127.0.0.1:1909 *:* 524
> UDP 192.168.1.33:123 *:* 916
> UDP 192.168.1.33:137 *:* 4
> UDP 192.168.1.33:138 *:* 4
> UDP 192.168.1.33:1900 *:* 1088
> UDP 192.168.1.33:5353 *:* 1116
>
>> 3) Use word pad and put in the below content and save it as itworks.htm
>> (text type) in c:\inetpub\wwwroot
>> <html><body><h1>It works!</h1></body></html>
>> then use your web browser and go to http://localhost/itworks.htm
> A: That works okay !!
>
>> 4) Did you check to see if there are any errors in the System and
>> Application event logs?
> A: I found C:Windows\EventSystem.log (modified 30/09/2007)
> And C:Windows\WindowsUpdate.log with (modified 17/10/2009); I will check
> this one ...
>
> T>> You'll need to view the logs in the Event Viewer.
I restarted Windows, and guess what, the problem is gone.
Don't know what caused it, but it's working again.
Thanks again and have a nice weekend !!!
LOL!
Typical windows, maybe next time try that first and look for other solutions
afterward that doesn't work!
Angelo
http://www.elemental.co.za
http://www.wapit.co.za
--- End Message ---
--- Begin Message ---
-----Original Message-----
From: George Langley [mailto:[email protected]]
Sent: 19 October 2009 01:38 AM
To: [email protected]
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)?
------------
<http://www.maxmind.com/app/ip-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
--- End Message ---
--- Begin Message ---
-----Original Message-----
From: John Black [mailto:[email protected]]
Sent: 19 October 2009 11:03 AM
To: [email protected]
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
--- End Message ---
--- Begin Message ---
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.
--- End Message ---