Skip to main content
Participant
November 21, 2007
Question

DW crashes when I use PHP and HTML

  • November 21, 2007
  • 1 reply
  • 299 views
Hi, I need to use PHP with DW to validate a form.

However, when I use PHP with HTML DW crashes. I use a PHP script to to select the correct radio button when the form is submitted (see below).

It works fine in the browsers and I can even edit in Notepad.

I am not sure how to solve this - I altered the DTD from strict to transitional (it didn't work). I am using the latest version of DW CS3.

Any ideas?


<dt>How did you find out about the site?</dt>
<dd>

<label for="how_did_you_find_out_about_the_site1">
<input name="how_did_you_find_out_about_the_site" id="how_did_you_find_out_about_the_site1" type="radio" value="Link_from_another site" <?php echo ($_POST["how_did_you_find_out_about_the_site"] == "Link_from_another site") ? "checked=checked" : "";?> />
Link from another site</label>
</dd>
<dd>
<label for="how_did_you_find_out_about_the_site2">
<input name="how_did_you_find_out_about_the_site" id="how_did_you_find_out_about_the_site2" type="radio" value="Read_about_it_in a_booklet_or_card" <?php echo ($_POST["how_did_you_find_out_about_the_site"] == "Read_about_it_in a_booklet_or_card") ? "checked=checked" : "";?> />
Read about it in a booklet/card</label>
</dd>
<dd>
<label for="how_did_you_find_out_about_the_site3">

<input name="how_did_you_find_out_about_the_site" id="how_did_you_find_out_about_the_site3" type="radio" value="Recommended_by_my tutor" <?php echo ($_POST["how_did_you_find_out_about_the_site"] == "Recommended_by_my tutor") ? "checked=checked" : "";?> />
Recommended</label>
</dd>
<dd>
<label for="how_did_you_find_out_about_the_site4">

<input name="how_did_you_find_out_about_the_site" id="how_did_you_find_out_about_the_site4" type="radio" value="Found_it_when_I_used_the_search" <?php echo ($_POST["how_did_you_find_out_about_the_site"] == "Found_it_when_I_used_the_search") ? "checked=checked" : "";?> />
Found it when I used the search</label>
</dd>
<dd>
<label for="how_did_you_find_out_about_the_site5">
<input name="how_did_you_find_out_about_the_site" id="how_did_you_find_out_about_the_site5" type="radio" value="Other" <?php echo ($_POST["how_did_you_find_out_about_the_site"] == "Other") ? "checked=checked" : "";?>/>
Other</label>

<label for="how_did_you_find_out_about_the_site6">(please specify)
<input name="how_did_you_find_out_about_the_site_specify" id="how_did_you_find_out_about_the_site6" type="text" value="<?php echo ($_POST["how_did_you_find_out_about_the_site"] == "Other") ? $_POST["how_did_you_find_out_about_the_site_specify"] : "";?>"/>
</label>
</dd>
This topic has been closed for replies.

1 reply

Inspiring
November 21, 2007
Steve84 wrote:
> Hi, I need to use PHP with DW to validate a form.
>
> However, when I use PHP with HTML DW crashes.

http://www.adobe.com/go/kb402776

--
David Powers, Adobe Community Expert
Author, "The Essential Guide to Dreamweaver CS3" (friends of ED)
Author, "PHP Solutions" (friends of ED)
http://foundationphp.com/
Participant
December 3, 2007
Thanks for the good solution. I first noticed DW CS3 crashing whenever I tried to open an ASP or PHP page that was data-driven on my desktop. I thought DW was corrupt on that computer and was hand editing those pages. Then, I noticed the same problem on my laptop. I thought that maybe it was a recent update that was causing the problems. It's good to find out a nice easy solution.