Jump to content

Ninjakreborn

Members
  • Posts

    3,922
  • Joined

  • Last visited

Everything posted by Ninjakreborn

  1. What are the best movie related filetypes to accept. I was thinking, of different filetypes. Unfortunately, at one time I had a site that allowed me to view all file type's but I lost the source code, I deleted it, and wasn't thinking, so that I have to rebuild, any advice appreciated as to what filetypes would be easy to allow viewing for.
  2. I wrote this whole thing, and lost it because the browser crashed, from now on, I edit it in a notepad, then put it on the site, that really pissed me off. http://www.corephp.co.uk/archives/19-Prepare-for-PHP-6.html [quote]Unicode Unicode support at present can be set on a per request basis. This equates to PHP having to store both Unicode and non-Unicode variants of class, method and function names in the symbol tables. In short - it uses up more resources. Their decision is to make the Unicode setting server wide, not request wide. Turning Unicode off where not required can help performance and they quote some string functions as being up to 300% slower and whole applications 25% slower as a result. The decision to move it to the php.ini in my mind does take the control away from the user, and puts it into the hands of the Web Host. If you compile PHP yourself or are responsible for this on your servers then you may be interested to know that PHP 6 will require the ICU libs (regardless if Unicode is turned on or off). The build system will bail out if the required ICU libs cannot be found. In a nutshell, you'll have another thing to install if you want to compile PHP.[/quote] Not exactly sure what this means, but it sounds good. [quote]Register Globals to go Say goodbye folks, this one is finally going. It will no longer be an ini file setting, and if found it will raise an E_CORE_ERROR, pointing you to the documentation on why it's "bad". This means that PHP6 will finally break all PHP3 era scripts (or any script using reg globals) with no recourse at all but to re-code it. That's a bold move, but a needed one.[/quote] Finally a step in the right direction, getting rid of something that should have never been there in the first place. [quote]Magic Quotes to go The magic quotes feature of PHP will be going, and as with register globals it's going to raise an E_CORE_ERROR if the setting is found anywhere. This will affect magic_quotes, magic_quotes_sybase and magic_quotes_gpc. Safe Mode to go This may please developers who have web hosts that insist upon safe mode! But it will now go totally, again raising an E_CORE_ERROR if found. The reason is that apparently they felt it gave the 'wrong signal', implying that it made PHP secure, when infact it didn't at all. open_basedir will (thankfully) be kept.[/quote] Magic quotes has always annoyed me, this is going to help a lot, with a lot of things.  It's going to make programming a better place. [quote]'var' to alias 'public' PHP4 used 'var' within classes. PHP5 (in its OO move) caused this to raise a warning under E_STRICT. This warning will be removed in PHP6 and instead 'var' will mean the same thing as 'public'. This is a nice move but I if anyone has updated their scripts to work under E_STRICT in PHP5 it will be a redundant one for them.[/quote] additions and changes to the var keyword [quote]Register Long Arrays to go Remember the HTTP_*_VARS globals from yesteryear? Well if you're not already using $_GET, $_POST, etc - start doing so now, because the option to enable long arrays is going (and will throw an E_CORE_ERROR).[/quote] Now we can  finally move forward in the future, towards better programming styles. No more use of as many deprecated elements [quote]PHP Engine Additions 64 bit integers A new 64 bit integer will be added (int64). There will be no int32 (it is assumed unless you specify int64) Goto No 'goto' command will be added, but the break keyword will be extended with a static label - so you could do 'break foo' and it'll jump to the label foo: in your code. ifsetor() It looks like we won't be seeing this one, which is a shame. But instead the ?: operator will have the 'middle parameter' requirement dropped, which means you'd be able to do something like this: "$foo = $_GET['foo'] ?: 42;" (i.e. if foo is true, $foo will equal 42). This should save some code, but I personally don't think it is as 'readable' as ifsetor would have been. foreach multi-dim arrays This is a nice change - you'll be able to foreach through array lists, i.e. "foreach( $a as $k => list($a, $b))". {} vs [] You can currently use both {} and [] to access string indexes. But the {} notation will raise an E_STRICT in PHP5.1 and will be gone totally in PHP6. Also the [] version will gain substr and array_slice functionality directly - so you could do "[2,]" to access characters 2 to the end, etc. Very handy.[/quote] Bad use for barand, is that they are not using go-to yet either.  Sounds like they are moving in the right direction.  [quote]Additions to PHP APC to be in the core distribution The opcode cache APC will be included in the core distribution of PHP as standard, it will not however be turned on by default (but having it there saves the compilation of yet another thing on your server, and web hosts are more likely to allow it to be enabled) Hardened PHP patch This patch implements a bunch of extra security checks in PHP. They went over it and the following changes will now take place within PHP: Protection against HTTP Response Splitting will be included. allow_url_fopen will be split into two: allow_url_fopen and allow_url_include. allow_url_fopen will be enabled by default. allow_url_include will be disabled by default. E_STRICT merges into E_ALL Wow, this is quite a serious one! E_STRICT level messages will be added to E_ALL by default. This shows a marked move by the PHP team to educate developers on 'best practises' and displaying language-level warnings in a "Hey, you're doing it the wrong way". Farewell <% They will remove support for the ASP style tags, but the PHP short-code tag will remain (<?) - so to those on php general who reckon the short-tag is 'depreceated' - hah! ;-)[/quote] Finally some needed improvements to error handling, as well as removing those ugly tags. http://www.dotvoid.com/view.php?id=57 Another link to reinforce a lot of the things mentioned above. This goes over a lot of the same stuff, and reinforces the stuff on the first link http://en.wikipedia.org/wiki/PHP Another re-inforcement (trusted one), of the things mentioned above. [quote]Future development PHP 6, in development as of October 2006, aims to address some of PHP 5's shortcomings.[12]     * Native Unicode support will be added;     * The magic_quotes option will be removed;     * The register_globals option will be removed;     * The safe_mode option will be removed. In addition, there has been discussion of adding namespace support.[/quote] With  magic quotes, register globals, and safe mode being taken out it will make a better, more secure work enviroment in my opinions. http://news.php.net/php.internals/17883 This is from the creator himself it reinforces my key points [quote]1. Remove register_globals completely 2. Remove magic_quotes_* 3. Add input filter extension which will include a mechanism for   application developers to very easily turn it off which would swap   the raw GPC arrays back in case the site had it turned on by default. 4. Include an opcode cache by default.  A lot of work has gone into   pecl/apc recently, but I am not hung up on which one goes in. 5. Remove safe_mode and focus on open_basedir 6. Remove some stuff that has been marked deprecated since PHP 3/4 A couple of others that we could consider, but I don't actually think wins us much apart from academic purity (which I have never been all that keen on) are: 7. Make identifiers case-sensitive 8. Remove various function aliases[/quote] That coming out of the owners mouth reinforces thoughts for me a lot http://news.php.net/php.internals/17668 Another piece of information about it. http://www.php.net/~derick/meeting-notes.html Now for my favorite link, the direct link to there meeting information related to EVERYTHING they are talking about for php 6.  The perfect place to be kept up to date. [quote]# 1. Unicode     * 1.1 Unicode on/off modes     * 1.2 Different String Types     * 1.3 Extension upgrading     * 1.4 Bundling ICU     * 1.5 Filename Encoding     * 1.6 Collator Caching     * 1.7 Optimising []     * 1.8 Locale Sensitivity     * 1.10 Conversion Errors [/quote] Not sure what unicode is exactly, have to check up on that. [quote]# 2. Cleanup of Functionality     * 2.1 register_globals     * 2.2 magic_quotes     * 2.3 safe_mode     * 2.4 Deprecated Behaviour     * 2.5 zend.ze1_compatibility mode     * 2.6 Support for Freetype 1 and GD 1     * 2.7 open_basedir     * 2.8 dl()     * 2.9 CGI/FastCGI mode     * 2.10 Dynamic class inheritance     * 2.11 register_long_arrays, HTTP_*_VARS     * 2.12 old type constructors     * 2.13 Case sensitivity of identifiers     * 2.14 break $var [/quote] To me this "cleanup" is going to greatly improve the speed at which php run's, and greatly increase it's security, and overall functionality.  These are some much needed improvements, and forced behaviours. [quote]# 4 Engine Additions     * 4.1 Add a 64bit integer     * 4.2 Adding "goto"     * 4.3 ifsetor() as "replacement" for $foo = isset($foo) ? $foo : "something else"     * 4.4 Allow foreach syntax for multi-dimensional arrays     * 4.5 Cleanup for {} vs. []     * 4.6 Changes to the shut-up (@) operator that disallow (@ini_set(...))     * 4.7 Allow foreach() without "as" part (I guess for iterators)     * 4.8 Named Parameters     * 4.9 Make parameter order consistent over all functions     * 4.10 Minor function changes: microtime()[/quote] [quote]4.2 Adding "goto" Issue: Goto is currently missing in PHP, and although there is a limited use for this construct in some cases it can reduce the amount of code a lot. Discussion: There are some inherent problems with implementing goto, as jumping into a foreach() loop will almost be impossible as at the start of the loop something is initialised. The same is most likely true for other loop constructs. As goto will most often be used to jump out of nested if statements, we think that restricting the construct so that you can only jump out of a construct is possible. Similarly restricting the construct so that you can only jump down should satisfy people who do not want the ability to jump all over the place. The name "goto" is misleading, and often associated with BAD THINGS(tm). Because our proposed solution is not a real GOTO construct, we will instead reuse the "break" keyword, and extend it with a static label. An example of using a labeled break: <?php for ($i = 0; $i < 9; $i++) {         if (true) {                 break blah;         }         echo "not shown"; blah:         echo "iteration $i\n"; } ?> Conclusions:   1. We extend "break" by allowing breaking to a label.   2. We ask Sara to make a patch for this, and we see how it is going to look like. We decide on that.[/quote] They finally seem to start addressing the issue to some extent that barand brought up awhile back, about them not having GoTo [quote]# 5. Changes to OO functionality     * 5.1 "function require __construct(" to force calling the parent's constructor     * 5.2 Allow interfaces to specify the __construct() signature     * 5.3 Implement inheritance rules for type hints     * 5.4 Late static binding using "this" without "$" (or perhaps with a different name)     * 5.5 Object casting to primitive types     * 5.6 name spaces     * 5.7 Using an undefined property in a class with defined properties should throw a warning     * 5.8 Type-hinted properties and return values     * 5.10 Method calls     * 5.11 ReflectionClass cache in zend_class_entry* and support "$this::class"     * 5.12 Delegates[/quote] Since I am just getting into OOP, I am hoping these changes and additions make OOP functionality even better, and more well rounded in PHP as a whole. [quote]# 6 Additions     * 6.1 Add an opcode cache to the distribution (APC)     * 6.2 Merge Hardened PHP patch into PHP     * 6.3 Sand boxing or taint mode     * 6.4 All non-fatal errors should be marked in extensions as E_RECOVERABLE_ERROR     * 6.5 All non-fatal errors should become exceptions     * 6.6 E_STRICT on by default     * 6.7 Remove support for <?, <% and <script language="PHP"> and add "<?php =$var?>"     * 6.8 Rewrite build system     * 6.9 Added persistent flag to zval struct     * 6.10 Read-only properties[/quote] A lot of additions, and changes to the actual error handling, remove shitloads of deprecated and outdated tags, and everything else.  I can't wait until this new version of PHP come's out and take's off. Still waiting for more servers tot ake to PHP 5.  Hopefully both of these things will come to pass soon.
  3. http://pecl4win.php.net/index.php I am about to have a lot of fun. I am going to be installing and playing with extensions on my server for the next 4-5 day's. Is it possible to get all extensions on that url (all of the libraries), all at once on one server, to learn and play with.  I am really looking forward to upgrading to a dedicated server, ands etting up my own php, I will be playing with a lot of those.  I can't wait.
  4. [quote]Check your spam box or whatever, its probably being filtered. You should look at adding at least some basic headers. Also, be aware that non numeric array indexes should be surrounded by quotes. eg; {$_POST['email']}[/quote] Ok, I used to but awhile back, someone said don't, I had 1 problem and it was due to taht, but it was awhile back, maybe I misunderstood that part.  I liked it better with the quotes anyway, I am going to go back to doing that when extrapolating. I am 100% sure it's not my spam box, because strangely, a lot of my clients go into spam box.  So I am constantly checking it just like I check my inbox.  Both stay empty all the time because I check them, it's just not going through at all, and I don't understand why.
  5. Yes, I did I know which one it comes compiled with.  What I was wondering is how to get more with it.  Since www.wampserver.com does an auto-install, is there a way to choose what you want it compiled with.  For instance it doesn't come with curl, or gdlibrary, or mcrypt.  I like all of those, is there a way to do that.
  6. [code]<?php $subject = "Primero Latino Contact Form"; $message = " Email: {$_POST[email]} Verified Email: {$_POST[verifyemail]} Message: {$_POST[message]} "; if (mail($contactemail, $subject, $message)) { echo "Contact was successfully made, we will get back to you within.<br />"; echo "24 hours.<br />"; }else { echo "There was a problem making contact.<br />"; echo "please try again later.<br />"; } ?>[/code] Didn't think it would help because it was standard code. The contact email is set in my config.php file, it's always worked like that, "I tested the variable made it through" and it did, it's just not sending the email.
  7. I don't understand why it's not sending, I am sending it over, and over again, it's not sending it to my inbox. I checked sendmail (I have full power over this server), I have installed mailenable, and have had the tech support for vpsland.com to set it up for me.  They say it should be working, however it's not sending me emails.
  8. I have installed a wamp server not too long ago.  I was wondering, what basic extensions php comes compiled with, with wamps auto-installed.  Is there a way to install additional module's, (extensions), or whatever when you run it's auto-install.  For instance the gd library, the mcrypt library, is there a way to get all of those installed with it,
  9. Perfect, thanks, I will look over those later today, when i start working with OOP again.
  10. What are you going to do from now on, to try and prevent it from happening again.
  11. Sorry to hear that. Hope everything turns out. Stick with it, if you have the backup (I don't know hardly anything about servers), hopefully you can get most or all of your files back Good luck.
  12. [quote]Hmm...a valiant effort businessman, but I don't quite buy it.  Are you really sure you meant to use 'peripherals?' I mean, The camcorder itself would be considered a peripheral, and I don't contest a flash drive being labeled a peripheral, but that's not what we really need from the OP. We need to know things like if his computer and camcorder have usb ports or av i/o jacks or a dv i/o for which they can physically connect. That's the type of stuff we are trying to find out, right? I think a more proper term would be "hardware interface."[/quote] It could be, that is what I was referring to if that'what you mean.  What plugs it was able to hold, whether it held usb, or ethernet,  ??? Maybe I did have an improper use of it.
  13. [quote]<?php error_reporting(E_ALL)?>[/quote] I don't really like notices, for a variety of reasons, it conflicts with my programming style. [quote]Also us isset() is what you need to use.[/quote] I did that was just a small excerpt out of my code. I got the array situation working. I will keep what you said about the layer's next time.  I will attempt at what you said, and see how it goes, and how I like it. [quote]The html is also 100% separate. I define constants so i can do something like[/quote] I am moving into MVC as we speak, havn't gotten to that yet, I am working on moving my personal programmer to OOP/MVC [quote]the reason I use constants is they are not restricted by scope. The reason I am ranting is I just think you have taken he wrong approach to forms and I think there is a better way. Also converting functions to oop like you have said you are going to do is the wrong approach. what could strlen() possibly gain by being an object?? Am I saying to throw out all your code or leave it as a normal function? NO, what I am saying is there are different and much better ways to do some things in oop and if it the code was designed for a function there is probably not much point in making an exact copy that is oop. You said you are going to try regex and arrays a lot but do you realize that regex is slow and there are times to use it and times to not use it. Email validation i a good use of it, checking for a set length, prefix, suffix is not a good use of regex. As for the arrays I know why you keep doing $v = $_POST['v']; I know why people do it and its stupid. $this->v = $_POST['v'] actually servers the purpose of abstraction but what does $v = $_POST['v'] do?? it only allows you using the ugly $_POST['v']. But there is a better way to do this Code: function call($_POST['username'], $_POST['password']); The code above allows for you to send the data to a function then you can name the values to whatever you want. It is clean and better for a large number of reasons. Hopefully someone will find this rant useful. [/quote] I want to see the validity in your point, but I have to hear atleast what a few other people say in response to it, to formulate an opinion.  I also want to see if you can re-explain some of it, I caught most of it, but some of it, I didn't understnad (I haven't done OOP/MVC very long, I am still studying them.
  14. [quote]Also, it's "et cetera"...[/quote] Thanks for the correction, I have always had problems spelling that out properly. When you get a hold of the information (when and if) you need some help.  let us know.  We will help all that we can.
  15. After sitting back and thinking about it for a minute, no, I don't feel I misused the word. I had a specific thought as to what it's definition meant.  I wasn't fully informed of it when I used the term, so I had to check to reinforce my opinion.  So I did my own search on the term, and it's different meanings from wikipedia's website. [quote] List of common peripherals     * Storage           o Removable (Writes/reads portable media)                 + CD                       # CD-ROM                       # CD-RW                       # CD-R                 + DVD                       # DVD-ROM                       # DVD-RW                       # DVD-R                 + USB flash drive                 + Tape drive                 + Floppy disk                 + Punch card           o Internal                 + Disk array controller     * Input           o Manual                 + Keyboard                 + Pointing devices                       # Mouse                       # Trackball                 + Joystick                 + Touch screen                 + Joypad           o Brain-computer interface           o Image scanner           o Computer terminal           o Computer speech recognition           o Webcam           o Digitizing tablet           o Barcode reader     * Output           o Printing                 + Plotter                 + Printer                 + Braille embosser           o Sound                 + Computer speech synthesis                 + Sound card                 + Speakers                 + Microphone           o Visual                 + Graphics card                 + Monitor           o Refreshable Braille display     * Networking           o Modem           o Network card     * Expansion           o docking station[/quote] A usb flash drive in specific I was talking about (If he had a connector on either his camera, or his computer.  Plus other things that he could have had, that would have helped. All listed here. With a modem, he could have transferred the data via an internet cable. Network card he could have done it that way, [quote]* Storage           o Removable (Writes/reads portable media)                 + CD                       # CD-ROM                       # CD-RW                       # CD-R                 + DVD                       # DVD-ROM                       # DVD-RW                       # DVD-R                 + USB flash drive                 + Tape drive                 + Floppy disk                 + Punch card           o Internal                 + Disk array controller[/quote] Those seem logically, all methods that can be used to transfer information from his Camera, to his Computer, assuming they have the proper (as I called it) peripherals. [quote]Disk drive is a peripheral device used to read from and write to a disk[/quote] Also off of wikipedia, which is another thing that can be used.  If he had the proper perripherals, or knowing his peripherals, could have been the knowledge I needed to help point him in the right direction. This is why I feel I had the right usage of the term.
  16. [quote]Please don't use words that are outside of your vocabulary.[/quote] ??? How would you specifically know my level of vocabulary.  Technically not knowing what level of high school I completed/Did not complete, whether I did, or did not go to college.  What I study, and have not studied. Not a very nice thing to say, if you were joking nevermind, but if you were saying that to be rude then shame on you for picking on other people that said nothing about you....
  17. I have all of that dealt with, with functions (Currently converting all my functions to OOP), for now, arrays I was weak at, lately regex and arrays I have been really getting into.  Forcing myself to use them a lot to help solve other problems. [code]$empty = array('firstname', 'lastname', ....); foreach ($empty as $key) {     if (empty($_POST[$key]))     {           echo "$key is empty";     } }[/code] I will keep that in mind, if the current approach I am using doesn't work.
  18. Also, I have been alot with making my code cleaner, neater, better commented a lot lately. Thank you for the example array, it helps me have a new, neater, cleaner way to setup arrays, I think I will format them like that from now until, until(if) I see another way that I like the looks of more, but it's a drastic improvement for now, thanks. [quote] businessman, are you sure fixed what I told you? You original script did: Code: if ($k == "") When it should be: Code: if(empty($v)) Notice- it's $v that needs to be checked, not $k. And it's always better to use empty() rather than '==""'. This way you won't need to name the keys (firstname, lastname ....)[/quote] Can you re-explain what you mean.  Well I know what you mean, but can you re-explain why. I can change it, it won't be that hard, but so far, I have always used == ""; or != "" for everything like $_POST['firstname'] != "" I have done that for a long time. What are the differences as far as functionality.  Which one is better, is there some kind of attached proof, or example of "how" it's better, so I don't make a blind change.  You might have a very valid point, I just wnat to be absolutely sure, before I make a change that affects my entire style. Thanks for all the help. Look forward to your answers. So far I had changed it over to [quote]<?php       foreach ($empty as $k=>$v) { // run them through to see if there empty if ($v == "") { // if they are register error messages $errorhandler .= $k . " was left blank, please correct this.<br />"; } } ?>[/quote] I can also use the other, I just need to see some reasoning behind it, so I am sure.  Thanks.
  19. [quote]$empty = array('firstname' => $_POST['firstname'],                       'lastname' => $_POST['lastname'],                       'password' => $_POST['password'],                       'verifypassword' => $_POST['verifypassword'],                       'country' => $_POST['country'],                       'stateorprovince' => $_POST['stateorprovince'],                       'country' => $_POST['county'],                       'zipcode' => $_POST['zipcode'],                       'birthdate' => $_POST['birthdate']);[/quote] Thanks for the advice, yes that is what I had in mind, if it wasn't going to pick them up automatically.  Thanks for all the help. Actually I just noticed, you wrote it out for me, thank you.
  20. If his solution doesn't work (which it probably will), you could try CURL. As far as I  know JSP, and PHP both have support for CURL, atleast I think JSP does.
  21. It sounds like (from my perspective) that at some point an error found it's way into your database. Sql injection might have stopped it (theory only), but I have seen in most hosts, it says error check database, debug database.  I know they can get error's, maybe your tables ran into some sort of error in the  database itself, and messed up, stopped taking queries.  I would (for debugging purposes) Dump all of the data, into an sql file.  Completely erase everything on the database, completely clear it out, and empty everything, then reload the data into it, and see if that fixes the error.
  22. Ah that's what I was afraid of, I was hoping the key would get picked up automatically based on the input name. Thanks for the help.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.