Jump to content

KevinM1

Moderators
  • Posts

    5,222
  • Joined

  • Last visited

  • Days Won

    26

Posts posted by KevinM1

  1. ::)

     

    The fact remains that we can't adequately help you process an API if we don't know the API.  If you can't divulge that information because of a NDA (whether explicit or not), so be it.

     

    But, really, the API should have documentation that you can follow, or, barring that, a real life person you can ask.

     

    Until you're able to provide relevant information, we cannot help you.  It's not a matter of intent, but rather a lack of sufficient information.  

  2. I dislike GoDaddy, both because of what they stand for (they originally supported both SOPA and PIPA), and because the few times I was forced to use them it was a painful experience (horrible control panel, customer service that knew nothing, but always tried to upsell what they could, etc.).

     

    I have a reseller account at ICDsoft that suits my needs.  Not sure of how they compare with GoDaddy with their prices, but I've had no complaints.  And they can give you shell access if you require it, which is nice (I do since I use Symfony for most of my PHP projects).

     

    EDIT: Each site I have with them has their own shared hosting account.  Their base level accounts have more than enough features to handle small-to-medium sites.

  3. Hi Everyone.  I am new to the world of coding in PHP and I am currently doing some practise stuff. At the moment I have a mysql database set up and I have a very basic html site. I want to place a simple comment box onto the website where someone leaves their name and their comment and it submits. Later I want to be able to log in as an administrator and manage the comments but for now I just want to create the form, create the php script and have the details stored in my database.

     

    This is turning out to be more difficult than I thought it would be. I checked out some tutorials but I've been told not to use their code because it's either badly written or it's not done in OOP style. I have been doing some reading on OOP and the theory behind it. This is what I understand of it so please correct me if I'm wrong.

     

    1. Objects belong to classes.

     

    2. The classes define the objects properties and methods (functions).

     

    3. Each object may contain different values of properties and methods but can belong to the same class.

     

    4. Each property may have it's own methods (functions).

     

    Is this correct?

     

    What I would like to do is create a comment box script so users can leave comments on my site but create the script in OOP style. I'm struggling to do this because I don't know how I would first create the class. Can someone please help me and tell me how I should create the class? Thanks.

     

    Classes are the definition/blueprint of a type.  A type is something that both represents something and the actions that can be performed on that thing.  Example: an integer is a type that represents whole numbers that can be manipulated via mathematics.  Objects are individual, discrete instances of that class (type).  Using the integer example, 5 would be an instance of an integer.

     

    With OOP, you're defining complex types and using individual instances of them to do things.  They're complex because they're created using the base types (like string, int, etc.) that the underlying language comes with.  The power of OOP comes from the fact that objects can contain other objects, and pass them around from object to object.

     

    That said, we're not just going to tell you how to complete your task.  Show us what you've tried so far, and we'll help, but we don't just give out answers on request as a matter of policy.  

  4. I'm so, so sorry that the free professional (yes, professional... those of us with badges write PHP for a living) advice we have given you has somehow offended your delicate sensibilities.  An edible bouquet will be shipped to you, with its fruit grown and sustained, in part, by our shameful tears.

     

    I think we can convince trq to end his own life, if you feel that your unique and entitled snowflake-ness needs something more than our communal genuflection.

  5. Beautiful would probably be something like ruby or python.  I'm a big fan of C#, as aside from Microsoft's penchant for long ass names, it's an incredibly readable C dialect (it's also a nicer language than Java on the whole, but that's another issue).  C# only gets funky when you start dealing with parameterized types, and it's not really any more difficult than figuring out pointers in C/C++.

  6. I think it's also important to note that:

     

    1. 3-5 years experience really isn't anything special.  I'm not trying to sound harsh, but if you look at non-web software development gigs, you'll see that they require a BS in Computer Science plus at least two years practical experience.  And that's just to have them not ignore your resume outright.  So, no, 3-5 years isn't really adequate to even think about a senior position.

     

    2. You do realize that a Senior Developer is usually a management position, right?  What's your experience in leading other developers?  In being able to successfully allocate time and resources for everyone under you?  To regularly meet with the business and/or PR arm of companies to keep everything on track?  To have (one of) the final says in app design?

     

    Josh and trq have been pretty gentle with this whole thing, but here's the truth: if you go into an interview and say "Hi, I'm 21 years old with 3-5 years experience, and I'm applying for the Senior Developer position," you will be laughed out of the building unless you have an impeccable portfolio with references (to corroborate the management portion of the job) to match.  It's just wholly unrealistic.

  7. If you don't need to use what you're echoing later, just echo it directly.  If you do, assign it to a variable, then echo.  And doing both on one line is, like others have said, bad for readability and debugging.

     

    Just because you can do something doesn't mean you should.

  8. Well, HTML isn't a programming language.  It doesn't have any brains, as it were.  It's just text markup (indeed, that's why it's called Hypertext Markup Language).  HTML is incredibly simple, with the hardest thing figuring out the difference between inline and block elements.  CSS is a bit more complicated (mostly with the way it handles element positioning), but the basics are simple enough.

     

    PHP isn't reliant on JavaScript (or vice versa).  In fact, PHP and JavaScript live in two different environments.  PHP is executed on the server, whereas JS is executed in the browser.  Because of this crucial difference, you'll need to be familiar with the HTTP request cycle, which is basically:

     

    Request to server --> Server side processing (PHP, or some other language) --> Response to user (output, which would include HTML, JavaScript, images, etc.)

     

    That said, JavaScript has become increasingly important to learn because it's what makes pages interactive.  Think about what Google does.  All of the data is on their servers, but they use JavaScript to request that data and update the screen seamlessly.  So, at the very least, you'll want to become familiar with the basics there as well if you actually want to become a developer.  If you're just doing an assignment, think of JS as extra credit.  It's not necessary in the process of creating dynamic sites, but it can add that extra layer of polish that shows that you're willing to put forth extra effort.

     

    Regarding resources, I'm not sure of any website that would meet my standards.  Someone somewhere will no doubt mention w3schools, but that's a bad idea (see the w3fools link in my signature for the reason why).  The vast majority of PHP tutorials available suck.  They're either outdated, or they show exactly the wrong way to do things (like using 'global' everywhere).  The best introductory resource I've found is Larry Ullman's Visual Quickstart Guide (http://www.amazon.com/PHP-MySQL-Dynamic-Web-Sites/dp/0321784073/ref=sr_1_1?s=books&ie=UTF8&qid=1388598161&sr=1-1&keywords=larry+ullman).  Easy to read, lots of pictures showing the exact code in action, and no glaring errors.  Yeah, it's a book, which costs money, but it's the best introductory resource available, IMO.

     

    Luckily, there is a good, free online resource for front end (HTML, CSS, JavaScript) stuff.  The Mozilla Developer Network (https://developer.mozilla.org/en-US/docs/Webwill give you just about everything you need there.  It's by far the best resource available for the basics, as it's written/maintained by the people who make the Firefox web browser, which is also the same group that created JavaScript to begin with.  So, you'll be getting the info straight from the source.

  9. To add to Kevin's post, PHP is not javascript, and cannot run via an "onchange" event.  You would need javascript for that, as PHP never sees what a client does, only what a client sends to the server.

    I didn't even notice they were trying to invoke it via on change. Yeah, that won't work.

     

    Basically, the answer is learn to code.

  10. Defining a function is different than invoking/running a function.  Something like:

     

     

    function someFunction($x)
    {
        // do something with $x
    }

     

    Is a function definition.  But that's all it is.  It doesn't run right then and there.  Function invocation looks like:

     

     

    someFunction($x);

     

    Look at your code - you're blending them together (note where you have the semicolon, and how you have a code block following it... that's incorrect syntax).  You need to define a function before you can run it.  

  11. thanks for your reply.

     

    I have a MA degree in English Literature. Then, based on your given points, this might come useful to me. Of course, assuming I have the necessary practical knowledge of Web Design and Development.

     

    Pretty much.  A degree tells employers you can handle deadlines, juggle multiple tasks, and that sort of thing.  The very next thing they'll want to know are your skills.  A portfolio is vital in conveying that.  And, during the interview process, be prepared to write code then and there.  It's not necessarily critical that you get their coding tests correct, but that you show you can understand the problem, come up with a way to tackle it, and if it doesn't work, understand why it doesn't work and how you'd tweak it so it would/could work.

     

    Employers want to see that you think like a programmer.  Knowing language features/limitations is less important than problem solving and debugging skills and showing them you don't need your hand held for every little thing.  If you can think like a programmer, then learning syntax isn't a big deal.

     

    Employers would also much rather you know what your weaknesses are and that you've taken concrete steps to address them (as that shows you're aware of yourself within the context of the skillset you need, and it shows you're a self-starter) than someone who gives a canned answer about being too much of a perfectionist, or something eyerollingly bad like that.

  12. Hello

     

    I am from Iran and want to move to Canada several years later. My questions are:

     

    Is having a degree in Programming or Computer Science necessary to get a job?

     

    Are there any reliable online center for issuing certificates?

     

     

    Thanks in advance

     

    If Canada is anything like the States, then having a degree in something is usually necessary to even be considered for anything that's not freelancing.  It doesn't have to be programming/computer science related, although that's definitely more desirable, but a college/university degree in something is usually a requirement in even getting your foot in the door.

     

    AFAIK, certificates aren't desirable.  They show that you know certain language features and minutiae, but don't illustrate whether or not you can problem solve.  A better route to go would be to build a portfolio of sites/projects that show you tackling specific problems.  That shows practical, in-the-field knowledge that's far more valuable to an employer.

  13. As for how the data got in the table, I set it myself, So there wont be any brands without a function etc, Either way, This example probably falls into your "illegitimate" uses for this methodology.

     

    If you care to provide a example, How would you personally deal with this?

     

    Thanks in advance.

     

    What do you mean "there won't be any brands without a function?"

  14. Of course it didn't work.  ASP and PHP are completely different languages.  You can't expect to slap '$' in front of everything and have it work.

     

    What are you trying to do?  As in, what is the programming task you're trying to accomplish?  Because it's likely there's no 1-to-1 translation.

  15. FWIW, I use Hover.com for my domains.  They start at $15/domain, which is a bit expensive, but they have a great, intuitive control panel, and never try to upsell me on anything.  Between them and ICDSoft for shared hosting, I've never had any issues with performance, uptime, customer support, etc.

  16. You need to read up on variable scope as this the issue with your code.

     

    The problem is the $connection variable is defined outside of your functions. Functions have their own variable scope, meaning variables defined outside of it are not accessible. The solution is to either define $connection as global or pass it to your functions as an argument.

     

    Please don't suggest using globals.  We strive to teach best practices here, and using 'global' is anything but.

  17. @Obafainka, we have rules here.  One of them is that we don't simply do other's work for them.  We address people's problems with specific coding problems.

     

    Another rule is that if you need someone to do the bulk of the work for you, that you post in our freelance section.

     

    Since you violated two rules and exhibited cocky attitude towards a member of the forum staff, consider yourself on incredibly thin ice.

×
×
  • 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.