Jump to content

Recommended Posts

I use Frontpage to develop web sites as I own a legal copy - please don't answer this question with 'Get another editor', I know there are a lot better ones out there but I've used this for so long I know how to do everything I need to do.

 

Now for the problem -

I have the following code (PHP) which is in the middle of a large page of code

  <TD align="center">
   <input type="button"
     onclick="show_confirm('<?PHP echo $message ?>', 'village_remove', '<?PHP echo $villages_array[$i*5] ?>')"
     Value="Remove Village">
   </TD>

 

BUT if I change anything on the page (and I mean anything) and then re-save the page this section of the code simply disappears, and I mean literally disappears.

I have now got a back up in notepad that I do a quick cut and save from to replace the code each time this happens, but is there a way to stop it from happening?

please don't answer this question with 'Get another editor', I know there are a lot better ones out there but I've used this for so long I know how to do everything I need to do.

You mean except for the fact that you editor deletes code for no reason whatsoever? If Word just randomly droped content whenever you created a document would that be acceptable? I'm not going to say use another editor, but let's be honest. You are using FrontPage as a crutch. Although changing an editor is not a seamless experience, if you understand the code you are creating it is not thar difficult. You are relying upon FrontPage so you don't have to really understand/pay attention to the code. This is readily apparent by the fact that you did not state any tests you did to isolate the problem.

 

Anyway, I have never used FrontPage as it generates seriously bloated code. So, I can only offer some "shots in the dark" type suggestions based upon what I see. First - as a test - try replacing the PHP code in that block with some dummy values to check and see if it is the php code that is causing the problem. If not, then it is something to do with the HTML. If that is the cae I would guess there is something about the table structure that is a problem. If it is the PHP coed, then I would try two things. 1) Reformt the php code. Although it should run fine, I would use lowercase 'php' for the opening tag and put a semi-colon at the end of the code. 2) Create a php variables for the second value instead of doing the calculation for the index within the index identifier.

 

Again, making an assumption that the PHP code is to blame, this is what I would try

<?php
$index = $i*5;
$village = $villages_array[$index];
?>
  <TD align="center">
   <input type="button"
     onclick="show_confirm('<?php echo $message; ?>', 'village_remove', '<?php echo $village; ?>')"
     Value="Remove Village">
   </TD>

 

Also, you should use another editor (ok, I lied before when I stated I wouldn't say that)

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.