Jump to content

scottybwoy

Members
  • Posts

    532
  • Joined

  • Last visited

    Never

Everything posted by scottybwoy

  1. I don't really know whats going on here. My page looks fine in firefox, but when in IE6 it looks like blocks of nothing start rendering over the top of my text and other elements. especially when hovering over links and scrolling around. Can someone have a look at http://www.mri.co.uk/controllers/eSATA-4MCR.php in IE and ff if you can, and see if you can tell me whats going on, thanks.
  2. I don't really know whats going on here. My page looks fine in firefox, but when in IE6 it looks like blocks of nothing start rendering over the top of my text and other elements. especially when hovering over links and scrolling around. Can someone have a look at http://www.mri.co.uk/controllers/eSATA-4MCR.php in IE and ff if you can, and see if you can tell me whats going on, thanks.
  3. Simple question, How do I send a string to the url. Or just redirect to another page, withou having to install http pecl
  4. Hi REGEX Lords, I'd like to beautify my JSON files so it's a bit easier to read. json_encode and fwrite, just sticks it all on on line, so I'd like to add in some /n and /t to break it up a bit. So I thought once I've got my JSON encoded object I could use some preg_replace magic to do some stuff like changing { => {/n/t } => }/n : => " : " // But without the quotes, just wanted to space it out a bit , => ,/n // and would it be possible to have the cursor level to the line above it? Thanks for your help, this may be a good one to put up on some Regex libraries too, what do ya think
  5. An example of the output can be found here : http://www.mri.co.uk/controllers/eSATA-4MCR.php Bare in mind the header etc is not included it's just the content part of the page. It's also worth noting that it is placing 8 $vars and 2 $arrays
  6. This function is part of my template class... (Yeah, yeah, I know the arguments.. But this is for uploading to a flat file site). <? function ReplaceStatic($tcontent, $static_data) { foreach ($static_data as $k => $v) { if (is_array($v)) { $prefix = $k; $rowbegin = "<!--%" . $prefix . "_ROWBEGIN%-->"; $row_b_len = strlen($rowbegin); $startrow = strpos($tcontent, $rowbegin); $rowend = "<!--%" . $prefix . "_ROWEND%-->"; $row_e_len = strlen($rowend); $endrow = strpos($tcontent, $rowend) + $row_e_len; $rowlen = $endrow - $startrow; $row = substr($tcontent, $startrow, $rowlen); $subrowlen = ($endrow - $row_e_len) - ($startrow + $row_b_len); $row_content = substr($tcontent, $startrow + $row_b_len, $subrowlen); $nrow_content = "$row_content\r\n"; $rowsyntax = "<!--%" . $prefix . "_ROW%-->"; foreach ($v as $nv) { $rows .= str_replace($rowsyntax, $nv, $nrow_content); } $tcontent = str_replace($row, $rows, $tcontent); unset($rows); } else { $placeMat = "<!--%$k%-->"; $tcontent = str_replace($placeMat, $v, $tcontent); } } return $tcontent; } ?> Now the actual functionality works fine, however the returned $tcontent is repeated a number of times and when written to the file, comes out as so. Can anyone see why? Thanks
  7. I'm trying to upgrade from v5.1.4 to v5.2 on a WIN2K ADV SERVER with IIS6. What I did was replace the original folder and files with the new php directory, except for PEAR.bat and the PEAR Directory and then amended php.ini and restarted the Web Server. However running phpinfo(); still says its php 5.1.4 What else would I need to do?
  8. Would anyone like to answer stuffradio's question instead of bickering about particularities. You might save yourselves some time one day.
  9. You need to put quotes the other side of the % like : $getNames = mysql_query("SELECT * FROM person WHERE FullName like '%" . $find . "%'"); You can't use $vars within single 'quotes'
  10. A very basic method would be to just include a print type css for your html file. That way when you choose to print the html web page, it looks exactly how you styled it via css. You just use display: none; for the items on the page you don't want to print. Alternatively you can use very small pdf libs or classes (you can find a few on the web) that require very limited install procedures, if you don't want to download the pear library, which is generally more bulky but concise. Good luck
  11. Thanks, although I'm not too hot on js, how would I go about that?
  12. Ok if I have a div that has a variable width of 33%, can I make it so that the height of the div is what ever that size is? Like { width: 33%; height: width; }
  13. For left middle and right, try adding display:inline; and float:left; to all of them. Note how that works and work around that. You can then play around using that same style to the top and bottom one since the way you are making your grid. Good Luck
  14. How come sometimes a styles invoked via a class don't work, but when put in the style of the element they do? eg: element.class { right:5px; } //not working <element style='right:5px;' /> //working
  15. yes is will. so in your second class you need to offset the styles in the previous class. But it seems maybe you are using this for a layout. Use divs instead (search google for tableless layouts) Only use table for tabular data / grids from now on. Good luck
  16. OK have it working now anyone else had this trouble here is a working version. It's a mess I know, but if anyone has a better idea, please share. html <div class="menu"> <ul> <li style='left:-8px; width:16px; margin:0px; padding:0px; z-index:150;'><img src="http://www.mri.co.uk/header/mri_head_c.png" style='left:-11.9%; width:16px;' alt='navigation image' /></li> <li class='ff ie6'> <a class="r" href="http://www.mri.co.uk/news/index.htm" title='News'>News<!--[if IE 7]><!--></a><!--<![endif]--> <!--[if lte IE 6]><table style='top:0px; z-index:203;'><tr><td><![endif]--> <ul style='top:0px;' id='red'> <li style='width:100%; height:17px; z-index:203;'><img alt="" src='http://www.mri.co.uk/header/mri_head_r_up.png' style='width:16px; z-index:203;' class='ff ie6' /><img alt="" src='http://www.mri.co.uk/header/ru.gif' style='right:-2px; width:16px; z-index:203; margin:0px; padding:0px;' /></li> </ul> <!--[if lte IE 6]></td></tr></table></a><![endif]--> <img src='http://www.mri.co.uk/header/grey.gif' alt="" /> </li> <li> <a class="y" href="http://www.mri.co.uk/products/index.htm" title='Products'>Products<!--[if IE 7]><!--></a><!--<![endif]--> <!--[if lte IE 6]><table style='top:0px; z-index:203;'><tr><td><![endif]--> <ul style='top:0px;' id='yellow'> <li style='width:100%; height:17px; z-index:203;'><img alt="" src='http://www.mri.co.uk/header/yd.gif' style='left:1px; width:16px; z-index:203; margin:0px; padding:0px;' /><img alt="" src='http://www.mri.co.uk/header/yu.gif' style='right:-2px; width:16px; z-index:203; margin:0px; padding:0px;' /></li> <li><a href="http://www.mri.co.uk/products/Controllers/index.htm" title="Storage Controller Cards">Controller Cards ><!--[if IE 7]><!--></a><!--<![endif]--> <!--[if lte IE 6]><table><tr><td><![endif]--> <ul> <li><a href="http://www.mri.co.uk/products/Controllers/sata.htm" title="RAID and Non-RAID SATA Controllers">SATA</a></li> <li><a href="http://www.mri.co.uk/products/Controllers/scsi.htm" title="Ultra Wide SCSI Controllers">SCSI</a></li> <li><a href="http://www.mri.co.uk/products/Controllers/ide.htm" title="RAID and Non-RAID IDE Controllers">IDE</a></li> </ul> <!--[if lte IE 6]></td></tr></table></a><![endif]--> </li> <li><a href="http://www.mri.co.uk/products/InputOutput/index.htm" title="I/O Devices">I/O Devices ><!--[if IE 7]><!--></a><!--<![endif]--> <!--[if lte IE 6]><table><tr><td><![endif]--> <ul> <li><a href etc... css /* bitch hack */ li.ff { margin-left: 6px; } img.ff { left: 0px; } the rest is the same as above.
  17. I have half solved this issue. What I have done is created an extra <li> that goes over the initial <li>. This second <li> holds the images on either side, this gives the appearance I am looking for. However it only half works in IE 6. Can anyone tell me why that is and how I can get around it. Here is the html : <ul> <li> <img name="mri_head_r2_c2" src="http://www.mri.co.uk/header/mri_head_c.png" style='left:-11.9%; width:16px;' id="mri_head_r2_c2" alt='navigation image' /> <a class="r" href="http://www.mri.co.uk/news/index.htm" title='News'>News</a> <!--[if lte IE 6]><table><tr><td><![endif]--> <ul style='top:0px;' id='red'> <li style='width:100%; height:17px;'><img alt="" src='http://www.mri.co.uk/header/mri_head_r_up.png' style='left:6px; width:16px; z-index:203; margin:0px; padding:0px;' /><img alt="" src='http://www.mri.co.uk/header/ru.gif' style='right:-2px; width:16px; z-index:203; margin:0px; padding:0px;' /></li> </ul> <!--[if lte IE 6]></td></tr></table></a><![endif]--> <img name="tab1" src='http://www.mri.co.uk/header/grey.gif' alt="" /> </li> <li> <a class="y" href="http://www.mri.co.uk/products/index.htm" title='Products'>Products<!--[if IE 7]><!--></a><!--<![endif]--> <!--[if lte IE 6]><table><tr><td><![endif]--> <ul style='top:0px;' id='yellow'> <li style='width:100%; height:17px;'><img alt="" src='http://www.mri.co.uk/header/yd.gif' style='left:1px; width:16px; z-index:203; margin:0px; padding:0px;' /><img alt="" src='http://www.mri.co.uk/header/yu.gif' style='right:-2px; width:16px; z-index:203; margin:0px; padding:0px;' /></li> <li><a href="http://www.mri.co.uk/products/Controllers/index.htm" title="Storage Controller Cards">Controller Cards ><!--[if IE 7]><!--></a><!--<![endif]--> <!--[if lte IE 6]><table><tr><td><![endif]--> etc... As you can see the first one is a bit different from the second, however the rest are the same. And the css: .menu { position: relative; width: auto; height: auto; margin: 0px 140px 0px 192px; padding: 0px; font-family: arial, sans-serif; text-align: center; vertical-align: middle; font-size: 9pt; z-index: 100; } /* remove all the bullets, borders and padding from the default list styling */ .menu ul { position: relative; padding: 0px; margin: 0px; list-style-type: none; } /* float the list to make it horizontal and a relative positon so that you can control the dropdown menu positon */ .menu ul li { position: relative; float: left; width: 11.9%; margin-right: 15px; font-weight: bold; } /* style the links for the top level */ .menu a, .menu a:visited { display: block; height: 17px; background-image: url(http://www.mri.co.uk/header/greyd.gif); text-align: center; color: #c00; font-size: 9pt; text-decoration: none; overflow: hidden; } /* hide the sub levels and give them a positon absolute so that they take up no room */ .menu ul ul { visibility: hidden; position: absolute; top: 0px; left: -16px; width: 110px; } .menu ul ul li { display: block; clear: both; } Thanks for having a look
  18. You've got the idea, however I am using 1024 x 768 screen res and your site is too big. Tested in FF
  19. OK let me narrow this down. I have a list + css type nav. When the mouse rolls over the anchor of the list I want it to change 3 images. One to the left, one to the right and all in the middle. I have this working with Javascript, is there a way to do it purely in css? Please look at the horizontal nav on this page [link]http://www.mri.co.uk/company-info/terms-of-business2.htm[/link] for an example. Would it be done using layers?
  20. Lol, Thanks Roopurt18, That's great advise, I suppose I should have just gone on with that myself. I do however would like to know if this is common place. I have two switches in my handling class. One that deals with _GET data from various hrefs and generally just present the correct template. Then another that deals with buttons, and that usually opens up a script, which then displays the correct template after doing something. Would it be better to just use buttons, styled to look like anchors (except when u do actually want an anchor)? And is the scenario I'm using at the mo common?
  21. I think your half way to getting on the right track. I'm probably not the best person to answer your question either. I haven't really coded in C++ so can't point out the differences. I can however pick out where I think you are going wrong. You don't need to use sessions, until you want something to be available throughout the script, like userdata, a cart perhaps, the users level of admission etc. You would only need to force users to a point of entry script, if you needed them to do anything there i.e log in. My current framework does pretty much what you said in your 2nd point. Since everything pretty much relates to an index.php, thats a good way to start. A benefit of that is passing users directly to securer areas of you directory, without having them specifically executing the file. Also if you look at the URI for this thread you can see that the way you got here, was one being passed to the relevant index.php which was given a $_GET handle and id file so that it can be easily accessed and sought via google etc. Generally you must always control the $_GET data and it should be intrinsic to your framework. All the other data that that is sent via $_POST and is user inputted, should go through some sort of validation and serialisation methods to stop your script from being broken or security breached. I think that should send you on your way a little. But maybe someone else can elaborate more or give sum basic examples. Good Luck and happy coding
  22. Hmm, not sure if you understood what I mean. I do that anyway. But I suppose thats what I'm trying to do in the case laid out below... Basically, for passing $vars between methods in different classes I use globals. This can become messy especially when trying to work out whats available to what. Especially when stuff gets passed thought one method to get to another, which I don't think return can be useful here. Also I usually have it set up so that my form data is usually passed through a handler class that passes data onto child classes. Which generally handles through switches. Is there a better way about going about that?
  23. Hi, I don't mean to hijack this thread, but my question's are somewhat similar to kratsg. I have been programming for about a year, and pretty much just jumped straight into OOP, I don't really understand why you wouldn't. I have been making myself a framework over the course of stuff I've done and notice I use globals allot and that it can become messy and sometimes difficult to see what belongs to what. Generally all my php files are classes and I use a function at the bottom to call a process function. I generally have a central class with all the main functions I use everywhere and I usually have a class sorts out what is displayed to the user. Then all other classes are called by sorting class and do various things. What my question is, is what is the best way to be passing information around instead of having lot's of globals and particularly in reference to when a button in a template is pressed? I hope this makes sense, if not I can post some examples of my shoody programming skills to help explain. Thanks
×
×
  • 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.