Jump to content

Joe Haley

Members
  • Posts

    103
  • Joined

  • Last visited

    Never

About Joe Haley

  • Birthday 12/13/1989

Contact Methods

  • MSN
    joehaley@gmail.com

Profile Information

  • Gender
    Male
  • Location
    Canada, eh?

Joe Haley's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. return halts excecution of a function and returns the specified value, so: [code=php:0] function foo() {     echo 'a';     return false;     echo 'b'; } foo(); [/code] would simpyl echo 'a', as once the function returns, the rest of the code within it is not executed. You could assign the value of $i to a variable, like so: [code=php:0] $string = $string . ' ' . $i; [/code] (.= is equivilent to $string = $string . $i) And then return $string.
  2. http://ca.php.net/manual/en/ini.core.php#ini.sect.file-uploads Look for .htaccess on google. both those directives can be controlled via a .htaccess file
  3. Not if you havnt implemented custom session save handlers. Read the PHP manual for more information on sessions.
  4. I would use an external CSS stylesheet, and external script. thus only 2 lines need to be in the header, and the browser may cache the data for faster loading times.
  5. It is possable. http://cssplay.co.uk/menus/index.html Many examples of neat CSS menus. (including ones similar to that which you describe.)
  6. Personally, i use the following structure for language constructs: [code=php:0] if (condition) // space between if and (condition) { // on their own lines     // 4 spaces, or 1 tab at 4 space widths     echo 'hi'; } [/code] As for comments, use them. lots of them. and look at PHPDocumenter for generating HTML pages based on formated comments (http://www.phpdoc.org/) For comments, it is most important to explain WHY you are doing something, then simply stating what you are doing. Also, i never exclude curly brackets. even when i can. i find my code is a bit more readable that way [code=php:0] if(condition)     print('hi'); // i would do: if (condition) {     print('hi'); } [/code] mind you, these are only my personal preferances. do what looks best to you. But remember: Use the SAME coding-stlye, dont change halfway throgh. (this can lead to verry messy code)
  7. [code=php:0] echo <<<END This uses the "here document" syntax to output multiple lines with $variable interpolation. Note that the here document terminator must appear on a line with just a semicolon. no extra whitespace! END; [/code] Will also work. (from the PHP manual)
  8. I would start off with learning the basic concepts of programing (if you alredy do not know them) From there, learn basic PHP syntax. (the manual is verry helpfull, http://php.net ) From there, learn some advanced programing concepts (sessions, sql, ext) From there, learn Object Orentation. From there, learn as many basic functions as you can. (again, the manual) From there, learn as much as you can about the advanced functions. From there, program something big! =)
  9. I do belive one of those options allows you to search only your site. if not, then just force a google search with a site: paramiter.
  10. Do you mean passing variables via the get method in a hyperlink? If so: echo '<a href="page2.php?var=' . $val . '">'; On page2.php: $_GET['var'] would contain the value of $val.
  11. [quote author=thorpe link=topic=101694.msg402674#msg402674 date=1153758938] Use || [/quote] I would use a switch. (easyer to read and expand)
  12. [quote author=DaveLinger link=topic=101662.msg402665#msg402665 date=1153758585] why couldn't you use external apps? As long as they are installed on the server and are usable from php... [/quote] because the screen he wishes to capture is within a SWF running on a clients machine. He esentally needs a way to make flash take a picture of itself, and send it to PHP.
  13. [code] 2004-10-20 15:33:12 0123456789012345678[/code] [code=php:0]<?php $a = substr($date1, 5, 2); //days (or is it months? i suck with date formats) of date 1 $b = substr($date2, 5, 2); //days (months?) of date 2 ?>[/code] FYI: The key in the code block shows you the 'number' of charicters. '10-20' starts at offset 5, and has a length of 5. Also, the 'type' of $a and $b is [u]String[/u], [b]not[/b] [u]Integer[/u].
  14. http://www.google.com/intl/en/services/websearch.html Google has some interesting options.
  15. are cookies enabled in your browser? is the value of $username false?
×
×
  • 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.