Jump to content

KevinM1

Moderators
  • Posts

    5,222
  • Joined

  • Last visited

  • Days Won

    26

Everything posted by KevinM1

  1. That's telling you, and confirms Dan's suspicions, that your $array only has two elements - $array[0] and $array[1]. So, again, where does $array come from? What would lead you to believe it would have additional elements?
  2. That's not completely horrible, really. Want to have nightmares? Listen to this: When I was first starting out (sometime around 04-05), my first gig was to 'fix' a local nonprofit's site. It was originally built by an older gentleman who used Microsoft Frontpage in point-and-click mode. Pure HTML, no CSS, and, under the hood, it was a mess of nested tables. Even better, the guy wasn't smart enough to save one of these monstrous pages as a general template for the rest, so every page had common elements of a different size. So, the menu on one page wouldn't have the same width as on another. The same goes for the header, footer (when it was there...), etc. It was obvious that he tried (and failed) to simply eyeball it all. On top of all that, the site's colors were pale yellow, storm gray, and a bit of lavender thrown in from time to time. I simply rebuilt it from the ground up, as it wasn't worth the effort to try to salvage it. File sizes were, on average, about a third of what they were originally.
  3. Well, where does $array come from?
  4. Undefined offset means you don't have a value in array[n], where n is the offset.
  5. I wasn't trying to be harsh in my original reply. Rather, I wanted you to tell us what you'd like to change based on what you learned earlier. Rank amateur or not, you were at least able to put together a site that had clear composition, which is a far cry better than some of the offerings we get. To me, the most glaring problem with this site is a complete lack of structure. There's no visual flow, sense of hierarchy, or even general context. It's mashed potatoes. Given the circumstances, it's understandable. Unfortunately, it works against the girl. The second thing that jumps out is a lack of visual excitement. Minimal color, and a bunch of text. A few simple graphics would go a long way to making it look more inviting/interesting. The structure will be the most important part, as the PayPal buttons need to be visible without being invasive. I recommend doing a few quick sketches in whatever image editor you have (paint can work for something like this) before diving into code. And feel free to show them to us.
  6. Well, since this is your second rodeo, let's start with what you think, since you're ultimately the one that's going to redesign the site. What are your ideas for color? Layout? Do you have any sketches/initial attempts we can look at? That said, there needs to be something explaining who Arielle Metzger is, what the site's goal is, why we should care, etc. A site that says, "Yeah, this is my site, I'm re-doing it, send money" isn't going to work, regardless of the circumstances. Explain the story and put some context behind the words and PayPal buttons.
  7. How can we help unless we see the code? You do realize that raw PHP is not visible when one selects "View Source" in their browser, right? Moreover, the link you provided brings us to a countdown to the unveiling of your new site design, and not a product page. We don't know how your code is organized. We don't know what queries you're running. We don't know what JavaScript or CSS you're using for the mouse hover states as you linked the wrong page. What do you expect from this community, telepathy?
  8. It's the ternary operator, which is a shorthand version of if/else. This: $var = (expression1) ? expression2 : expression3 is the same as this: if (expression1) { $var = expression2; } else { $var = expression3; } http://php.net/manual/en/language.operators.comparison.php
  9. Here's what I'd do, based on what you have: $letter = $_GET['letter']; // <-- It's NOT a good idea to simply trust whatever is present in $_GET or $_POST, but that's a discussion on another topic $query = "SELECT * FROM tbl_tribue WHERE letter = $letter ORDER BY letter ASC"; $result = mysql_query($query); if (mysql_num_rows($result)) { while($row = mysql_fetch_assoc($result)) { $hasImage = empty($row['imgpath']) ? "" : "<img src=\"{$row['imgpath']}\" class=\"photoWithBorder2\" style=\"float:left; margin-right:10px; margin-bottom:10px;\" />\n"; echo "<div>\n$hasImage<p><strong>{$row['petname']}</strong><br />\n{$row['description']}<br />\n<em>- {$row['familyname']}</em></p>\n</div>"; } } else { echo "<p>No pet tributes for the letter.</p>"; }
  10. I set it to this: ini_set("display_errors",-1); And it's still blank. Hmmmm...maybe I have a loop or something that's not working or closed off? D'oh, my mistake. Put the following at the top of your script: error_reporting(-1); ini_set("display_errors", 1);
  11. Matt, you're over thinking it. You want to check that if the user is not using Ubuntu AND is not using XP AND is not using Vista AND.... Why? Because if the user is using one of the legit options, the result of the conditional will be false, thereby making the script execute the else-clause. See: http://en.wikipedia.org/wiki/Truth_table#Logical_conjunction, specifically the second row of the first table. Conversely, the test will always return true if you use OR. Despite using some combination of legit OS and browser, there will always be options that the user is not using. See: http://en.wikipedia.org/wiki/Truth_table#Logical_disjunction, again, the second row of the first table.
  12. Set display_errors to -1.
  13. Not reliable, as not all user agents set it.
  14. There's also LESS: http://lesscss.org/
  15. Better to just check it like: if (!$num_rows) // if no rows are returned { // error } else { // code } It's a bit more clear, as mysql_num_rows returns false if unsuccessful.
  16. Your if is trying to assign $img, not check if it's empty. = means assignment, == means logical equals. That said, if you're checking for an empty string, use empty.
  17. The whole point of using PHP and a database is to make dynamic sites. As in, one (or several) HTML templates that can show any number of individual rows of database..err..data. To flesh out what tonyhh said above, your links should look something like: www.mysite.com?id=2234214 You can then use that id (which would be available in $_GET) as a parameter in a SELECT query. From there, you can plug in the data that's returned into a template.
  18. And all of your docs are TLDR's
  19. The doc in question was a grand total of 4 distinct pages. Somewhat lengthy (coding conventions can be long and dry), but hardly an insurmountable task for someone with 5-10 minutes on their hands.
  20. Exactly. PHP itself is a template engine. And if your views require more than basic if/else statements or loops, you're doing it wrong.
  21. So I don't have to read a 1,000 page manual, care to be a little more specific?! ...really?
  22. If your PHP is getting cluttered, chances are you're doing it wrong. Just because you can switch between PHP and HTML on the fly, it doesn't mean that you should. Moreover, there's no reason why you can't make a 'snappy' website in PHP. There are many sites that use PHP with Ajax to great effect. Really, it sounds like your blaming your lack of proficiency as a developer on the language you're using rather than increasing your own skill. Learn: OOP - not just the syntax, but the methodology, including but not limited to encapsulation, polymorphism, coding to an interface, SOLID (it's an acronym) principles. Design patterns - MVC is the de facto pattern for web apps, but it's implemented with other patterns. Best practices - separation of concerns, DRY (another acronym), dependency injection.
  23. Does Apache have its document root set properly?
  24. What does "It doesn't work" mean? Error message? No content being shown without an error message? Have you checked "component's" permissions?
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.