Page 1 of 2 12 LastLast
Results 1 to 25 of 27
  1. #1
    Member Cav's Avatar
    Join Date
    August 13th, 2008
    Location
    Ontario, Canada
    Posts
    98
    JavaScript to PHP and MySql, how much of a learning curve is it.
    Over the past 7 months I have been intensely teaching myself and practicing JavaScript to get really good at it. I am now about to go and start learning PHP and MySql, so I was wondering how difficult will it be to pick up if your fully dedicated. I know it all depends on the individual but I'm just curious as to anybody else's experience in doing this.

  2. #2
    Full Member
    Join Date
    January 18th, 2005
    Posts
    396
    I haven't had much trouble going from VB Script and Visual Basic to Php. I do like that they have so many built-in functions - even more than VB. Do become acquainted with PHP.net - the official PhP site. They have a very through search function to find the function you need and plenty of examples using that function. Also, the sitepoint forums (at sitepointforum.com) offer the best help for troubleshooting errant code

    Charles

  3. #3
    Member Cav's Avatar
    Join Date
    August 13th, 2008
    Location
    Ontario, Canada
    Posts
    98
    I was wondering that, I was starting to get into php a little while ago. At the time though I was still struggling with JavaScript so I decided to get a good concrete handle on it before I moved on to another language.
    Thank for the site link.

  4. #4
    ABW Ambassador superCool's Avatar
    Join Date
    April 23rd, 2008
    Location
    Texas
    Posts
    1,268
    php is pretty easy to learn if you know anything about programming/scripting. superCool has never learned to get "really good at it" because he doesn't have to. unless you are trying to get a job with php then you really don't need to know everything. if you concentrate on solving your own needs then you can get by knowing very little. superCool keeps a document with all the commands and techniques that have been helpful to him. then when something comes up he just looks at the doc and it helps him figure out the problem. with all the online references out there you have everything at your fingertips.

    one way to learn is to grab a free script that does something similar to what you want and then study what it does and customize it to do what you really need. you might also want to set up some error logging in the background so that you can see what errors are occurring but the user does not see them.

    the area that you really should look into and learn more about is security.

    hope this helps.

  5. #5
    Visual Artist & ABW Ambassador lostdeviant's Avatar
    Join Date
    September 7th, 2007
    Location
    Cuautitlán, Edo. de México
    Posts
    1,725
    I went from not knowing anything to being able to do almost everything I want in PHP without help in a year, so I'd have to say that PHP is very easy to learn. It was good to have help from other users when I got stuck.
    I think the worst part is learning how to get the mysql queries right when getting php scripts to save and get data from mysql tables. The other big frustration was setting up pagination. There are tutorials for that too, but most of them omit key steps.

    I'm thinking about learning javascript now, but the only thing I want to do is have a javascript show different ads based on a visitor's browser and I haven't found examples of that to start with.

  6. #6
    Member Cav's Avatar
    Join Date
    August 13th, 2008
    Location
    Ontario, Canada
    Posts
    98
    Thanks for the insight guys it really helps.

  7. #7
    Member Cav's Avatar
    Join Date
    August 13th, 2008
    Location
    Ontario, Canada
    Posts
    98
    If your looking to learn javascript, get the book head first JavaScript it worked great for me.

  8. #8
    Member Cav's Avatar
    Join Date
    August 13th, 2008
    Location
    Ontario, Canada
    Posts
    98
    Hey lostdeviant I'll see if I can come up with a script for you to switch ads based on the users browser.

  9. #9
    Visual Artist & ABW Ambassador lostdeviant's Avatar
    Join Date
    September 7th, 2007
    Location
    Cuautitlán, Edo. de México
    Posts
    1,725
    Quote Originally Posted by Cav
    Hey lostdeviant I'll see if I can come up with a script for you to switch ads based on the users browser.
    Thank you. To be specific if it is Internet Explorer ...show ad (probably affiliate banner) ... else adsense.

  10. #10
    Member Cav's Avatar
    Join Date
    August 13th, 2008
    Location
    Ontario, Canada
    Posts
    98
    OK I'll see what I can do, shouldn't be a problem. Just to be sure, you just want to know if the user's browser is IE and don't need to know the other specific browsers?

  11. #11
    ABW Veteran Mr. Sal's Avatar
    Join Date
    January 18th, 2005
    Posts
    6,795
    Arrow
    Quote Originally Posted by Cav
    Over the past 7 months I have been intensely teaching myself and practicing JavaScript to get really good at it. I am now about to go and start learning PHP and MySql, so I was wondering how difficult will it be to pick up if your fully dedicated. I know it all depends on the individual but I'm just curious as to anybody else's experience in doing this.
    I have found that after learning some of the basics of PHP and MySql from a book, and some sites on the net, the best way to learn about PHP and MySql for me, was by actually play around with many different PHP scripts on a test directory on the server...

    Up to recently, I was doing all my script tests, live on the server, but this week I decided to try XAMPP on my computer, and now I wish that I had done that a couple of years ago when I was learning PHP and MySql in order to work with datafeeds...

    By using XAMPP on my computer, I can now do all my PHP and MySql tests on my HD, and not worry about messing up things on the server, I also learned that I can test any PHP on my computer without even been conected to the internet, so now I would be able to learn more ways to do things with PHP and MySql off-line, and not be distracted with other things on the net.

    If your're interested in learning more about XAMPP, check the link below:

    XAMPP is an easy to install Apache distribution containing MySQL, PHP and Perl. XAMPP is really very easy to install and to use - just download, extract and start. http://www.apachefriends.org/en/xampp.html

  12. #12
    Visual Artist & ABW Ambassador lostdeviant's Avatar
    Join Date
    September 7th, 2007
    Location
    Cuautitlán, Edo. de México
    Posts
    1,725
    Quote Originally Posted by Cav
    OK I'll see what I can do, shouldn't be a problem. Just to be sure, you just want to know if the user's browser is IE and don't need to know the other specific browsers?
    yes, that's correct :-)

  13. #13
    Member Cav's Avatar
    Join Date
    August 13th, 2008
    Location
    Ontario, Canada
    Posts
    98
    XAMPP is an easy to install Apache distribution containing MySQL, PHP and Perl. XAMPP is really very easy to install and to use - just download, extract and start. http://www.apachefriends.org/en/xampp.html
    Thanks Mr Sal, yeah I've been using XAMPP for awhile for my AJAX apps, it saves a lot of trouble of breaking your site.

  14. #14
    Member Cav's Avatar
    Join Date
    August 13th, 2008
    Location
    Ontario, Canada
    Posts
    98
    Hey lostdeviant I should have that script done later tonight, I'll post it here.

  15. #15
    ABW Ambassador Snib's Avatar
    Join Date
    January 18th, 2005
    Location
    Virginia
    Posts
    5,303
    I'd start with a foundation when learning PHP. Maybe something like Cake, Pear, Smarty or even Wordpress. It's much better to build on top of a foundation than to start from scratch. You definitely want to research your options and see which is best suited for your needs. The same can be said for Javascript. For example you can try jQuery to get started with Javascript. It provides a solid foundation and much more advanced functionality with limited work. The more tools you begin with, the faster your development will be. Most of the time there's absolutely no need to re-invent the wheel. Especially when it comes to things like interactive-GUI, template or database libraries.

    - Scott
    Hatred stirs up strife, But love covers all transgressions.

  16. #16
    Member Cav's Avatar
    Join Date
    August 13th, 2008
    Location
    Ontario, Canada
    Posts
    98
    Smile
    Hey lostdeviant here is your code for browser specific code I tested it and it works, let me know how it works for you.
    [CODE]
    <script type="text/javascript">


    function isbrowserIE(){

    var isIE =(navigator.appName == "Microsoft Internet Explorer");

    if(isIE){
    //find the element in the document that matches this id attribute
    var ieAd = document.getElementById("testelem");
    //if user's browser is IE show this ad
    ieAd.innerHTML ="Place your IE specific affiliate code here";

    }else{

    var otherAd = document.getElementById("testelem");
    //if user's browser is not IE show this ad
    otherAd.innerHTML="place your non IE advertisment affiliate code here";
    }
    }

    </script>
    [CODE]

  17. #17
    Visual Artist & ABW Ambassador lostdeviant's Avatar
    Join Date
    September 7th, 2007
    Location
    Cuautitlán, Edo. de México
    Posts
    1,725
    When I try it nothing happens in the browser. Shouldn't those words in between the quotes appear or do I need to place the code somewhere else?

  18. #18
    Comfortably Numb John Powell's Avatar
    Join Date
    October 17th, 2005
    Location
    Bayou Country, LA
    Posts
    3,432
    Quote Originally Posted by supercool
    php is pretty easy to learn if you know anything about programming/scripting. superCool has never learned to get "really good at it" because he doesn't have to. unless you are trying to get a job with php then you really don't need to know everything.
    Unless you are a sicko like me and think PHP is fun. Problem is that I learn and can't remember, but I get the fun of learning it again.
    Quote Originally Posted by lostdeviant
    I think the worst part is learning how to get the mysql queries right when getting PHP scripts to save and get data from mysql tables. The other big frustration was setting up pagination.
    Over time these are my biggest headaches also. Larry Ullman books saved the day for me.
    Quote Originally Posted by Mr. Sal
    By using XAMPP on my computer, I can now do all my PHP and MySql tests on my HD, and not worry about messing up things on the server
    I use WampServer which is the same thing and also easy to install. Only small problem comes when your PHP version on your XAMPP or WampServer is different than your live server. This is not big at all but saves time if you are aware of it.


  19. #19
    ABW Ambassador
    Join Date
    January 18th, 2005
    Posts
    551
    I would also read up on security as you may unintentionally write vunerable code.

    I found Essential PHP Security by Chris Shiflett extremely useful. If you dont want to buy the book, he has a website that covers most of it.

    I like to buy the book because if you actually read it through you get information you would never have thought about and I can put tags on the pages and underline stuff to remind myself.

  20. #20
    Member Cav's Avatar
    Join Date
    August 13th, 2008
    Location
    Ontario, Canada
    Posts
    98
    Quote Originally Posted by lostdeviant
    When I try it nothing happens in the browser. Shouldn't those words in between the quotes appear or do I need to place the code somewhere else?

    The code can go in the head of the document or be put into an external .js file like this. This is what the code and placement should look like.

    <html>
    <head>
    <script type="text/javascript">
    window.onload = isbrowserIE;

    function isbrowserIE(){

    var isIE =(navigator.appName == "Microsoft Internet Explorer");

    if(isIE){
    //find the element in the document that matches this id attribute
    var ieAd = document.getElementById("testelem");
    //if user's browser is IE show this ad
    ieAd.innerHTML ="Place your IE specific affiliate code here";

    }else{

    var otherAd = document.getElementById("testelem");
    //if user's browser is not IE show this ad
    otherAd.innerHTML="place your non IE advertisment affiliate code here";
    }
    }

    </script>
    </head>

    <body>
    <div id="testelem">



    </div>



    </body>
    </html>

  21. #21
    .
    Join Date
    January 18th, 2005
    Posts
    2,973
    Mr. Sal wrote: > * * * Up to recently, I was doing all my script tests, live on the server, but this week I decided to try XAMPP on my computer, and now I wish that I had done that a couple of years ago when I was learning PHP and MySql in order to work with datafeeds..." <

    I did the exact same thing this past week, installing XAMPP on my Windows PC in order to test-drive and experiment with Joomla. (A word of warning: I first tried WAMPserver, but after about 10 hours of effort, I was still encountering problems with Joomla on WAMPserver, and in response to a Craigslist post, someone suggested to me that I switch to XAMPP instead, and it worked perfectly.)

    Added: To respond to the original question -- moving from a "single programming language" to LAMP is a pretty big move because you need to learn a whole bunch of different/overlapping systems, and you must discover the importance of hundreds of configuration settings (and how to change them). As I've mentioned often in the past, I've encountered many "simple problems that seem like they should only take 5 minutes to solve, but which took 8 hours instead." After several dozen of those problems in a month, I get very frustrated.

  22. #22
    Member Cav's Avatar
    Join Date
    August 13th, 2008
    Location
    Ontario, Canada
    Posts
    98
    Hey lostdeviant
    Let me know how the code is working, hope my last post helped.

  23. #23
    Visual Artist & ABW Ambassador lostdeviant's Avatar
    Join Date
    September 7th, 2007
    Location
    Cuautitlán, Edo. de México
    Posts
    1,725
    Quote Originally Posted by Cav
    Let me know how the code is working, hope my last post helped.
    I got it working by adding a div with that ID like you showed except when i try to include Adsense as the non-ie text, it breaks. Thank you for the sample code.

  24. #24
    Member Cav's Avatar
    Join Date
    August 13th, 2008
    Location
    Ontario, Canada
    Posts
    98
    Your welcome, by the way how is the adsense breaking, is the code similar to your affiliate link?

  25. #25
    Visual Artist & ABW Ambassador lostdeviant's Avatar
    Join Date
    September 7th, 2007
    Location
    Cuautitlán, Edo. de México
    Posts
    1,725
    Quote Originally Posted by Cav
    Your welcome, by the way how is the adsense breaking, is the code similar to your affiliate link?
    well the adsense ad doesn't appear and I'd see some characters appear I think I saw ";

    no, it is very different. Normal affiliate links appear as plain html links. Adsense links use Javascript code.

+ Reply to Thread
Page 1 of 2 12 LastLast

Similar Threads

  1. Best Learning Source for PHP, mySQL??
    By JordanG in forum Programming / Datafeeds / Tools
    Replies: 7
    Last Post: August 16th, 2007, 11:26 PM
  2. The Learning Curve
    By kennedy in forum Marketing Resources & Power Tools
    Replies: 5
    Last Post: February 12th, 2007, 04:37 PM
  3. Learning php??????
    By Trying to Win in forum Newbie Affiliate FAQs & Helpful Articles
    Replies: 18
    Last Post: January 22nd, 2006, 01:31 AM
  4. Shorten Your Blogging-RSS Learning and Submission Curve
    By dataminer in forum Newbie Affiliate FAQs & Helpful Articles
    Replies: 0
    Last Post: June 4th, 2005, 02:44 PM
  5. How long was your learning curve?
    By Rick K. in forum Midnight Cafe'
    Replies: 29
    Last Post: September 20th, 2004, 01:46 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •