Jump to content

RobinTibbs

Members
  • Posts

    32
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

RobinTibbs's Achievements

Member

Member (2/5)

0

Reputation

  1. i aint to php genius either butttt i think its because you are using OR and maybe the brackets around the $_POST things could be affecing it. rather than OR, try | since that is the correct comparison operator to use, i think hope that helps so (($_POST["name"] == "") OR ($_POST["email"] == "") OR ($_POST["telNum"] == "")) would become ($_POST["name"] == "" | $_POST["email"] == "" | $_POST["telNum"] == "")
  2. thanks to you all, going to go with the ucwords but i've also noted down the other solutions just for reference.
  3. ok basically this function is meant to capitalise text properly, so given "HELLO THERE" it should return "Hello There". however what is being returned is "hello there". what am i missing? many thanks. code is probably big mess ^^ function prettyfyText($text){ $text = strtolower($text); $explode = explode(" ", $text); $i = 0; while($i < count($explode)) { $string = str_split($explode[$i]); $idx = 0; while($idx<count($string)){ if($idx == 0) { $string[$idx] = strtoupper($string[$idx]); } $idx++; //echo $string[0]." ".$string[1]."<br />"; $nice = implode("", $string); } $blah = implode(" ", $explode); $i++; } echo $blah; } // end function prettyfyText
  4. is there a definitive method for detecting the javascript version or is it a matter of finding a list of what browsers support which js version?
  5. function detectDotNet() { $agentstring = "Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; .NET CLR 1.1.4322; .NET CLR 2.0.50215)"; preg_match_all("%(.NET CLR)[ ]([0-9.]+)%", $agentstring, $matches); echo $matches; } trying to grab the number after the .NET CLR, but nothing is being captured, hohum!
  6. you must live and breathe regex thank you once again
  7. since i am perhaps totally suicidal or w/e im copying/pastin user agent strings from a website and using them to test my detection methods. however when i copy and past the lines, theres always a * (since i'm copying from a list). what i want to do is read in a text file containing these pasted strings (already know how to do this) then strip the * and any whitespace is this possible? many thanks
  8. Ok basically, when i program in Java i like to use the Javadoc tool to document my code. i was just wondering if there was an equivalent for php or some third party solution? many thanks, and sorry if this is wrong forum :)
  9. the problem here is that the echo statements appear to echo twice, even though there is only (currently) one row in the table. any ideas? many thanks. [code]$query = "SELECT name, version FROM browsers WHERE agentstring='$agentstring'";     $result = mysql_query($query)         or die ('Query failed: '.mysql_error());             while($row = mysql_fetch_array($result, MYSQL_ASSOC)) {         foreach($row as $value) {             if($bname = $value[1]) {                 echo "This string appears to be correct<br />";             }             else {                 echo "Something wrong here!";             }         }     }[/code]
  10. ok heres the 411 ( or w/e these kids say nowadays ). in all their wisdom, Apple put the safari build numbers in the UserAgent string rather than the actual version numbers, but thankfully they have a table up on their developer site detailing which build numbers refer to which version numbers. to this extent i made this function: [code]function getSafariVersion($buildstring) {   if($buildstring == "419.3") {       return "2.0.4";   }    elseif($buildstring == "417.9.3" | $buildstring == "417.9.2" | $buildstring == "417.8") {       return "2.0.3";   }   elseif($buildstring == "416.13" | $buildstring == "416.12") {       return "2.0.2";   }   elseif($buildstring == "412.5") {       return "2.0.1";   }   elseif($buildstring == "412.2.2" | $buildstring == "412.2" | $buildstring == "412") {       return "2.0";   }   elseif($buildstring == "312.6" | $buildstring == "312.5") {       return "1.3.2";   }   elseif($buildstring == "312.3.1" | $buildstring == "312.3") {       return "1.3.1";   }   elseif($buildstring == "312") {       return "1.3";   }   elseif($buildstring == "125.12" | $buildstring == "125.11") {       return "1.2.4";   }   elseif($buildstring == "125.9") {       return "1.2.3";   }   elseif($buildstring == "125.8" | $buildstring == "125.7") {       return "1.2.2";   }   elseif($buildstring == "100.1") {       return "1.1.1";   }   elseif($buildstring == "100") {       return "1.1";   }   elseif($buildstring == "85.8.1" | $buildstring == "85.8") {       return "1.0.3";   }   elseif($buildstring == "85.7") {       return "1.0.2";   }   elseif($buildstring == "85.5") {       return "1.0";   } }[/code] was just wondering if there was a more efficient way of going about it? hmm. many thanks in advance
  11. ah perfect! thanks! i tried something similar but that wasn't quite it :)
  12. [code] %($browser)[ /]([\d.]+[\w.]+)%[/code] the intention of this pattern is to get the browser name and version number. now it works fine when the version number has just numbers and periods, but if there are letters (perhaps to designate beta versions) then the pattern doesnt get the version number correctly. so im looking for a way to modify [b]this[/b] [code]([\d.]+[\w.]+)[/code] part of the pattern so it will capture any version number with just numbers and periods + any version with numbers, dots and letters. many thanks
  13. the 'trim' function could get rid of the spaces and any extra characters if that is part of the problem? hope that helps
  14. thats worked great thanks, the "margin: 0 auto;" in the 'wrapper' css is the 0 for the top/bottom margins then?
×
×
  • 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.