Jump to content

CroNiX

Staff Alumni
  • Posts

    1,469
  • Joined

  • Last visited

  • Days Won

    12

Everything posted by CroNiX

  1. I still wouldn't store as HTML, especially if you're searching for things in the file. That will complicated things. I'd store like: 234::Jake::blabla Then when looping through lines of the file, you could: list($id, $name, $text) = explode('::', $file_line); if ($id == '234') //we already have 234 or for output back into HTML echo '<div id="' . $id . '"><strong>' . $name . '</strong>: ' . $text . '<br/></div>';
  2. VARCHAR won't allocate space for unused characters (stands for Variable Character), it's counterpart CHAR will.
  3. It would be a lot better to store the first and last name separately, then format how you want on output.
  4. You'd have to check the version of MySQL that your new server is using and use something appropriate for that version.
  5. Since you're just linking to the actual file in a dir instead of a script that process the request and plays the video, probably the best way would be using ajax that sends the $row['FileName'] value to a script on the server, which will increment the counter for that movie. You'd just do something like: echo "<a href='alldaymovies/{$row['FileName']}' onclick='playVideo(this.href, {$row['FileName']});' onkeypress='playVideo(this.href, {$row['FileName']});'>Se film</a>"; and then create a js function function playVideo(url, filename) { //code to send the ajax request, POSTing "filename" to the script //.. //in the oncomplete of the ajax event window.open(url); return false; } It would probably be best to send them to a script, which will output the video, rather than linking to the raw file. Then you could put the update code in there whenever a video is requested. That would be more sure-fire.
  6. Would be really helpful to have the XML as well, or the URL you are retrieving it from... We have nothing to test against without it. I don't see the code from your first post in the code from your last post, but in the original...the very first line doesn't make sense: $f = ($game['q']); { What's the { for at the end of that line, just before your first if()?
  7. <form action="http://yoursite.com/movies.php" method="POST"> <select name="ndate"> <option></option> //your options </select> <input type="submit"> </form> Clicking submit will send all form data to http://yoursite.com/movies.php via the POST method. So all values in movies.php would retrieve from the $_POST superglobal Then in your movies.php script, get the form value for the form element named 'ndate', which is your select form element. $ndate = $_POST['ndate'];
  8. Not exactly. Why do you need javascript there anyway, especially if you don't know what it's doing? Just use a regular form with a submit button. You don't have a complete form right now...just a single form element with no form open/close tag. The form open tag should contain the action attribute, where the form gets submitted to (your movies.php script), along with the method, which would be POST. There are tons of tutorials on HTML forms on the net.
  9. It'd either be: $key = $_GET['ndate'] or $key = $_POST['ndate'] depending on how you are submitting your form (POST or GET). Your code is using a javascript function here, but we don't see that code so not sure how your form is being submitted: <select name="ndate" onClick="submitCboSemester();">
  10. Not bad if you bought a bunch when they were a few $'s each
  11. At least that's my interpretation of what the OP is asking. I could be wrong.
  12. I was referring to "exact same time". Like it sounds like he wants all 3 computers to request the data at the same physical time, not just same interval of 10 seconds apart. Like PC 1 send the initial page request at 10:00:10, even if the page was initially accessed at 10:10:05, etc. PC 2 sends the initial request at 10:00:10 even if it was initially accessed at 10:00:01, etc. Looking at the code, if all 3 browsers first accessed the page 2 seconds apart, then all of their requests would be 2 seconds apart (10 seconds in between request intervals though). I think there needs to be a check to delay the refresh the first time to make sure the time (in seconds) is evenly divisible by 10. If not, wait until it is. Like if the current time is 10:00:05, it should wait until 10:00:10 until it starts the 10 second apart interval refreshes. That way, no matter what time the initial request is made from the separate 3 computers, they would still get updated at the same time and not just 10 seconds apart from initial page load. Otherwise it seems they'd have to initially manually access the page from all 3 computers at the exact same physical time to have them refresh at the same physical time.
  13. DRY: Don't Repeat Yourself. If you find yourself writing the same thing over and over (like your opening HTML), then that is a good indicator something is not structured correctly. No matter what your script does, it's going to send the same HTML starting code. So might as well write it once and not 5 times. <!DOCTYPE HTML> <HTML> <HEAD> <TITLE>test</TITLE> </HEAD> <BODY> <?php //all your php code here. ?> </BODY> </HTML>
  14. I think it will take a bit more than that. It seems he want to use the local time on each computer to refresh at certain times, not just intervals, so they will all retrieve the update at the same time (assuming all clocks are sync'd). Like 10:00:00am, 10:00:10am, 10:00:20am, etc.
  15. I'd use an HTML5 doctype. XHTML1 is so old and outdated. <article> is also an HTML5 element, so it would be best to use the correct doctype.
  16. A simple example: $anchor = '<a class="stripped-link lightblue-link profile-page-link" href="/x/xxx+xxx+xxx/xxxx">HER IS THE WANTED TEXT</a>'; $dom = new DOMDocument(); $dom->loadHTML($anchor); foreach($dom->getElementsByTagName('a') as $a) { echo "{$a->nodeValue}<br>"; //"HER IS THE WANTED TEXT" }
  17. You really shouldn't use regex for that, but use the DOM which is more solid.
  18. Something like this: https://www.daniweb.com/web-development/php/threads/364699/php-converting-numbers-to-letters or http://www.tiny-threads.com/blog/2013/11/12/php-convert-number-excel-column-letter-2/
  19. Yeah, that's where he installed the login library. So it works there, but now the OP wants to use the sessions generated by logging in on OTHER pages.
  20. That really depends. Usually you'd just query to see if there are any new notifications for the user on each page (like the menu part of your code), and if so use the appropriate CSS. Like for bootstrap: http://getbootstrap.com/components/#badges
  21. There's nothing in that script that changes the location of session cookies or save paths. Most likely the OP just isn't using $_SESSION properly on his new custom pages outside of that login script.
  22. CroNiX

    Back online.

    Thanks for adding email notifications. Holy flood of email, batman! lol.
  23. Looking the wordpress function up in the wordpress docs might be helpful.
  24. What are you going to do if someone needs to change their appointment? Edit. What are you going to do if someone cancels an appointment? Delete.
×
×
  • 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.