Jump to content

krillz

Advanced Member
  • Posts

    150
  • Joined

  • Last visited

Posts posted by krillz

  1. wouldn't using clickbank be the best option for you in this case, have links to the templates and after payment they are unlocked.

    You get the dynamical built download links as well, which will spare you the hassle of coding this yourself which is necessary to prevent the event of one pays and spreads you download location to everyone.

  2. Depends, you will get different answers from different people.

    But as in any product around the world the latest model/version tends to be better than the previous otherwise there would not be any need to release a new candidate if you catch my drift.

     

    But which version works the best for you or anyone else can depend on an array of things like which one you've learnt the best and feel most confortable with to the one that have the best solutions for the type of code you write most frequently and for some reason you do not like the changes in the new version.

     

    I say try and make up your own mind about the matter, as I believe trail versions are available.

  3. To succeed with this you should read and learn the following things:

     

    Processing forms with PHP.

    PHP with MySQL

    MySQL ( namely creating databases and table design)

    PHP with MySQL security

    Writing secure php code, avoiding code injection.

    Creating dynamic sites with PHP, as you would like to create personal pages on the fly generated and filled using PHP+MySQL

    Creating a loginsystem with PHP+MySQL

    Creating a secure user auth sessions

    As a start then there are tons of other topics that could be good to cover to ensure the system you build is safe, secure and well functional.

     

     

    Or you could search for already coded solutions then costumize them to meet your needs, check out phpclasses.org or similar sites to prevent reinventing the wheel 100 times during your process. Or if you want to seriously learn and utlize the knowledge in your future business it could be wise to actually reinvent the wheel in the sense of learning. The tutorials found on this site is a good first step into that direction.

  4. i finally had a play with the code pollux wrote, it giving me the error of

     

    Access denied for user 'ODBC'@'localhost' (using password: NO) in D:\xampp\htdocs\000.SERVICES\001.PHP\projects\001.object_orientated\cart.php\cart_lib.php on line 82

     

    line 82 refers to this:

    $this->_result = mysql_query($sql);

     

    and as far as i know the problem is in this:

     private function __construct() {
    
           $dbc = mysql_connect(parent::DB_HOST , parent::DB_USERNAME , parent::DB_PASSWORD );
           mysql_select_db( parent::DB_NAME, $dbc );
    //...
    

     

    now when i hover over the $server, $user and password; a pop-up (the little hints) come up saying they are equal to null

     

    i tried to search the error in google and it says that the configuration details are not set

     

    but i did change them:

     

    class Config{
     const DB_HOST     = "localhost";
     const DB_USERNAME = "root";
     const DB_PASSWORD = "";
     const DB_NAME     = "agile";
    }
    

     

    though i even tryed to enter the config info directly:

     

    $dbc = mysql_connect("localhost" , "root" , "" );

     

    but still the same error

     

    hope you can help

     

    I assume you are using wamp or some other ready to go server, where the standard mysql user has no pass set.

    Go into phpmyadmin and add a password to the root user, or preferably create a new user that you will use in development with a password and use that instead.

  5. mysqli is the new mysql library for php using an object oriented solution. This was you have your mysqli object with class members you can utilize in any OOP standard fashion. And to be honest if you know the old mysql commands and have done object oriented code this will be just a matter of typing it out slightly differently.

     

    
    // creating a new object of the type mysqli, you automatically get a refference to the connection stored in your refference variable.
    $conn = new mysqli('host', 'user', 'pass', 'database');
    // this way you can do the usual stuff but with a OO syntax.
    
    $result = $conn->query('SLQ QUERY');
    
    if( $result && $result->num_rows > 0 ) {
     // do what you need
    }
    
    $conn->close();
    
    

     

    Of course PHP being friendly to people coming from other languages you will find different functions/ways that seem different but do the same thing when it comes down to it. Also a lot functions are static not requiring an init of the object to use which can get useful at times. And PHP being PHP I would say you can find anything and everything a long with good code examples and remarks by users in the comments.

    Go to www.php.net/mysqli and spend 1-2 hours to get used to it then your set to go.

  6. It's like in Java Integer.parseNext();

    but in PHP we use the arrow so we would do Integer->parseNext();

    So what you do is specify the object type, in this case Integer and call the function in that object by the refference -> to call the object member parseNext().

     

    So to formally wrap it up:

    It's how PHP let's you reference a member of some class. If there was some class reference stored in the variable $foo and there was a member function 'noWay()' you could call it by writing '$foo->noWay()', it's the namespace separator or object access operator. you use it to reference member data of an object.

  7. If you are switching from a function based approach and going to implement a OOP standard of coding, I suggest you ditch the old function based mysql functions and switch over to OO based functions instead, namely using the mysqli library.

  8. There are a few good sayings when it comes to business and friends:

     

    Lending/borrowing money to friends are a recipe for disaster. Money kills friendships ( I bet there are thousands of variations for this one ).

    The hardest thing is to know when to be a boss and when to be a friend, especially if your friend works for you.

     

     

    My advice is to put the personal aspects aside, and treat this as if someone completely new did this to you, handle it the same way.

    Or you could do a last attempt to fix this, but be firm; Tell him that he needs to contact you as this is in his best interest and the possible future actions that may occur due to his poor attempt and neglect to fix or explain the situation, is entirely and completely on his next actions.. This way you leave the ball at his side, of course with a deadline. If nothing happens just start the standard procedures you utilize in these situations.

  9. create what you have to create in phpmyadmin locally on your development server, upload it to the site, export the databases and you are ready to go.

    I would not recommend developing on the clients site where he will host the site, as there is always the possibility of leaving crap behind that could potentially put the whole site at risk of being taken down by a nosy prick.

  10. I only take on multiple clients if the goal is to complete similar or projects that in a way are solved in the same fashion. That way you can find key elements that can be the same or very similar in both projects thus focus on creating/coding them. Then you have plenty of time doing the unique touches that are required.

     

    I would never take one more than one project if it is apparent that the projects are completely different and have to be solved using seperate methods, as you usually have a deadline and don't want to do a half sloppy job just because you took on projects that might not be that time consuming but still it might take a couple of days to complete one and then you might feel you've cheated the client with the last project being on a time crunch.

     

    But I've found out working in a team is always good. That way you can pass something over to the team member. This way if someone hits a gold ore at a time with very profitable projects you provide jobs to a member that might have found themselves in the middle of a dry period.

  11. Yeah that sucked a lot of sites were affected by the worm. But I think they fixed it last time I read a report regarding the matter.

     

    About the site, well it doesn't fit on my 17" screen so most laptop people will have to be scrolling up down left and right which might be annoying. Also the layout makes me think of some early game communities back in the days. Might be the grey metalic frames.

  12. If you uninstalled/reinstalled WAMP, that happens. PHPMyAdmin does allow you to export databases, so if you ever need to do that again keep that in mind.

     

    BTW, make sure when you are writing this login script that you are escaping your user input correctly to prevent MySQL injection. I talk about this in a series I did on creating a PHP login that's available in the KillerSites University (under PHP > Misc PHP Videos). I'd suggest looking at the mysql_real_escape_string() and htmlspecialchars() functions.

     

    With the code you have at the moment, I could input "' OR 1==1 --" in one of the fields and instantly get access, without knowing the username or password.

     

    http://www.tizag.com...l-injection.php

     

    Make sure you cover binary and hexdecimal, computer code injections also as the computer do not require text to be inputed and many times escaping non text, digit characters isn't enough. But it's a good start.

  13. :angry: So, I installed the Wampserver on my computer and have set up numerous databases over the past few days while working on a couple of tutorials. First one connected fine to the database and now I can't seem to get a connection and I'm confused with what I'm doing now. I'm trying to set up a login / registration. my original db was set up and called "recipes" host=localhost, username=test, password=password. So I have deleted all but 1 db now thinking maybe I'm only allowed 1 per wampserver?? Is that true?

    Now I have a db named catfishdb and a table set up called members with 3 fields, id, username, password

    My html form

     

    You may have as many databases as you want. I would start of with making sure that the user you have set up has in fact the correct priveleges to access the database and/or use the commands as SELECT, UPDATE, INSERT and any other needed.

     

     

    Also just create a test.php and see if you can establish the connection.

     

    <?php
    $host = "localhost"; 
    $username = "test";
    $password = "password";
    $db_name = "catfishdb";
    
    $conn = new mysqli($host, $username, $password, $db_name)
    if (! $conn) 
    echo 'Could not establish connection';
    else
    echo 'Connection established';
    
    mysqli_close($conn);
    
    ?>
    
    

  14. It's a multi million business when it comes to SEO you got big firms and people who have been in this from the start that take big money to rank well for popular keywords. So depending on what it is you wan't to achieve it might be a good idea or it might be a bad idea.

     

    Google maps so local inhabitants quickly can see you, and relevant keywords with content backing itt up as a start and then analyze what the result were after some weeks ( might not happen much now as after all it's the summer holidays pretty soon).

  15. Nah wamp in my opinion should only be used as an easy method to develop things.

     

    Say you want a fully functional apache webserver with PHP working on it and mysql server (specify version). And they should be able to set it up to meet the policy needs and regulations. Also ask for a list of things that might be turned off or configurated in a different fashion from what you are used to.

    So that you can quicker and more easily fix the issues that may appear.

     

    And phpmyadmin don't forget to remove it after you've developed so that it isn't accessed by someone evil.

  16. Yea, good luck with that one. After a few years of the FF campaign, IE still has a majority share. It is up to Microsoft to push an IE9 that is up to date and to get people off of IE6, IE7 and IE8.

     

    ... Yes, even IE6 is still being used!

     

    S

     

    Well it's the mentality of if it works it ain't broke.. the bottom line is people are good with only being able to access a page and see it's content and wouldn't bother about downloading and installing new software ( As can be seen with the fact that people are still using IE6) . And unfortunately it happened to be that IE is the browser from the getgo and together with that mentality they are stuck.

     

    And what apple are trying to do with going with html 5 will only split the internet in it initial phase as the majority of sites that will be html 5 with all new goodies I assume will be web platforms aimed at the iTable and other apple product clients, maybe some "geek"/technology sites too.

     

    Let see I bet in 5 years (if nothing amazing happens in the time between) we will be bitching about people still stuck with IE8 talking about some new awesome internet phenomena.

  17. Well to get a boost people would have to start doing the thing that was popular when firefox first came out remember this text; Does this site look like shit in your browser? It's because you are using a shit browser *Link to download FF*

     

    Anyway it would take a couple of big sites to switch over completely and urge people to use browser that have this support for it to catch on, it will be one of those 5 years plus transision phases all over again :(.

  18. I assume the product array only gives you something like [0 0 1] depending on if they were selected or not right? ( Can't remember what the set for them are)

     

    Anyway radio buttons have multiple choices, but one and only one value is transmitted for each group. If no radio button of a group is checked, the action of the client browser is unpredictible. For that reason, you should always specify the checked attribute for one button of a group, assuring that a button will be checked when the form is transmitted.

     

    Also you are using the super global array $_REQUEST = $_POST or $_GET .. now in order to access the info in there you have to actually send info using a form. And I suspect you might have an issue with this.

     

     

    Also this looks strange to me, where do you have the info sent from the form with the checkboxes?

    Especially the foreach loop looks very suspicious.

     

    $fields = array();
    
    $fields{"first_name"} = "First Name";
    
    $fields{"last_name"} = "Last Name";
    
    $fields{"products"} = "Products and Services";
    
    $body = "New product:\n";
    foreach($fields as $a => $b )
    {
    {
    $body .= sprintf("%s: %s\n\n",$b,$_REQUEST[$a]);
    }
    

     

    I mean you are looping the $fields array in that loop and trying to access $_REQUEST[[first_name ... and so on]) when in fact what you got is a miltidimensional array let say $_REQUEST[products[]]

     

    where products[] is an array holding the info of which boxes were checked. You have to relook the logic in your script.

  19. Thanks Krillz

     

    I didnt think you needed a destructor since PHP 5 as the objects are disposed of automatically

     

    Yes they are disposed of, but you have to think of it like this, not always do you have the case that when the script hits the end you are completely fine with losing the info and might want to do something with the object like terminate connections, save data, log or whatever before it completely is dropped from memory.

  20. if you are using a function library made up of static functions, you do not have to instantiate as these are treated as individual modules. Let say like a recipe book where you do not have to buy the entire book but can instead take out chunks of it.

     

    If you're using an object that has a dependency of another object then you can instantiate that in the constructer as shown before, then kill it in the destructor.

  21. I would just install firebug plugin for firefox, hit the html mode then select the DIV and se them light up in the browser. And as I assume you are aiming to learn and understand where they are located nested and so forth. I think that is one of the quickest and cheapest ways of accomplishing a good visual effect that you can study.

×
×
  • Create New...