ignace
Moderators-
Posts
6,457 -
Joined
-
Last visited
-
Days Won
26
Everything posted by ignace
-
Build your website in one language it's IMO the best solution some use a setup like an PHP array and a table for translations of their pages and their blog posts, .. To many sources to maintain keep it all in your database. If the user selects a language then translate everything that has a translation in the translation table. create table language ( id integer not null auto_increment, name varchar(32), -- Dutch (for back-end) name_translated varchar(32), -- Nederlands (for front-end) code char(2), -- nl unique language_code_un (code), primary key (id)); create table translation ( id integer not null auto_increment, language_id integer, message text, -- message as typed on the website message_translated text, -- translated version key translation_language_id_fk (language_id), primary key (id)); Now on your website: <a href=".." title="<?php print translate('Return to the frontpage');?>"><?php print translate('Frontpage');?></a> Your function translate remembers the language of the user (cookie otherwise HTTP_ACCEPT_LANGUAGE or system settings eg English). SELECT t2.* FROM language t1 JOIN translation t2 ON t1.id = t2.language_id WHERE t1.code = $code
-
No you create a wireframe on paper (altough there are tools to make neat wireframes) From a scale from 0 to 10. 10 being really bad.. 15.
-
Is there a way to override built in php functions without APD?
ignace replied to DssTrainer's topic in PHP Coding Help
I highly discourage overriding or renaming built-in functions. What is in page.php? -
Oh it's been there for some time already... Care to share those Daniel quotes? I doubt it could come from anyone else
-
- Make the buttons part of the website instead of them sticking out - "...Latest pub events submitted" what is that doing there? I don't see anything submitted? - Remove the green light unless "Submit pool event" is only available during a certain period of the day - "Tournaments Local" does local represent a tab? If not don't make it look like a tab - Watch out with "Send to a friend" don't enter anything of your website except what the submitter wrote due to a pending court order - Don't use technical terms like "round robin" instead explain to users immediatly know what it is and not have to guess - Remove the bullets under News, Tournaments, .. - Add a submit button to your search field (accessibility)
-
Yeah I agree. Solved about 90% of my problems.
-
Are you referring to the "Whether it's Death Metal...." quote? Can I re-create the text in a p tag and just send it -2000 pixels off the screen with css as well? I've heard of this being the correct way to display image as text without removing the text itself for search engines but that might not be proper. Yes. Not sure how to do that. If you have any links on how to fix this problem, or at least create a personalized 'thank you for submitting page' that would be greatly appreciated. It's not that hard. It can be as simple as: <?php $errors = array(); $show_form = true; if ('post' === strtolower($_SERVER['REQUEST_METHOD'])) { function is_valid_name($value) { // do stuff here return true; // or false based on above code } function is_valid_email($value) { // do stuff here return true; // or false based on above code } function is_valid_message($value) { // do stuff here return true; // or false based on above code } function clean($value) { $value = trim($value); $value = strip_tags($value); $value = htmlentities($value, ENT_QUOTES); return $value; } $_POST = array_map('clean', $_POST); $name = $_POST['name']; $email = $_POST['email']; $message = $_POST['message']; if (!is_valid_name($name)) { $errors[] = "$name is not valid."; } if (!is_valid_email($email)) { $errors[] = "$email is not a valid e-mail address."; } if (!is_valid_message($message)) { $errors[] = "Your message is invalid."; } if (0 === sizeof($errors)) { $show_form = false; $headers = array( "From: $name <$email>", "Reply-To: $name <$email>", "Return-Path: $name <$email>" ); if (!@mail('your email here', 'your subject here', wordwrap($message, 70), implode(PHP_EOL, $headers))) { $show_form = true; $message = urlencode($message); $errors[] = 'E-mail was not submitted due to an internal server error.' . ' However your inputted data is not lost and there is another option for you available to send your e-mail' . ' by using <a href="mailto:your email here?subject=your subject here&body=$message">your own e-mail client</a>' . ' (link contains additonal data that will pre-fill your e-mail).'; } } } if (!$show_form) { ?> your personal thank you message <?php } else { if (sizeof($errors)) echo '<p>Your message something went wrong</p>', '<ul class="form-errors"><li>', implode('</li><li>', $errors), '</li></ul>'; ?> form here <?php // don't forget: <input type="text" .. value="<?php print isset($_POST['name']) ? $_POST['name'] : ''; ?>" .. } You mean integrate the blog as an actual part of the website instead of using third party blogging (ie Blogger)? No. Integrate it. Read the RSS feed using PHP for example and display it on your website.
-
CREATE DATABASE databaseName; And where? If you have phpMyAdmin might be a good start or if you are running mysql you can use the command-line: > mysql --username username --password password
-
You normally don't wireframe in Photoshop you also normally don't violate de facto rules Yeah I know: I am a pain in the ass Put the navigation on top or left or right (rather left then right)
-
Ok thanks salathe already thought they would. Not sure, manual does not tell explicitly. And congrats with your recent promotion.
-
You should not use type to verify it's an image because I can upload PHP files this way if I tell my browser that PHP is an image. See http://josephkeeler.com/2009/04/php-upload-security-the-1x1-jpeg-hack/
-
Sort of new site - Commercial and Residential Cleaning
ignace replied to Plagel's topic in Website Critique
- HTML & CSS are invalid - The website provide services to specific area's use geo-targeted keywords (your client will thank you) + Make sure to highlight keywords on all pages. - To increase SEO I would replace: <!-- XHTML specifies alt as a required attribute (http://htmldog.com/reference/htmltags/img/) --> <img width="750px" height="71px" src="http://www.sparkleaning.com/images/headbg2.png"/> With <h1><span>Sparkleaning</span></h1> h1 span { margin: -9999px; } h1 { background-image: url(http://www.sparkleaning.com/images/headbg2.png); background-repeat: none; width: 750px; height: 71px; } - Optimize your webpage titles to increase findability. They now look the same for each page. For the homepage I would recommend something like: - I think it's ok for the contact form to be on every page easy for people to contact your client (especially because it's a small website). It's not a de facto but it doesn't bother me altough I would add a title to it indicating that it's a contact form. - One of your contact form items is mislabeled <label for="name">Name</label> <input type="text" name="first_name" ..> -
Don't change your opinion just because someone with a rep. made some good arguments. No need for dogmatic thinking research it yourself see if all of his points are indeed true and if not counter-argue. Don't mistake me here and I certainly don't want to question Daniel's knowledge quite the contrary but not everyone is like Daniel and it's best to not always take someone's word for it. Plus March 2009 is not so current.. Remember only intelligent people ask questions all other just nod. Edit: nevermind
-
Shorter: print_r(array_fill(0, 8, '1'));
-
Or $array = range(0, 10); $keys = array_rand($array, 3); echo $array[$keys[0]]; echo $array[$keys[1]]; echo $array[$keys[2]]; I'm not sure these are unique.
-
Use a library like jQuery. It allows you to drag 'n drop plus ajax functionality.
-
Also eregi is deprecated use preg instead.
-
If you apply multiple functions to a single input then create a new function something like: function clean($value) { $value = trim($value); $value = strip_tags($value); $value = addslashes($value); if ($temp = @mysql_real_escape_string($value)) $value = $temp; // PHP Manual: mysql_real_escape_string: Returns the escaped string, or FALSE on error. return $value; } $_POST = array_map('clean', $_POST);
-
I didn't fill it in to many difficult questions: I answered Italian How should I know? And NO I am not going to look it up!! If you want to call me a douche then please atleast make it easy for me to fill it in
-
2 Scripts, 1 Error - Need them Blending together - Possible?
ignace replied to kma9000's topic in PHP Coding Help
What is it that you want to do? $Int32Unit = 4294967296; // 2^32 I can be wrong but as far as I know this is not possible PHP's max INT size is -2^31 -> 2^31-1 instead of 4294967296 use PHP_INT_MAX -
What are you actually looking for? How to write SQL? The documentation can be found here: http://dev.mysql.com/doc/
-
- Your homepage commits Search Engine suicide. Get the text out of the image and place it into the html. The effect you want can easily be achieved using some CSS applied to the paragraph that contains your text. - Your keywords do not nearly match your text. - The user never knows where he is. Highlight your navigation links to indicate active page. - Your user will most likely land on your homepage don't make him click more to find more information. A very good example is this portfolio (http://www.legacydesign.co.uk) All information you may seek is on this page. Who he is, what he does, where he lives, what he can do for you and how you can contact him. - I can submit the form empty. And once submitted I land on an unknown page with no identifiable interface with your website. Keep consistency among your pages. - Please do write your own form submission script and don't use someone else's messages like these are ugly and don't contribute to value increase towards prospects: - As you are apparently blogging I highly recommend integrating it as it increases your value towards prospects and gives you lots of keywords - Both your HTML and CSS are invalid. - All page titles are the same. Create a title specific for each page to increase SEO
-
Object Oriented Programming Question: accesing object values
ignace replied to phpfreakjav's topic in PHP Coding Help
if($row[$columnName]== $id) { return true; } else { return false; } can be written as: if($row[$columnName]== $id) { return true; } return false; -
Try: http://freelanceswitch.com/resources-directory/