PHP website development
Page 1 of 2 12 LastLast
Results 1 to 15 of 19

Thread: PHP website development

  1. #1
    Junior Member
    Join Date
    Mar 2012
    Posts
    7

    PHP website development

    Hi All,

    I am trying to build a photography studio website using PHP, MySQL, and Apache. I am new to the language though. I went through a book and worked through all the examples but it still isn't totally clear. Anyway I need to make a pretty decent site. So far I have really basic things on it and it seems to be ok but the question I have right now is that I am trying to build albums on the site and I need to use the different tables in the database. I am just wondering if there is a way to use the photo names that I put into the database in my code...as in is there anyway to retrieve the photos from there after I link the PHP script and MySQL together or do I always have to put the photo location into the script?

    There is so much that I want to do with the site and I have tried looking at different sites and tutorials online but it is difficult for me to understand them as the language is still so new to me.

    Thanks a million!

    Leah

  2. #2
    Senior Member dagon's Avatar
    Join Date
    Nov 2001
    Posts
    6,178
    with respect, you will not be able to build a "pretty decent site" with out experience. Just like I wouldn't photograph a wedding (my dad was a pro, when they still used glass plates), I suggest you hire a professorial web developer, if you want a professional website.

  3. #3
    Junior Member
    Join Date
    Mar 2012
    Posts
    7
    I never said I needed to build a professional site. I just said that I needed to build a site and that I want to learn how to make it pretty decent. What is the point in learning a new computer language if I am just going to hire someone else to build it???

  4. #4
    Senior Member dagon's Avatar
    Join Date
    Nov 2001
    Posts
    6,178
    Quote Originally Posted by leahmo View Post
    Anyway I need to make a pretty decent site.
    Quote Originally Posted by leahmo View Post
    I never said I needed to build a professional site.
    Ok, we have different definitions of professional and decent, but I stand by my suggestions. Best of luck.

  5. #5
    Senior Member traq's Avatar
    Join Date
    Jun 2011
    Location
    so.Cal
    Posts
    949
    Quote Originally Posted by leahmo View Post
    I never said I needed to build a professional site. I just said that I needed to build a site and that I want to learn how to make it pretty decent. What is the point in learning a new computer language if I am just going to hire someone else to build it???
    I think this begs the question: Do you want...
    a) a "pretty decent" (and/or "professional-looking," whatever) website?
    b) a "learning experience"?

    Your first attempt is not going to produce both.

  6. #6
    Junior Member
    Join Date
    Mar 2012
    Posts
    7
    I am a quick learner ok? And pretty decent as in it will work and the it will do the little things that I want it to do. When using code to create things it is a learning experience.

  7. #7
    Senior Member dagon's Avatar
    Join Date
    Nov 2001
    Posts
    6,178
    Quote Originally Posted by leahmo View Post
    I am a quick learner ok? And pretty decent as in it will work and the it will do the little things that I want it to do. When using code to create things it is a learning experience.
    ok great, your original question is un answerable because it's to vague, you need to be far more specific, there are dozens of way to put things in to and out of a db; some code would be very helpful.

  8. #8
    Junior Member
    Join Date
    Mar 2012
    Posts
    7
    ok what I am trying to do is build a website for a photography studio (its a project I am working on...not for an actual studio or anything ok) and I am currently trying to build a client page where they can see a bunch of different albums. They log into their album and there is their photos. I have the login part working the thing is that I can't figure out how to

    1. have it so that they can only view their album.
    2. i want to know if there is anyway that i can pull the photos from the database itself. As in, that I have a database set up for the studio and I have a table for albums and a table for photos etc. I am wondering if from the table called albums or photos or whatever can i take the photos from there or do I always have to type in the name of the photo ie. <img src="location.jpeg> etc.

    Is that clear?

  9. #9
    Senior Member traq's Avatar
    Join Date
    Jun 2011
    Location
    so.Cal
    Posts
    949
    What does your existing code look like? Code examples would be helpful.

    1. to limit users to individual albums, you'll need to build a login system.

    2. you can store the photos in the DB, but there's no real reason to. the typical approach is to store the metadata (file name, etc.) in the DB and then you can just insert it into your HTML markup.

  10. #10
    Senior Member Derokorian's Avatar
    Join Date
    Apr 2011
    Location
    Denver
    Posts
    1,763
    Basically, to limit users to their images only, you would only select their images from the DB. One way to do this is to store the userid in the session, and store images with the user_id of the person it belongs to, then construct a query along the lines of:
    PHP Code:
    $sql 'SELECT filename FROM images WHERE user_id = '.$_SESSION['user_id'].' LIMIT '.$offset.','.$limit
    Sadly, nobody codes for anyone on this forum. People taste your dishes and tell you what is missing, but they don't cook for you. ~anoopmail
    I'd rather be a comma, then a full stop.
    User Authentication in PHP with MySQLi - Don't forget to mark threads resolved - MySQL(i) warning

  11. #11
    Junior Member
    Join Date
    Mar 2012
    Posts
    7
    Ok I will send my two codes in two different posts. Right now I have two seperate pages, 1 for galleries, and 1 for client login. Now with the galleries and stuff I have only posted like one or two photos for each gallery as a bit of practice etc. So here is the code for the galleries.

    HTML Code:
    <html>
    <head>
    
    <style type="text/css">
    ul
    {
    list-style-type:none;
    margin:0;
    padding:0;
    overflow:hidden;
    }
    li
    {
    float:left;
    }
    a:link,a:visited
    {
    display:block;
    width:120px;
    font-weight:bold;
    color:#FFFFFF;
    background-color:#98bf21;
    text-align:center;
    padding:4px;
    text-decoration:none;
    text-transform:uppercase;
    }
    a:hover,a:active
    {
    background-color:#7A991A;
    }
    
    </style>
    </head>
    
    <body>
    <body bgcolor=#A00000>
    
    <h1><p align="center">L. Mo's Photography</p></h1>
    <body>
    <ul>
    <li><a href="home.html">Home</a></li>
    <li><a href="maingallery.html">Galleries</a></li>
    <li><a href="about.html">About</a></li>
    <li><a href="contact.html">Contact</a></li>
    <li><a href="clients.html">Clients</a></li>
    </ul>
    <h1><p align="center">Galleries</p></h2>
    <ul>
    <a href="kidsgallery.html"/><font size="4" color="white">Kids</font></a href>
    <a href="kidsgallery.html"/><img src="kidslinkphoto.php" width="191" height="127"/></a href><br>
    <a href="animalsgallery.html"/><font size="4" color="white">Animals</font></a href>
    <a href="animalsgallery.html"/><img src="animalslinkphoto.php" width="191" height="127"/></a href><br>
    </ul>
    </body>
    </body>
    </html>
    Last edited by bradgrafelman; 03-30-2012 at 06:38 AM. Reason: HTML bbcode tags added

  12. #12
    Junior Member
    Join Date
    Mar 2012
    Posts
    7
    Here is the code for the client login so far.

    HTML Code:
    <html>
    <head>
    
    <style type="text/css">
    ul
    {
    list-style-type:none;
    margin:0;
    padding:0;
    overflow:hidden;
    }
    li
    {
    float:left;
    }
    a:link,a:visited
    {
    display:block;
    width:120px;
    font-weight:bold;
    color:#FFFFFF;
    background-color:#98bf21;
    text-align:center;
    padding:4px;
    text-decoration:none;
    text-transform:uppercase;
    }
    a:hover,a:active
    {
    background-color:#7A991A;
    }
    
    </style>
    </head>
    
    <body>
    
    
    <body bgcolor=#A00000>
    
    <h1><p align="center">L. Mo's Photography</p></h1>
    
    <body>
    <ul>
    <li><a href="home.html">Home</a></li>
    <li><a href="maingallery.html">Galleries</a></li>
    <li><a href="about.html">About</a></li>
    <li><a href="contact.html">Contact</a></li>
    <li><a href="clients.html">Clients</a></li>
    </ul>
    <h1><p align="center">PhotoShoot Albums</p></h2>
    <ul>
    <style type="text/css">
    div.img
    {
      margin: 2px;
      border: 1px solid #0000ff;
      height: auto;
      width: auto;
      float: left;
      text-align: center;
    }	
    div.img img
    {
      display: inline;
      margin: 3px;
      border: 1px solid #ffffff;
    }
    div.img a:hover img {border: 1px solid #0000ff;}
    div.desc
    {
      text-align: center;
      font-weight: normal;
      width: 120px;
      margin: 2px;
    }
    </style>
    </head>
    <body>
    
    </ul>
    
    
    <p align="center"><table border="8">
    <tr>
    <td>
    <form method="post" action="userlogin.php">
    <p><strong>username:</strong><br/>
    <input type="text" name="username"/></p>
    <p><strong>password:</strong><br/>
    <input type="password" name="password"/></p>
    <p><input type="submit" name="submit" value="login"/></p>
    </form>
    </td>
    </tr>
    </p>
    </table>
    </body>
    </body>
    </html>
    Last edited by bradgrafelman; 03-30-2012 at 06:39 AM. Reason: HTML bbcode tags added

  13. #13
    Junior Member
    Join Date
    Mar 2012
    Posts
    7
    In both the codes I have a navigation bar at the top as this is for a photography studio.

  14. #14
    Senior Member dagon's Avatar
    Join Date
    Nov 2001
    Posts
    6,178
    I would start by learning to write valid html, and you did not post the php, which is what you where asked for.

  15. #15
    Senior Member traq's Avatar
    Join Date
    Jun 2011
    Location
    so.Cal
    Posts
    949
    It would also be a good idea to separate out your CSS into an external stylesheet.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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