PHP - Ctrl+f5 Hard Refresh Explanation And Solution
Hi guys. First of, English is not my spoken language so have patience
I've google it and done some reading regarding "hard refresh" but i cant find the information i'm looking for. Lets say that i visit a website that i've visit 6 month earlier, and what if they done some changes that require a so called hard refresh. How should people know that the site require a ctrl+5? I mean, i could be visit sites that looks different without my knowledge, that could been changed several month ago? How does it work? Is it manage automatically or is it up to the webmaster to implate some codes like Code: [Select] <?php header("Cache-Control: no-cache, must-revalidate"); // HTTP/1.1 header("Expires: Sat, 26 Jul 1997 05:00:00 GMT"); // Date in the past ?> I dont know much about site development and i try to learn as much as i can. Is there no better way to handle this. And my second question. Where should i paste codes like this to solve the cache problem? In the header.php? Similar TutorialsHi, I need some telnet function written by php. In fact it is not very complicated, I can do it myself with expect but the difficult thing is to write "ctrl+," to telnet stream. Connecting to device is a little bit weird. Login prompt doesnt appear on cli without sending "ctrl+,". If you send "ctrl+," then "?" appears after you can write "login" to write your user name... something like that Quote Connected to 1.1.1.1 (1.1.1.1). Escape character is '^M'. here it is waiting for ctrl+, and after Quote ? appears, now you can write login Quote ?login Enter name: it's waiting for user name. How can I send "ctrl+," character via fwrite function of php? Hi all, Thanks for reading. I'm running a script using jQuery that auto-refreshes a <div> on the index page from an external PHP script to get all the rows in a database and display them on the index page. The script works great - here it is as follows: Code: [Select] <script type="text/javascript"> $(document).ready(function() { $("#responsecontainer").fadeOut("fast").load("getrows.php").fadeIn("slow"); var refreshId = setInterval(function() { $("#responsecontainer").fadeOut("fast").load('getrows.php').fadeIn("slow"); }, 5000); $.ajaxSetup({ cache: false }); }); </script> The getrows.php script I'm working with looks like this: Code: [Select] <?php $rowsQuery = mysql_query("SELECT * FROM Happenings WHERE HappeningDate='$today'"); if (mysql_num_rows($rowsQuery) == 0) { $happeningsToday = "There are no happenings today."; } else { $allHappeningsToday = 1; while ($getHappeningsToday = mysql_fetch_array($rowsQuery)) { $happeningName = stripslashes($getHappeningsToday['HappeningName']); $happeningDate = $getHappeningsToday['HappeningDate']; $happeningDescription = $getHappeningsToday['HappeningDescription']; if ($allHappeningsToday == 1) { $happeningsToday .= " <div class=\"box\"> <p>".$happeningName." | ".$happeningDate." | ".$happeningDescription." </div>"; $allHappeningsToday = 2; } else { $happeningsToday .= " <div class=\"box\"> <p>".$happeningName." | ".$happeningDate." | ".$happeningDescription." </div>"; $allHappeningsToday = 1; } } } echo $happeningsToday; ?> This script works great as well. Currently, the auto-refresh jQuery script as you can see if getting and fading in/out all of the rows. Off of the above getrows.php script, is there a way after I could get only the newly created rows since the last refresh and only fade those in and out while leaving the others already loaded by the auto-refresh script to not fade in/out? Any ideas, thoughts or suggestions would be unbelievably helpful. Thank you very much. I just want to clarify what this line means...
<?php if(get_post_meta($id, "title_override_text", true) !== '') { ?>Is this saying, if 'title_override_text' exists but doesn't contain any value? Thanks in advance. If I am trying to say something like: if a variable is not empty, would I do this? if ($id != "") or does the "" mean ANYTHING instead of NOTHING? The reason I'm asking is because my home.php page does not have an id associated with it when a person first comes to the site, but when a user clicks on the "home" links then the id for the home page is set to 13. So I get an error for some of the lines when a user first visits the page because all the info for the page is based on the id (which isn't set yet). home.php is pointed to by my controller index.php script which so far only says <?php include $_SERVER['DOCUMENT_ROOT'] . './includes/magicquotes.inc.php'; include $_SERVER['DOCUMENT_ROOT'] . './includes/db.inc.php'; include 'home.php'; ?> is there a way to make the include 'home.php'; line point to something like include 'home.php?id=13' without having to have an actual file called home.php?id=13 on the server? Thanks Hello everyone, Can somebody help me? I am a novice in PHP programming. I do not understand a line of code below: $action = isset($_GET['action']) ? $_GET['action'] : ''; The variables $action saves the values obtained by the GET method, but what does this piece of code ? $_GET['action'] : ''; Thanks in advance! I'm getting a strange error for this code, but i'm unable to find out what's wrong, the error is below: Quote Parse error: parse error, expecting `'&'' or `T_VARIABLE' in on line 12 Here's the code: function CMySQL_Create($Username, $Password, bool:$md5 = true) { switch($md5) { case false: { mysql_query("INSERT INTO " . $ACCOUNT_TABLE . " (" . $USERNAME_FIELD . ", " . $PASSWORD_FIELD . ") VALUES('" . mysql_real_escape_string($Username) . "', '" . mysql_real_escape_string($Password) . "')") or die(mysql_error()); } case true: { mysql_query("INSERT INTO " . $ACCOUNT_TABLE . " (" . $USERNAME_FIELD . ", " . $PASSWORD_FIELD . ") VALUES('" . mysql_real_escape_string($Username) . "', md5('" . mysql_real_escape_string($Password) . "'))") or die(mysql_error()); } } } The line of this error is: function CMySQL_Create($Username, $Password, bool:$md5 = true) { Any clue? My site keeps track of people using cookies. This is stored in $cookie['supercookie']; There area mods who can recommend normal posters to become mods. What it does its sends the persons cookie to recommend.php recommend.php looks like this. Note when i recommend someone, for some reason my cookie gets unset and it will not let me set a new cookie. I literally don't understand why as the $_cookie['supercookie'] variable is NEVER referneced. i read the GET info containing their cookie, check to see its not and admin or mod, then if they are not i submit their cookie to the pword table and get their uname (this isnt alwatys set) -> Then i add it into a pending table. The script executes perfectly, however for some weird reason it unsets my cookie and wont let me set another one. Its doing my head in. <?php session_start(); include $_SERVER['DOCUMENT_ROOT'] . "/includes/functions.php"; if(isset($_SESSION['lv'] )AND $_SESSION['lv'] > 4){ $pass = "*Private*"; if(isset($_GET['cook'])){ $recby = "Not recorded"; $ck = protect($_GET['cook']); if(!_is_admin($ck) && !_is_mod($ck)){ //everything is fine. //uname,pass,scookie,recby //get details. $res = mysql_query("SELECT * FROM pword WHERE scookie = '$ck'AND level = 'Norm' LIMIT 1") or die(mysql_error()); $row = mysql_fetch_array($res); $uname = stripslashes($row['uname']); mysql_query("INSERT INTO nwg (uname,pass,scookie,recby) VALUES ('$uname','$pass','$ck','$recby')")or die(mysql_error()); add_notice("User: <strong>$uname</strong> has been recommended"); echo "<script>location.href='http://www.imgboard.co.uk/'</script>"; } else{ add_notice("You shouldn't have been able to do that!"); addaction(8,"Recommended /kbos"); echo "<script>location.href='http://www.imgboard.co.uk/'</script>"; die(); } } else{ add_notice("You need to specify a cookie id!"); echo "<script>location.href='http://www.imgboard.co.uk/'</script>"; die(); } } else{ add_notice("Restricted Area"); echo "<script>location.href='http://www.imgboard.co.uk/'</script>"; die(); } ?> I something like this to happen...
A user has a text field and a button, he enters text in the field and clicks the button it will go to a URL. Once it goes to that URL it has a text field, this field would be automatically completed from what the user typed in at the start. On that URL there is also a button, that is automatically clicked once the text field has been automatically entered.
BUT the user only sees the first page where he entered text in the field and clicked the button. Everything that happens after he clicked that button he cannot see.
Is there a particular phrase you would call this from what is happening? If so, what is it and how would I do it? This probably is hard to understand but I tried :/
Thanks
Please delete my other post as I realized it is not what I needed and I cannot delete it myself. Here is exactly what I need. I have X amount of text files (with random names) in each text file there is Y amount of lines with one word on each line. I need to open all X amount of files and take the first line from each and save it in a new txt doc. then take the second line of each and save them to a new text doc. and so on. so I have all the line 1's from all the txt files together and all the line 2's together etc. I hope that makes sense. Ok all I need some help with this. I have been stuck for two days. Basically I have a form that asks a registrant their gender and age, then my script spits out a list of race categories they qualify for. The situation calls for the registrant to be able to register for any category YOUNGER than them, but not older. Screen Shot #1 shows my database setup (this can be changed if you have any better ideas...) that holds the race category information. Here is the sql statement I am using to pull a female racer information, where $race_age is their submitted age. "SELECT * from counts where female=1 and $race_age < age_end and $race_age > age_start" This works, but doesn't pull any categories YOUNGER Than their age. I'm stumpped Thanks for any help in advance. Get a hugh problem with a work in school! We are suposed to optimize a website for moblie devices.. Just by using xhtml, css and php. the problem is that I want the meny to just show at the front page for mobile devices.. I konw that I can choos pic with < img > < media="only screen and (min-width: 640px)" src="bild1.jpg" /> < media="only screen and (min-width: 800px)" src="bild2.jpg" /> </ img > is it possible to do a if construct in any point with using media? please help, Im lost. Hey guys, this is what I'm trying to do. I want to print on the member's profile page, a list of the products he has bought so far. I've come with two solutions: A) add a new field to the products' table, with the ID of every clients that bought that product; B) add a new field to the members table, with the ID of every products he bought; These are pretty similar approaches, but I've no idea on how can this be done. It would look like: Bought: 2, 3, 4, 5, I dont know how to write this data or how to read it. Any idea? Thanks! I get the following error: Quote Parse error: syntax error, unexpected ';' in /hermes/web06/b1946/moo.rghollenbeck/index.php on line 35 But here is the only php code on the whole page: . . .more html code above <?php // PHP version: 5.2.12 // MySQL Version: 5.0.77 $link = mysql_connect('path', 'username', 'pword'); if (!$link) { die('Could not connect: ' . mysql_error()); } mysql_select_db(guestlist); $Users_IP_address = $_SERVER["REMOTE_ADDR"] ; echo "<input type='hidden' name='ip' value="; echo $Users_IP_address; echo ">"; $first_name=mysql_query("SELECT 'fname' FROM tblMain; WHERE 'ip'=" . $Users_IP_address); // pseudocode section: // If $first_name !null{ // echo "Hello " . $first_name; // } // end pseudocode section: // something like that ?> more html code below. . . Thank you. Sorry this may sound insane. Is there anyway to accomplish this, using paypal you can creat buy it now buttons and whatnot. The problem with these is you set the price of the time when making the button. Is there a way to set the price with php thus creating a dynamic price instead of a static one? I know you can send paypal vars. but is there a way to edit the price? Thanks I hope that makes sense at all I'd like to detect emails that hard bounce after i send out my newsletter, and then delete them from the table that stores them in my database. Any ideas? Thank you. hey guys so I have this code: $result = mysql_query("SELECT * FROM pec_mssgs ORDER BY (y / m) DESC, d ASC"); while($row = mysql_fetch_array($result)) { echo "•<a style='text-decoration: underline; font-weight: bold;' href='../index?id=".$row['id']."'>". $row['m']."/".$row['d']."/".$row['y'] . " - ".$row['title']."</a>"; echo "<br /><br />"; } in my database instead of doing date I have 3 rows d, m, y, which correlate to day, month, year. now currently its echo out a list and sorting by year then month then day this way the events which are happening soonest will be at top. the problem is it shows events that has already passed. what do I do? It will be way to much work to to back and recode the application to just use date. is there a way I can create a var. using my d/m/y then compare that var. to the current date or something? thanks for the help. Hi guys, Here's my problem. My company wants to use SSRS to generate reports. The backend, what stores the data for the report is MS SQL 2005 (and no, I can't upgrade it to 2008, we don't have the licenses for it). When I used one of their examples to login, I got an error stating that the URL, username or password might not be correct. But when I do this, I connect just fine: Code: [Select] $client = new SoapClient("http://sampleURL/reportserver/reportexecution2005.asmx?wsdl", array('login' => "lmaster\SVCWEBDOCS", 'password' => "pdfconverter")); Now, honestly, I don't know much about this and I'm still doing some research, has anyone tried to make this SDK spit out a report? I'd appreciate some guidance/direction as to what to do next. Also, if you could tell me about some of your experiences in getting to work, I'd really appreciate it. This topic has been moved to MySQL Help. http://www.phpfreaks.com/forums/index.php?topic=328677.0 In ubuntu 18.10 , i created a folder name db in the external usb hard dirve changed the ownership to the www-data the apache2 server and set the permissions to 777 , i run this php code and get the permission error: <php chdir('/media/user/e46cafba-2656-4e42-b1c9-6417f28839df/db/'); system('./rs'); ?> but the php code cannot change to the dir and get the error: [21-Feb-2019 10:43:26 UTC] PHP Warning: chdir(): Permission denied (errno 13) in /home/user/www/html/rse4db.php on line 5
hello, if i have $big=3410 how can i take the last 2 digits of that to make it so that i only get the 10? hope this makes sence. |