ignace
Moderators-
Posts
6,457 -
Joined
-
Last visited
-
Days Won
26
Everything posted by ignace
-
insert: echo '<p>'; before the first echo in the while and insert: echo '</p>'; just before the closing }
-
Cheers! No, tiredness (masquerading as stupidity!) - I concede that. Rw Just a joke rwwd
-
This one has bugged me since it came on, but for the life of me I couldn't put my finger on what was wrong with it, if your right Ignace (which I don't doubt you are) Do I feel stoopid - or what, doh.. Rw stoopid, no - unexperienced, maybe PHP != Java You can't do this for example in PHP: public class SomeJavaClass { private SomeJavaClass parent = new SomeJavaClass(); }
-
Question about 'proper way' to use objects, methods, classes
ignace replied to Darkelve's topic in PHP Coding Help
try { $gateway = new UserStoreGateway(); $user = $gateway->createRow($_POST); $user->save();} catch(DbServiceUnavailableException $e) {} catch(UserAlreadyExistsException $e) {} This might be more re-usable then a simple Database object that would act as a grand Façade for everything Database. -
You can't have a function in a class variable declaration.
-
colspan="all" => <div/>
-
@OP 1) Using globals inside functions/classes is bad practice. 2) Login::filter() is a violation of SRP (Single-Responsibility, and quite a few others: DRY for example) as I doubt you want to create an instance of Login class whenever you need to filter data.
-
Typically I wouldn't because until the user successfully logs in we can't actually speak of a "User" as we know nothing about him only that he's a Guest/Visitor (a Special Case of "User" at best). In the login procedure we create a personification of the User on the system which leads me to believe that the login procedure should be handled by a Creational Pattern: like Factory (or Builder if the personification requires multiple steps as could be the case with an ACL). That's of course the modeler inside of me, from an SRP-perspective a login() method on a User-class is of course perfectly fine.
-
Hi, What do you think about this design? I'm teaching myself Photoshop
-
CREATE TABLE do ( your INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY, own VARCHAR(32) CHARACTER SET utf8 NOT NULL, homework TEXT CHARACTER SET utf8 NOT NULL ) ENGINE = MyISAM;
-
Detailed Site critique need from Professional designers like you
ignace replied to king450d's topic in Website Critique
@Rakuhana 1) An image preloader may not be ideal, it's still better then having your images load slowly one-by-one on the web-page. 2) XHTML??? IE never even has supported XHTML (try to load index.xhtml in IE, it won't even work) as it renders it just like HTML. Almost every website that uses "XHTML" has it's content-type set to "text/html" while this should be set to "application/xhtml+xml" for XHTML documents. -
You are looking for an Access-Control List (ACL). If you want to assign permissions on a per-user basis you can use: user (id) resource (id) acl (user_id, resource_id, permission) If you want to make it for a group of users: user (id, role_id/group_id) role/group (id) resource (id) acl (role_id/group_id, resource_id, permission) Where permission is allow/deny and a resource can be something like 'add_comment'. In your application you can then add something like: if($acl->isAllowed('add_comment')) {
-
The use of the Autoloader is encouraged.
-
Open the zf.bat with a text editor.
-
No, they are not. Your design isn't normalized or optimized, mine is.
-
It didn't strike me as one It would, every user has a locale setting (not saying this is entirely reliable but it will give you an idea of what languages the user can speak). It would look for Kings of Leon on YouTube, MusicSearch, and Lyrical.
-
You have a unique concept but have gone it the wrong way. When a user consults a search engine that means they want what they are looking for fast, your website does not satisfy that need it merely provides a shortcut while it can be that much more IMO. A better approach would have been if you showed the top 10 results of the major search engines (Google, Bing, Yahoo) if they didn't select a search engine. I also noticed that when you select a search engine, YouTube for example you get a "prefix" I like this but I hate it that I still need to select it and can't just type "youtube<space>" to filter my results to a certain engine. Chaining up to 3 (or more) search engines would also be a nice feature, something like: "youtube<space>musicsearch<space>lyrical<space> kings of leon" would be transformed into "[musicsearch][lyrical] kings of leon" and show results out of those 3 search engines sorted on highest relevancy.
-
Your table should look somewhat similar to: user (id, user_name, password)status (id, user_id, status, posted_at)like (status_id, user_id, liked) In mySQL this would be: CREATE TABLE user ( id INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY, user_name VARCHAR(32) NOT NULL CHARACTER SET utf8 COLLATE utf8_bin, password CHAR(40) NOT NULL CHARACTER SET ascii, INDEX idx_user_logon (user_name, password), UNIQUE idx_user_name (user_name)) ENGINE = MyISAM;CREATE TABLE status ( id INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY, user_id INT UNSIGNED NOT NULL, status VARCHAR(160) NOT NULL CHARACTER SET utf8 COLLATE utf8_bin, posted_at DATETIME NOT NULL, INDEX idx_status_user_id (user_id)) ENGINE = MyISAM;CREATE TABLE like ( status_id INT UNSIGNED NOT NULL, user_id INT UNSIGNED NOT NULL, liked TINYINT(1) NOT NULL DEFAULT TRUE, INDEX idx_like_status_id (status_id), PRIMARY KEY (status_id, user_id)) ENGINE = MyISAM; This design should cover most of your bases (user_name should only be registered once, user_name|password index for login, ..).
-
You can use the Zend tool with the Zend tool created file structure any other structure means you'll have to re-write pieces of the Zend tool.
-
No. Would you complain if someone made you extra revenue?
-
Using require() isn't safer then using include() as they are technically the same except require() will halt the script if it can't find the file.
-
curl_setopt_array($curlConfig); should be curl_setopt_array($curl, $curlConfig); and reading "Object required: 'oXML.documentElement'" I think it's not possible to send from PHP to ASP
-
does converting a website restart search engines?
ignace replied to corbeeresearch's topic in Application Design
If your websites text remains the same you don't have anything to fear. You do need however to put a 301 (or 302?) to the new page. -
Here's the translation. Please note that I didn't test it because I couldn't (192.168 is type C -> local) Making it work will be your end of the bargain. $companyKey = '212121'; $server = 'http://192.168.1.111/'; $xml = '<?xml version="1.0" encoding="utf-8"?>' . '<LeadImportDatagram>'. '<CompanyKey>' . $companyKey . '</CompanyKey>' . '<NotificationEmailTo>joeschmoe@aol.com</NotificationEmailTo>' . '<LeadInfo>'; foreach($_POST as $key => $value) { //This code assumes that the form fields match up exactly with the node names, including uppercase/lowercase. //You may need to write custom code here if that's not true for your form. $xml .= '<' . $key . '>' . htmlentities($value) . '</' . $key . '>'; } $xml .= '</LeadInfo>' . '</LeadImportDatagram>'; if(substr($server, 0, 4) != 'http') $server = 'http://' . $server; if(substr($server, -1) == '/') $server = rtrim($server, '/'); $curlConfig = array( CURLOPT_POST = > true, CURLOPT_RETURNTRANSFER => true ); $curl = curl_init($server . '/xml/importlead.php'); curl_setopt_array($curlConfig); $responseText = curl_exec(); $httpCode = curl_getinfo($curl, CURLINFO_HTTP_CODE); if($httpCode != 200) { echo 'Error sending XML: ' . $responseText; exit(0); } header('Location: thanks.php'); exit(0);
-
Take a look at http://builditwith.me (no one ever said your degree can't be profitable )