Jump to content

falkencreative

Advanced Member
  • Posts

    4,419
  • Joined

  • Last visited

  • Days Won

    27

Everything posted by falkencreative

  1. I think that is related to a missing <title></title> element in the head section.
  2. Layers is something that Adobe made up in an attempt to make web design more like print design. Layers are just absolutely positioned elements -- they have a tendency to cause problems if you don't know what you are doing, and it's something that I wouldn't suggest people use.
  3. Or... you could search for one? There are a lot of freely available options if you search for "php mail script".
  4. If it's a helpful link to an outside resource, I doubt it will be zapped. The links that tend to get zapped are the ones that seem to be spam or obvious self promotion.
  5. Huh, I must have missed it when this was originally posted. Yes, the correct solution is to return an array, with each of those items in an array. You might consider using an associative array to make your code a little more readable when you use the returned array. That way, you can access the array using $mydata['name'] rather than $mydata[1] And constantly having to remember what each spot in the array is for. In that case, you'd use: function get_person() { $r['firstname'] = $this->get_firstname(); $r['lastname'] = $this->get_lastname(); $r['age'] = $this->get_age(); $r['weight'] = $this->get_weight(); $r['height'] = $this->get_height(); return $r; } Keep in mind, there's little point in using the getters from within the object, so you may as well just use "$this->firstname" rather than "$this->get_firstname()" and make it slightly easier on PHP. The getters are there to access your object's properties from "outside" the object, so you can control how they are accessed or used.
  6. I've found Hunie to be a great resource for giving and getting design related critiques: http://hunie.co/

  7. I use a large monitor aout that size too, but you should be able to resize the browser window to emulate smaller displays?
  8. The main issue regarding the logo is that the image is inserted into the page as a background image, meaning it is behind the text. Probably your best option is to: -- Give #logoTxt a width of 960px, to match the rest of your site, and use "margin: 0 auto;" to center it in the window. Also, give it "position: relative;" so you can use absolute positioning on your logo -- make the font size on the h1 and h3 within your header area smaller, so your logo will fit -- Adjust your logo image so that the size of the image is cropped closely around the logo. Currently, it looks like you have a lot of transparent space above the logo: http://www.integratedbuildinginspections.com/images/logo.png -- Rather than using a background image for the logo, insert it within the #logoTxt area as a standard <img> element, and use CSS to position it absolutely ("postion: absolute;") and adjust the top and left position to fit. Hope that helps?
  9. I don't really see the need to go to physical classes to learn web design topics. The web is constantly changing, and it's more likely that you'll be able to stay up to date and stay on top of trends by learning online. In many cases, the curriculums at college/university are delayed by one or two years from the current state of the web, so you may graduate with a out of date understanding of recent changes and best practices. I'll just depend on your specific school and the teachers you have. There are too many good options out there for learning -- from KillerSites and elsewhere, like CodeSchool, Treehouse, CodeAcademy, etc. That said, it depends on the person. I like video tutorials... but not everyone does. Some people may learn better in a classroom environment.
  10. I think by "bar", he's meaning "except". It made me a little confused too at first.
  11. Are you perhaps referring to the one year's subscription to the KS Video Library? http://killersites.com/video-library/ This is the actual Complete PHP Package link: http://www.killervideostore.com/video-courses/complete-web-programmer.php
  12. Sorry, I didn't see this earlier. I know the empty_cart() function should be public function empty_cart() { unset($_SESSION['cart']); } Fix that, then let me know if you still have issues?
  13. It looks like it's a customized version of the Avalon Template: https://www.joomlashack.com/joomla-templates/item/609-avalon-joomla-template Can you download the template? Kindof. There are tools out there that let you download a website, such as http://www.httrack.com/, but they do it based on grabbing the HTML/CSS/images, and it won't include any server side files (.php, etc). You're not going to be able to download the Joomla template and have it work properly without any work in Joomla. The only way to do that is to buy the original template. Obviously, though, you can't simply copy another person's site and claim it as your own, even after edits. Their work is protected by copyright. It is OK to use it as a plate for experimentation, but it shouldn't be posted online. If you're looking for something to learn on, you'd be much better off finding a free Joomla template so you can see how Joomla and the Joomla templating process works.
  14. Sure. But when you are talking about 15 minutes of work adjusting some CSS properties, especially when there are options like Firebug or the Chrome Web Inspector to make these sort of changes easy, then you may as well do it.
  15. Personally, you need to recode your header area's CSS. It's a bit of a mess -- lots of set heights and widths, lots of floats, lots of negative margins (which are usually a sign that something strange is being done). Fixing things with more position:relative and negative margins isn't a good way to do it -- you'll just end up being more confused if you ever need to make any additional changes in the future. In your case, #branding is floated left, but has a set width (100%) and height. This means that any elements that are floated have to be positioned below the #branding area. You're trying to use negative margins to adjust for that fact, but it's a bit of a mess and I think it's more confusing than necessary, causing weird gaps. Personally, I think you can make things a lot simpler if you set a height on <header>, and remove any height or negative margins from #branding or any other element within <header>. Then, set the widths on both #branding and #social so they can both fit on the same line, with #branding floated left and #social floated right. Then adjust positioning as necessary. Also, if you are wanting to position the site tagline over the logo, I'd highly suggest doing that using absolute positioning rather than your current negative margins.
  16. Here's a fixed version: <?php $original = array( array('animal' => 'cats', 'quantity' => '1'), array('animal' => 'dogs', 'quantity' => '1'), array('animal' => 'cats', 'quantity' => '3') ); $new = array(); foreach($original as $entity) { if(!isset($new[$entity["animal"]])) { $new[$entity["animal"]] = array("animal" => $entity["animal"], "quantity" => 0); } $new[$entity["animal"]]['quantity'] += $entity["quantity"]; } echo "<pre>"; print_r($new); echo "</pre>"; Basically, the key thing was this line: $new[$entity["animal"]]['quantity'] += $entity["quantity"]; In your original sample, you missed the "['quantity]" portion, meaning you were trying to access the entire array, not specifically the quantity key within that array. This meant you were trying to add a number to an array, and since those are incompatible types, you got an error. However... this code doesn't do exactly what you want, since this is the result: Array ( [cats] => Array ( [animal] => cats [quantity] => 4 ) [dogs] => Array ( [animal] => dogs [quantity] => 1 ) ) Note how you have "[cats]" and "[dogs]" instead of [0] and [1]? You'll need to work on fixing that, but it's a first step in the right direction.
  17. If you have 85 columns in a database, I'd think your database is designed wrong, and you need to be splitting that up into multiple tables. Also, from a database load perspective, it's easier on the database if you are selecting specific columns rather than selecting them all with "*". That aside, it is possible to use get_result() instead. See http://php.net/manual/zh/mysqli-stmt.bind-result.php (see comment #2) http://php.net/manual/en/mysqli-stmt.get-result.php For counting rows, just use a variable, and add to it every time you have a while loop. As a very rough example: $i = 1; while ($stmt->fetch()) { // work with the database here... echo "Row: " . $i; $i++; }
  18. Yep, that would do it. It's an easy mistake to make.
  19. Here's a better example demonstrating using a prepared statement with MySQLi. See http://devzone.zend.com/239/ext-mysqli-part-i_overview-and-prepared-statements/ for a more detailed explanation. <?php /* connect to db */ $mysqli = new mysqli("localhost", "user", "password", "world"); if (mysqli_connect_errno()) { printf("Connect failed: %s\n", mysqli_connect_error()); exit(); } /* prepare statement */ if ($stmt = $mysqli->prepare("SELECT Code, Name FROM Country WHERE Code LIKE ? LIMIT 5")) { /* bind variables */ $stmt->bind_param("s", $code); $code = "C%"; /* execute statement */ $stmt->execute(); /* bind variable results */ $stmt->bind_result($col1, $col2); /* fetch values */ while ($stmt->fetch()) { echo $col1 . ' ' . $col2 . '\n'; } /* close statement */ $stmt->close(); } /* close connection */ $mysqli->close(); ?>
  20. Sorry, guess I misunderstood. To be honest, the more I think about this, the more I'd suggest avoiding the problem entirely -- why do you need quotes in a URL anyway? I'd really just suggest sticking primarily to alphanumeric characters only in URLs -- standard letters and numbers and dashes. You could use this to strip quotes from a variable: $name = "test'ing"; $name = str_replace(array('"', "'"), '', $name); Alternately, if you really need that apostrophe, you can encode it into the URL using "%27" (http://www.w3schools.com/TAGS/ref_urlencode.asp) $name = "test'ing"; $name = str_replace("'", '%27', $name);
  21. How are you trying to use it? Are you getting any specific error messages? I don't really get any specific issues with your sample code. For example, this works the way I'd expect: <?php $name = 'test'; $list = "<a href='editStuff.php?name=$name'>Click Here</a>"; echo $list;
  22. Sorry, is this a question? Comment?
  23. Just to be clear, what error are you currently getting with your version? For a reference, you might check out http://www.killersites.com/community/index.php?/topic/3064-basic-php-system-view-edit-add-delete-records-with-mysqli/ which has examples of a variety of MySQLi queries.
  24. The problem isn't that it isn't working. The problem is that you have a logic error in your code -- specifically, if $name isn't empty (if it contains something the user entered, or "Company Name"), the if statement will always set $condition2 to true, and PHP will never continue down to check out the last elseif. PHP will only check the elseif's if the previous if or elseif is false. Hopefully that helps get you started?
×
×
  • Create New...