SitePoint Sponsor

User Tag List

Results 1 to 6 of 6

Hybrid View

  1. #1
    SitePoint Member
    Join Date
    Oct 2006
    Posts
    13
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Page layout in PhP

    As some of you may know from my previous posts, I am a PhP newbie.

    I have an undaunting task of learning CSS, MySQL and PhP concurrently.

    Although it's a bit of a struggle, I am getting by with your help and the help of many books.

    The book by Kevin Yank "Build your own Database Driven Website using Php & MySQL has been invaluable to me.

    While I got through each chapter with minumum difficulty, I am stumped as how to layout my page in PhP.

    For instance, We created an interactive joke database and displayed the output in a browser. The output was displayed beginning in the upper lefthand corner of the page and proceeded downward.

    I am trying to figure out how to manipulate the output, say to the center or maybe right justified. His book, albeit a good one failed to touch on this subject.

    I am envisioning creating my reports (webpages) in PhP and would appreciate any reference manuals you can point me too.

    I thought perhaps I should be looking at CSS to manipulate the output look but could not see how to tie the two together regarding the actual content of the PhP page.

    As I'm typing, I'm thinking; Is it possible that once I pull the PhP page into my HTML, I will be able to structure the output using CSS at that point?

    Thanx in advance for your help

  2. #2
    SitePoint Zealot
    Join Date
    Feb 2007
    Location
    Melbourne, Australia
    Posts
    144
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    This really depends on what you are storing in your database and there are many ways to accomplish what you are saying.

    As a start, using your joke db as an example, you could simply create a html page and embed database calls (reports) into this page.

    This is when css and html coding come into play. After you have called your jokes from the database you embed them into you html code in between php tags and voila you have a simple dynamic web page.

    Try having a look at some simple php scripts on hotscripts they may give you a good idea of whats going on.

  3. #3
    SitePoint Member
    Join Date
    Oct 2006
    Posts
    13
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Ahh! Ok then...

    I was kinda sensing that. I will see what "Hotscripts" have to offer and go from there.

    Thank you for a fast response.

  4. #4
    SitePoint Zealot
    Join Date
    Feb 2007
    Location
    Melbourne, Australia
    Posts
    144
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    No probs man glad to help

  5. #5
    SitePoint Wizard silver trophy kyberfabrikken's Avatar
    Join Date
    Jun 2004
    Location
    Copenhagen, Denmark
    Posts
    6,157
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Forgive me if you know this already, but just to straighten the concepts out a bit.

    PHP generates HTML -- it's not an alternative, but rather an extension. HTML is interpreted by the browser, along with CSS and javascript, to generate a visual rendering.

    PHP happens at the server, while the interpretation of HTML (+ CSS) happens at the users machine (client side). There is no direct interaction going on between PHP and the browser -- PHP just generates the HTML, which is then sent to the browser. This is why, when you select "View Source" in the browser, you won't see any PHP-code in there -- you only see the output from the PHP script (HTML).

    In principle, there is no difference between using PHP and any other server side technology, from the user point of view.

  6. #6
    SitePoint Member
    Join Date
    Oct 2006
    Posts
    13
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    HMM!

    That makes sense and I did hear that before. What was throwing me off was seeing the ? in url address and knowing that it represents a PhP call.

    I was assuming the entire page was somehow constructed in PhP, but now it appears that while the content is on the server-side, I can format it in the HTML using CSS.

    I'm going to do a little experimenting to see if I'm getting it.

    Thanx again, you guys are fantastic and no apology is necessary to excuse my ignorance; anonymity is another bonus of this forum.


Bookmarks

Posting Permissions

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