Jump to content

falkencreative

Advanced Member
  • Posts

    4,419
  • Joined

  • Last visited

  • Days Won

    27

Posts posted by falkencreative

  1. Bel, sorry you're having trouble with the CRUD videos. From my perspective, as the author, I assumed as I was recording those videos that you would have a pretty solid understanding of PHP -- standard operators, working with functions, that sort of thing. My course wasn't really recorded with the others in mind -- it wasn't necessarily recorded with an idea that it would be part of a specific sequence. Based on what I know of the first three, I would think that those would give you the foundation for understanding my course... but if you have any specific questions, you're welcome to post them and I'll do my best to help.

  2. Your errors indicate you are trying to link to a file that doesn't exist -- either your path is wrong, or the file isn't uploaded to the correct spot. Keep in mind that the path to the include is relative to the document that includes the include() line. Are you sure those include lines should include "MaxAmpsDigital/public_html"? Shouldn't the file that includes these files be within the public_html folder already? I would test the code without that portion:

     

    <?php
    session_cache_limiter('none');
    session_start();
    ini_set('url_rewriter.tags', '');
    include_once "vsadmin/db_conn_open.php";
    include_once "vsadmin/inc/languagefile.php";
    include_once "vsadmin/includes.php";
    include_once "70and100mphclub.php";
    include_once "vsadmin/inc/metainfo.php";?>

  3. So in the classes above, __construct() in both Person and Employee allows you to set the name of the person or employee when you create the object. The __construct() is automatically called when the object is created.

     

    The __construct() doesn't have anything to do with allowing or not allowing access to set_name() or get_name(). It simply allows you to set a name when the object is created.

  4. I did a short introductory series on Bootstrap. Overall, I've found the concept of a framework interesting... but in general I've found it more limiting than I'd like. The more responsive coding I do, the more likely I'd be to start using a framework though.

  5. __contstruct() just allows you a way to perform various actions when the object is first created. Exactly what it does depends on what you need... but it could set various variables, connect to the database and retrieve data, etc.

     

    For example, take those two pieces of code:

     

    class employee extends person {
                   function __construct($employee_name) {
                           $this->set_name($employee_name);
                   }
           }

     

    class employee extends person {
                   function __construct() {
                   }
           }

    The first would allow you to set the name of the employee when the object is first created:

     

    $person = new Employee('Their Name');

    The second doesn't have that ability, so you'd need to have a set_name() method and call that separately.

     

    $person = new Employee();
    $person->set_name('Their Name')

    Hopefully that makes sense? A more "real world" example might be something like this... say you ran a business, and were creating some software that stored information about your employees. For example, you could create an Employee object and pass in the employee ID when that object is first created:

     

    $employee = new Employee(1234);

    if you have a _construct set up, immediately when that object is created, you could run code to access the database and automatically populate information about that person (name, birthday, weekly schedule, etc.). You could do that same thing without __construct... but the code would be cleaner and simpler with __construct. The more simple and concise your code is, the easier it is to maintain and understand.

  6. I imagine you'd need to do this with AJAX -- redirect to a loading page on login, load the data using AJAX (saving the data into a session variable? It depends how much data you need to save?), and only redirect using Javascript once the AJAX request returns the data. You can use header() to redirect to the loading page, but you'd need to redirect using a Javascript method for the second redirect, since header() won't work if something has already been shown in the browser already.

  7. Are you doing this with AJAX or something? Why the long load time? If you're using header() to redirect, that redirect should be instantaneous (thought the page the user gets redirected to may show a blank white page as it loads).

     

    ...I think the bigger question here is why your page is taking 20+ seconds to load though. Loading page or not, you actually expect people to wait around for that? I wouldn't.

  8. I'm not quite sure what you are doing here:

     

    $cart[$id] = $num && $pronum;

     

    That's not really valid code, as far as I can tell.

     

    You could do something like this instead?

     

    $cart[$id]['num'] = $num;

    $cart[$id]['pronum'] = $pronum;

     

    Basically, that's the way I'd approach it. Currently, the way the system stores item in the cart is within a $cart array, that is then saved to a session variable. The array key represents the id of the product, and the value represents the number of that item in the cart:

     

    $cart[key] = value;

     

    I'd modify it so that $cart[key] holds an associative array instead, so you can store separate values for the number of that item in the cart, and also the procarb number. This would allow you to have separate procarb numbers per product, rather than one global one that works for all products. This means you'd need to update any place in the cart model that uses $cart[$id] to use $cart[$id]['num'], and then use $cart[$id]['pronum'] anytime you want to store the procarb number related to that product.

     

    As for your error messages, they are exactly what they describe: in line 253 in m_cart.php, you are trying to access a variable that doesn't exist. My guess is that you likely are trying to use $procarb, when you should be accessing $pronum instead.

  9. I think it partially depends on where in the process you need the visitor to enter their procarb #. Do they have one number that's used on all products? Can that number change per product? Is that number entered when they first enter the store? When they first view a product? When they first add a product to the cart?

     

    If I understand things correctly... this is how I would do it. I'd have a form field in your "add to cart" form that asks the customer for their # when they place a product in the cart. That field would be required, so they can't add an item to the cart without the number. When the form submits, you'd save the number in a session variable, and access that session variable when calculating the price of items in the cart. Perhaps if you wanted to be fancy, you could use some Javascript/jQuery and AJAX to retrieve

     

    Once that number is saved in the session variable, you'd automatically want fill out the number field on any other product pages, so they don't have to continually re-enter the number. If they decide to change the number and it no longer matches what has been stored in the session variable, you'd want to update the session variable with the new number.

     

    I imagine you'd likely want to do most of the code changing within the m_cart.php model. You'll want to add methods to set, update and retrieve the procarb session variable, update the get_total_cost() method, and of course adjust the views and controllers to allow a visitor to enter their procarb number and save it.

  10. The error is exactly what PHP describes: "Number of elements in type definition string doesn't match number of bind variables in /xxxxx/records.php on line 205"

     

    I believe (I haven't checked the line numbers, that this line is the issue:

     

    $stmt->bind_param("ssi", $naam, $mp3naam, $links, $linka, $linkt, $linkb, $yt1, $yt2, $bladm, $opm, $id);

    Note the first parameter, "ssi"? The number of characters needs to match up with the number of perimeters after it. "s" is a string, "i" is an int, etc. So I believe it should be:

     

    $stmt->bind_param("ssssssssssi", $naam, $mp3naam, $links, $linka, $linkt, $linkb, $yt1, $yt2, $bladm, $opm, $id);

    Make sure to fix any other bind_param() lines to match up the number/type of parameters as well.

  11. Sorry, I might be a little out of touch with KS related things -- it appears that Stefan has closed KSU in favor of StudioWeb, which has the same course content but a slightly different focus. I'd suggest either buying the course(s) you're interested in from the store (http://killervideostore.com -- it's the same exact content, just without the questions following each video) or emailing Stefan directly (stefan @ killersites.com) and seeing if there's anything he can do.

  12. I can answer your questions, at least to some extent...

     

    -- At least for my courses (four of them in the KSU, primarily PHP related), I don't use Dreamweaver. I believe a lot of the courses that Stefan teaches do use Dreamweaver, but in general, unless the course is specifically on Dreamweaver, the course author won't be doing anything that absolutely requires Dreamweaver. In most cases, you'll be seeing hand coding through Dreamweaver's code editor. I definitely agree though -- it's important to be able to understand HTML and CSS without using a WYSIWYG tool like Dreamweaver.

     

    -- Overall, the courses are generally focused on coding. There is some courses that KS offers on Photoshop (http://www.killervideostore.com/videos-photoshop.php), but those aren't really appropriate for the KSU.

     

    Hope that helps? One thing to keep in mind -- some of the courses that are in the KSU are also available on http://www.killervideostore.com/. Even if you'd prefer to purchase the more interactive format on the KSU, there are some preview videos available there, so you can take a look and get a feel for some of the courses before you make any commitments.

     

    Hope that helps?

  13. Site 1 is running a custom designed/built Wordpress template. Site 2 isn't Wordpress -- it's a site provided by 22Slides.com. You have two options moving forward:

     

    1. Find a template

    Which is surprisingly harder than I would have expected. Your best bet is to probably search for "wordpress photo template" and see what you get. Here are a couple to get you started.

     

    http://vandelaydesign.com/blog/wordpress/photo-themes/

    http://mashable.com/2013/05/07/wordpress-themes-photography/

    http://themeforest.net/category/wordpress/creative/photography

     

    2. Custom design/development

    This one is tricker, and will definitely require solid knowledge of HTML, CSS and at least PHP and Javascript basics. You might check out my course on developing a Wordpress blog -- while it isn't specific to a photo style website, it will provide you with an understanding of a lot of the process and the basics required when working with Wordpress: http://www.killervideostore.com/video-courses/wordpress-themes.php and the demo of what I build: http://www.killervideostore.com/video-courses/live-demos/WORDPRESSFROMSCRATCH/. Treehouse also offers quality content, and their Wordpress section might be worth checking out: http://teamtreehouse.com/library/how-to-build-a-wordpress-theme. You likely won't find a tutorial on building the exact style of site you want to build. But you should be able to find Wordpress tutorials that will teach you about building and customizing Wordpress themes.

  14. Have you closed WAMP and restarted? Have you clicked on the icon in the taskbar and ensured that all the services are running correctly? Have you right clicked on the icon and accessed localhost (as opposed to trying to type it in directly -- it should be just "localhost", no "www" or ".com"). Are you running any other programs that might conflict? (Skype? Windows Server?)

  15. You need to update your SQL query:

     

    $result = mysql_query("SELECT patientname,RN,IC,age,gender,race,discipline,dateofincident,timeofincident,dateofreport,monthofreport,namastaff,brief,action,status,namelocation,category

    FROM registerstaff,location,incident WHERE $searchtype LIKE '%$searchvalue%' and location.id=registerstaff.location_id and incident.id=registerstaff.incident_id";

     

    to include "limit". Take a look at my SQL query from my pagination example code and compare the two.

  16. how do combine function "search" and "view-paginated"??

    You'd need to use a SQL query that included "like", for search functionality (http://dev.mysql.com/doc/refman/5.0/en/string-comparison-functions.html#operator_like), with "limit" for pagination (http://php.about.com/od/mysqlcommands/g/Limit_sql.htm). Basically, you'd use the exact same pagination code you already have, just change the query to search using "like". See my last comment for direction regarding search.

  17. Problem is when i click on edit file in view-page.php it shows all the data as "Array"

     

    Check this section of your code, and compare it with my code -- specifically, the "get data from db" section.

     

    // check that the 'id' matches up with a row in the databse
    if($row)
    {
    
    // get data from db
           $Volunteer=['Volunteer'];

     

    My impression is that these lines: $Volunteer=['Volunteer']; need to be something like this: $Volunteer=$row['Volunteer']; (Check my code -- this is just off the top of my head.) The way you currently have it, you are passing in an array element, not giving those variables values from the database.

     

    As for search, that's a little outside the scope of the tutorial. You might want to check out http://www.webreference.com/programming/php/search/index.html, or do a web search for "php database search" or similar, and you should find some direction.

    • Upvote 1
  18. It is being floated properly, it's just getting "caught" on the middle column (see screenshot).

     

    I'm not sure exactly how you handle that... perhaps adding a min-height to help standardize the heights of the blocks? Or adding multiple media queries, adding "clear:both" to the correct items as the layout changes?

    screenshot.jpg

  19. In a nut shell really all a proxy is (whether its a web site or server) is something that does some action on behalf of another.

     

    Put it simply you ask the proxy to do something (something it was obviously designed to do) and it will do that for you, then send you back that information without leaving any trace that it was you that wanted that.

     

    That's all proxy's are.

     

    Though to answer your question usually yes that kind of thing would work, but in reality it could be (I would have thought of the way you're describing the situation) it'd be more to do with a geographic aspect of your searching, it'd not be because of blocking really I wouldn't have thought.

     

    What proxy's are you using by chance?

    You might want to check the dates on the questions before posting. This one was posted in 2011. ;)

×
×
  • Create New...