sKunKbad
Members-
Posts
1,832 -
Joined
-
Last visited
-
Days Won
3
Everything posted by sKunKbad
-
Part of the way that Google will determine the language of the page is the lang attribute on the html tag. Obviously the words on the page matter, too. Take a look at some of the popular PHP frameworks to see how they have done localization (i18n). It's really pretty easy to do.
-
You could do this a number of ways, but I would use a subdomain, like en.yoursite.com. If you create all of your links dynamically, you can change the domain according to the current domain. Actual text content would be stored in language files, and pulled in according to the current domain. I would not try to automatically translate your user's descriptions. Your likely to never have an accurate translation.
-
As you say, I'm sure it is pretty standard SQL syntax. I've used ORDER BY and LIMIT to do pagination many times, and I've also created and used stored procedures quite a bit. I've been working with MySQL for years, and I feel comfortable with using it, which happens every day actually. I have read a couple books on MySQL, but I think I have a habit of skimming over things I don't think I will use, and that's probably contributing to why I didn't see the usefulness of GROUP BY. I really don't like the MySQL docs. PHP has great docs when compared to MySQL. Also, I like real world examples, which the docs don't have a lot of. That's why when I saw the usage of GROUP BY I was so pleased. I have a lot of goals, and one is to have a more complete understanding of MySQL. For instance, I'm not really able to understand the usefulness of MySQL VIEWS.
-
As a freelancer working alone, I've got to wear all the hats, doing all the front end and back end design and development. So perhaps I'm never really specializing in any one thing, and I tend to miss some good stuff, like MySQL GROUP BY. Doing counts of things using GROUP BY is very handy. I saw somebody doing that in a thread, and adapted it to two things that I was working on in the last week. Sweet! What other fun MySQL stuff am I missing out on?
-
Summer running site - Dodgy links maybe?
sKunKbad replied to ericburnard's topic in Website Critique
For me, on my screen, it is like an illusion that there is no content, because the footer is at the bottom of the page, and because of the fixed positioning. Using FF (latest version) on Windows 7, the text "days" and "hours" appears floating in the middle of the days and hours show, making it appear as a rendering issue. You might want to confirm that this looks the way you intend. Browsing to the non-www version of your domain does not redirect to the www version. Consider duplicate content. -
Learning PHP reminds me of the feeling of falling
sKunKbad replied to Keyboarding's topic in Introductions
I didn't mean that PHP wasn't needed. I just think that JS is hooked deeply into modern web design. JS skills are mandatory. PHP is an essential. Must use both! -
I would be very upset if my host changed my SMTP host without notifying me in advance. If they had not sent you at least one email to let you know of this change, I would say that is unacceptable. You could have untold numbers of emails that were lost.
-
Learning PHP reminds me of the feeling of falling
sKunKbad replied to Keyboarding's topic in Introductions
Unfortunately you will probably end up going back to JavaScript again because it handles stuff that PHP doesn't handle. I started with PHP and didn't get very involved with JavaScript, but then found that I needed it. I now use it all the time. It's not like the old days where JavaScript was considered a option. These days JavaScript is enabled on like 99.99999% of devices. PHP and JavaScript are good friends though. I can't remember when I started in on web design and development, but it's probably been about 10 years. Been using PHP for 8 years. You never stop learning, so that feeling of falling will probably be with you for a couple years until you start feeling more comfortable. -
ginerjm is correct, but for the sake of learning what you wanted to do, most of the time you will not be using an IP address, but rather a domain. If you really do need the IP address, you can use the server variable $_SERVER['SERVER_ADDR']. Likewise, if you really did want to use the domain, you would use $_SERVER['HTTP_HOST']. Example: <?php $domain = $_SERVER['HTTP_HOST']; echo '<a href="http://' . $domain . '">Link</a>'; echo '<br />'; echo '<a href="http://' . $domain . '/contact">Link to contact page</a>';
-
This isn't really a PHP or WP issue, because the output is what you want it to be. What it is is a CSS issue, and if your on-hover color isn't right for the span, then you'll need to add/edit some CSS to make it right. So where you have CSS rules for "a" and "a:hover", you're also going to need one for "a span:hover". This wouldn't normally be the case, but it seems that you might have a rule that this span is inheriting from.
-
sitemap create large website photo albums with java etc
sKunKbad replied to ssaigal's topic in Applications
Have you checked out phpSitemapNG? It is no longer maintained, but it works pretty well. -
Swap value of ->fetch(PDO::FETCH_ASSOC) in WHILE loop
sKunKbad replied to Raz3rt's topic in PHP Coding Help
I think he may need nested foreaches, because he wants the keys (field names). foreach ($rma_details_stmt as $rma_details) { foreach( $rma_details as $k => $v ) { // $k is the key and $v is the value of the field } } -
Swap value of ->fetch(PDO::FETCH_ASSOC) in WHILE loop
sKunKbad replied to Raz3rt's topic in PHP Coding Help
$result = $stat->fetchAll(); foreach( $result as $k => $v ) { if( $v['whatever'] === 1 ){ $v['whatever'] = 'yes'; } // $k is your key, so do something with it } -
Doesn't OP's code more or less show an example of dependency injection? Yes, having the class and implementation of the class in the same script is not appropriate, but he's learning, and it's not half bad. Also, I think a DB connection is a great place for a singleton, no? Would one really want to make multiple connections to the database in the same request? In any case, OP needs to read up on dependency injection and service locators, and also take a look at the modern PHP frameworks and how they are handling dependencies.
-
I always tell people that WordPress is a great example of how not to code. It's the definition of spaghetti code. Makes CodeIgniter look like a golden nugget, LOL.
-
If you can provide any actual errors shown, that would be helpful. WP has no "environment" like most modern PHP frameworks offer. So to see the errors, you must set WP_DEBUG to TRUE in wp-config.php. Just looking at your code, there are a couple things wrong. First, you're not ending your while loop. Secondly, you will probably need to use output buffering to capture the output generated, then insert it into your function. Look at the PHP manual for ob_start, and then go from there.
-
It's not going to give your site visitors the feeling that they are dealing with a professional company. You might go over to themeforest.net and search for responsive WordPress designs. You can do really well for about $50 and a couple of hours to input your content.
-
using PHP to "fetch" files from a folder (for a CMS-type site)?
sKunKbad replied to sirhawkeye's topic in PHP Coding Help
So, lets say your files are in a directory named foo, then in your .htaccess file: RewriteEngine On RewriteBase / RewriteRule ^(foo) - [F,L] Requests for files in foo will output a 403 error. PHP scripts will still have access. -
I've used inMotion before, and also complained to everyone about how I felt they were deceptive and trying to get me to upgrade my account for no reason. As soon as I told them I was leaving, then all the sudden there was no problem. I've been using MDD Hosting, www.mddhosting.com for about 4 years now. I have a semi-dedicated account, which costs about $22 a month. They've been very helpful when I needed server changes, and they have a better "smaller business" type of customer support that works well for me. I have a lot of reasons that I like them, but some highlights are the litespeed server, php 5.5.12, and if something goes bonkers with the server they are very up-front with what is going on. For instance, when they had a hardware issue they emailed everyone letting them know that they were working on it and maybe to expect certain things. If you go with inMotion, remember this story if they tell you your account is using a lot of resources and they are going to need you to pay more for a better account.
-
I wasn't suggesting that you use the script for production purposes, only to test basic file uploading. So 777 or 755, makes no difference. Quick search on Google for "modsecurity input filter" gave me this: https://discussion.dreamhost.com/thread-138012.html See last response, which indicates something useful about mod security:
-
I don't think what your trying to do is possible. I understand usage of window.onbeforeunload, but don't believe that it's meant to be used for what you're attempting to do. As far as I know, window.onbeforeunload is only going to give the site visitor a chance to stay of leave, based on a suggested message. For instance, "Are you sure you want to leave, because if you do the world will self destruct.". Maybe I'm wrong.
-
Open up the index file and tell it where the system file is. That's what it's telling you to do. You'll see a variable in that file called $system_path. Set it to reflect where the CI system directory is. You may also need to set the variable directly under it, called $application_folder.
-
<?php if( isset( $_FILES['track'] ) ) { if( ! is_dir( __DIR__ . '/uploads' ) ) { mkdir( __DIR__ . '/uploads', 0777, TRUE ); } if ( ! @copy( $_FILES['track']['tmp_name'], __DIR__ . '/uploads/' . $_FILES['track']['name'] ) ) { if ( ! @move_uploaded_file( $_FILES['track']['tmp_name'], __DIR__ . '/uploads/' . $_FILES['track']['name'] ) ) { echo $_FILES['track']['error'] . '<br />'; } } echo 'Upload attempted <br />'; } else { echo 'No Track'; }
-
Google oversætte, bare så du ved det. Jeg tror, din hjemmeside er OK. Jeg kan godt lide, at det er lydhør. Der er noget for minimalistiske om det selv. Responsive hjemmeside design behøver ikke at ligne børnehavebørn designet det med farvekridt. Jeg vil sige at arbejde på at forfine designet. Det er de subtile ting at tilføje op til noget stort. Baggrundsbilleder, skygge, skygger, grænser, osv. osv. Gør det et mesterværk! Google translating, just so you know. I think your website is OK. I like that it is responsive. There's something too minimalistic about it though. Responsive website design doesn't have to look like kindergarten students designed it with crayons. I'd say to work on refining the design. It's the subtle things that add up to something great. Background images, shading, shadows, borders, etc, etc. Make it a masterpiece!
-
help me to create a login and logout form with session
sKunKbad replied to MachineGamer's topic in PHP Coding Help
There is really nothing simple about an effective, safe, and trustworthy authentication script / class. Having spent hundreds of hours on my own, I can tell you that you aren't going to get a final product worth using unless you have great dedication. Your best option is to pick up a framework that already has an Auth class.