Jump to content

ignace

Moderators
  • Posts

    6,457
  • Joined

  • Last visited

  • Days Won

    26

Everything posted by ignace

  1. The link bar thing was an example it can be anything really. Besides a wireframe is always a good idea it's not only about the content. It's how you will line-up everything anything so you can instead of dragging or tapping left- or right key to adjust your layer everything snaps into place and is immediatly correctly spaced. Don't they teach you that in class? If they don't LEAVE or if they don't even know what a wireframe is.. LEAVE EVEN FASTER and ASK YOUR MONEY BACK. Damn one once told me: unit-testing why would you do that???
  2. // Dialog for the download header("content-type: application/octet-stream"); // open with MSWord header("content-type: application/msword"); // open with MSExcel // header("content-type: application/vnd.ms-excel"); // open with text // header("content-type: text/plain"); This basically replaces content-type with: application/octet-stream then rechanges it to application/msword until it finally ends up with text/plain. You can only define one content-type
  3. I already told you that: $ext = findexts ($_FILES['userfile']['name']) ; // is the same as $ext = pathinfo($_FILES['userfile']['name'], PATHINFO_EXTENSION); You don't need to waste more memory then required. If you want to upload a file from domain.com to sub.domain.com then place the upload script on sub.domain.com and let domain.com refer to it <form action="http://sub.domain.com/upload.php"> Or if you need it at both domains perform the upload on domain.com and then pass (using curl) a task to sub.domain.com which tells him that he needs to download a file something like: http://sub.domain.com/upload.php?uri=http://domain.com/uploads/file.jpg
  4. Set your constraints to: ON UPDATE CASCADE ON DELETE CASCADE Or maybe better advice: DROP THE CONSTRAINTS If you don't need the whole data integrity just DROP IT!
  5. Make the text "McGovern.." smaller. Also apparently you are not taking my advice I told you to draw guides these really ease your design work as elements just "snap" to these guides and if you add proper whitespace too then everything will fall to place.
  6. Constraints are used to maintain data integrity which basically means that you can not a delete primary key if there are still foreign keys referring to it which in turn means that before you can delete this record you must delete all records that may contain a foreign key to this field. A good scenario is linux where you can not delete a directory before deleting the files inside and this rule also applies to every directory in the directory.
  7. "SELECT * FROM members WHERE login='$login' AND passwd='".md5($_POST['password'])."' AND is_approved = TRUE"
  8. Apparently you haven't set the appropriate headers
  9. If you want someone to write code for you then head over to the freelance section in here we only help you with debugging your code.
  10. He can't encode it because if he would he wouldn't be able to authenticate anyone because he can't generate the same prefix and annex twice!! Apparently only I and mjdamato are aware of this. Only mjdamato's option is tried-and-true.
  11. Post some code if you want us to be able to help you
  12. A bad habit I guess mostly use it in conjunction with content negotiation
  13. If you want to pay someone you should head over to the freelance section. This section is reserved for help with code (debugging mainly). What are you actually asking for? Someone to write your db and sql queries?
  14. If you could provide us with a detailed explanation I might be able to give you an idea on how complex this might be
  15. I think only you will be stumped when suddenly everything's gone.. mjdamato is IMO the only legit tried-and-true option
  16. Add an additional field that indicates wether they may login: is_approved BOOLEAN NOT NULL DEFAULT FALSE On login: WHERE username = '$username' AND password = '$password' AND is_approved = TRUE
  17. print 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['SCRIPT_NAME']; print nl2br("\n"); print dirname(__FILE__);
  18. Might not be perfect but gives you a good idea on how you can implement this: interface IValidator { public function isValid($value); } class ValidatorChain implements IValidator { protected $_chain; protected $_messages; protected $_haltOnFirstError = false; public function __construct($haltOnFirstError = false) { $this->_chain = new ArrayObject(); $this->_messages = new ArrayObject(); $this->_haltOnFirstError = $haltOnFirstError; } public function addError($error) { $this->_messages->append($error); } public function addErrors($errors) { foreach ($errors as $error) { $this->addError($error); } } public function getErrors() { return $this->_messages; } public function addValidator(IValidator $validator) { $this->_chain->append($validator); } public function isValid($value) { if (!sizeof($this->_chain)) return true; $valid = true; foreach ($this->_chain as $validator) { if (!$validator->isValid($value)) { $this->addErrors($validator->getErrors()); if ($this->_haltOnFirstError) return false; if ($valid) $valid = false; } } return $valid; } } abstract class ValidatorAbstract implements IValidator { protected $_messages; public function __construct() { $this->_messages = new ArrayObject(); } public function addError($error) { $this->_messages->append($error); } public function getErrors() { return $this->_messages; } } class IsNotEmpty extends ValidatorAbstract { public function isValid($value) { if (empty($value)) { $this->addError("$value is empty"); return false; } return true; } } class IsNumeric extends ValidatorAbstract { public function isValid($value) { if (!is_numeric($value)) { $this->addError("$value is not numeric"); return false; } } return true; } $validator = new ValidatorChain(); $validator->addValidator(new IsNotEmpty()); $validator->addValidator(new IsNumeric()); if (!$validator->isValid('')) { print_r($validator->getErrors()); }
  19. In the upper left corner there is your search form. Now if you browse through your website it's functionality changes to search user some may not notice the change and mistake it for the old (to find an image, topic, url)
  20. $num-->intval This reminds me about a discussion on StackOverflow intval(PHP_INT_MAX+1) This is funny but no so funny as this: PHP_INT_MAX+1
  21. No you still have to create a db connection however if your smart you apply caching and the entire website will be run off on static html pages which get replaced once the user update a page in the back-end. And by update I mean get the new content apply the template and instead of rendering you store it's output to a html file. If your CMS also provides "slugs" like blogs do, you get: about-us.html
  22. @Rayth can't believe you missed this: if ($don = "1") // should be == or === Instead of making it so hard to add something so futile do this: echo $don == 1 ? "<span class=\"donator\">$playername</span>" : $playername; Then using simple CSS: .donator:after { content: " *"; color: #0EE; }
  23. Depending on their browser: a usable or unusable website.
  24. $query = 'SELECT * FROM users'; $result = mysql_query($query, $connection); $fieldCount = mysql_num_fields($result); for ($i = 0; $i < $fieldCount; ++$i) { echo mysql_field_name($result, $i), ', '; } Outputs: id, username, password, email_address
  25. Article on StackOverflow with multiple options: http://stackoverflow.com/questions/594004/can-windows-authentication-be-used-with-php-on-iis-for-odbc-connections
×
×
  • 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.