Jump to content

falkencreative

Advanced Member
  • Posts

    4,419
  • Joined

  • Last visited

  • Days Won

    27

Everything posted by falkencreative

  1. Can you post the code you are working with -- the index.php file that has the error specifically?
  2. When I test using: <?php //Start session session_start(); include('config.php'); include('connect-To-db.php'); $error ['alert'] = ''; $error ['first'] = ''; $error ['last'] = ''; $error ['user'] = ''; $error ['pass'] = ''; $error ['pass2'] = ''; $error ['em'] = ''; $input ['first'] = ''; $input ['last'] = ''; $input ['user'] = ''; $input ['pass'] = ''; $input ['pass2'] = ''; $input ['em'] = ''; include('view.php'); ?> I don't get any errors. If you want, however, send your files and a dump of your database to ben [at] falkencreative.com, and I'll see if there is something else going on?
  3. Have you checked the documentation files that came with the template? Usually that will provide installation instructions. In most cases, installation takes a bit more than simply uploading the theme files and uploading the theme. Like others said, some themes (depends on the theme author) come with sample content that you can import in. I'd suggest checking the documentation for instructions in case that is included. I imagine you'll have to follow other steps to get things set up like the demo site, probably including changing the home page to be an actual page rather than just a list of recent blog entries (there's likely a "Home" template for that specific page), updating widgets, etc. Every theme is a little different. But the documentation that's included with the theme is the first place to start.
  4. I believe the issue here is the order of your code. within login.php, see how the include() line is before the definition of the $input and $error variables? This means that the view is being loaded too early, and those variables don't exist yet. I believe if you move your include line later within the login.php file, after you define your $errors and $inputs. Hope that helps?
  5. Can you post the file you are having trouble with, v_login.php I believe, and I can compare that against my code?
  6. Instead of echoing "success", have you tried debugging and printing out the value of $human instead? You might also want to check what type of variable $human is. Since you're using "!==", it's strictly comparing two things, so even if both values are "2", if one is a string and one is an int, you'll get a false return if you are checking to see if they are the same.
  7. Personally, I'd suggest looking at Wordpress' Galleries functionality: https://codex.wordpress.org/The_WordPress_Gallery It's super easy to set up, and you can arrange things in whatever way you like, since you can have multiple galleries and the interface for uploading images and working with them is well done.
  8. Are you following the OOP or non OOP version?
  9. Figured out the problem. Sorry I didn't see this earlier, but that's why I prefer to work with actual code rather than posted code -- it's much easier to debug and figure out what's going on. #1: You never actually passed $array into the renderForm() function. You were passing an empty string in, causing issues. So at the end of the file, you'd want to change: renderForm('','','', '','', ''); to renderForm('','','', '',$array, ''); #2: You can't simply reference the variables, you need to echo them out, so replace: <option value="<?php $array[$k]?>"><?php $array[$k]?></option> with <option value="<?php echo $array[$k]?>"><?php echo $array[$k]?></option> #3: You need brackets around your for loop. So instead of <?php $count=count ($array); for ($k=0;$k<$count;$k++) { ?> <option value="<?php echo $array[$k]?>"><?php echo $array[$k]?></option> <?php } ?> you need to use <?php $count=count ($array); for ($k=0;$k<$count;$k++) { ?> <option value="<?php echo $array[$k]?>"><?php echo $array[$k]?></option> <?php } ?> Basically, the way the PHP ends and changes to HTML causes some confusion within PHP -- it doesn't realize it's supposed to loop the next line. The loop runs without doing anything, and $k ends up being $count, and thus when the <option> line runs, it tries to process $array[$k], an array item that doesn't exist, causing the error. Hope that all makes sense?
  10. Why don't you do this... Can you send me a backup of your database (I imagine you should be able to use PHPMyAdmin's Export functionality?) and the file you are working with, I'll be able to experiment a little and figure things out. At the moment, I feel like I'm just doing guesses and it'll be much quicker if I can play with the code directly. ben [at] falkencreative.com
  11. Still getting errors? Or no errors any more, but the dropown list doesn't have any items in it?
  12. For this line: for ($k=0;$k<=$count;$k++)?> You need to use: for ($k=0;$k<$count;$k++)?> (Note the "<" not "<=". This is because count() returns a whole number, but arrays start at key 0. So if count() returns 3, you only have three array items, and you'd need to loop array items 0-2. No, you don't need to have another mysql_query. I was just confused by your $row / $array typo.
  13. First thing I notice: Where is $row['$k'] being set within the renderForm() function? I see where it's intended to be set, but it looks like it has been commented out? Is that supposed to be $row? Secondly, why is there any need to pass around the number of elements in the array? This likely doesn't have anything to do with your error, but it's just adding unnecessary complexity to your code. For example, you could simplify the retreival of the data: <?php $result = mysql_query("SELECT * FROM users",$link); while($row = mysql_fetch_array($result)) $array[]=$row['surname']; } //for ($k=0;$k<count($array);$k++) echo $array[$k]; // I can see the content of $array. It's right. ?> Then, you can do the same thing with the renderForm() function, using count(), and there's no need to pass around $i.
  14. That's not the way $global works though. See http://php.net/manual/en/language.variables.scope.php I believe if you include the line global $link; within your renderForm function, right before you use it, it should work fine.
  15. Where were you trying to declare $link as a global variable? Directly before you used it, within the renderForm() function? Realistically though... at least, according to the way I had organized my code... that renderForm should do just that -- render the form. Personally, I would access the database and retrieve the data you need outside of the form, store that data in an array, and pass it to the renderForm() function. This way, the code is a little cleaner, in the sense that you are separating the logic of the page from the HTML/CSS that gets displayed.
  16. When you run this code, what are you getting? Error messages? Blank screen? Something else? Have you checked the documentation for examples? http://php.net/manual/en/mysqli-stmt.execute.php
  17. I'd suggest making a new topic for this, and including your code.
  18. It sounds like you have the right general approach. I would do it by accessing the database outside the renderform() function, and creating an array of the data for the dropdown. I would then pass that array into the renderform function, adding the array as an extra parameter: function renderForm($first, $last, $new_data, $error) And then within the function, use that data to generate the dropdown. That's just the form portion, obviously -- you'd need to update the part of the code that handles form submission, and make sure you are saving the selected item from the dropdown correctly.
  19. Hello. There isn't an update currently, but it's on my list.
  20. I do notice that in this line: $stmt->bind_param("ssss", $input['user'], $input['firstname'], $input['email'], $input['type'], md5($input['pass'] . $config['salt'])); You should have 5 "s"'s as the first parameter, since each "s" (representing the type, in this case a string) must match up with the rest of the parameters used in the function. Since you have five inputs, you need to have the same number of "s"'s. Are you running into any errors?
  21. What about it isn't working? How are you expecting it to work, and how is it currently working?
  22. A couple comments: DESIGN: -- I agree that there's too much white space, thus leading to unnecessary scrolling. Specifically, I'm looking at the unnecessary white space that separates the navigation from the portfolio section of the page (with all the down arrows), and the spacing between portfolio items. -- When viewed at smaller sizes, I would decrease the vertical space between individual portfolio items. It feels a bit strange at the moment. -- When viewed full size on a desktop, the positioning of your name and navigation seems awkward. There's just too much empty space to the right. Instead, I would consider centering it. -- I'd suggest making the navigation and your name different colors, to help the navigation stand out a little more. -- If you are going to have just images of your work, and not link out to it, I'd highly suggest having some sort of slideshow or multiple thumbnails that when clicked, show a larger version. The single image doesn't do much to demonstrate skill, but showing multiple images would give a better impression. For example, take a look at http://wes.ly/ (a site I developed, though it isn't my portfolio). Basically, the more work you have, the better. A website is usually more than just one image. -- The drop shadow on your name seems a little out of place with the rest of the site, since there are no other drop shadows used, and no other elements that add a sense of depth to the design. -- Any reason why you are using a serif based typeface? Serif typefaces tend to make something feel a little old and dated when used online, and I'm not sure that's the impression you want to give off in your portfolio. CODE: -- You may as well use HTML5 doctype, rather than XHTML -- Why are you using jQuery Migrate if you are using jQuery 1.4.3? It's really only intended for use if you are using old jQuery code that won't work in jQuery 1.9+? -- You have a couple javascript errors that you should look at (jquery.js not found, and thus a "jQuery is not defined" error). -- Why are you trying to include jQuery multiple times? -- Why are you including jQuery code to scroll based on #top being clicked twice? The second instance may not work, since it isn't included within a $(document).ready() block. -- I don't believe you need a clearing div in between each of your portfolio elements. Can't you add "clear:both" to your portfolio images, and add the spacing with either top margin on the images, or bottom margin on your text divs? The cleaner/less code you use, the better.
  23. When you get an "undefined constant", it tends to mean that you forgot to include a "$" that indicates a bit of text is a variable. In this case, I believe that "name" in line 32 should be "$new_name" -- I believe that should fix the error.
  24. $10 seems relatively fair, depending on the photo and how much work is involved. I'd bet that each photo is at least 10-15 minutes to clean up -- adjusting the lighting and settings and potentially cropping out the entire object. As someone who does photo cleanup on a semi-regular basis, it's a lot more than a couple seconds per photo. Depends on the photo really. But yes, there are a lot of tutorials on this subject online, so if you have a copy of Photoshop and the time, it's a skill worth knowing.
  25. See here: http://www.killersites.com/community/index.php?/topic/5878-cms-tutorial-having-issues/page__p__26818__hl__cms__fromsearch__1#entry26818
×
×
  • Create New...