I have a question that is kind of complex to answer but hopefully someone will understand where I am coming from.

I have been developing PHP with dreamweaver for a while. Usually simple ticket systems or simple record keeping pages. I have been contracted to do a project where the owner of the site is clear that it will be a learning curve for me.

I have used Dreamweaver to do the basics of the site and then i switch to code view and add the things DW doesnt do, such as If/Else statemnts to display a different row color depending on a certain field, or send emails.

Where I get lost or confused is how do I know what is the best way to accomplish something. For example, this system is for students to sign up for a class. Once they register, they get an email. What is the best way to do the email? right now i have a page that has the script to send the email and to a PHP Include to the page that thanks them for the registration. However if they hit refresh or back it resends the email. This cant be the best way to do this?

Also once the record is submitted I do a select statement showing only records from their login name and sorting by descending order to pull the information they just submitted. This works, but again, this cant be the best way to accomplish this.

in PHP is it safe to say if it works, its fine?

How do I move on from here. My next project is a directory of courses, and uses adsense so it has to be great with SEO.

Is it ok to keep using dreamweaver? How do I learn more about PHP?

A little bit of pseudocode:


Basically, have the mail() function triggered after something actually gets processed in PHP, and not on a page visit.

Dreamweaver isn’t causing the issue.

Thanks for the reply.
Definitely aware that Dreamweaver isnt the issue. Just wondering what is the recommended way to go from here. I want to do more advanced things. I know Dreamweaver is just an editor but the code it uses to do record sets, etc, is that ok? in other words, is it considered amateur to use Dreamweaver?

I dont really call myself a PHP Programmer just because i still use Dreamweaver, even though I can decipher the code and find out what its doing and im fully capable of writing an application that will do most things a customer requires.

When i search books on learning PHP, they really dont discuss in great detail the web app side of things. They say how to send an email but dont mention it pulling information from the DB. Just for a contact us form.

Do you know of any good resources that will discuss web application building as a whole instead of just PHP?

Well, to extend FF’s pseudocode just a little bit. Presumably if the website is storing registrations for students in the class, a student cant register for the same class twice. So maybe check the database for if the student is already registered. If so, dont send the email again.

And personally, if I were you (you said you can extrapolate what code is doing, which is a good skill to have)… take a look at the PHP manual. Pull up a ‘chapter’ page like… [FPHP]array[/FPHP] or [FPHP]mysql[/FPHP], and just look at the list of functions. It should give you a good idea of ‘whats out there to use’.

Dreamweaver is typically used for design work, rather than web app development, but the two can cross over when you have PHP code in the front-end.

For PHP development, most folks either just use a variant of notepad (such as notepad++), or an IDE (integrated development environment) such as eclipse PDT or Netbeans.

As for books…maybe look over some of the things that [=php&filters[difficulty]=&simpleform_submit_marker=showme"]sitepoint has available]([tag). Beyond that, I’m not sure what to suggest.

However, for a good introduction to PHP, I can recommend this one:

Although, I’d suggest skipping the first couple of chapters on how to set up & configure a server–it’s confusing.

Just finished documenting a new toolkit. Part of that documentation includes an example of “best practices” in terms of form handling scenarios such as yours. You have a form on a page, then the user submits that form. I like to loop the form back on itself so that any errors can be easily corrected. Then, if everything is successful, redirect the user to a new page so they can’t just hit reload to submit the same information a second time.

Here’s the documentation in case you are interested in seeing the full example (178 lines of PHP and HTML):

Ultimate E-mail Toolkit Documentation