Jump to content

johnny44

Members
  • Posts

    28
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

johnny44's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Ya, that does work. Enclosing the image itself within a div. Thanks a bunch, mate.
  2. When I float an image to the left or right within a div, I get an unwanted margin of 1px where the image meets the side of the div. If I don't float the image, there is no margin. This happens in IE. The attached screenshot shows the exact problem, where I used this css: div{ background: white ; width: 300px ; height: 175px; padding: 0px ; } and this html: <div><img src="photo.jpg" width="250" height="175" style="float:none" /></div> <br/> <div><img src="photo.jpg" width="250" height="175" style="float:left" /></div> <br/> <div><img src="photo.jpg" width="250" height="175" style="float:right" /></div> Please see the screenshot. The yellow arrows show the unwanted margins. Is my css in error? How do I remove the unwanted margins in IE? (It's fine in Firefox.) [attachment deleted by admin]
  3. Sorry, don't understand the question. If no username is posted, isn't the header committed, rather than omitted?
  4. When rmsloginverify.php is called, the header to redirect to rmslogin.php is laid down, since $username is not set. But the script carries on, since no exit command has been declared. And since $loginname and $loginpassword are incorrect, the second header to redirect to rms.php is ignored. So, at the end of the script, you are redirected to rmslogin.php, as per the first header that was laid down. On the other hand, if $loginname and $loginpassword are correct, the second header is successfully laid down and overrides the first header. So you are taken to rms.php instead.
  5. In the second file, placing: exit; immediately after header("location:rmslogin.php"); would generate the behaviour that you were expecting. The lack of the exit command is what generates the behaviour that you are actually seeing. But someone correct me if I'm wrong.
  6. An inline frame is just a window (somewhere within your page) onto some other page. Try this out and you will see what I mean: <table style="width:100%"> <tr> <td style="width:33%">column one</td> <td style="width:33%"><iframe src="http://www.google.com" style="width:100%"></iframe></td> <td style="width:33%">column three</td> </tr> </table> The inline frame lies in the middle column, and is a window onto google's homepage. But of course you can just change the src value to any other page you like, e.g., one of your other pages. If you can work with this, it is easy to grasp, but I don't know what your aim is. I don't normally work with frames, I must confess, so I may be the wrong person to guide you here.
  7. You can actually put <a name="blah"> at the very top of the page, above the graphics and text. But if the javascript works for you, go for it. A third option is simply to link to the page itself, so the whole page just reloads all over again. -but not if your page takes a long time to load. Okay, I can't help with this then. I was thinking of an inline frame, which you can certainly lodge within a pair of <td> ... </td> tags, but you may have something else in mind.
  8. Just put <a name="blah"> at the top of your page. (More generally, anywhere you like.) And then, anywhere else on your page, clicking this: <a href="#blah"> Click here </a> will take you there. As for frames, I'd make three columns in the table, and simply put the frame in the middle one.
  9. Change <td> to <td valign="top"> for the first column in your table. In fact, do it for both columns.
  10. You're using an image as your submit button, but you can't do it your way: <a href='register.php?action=register'><img src='images/signup.png' width='150' height='30' border='0' /></a> That's just a hyperlink. No wonder no variables are going through. You need this as your submit button: <input type='image' src='images/signup.png' width='150' height='30' border='0' />
  11. Gotcha, thanks! $output = number_format( $output , 2 , "." , "" );
  12. This converts fractions to decimals, rounded to two decimal places. But with fractions like 8/2 or 21/10, the outputs are 4 and 2.1, whereas I need 4.00 and 2.10. Need two decimal places always. $numerator = 8; // say $denominator = 2; // say $output = round ( ($numerator/$denominator) , 2 ); echo $output; This outputs 4, but I need 4.00. I can get this done indirectly: $array = explode( "." , $output ); $n = strlen( $array[1] ); if( $n == 0 ){ $output = $output . ".00"; } elseif( $n == 1 ){ $output = $output . "0"; } elseif($n == 2 ){ } echo $output; But this strikes me as being totally ridiculous. Is there a straightforward function I could use to ensure that output is always expressed to two decimal places? Numerator and denominator will vary, but are always positive integers.
  13. Avoid the capture. Good, good, good. Thanks Effigy.
  14. Gosh, thanks Orio. Much appreciated !!
  15. I want to replace all plain text apostrophe's ( ' ) in a certain string with the html variant ( ’ ). The apostrophes invariably come before letters like s, t and d. This code works fine: $blah = str_replace( "'s" , "’s" , $blah ); $blah = str_replace( "'t" , "’t" , $blah ); $blah = str_replace( "'d" , "’d" , $blah ); ... but I trying to learn preg_replace. Nothing I have tried works. The closest I got is this: $blah = preg_replace( "/'[a-z]/" , "’$0" , $blah ); but this just adds the html apostrophe without removing the plain one. Can anyone show me what would work?
×
×
  • 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.