Jump to content

alpine

Members
  • Posts

    759
  • Joined

  • Last visited

Everything posted by alpine

  1. $num=mysql_numrows($result); $num2=mysql_numrows($result2); $num=mysql_num_rows($result); $num2=mysql_num_rows($result2);
  2. What you are doing is allowing an img src from another location, not uploading THE image to YOUR server - so the easiest way for you is probably to solve it in CSS by adding an image class and setting max-width #bbcode img { max-width: 480px; }
  3. I think you are over complicating this, here is another example on how you could run a post data check, should give you a pointer on how to do it a little easier - it is far from complete but thats not the point. <?php if(isset($_POST['submit']) || isset($_POST['preview'])){ $req = array("name", "email"); foreach($_POST as $key => $value){ if(in_array($key, $req) && empty($value)){ $err_empty[] = $key." is blank"; } ${$key} = $value; // Note that this is raw value not suited for direct db insert } if(!empty($err_empty)){ $err_msg = "Following failed:"; $err_msg .= "<ul><li>"; $err_msg .= implode("</li><li>", $err_empty); $err_msg .= "</li></ul>"; echo $err_msg; } else{ // treat data based on preview or save } } // show form and use posted values ?>
  4. Something like this should work on resetting the file when reached 1000 lines <?php $lines = file('path/file.txt'); if(count($lines > 1000)){ file_put_contents('path/file.txt', $randomEntry); } else{ file_put_contents('path/file.txt', $randomEntry, FILE_APPEND); } ?>
  5. Dont matter, i think its a total evaluation of many factors - but i think its time -to spend time -designing and optimizing for modern browsers rather than dealing with an outdated browser aswell. Thumbs up from me.
  6. well - looks like one of the big ones decided to stop supporting IE6, that might finally be a step towards the end of this IE6 stuff.... [attachment deleted by admin]
  7. already have that one, and have always used it - until now. Why should i use many (many! for me anyhow) hours working with css hacks for IE6 - and for nothing... i mean, its time to ditch IE6 imo. A proper message for IE6 users will do this time When looking on the stats for another website i have, its the minority still running IE6 while most are on IE7, FF or Opera -and IE8 striking by. I wonder for how much longer horrible hacks for IE6 will continue.... Anyhow - this post was just to get some more oppinions on this, so hit me!
  8. Should i bother on a non profit service ? I've decided not to in this case. If i was to make money on it i would perhaps have to think twice - i agree. If more web developers ditched support for IE6 it would modernise the browsers faster, without doubt. Problem is that as long as the IE6 users have full functionality they see no reason for upgrading to a newer IE or changing to another browser. I still make sure it works in FF, IE7+ and Opera.
  9. I am currently building a web service (automotive data storage), open for anyone that wants to use it. I am working with CSS layout, and i dont bother adapting it to IE6 simply because i think its time to move on plus the fact that my CSS knowledge is intermediate - so all this hacks seems hopeless. It ain't critical to support IE6 in this particular web site, if you dont want to use a modern browser then don't use my web site service - so to speak What are the general oppinion on ditching IE6 support ?
  10. Either you set different form actions on each form, or use a common page to send the user depending on where you want them to go, example <?php // login_router.php session_start(); if(isset($_POST['submit'])){ $_SESSION['area'] = $_POST['destination']; switch ($_POST['destination']){ case 'area1': header('Location: http://www.example.com/area1.php'); break; case 'area2': header('Location: http://www.example.com/area2.php'); break; default: header('Location: http://www.example.com/area.php'); } } ?> <!-- One of the tabbed pages form --> <form action="login_router.php"> <input type="hidden" name="destination" value="area1" /> <!-- or use a select drop down or whatever --> <input type="submit" name="submit" value="Log in" /> </form>
  11. But it will make search engines incapable of indexing these lines.
  12. <?php echo date('d/m l', strtotime('12/1/2009')); ?>
  13. Depending on what level of protection you want on it, something simple might do what you need - but its not bullet-proof on this level <?php if(!isset($_POST['formdata'])){ die("You cannot access this page without posting from form"); } if($_POST['formdata'] <> "some access value"){ die("Submitted data does not give access"); } // Page content continues here ?>
  14. Another one <?php $chars = "abcdefgh"; if(in_array(strlen($chars),range(20,200))){ echo "OK - between 20 - 200 chars"; } else{ echo "Fail - too low or too high"; } ?>
  15. or if you need to remove only if "," on the end <?php $string = ".jpg,"; substr($string, -1) == "," ? $string = substr($string, 0, -1) : $string = $string; echo $string; ?>
  16. CSS isnt my strong side, and havent been touching it for a few years. Problem is that the next data row (or data header) doesnt appear where the last one stopped, its a gap between. Probably due to some divs taking space even if they are adjusted upwards. So, any tips on how to improve or correct this ? <style type="text/css"> .checklist_data_container{ position: absolute; top:0; left:0; width: 100%; background-color: #ddd; } .checklist_data_heading{ position: relative; width: 100% height: 30px; background-color: blue; } .checklist_data_text{ position: relative; width: 100%; height: 60px; background-color: green; } .checklist_data_options_container{ position: relative; top: -60px; left: 80%; width: 20%; height: 60px; background-color: yellow; } .checklist_data_options_text{ position: relative; height: 20px; text-align: left; background-color: grey; } .checklist_data_options_input{ position: relative; height: 20px; top: -60px; left: 50%; width: 50%; background-color: purple; } .checklist_data_input_options{ position: relative; min-height: 10px; top: -60px; text-align: left; background-color: pink; } </style> <div class="checklist_data_container"> <!-- new header for data rows --> <div class="checklist_data_heading">Heading</div> <!-- new data row --> <div class="checklist_data_text">Text</div> <div class="checklist_data_options_container"> <div class="checklist_data_options_text">text klikk</div> <div class="checklist_data_options_text">text klikk</div> <div class="checklist_data_options_text">text klikk</div> <div class="checklist_data_options_input">KLIKK</div> <div class="checklist_data_options_input">KLIKK</div> <div class="checklist_data_options_input">KLIKK</div> </div> <div class="checklist_data_input_options">hidden fields</div> <!-- new data row --> <div class="checklist_data_text">Text</div> <div class="checklist_data_options_container"> <div class="checklist_data_options_text">text klikk</div> <div class="checklist_data_options_text">text klikk</div> <div class="checklist_data_options_text">text klikk</div> <div class="checklist_data_options_input">KLIKK</div> <div class="checklist_data_options_input">KLIKK</div> <div class="checklist_data_options_input">KLIKK</div> </div> <div class="checklist_data_input_options">hidden fields</div> <!-- new header for data rows --> <div class="checklist_data_heading">Heading</div> <!-- new data row --> <div class="checklist_data_text">Text</div> <div class="checklist_data_options_container"> <div class="checklist_data_options_text">text klikk</div> <div class="checklist_data_options_text">text klikk</div> <div class="checklist_data_options_text">text klikk</div> <div class="checklist_data_options_input">KLIKK</div> <div class="checklist_data_options_input">KLIKK</div> <div class="checklist_data_options_input">KLIKK</div> </div> <div class="checklist_data_input_options">hidden fields</div> <!-- new data row --> <div class="checklist_data_text">Text</div> <div class="checklist_data_options_container"> <div class="checklist_data_options_text">text klikk</div> <div class="checklist_data_options_text">text klikk</div> <div class="checklist_data_options_text">text klikk</div> <div class="checklist_data_options_input">KLIKK</div> <div class="checklist_data_options_input">KLIKK</div> <div class="checklist_data_options_input">KLIKK</div> </div> <div class="checklist_data_input_options">hidden fields</div> </div>
  17. Should handle several pitfalls $username = strtolower(join(str_replace(" ", "", array(substr(ltrim($firstname),0,1),substr(ltrim($middlename),0,1),ltrim($lastname)))));
  18. sorry - just put the final message below (outside) the foreach loop, its inside now.
  19. This is perhaps what you are asking for when using your current code if(isset($_POST['signupID'])) { $cheater = false; foreach($_POST['signupID'] as $item) { $sql = "SELECT pagestate FROM postcode WHERE postcodeID=$item"; mysql_query($sql) or trigger_error("SQL: $sql, ERROR: " . mysql_error(), E_USER_ERROR); $result = mysql_query($sql); $row2 = mysql_fetch_assoc($result); if($row2['pagestate'] === 'T') {$cheater = true;} else {everything is ok insert into database } } if($cheater == true){ echo "You have tried to cheat!"; } echo somestuff mail some stuff }
  20. I find it very hard to read, the colours makes it difficult to separate content from the surrounding layout. When looking at e.g. category listings, the main focus is given to the category (inside fieldset) (?) while the description sort of dissappears inbetween (?). Should be inverted IMO. In summary it just gives me too much headache trying to focus my eyes finding the stuff i would be looking for.
  21. alpine

    WebAXiSS

    When you are about to submit a new link, you are asked to add a generated meta-tag on the page you are submitting - sorry to say this but i doubt anyone at all would bother to do that (even if it is just for a one time validation or whatever..) Other than that i like the overall looks, still i find some problems in believing that this would appeal to the mass-submitting you would need in order for it to be even close to a handy search tool.
  22. Just remember the difference on html vs xhtml
  23. <?php $text = "Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua."; echo join(' ', array_slice (explode(' ', $text), 0, 10)); // where 10 is words to print out before cutoff ?>
×
×
  • 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.