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
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.
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.
No probs man glad to help
Forgive me if you know this already, but just to straighten the concepts out a bit.
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.
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.