Re: [PHP] PHP-GTK dead?
I don't think so. php-gtk is still very active here http://php-gtk.eu/ On Wed, Jan 11, 2012 at 3:19 AM, Yared Hufkens wrote: > It seems that PHP-GTK is completely dead. The latest version (2.0.1) was > released on May 2008, nobody answers on questions in the mailing list, > and the latest SVN commit is nearly one year ago. > > Am I wrong or is it senseless to write still PHP-GTK programs? > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > -- -BEGIN GEEK CODE BLOCK- Version: 3.1 GSC d- s:>++ a- C++ UL/B+++$ !P L++>+ E--- W+ N o-- K? w++ O? M- V- PS PE++(-) Y+ PGP++@ t 5 X R+>+++$ tv- b+++ DI++ D++ G++@ e+++>+ h*>--- r-- z? -END GEEK CODE BLOCK--
[PHP] Curl problems
Hello all. I use curl to make a call to another page on my site... but it operates erroneously sometimes working... sometimes not. The page it calls creates an email and I can see on the server the email in the queue when it's working. If I echo out the URL the curl command is supposed to load and load it manually, it works without fail. Any help on what I am doing wrong below is greatly appreciated. Thanks. $curl_handle=curl_init(); curl_setopt($curl_handle,CURLOPT_URL,'https://mydomain.com/email_confirmation.htm?id_order='.$id_order.'&sess_id='.$sess_id) ; curl_exec($curl_handle); curl_close($curl_handle); --Rick -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] differences in between these env. variables
I've grouped these env variables, each group returns the same values is there a difference? which ones do you use? which ones should I not use for the purposes listed below group1 SCRIPT_FILENAME vs PATH_TRANSLATED where both return D:\Hosting\5291100\html\directory\file.php purpose: get the full file path to the php script group2 REMOTE_ADDR vs REMOTE_HOST where both return same IP purpose: get the visitor's ip group3 REQUEST_URI vs SCRIPT_NAME vs URL vs ORIG_PATH_INFO vs PHP_SELF which all return /directory/file.php purpose: get the virtual url to the php script -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Curl problems
On Thu, Jan 12, 2012 at 12:20 AM, Rick Dwyer wrote: > Hello all. > > I use curl to make a call to another page on my site... but it operates > erroneously sometimes working... sometimes not. The page it calls > creates an email and I can see on the server the email in the queue when > it's working. If I echo out the URL the curl command is supposed to load > and load it manually, it works without fail. > > Any help on what I am doing wrong below is greatly appreciated. > > Thanks. > > > $curl_handle=curl_init(); > curl_setopt($curl_handle,CURLOPT_URL,'https://mydomain.com/email_confirmation.htm?id_order='.$id_order.'&sess_id='.$sess_id); > curl_exec($curl_handle); > curl_close($curl_handle); > > --Rick It's maybe not a real answer to your question, but if all you want to do is call that page, why don't you just use file_get_contents(https://mydomain.com/email_confirmation.htm?id_order='.$id_order.'&sess_id='.$sess_id); (See [1]) It works out of the box, and I have found curl unstable too sometimes. Matijn [1] www.php.net/file_get_contents -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Curl problems
On Jan 11, 2012, at 6:29 PM, Matijn Woudt wrote: On Thu, Jan 12, 2012 at 12:20 AM, Rick Dwyer wrote: Hello all. I use curl to make a call to another page on my site... but it operates erroneously sometimes working... sometimes not. The page it calls creates an email and I can see on the server the email in the queue when it's working. If I echo out the URL the curl command is supposed to load and load it manually, it works without fail. Any help on what I am doing wrong below is greatly appreciated. Thanks. $curl_handle=curl_init(); curl_setopt($curl_handle,CURLOPT_URL,'https://mydomain.com/email_confirmation.htm?id_order='.$id_order.'&sess_id='.$sess_id) ; curl_exec($curl_handle); curl_close($curl_handle); --Rick It's maybe not a real answer to your question, but if all you want to do is call that page, why don't you just use file_get_contents(https://mydomain.com/email_confirmation.htm?id_order='.$id_order.'&sess_id='.$sess_id ); (See [1]) It works out of the box, and I have found curl unstable too sometimes. Matijn Thanks Matijn, But I get "Notice: file_get_contents() [function.file-get-contents]: Unable to find the wrapper "https" - did you forget to enable it when you configured PHP?"... I'm using a hosting provider and I don't believe they will enable this for security reasons. --Rick -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] differences in between these env. variables
On Thu, Jan 12, 2012 at 12:26 AM, Haluk Karamete wrote: > I've grouped these env variables, each group returns the same values > is there a difference? which ones do you use? which ones should I not > use for the purposes listed below > You can find the answers here: http://nl3.php.net/manual/en/reserved.variables.server.php I'll try to answer them in short > group1 > SCRIPT_FILENAME vs PATH_TRANSLATED > where both return D:\Hosting\5291100\html\directory\file.php > purpose: get the full file path to the php script > SCRIPT_FILENAME can be a relative path, PATH_TRANSLATED is the full path. This is only true if run from CLI. On my Ubuntu box I don't even have PATH_TRANSLATED, so SCRIPT_FILENAME is recommended. > > group2 > REMOTE_ADDR vs REMOTE_HOST > where both return same IP > purpose: get the visitor's ip REMOTE_HOST is not necessary always IP, if PHP succeeds to do a reverse lookup (ie. get name for this ip), than REMOTE_HOST contains a name instead of ip. You need to set a config option for this, though. Recommended: REMOTE_ADDR, it matches what you need, doesn't need config, and REMOTE_HOST doesn't even work for all hosts. > > group3 > REQUEST_URI vs SCRIPT_NAME vs URL vs ORIG_PATH_INFO vs PHP_SELF > which all return /directory/file.php > purpose: get the virtual url to the php script I'll extend your example. We now have a RewriteRule in apache like this: RewriteRule ^files/?$ /directory/file.php [L,QSA] Which will rewrite /files/... --> /directory/file.php REQUEST_URI now contains how it was called by the browser, '/files/something.php' SCRIPT_NAME returns path to script (/directory/file.php), set by the SAPI (apache, ..). PHP_SELF returns also the path to script (/directory/file.php), but set by PHP self. I don't have any ORIG_PATH_INFO on my Ubuntu box, so be careful about this one. Recommended: Depends on which you need. I prefer PHP_SELF over SCRIPT_NAME, but that's more personal choice. Matijn -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Curl problems
On Thu, Jan 12, 2012 at 12:44 AM, Rick Dwyer wrote: > On Jan 11, 2012, at 6:29 PM, Matijn Woudt wrote: > >> On Thu, Jan 12, 2012 at 12:20 AM, Rick Dwyer >> wrote: >>> >>> Hello all. >>> >>> I use curl to make a call to another page on my site... but it operates >>> erroneously sometimes working... sometimes not. The page it calls >>> creates an email and I can see on the server the email in the queue when >>> it's working. If I echo out the URL the curl command is supposed to load >>> and load it manually, it works without fail. >>> >>> Any help on what I am doing wrong below is greatly appreciated. >>> >>> Thanks. >>> >>> >>> $curl_handle=curl_init(); >>> >>> curl_setopt($curl_handle,CURLOPT_URL,'https://mydomain.com/email_confirmation.htm?id_order='.$id_order.'&sess_id='.$sess_id); >>> curl_exec($curl_handle); >>> curl_close($curl_handle); >>> >>> --Rick >> >> >> It's maybe not a real answer to your question, but if all you want to >> do is call that page, why don't you just use >> >> file_get_contents(https://mydomain.com/email_confirmation.htm?id_order='.$id_order.'&sess_id='.$sess_id); >> (See [1]) >> It works out of the box, and I have found curl unstable too sometimes. >> >> Matijn > > > Thanks Matijn, > But I get "Notice: file_get_contents() [function.file-get-contents]: Unable > to find the wrapper "https" - did you forget to enable it when you > configured PHP?"... I'm using a hosting provider and I don't believe they > will enable this for security reasons. > > --Rick It seems like they have not compiled PHP with SSL support, or they're using a pretty old version. Anyway, you're probably stuck with cURL then, check the return of curl_exec, and if false, call curl_error to get an error message. Matijn -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] differences in between these env. variables
On Wed, Jan 11, 2012 at 5:49 PM, Matijn Woudt wrote: > On Thu, Jan 12, 2012 at 12:26 AM, Haluk Karamete > wrote: >> I've grouped these env variables, each group returns the same values >> is there a difference? which ones do you use? which ones should I not >> use for the purposes listed below >> > You can find the answers here: > http://nl3.php.net/manual/en/reserved.variables.server.php > I'll try to answer them in short > >> group1 >> SCRIPT_FILENAME vs PATH_TRANSLATED >> where both return D:\Hosting\5291100\html\directory\file.php >> purpose: get the full file path to the php script >> > SCRIPT_FILENAME can be a relative path, PATH_TRANSLATED is the full > path. This is only true if run from CLI. > On my Ubuntu box I don't even have PATH_TRANSLATED, so SCRIPT_FILENAME > is recommended. >> >> group2 >> REMOTE_ADDR vs REMOTE_HOST >> where both return same IP >> purpose: get the visitor's ip > > REMOTE_HOST is not necessary always IP, if PHP succeeds to do a > reverse lookup (ie. get name for this ip), than REMOTE_HOST contains a > name instead of ip. You need to set a config option for this, though. > Recommended: REMOTE_ADDR, it matches what you need, doesn't need > config, and REMOTE_HOST doesn't even work for all hosts. >> >> group3 >> REQUEST_URI vs SCRIPT_NAME vs URL vs ORIG_PATH_INFO vs PHP_SELF >> which all return /directory/file.php >> purpose: get the virtual url to the php script > > I'll extend your example. We now have a RewriteRule in apache like this: > > RewriteRule ^files/?$ /directory/file.php [L,QSA] > > Which will rewrite /files/... --> /directory/file.php > > REQUEST_URI now contains how it was called by the browser, > '/files/something.php' > SCRIPT_NAME returns path to script (/directory/file.php), set by the > SAPI (apache, ..). > PHP_SELF returns also the path to script (/directory/file.php), but > set by PHP self. > I don't have any ORIG_PATH_INFO on my Ubuntu box, so be careful about this > one. > > Recommended: Depends on which you need. I prefer PHP_SELF over > SCRIPT_NAME, but that's more personal choice. > > Matijn > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > Is there ever a case where SCRIPT_NAME does not equal PHP_SELF? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] reporting errors when $ sign is missing in front of a variable
Hi, I'm coming from ASP background. There, there is a life saver option called "option explicit". It forces you to declare your variables using the "dim" statement. The good thing about that is that if you were to mis-spell one of your variables, asp.dll throws an error stating that on line so and so, variable so and so not declared. This allows you to immediately fix the error saving lots of time. If you did not use "option explicit", then that misspelled variable would not have caused any error and you woud have spent much more time debugging your app as to what went wrong where. Now, I undersand with PHP, that we do not have a variable declaration per se; you put a $ sign in front of a word, and that becomes a variable. Since in asp, we do not use $ much. I keep forgetting that. I first declare a var and set a value for it using the $. But then I refer to the darned thing, without the $. And there are no errors. Ths behaviour seems extremely odd to me. How do I achieve the functionality that if I forget to use $ sign for a previously declared variable, php throws me an error. example $my_var = 90; echo my_var; I want an error to be thrown in line 2. what do I need to do?" I was assuming that since there is no function titled "my_var", PHP would have complain right there and then. But instead, it simply echoes "my_var". I would have expected "my_var" to be outputted only if I were to write echo "my_var";. This beats me. At the top of my page, I already have this Haluk -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] reporting errors when $ sign is missing in front of a variable
On Wed, Jan 11, 2012 at 8:43 PM, Haluk Karamete wrote: > > Hi, I'm coming from ASP background. > There, there is a life saver option called "option explicit". It > forces you to declare your variables using the "dim" statement. The > good thing about that is that if you were to mis-spell one of your > variables, asp.dll throws an error stating that on line so and so, > variable so and so not declared. This allows you to immediately fix > the error saving lots of time. If you did not use "option explicit", > then that misspelled variable would not have caused any error and you > woud have spent much more time debugging your app as to what went > wrong where. > > Now, I undersand with PHP, that we do not have a variable declaration > per se; you put a $ sign in front of a word, and that becomes a > variable. Since in asp, we do not use $ much. I keep forgetting that. > I first declare a var and set a value for it using the $. But then I > refer to the darned thing, without the $. And there are no errors. Ths > behaviour seems extremely odd to me. > > How do I achieve the functionality that if I forget to use $ sign for > a previously declared variable, php throws me an error. > > example > > $my_var = 90; > echo my_var; > > I want an error to be thrown in line 2. what do I need to do?" > I was assuming that since there is no function titled "my_var", PHP > would have complain right there and then. But instead, it simply > echoes "my_var". > > I would have expected "my_var" to be outputted only if I were to write > echo "my_var";. This beats me. > > At the top of my page, I already have this (E_ALL ^ E_NOTICE); ?> > > Haluk > > This works for me in development environment without a debugger setup using a web browser (note that I'm using 5.4RC2 so the default behavior of error_reporting(E_ALL) is different [1]: Notice: Use of undefined constant my_var - assumed 'my_var' in F:\dev\sites\wwwroot\php_apps\test.php on line 5 my_var http://php.net/function.error-reporting -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] reporting errors when $ sign is missing in front of a variable
Thanks... Well I just changed the to and that does it for me. Notice: Use of undefined constant my_age - assumed 'my_age' in D:\Hosting\5291100\html\blueprint\bp_library.php on line 40 my_age Now back in business :) Notice: Use of undefined constant my_age - assumed 'my_age' in D:\Hosting\5291100\html\blueprint\bp_library.php on line 40my_age On Wed, Jan 11, 2012 at 9:12 PM, Tommy Pham wrote: > On Wed, Jan 11, 2012 at 8:43 PM, Haluk Karamete > wrote: >> >> Hi, I'm coming from ASP background. >> There, there is a life saver option called "option explicit". It >> forces you to declare your variables using the "dim" statement. The >> good thing about that is that if you were to mis-spell one of your >> variables, asp.dll throws an error stating that on line so and so, >> variable so and so not declared. This allows you to immediately fix >> the error saving lots of time. If you did not use "option explicit", >> then that misspelled variable would not have caused any error and you >> woud have spent much more time debugging your app as to what went >> wrong where. >> >> Now, I undersand with PHP, that we do not have a variable declaration >> per se; you put a $ sign in front of a word, and that becomes a >> variable. Since in asp, we do not use $ much. I keep forgetting that. >> I first declare a var and set a value for it using the $. But then I >> refer to the darned thing, without the $. And there are no errors. Ths >> behaviour seems extremely odd to me. >> >> How do I achieve the functionality that if I forget to use $ sign for >> a previously declared variable, php throws me an error. >> >> example >> >> $my_var = 90; >> echo my_var; >> >> I want an error to be thrown in line 2. what do I need to do?" >> I was assuming that since there is no function titled "my_var", PHP >> would have complain right there and then. But instead, it simply >> echoes "my_var". >> >> I would have expected "my_var" to be outputted only if I were to write >> echo "my_var";. This beats me. >> >> At the top of my page, I already have this > (E_ALL ^ E_NOTICE); ?> >> >> Haluk >> >> > > This works for me in development environment without a debugger setup > using a web browser (note that I'm using 5.4RC2 so the default > behavior of error_reporting(E_ALL) is different [1]: > > Notice: Use of undefined constant my_var - assumed 'my_var' in > F:\dev\sites\wwwroot\php_apps\test.php on line 5 > my_var error_reporting(E_ALL); > ini_set('display_errors', 'on'); > $my_var = 90; > echo my_var; > > highlight_file(__FILE__); > > Good luck, > Tommy > > [1] http://php.net/function.error-reporting -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] http_referer. what's wrong with that?
Because I got this echo $_SERVER['HTTP_REFERER']; I end up with this Notice: Undefined index: HTTP_REFERER in D:\Hosting\5291100\html\blueprint\bp_library.php on line 16 die; Now, this is of course after the change. One solution is to dodge it by echo @$_SERVER['HTTP_REFERER']; But I'm still curious, what configuration am I missing so that http_referer is treated like that? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: http_referer. what's wrong with that?
On Wed, 11 Jan 2012 21:27:58 -0800, Haluk Karamete wrote: >[...] >Notice: Undefined index: HTTP_REFERER in >D:\Hosting\5291100\html\blueprint\bp_library.php on line 16 >die; >[...] >But I'm still curious, what configuration am I missing so that >http_referer is treated like that? You only get an HTTP_REFERER when you link to a page from another page. If you go directly to the page, e.g. by typing / pasting the URL into the location bar, or linking from an email, then there is no HTTP_REFERER. -- Ross McKay, Toronto, NSW Australia "Let the laddie play wi the knife - he'll learn" - The Wee Book of Calvin -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: http_referer. what's wrong with that?
While perhaps unlikely in "common users" it is also possible to prevent your browser from sending the referrer. IIRC, the referrer can also get mangled when passing through HTTPS (although I don't remember on which side, HTTP->HTTPS or HTTPS->HTTP or both) Matt On Thu, Jan 12, 2012 at 1:11 AM, Ross McKay wrote: > On Wed, 11 Jan 2012 21:27:58 -0800, Haluk Karamete wrote: > >>[...] >>Notice: Undefined index: HTTP_REFERER in >>D:\Hosting\5291100\html\blueprint\bp_library.php on line 16 >>die; >>[...] >>But I'm still curious, what configuration am I missing so that >>http_referer is treated like that? > > You only get an HTTP_REFERER when you link to a page from another page. > If you go directly to the page, e.g. by typing / pasting the URL into > the location bar, or linking from an email, then there is no > HTTP_REFERER. > -- > Ross McKay, Toronto, NSW Australia > "Let the laddie play wi the knife - he'll learn" > - The Wee Book of Calvin > > -- > 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] http_referer. what's wrong with that?
At 12:27 AM 1/12/2012, Haluk Karamete wrote: Because I got this echo $_SERVER['HTTP_REFERER']; I end up with this Notice: Undefined index: HTTP_REFERER in D:\Hosting\5291100\html\blueprint\bp_library.php on line 16 die; Now, this is of course after the change. One solution is to dodge it by echo @$_SERVER['HTTP_REFERER']; The better way to avoid the error is to do something like echo (isset($_SERVER['HTTP_REFERER']))?$_SERVER['HTTP_REFERER']:'No referrer set'; Which checks to see if it's set before echoing the value. If it's not set, you get a message saying so. Ken -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] reporting errors when $ sign is missing in front of a variable
Haluk Karamete hat am 12. Januar 2012 um 06:17 geschrieben: > Thanks... > Well I just changed the > to and that does it for me. > > Notice: Use of undefined constant my_age - assumed 'my_age' in > D:\Hosting\5291100\html\blueprint\bp_library.php on line 40 > my_age > > Now back in business :) If you are programming with an IDE, it does the work for you. While programming you will see warning notices, that you are refering to something unknown. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php