Curious....

Ye' old general discussion board. Basically, for everything that isn't covered elsewhere. Come here to shoot the breeze, shoot your mouth off, or whatever suits your fancy.
This forum is not for asking programming related questions.

Moderator: General Moderators

Post Reply
anthonyw
Forum Newbie
Posts: 1
Joined: Fri Jul 20, 2007 9:29 pm

Curious....

Post by anthonyw »

I'm sure this is a very simple question with an obvious answer that eludes me BUT, here goes. I'm accustomed to building web pages with html, but am ignorant about php. I'm wondering if there is any way of seeing how the web page in php is going to look as you can an html page through dreamweaver, or even explorer for that matter. It baffles me how you can tell what the site is going to look like without being able to preview it. Is there some editor ( using a windows xp operating environment) that allows you to view the page as you would an html page?

A premature thanks.
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

Most of us pros typically set up a (web) server, either on our own machine, or on an in-house development server.
User avatar
Chalks
Forum Contributor
Posts: 447
Joined: Thu Jul 12, 2007 7:55 am
Location: Indiana

Post by Chalks »

That was the first thing I tried to find out too... This thread helped. :)
toasty2
Forum Contributor
Posts: 361
Joined: Wed Aug 03, 2005 10:28 am
Location: Arkansas, USA

Post by toasty2 »

I too run a local webserver (running Abyss Web Server and PHP 5). Network Drives for easy script editing.
User avatar
The Phoenix
Forum Contributor
Posts: 294
Joined: Fri Oct 06, 2006 8:12 pm

Re: Curious....

Post by The Phoenix »

anthonyw wrote:I'm sure this is a very simple question with an obvious answer that eludes me BUT, here goes. I'm accustomed to building web pages with html, but am ignorant about php. I'm wondering if there is any way of seeing how the web page in php is going to look as you can an html page through dreamweaver, or even explorer for that matter. It baffles me how you can tell what the site is going to look like without being able to preview it. Is there some editor ( using a windows xp operating environment) that allows you to view the page as you would an html page?

A premature thanks.
In most cases, you cannot.

However, if you use some templating engines (Smarty, etc), you can (with considerable effort) get a template that can be opened in a WYSIWIG editor (Dreamweaver, NVU, etc).

Thats not to say that it will look *identical* to the output, but it gets you far closer.

In general, its mostly a test/rewrite cycle to get what you want. As other posters have noted, running it on a local webserver really helps.
User avatar
onion2k
Jedi Mod
Posts: 5263
Joined: Tue Dec 21, 2004 5:03 pm
Location: usrlab.com

Post by onion2k »

I don't use it, but I know RapidPHP (an editor/IDE) has a built-in web server for testing scripts.
User avatar
superdezign
DevNet Master
Posts: 4135
Joined: Sat Jan 20, 2007 11:06 pm

Post by superdezign »

There are quite a few editors that will let you preview PHP in them. I use PHP Designer which just uses my currently installed PHP version for display. However, I find the easiest way is to just install Apache and open it in the browser.
User avatar
RobertGonzalez
Site Administrator
Posts: 14293
Joined: Tue Sep 09, 2003 6:04 pm
Location: Fremont, CA, USA

Post by RobertGonzalez »

Eclipse has a built in browser that will save at intervals and display as you go along. It is a neat but annoying feature in that, for the most part, I know what my code is doing and what my markup/CSS is doing. Seeing it on the screen only confirms what I had suspected as I code it. Sometimes things show up differently that I expected, but it usually comes down to a silly CSS rule or something of that nature.

I recommend to all developers to install a local web server, local database server and local install of PHP so you can develop right on your machine without having to code/FTP/test/recode. Locally you can code, test, code, test, push to production. It is the fastest way to develop.
User avatar
superdezign
DevNet Master
Posts: 4135
Joined: Sat Jan 20, 2007 11:06 pm

Post by superdezign »

Everah wrote:I recommend to all developers to install a local web server, local database server and local install of PHP so you can develop right on your machine without having to code/FTP/test/recode. Locally you can code, test, code, test, push to production. It is the fastest way to develop.
And for those of us with "affordable" (cheap) hosting packages, you'll save bandwidth.
User avatar
RobertGonzalez
Site Administrator
Posts: 14293
Joined: Tue Sep 09, 2003 6:04 pm
Location: Fremont, CA, USA

Post by RobertGonzalez »

superdezign wrote:
Everah wrote:I recommend to all developers to install a local web server, local database server and local install of PHP so you can develop right on your machine without having to code/FTP/test/recode. Locally you can code, test, code, test, push to production. It is the fastest way to develop.
And for those of us with "affordable" (cheap) hosting packages, you'll save bandwidth.
+1. Good point.
User avatar
Ollie Saunders
DevNet Master
Posts: 3179
Joined: Tue May 24, 2005 6:01 pm
Location: UK

Post by Ollie Saunders »

I work off a Samba share on my Windows PC served by my Linux server. This is mainly because I prefer to execute PHP in the Linux environment and my production server is Linux so it makes sense that I'm able to clone the two server configurations. I would be 100% Linux if it wasn't for needing Photoshop and Illustrator, :(. Anyway, back to the main point, coding directly off your production server is not a good idea but there are in fact some editors that will let you "mount" an FTP connection and use it as if it were the local file-system, albeit a bit slower, which has proven useful on a couple of high stress "must fix this NOW!" moments. Although I won't be doing that now I've finally got my subversion repo how I like it.
Post Reply