Xhtml/php/css?

Discussion in 'Web Design and Development' started by michael85, Aug 28, 2007.

  1. michael85 macrumors newbie

    Joined:
    Jul 5, 2007
    Location:
    Antwerp, Belgium
    #1
    Well this is a lil question from a student who has experience in web-dev (HTML and CSS). Bt obviously those are the easy languages out there.
    Also I have experience in software-engineering (C,C++ and C#)

    Now I'm having this new 'student job'.
    It's from a company wich wants me to make websites for their clients
    The sites needs to work with a :

    *online shop
    *allowing users to create profiles
    *interact with databases
    *interact with http://en.mylivepage.com/
    *etc.

    Now I'm not really sure wich language I'll have to learn for that..
    Is it Java? PHP? XHTML?

    I don't really have a clue wich language is best for the job, or maybe a combination?

    I hope some of the more experienced guys here can help me out :)

    PS: I got the job because of my knowledge about the C languages. Since PHP looks a lot like C++ ..

    Greetings,
    Michaël
     
  2. dataset macrumors member

    Joined:
    Jun 27, 2007
    Location:
    La Mirada, California, United States Of America
    #2
    PHP will probably be the best, and that is also what I always use for any server side stuff that needs to be done.

    ASP is another choice.. But I have no experience in that.

    So, basically I think PHP will be the best if close to best if it isn't the best.
     
  3. michael85 thread starter macrumors newbie

    Joined:
    Jul 5, 2007
    Location:
    Antwerp, Belgium
    #3
    Yeah, my first idea as well :)
    And it's sweet I can do all that in OSX (I'm a switcher and loving it)
    Btw, do you have any great online resources for PHP?
    So far I'm studying from PHPMac and the Books included in Coda.

    Greetings
     
  4. dataset macrumors member

    Joined:
    Jun 27, 2007
    Location:
    La Mirada, California, United States Of America
    #4
    I don't really have any good online resources for PHP.. I used a huge book to learn, and I left my PHP book at my parents house so, I can't give you the name of that. sorry.
    But..
    PHP.net 's manual seems fairly good. http://www.php.net/manual/en/
    And they also have reference for all the functions, thats really helpful.

    ALSO:
    And installing php is easy also.. Just download the binary from here http://www.entropy.ch/software/macosx/php/

    BTW:
    Welcome to the awesome mac world!
     
  5. michael85 thread starter macrumors newbie

    Joined:
    Jul 5, 2007
    Location:
    Antwerp, Belgium
    #5
    Yes idd, I think I allready enables PHP:

    I downloaded MAMP
    I got the "httpd conf" file changed through the Terminal

    When I open MAMP, a webpage opens, telling me PHP is installed on my mac :)
    That's all that needs to be done I think.
    I didn't download any binary I think, but maybe it came along with MAMP?

    Also, the tutorial site is great. I think I'll better start studying/experimenting now ;)
     
  6. Stampyhead macrumors 68020

    Stampyhead

    Joined:
    Sep 3, 2004
    Location:
    London, UK
    #6
    The Sitepoint PHP forum is a great resource. If you ever get stuck or run into any problems you can't figure out, these are the guys (and girls) to ask.
     
  7. michael85 thread starter macrumors newbie

    Joined:
    Jul 5, 2007
    Location:
    Antwerp, Belgium
    #7
    Hmmm..

    I installed MAMP
    Is it necesarry to install a package like XAMPP in order to develop localy?
    Srry for all the questions ;) I just don't have much experience with the server-stuff
     
  8. dataset macrumors member

    Joined:
    Jun 27, 2007
    Location:
    La Mirada, California, United States Of America
    #8
    Well if its mamp (MacOs Apache MySQL PHP) then that should be all you need to develop locally. When you start the server on your computer you and anyone on your network will have access to it.

    XAMPP Just stands for Windows/Mac/Linux Apache MySQL PHP Python
     
  9. michael85 thread starter macrumors newbie

    Joined:
    Jul 5, 2007
    Location:
    Antwerp, Belgium
    #9
    lil problem:

    [​IMG]

    coda:

    [​IMG]

    seems like theres a problem with the parsing?
    MAMP says everything is ok, also my php files are in the right directory :)
     
  10. macfaninpdx macrumors regular

    Joined:
    Mar 6, 2007
    #10
    You need to save the file with a .php extension for apache to know to parse the php in the file. Even if the beginning (or most) of the code is <html>, it still needs a .php extension.
     
  11. michael85 thread starter macrumors newbie

    Joined:
    Jul 5, 2007
    Location:
    Antwerp, Belgium
    #11
    Hmm still wont work, I even added the .php extension manually when saving the file.. same result :(
     
  12. michael85 thread starter macrumors newbie

    Joined:
    Jul 5, 2007
    Location:
    Antwerp, Belgium
    #12
    Something isnt clear to me :

    Code:
    <HTML>
    
      <HEAD>
         <TITLE>Mijn eerste PHP pagina</TITLE>
      </HEAD>
    
      <BODY>
          <?php
       echo ("Hello world"); 
       ?> 
      </BODY>
    
    </HTML>
    or

    Code:
    <HTML>
    
      <HEAD>
         <TITLE>Mijn eerste PHP pagina</TITLE>
      </HEAD>
    
      <BODY>
          <?php
       echo <p>'Hello world'</p> ; 
       ?> 
      </BODY>
    
    </HTML>
    I saw both being used, only the 2nd one gets me this:
    [​IMG]

    the first one returns nothing :x

    MAMP says Apache and mySQL server is up, also the directory is configurated correctly..

    The problem is probably easy, but can't find it.
    So: Wich code is the right one? and how do i get it to work? :x

    Greetings

    edit: if its hard to explain, my skype is MichaelBE85
     
  13. macfaninpdx macrumors regular

    Joined:
    Mar 6, 2007
    #13
    Echo is not technically a PHP function - it is a language construct. So you can use echo with or without paranthesees. So thse are all correct:
    PHP:
    echo ("Hello World");
    echo 
    "Hello World";
    echo 
    "Hello"" ""World";
    The problem in your non-working code is that the <p> tags are not in the quotation marks. Try this:
    Code:
    <HTML>
    
      <HEAD>
         <TITLE>Mijn eerste PHP pagina</TITLE>
      </HEAD>
    
      <BODY>
          <?php
       echo '<p>Hello world</p>'; 
       ?> 
      </BODY>
    
    </HTML>
    If it is still giving you problems, try using double-quotes instead of single.
     
  14. michael85 thread starter macrumors newbie

    Joined:
    Jul 5, 2007
    Location:
    Antwerp, Belgium
    #14
    Doesn't change a thing, and when I use double-quotes, the output just shows the same, except with double-quotes..

    Kinda annoying, can't start with this problem lying around :(
     
  15. xelterran macrumors 6502

    Joined:
    Dec 28, 2001
    #15
    Which directory are you running the php file from?
     
  16. tominated macrumors 68000

    tominated

    Joined:
    Jul 7, 2006
    Location:
    Queensland, Australia
    #16
    if you are testing it with MAMP, it needs to be in a folder called htdoc in the MAMP folder, and you need to open MAMP. So the php files should be in a directory like so:
    /Applications/MAMP/htdocs/
    but when mamp is open, you access them like this:
    http://localhost:8888/
     
  17. Mr.nix macrumors member

    Joined:
    Jan 30, 2007
    #17
    What he said is correct. So you'll need something like this

    http://localhost:8888/index.php

    As far as your code, single quotes are fine for what you're doing there. No need for double.
     
  18. michael85 thread starter macrumors newbie

    Joined:
    Jul 5, 2007
    Location:
    Antwerp, Belgium
  19. michael85 thread starter macrumors newbie

    Joined:
    Jul 5, 2007
    Location:
    Antwerp, Belgium
    #19
    omg guys, it worked!
    you don't know how thankfull i am :)

    cheers to this great community
     

Share This Page