Jump to content

neylitalo

Staff Alumni
  • Posts

    1,853
  • Joined

  • Last visited

    Never

Everything posted by neylitalo

  1. I don't think there are really any particular attitudes that you need to have, but you certainly do need to develop good habits. Some habits that are good to get into: [list][*]Always, always make your code portable. Use <?php instead of <? (in the case of PHP), don't depend on register_globals, etc.[*]If your code could be reused, put it in a function. Don't even copy and paste, unless you are going to make substantial changes.[*]Indent code when you can - it makes it sooo much easier to read.[*]Use HEREDOC syntax for quoting instead of escaping quotes, if you can - it's much easier to read that way, too.[/list]And I'm sure there are several other habits, theories, and ideas that you can learn from a computer science class.
  2. That's the current Unix timestamp. You want to use the date() function to format the date like this: [code]<?php $timestamp = time(); $formatted = date("g:h:i", $timestamp); echo $formatted; ?>[/code]
  3. [!--quoteo(post=364740:date=Apr 14 2006, 05:08 AM:name=Yesideez)--][div class=\'quotetop\']QUOTE(Yesideez @ Apr 14 2006, 05:08 AM) [snapback]364740[/snapback][/div][div class=\'quotemain\'][!--quotec--] What was the date this news item was posted? April 1st? [/quote] April 10th - it tells you right above the post.
  4. [!--quoteo(post=365040:date=Apr 15 2006, 06:23 AM:name=bmbc)--][div class=\'quotetop\']QUOTE(bmbc @ Apr 15 2006, 06:23 AM) [snapback]365040[/snapback][/div][div class=\'quotemain\'][!--quotec--] yo g's i'm 6'3 and cant do a backwards dunk please help [/quote] hm... I'm afraid we're not certified for that - we can try anyway, if you like. [!--quoteo(post=365144:date=Apr 15 2006, 02:34 PM:name=redbullmarky)--][div class=\'quotetop\']QUOTE(redbullmarky @ Apr 15 2006, 02:34 PM) [snapback]365144[/snapback][/div][div class=\'quotemain\'][!--quotec--] or (what has the world come to...) [a href=\"http://www.biscuit.org.uk/dunk/index.html\" target=\"_blank\"]The Biscuit Dunking Appreciation Society[/a][/quote] oh my word...
  5. an "Invalid argument in foreach" error is thrown when you give foreach() something that isn't an array. So you need to make sure that $_FILES['pictures']['errors'] is indeed an array.
  6. [!--quoteo(post=364957:date=Apr 14 2006, 07:55 PM:name=moberemk)--][div class=\'quotetop\']QUOTE(moberemk @ Apr 14 2006, 07:55 PM) [snapback]364957[/snapback][/div][div class=\'quotemain\'][!--quotec--] Um... yeah, I can't help you here, because, as it turns out, I have absolutely NO clue what carp is. [/quote] You don't need to know what a carp is to give suggestions on a site. ;) (btw, it's a fish - a really ugly fish that's good for bait and nothing else.) I have a few suggestions: Get rid of the outside border. It looks messy. Give your navigation & advertisement sections some background colors. And take the advertisements section out until you get something in there. Make your headings actually stand out. It doesn't help that "Welcome to Carp Fishing UK" is smaller than the rest of it. And make the individual articles stand out a bit; give them a border and background of some kind? Keep the main background white, but give all your other sections a background of some kind. Take the picture of the fish out of the background and put it in the header image, somewhere. It's distracting. (I've never seen a carp like that... all the carp up here are ultra ugly) Make your links stand out. An underline or something - anything. And please, please make the header image easier on the eyes - the bright yellow and bright blue don't go well together. Once you've made a few changes, let us know, and we'll go for round 2. :)
  7. I think a CSV file would be unnecessary work - patrick87, maybe you should use a database. They're designed to store data, and it'd be much more convenient than using a text file.
  8. [!--quoteo(post=364964:date=Apr 14 2006, 08:06 PM:name=JRS)--][div class=\'quotetop\']QUOTE(JRS @ Apr 14 2006, 08:06 PM) [snapback]364964[/snapback][/div][div class=\'quotemain\'][!--quotec--] ToonMariner, Thanks - yes I will encrypt the entire string - but still would need 1 data variable to retrieve the string. So I thought I would just use generic variable such as data. I was thinking of writing a simple encryption routine - nothing extremely complicated for this - mcrypt encryption would be quite cpu intensive right? I don't want to slow the the system down too much Thanks for your reply JRS [/quote] I don't think it would be very CPU intensive at all - remember, you're using a relatively powerful machine to run a relatively simple encryption/decryption process on a relatively small string. The only way it would really slow down the machine is if you were to encrypt/decrypt a HUGE string or file. I think mcrypt would work beautifully. :)
  9. If you aren't particular about whose browsers you support, you may be able to put the Javascript innerHTML property. I don't think browsers other than Gecko-based or IE support it, though. Here's a quick & dirty demonstration: [code]<html> <head> <script language="javascript"> function increaseCounter() {     document.getElementById('testdiv').innerHTML ++;     setTimeout('increaseCounter();', 1000); } </script> </head> <body onload="increaseCounter();"> <div id="testdiv">1</div> </body> </html>[/code] Load that in your browser, and see if you can make something useful out of the innerHTML property. I'm sure www.w3schools.com has something they can teach you about it. And you may also want to check out AJAX - Asynchronous Javascript with XML. It's designed specifically for this purpose. Support the creators of this community and go to [a href=\"http://www.ajaxfreaks.com\" target=\"_blank\"]http://www.ajaxfreaks.com[/a] for more info. I'm afraid I've got no experience with that, so I can't help there. :)
  10. [!--quoteo(post=364657:date=Apr 13 2006, 09:14 PM:name=AndyB)--][div class=\'quotetop\']QUOTE(AndyB @ Apr 13 2006, 09:14 PM) [snapback]364657[/snapback][/div][div class=\'quotemain\'][!--quotec--] Depends on the exact format of your text file, but something like this might get you closer: [code]<?php $prices = file("pricesffs.txt");// read file into array for ($i=0;$i<count($prices)-1;$i++) {     echo $prices[$i]. "<br/>"; // echo each element of array }[/code] [/quote] This worked beautifully for me, except you need to change [b]count($prices)-1[/b] to [b]count($prices)[/b], or [b]<[/b] to [b]<=[/b]. Try this: [code]<?php $prices = file("pricesffs.txt");// read file into array for ($i=0; $i<count($prices); $i++) {     echo $prices[$i]. "<br/>"; // echo each element of array } ?>[/code] I've taken off the -1. Make sure you have pricesffs.txt in the same folder as the PHP script that's being called, or it won't find it.
  11. I use Gentoo Linux as my main operating system (only operating system), and after years of writing PHP scripts on a Windows machine, there are really very few differences, most of which are trivial: The new line characters, as kenrbnsn said, are different, however there is really very little practical application for them in Windows or Linux. In Windows, only \n\r officially qualifies as a new line character. However, in my experience, Internet Explorer and Firefox (and maybe others) treat all three forms of new line identically, so there is really no difference. Additionally, the directory delimiters are different - in Windows, directories are separated by a backslash \ [code]C:\Windows\System 32\[/code] whereas in Unix-like operating systems, directories are separated by a forward slash [b]/[/b]. [code]/usr/bin/[/code] And, as AV1611 said, Unix-like systems are case-sensitive. If you save a file as File.php, and try to include() it as file.php, it won't find it - in Windows, that's fine, but not so in *nix systems. There are a few PHP-specific differences, as well - for example, the printing library in PHP does not work in non-Windows operating systems. However, as little as I played with the printing library, the impression I got was that it's not very useful. Also, in non-Windows OS's, you don't have access to PHP's COM library - with good reason. COM is exclusive to Windows. Like the printing library, the COM and .NET libraries in PHP don't seem very useful at the moment. I honestly don't think you'll have a hard time adapting to a Linux environment, especially if you're just using it for an exam. Sure, there are some tips and tricks that may help you in your development, and you're not going to be using your favorite text editor, unless it happens to be an editor also supported in Linux, but they're not necessary for development.
  12. [!--quoteo(post=363777:date=Apr 11 2006, 03:10 PM:name=lead2gold)--][div class=\'quotetop\']QUOTE(lead2gold @ Apr 11 2006, 03:10 PM) [snapback]363777[/snapback][/div][div class=\'quotemain\'][!--quotec--] You guys should check out the game 'Apples to Apples'. Mind you; you need at least 4 people to play. but it can get really entertaining! That and pictionary is pretty fun... but again, i'm probably off topic because you guys are quoting games you can play with 2 people. ;) [/quote] That we've mentioned games you can play with two people doesn't matter - we're sharing our favorite board games, and they just so happened to be games you can play with 2. And Pictionary is one of my personal favorites; I like games where you guess stuff like that. Charades, Guesstures (sp?), etc. - I love it.
  13. I can't afford BF2 (or have the OS to run it on - I use Linux), but like SA and obsidian said, if you had a UT2K4 server, I'd be all over that!
  14. I'm guessing it's nothing more than a simple include() statement inside of a table cell, or modding the IPB index.php to have the PHP Freaks website wrapped around the IPB content.
  15. Yeah, we've been noticing this - I think someone mentioned that it's a IPB security feature that doesn't quite work all the way. Unfortunately, I'm not entirely sure how to get around it - the only thing I can suggest is to keep trying, or try a different forum.
  16. Wow... problems are showing up all over the place
  17. ToonMariner's got something, too... different operating systems have different new line characters: [code]Windows: \n\r Linux: \n Mac: \r[/code] \n is new line, while \r is carriage return - Windows apps usually require both. And you can also check out the nl2br function - you give it a string that contains new line characters, and it will return a string with HTML line breaks in their place. :) the <pre> tag is a personal favorite of mine - especially for print_r and var_dump. Without <pre>, the output from two functions gets messy fast.
  18. I'm afraid this will be a bit tricky to do in PHP - you can get the source for any page, but I'm not aware of any way to render a page in PHP. If you could do it, then you'd just have to use the GD library... but I don't think you can.
  19. A 404 is thrown by the web server when a client (your browser) requests a file from the server that does not exist. When you're using include(), that's not a client request; rather, it's the server requesting a file. If you try to include() a file that doesn't exist, it'll throw a PHP warning. [a href=\"http://www.php.net/manual/en/function.include.php\" target=\"_blank\"]http://www.php.net/manual/en/function.include.php[/a]
  20. If I were you, I'd just have the customers register with phpBB, and have your marketplace script use the phpBB table(s) - don't have any user authentication tables in your marketplace system. Although, I must say, it may be a bit more trouble than it's worth - all of my experience in integrating databases was not fun at all.
  21. You could check out FCK... [a href=\"http://www.fckeditor.net\" target=\"_blank\"]http://www.fckeditor.net[/a]
  22. That's made my day. It looks as though IE isn't very popular over in Redmond, either. :D
  23. [!--quoteo(post=358996:date=Mar 27 2006, 02:27 PM:name=darkcarnival)--][div class=\'quotetop\']QUOTE(darkcarnival @ Mar 27 2006, 02:27 PM) 358996[/snapback][/div][div class=\'quotemain\'][!--quotec--] could be a firewall issue? might want to check your firewall settings. It's certainly not going to be a firewall issue on the client side... maybe on the server side, but definitely not client side. If I were to take a guess, it'd be that the PHP Freaks staff was working on it, and maybe changing some Apache access directives.
  24. Does your SMTP server in fact work? I do know that you need to have your SMTP server sending from a registered domain, if you're planning on sending mail outside of your network, and that's a common problem for people without registered domains.
  25. [!--quoteo(post=353710:date=Mar 10 2006, 03:38 PM:name=AndyB)--][div class=\'quotetop\']QUOTE(AndyB @ Mar 10 2006, 03:38 PM) [snapback]353710[/snapback][/div][div class=\'quotemain\'][!--quotec--]apply a tweak to that (sub)forum to prevent replies altogether, i.e. a read-only forum. That would be my preferred solution as it's passive and needs no moderators to control the people who can't read/don't care. [/quote] I've thought of that - maybe automatically lock a thread after the first post? Then the user would have to get a mod to unlock it in order to bump it, though...
×
×
  • 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.