Re: [PHP] about getting a site
thanks Sharl,I'll study it Joshua,Yes,I mean host and Run
Re: [PHP] about getting a site
*Joshua You are right,I **apologize**.*
Re: [PHP] about getting a site
On 2011年05月28日 14:18, Negin Nickparsa wrote: if i don't have any site can i share my php files in somewhere 4 free? if yes, what u suggest? here,or try googlecode. -- Best regards, Sharl.Jimh.Tsin (From China *Obviously Taiwan INCLUDED*) Using Gmail? Please read this important notice: http://www.fsf.org/campaigns/jstrap/gmail?10073. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] about getting a site
On May 28, 2011, at 2:18 AM, Negin Nickparsa wrote: > if i don't have any site can i share my php files in somewhere 4 free? > if yes, what u suggest? Nergin- Several small points. 1. Use correct punctuation. Use capitalization. 2. Don't use phrases like "what u suggest" or "somewhere 4 free" as it will reflect poorly on yourself and cause most people to ignore your request. 3. The best things in life aren't free, if you want something useful you often have to pay for it in some form. 4. Question: By "share" do you mean "host and run?" 5. I am assuming a true flag thrown on point #4; I do not know of any free hosting sites worth mentioning. Regards, -Josh Joshua Kehn | josh.k...@gmail.com http://joshuakehn.com
[PHP] about getting a site
if i don't have any site can i share my php files in somewhere 4 free? if yes, what u suggest?
[PHP] What's up with Quercus?
Although I've been mostly using Java and Ruby in my professional software development work for the past decade or so, in the past two or three years I've started to do more and more PHP. I originally started using PHP because I needed to set-up and customize Drupal for a project. Although as a programmer I've come to feel comfortable writing PHP code, I still don't feel like I have a good sense of where PHP is going as a platform and what's it's future is. As the Drupal site has continued to grow both in terms of features and usage, it's become clear that this is something that I need to research and educate myself about. That led me to give a closer look at Quercus, the implementation of PHP 5 that runs on top of the JVM. I'd already heard about it somewhere along the line, but it's only in the past couple of weeks that I've actually pulled it down, read through the documentation and some of the source and tried it out. So far I'm pretty impressed and enthusiastic about it. The cancellation of PHP 6 combined with the steady trickle of PHP-related bugs and security vulnerabilities that have become public over the past few years had made me very nervous about the future of the platform. Having an open-source implementation of PHP that runs on the JVM, which is like the gold standard for server application performance and reliability, is reassuring. The fact that it makes it easy and fast to use the huge library of Java frameworks out there in your PHP applications doesn't hurt either. Although I've had great results so far in my experiments with Quercus, I'm curious to hear about other PHP developers' experiences with it. Even though it seems like a significant number of people are using it for production applications, I'm curious why it's adoption isn't even higher than it is? Given the difficulties of writing a Virtual Machine, it seems like leveraging the JVM is a no brainer. Is there some technical drawback that I'm unaware of or is it just a case of inertia? Thanks. -- Arnold -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Detecting HTTPS connections under Apache
$_SERVER['HTTPS'] --Curtis On 5/26/2011 3:37 PM, Geoff Shang wrote: Hi, Apologies if this is covered somewhere but I've searched fairly extensively and not found anything. I'm working on an application which has a function for redirecting to a given URL. This is generally used for redirecting after a form has been submitted. Right now it sends an HTTP URL in the redirection, which means it can't work under a secure connection. I'd like to be able to use it over HTTPS but don't want to force people to do this. So ideally I'd like to be able to detect the protocol in use and send the appropriate protocol in the Location header. The problem is that, at least on the system I'm working on, I can't see any way of detecting the protocol. _SERVER["SERVER_SIGNATURE"] and _SERVER["SERVER_ADDR"] both give the port as 80, even if I specify port 443 in the URL. I've seen references to _SERVER["HTTPS"] or something similar but it's not in the output I get from either "print_r ($_SERVER)" or "phpinfo ()". I'm running PHP Version 5.3.3-7+squeeze1 on Apache/2.2.16 (Debian). The machine is an x86-64 VPS running Debian Squeeze. I have full access to the VPS, so if something needs tweeking in Apache (or anything else) then I can do this. Thanks in advance, Geoff. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] phpsadness
On Fri, May 27, 2011 at 17:59, Robert Cummings wrote: > > It's common trait of whiners to give criticism but not take any :) Where's my "Like" button when I need it? -- Network Infrastructure Manager http://www.php.net/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Urgent help - Token Generation code!
> From: shreya...@gmail.com > To: lord_fa...@hotmail.com > Subject: Re: [PHP] Urgent help - Token Generation code! > Date: Sat, 28 May 2011 04:15:59 +0530 > > Jasper, > > Tried echoing $sToken but wouldn't work. > > Regards, > Shreyas > > On 28-May-2011, at 4:11 AM, Jasper Mulder > wrote: > > > > > > >> Date: Sat, 28 May 2011 03:56:26 +0530 > >> From: shreya...@gmail.com > >> To: php-general@lists.php.net > >> Subject: [PHP] Urgent help - Token Generation code! > >> > >> I am re-visiting the world of PHP after a really big hiatus and I > >> am finding > >> things veryslippery. Can someone please help me with the below code > >> and let > >> me know how I can print the token that is getting generated? > >> > >> I am using EasyPHP and I am trying to echo the $token but it > >> wouldn't print > >> anything. I am trying it as : http://localhost/token/URLToken.php. > >> May I > >> know where all I am going wrong here in my approach? > >> > >>> > >> $sUrl = "/tstd_c_b1@s54782"; > >> $sParam = "primaryToken"; > >> $nTime = time(); > >> $nEventDuration = 86400; > >> $nWindow = $nTime + $nEventDuration; > >> $sSalt = "akamai123!"; > >> $sExtract = ""; // optional > >> As a second try, what happens if you add right here the line $sGen = urlauth_gen_url($sUrl, $sParam, $nWindow, $sSalt, $sExtract, $nTime); Because it seems as though you just declare three functions in the code without calling them... > >> > >> function urlauth_gen_url($sUrl, $sParam, $nWindow, > >> $sSalt, $sExtract, $nTime) { > >> > >> > >> > >> $sToken = urlauth_gen_token($sUrl, $nWindow, $sSalt, > >> $sExtract, $nTime); > >> echo $token; > > > > There are two cases: > > 1. You made a typo and meant 'echo $sToken;' on the above line instead > > 2. You omitted the part where $token is defined and used > > > >> [More code that seemed fine] > >> > >> -- > >> Regards, > >> Shreyas Agasthya > > Best regards, Jasper Mulder -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Urgent help - Token Generation code!
> From: lord_fa...@hotmail.com > To: shreya...@gmail.com > Subject: RE: [PHP] Urgent help - Token Generation code! > Date: Sat, 28 May 2011 00:41:02 +0200 > > > > > Date: Sat, 28 May 2011 03:56:26 +0530 > > From: shreya...@gmail.com > > To: php-general@lists.php.net > > Subject: [PHP] Urgent help - Token Generation code! > > > > I am re-visiting the world of PHP after a really big hiatus and I am finding > > things veryslippery. Can someone please help me with the below code and let > > me know how I can print the token that is getting generated? > > > > I am using EasyPHP and I am trying to echo the $token but it wouldn't print > > anything. I am trying it as : http://localhost/token/URLToken.php. May I > > know where all I am going wrong here in my approach? > > > > > > > $sUrl = "/tstd_c_b1@s54782"; > > $sParam = "primaryToken"; > > $nTime = time(); > > $nEventDuration = 86400; > > $nWindow = $nTime + $nEventDuration; > > $sSalt = "akamai123!"; > > $sExtract = ""; // optional > > > > > > function urlauth_gen_url($sUrl, $sParam, $nWindow, > > $sSalt, $sExtract, $nTime) { > > > > > > > > $sToken = urlauth_gen_token($sUrl, $nWindow, $sSalt, > > $sExtract, $nTime); > > echo $token; > > There are two cases: > 1. You made a typo and meant 'echo $sToken;' on the above line instead > 2. You omitted the part where $token is defined and used > > > [More code that seemed fine] > > > > -- > > Regards, > > Shreyas Agasthya > > Best regards, > Jasper Mulder > I forgot to hit Reply All instead of Reply. I am deeply sorry for such a careless omission. Best regards, Jasper Mulder -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Urgent help - Token Generation code!
I am re-visiting the world of PHP after a really big hiatus and I am finding things veryslippery. Can someone please help me with the below code and let me know how I can print the token that is getting generated? I am using EasyPHP and I am trying to echo the $token but it wouldn't print anything. I am trying it as : http://localhost/token/URLToken.php. May I know where all I am going wrong here in my approach? 12)) { return; } if (($nWindow < 0) || (!is_integer($nWindow))) { return; } if (($nTime <= 0) || (!is_integer($nTime))) { $nTime = time(); } $nExpires = $nWindow + $nTime; if (strpos($sUrl, "?") === false) { $res = $sUrl . "?" . $sParam . "=" . $nExpires . "_" . $sToken; } else { $res = $sUrl . "&" . $sParam . "=" . $nExpires . "_" . $sToken; } return $res; } /** * Returns the hash portion of the token. This function should not be * called directly. */ function urlauth_gen_token($sUrl, $nWindow, $sSalt, $sExtract, $nTime) { if (($sUrl == "") || (!is_string($sUrl))) { return; } if (($nWindow < 0) || (!is_integer($nWindow))) { return; } if (($sSalt == "") || (!is_string($sSalt))) { return; } if (!is_string($sExtract)) { $sExtract = ""; } if (($nTime <= 0) || (!is_integer($nTime))) { $nTime = time(); } $nExpires = $nWindow + $nTime; $sExpByte1 = chr($nExpires & 0xff); $sExpByte2 = chr(($nExpires >> 8) & 0xff); $sExpByte3 = chr(($nExpires >> 16) & 0xff); $sExpByte4 = chr(($nExpires >> 24) & 0xff); $sData = $sExpByte1 . $sExpByte2 . $sExpByte3 . $sExpByte4 . $sUrl . $sExtract . $sSalt; $sHash = _unHex(md5($sData)); $sToken = md5($sSalt . $sHash); return $sToken; } /** * Helper function used to translate hex data to binary */ function _unHex($str) { $res = ""; for ($i = 0; $i < strlen($str); $i += 2) { $res .= chr(hexdec(substr($str, $i, 2))); } return $res; } ?> -- Regards, Shreyas Agasthya
Re: [PHP] phpsadness
On 11-05-27 05:54 PM, Nathan Nobbe wrote: On Fri, May 27, 2011 at 3:52 PM, Robert Cummings mailto:rob...@interjinn.com>> wrote: On 11-05-27 03:52 PM, Daevid Vincent wrote: A friend sent me this URL today. While amusing, he's got many valid points and I certainly share in his frustration. http://www.phpsadness.com What a whiner! Many of the things listed are things which give PHP character and history. Too bad it's not a blog post with a comments section. I'd point him to the internals list :) It's common trait of whiners to give criticism but not take any :) Cheers, Rob. Ps. have a great weekend everyone! -- E-Mail Disclaimer: Information contained in this message and any attached documents is considered confidential and legally protected. This message is intended solely for the addressee(s). Disclosure, copying, and distribution are prohibited unless authorized. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Detecting HTTPS connections under Apache
On Thu, 26 May 2011, ad...@buskirkgraphics.com wrote: So when you echo $_SERVER['SERVER_PORT']; You get port 80 even if the url currently is https://www.yoursite.com ? Yes. If this is the case good luck. Because you have serious issues. OK. This on its own is not particularly helpful. Surely I can't be the only person in the universe who has experienced this. I'm running a minimally-altered stock Debian Apache and PHP setup. Geoff. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] phpsadness
On Fri, May 27, 2011 at 3:52 PM, Robert Cummings wrote: > On 11-05-27 03:52 PM, Daevid Vincent wrote: > >> A friend sent me this URL today. While amusing, he's got many valid points >> and I certainly share in his frustration. >> >> http://www.phpsadness.com >> > > What a whiner! > > Many of the things listed are things which give PHP character and history. > Too bad it's not a blog post with a comments section. I'd point him to the internals list :) -nathan
Re: [PHP] phpsadness
On 11-05-27 03:52 PM, Daevid Vincent wrote: A friend sent me this URL today. While amusing, he's got many valid points and I certainly share in his frustration. http://www.phpsadness.com What a whiner! Many of the things listed are things which give PHP character and history. Cheers, Rob. -- E-Mail Disclaimer: Information contained in this message and any attached documents is considered confidential and legally protected. This message is intended solely for the addressee(s). Disclosure, copying, and distribution are prohibited unless authorized. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] phpsadness
On 27 May 2011 20:52, Daevid Vincent wrote: > A friend sent me this URL today. While amusing, he's got many valid points > and I certainly share in his frustration. > > http://www.phpsadness.com WOW. That's a LOT of unhappiness. http://twitter.com/#!/topaz2078/status/73982006681276416 -- Richard Quadling Twitter : EE : Zend : PHPDoc @RQuadling : e-e.com/M_248814.html : bit.ly/9O8vFY : bit.ly/lFnVea -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] phpsadness
On Fri, May 27, 2011 at 12:52 PM, Daevid Vincent wrote: > A friend sent me this URL today. While amusing, he's got many valid points > and I certainly share in his frustration. > > http://www.phpsadness.com > Some points are valid, but many others show a lack of understanding of PHP and OOP in general. * #18 (as stated) is intentional. If you want an instance property--use an instance property! A static variable in an instance method could do one of two things: create a static variable private to the method or an instance variable private to the method. But using "static" to create an instance property would be very confusing. * #24 on reflection methods. I agree that the lack of documentation is sad, but allowsNull() and isOptional() are definitely separate. Any parameter with a type hint (array or class) will allow null only if it has a null default value. So a parameter can be optional and disallow null and vice versa. * #33 The point of private methods is to block subclasses (and other classes) from accessing or overriding them. Yes, it makes mocking them impossible, but this is a core OOP concept. Make those methods protected and put a comment on them stating that they should not be overridden by subclasses if you need to mock them. * #41 You can create a final class with a private constructor or better yet simply *avoid* instantiating the class. Problem solved. Seriously, who cares if someone instantiates your class full of static methods? Hopefully we're all a little less sad now. :) David
Re: [PHP] Re: Need pro advice: Is Pear installed and/or setup correctly?
On Fri, May 27, 2011 at 12:48 PM, Micky Hulse wrote: > Looks like the host changed my include path: > I will probably ditch the whole Pear idea and use something else. Well, actually, it looks like having PEAR on the include path did help. Mail.php was found... It was Mail_Mime/mime.php that was not getting found. This seems totally hackish, but I had to download Mail_Mime and put it in the web root of my friend's server: http://pear.php.net/package/Mail_Mime/download And changed the Mail_Mime include path to point to the new location and it worked. What a headache. Lol. Problem solved. Thanks for the help Philip, and thanks for listening all! Have a nice day. Cheers, Micky -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] phpsadness
A friend sent me this URL today. While amusing, he's got many valid points and I certainly share in his frustration. http://www.phpsadness.com
Re: [PHP] Re: Need pro advice: Is Pear installed and/or setup correctly?
Looks like the host changed my include path: (include_path='.:/usr/lib/php:/usr/local/lib/php:/usr/local/lib/php/PEAR') I am still getting "file not found" include errors. I am guess that Mail.php and Mail_Mime/mime.php are extras that are not installed. This is my first time trying to use Pear. Normally I use other code for sending emails with attachments... I think my friend setup an e-mail form using this tutorial: http://www.html-form-guide.com/email-form/php-email-form-attachment.html He could not get it to work, and I am just trying to get it to work for him. I will probably ditch the whole Pear idea and use something else. I hate working for free! :D Thanks for listening all.. Sorry to bug the list with my crud. Cheers, Micky -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Need pro advice: Is Pear installed and/or setup correctly?
On Fri, May 27, 2011 at 12:06 PM, Philip Thompson wrote: > The host is apparently using PHP 5.3 - this message started to appear in > this version. Use date_default_timezone_set() somewhere in your code to > explicitly set your timezone. I'm in the central US, so I use > 'America/Chicago'. See the docs for more info. Thanks Philip! I will give that a try. :) Testing now... Nice! That helped! :) date_default_timezone_set('America/Los_Angeles'); Now all I got to do is convince my friend that the host needs to add Pear to the include path (at least, I think this is the problem with Pear). Thanks again Philip! Have a great day. Cheers, Micky -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Need pro advice: Is Pear installed and/or setup correctly?
On Fri, May 27, 2011 at 1:36 PM, Micky Hulse wrote: > On Fri, May 27, 2011 at 10:27 AM, Micky Hulse > wrote: > > Would it be safe for me to conclude that Pair is not setup properly? > > Haha, "Pear" the package, not the host. :D > > http://www.pair.com/ > > Typo. My bad. > > Also, what the heck does this mean: > > "It is not safe to rely on the system's timezone settings. Please use > the date.timezone setting, the TZ environment variable or the > date_default_timezone_set() function. In case you used any of those > methods and you are still getting this warning, you most likely > misspelled the timezone identifier. We selected 'America/New_York' for > 'EDT/-4.0/DST' instead in /home/USER/public_html/test.php on line 6" > The host is apparently using PHP 5.3 - this message started to appear in this version. Use date_default_timezone_set() somewhere in your code to explicitly set your timezone. I'm in the central US, so I use 'America/Chicago'. See the docs for more info. Not sure about your original question. Happy coding, ~Philip http://lonestarlightandsound.com/
[PHP] Re: Need pro advice: Is Pear installed and/or setup correctly?
On Fri, May 27, 2011 at 10:27 AM, Micky Hulse wrote: > Would it be safe for me to conclude that Pair is not setup properly? Haha, "Pear" the package, not the host. :D http://www.pair.com/ Typo. My bad. Also, what the heck does this mean: "It is not safe to rely on the system's timezone settings. Please use the date.timezone setting, the TZ environment variable or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'America/New_York' for 'EDT/-4.0/DST' instead in /home/USER/public_html/test.php on line 6" Never seen that warning message before when including files... Like I said, I know nothing about this host, but so far I am wondering if they have things setup properly? Thanks for listening. Cheers, Micky -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Need pro advice: Is Pear installed and/or setup correctly?
What do you think this means. This code: [code] [/code] Outputs these error messages: http://pastebin.com/ZKtyELT1 But this code: [code] [/code] Returns "bool(true)" Looking at these docs: http://pear.php.net/manual/en/installation.checking.php ... it says: "In every case, PEAR's php_dir should be in the include path. If not, add it in your system's php.ini." When viewing PHP info, I do not see "php_dir" in the include path (or anywhere else... Nor do I see any reference to "pear".) My friend told me that the host said Pear "is installed." I tried adding a php.ini to the root of the server (I don't know much about this host's setup... I am just helping a friend out) but that did not seem to load. I don't have shell access either. Would it be safe for me to conclude that Pair is not setup properly? Would it be a simple fix for the host to add Pear to the include path? What else could I do to get Pear to work if I can't use a php.ini file and/or ssh into the server and check/tweak/install packages? Thanks so much! Cheers, Micky -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php