Jump to content

trq

Staff Alumni
  • Posts

    30,999
  • Joined

  • Last visited

  • Days Won

    26

Everything posted by trq

  1. Javascript executes on the client, while php executes on the server. See the problem with your code?
  2. This isn't a PHP setting, but an Apache one. AddType application/x-httpd-php .html
  3. This topic has been moved to Installation & Configuration Issues. http://www.phpfreaks.com/forums/index.php?topic=346331.0
  4. If the files are uploaded to a location outside of your web root, they are not accessible from the web. It's that simple. if you want to make them accessible, either move them, or write a script to serve them to a client. Now, do you have a question?
  5. This topic has been moved to Application Design. http://www.phpfreaks.com/forums/index.php?topic=346338.0
  6. This topic has been moved to PHP Installation & Configuration. http://www.phpfreaks.com/forums/index.php?topic=346325.0
  7. Your not using $array1 or $array2 as arrays. Really, your code is quite all over the place. Also, you should have a separate method responsible for printing. Having a 'setter' also print is just poor design. <?php class Foobar { private $array1 = array(); private $array2 = array(); private $binary = 1; /*Toy FCN that will append "dog" to 1 and "cat" to -1*/ //param numRuns is how many times to run this FCN function putInProperArray($numRuns) { for($i=0;$i<$numRuns;$i++) { if($this->binary==1) { $this->array1[] = "dog"; } else if($this->binary==-1) { $this->array2[] = "cat"; } $this->binary*=-1; } } public function print() { echo implode(' ', $this->array1); echo implode(' ', $this->array2); } }//END CLASS Foobar $fooBar = new Foobar; $fooBar->putInProperArray(3); $fooBar->print(); ?>
  8. CSS files are cached. So making a client donwload a new stylesheet for each page is more of a waste of resources than having all your styles in a single sheet.
  9. Your not testing that $_POST['password'] exists before using it. See isset.
  10. You also have this: if($_POST['password1'] = $_POST['password2']) The = operator is for assigning, == is for comparing.
  11. Actually, it's pretty easy to see even without a decent description. You have this: if(isset($_POST['submit'])) And then within that statement is no code that actually executes any query.
  12. This topic has been moved to PHP Coding Help. http://www.phpfreaks.com/forums/index.php?topic=346308.0
  13. You might want to actually give us some details of what your issue is.
  14. It should NOT be within your class, it makes no sense. class foo { // class code } // code that uses a class to instantiate an object $f = new foo;
  15. Didn't notice it before. This code: $fooBar=new Foobar(); $fooBar->putInProperArray(3); Is within your class. It does not belong there. Are you sure you have programmed Java?
  16. $array1, $array2 and $binary do not exist within your class. This is no different to how things work in Java. Move them into your class: <?php class Foobar { private $array1 = array(); private $array2 = array(); private $binary = 1; Now you can access them within the putInProperArray() method by using the special $this keyword. eg; $this->binary
  17. This topic has been moved to PHP Coding Help. http://www.phpfreaks.com/forums/index.php?topic=346269.0
  18. This topic has been moved to Miscellaneous. http://www.phpfreaks.com/forums/index.php?topic=346288.0
  19. You need to learn the actual language before you can start to build software with it. Do you know PHP at all? I would start by learning that first.
  20. See section 14.30 of http://www.faqs.org/rfcs/rfc2616.html
  21. As I said, the Location header expects a complete url. Using a path like floridaflatlander suggested is NOT recommended.
×
×
  • 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.