PHP - How To Do Perfect Browser Simulation?
Hi,
I am using Snoopy class to read contents of a web page. But it doesn't perfectly simulate the browser because the content of web page changes when I use Snoopy to fetch it. And if I view it in browser directly then content is different. I even set the user agent string in Snoopy but still no luck. How can we perfectly simulate browser so it is indistinguishable whether we are using some script or a browser to view web page? Thanks Similar TutorialsHi I am still learning PHP and have a project due. I haven't had any PHP classes so I am struggling with this project. It is suppose to be a text only output pinball simulation. It calculates the players skill level randomly, there are 4 bumpers and for banks, it calculates how many times each bumper and bank is hit and calculates the score outputting all info in text no formatting. My code looks like it should work but doesn't output correctly and I can't figure out way. Here is the output : Notice: Undefined variable: skillLevel in C:\xampp\htdocs\pinball.php on line 39 Notice: Undefined variable: skillLevel in C:\xampp\htdocs\pinball.php on line 39 Notice: Undefined variable: skillLevel in C:\xampp\htdocs\pinball.php on line 42 Notice: Undefined variable: skillLevel in C:\xampp\htdocs\pinball.php on line 42 Notice: Undefined variable: skillLevel in C:\xampp\htdocs\pinball.php on line 45 Notice: Undefined variable: skillLevel in C:\xampp\htdocs\pinball.php on line 45 Notice: Undefined variable: skillLevel in C:\xampp\htdocs\pinball.php on line 48 Notice: Undefined variable: skillLevel in C:\xampp\htdocs\pinball.php on line 48 Notice: Undefined variable: skillLevel in C:\xampp\htdocs\pinball.php on line 51 Notice: Undefined variable: skillLevel in C:\xampp\htdocs\pinball.php on line 51 Notice: Undefined variable: skillLevel in C:\xampp\htdocs\pinball.php on line 54 Notice: Undefined variable: skillLevel in C:\xampp\htdocs\pinball.php on line 54 Welcome To God Mode! Ball Launched! Notice: Undefined variable: skillLevel in C:\xampp\htdocs\pinball.php on line 64 Bumper 4 Hit. Bumper 2 Hit. Bank 2 Hit! Notice: Undefined variable: bank2 in C:\xampp\htdocs\pinball.php on line 441 Damn You Suck!!!! Notice: Undefined variable: bank1 in C:\xampp\htdocs\pinball.php on line 905 Notice: Undefined variable: bank1Pegs in C:\xampp\htdocs\pinball.php on line 907 Notice: Undefined variable: bank1 in C:\xampp\htdocs\pinball.php on line 905 Notice: Undefined variable: bank1 in C:\xampp\htdocs\pinball.php on line 905 Notice: Undefined variable: bank1 in C:\xampp\htdocs\pinball.php on line 905 Notice: Undefined variable: bank1 in C:\xampp\htdocs\pinball.php on line 905 Notice: Undefined variable: bank1 in C:\xampp\htdocs\pinball.php on line 905 Notice: Undefined variable: bank2 in C:\xampp\htdocs\pinball.php on line 913 Notice: Undefined variable: bank2Pegs in C:\xampp\htdocs\pinball.php on line 915 Notice: Undefined variable: bank2 in C:\xampp\htdocs\pinball.php on line 913 Notice: Undefined variable: bank2 in C:\xampp\htdocs\pinball.php on line 913 Notice: Undefined variable: bank2 in C:\xampp\htdocs\pinball.php on line 913 Notice: Undefined variable: bank2 in C:\xampp\htdocs\pinball.php on line 913 Notice: Undefined variable: bank2 in C:\xampp\htdocs\pinball.php on line 913 Notice: Undefined variable: bank3 in C:\xampp\htdocs\pinball.php on line 921 Notice: Undefined variable: bank3Pegs in C:\xampp\htdocs\pinball.php on line 923 Notice: Undefined variable: bank3 in C:\xampp\htdocs\pinball.php on line 921 Notice: Undefined variable: bank3 in C:\xampp\htdocs\pinball.php on line 921 Notice: Undefined variable: bank3 in C:\xampp\htdocs\pinball.php on line 921 Notice: Undefined variable: bank3 in C:\xampp\htdocs\pinball.php on line 921 Notice: Undefined variable: bank3 in C:\xampp\htdocs\pinball.php on line 921 Notice: Undefined variable: bank4 in C:\xampp\htdocs\pinball.php on line 929 Notice: Undefined variable: bank4Pegs in C:\xampp\htdocs\pinball.php on line 931 Notice: Undefined variable: bank4 in C:\xampp\htdocs\pinball.php on line 929 Notice: Undefined variable: bank4 in C:\xampp\htdocs\pinball.php on line 929 Notice: Undefined variable: bank4 in C:\xampp\htdocs\pinball.php on line 929 Notice: Undefined variable: bank4 in C:\xampp\htdocs\pinball.php on line 929 Notice: Undefined variable: bank4 in C:\xampp\htdocs\pinball.php on line 929 Notice: Undefined variable: score in C:\xampp\htdocs\pinball.php on line 946 Notice: Undefined variable: bumper1Hits in C:\xampp\htdocs\pinball.php on line 951 Notice: Undefined variable: bumper2Hits in C:\xampp\htdocs\pinball.php on line 952 Notice: Undefined variable: bumper3Hits in C:\xampp\htdocs\pinball.php on line 953 Notice: Undefined variable: bumper4Hits in C:\xampp\htdocs\pinball.php on line 955 GAME OVER! Your Sco Number Of Pegs Left In Bank 1: 6; Number Of Pegs Left In Bank 2: ; Number Of Pegs Left In Bank 3: 6; Number Of Pegs Left In Bank 4: 6; Number Bumper 1 Hit: Number Bumper 2 Hit: Number Bumper 3 Hit: Number Bumper 4 Hit: Refresh Page To Play Again! Here is the code: Code: [Select] <?php $score; $bank1PegsNotHit; $bank2PegsNotHit; $bank3PegsNotHit; $bank4PegsNotHit; $bumper1Hits; $bumper2Hits; $bumper3Hits; $bumper4Hits; $skillLevel = 2 - (getRandom() * 0.01); $bank1[0] = true; $bank1[1] = true; $bank1[2] = true; $bank1[3] = true; $bank1[4] = true; $bank1[5] = true; $bank2[0] = true; $bank2[1] = true; $bank2[2] = true; $bank2[3] = true; $bank2[4] = true; $bank2[5] = true; $bank3[0] = true; $bank3[1] = true; $bank3[2] = true; $bank3[3] = true; $bank3[4] = true; $bank3[5] = true; function launch() { $player; switch ($skillLevel) { case $skillLevel < 1.1: $player = " First Timer"; break; case $skillLevel < 1.2: $player = " Beginer"; break; case $skillLevel < 1.3: $player = " Regular"; break; case $skillLevel < 1.4: $player = " Advanced"; break; case $skillLevel < 1.5: $player = " Pro"; break; case $skillLevel < 1.6: $player = " Olympic "; break; default: $player = " God "; break; } echo "Welcome To<strong>$player</strong>Mode!<br />Ball Launched!<br /><br />"; switch ($i = $skillLevel * getRandom()) { case $i <= 5: hole(); break; case $i <= 20: flipper(); break; case $i <= 25: bumper4(); break; case $i <= 30: bumper3(); break; case $i <= 65: bumper1(); break; default: bumper4(); break; } } function bumper1() { global $score; $score+= 100; global $bumper1Hits; $bumper1Hits += 1; echo "<br />Bumper 1 Hit."; switch ($i = getRandom()) { case $i <= 25: bumper2(); break; case $i <= 50: bumper3(); break; case $i <= 60: bumper4(); break; case $i <= 70: bank1(); break; case $i <= 75: bank2(); break; case $i <= 80: bank3(); break; case $i <= 95: flipper(); break; default: hole(); break; } } function bumper2() { global $score; $score+= 100; global $bumper1Hits; $bumper1Hits += 1; echo "<br />Bumper 2 Hit."; switch ($i = getRandom()) { case $i <= 25: bumper1(); break; case $i <= 35: bumper3(); break; case $i <= 60: bumper4(); break; case $i <= 65: bank1(); break; case $i <= 75: bank2(); break; case $i <= 80: bank4(); break; case $i <= 95: flipper(); break; default: hole(); break; } } function bumper3() { global $score; $score+= 500; global $bumper1Hits; $bumper1Hits += 1; echo "<br />Bumper 3 Hit."; switch ($i = getRandom()) { case $i <= 25: bumper1(); break; case $i <= 35: bumper2(); break; case $i <= 60: bumper4(); break; case $i <= 65: bank1(); break; case $i <= 90: bank3(); break; case $i <= 95: flipper(); break; default: hole(); break; } } function bumper4() { global $score; $score+= 500; global $bumper1Hits; $bumper1Hits += 1; echo "<br />Bumper 4 Hit."; switch ($i = getRandom()) { case $i <= 10: bumper1(); break; case $i <= 35: bumper2(); break; case $i <= 60: bumper3(); break; case $i <= 65: bank2(); break; case $i <= 90: bank4(); break; case $i <= 95: flipper(); break; default: hole(); break; } } function bank1() { echo "<br />Bank 1 Hit!"; switch ($i = getRandom()) { case $i <= 16: if ($bank1[0]) { global $score; $score+= 10; global $bank1; $bank1[0] = false; } switch ($i = getRandom()) { case $i <= 40; bumper1(); break; case $i <= 80: bumper2(); break; case $i <= 95: flipper(); break; default: hole(); break; } break; case $i <= 32: if ($bank1[1]) { global $score; $score+= 10; global $bank1; $bank1[1] = false; } switch ($i = getRandom()) { case $i <= 40; bumper1(); break; case $i <= 80: bumper2(); break; case $i <= 95: flipper(); break; default: hole(); break; } break; case $i <= 48: if ($bank1[2]) { global $score; $score+= 10; global $bank1; $bank1[2] = false; } switch ($i = getRandom()) { case $i <= 40; bumper1(); break; case $i <= 80: bumper2(); break; case $i <= 95: flipper(); break; default: hole(); break; } break; case $i <= 64: if ($bank1[3]) { global $score; $score+= 10; global $bank1; $bank1[3] = false; } switch ($i = getRandom()) { case $i <= 40; bumper1(); break; case $i <= 80: bumper2(); break; case $i <= 95: flipper(); break; default: hole(); break; } break; case $i <= 80: if ($bank1[4]) { global $score; $score+= 10; global $bank1; $bank1[4] = false; } switch ($i = getRandom()) { case $i <= 40; bumper1(); break; case $i <= 80: bumper2(); break; case $i <= 95: flipper(); break; default: hole(); break; } break; case $i <= 96: if ($bank1[5]) { global $score; $score+= 10; global $bank1; $bank1[5] = false; } switch ($i = getRandom()) { case $i <= 40; bumper1(); break; case $i <= 80: bumper2(); break; case $i <= 95: flipper(); break; default: hole(); break; } break; case $i <= 99; flipper(); break; default: hole(); break; } } function bank2() { echo "<br />Bank 2 Hit!"; switch ($i = getRandom()) { case $i <= 16: if ($bank2[0]) { global $score; $score+= 10; global $bank2; $bank2[0] = false; } switch ($i = getRandom()) { case $i <= 40; bumper1(); break; case $i <= 80: bumper2(); break; case $i <= 95: flipper(); break; default: hole(); break; } break; case $i <= 32: if ($bank2[1]) { global $score; $score+= 10; global $bank2; $bank2[1] = false; } switch ($i = getRandom()) { case $i <= 40; bumper1(); break; case $i <= 80: bumper2(); break; case $i <= 95: flipper(); break; default: hole(); break; } break; case $i <= 48: if ($bank2[2]) { global $score; $score+= 10; global $bank2; $bank2[2] = false; } switch ($i = getRandom()) { case $i <= 40; bumper1(); break; case $i <= 80: bumper2(); break; case $i <= 95: flipper(); break; default: hole(); break; } break; case $i <= 64: if ($bank2[3]) { global $score; $score+= 10; global $bank2; $bank2[3] = false; } switch ($i = getRandom()) { case $i <= 40; bumper1(); break; case $i <= 80: bumper2(); break; case $i <= 95: flipper(); break; default: hole(); break; } break; case $i <= 80: if ($bank2[4]) { global $score; $score+= 10; global $bank2; $bank2[4] = false; } switch ($i = getRandom()) { case $i <= 40; bumper1(); break; case $i <= 80: bumper2(); break; case $i <= 95: flipper(); break; default: hole(); break; } break; case $i <= 96: if ($bank2[5]) { global $score; $score+= 10; global $bank2; $bank2[5] = false; } switch ($i = getRandom()) { case $i <= 40; bumper1(); break; case $i <= 80: bumper2(); break; case $i <= 95: flipper(); break; default: hole(); break; } break; case $i <= 99; flipper(); break; default: hole(); break; } } function bank3() { echo "<br />Bank 3 Hit!"; switch ($i = getRandom()) { case $i <= 16: if ($bank3[0]) { global $score; $score+= 10; global $bank3; $bank3[0] = false; } switch ($i = getRandom()) { case $i <= 40; bumper1(); break; case $i <= 80: bumper2(); break; case $i <= 95: flipper(); break; default: hole(); break; } break; case $i <= 32: if ($bank3[1]) { global $score; $score+= 10; global $bank3; $bank3[1] = false; } switch ($i = getRandom()) { case $i <= 40; bumper1(); break; case $i <= 80: bumper2(); break; case $i <= 95: flipper(); break; default: hole(); break; } break; case $i <= 48: if ($bank3[2]) { global $score; $score+= 10; global $bank3; $bank3[2] = false; } switch ($i = getRandom()) { case $i <= 40; bumper1(); break; case $i <= 80: bumper2(); break; case $i <= 95: flipper(); break; default: hole(); break; } break; case $i <= 64: if ($bank3[3]) { global $score; $score+= 10; global $bank3; $bank3[3] = false; } switch ($i = getRandom()) { case $i <= 40; bumper1(); break; case $i <= 80: bumper2(); break; case $i <= 95: flipper(); break; default: hole(); break; } break; case $i <= 80: if ($bank3[4]) { global $score; $score+= 10; global $bank3; $bank3[4] = false; } switch ($i = getRandom()) { case $i <= 40; bumper1(); break; case $i <= 80: bumper2(); break; case $i <= 95: flipper(); break; default: hole(); break; } break; case $i <= 96: if ($bank3[5]) { global $score; $score+= 10; global $bank3; $bank3[5] = false; } switch ($i = getRandom()) { case $i <= 40; bumper1(); break; case $i <= 80: bumper2(); break; case $i <= 95: flipper(); break; default: hole(); break; } break; case $i <= 99; flipper(); break; default: hole(); break; } } function bank4() { echo "<br />Bank 4 Hit!"; switch ($i = getRandom()) { case $i <= 16: if ($bank4[0]) { global $score; $score+= 10; global $bank4; $bank4[0] = false; } switch ($i = getRandom()) { case $i <= 40; bumper1(); break; case $i <= 80: bumper2(); break; case $i <= 95: flipper(); break; default: hole(); break; } break; case $i <= 32: if ($bank4[1]) { global $score; $score+= 10; global $bank4; $bank4[1] = false; } switch ($i = getRandom()) { case $i <= 40; bumper1(); break; case $i <= 80: bumper2(); break; case $i <= 95: flipper(); break; default: hole(); break; } break; case $i <= 48: if ($bank4[2]) { global $score; $score+= 10; global $bank4; $bank4[2] = false; } switch ($i = getRandom()) { case $i <= 40; bumper1(); break; case $i <= 80: bumper2(); break; case $i <= 95: flipper(); break; default: hole(); break; } break; case $i <= 64: if ($bank4[3]) { global $score; $score+= 10; global $bank4; $bank4[3] = false; } switch ($i = getRandom()) { case $i <= 40; bumper1(); break; case $i <= 80: bumper2(); break; case $i <= 95: flipper(); break; default: hole(); break; } break; case $i <= 80: if ($bank4[4]) { global $score; $score+= 10; global $bank4; $bank4[4] = false; } switch ($i = getRandom()) { case $i <= 40; bumper1(); break; case $i <= 80: bumper2(); break; case $i <= 95: flipper(); break; default: hole(); break; } break; case $i <= 96: if ($bank4[5]) { global $score; $score+= 10; global $bank4; $bank4[5] = false; } switch ($i = getRandom()) { case $i <= 40; bumper1(); break; case $i <= 80: bumper2(); break; case $i <= 95: flipper(); break; default: hole(); break; } break; case $i <= 99; flipper(); break; default: hole(); break; } } function flipper() { switch ($i = $skillLevel * getRandom()) { case $i <= 10: hole(); break; case $i <= 15: bank3(); break; case $i <= 20: bank4(); break; case $i <= 25: bank1(); break; case $i <= 30: bank2(); break; case $i <= 47: bumper1(); break; case $i <= 64: bumper2(); break; case $i <= 81: bumper3(); Alright this script is being stupid! Heres the Script... $gid = array($P1 = $_POST[P0] ,$P2 = $_POST[P1] ,$P3 = $_POST[P2] ,$P4 = $_POST[P3] ,$P5 = $_POST[P4] ,$P6 = $_POST[P5] ,$P7 = $_POST[P6] ,$P8 = $_POST[P7] ,$P9 = $_POST[P8] ,$P10 = $_POST[P9] ,$P11 = $_POST[P10] ,$P12 = $_POST[P11] ); $pick= array($G1 = $_POST[game1] ,$G2 = $_POST[game2] ,$G3 = $_POST[game3] ,$G4 = $_POST[game4] ,$G5 = $_POST[game5] ,$G6 = $_POST[game6] ,$G7 = $_POST[game7] ,$G8 = $_POST[game8] ,$G9 = $_POST[game9] ,$G10 = $_POST[game10] ,$G11 = $_POST[game11] ,$G12 = $_POST[game12] ); function iORu($gameF, $pickF){ $Current_user_id = $_SESSION[user_id]; $con = mysql_connect("localhost","user","pass"); if (!$con) { die('Could not connect: ' . mysql_error()); } mysql_select_db("sports", $con); $query = "SELECT User_ID FROM CollegeFootballPicks WHERE User_ID='$Current_user_id' && Game_ID='$gameF'"; $result = mysql_query($query); if(mysql_num_rows($result) == 0){ $query = "INSERT INTO CollegeFootballPicks (User_ID, Game_ID, Pick) VALUES ('$Current_user_id','$gameF','$pickF')"; $result = mysql_query($query); echo'Inserted'; }else{ $query = "UPDATE CollegeFootballPicks SET User_ID = '$Current_user_id', Game_ID = '$gameF', Pick = '$pickF'"; $result = mysql_query($query); echo'Updated'; } mysql_close(); echo "<i>"; echo ' '.$Current_user_id. ' '; echo $gameF. ' '; echo $pickF. ' '; echo "</i>"; echo '<br />'; } //End of Function for($i=0; $i< 12; $i++) { iORu($gid[$i],$pick[$i]); } For testing purposes i have inserted all the echos along the way to visually see how far its getting. When i run the script it recognizes all the information when and where it's supposed to (With the echos) but its not inserting/ updating to mysql except for game 1 (i.e. the first time the function runs) Does anyone see any errors? It doesn't make sense on why all the info echos exactly right, and game one inserts and updates right. But games 2-12 don't insert or update! Before anyone says something. Yes this is the same shit i've been working on for about two weeks and have gotten help with before. I have two jobs and web design aint one of them. So if your gonna help, help! But if your gonna say something that aint in any way "help" keep it to yourself! hello all,
I want to create a script similar to the following two sites:
zopium
livechatinc
i am confused where to start , i want to know what framework will be best for creating such a script i can learn any frameworks and can start working on it ,i have got 2 months to coomplet the project also i want to know what kind of resources i will be required to make a complete set up,
I know i am new to this forum so if i have posted in worng section then please point me to the right section so that i can move the post there or moderators feel free to move this post
i want to know each and every espects that will be required and i should take care of while creating this project
hoping to hear soon from you guys
thanks
Here is the scenario: I have phpbb installed inside of an iframe and I have all of these features working .....in firefox only: Iframe re-sizes to fit content external links within the forum open in a new window traffic to my /forum directory is redirected (with a javascript window.location.replace) to open inside of the iframe Essentially phpbb works perfectly in firefox When I load it in either Chrome or IE: My site index will load fine (as will any site feature that is not within the iframe) When I attempt to load my forum or request anything within the iframe IE and Chrome show the page for less than one second then continuously load a 404 page within the frame This leads me to believe that it is a problem with my redirect...but I have no clue. Here is the PHP, hopefully somebody can help: Iframe re-size code (in iframefile.php): <script type="text/javascript"> /*********************************************** * IFrame SSI script II- &#169; Dynamic Drive DHTML code library (http://www.dynamicdrive.com) * Visit DynamicDrive.com for hundreds of original DHTML scripts * This notice must stay intact for legal use ***********************************************/ //Input the IDs of the IFRAMES you wish to dynamically resize to match its content height: //Separate each ID with a comma. Examples: ["myframe1", "myframe2"] or ["myframe"] or [] for none: var iframeids=["myframe"] //Should script hide iframe from browsers that don't support this script (non IE5+/NS6+ browsers. Recommended): var iframehide="yes" var getFFVersion=navigator.userAgent.substring(navigator.userAgent.indexOf("Firefox")).split("/")[1] var FFextraHeight=parseFloat(getFFVersion)>=0.1? 150 : 0 //extra height in px to add to iframe in FireFox 1.0+ browsers function resizeCaller(){ var dyniframe=new Array() for (i=0; i<iframeids.length; i++){ if (document.getElementById) resizeIframe(iframeids[i]) //reveal iframe for lower end browsers? (see var above): if ((document.all || document.getElementById) && iframehide=="no"){ var tempobj=document.all? document.all[iframeids[i]] : document.getElementById(iframeids[i]) tempobj.style.display="block" } } } function resizeIframe(frameid){ var currentfr=document.getElementById(frameid) if (currentfr && !window.opera){ currentfr.style.display="block" if (currentfr.contentDocument && currentfr.contentDocument.body.offsetHeight) //ns6 syntax currentfr.height = currentfr.contentDocument.body.offsetHeight+FFextraHeight; else if (currentfr.Document && currentfr.Document.body.scrollHeight) //ie5+ syntax currentfr.height = currentfr.Document.body.scrollHeight; if (currentfr.addEventListener) currentfr.addEventListener("load", readjustIframe, false) else if (currentfr.attachEvent){ currentfr.detachEvent("onload", readjustIframe) // Bug fix line currentfr.attachEvent("onload", readjustIframe) } } } function readjustIframe(loadevt) { var crossevt=(window.event)? event : loadevt var iframeroot=(crossevt.currentTarget)? crossevt.currentTarget : crossevt.srcElement if (iframeroot) resizeIframe(iframeroot.id); } function loadintoIframe(iframeid, url){ if (document.getElementById) document.getElementById(iframeid).src=url } if (window.addEventListener) window.addEventListener("load", resizeCaller, false) else if (window.attachEvent) window.attachEvent("onload", resizeCaller) else window.onload=resizeCaller </script> _________________________________________________ ___ This is (part of) the javascript redirect (in iframefile.php) <script type="text/javascript"> var text = window.location.href; function delineate(str) { theleft = str.indexOf("=") + 1; theright = str.indexOf("&"); return(str.substring(theleft, str.length)); } url=delineate(text) function refreshFrame() { myframe.location.replace("http://www.mydomain/?var1='+window.location.href+'"); } </script> This is the other part of the above javascript redirect that is in the overall_header to redirect pages requested within the forum to target the iframe via the code above: <script type="text/javascript"> if (window == top) { var url='window.location.replace("/?var1='+window.location.href+'")'; eval(url); } </script> This is the necessary code i had to add in my home directory index.php for the above two codes to work: <? ob_start(); $vary = $_GET['var1']; $tee = $_GET['t']; if ( $vary == "" ) { // do nothing, no var } else { $gogogo = strtolower($vary); $healthy = array("http://mydomain/forum/", "http://www.mydomain/forum/"); $yummy = array("", ""); $newphrase = str_replace($healthy, $yummy, $gogogo); $finalcode = base64_encode($newphrase); $healthy = array("+", "="); $yummy = array("7PLUS7", "7EQUALS7"); $newphraseu = str_replace($healthy, $yummy, $finalcode); if ( $tee == "" ) { header("Location: http://www.mydomain/iframefile.php?var=$newphraseu"); } else { header("Location: http://www.mydomain/iframefile.php?var=$newphraseu&t=$tee"); } } ob_flush(); ?> ___________________________________ And finally this is the code for my actual iframe (in iframefile.php): <? $healthy = array("7PLUS7", "7EQUALS7"); $yummy = array("+", "="); $newphraseu = str_replace($healthy, $yummy, $vary); $finally = base64_decode($newphraseu); if ( $tee == "" ) { $thedone = $finally; } else { $thedone = "$finally&t=$tee"; } if ( $vary == "" ) { ?> <center><iframe onload="refreshFrame();" id="myframe" src="/forum" scrolling="no" marginwidth="0" frameborder="0" marginheight="0" vspace="0" hspace="0" style="overflow:invisible; width:100%; display:none"></iframe></center> <? } else { ?> <center><iframe onload="refreshFrame();" id="myframe" src="/forum/<? echo $thedone; ?>" scrolling="no" marginwidth="0" marginheight="0" frameborder="0" vspace="0" hspace="0" style="overflow:invisible; width:100%; display:none"></iframe></center> <? } ?> Sorry for the long read. Again this all works perfect in firefox but with IE and Chrome the iframe keeps reloading a 404 page after showing the requested page briefly. Any and all help is appreciated! Thanks in advance Here is one of my emails. Delivered-To: jason@gmail.com Received: by 10.204.57.134 with SMTP id c6cs22321bkh; Tue, 13 Sep 2011 07:23:32 -0700 (PDT) Received: by 10.101.168.12 with SMTP id v12mr3751263ano.48.1315923810914; Tue, 13 Sep 2011 07:23:30 -0700 (PDT) Return-Path: <contact@big.com> Received: from big.com (big.com [173.0.59.100]) by mx.google.com with ESMTP id c19si889696anj.173.2011.09.13.07.23.29; Tue, 13 Sep 2011 07:23:29 -0700 (PDT) Received-SPF: pass (google.com: domain of contact@big.com designates 173.0.59.100 as permitted sender) client-ip=173.0.59.100; Authentication-Results: mx.google.com; spf=pass (google.com: domain of contact@big.com designates 173.0.59.100 as permitted sender) smtp.mail=contact@big.com; dkim=neutral (body hash did not verify) header.i=@big.com Received: by big.com (Postfix, from userid 33) id 1BDCE2F4041A; Tue, 13 Sep 2011 10:23:20 -0400 (EDT) DKIM-Signatu v=1; a=rsa-sha256; c=simple/simple; d=big.com; s=mail; t=1315923800; bh=ysNGlrscqmqCPbqxJlWWHLaW3SU6MgDVQCze+cevPS4=; h=To:Subject:Message-ID:Date:MIME-Version:Sender:From:Reply-To: Content-Type; b=PDPCRvKGQRP3LeeDNhZQwbX6aMXOZEyqRXV1E+kuDDq05NYRIrmJCcQRhwEIaSosh yoZ0pF5wtrXjgY1KA0hgee7qzSVDhweguBfOydn1qE6nsL1pq CQgsHmtvu9dwPGw9z uUEHM9bg5DwiG0RT5KLYf4oZTJmJpc8n2oyK26/I= To: jason@gmail.com Subject: Closed Beta Invitation from Jason Gordon Message-ID: <87847890-050333@big.com> Date: Tue, 13 Sep 2011 10:38:17 -0400 MIME-Version: 1.0 X-Mailer: PHP-5.3.8 X-Sender: "big" <contact@big.com> X-Priority: 3 Organization: big Errors-To: contact@big.com Sender: contact@big.com From: "big" <contact@big.com> Reply-To: "big" <contact@big.com> Content-Type: multipart/alternative; boundary=87847890 --48673093 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit <a href="http://big.com/u/jasonGordon?utm_source=beta_invite&utm_medium=email&utm_content=referer_name&utm_campaign=join_beta" alt="Jason Gordon's profile" title="Jason Gordon's profile">Jason Gordon</a> invited you to join the newest community of entreprenuers and investors, big. Why participate in our closed beta? Here you will be able to find, research and connect with entrepreneurs or investor so much easier than ever before. You will be one of the first people to ever lay eyes on our exclusive software! Sign up by clicking <a href="http://big.com/join?9b782e=&key=7RG5poe9lgxmUSIcQTPji8EtFMnXyOYW3Cf&utm_source=beta_invite&utm_medium=email&utm_content=sign_up&utm_campaign=join_beta" title="big Beta Referral">here</a> If the link does not work, go to <a href="http://big.com" title="big">big.com</a>, click "Join big" and enter your closed beta access key. Your closed beta access key is: 7RG5poe9lgxmUSIcQTPji8EtFMnXyOYW3Cf Please leave us feedback so that we can improve our software. big Team --48673093 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> <title>Closed Beta Invitation</title> </head> <body> <table width="500px" cellspacing="0" cellpadding="13" style="border: 1px solid #e7e7e7;"> <tr> <td> <table cellspacing="0" cellpadding="5" bgcolor="#ffffff" width="480px" style="border: 1px solid #999999;"> <tr> <td bgcolor="#489fcc" cellspacing="15" style="border-bottom: 1px solid #999999; border-top: 0; border-left: 0; border-right: 0; font-family: verdana; letter-spacing: 1px; font-weight: bold; color: white;" width="480px"> big </td> </tr> <tr> <td> <table style="line-height: 26px; font-family: arial; font-size: 13px;" width="100%" cellspacing="10" cellpadding="0"> <tr> <td width="100%"> <table style="line-height: 26px; text-align: justify;" width="100%" cellpadding="0" cellspacing="0"> <tr> <td width="100%"> <a href="http://big.com/u/jasonGordon?utm_source=beta_invite&utm_medium=email&utm_content=referer_name&utm_campaign=join_beta" alt="Jason Gordon's profile" title="Jason Gordon's profile">Jason Gordon</a> invited you to join the newest community of entreprenuers and investors, big. Why participate in our closed beta? Here you will be able to find, research and connect with entrepreneurs or investor so much easier than ever before. You will be one of the first people to ever lay eyes on our exclusive software! </td> </tr> </table> </td> </tr> <tr> <td align="center" width="100%"> <table style="border-top: 1px solid #b8b8b8; border-bottom: 1px solid #b8b8b8;" width="100%" cellpadding="0" cellspacing="5"> <tr> <td width="100%" align="center"> Sign up by clicking <a href="http://big.com/join?9b782e=&key=7RG5poe9lgxmUSIcQTPji8EtFMnXyOYW3Cf&utm_source=beta_invite&utm_medium=email&utm_content=sign_up&utm_campaign=join_beta" title="big Beta Referral">here</a> </td> </tr> </table> </td> </tr> <tr> <td width="100%" style="text-align: justify;"> If the link does not work, go to <a href="http://big.com" title="big">big.com</a>, click "Join big" and enter your closed beta access key. Your closed beta access key is: </td> </tr> <tr> <td align="center" width="100%"> <table bgcolor="#e6e6e6" style="border: 1px solid #b8b8b8;" width="100%" cellpadding="0" cellspacing="5"> <tr> <td width="100%" align="center"> 7RG5poe9lgxmUSIcQTPji8EtFMnXyOYW3Cf </td> </tr> </table> </td> </tr> <tr> <td width="100%"> Please leave us feedback so that we can improve our software. </td> </tr><tr> <td width="100%"> big Team </td> </tr> </table> </td> </tr> </table> </td> </tr> </table> </body> </html> --48673093-- My headers function is... Code: [Select] function mail_header ($type, $random_hash) { $type = (int)$type; if ($type === 0) { $boundary = $random_hash; $x_mailer = phpversion(); $time_stamp = date("r"); $headers = 'Message-ID: <'.$boundary.'-050333@big.com>' . "\r\n"; $headers .= 'Date: ' . $time_stamp . "\r\n"; $headers .= 'MIME-Version: 1.0' . "\r\n"; $headers .= 'X-Mailer: PHP-' . $x_mailer . "\r\n"; $headers .= 'X-Sender: "big" <contact@big.com>' . "\r\n"; $headers .= 'X-Priority: 3' . "\r\n"; $headers .= 'Organization: big' . "\r\n"; $headers .= 'Errors-To: contact@big.com' . "\r\n"; $headers .= 'Sender: contact@big.com' . "\r\n"; $headers .= 'From: "big" <contact@big.com>' . "\r\n"; $headers .= 'Reply-To: "big" <contact@big.com>' . "\r\n"; $headers .= 'Return-Path: "big" <contact@big.com>' . "\r\n"; $headers .= 'Content-Type: multipart/alternative; boundary=' . $boundary . "\r\n"; } return $headers; } I'd like to use an application that's not browser based, on Internet Explorer. I've read somewhere that this is possible with a PHP script, but which one? If you can get me on the right track, I'd really appreciate it. Cheers. Hello PHPers, I need help regards obtaining the correct Host and IP address. Using all browsers except mozilla-firefox, I will received the correct IP address. But with Mozzilla-firefox I get the wrong Host and IP address back as 10.1.23.22 ..The code I have is $mj_ip = $_SERVER['REMOTE_ADDR']; $mj_host = gethostbyaddr($_SERVER['REMOTE_ADDR']); Cheers, HJ Hey there, I'm trying to set up a little ftp script to make it easier to upload files and add new folders for images and videos ect on a backend admin page however the following script just will not connect I keep getting the "Couldn't connect to 66.40.52.167" error so it's not even finding the server however when I put it into my browser it connects just fine, I've even pinged it and all works fine so I don't get it. $ftp_server = "66.40.52.167"; $ftp_user = "username"; $ftp_pass = "password"; $conn_id = ftp_connect($ftp_server) or die("Couldn't connect to $ftp_server"); if (@ftp_login($conn_id, $ftp_user, $ftp_pass)) { echo "Connected as $ftp_user@$ftp_server\n"; } else { echo "Couldn't connect as $ftp_user\n"; } ftp_close($conn_id); Any ideas would be appreciated! Hello,
I want to know how they keep the same url when page is changing, if you dont know what i mean try the link and check the browser when you wat happens when you click in a other link in the website.
( Website Link ( Normal Content ) ) http://geedmo.com/?item=LushSlider
Thanks in advance.
I am trying to come up with a script that will detect whether the requesting user agent is a bot or a browser, as their are so many bots and scripts around i have decided to go with the latter so i need a list of browsers that may be used to do the following Quote $browser_array = array(list of browsers..................); if(!in_array($_SERVER['HTTP_USER_AGENT'], $browser_array)) { output text; } else { output html; } so basically i am now stuck without a complete list of user agents so if anyone knows where i can find a list it would be much appreciated I need to use an if statement in conjunction with the browser name/type "Mozilla Firefox" vs "Google Chrome" to display certain scripts of CSS to a page. I am not sure how to do this. Any help would help, Brian OK, I'm nearing the end of a very long chat project and I have one last hurdle to jump, I've saved this task to the near end because I thought it would be a problem as I have no idea what to do or where to start. The problem is exactly what is said in the subject title. I have looked into JavaScript options such as "onbeforeunload" but that is just BAD. The login is controlled by sessions, so when the user closes the browser, the session is ended, but data in the database says different, cookies are not an option I'm afraid. I've had an idea that if I create a special account (or a few) and always leave these accounts logged in, they can check if a user has been inactive for a certain period of time, and then run queries to change things, I know this sound odd but maybe I will not have to create these accounts but general accounts that people make will be able to do this for me, without them even knowing. Please help, any ideas, suggestions, logic or methods that you think will help will be great. Thanks. Hi, I have tried a "Hello.php" to open in my web browser. It throws 404 file not found error. I am using Intranet. How to determine the web server I am using? Thanks. hi i was wondering if anyone has any idea how to get this code to work for more then one browser? i can get it to work for one browser but have no luck on getting it to work for more then one browser thanks... code that don't work: Code: [Select] <?php include("browserDetection.php"); $user_browser = browser_detection('browser'); if ( $user_browser == 'mozilla' ) { echo("<link href='style.css' type='text/css' rel='stylesheet'></link>\n"); } else { echo("<link href='style1.css' type='text/css' rel='stylesheet'></link>\n"); } if ( browser_detection('msie') ) { echo("<link href='style.css' type='text/css' rel='stylesheet'></link>\n"); } else { echo("<link href='style1.css' type='text/css' rel='stylesheet'></link>\n"); } ?>code that works: Code: [Select] <?php include("browserDetection.php"); $user_browser = browser_detection('browser'); if ( $user_browser == 'Mozilla' ) { echo("<link href='style.css' type='text/css' rel='stylesheet'></link>\n"); } else { echo("<link href='style1.css' type='text/css' rel='stylesheet'></link>\n"); } ?> Is there a way so when someone loads your website that it forces them to load it in a different browser? hello, this is part of my contact form code. When i click on the submit button i need the form to take me to the $success_message or the $failure_message instead of the top of the page. I know i can do it with # tag or # id normally. But I do not know how to apply it to the form. Code: [Select] //some text and stuff<tr> <td> <? if(!empty($success_message)) { echo "<center><font color='blue'><b>".$success_message."</b></font><br></p>"; } if(!empty($failure_message)) { echo "<center><font color='red'><b>".$failure_message."</b></font><br></p>"; } ?> <? if((empty($_POST)) || !empty($strError)) { echo "<table align= 'center' width='70%' style='border-top: 1px; border-right: 1px; border-left: 1px; border-bottom: 1px; border-color: black; border-style: solid;'>"; ?> <form action="<?php echo $PHP_SELF;?>" method="post"> <tr height='40'> <td> <font color="black"><B> First Name: </B></font> </td> <td><input type="text" size ="40" name="first_name" value="<? if(!empty($strError)) {echo cleaninput($_POST['first_name']);}?>" class="advertising-inputbox-style" /> <?php if (!empty($arrErrors['first_name'])) echo $arrErrors['first_name']; ?> </td> </tr> <tr height='40'> <td><font color="black"><B> Last Name: </B></font></td> <td><input type="text" size ="40" name="last_name" value="<? if(!empty($strError)) { echo cleaninput($_POST['last_name']);}?>" class="advertising-inputbox-style"/> <?php if (!empty($arrErrors['last_name'])) echo $arrErrors['last_name']; ?> </td> </tr> <tr height='40'> <td><font color="black"><B> Email Address: </B></font></td> <td><input type="text" size ="40" name="email_address" value="<? if(!empty($strError)) { echo cleaninput($_POST['email_address']);}?>" class="advertising-inputbox-style"/> <?php if (!empty($arrErrors['email_address'])) echo $arrErrors['email_address']; ?> </td> </tr> <tr height='35'> <td><font color="black"><B> Business Name: </B></font></td> <td><input type="text" size ="40" name="business_name" value="<? if(!empty($strError)) { echo cleaninput($_POST['business_name']);}?>" class="advertising-inputbox-style" /> <?php if (!empty($arrErrors['business_name'])) echo $arrErrors['business_name']; ?> </td> </tr> <tr> <td><font color="black"><B> Business Description: </B></font></td> <td ><textarea rows=7 cols=31 name="description" class="advertising-textarea-style"><? if(!empty($strError)) { echo cleaninput($_POST['description']);}?></textarea> <?php if (!empty($arrErrors['description'])) echo $arrErrors['description']; ?> </td> <tr height='35'> <td></td> <td><input type="submit" name="submit" value="submit" /></td> </tr> </form> I'm not sure if JS or PHP is causing my browser to lock up when I access this page. I have a database of zipcodes ... approx. 70,000 of them. I have a php loop put them into a JS array. I then want JS to create a drop down with all the zip codes. On Chrome it completely doesn't work. On FF it will loop to about 64,000 and then give a warning that the script is taking too long. Reading up on google it seems that JS should be able to handle an array much bigger then mine... so what could be he problem? <script language="javascript"> function addOption(selectbox,text,value ) { var optn = document.createElement("OPTION"); optn.text = text; optn.value = value; selectbox.options.add(optn); } <?php //TESTING $con = mysql_connect("","",""); mysql_select_db("", $con); //END TESTING $data = mysql_query("SELECT postalCode FROM geo_city WHERE postalCode !='' ORDER BY postalCode ASC") or die(mysql_error()); echo 'function addOption_list(selectbox){ var zip = new Array("VOID"'; while($info = mysql_fetch_array($data)){ echo ',"'.$info['postalCode'].'"'; } echo ');'; ?> for (var i=0; i < zip.length;++i){ addOption(document.drop_list.zip_list, zip[i], zip[i]); } } </script> </head> <body onLoad="addOption_list()";> <FORM name="drop_list" action="" method="POST" > <SELECT NAME="zip_list"> <Option value="" >Zip Code list</option> </SELECT> </form> I got problem with one of my php page. Mozilla browser keeps on loading although it shows the page, i am not really sure which part is wrong. But i don't find any problem with other browsers lol. Can anyone help me please thanks in advance I'm planning on writing a library script holding pdf files which will serve the purpose as ebooks in which people could search and open. I don't know for sure, but doubt that you can open a pdf file and make it readable in php. I've noticed adobe reader has managed to do it, and what method do they use to do so? I have done some searching and digging, but it seems everyone has their own ways of doing things, some more effective than others. I have a web design portfolio website, which uses a "coinslider" flash slideshow. It looks awesome in FF, but IE6/etc users cant view it properly. How can I create a PHP if/then to detect if they are using a sub-par browser, and display a more simple slideshow? That way it will work for all users, and those with Firefox and similar browsers can view the more interesting slideshow. Thanks. |