PHP - Moved: Dropdown Menu To Refresh The Content Without Reloading The Page?
This topic has been moved to Ajax Help.
http://www.phpfreaks.com/forums/index.php?topic=314750.0 Similar TutorialsThis topic has been moved to Ajax Help. http://www.phpfreaks.com/forums/index.php?topic=305930.0 This topic has been moved to Ajax Help. http://www.phpfreaks.com/forums/index.php?topic=329003.0 This topic has been moved to Ajax Help. http://www.phpfreaks.com/forums/index.php?topic=326913.0 Hello, I have links at above of the page. if i click a link a new page will appear. The menu links above are same for all pages. Which is better reloading the whole page with all menu links or keeping the above menu link permanent/unchange reloading bottom division with ajax? I mean only one page will contain the menu.Is it better? Or every page will contain the menu above.Is it better then the first one? I say many web site they have link menus above if i click a link from above it seems the whole page reloads or chages. For example:http://www.sitepoint.com/ Thank you. This topic has been moved to JavaScript Help. http://www.phpfreaks.com/forums/index.php?topic=333787.0 This topic has been moved to Miscellaneous. http://www.phpfreaks.com/forums/index.php?topic=353763.0 This topic has been moved to Ajax Help. http://www.phpfreaks.com/forums/index.php?topic=331067.0 This topic has been moved to mod_rewrite. http://www.phpfreaks.com/forums/index.php?topic=357949.0 I have a php generated image: (number.txt contains a number 1 or 2) pic.php Code: [Select] <?php // Set the content-type header('Content-type: image/bmp'); // Create the image $im = imagecreatetruecolor(80, 80); $count_my_page = ("number.txt"); $hits = file($count_my_page); if ($hits[0] == 1) { $im = imagecreatefrompng("image1.png"); $hits[0] ++; $fp = fopen($count_my_page , "w"); fputs($fp , "$hits[0]"); fclose($fp); }else{ $im = imagecreatefrompng("image2.png"); $hits[0] --; $fp = fopen($count_my_page , "w"); fputs($fp , "$hits[0]"); fclose($fp); } // Create some colors $white = imagecolorallocate($im, 255, 255, 255); $black = imagecolorallocate($im, 1, 1, 1); // Using imagepng() results in clearer text compared with imagejpeg() imagepng($im); imagedestroy($im); ?> And I have another page index.html Code: [Select] <img src="pic.php"> <img src="pic.php"> Basically, I need one of the images on the index page to be image1 and then the second image to be image2, but it must be contained within the php file because I am unable to edit index.html. Is there anyway to do this? The method I have now where it reads a file to see if it's value is 1 or 2 doesn't seem to compute each time the image is generated. I have tried header("Cache-Control: no-cache"); header("Pragma: no-cache"); in the image code to force it not to cache but to no avail. Can anyone solve this? Hi everybody I am a PHP rookie for now, and I want to reload the same dynamic page - it's content in several languages - by clicking little flags which are located at some point on the page - AND ITS NOT WORKING. Clicking on the flag triggers a PHP script which basically says Code: [Select] ]$_SESSION['lang'] = <Some_language>; require ('webpage.php'); where webpage.php is the dynamic page, in different languages, with it's content drawn out from a database (which contains the content in all languages I chose to display, blah, blah) Funny thing - when I look at the page html (View Page Source) - it seems OK (identical from one page to the next) ! But WHAT is displayed after the first attempt to change the language is not. Is something fundamentally wrong with my approach ? Mike hey guys im sure this is possible im wondering how a user can execute a mysql query by a click of a button but without the page reloading...thanks guys What is the best function to use to ensure an order is not re-entered when the user selects reload page? I can link code if you'd like but I'm only looking for a direction to go in and search google with. 'reload current page inserts extra' that google search hasn't been fruitful. I'm trying to show the same data, but updated right away. For example. I want to update my coords on a map and refresh a div to show the new data, but as the code now, it keeps the same data until I reload the page. Here is the code I have now. if ($north) { $ylocation = $users['y'] + 1; if ($ylocation > 5) { $ylocation = 0; } $locationyupdate = ("UPDATE players SET y = '$ylocation' WHERE name='$users[name]'"); mysql_query($locationyupdate) or die("could not register");?> <script type="text/javascript"> $('#npc').load('npc.php'); $('#description').load('description.php'); </script><?} The update code is before the reload script for the two div's. The data DOES change in the database, but the two div's won't display the new data until it is refreshed again. Do I need to reactivate fetch to get the new data? hello and good day... I'm trying to refresh by press the F5 button to refresh my iframe.. for your information, there is other tool in that iframe. the problem is 1. when i press the F5 key(refresh) while it's running, the whole page refreshing and i need to login to the tool. 2. i want to refresh the iframe without logout the tool... can you give me some guide how to solve this problem.. sorry my english not so good... thank you... regards, hyuuga Hello
I need to have 3 computers refreshing content every minute at the exact same time.
how can i do that? i don't want to use the tag <meta http-equiv="refresh" content="60; URL=http://www.yourdomai.../yoursite.html"> because it will not refresh syncronized with the computer clock and has i'll have 3 computers side by side it has to be at the exact same time. so i thougth about the refresh be based with the computer clock.
Anyone can help?
So i have a <drop down> menu, and a <nav> menu on my left side of the page. I have a problem when i click at the first column of my drop down menu and it explores submenu, the submenu mixes with the nav menu that is under the drop down menu on the left. i could solve it with margin-top of the nav menu but i don't like the empty space beetwen them. I tried with putting overflow:visible; in CSS of my dropdown menu but it is still the same. drop down menu is seen but there is stil seen nav menu under and they are mixed. So basicly i want my dropdown menu to be priority, so when i clicks on my first column (only first column is problem because there under is nav menu the other are open nice) it will explore submenu and the part of nav menu that covers the submenu will be hidden.
Here is the screen shot:
Here is the code of head <dropdown> menu if someone finds the problem.
#menu, #menu ul { margin: 0; padding: 0; list-style: none; } #menu { width: 900px; margin-top:20px; margin-left:auto; margin-right:auto; border: 1px solid #222; background-color: #111; background-image: linear-gradient(#444, #111); border-radius: 6px; box-shadow: 0 1px 1px #777; } #menu:before, #menu:after { content: ""; display: table; } #menu:after { clear: both; } #menu { zoom:1; } #menu li { float: left; border-right: 1px solid #222; box-shadow: 1px 0 0 #444; position: relative; } #menu a { float: left; padding: 12px 30px; color: #999; text-transform: uppercase; font: bold 12px Arial, Helvetica; text-decoration: none; text-shadow: 0 1px 0 #000; } #menu li:hover > a { color: #fafafa; } *html #menu li a:hover { /* IE6 only */ color: #fafafa; } #menu ul { margin: 20px 0 0 0; _margin: 0; /*IE6 only*/ opacity: 0; visibility: hidden; position: absolute; top: 38px; left: 0; z-index: 1; background: #444; background: linear-gradient(#444, #111); box-shadow: 0 -1px 0 rgba(255,255,255,.3); border-radius: 3px; transition: all .2s ease-in-out; } #menu li:hover > ul { opacity: 1; visibility: visible; margin: 0; } #menu ul ul { top: 0; left: 150px; margin: 0 0 0 20px; _margin: 0; /*IE6 only*/ box-shadow: -1px 0 0 rgba(255,255,255,.3); } #menu ul li { float: none; display: block; border: 0; _line-height: 0; /*IE6 only*/ box-shadow: 0 1px 0 #111, 0 2px 0 #666; } #menu ul li:last-child { box-shadow: none; } #menu ul a { padding: 10px; width: 130px; _height: 10px; /*IE6 only*/ display: block; white-space: nowrap; float: none; text-transform: none; } #menu ul a:hover { background-color: #0186ba; background-image: linear-gradient(#04acec, #0186ba); } #menu ul li:first-child > a { border-radius: 3px 3px 0 0; } #menu ul li:first-child > a:after { content: ''; position: absolute; left: 40px; top: -6px; border-left: 6px solid transparent; border-right: 6px solid transparent; border-bottom: 6px solid #444; } #menu ul ul li:first-child a:after { left: -6px; top: 50%; margin-top: -6px; border-left: 0; border-bottom: 6px solid transparent; border-top: 6px solid transparent; border-right: 6px solid #3b3b3b; } #menu ul li:first-child a:hover:after { border-bottom-color: #04acec; } #menu ul ul li:first-child a:hover:after { border-right-color: #0299d3; border-bottom-color: transparent; } #menu ul li:last-child > a { border-radius: 0 0 3px 3px; }Here is the code of <nav> menu if someone finds the problem. #cssmenu { width:15%; padding: 0; margin-top: 50px; margin-left:auto; margin right:auto; float:left; border: 0; line-height: 1; } #cssmenu ul, #cssmenu ul li, #cssmenu ul ul { list-style: none; margin: 0; padding: 0; } #cssmenu ul { position: relative; z-index: 597; float: left; } #cssmenu ul li { float: left; min-height: 1px; line-height: 1em; vertical-align: middle; position: relative; } #cssmenu ul li.hover, #cssmenu ul li:hover { position: relative; z-index: 599; cursor: default; } #cssmenu ul ul { visibility: hidden; position: absolute; top: 100%; left: 0px; z-index: 598; width: 100%; } #cssmenu ul ul li { float: none; } #cssmenu ul ul ul { top: -2px; right: 0; } #cssmenu ul li:hover > ul { visibility: visible; } #cssmenu ul ul { top: 1px; left: 99%; } #cssmenu ul li { float: none; } #cssmenu ul ul { margin-top: 1px; } #cssmenu ul ul li { font-weight: normal; } /* Custom CSS Styles */ #cssmenu { width: 200px; background: #333333; font-family: 'Oxygen Mono', Tahoma, Arial, sans-serif; zoom: 1; font-size: 12px; } #cssmenu:before { content: ''; display: block; } #cssmenu:after { content: ''; display: table; clear: both; } #cssmenu a { display: block; padding: 15px 20px; color: #ffffff; text-decoration: none; text-transform: uppercase; } #cssmenu > ul { width: 200px; } #cssmenu ul ul { width: 200px; } #cssmenu > ul > li > a { border-right: 4px solid #1b9bff; color: #ffffff; } #cssmenu > ul > li > a:hover { color: #ffffff; } #cssmenu > ul > li.active a { background: #1b9bff; } #cssmenu > ul > li a:hover, #cssmenu > ul > li:hover a { background: #1b9bff; } #cssmenu li { position: relative; } #cssmenu ul li.has-sub > a:after { content: '+'; position: absolute; top: 50%; right: 15px; margin-top: -6px; } #cssmenu ul ul li.first { -webkit-border-radius: 0 3px 0 0; -moz-border-radius: 0 3px 0 0; border-radius: 0 3px 0 0; } #cssmenu ul ul li.last { -webkit-border-radius: 0 0 3px 0; -moz-border-radius: 0 0 3px 0; border-radius: 0 0 3px 0; border-bottom: 0; } #cssmenu ul ul { -webkit-border-radius: 0 3px 3px 0; -moz-border-radius: 0 3px 3px 0; border-radius: 0 3px 3px 0; } #cssmenu ul ul { border: 1px solid #0082e7; } #cssmenu ul ul a { font-size: 12px; color: #ffffff; } #cssmenu ul ul a:hover { color: #ffffff; } #cssmenu ul ul li { border-bottom: 1px solid #0082e7; } #cssmenu ul ul li:hover > a { background: #4eb1ff; color: #ffffff; } #cssmenu.align-right > ul > li > a { border-left: 4px solid #1b9bff; border-right: none; } #cssmenu.align-right { float: right; } #cssmenu.align-right li { text-align: right; } #cssmenu.align-right ul li.has-sub > a:before { content: '+'; position: absolute; top: 50%; left: 15px; margin-top: -6px; } #cssmenu.align-right ul li.has-sub > a:after { content: none; } #cssmenu.align-right ul ul { visibility: hidden; position: absolute; top: 0; left: -100%; z-index: 598; width: 100%; } #cssmenu.align-right ul ul li.first { -webkit-border-radius: 3px 0 0 0; -moz-border-radius: 3px 0 0 0; border-radius: 3px 0 0 0; } #cssmenu.align-right ul ul li.last { -webkit-border-radius: 0 0 0 3px; -moz-border-radius: 0 0 0 3px; border-radius: 0 0 0 3px; } #cssmenu.align-right ul ul { -webkit-border-radius: 3px 0 0 3px; -moz-border-radius: 3px 0 0 3px; border-radius: 3px 0 0 3px; } Edited by Dorkmind, 26 November 2014 - 05:00 PM. This topic has been moved to JavaScript Help. http://www.phpfreaks.com/forums/index.php?topic=306168.0 This topic has been moved to Miscellaneous. http://www.phpfreaks.com/forums/index.php?topic=343488.0 (not sure if this should be in php or javascript section) I am trying to create a dropdown list that loads content according to the option chosen.. The idea is that you select from 4 or so dropdown boxes, which then selects the appropriate content that the user picked Pretty much like http://www.cooldiamonds.com/ (after you click enter) This is what I've got so far: Option.html Code: [Select] <script src="http://code.jquery.com/jquery-latest.js" type="text/javascript"></script><br> <script type="text/javascript"> $(document).ready(function(){ $('.select').change(function() { var option = $(this).val(); $.get('option.php', {select:option}, function(data) { $('#result').html(data).hide().fadeIn(1000); }); }); }); </script> </head> <body> <p> Selection 1</p> <select name="select" id="select" class="select"> <option value="">Select</option> <option value="option1">Option 1</option> <option value="option2">Option 2</option> </select> <p> Selection 2</p> <select name="select2" id="select2" class="select"> <option value="">Select</option> <option value="option3">Option 3</option> <option value="option4">Option 4</option> </select> <p> Selection 3</p> <select name="select3" id="select3" class="select"> <option value="">Select</option> <option value="option5">Option 5</option> <option value="option6">Option 6</option> </select> <p> Selection 4</p> <select name="select3" id="select3" class="select"> <option value="">Select</option> <option value="option7">Option 7</option> <option value="option8">Option 8</option> </select> <div id="result" style="border:1px solid #000;padding:10px;color:#ff0000;display:none;"></div> option.php Code: [Select] <?php // Multiple Selections if ($_GET['select'] == 'option1' && $_GET['select2'] == 'option3') { echo 'the option you have chosen is 1 and 3';} elseif ($_GET['select2'] == 'option4' && $_GET['select3'] == 'option5' && $_GET['select4'] == 'option7') { echo 'the option you have chosen is 4, 5 and 7';} // and so on //Selection 1 elseif($_GET['select'] == 'option1') { echo 'the option you have chosen is 1';} elseif($_GET['select'] == 'option2') { echo 'the option you have chosen is 2';} //Selection 2 elseif($_GET['select2'] == 'option3') { echo 'the option you have chosen is 3';} elseif($_GET['select2'] == 'option4') { echo 'the option you have chosen is 4';} //Selection 3 elseif($_GET['select3'] == 'option5') { echo 'the option you have chosen is 5';} elseif($_GET['select3'] == 'option6') { echo 'the option you have chosen is 6';} // Selection 4 elseif($_GET['select4'] == 'option7') { echo 'the option you have chosen is 7';} elseif($_GET['select4'] == 'option8') { echo 'the option you have chosen is 8';} ?> You can view it he http://adamwatkin.com/option.html As you can see selection 1 works fine, but the other selections do not work and neither does multiple selections. Its almost certainty theres errors in the code, does anyone have any idea what the problem is? Any help will be appreciated Cheers This topic has been moved to Ajax Help. http://www.phpfreaks.com/forums/index.php?topic=349338.0 |