Jump to content

[SOLVED] My php code is crashing...


vozzek

Recommended Posts

... Dreamweaver CS3  ::)

 

First off, yes, I know Dreamweaver is a big steaming pile of Mickey Mouse dog crap.  I was new when I bought it and I'm past that.

 

Second, I'm very new to php and my code probably sucks.  So please go easy on me, and I'm certainly open to alternate and better ways to do this.  The code below is all mine, meaning I wrote it from scratch and didn't use any Romper Room DW php builder to create it.

 

Quick rundown: I'm populating a detail page from my SQL database. If an option (for example "option_a") exists, I want the dropdown list to populate with all available selections for that particular option. An example for option_a would be 'Color', and the listbox selections (a1, a2, a3...) would be something like "blue", "green", or "red". The code is attached below:

 

<?php if (!empty($row_rs_detail['option_a'])) { ?>
  <label>
  <?php echo $row_rs_detail['option_a'].":"; ?>
  <select name=<?php echo $row_rs_detail['option_a']; ?> id=<?php echo $row_rs_detail['option_a']; ?>>
  
  <?php
   echo "<option selected='yes'>Please Select</option>";
   if (!empty($row_rs_detail['option_a1'])) {
      echo "<option>{$row_rs_detail['option_a1']}</option>";
   }
   if (!empty($row_rs_detail['option_a2'])) {
      echo "<option>{$row_rs_detail['option_a2']}</option>";
   }
   if (!empty($row_rs_detail['option_a3'])) {
      echo "<option>{$row_rs_detail['option_a3']}</option>";
   }
   ?>
   </select>
  </label>
<?php } ?>

 

DW is crashing the SECOND I close that </select> tag near the end.  I was wondering if anything in my php code should be causing this crash to happen.

 

The really strange thing is this was working for several weeks. All of a sudden, it doesn't work anymore. I wonder if there's a control character in there or something, or maybe I deleted an important character? Thanks in advance for the help.

 

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.