Testing php code before posting on web server

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
lhcpr
Forum Newbie
Posts: 10
Joined: Fri Jun 20, 2008 4:22 am

Testing php code before posting on web server

Post by lhcpr »

Hello there,

First time post and absolute newbie to php...

I am building a website that will have a mail php form function for a particular field. Is there anyway that I can test the mail-to function locally before I post on webserver? I just want to be sure that the field can actually be sent to the nominated email address.

I am using both Windows and Ubuntu OS.

Thanks

Graham
matthijs
DevNet Master
Posts: 3360
Joined: Thu Oct 06, 2005 3:57 pm

Re: Testing php code before posting on web server

Post by matthijs »

You can install a local webserver and test your code that way. On linux it should be easy. On windows there are packages like XAMPP which allow you to install the apache/mysql/php stack in one go.

If you're new to PHP it's advisable to post your code here before putting it on a live server, so that smart coders here can advice on improving the code, especially the security.
lhcpr
Forum Newbie
Posts: 10
Joined: Fri Jun 20, 2008 4:22 am

Re: Testing php code before posting on web server

Post by lhcpr »

Hi there Matt,

I appreciate your help very much!!! I have been using phpFormGenerator to do the hard work, but will need to change some of the code.

Will post when done.

Again - thanks heaps

Graham
User avatar
RobertGonzalez
Site Administrator
Posts: 14293
Joined: Tue Sep 09, 2003 6:04 pm
Location: Fremont, CA, USA

Re: Testing php code before posting on web server

Post by RobertGonzalez »

You're going to need a mail server to test mailing. You could hook into your SMTP server from your ISP, but that is not really what you are going to want since your web server is not going to be the same more than likely (at least it shouldn't be).

If you are using Ubuntu, use the package manager to install sendmail and the let your local webserver rip. It should work out pretty well for you.
Post Reply