sKunKbad
Members-
Posts
1,832 -
Joined
-
Last visited
-
Days Won
3
Everything posted by sKunKbad
-
The one and only Salathe I presume? I believe you have helped me, or been involved in discussions with me on Sitepoint and Kohana forums. Yes, you are obviously correct. I was doing too much work. Oddly enough, in the 3.5 years I've been using php, I've never used current() or key(), so these functions are new to me. While I'm glad that I was able to solve my problem, I'm happy to have had my problem so I could learn something.
-
I had tried using array_keys, but for some reason even after a second attempt, it still wouldn't work. Using current() , which is something I've never used, worked great! What kind of complicates things is that this array is inside an array, but it does work now: <?php // redirect if only one option if (count($rates_array) == 1) { $ak = array_keys( $rates_array ); if( count( $rates_array[ $ak[0] ] ) == 1) { $ak2 = $rates_array[ $ak[0] ]; $_SESSION['checkout_data']['shipping_fee'] = current($ak2); $_SESSION['checkout_data']['shipping_type'] = array_search( current($ak2) , $ak2); header("Location: ".secure_base_url()."checkout/card_accept/one_ship".SITE_FILE_EXTENSION, TRUE, 302); } } Thanks for your help!
-
If I have an array with only one key => value pair, like this: Array ( [black] => 5 ) I know I can use foreach to get the key and value, but since there is only one key=>value pair, and there will only ever be one key=>value pair, I was thinking there has to be a better way than using foreach. At first I thought that I should use [0], but that results in an undefined index. Should I just use foreach, or is there a better way to get both key and value.
-
I didn't say I don't personally like Flash. I said that I make new websites for customers who have Flash websites that don't work well for them. Most web designers/developers don't provide alternate content and the result is a site with little or zero SEO value. The truth is, I really don't like Flash except for the video player capabilites, but my opinion of Flash doesn't change the fact that alternate content is needed to make it perform well. Do you want to see a site with Flash done right? Check out Hemet Pool Care. View the source, and see how the alternate content is applied.
-
[SOLVED] Help parsing xml... while loop is destroying data? (WTF)
sKunKbad replied to shauntain's topic in PHP Coding Help
I only asked because the docs don't show any good examples, and the code you have shown doesn't make any sense to me. SimpleXML is what I've been using, and they don't call it simple for nothing. -
[SOLVED] Help parsing xml... while loop is destroying data? (WTF)
sKunKbad replied to shauntain's topic in PHP Coding Help
Why not simpleXML? -
When I view your site on my Mac using Firefox 3.5, the main content area is blank. Opera shows the same thing. Safari is a bit better, but you have some work to do, and need to test in multiple browsers.
-
It's funny that you say you hate when people design a website using 1990s techniques, but if the company is using Windows 2000 with IE6, they'd feel right at home. I always make sure my designs work in IE6 (for now), but IE6 users can't expect to have everything (except for maybe some viruses and trojans!), and certainly can't expect to use IE6 forever. 12 of the last 500 people that came to my website were using IE6. That's 2.x%, and on a good day, when all of the senior citizens get on the internet, it might be as high as 10%. At some point, depending on the site, it doesn't make sense to support IE6. In the OP's case, maybe it's the only browser he/she needs to worry about designing for? Part of what I have learned over the years is get the project requirements before starting the job. OP should have known to test in multiple browsers / operating systems in the first place. I've never had to design an internal application for a company that used IE6, but it would be a sad day if I had to accept such work.
-
function queue($skip) { if($skip == FALSE) { // check for new skip value $new_skip = // some value from database or something queue($new_skip); } return TRUE; } Note that you have the potential for an infinite loop if skip never returns true.
-
Forms and PHP: Getting Option Value into PHP
sKunKbad replied to FangerZero's topic in PHP Coding Help
Yes, what he said.... You need to change your value="1" to value="dogs". Either that, or use a switch to reference what number belongs to what animal, or use foreach on an array that compares the value to a key. -
Windows 2000 had IE6. Have you tested this website in IE6 on any other computer? When testing websites, I test with: Win XP (IE6, IE7, IE8, Firefox 3.5, Opera 9, Safari 4, Chrome) Windows Vista (IE7) Windows 2000 (IE6) Mac OSX (Opera, Firefox, Safari) Ubuntu (Firefox) but even when testing, there are sometimes little differences that can't be solved, or can't be solved easily. I would tell your customer that it is normal for IE6 users to not have a good experience on the internet, and why should your site be different? Should you also accommodate 640x480 monitors? What if he had Windows 98 with IE5? What would you do then? At some point, you have to explain to customers the way that content will be seen on screen depends on browser capabilities, and that old browsers don't support CSS, or don't have good support for CSS. Show him some browser usage statistics and tell him that developing with these old browsers in mind is going to cost him extra. This reminds me of a customer that told me that his dad had a Mac with OS9 and he couldn't see the site I made him using IE5.5. I just told him I wouldn't do anything about it. I told him to get his dad a new computer.
-
Information website about drug addicts and drug use
sKunKbad replied to selbekk's topic in Website Critique
I don't think the design is bad. I think you just need to pay somebody to make you a really nice logo, and then reduce the size of the text -> (Politiet aksjonerer på Oslo S!). I think it is funny where you say, "... and other people of that nature". Language of that nature would be offensive to somebody that is easily offended. What other kinds of people are there that are of that nature? I think my X girlfriend is of that nature. What a loser she is. -
Forms and PHP: Getting Option Value into PHP
sKunKbad replied to FangerZero's topic in PHP Coding Help
On View.php <?php echo $_POST['Animal']; ?> -
I never liked the way MySQL stored dates. I just use php's time() when inserting into the database. It makes doing time comparisons a lot easier for me. Your field in the database becomes int(10)
-
My connection is 10MB down, and I don't really see a difference. Maybe dial-up users would be pleased?
-
I know it doesn't make a difference. But a function inside a class is technically a method, so it's just something that I think about.
-
I wonder if php will ever have: public method name(){ instead of: public function name(){
-
Please don't use Flash. I get a good portion of my customers because somebody made them a Flash site that isn't working well for them. Because you will need to have alternate content for your Flash site, you end up making the site twice if you do it the right way. Save yourself the pain.
-
Calculating a shipping package size based on cart contents
sKunKbad replied to sKunKbad's topic in Application Design
You are definitely right about the web being a competitive marketplace. Did you ever successfully develop ideas based on the shared logic? -
Calculating a shipping package size based on cart contents
sKunKbad replied to sKunKbad's topic in Application Design
This sounds complex! Right now, the request from UPS alone seems to take a long time. I can imagine that what you are doing makes it a much longer wait for the user. I just decided to skip it. It should be acceptable for packages to be in a range of prices, and because handling charges need to be applied, the rate given to the user is not exactly what UPS charges (the way I made it). I think it is something that will need to be fine tuned. You win some you lose some... -
I don't think it matters where your webserver is located. If somebody searches for "right move" or "rightmove", and the other site spends millions of dollars on SEO, and you don't get listed on the first page of results, I really doubt you are going to be able to do anything about this. Perhaps change your domain name. It is good to have keywords in the domain name.
-
Kind of hard to tell without seeing some code. Assuming the code is good, you might want to double check that your username and password are correct.
-
I figured it out: $retail_cost = ( ( ceil ( $cost / .5 ) ) * .5 ) - .01;
-
I'd like to round up to a 49 or 99 cent value. 1.84 would become 1.99 2.1 would become 2.49 3.0 would become 3.49 etc I've seen round(), but not going to work. Any ideas for me?
-
I read and re-read at least 3 php books before having any confidence that I knew php, and that was just the beginning. The best thing would be to go to the bookstore or library and get some books. Most books from O'rielly books or Wrox books are pretty good.