Search the Community
Showing results for tags 'browser'.
-
Hello, I want to add a process that will trigger a show of advertisement or opening a new tab when the user close a the tab or browser. $(window).bind("beforeunload", function(e) { window.open(URL+'ads', '_blank'); return 'You are closing the browser'; }); The window.open and the return message is both not working. I tried also other possibilities but window.open is not working. Anyone knows about this?
-
Can I rely on the $_SERVER variable of HTTP_ACCEPT_LANGUAGE to get the language of the browser? I know that some browsers don't send things the same way, and even some servers may not use all variables. Is this the most common way to determine the user's language? Is there another or more preferred way? Thank you.
- 1 reply
-
- internationalization
- browser
-
(and 2 more)
Tagged with:
-
why this simple code only works on chrome?? function mostrarOcultar(obj) { document.getElementById('seguro').style.visibility = (obj.checked) ? 'hidden' : 'visible'; } this the php: <table width="100%" border="1" id="seguro" style="visibility:visible"> <tr> <td bgcolor="#B4ED89" class="Estilo3"><?php echo "Cantidad Asegurada Bs" ?></td> <td width="47%"><input name="asegu" type="text" id="asegu" size="39" onkeypress="return NumCheck(event,this)" onpaste="return false"/></td> <tr> </table> only work on chrome and perfectly
- 2 replies
-
- php
- javascript
-
(and 3 more)
Tagged with:
-
Hello, i need to change the display url in the browser with httaccess This is the link in the browser: fun.php?search=&submit=search&page=1 And i want to change in to this fun/page/1 This is what i try to do, I created a .httacces file in public html with this text in it. RewriteEngine On # Rewrite all php files RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME}\.php -f RewriteRule ^(.*)$ $1.php [L] # Rewrite blog pagination RewriteRule ^fun/page/([a-zA-Z_-]+)/([0-9]?) fun.php?search=&submit=search&page=$1 [L,QSA] But it doenst work. Thanks in advance for any help.
- 1 reply
-
- .httacces
- pagination
-
(and 1 more)
Tagged with:
-
Hello and thanks in advance for any advice until recently, when our pdf was displayed in the browser, the whole pdf showed up - now (within the past 2-3 months) only about 1/3 of it shows Here's the page http://www.manofsteelesports.com/nonjphp/report.php?sid=128&a=d728d31d84495231a61b35d1ad7ccdcd&b=pdf I've looked at this in both Chrome and IE the php statement we're using in the PHP file that converts the HTML to pdf is $pdf->Output(); //Outputs on browser screen Any ideas on why this is happening and how to fix it?
-
Hello, i have a question about the results in the browser where you search. I want that this, Search+source+code&page=36 Search+source+code&page=72 Search+source+code&page=108 to change it like this, when you click next or 2 3 4 5 etc Search+source+code&page=2 Search+source+code&page=3 Search+source+code&page=4 is that possible ? here below the complete script <?php $button = $_GET ["submit"]; $search = $_GET ["search"]; if(strlen($search)<=1) echo "Search term too short"; else{ echo "You searched for <b>$search</b> <hr size='1'></br>"; mysql_connect("mysql_host_name","mysql_username","mysql_password"); mysql_select_db("database_name"); $search_exploded = explode (" ", $search); foreach($search_exploded as $search_each) { $x++; if($x==1) $construct .="title LIKE '%$search_each%'"; else $construct .="AND title LIKE '%$search_each%'"; } $constructs ="SELECT * FROM database_table_name WHERE $construct"; $run = mysql_query($constructs); $foundnum = mysql_num_rows($run); if ($foundnum==0) echo "Sorry, there are no matching result for <b>$search</b>.</br></br>1. Try more general words. for example: If you want to search 'how to create a website' then use general keyword like 'create' 'website'</br>2. Try different words with similar meaning</br>3. Please check your spelling"; else { echo "$foundnum results found !<p>"; $per_page = 36; $page = $_GET["page"]; $max_pages = ceil($foundnum / $per_page); if(!$page) $page=0; $getquery = mysql_query("SELECT * FROM database_table_name WHERE $construct LIMIT $page, $per_page"); while($runrows = mysql_fetch_assoc($getquery)) { $title = $runrows ["title"]; $desc = $runrows ["description"]; $url = $runrows ["url"]; echo " <a href='$url'><b>$title</b></a><br> $desc<br> <a href='$url'>$url</a><p> "; } //Pagination pages echo "<center>"; $prev = $page - $per_page; $next = $page + $per_page; $adjacents = 3; $last = $max_pages - 1; if($max_pages > 1) { //previous button if (!($page<=0)) echo " <a href='search.php?search=$search&submit=Search+source+code&page=$prev'>Prev</a> "; //pages if ($max_pages < 7 + ($adjacents * 2)) //not enough pages to bother breaking it up { $i = 0; for ($counter = 1; $counter <= $max_pages; $counter++) { if ($i == $page){ echo " <a href='search.php?search=$search&submit=Search+source+code&page=$i'><b>$counter</b></a> "; } else { echo " <a href='search.php?search=$search&submit=Search+source+code&page=$i'>$counter</a> "; } $i = $i + $per_page; } } elseif($max_pages > 5 + ($adjacents * 2)) //enough pages to hide some { //close to beginning; only hide later pages if(($page/$per_page) < 1 + ($adjacents * 2)) { $i = 0; for ($counter = 1; $counter < 4 + ($adjacents * 2); $counter++) { if ($i == $page){ echo " <a href='search.php?search=$search&submit=Search+source+code&page=$i'><b>$counter</b></a> "; } else { echo " <a href='search.php?search=$search&submit=Search+source+code&page=$i'>$counter</a> "; } $i = $i + $per_page; } } //in middle; hide some front and some back elseif($max_pages - ($adjacents * 2) > ($page / $per_page) && ($page / $per_page) > ($adjacents * 2)) { echo " <a href='search.php?search=$search&submit=Search+source+code&page=0'>1</a> "; echo " <a href='search.php?search=$search&submit=Search+source+code&page=$per_page'>2</a> .... "; $i = $page; for ($counter = ($page/$per_page)+1; $counter < ($page / $per_page) + $adjacents + 2; $counter++) { if ($i == $page){ echo " <a href='search.php?search=$search&submit=Search+source+code&page=$i'><b>$counter</b></a> "; } else { echo " <a href='search.php?search=$search&submit=Search+source+code&page=$i'>$counter</a> "; } $i = $i + $per_page; } } //close to end; only hide early pages else { echo " <a href='search.php?search=$search&submit=Search+source+code&page=0'>1</a> "; echo " <a href='search.php?search=$search&submit=Search+source+code&page=$per_page'>2</a> .... "; $i = $page; for ($counter = ($page / $per_page) + 1; $counter <= $max_pages; $counter++) { if ($i == $page){ echo " <a href='search.php?search=$search&submit=Search+source+code&page=$i'><b>$counter</b></a> "; } else { echo " <a href='search.php?search=$search&submit=Search+source+code&page=$i'>$counter</a> "; } $i = $i + $per_page; } } } //next button if (!($page >=$foundnum-$per_page)) echo " <a href='search.php?search=$search&submit=Search+source+code&page=$next'>Next</a> "; } echo "</center>"; } } ?> Thank`s in advance.
-
I am having a problem with a webfont I got from Google. It only works in IE, which I found amusing. Here is the CSS font-face declaration: @font-face { font-family:BerkshireSwash-Regular; src: url('../font/BerkshireSwash-Regular.eot'); src: url('../font/BerkshireSwash-Regular.eot?#iefix') format('embedded-opentype'), url('../font/BerkshireSwash-Regular.otf') format('opentype'), url('../font/BerkshireSwash-Regular.woff') format('woff'), url('../font/BerkshireSwash-Regular.ttf') format('truetype'), url('../font/BerkshireSwash-Regular.svg#BerkshireSwash-Regular'), format('svg'); font-weight: normal; font-style: normal; } h1, h2, h3, h4, h5, h6 { font-family: 'BerkshireSwash-Regular', 'Times New Roman', serif; text-align: center; } I checked it in the newest version of the top five browsers: Opera, FF, IE, Chrome, and Safari. As I said, IE is the only one that's correctly interpreting the font files. I have all the sources uploaded to my server as well, eot, ttf, woff, ttf, and svg. I also made sure to add all the MIME types to my .htaccess. AddType "application/vnd.ms-fontobject" .eot AddType "application/x-font-opentype" .otf AddType "application/x-font-truetype" .ttf AddType "application/x-font-ttf" .ttf AddType "application/x-font-woff" .woff AddType "image/svg+xml" .svg Does anyone have any suggestions? Let me know if you need more information.
-
I have a couple questions about those MMORPG like khanwars.com. 1. What programming languages do you need to create a web browser game like khanwars? Is PHP, MySQL and Javascript sufficient? Yes, of course it depends on what you want to achieve but take the khanwars.com example. What programming languages do you think they use? 2. How do you go about creating a clickable game map like this one http://www.browsergameslist.com/imgs/ikariam.jpg . or even like http://i.ytimg.com/v...QoDO6NbV0/0.jpg 3. With WebGL can you create a map and overlay building and other icons on top of it using javascript or other languages. 4. Is there a book which explains all about creating browser based mmorpgs; generating the terrain, game dynamics, resource gathering, resource production, military actions. Thanks in advance to anyone who will answer my silly question. I would also like to mention that i am willing to learn anything that is necessary and am willing to invest lots of time in understanding new concepts.
-
Hi all, I've got a problem with this piece of code. I believe this should work properly but when closing the Safari browser the alert box is properly displayed but when clicking "Ok" the browser closes. It should return to the page as it returns false. I've tried setting it to return false but with no luck. This works on FF and Chrome ok. var is_chrome = navigator.userAgent.indexOf('Chrome') > -1; var is_explorer = navigator.userAgent.indexOf('MSIE') > -1; var is_firefox = navigator.userAgent.indexOf('Firefox') > -1; var is_safari = navigator.userAgent.indexOf("Safari") > -1; var is_Opera = navigator.userAgent.indexOf("Presto") > -1; if ((is_chrome)&&(is_safari)) {is_safari=false;} //within $(document).ready(function(){ jQuery(window).bind("beforeunload", function(){ // showDebug1("Exiting..."); $.ajax({ url: "<?=$exit_url?>"}); leave = confirm("Exit page?"); if (leave==true){ return ret; } else { if(is_chrome) { return 'Leave page?'; } else if(is_safari) { alert('Click OK to continue'); } else { return false; } } }); Anyone have any ideas? Cheers, CaptainChainsaw