Jump to content

schme16

Members
  • Posts

    97
  • Joined

  • Last visited

    Never

Everything posted by schme16

  1. This code works fine in firefox (http://mooseinc.net/chat) but refuses to refresh the page in IE. the way it works is i have a page where all the database is dumped and i import the data from that file every second. i think it might be to do with the import file script...but i'm not that familia with JS....PLEASE HELP! Heres the code for you guys to disect: <SCRIPT LANGUAGE="Javascript"> <!-- var rfNodeId=''; var xmlhttp; function include(pURL, pNodeId) { if (arguments.length!=0) { var url=pURL; if (arguments.length>=2) { rfNodeId=pNodeId; } getFile(pURL); if ((typeof(xmlhttp))!='object') { document.write('You need to upgrade your browser to use this page.\r\nAs of March 2006 more than 98% of the web browsers in use support the remote scripting object. Either your browser does not support remote scripting or the support has been disabled.'); } }else{ if (xmlhttp.readyState==4) { if (xmlhttp.status==200) { if (rfNodeId=='') { document.write(xmlhttp.responseText); }else{ document.getElementById(rfNodeId).innerHTML=xmlhttp.responseText; } } } } } function getFile(pURL) { var objError=false; try { if (window.XMLHttpRequest) { // code for Mozilla, Safari, etc xmlhttp=new XMLHttpRequest(); } } catch(e) { objError=true; } try { if (window.ActiveXObject) { //IE xmlhttp=new ActiveXObject('Microsoft.XMLHTTP'); objError=false; } } catch(f) { objError=true; } if (!objError) { xmlhttp.onreadystatechange=include; xmlhttp.open("GET", pURL, true); // leave true for Gecko xmlhttp.send(null); }else{ alert('Your browser does not appear to support remote scripting.'); xmlhttp=false; } } var x = 1; var y = .5; var yes = 'true'; function startClock(){ x = x-y; document.frm.clock.value = x; setTimeout("startClock()", 100); if(x==.5){include('dump.php', 'Chat_window');} if(x==0){include('users.php', 'online'); x=1;} Thanks in advance!
  2. i've scoured the net and all i can find is ways to read XML data, but people keep saying its easy to get the contents of a txt file (the file is on the server that the script will be launched from...i was informed that it cannot be done otherwise) but no-one will sya how its done.... Thanks in advance for any help!
  3. Hey everyone, just wondering two things: one, how do chat programs that are done in php know when to update the page, and two how do i make the page scoll to the bottom when its opened. i'd post code but havn't got any as of yet, i'm all out of ideas....heck even a few links to tutorials'd be fine.
  4. Thats kool, just thoguht i'd mention it is all, and like i said, far be it my place to say anything in the first place...i'm usualy the one posting out of place ( mostly due to have a million tabs open at once!)
  5. far be it my place to mention this, but this area is for php, and while i'm not certain but i think it might only allow for php code to be placed here
  6. Thanks, a close friend offered to help my make them.
  7. Thanks redbullmarky for the heads up, I'll simply disallow going higher than document level! any other suggestions anyone?
  8. Basically this is a page that shows all the files in a directory (either a defined one or by default it will show everything in the directory it sits in). Its not meant to fancy, but any suggestions are welcome (read: Encouraged). http://development.mooseinc.net/software/1/
  9. I've found a rather ungraceful approach to it: <?php $file_1 = explode('.',$file); $file_1 = explode((0),$file_1[0]); $file_1 = explode((1),$file_1[0]); $file_1 = explode((2),$file_1[0]); $file_1 = explode((3),$file_1[0]); $file_1 = explode((1),$file_1[0]); $file_1 = explode((4),$file_1[0]); $file_1 = explode((5),$file_1[0]); $file_1 = explode((6),$file_1[0]); $file_1 = explode((7),$file_1[0]); $file_1 = explode((,$file_1[0]); $file_1 = explode((1),$file_1[0]); $file_1 = explode((9),$file_1[0]); ?>
  10. maybe something like $queryLastReply = " SELECT MAX(actionID), name, subjectID, subject, timestamp FROM onetable GROUP by subjectID, actionID "; but i'm not sure, i'm used to using order rather than group...but esentialy the look to be doing the same thing.
  11. I'm wanting php to explode a file name that has numbers at the end...mostly I want the numbers gone...so if there's another way around it I'd love to hear it... This is what I got so far: $file_1 = explode('.',$file); //Gets rid of the .extension $file_1 = explode(int,$file_1[0]); // failed attempt at removing the numbers.
  12. Can php understand if a number is a perfect division of five (i want it to do five things then alter slightly the do another five things) i've got as far as: <?php $x = 0 while($x == *code for division of five*) {$x++;} ?>
  13. Every time I put a ' or " in a form and tell php to print it every time the user hits the send button, it escapes them...is there a way to make it stop that as its really annoying me and the teacher that i'm doing this for. Thanks in advance!
  14. Meh, The opinions shared here mean nothing (mine included, should I bother to share them) I just wanted an opinion from a group that spent their lives well, looking at sites..the website since the time when each of you visited has changed dramatically, there's now a gallery with Boolean search, there's a fully functional image resizer/renamer/re-sampler/archiver (all code within it personally coded from scratch), the quality of my website is constantly undergoing improvement's, its not that your opinions aren't valid (because they really are) just that they quickly became obsolete (except for the person with the problem with the colour scheme...you'll still have that problem, oh! and the guy with the problems with the members page (its still the same, its not ready to be displayed yet) and the splash screen, you'll have to speak with the designer as to why its so tall, he believes that everybody should (not does, he's not naive) have a 19" monitor.)
  15. Thanks for the conceptual base upon which i wrote the code (I'm a person that has to understand the process in order to create it...come people can create without knowing that...but often I can write exceptionally when I have thought out what it is being done)... The code I ended up using (for anyone else out there who needs help) is: [code] if (($logged[username]) != (NULL)) { $update = mysql_query("Update users set timestamp = '$realtime' where username = '$logged[username]'"); } //This strips the user of their online status if the've been 'offline' for x minutes. $getuser = mysql_query("SELECT * from users"); while ($user = mysql_fetch_array($getuser)) { $sumtime =(($realtime) - ($user[timestamp])); if ($sumtime > 300) { $update = mysql_query("Update users set online = 'false' where username = '$user[username]'"); } } //this is for the offlinners to get re-instated as online. $getuser = mysql_query("SELECT * from users"); while ($user = mysql_fetch_array($getuser)) { $sumtime =(($realtime) - ($user[timestamp])); if (($sumtime < 300)  and ($user[loggedout] == 'false')) { $update = mysql_query("Update users set online = 'true' where username = '$user[username]'"); } } [/code] Variable List: $realtime = time(); $logged is the persistence of the users settings(table values)
  16. being a windows user, how do i accomplish the cron job with scheduled tasks?
  17. I've made a website (http://josef-stalin.com but its not about him dont worry) and i've set it so that when a user logs in it sets a value in the users table data to "online" and for a list of people with this value to be shown on the site. My Question is, how can i make my website set that value to "offline" when the user closes the browser or navigates away from my domain.... or if its easier, how can i set it so that after about 30mins the cookie timesout (but i'd need to be told how to make this way set the value to offline when the cookies has timed out) any help is greatly appreciated!
  18. it would hardly be building the entire script, and i'd be just as happy with a detailed explanation as to where the preg-something function goes and how to actually make it work...most of the tutorials out their are comprehensive...but never show you where in the code it has to sit and what the variables should be set to.....
  19. this is my website...its only just started to get php implementaion...this is because until recently i could write php...and within 3 days i wsa able to make all this...i'm kinda pround of it...so go easy but critiques are still welcome!                               [url=http://schme16.selfip.com][u][b]Just messing With Ya![/b][/u][/url] [b]EDIT: REMOVED SWEARING FROM POST. PLEASE DO NOT ADD SWEAR WORDS INTO A POST. THIS IS FORBIDDEN[/b]
  20. hi all, this is my first or second post here, and i was wondering if anyone out there in teh interwebs was willing to add to a peice of code for me, its a posting system for me to add new update posts to my hompage....but i want to be able to use bb code in it as well as html...no luck so far... heres the code...entirely except of bbcode implementation (thought it'd be easier for you guys to start fro scratch ^_^. [code]<!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=iso-8859-1" /> <title></title> <link href="css/editpage.css" rel="stylesheet" type="text/css" /> <style type="text/css"> <!-- .style6 { font-size: 24px; font-weight: bold; } --> </style> </head> <body> <p>   <?php ob_start(); // allows you to use cookies include("configs/config.php"); include("time.php"); $userlvl = $logged[userlevel]; if (($userlvl)==(2)) { //gets the config page if ($_POST[post]) { // the above line checks to see if the html form has been submitted $username = $logged[username]; $message = $_POST[message]; $realname = $logged[realname]; $email = $logged[email]; //the above lines set variables with the user submitted information if($message==NULL) { //checks to make sure no fields were left blank echo "Type a damned message ya idiot!."; }else{ //Everything seems good, lets insert. $query = mysql_query("INSERT INTO posts (title, realname, username, message, email, date) VALUES('$title','$realname','$username','$message','$email','$date')"); // inserts the information into the database. echo "You have successfully posted! Now redirecting you to you to view your post"; echo ("<meta http-equiv=Refresh content=2;URL=\"posts.php\" />"); } } else {     echo ("<form method=\"POST\"><br /> <div align=center><span class=header>Hello $logged[realname]!     </span><br /><br /> <span class=dingbat>Type the title of your post:</span> <input type=\"text\" size=60 name=\"title\" maxlength=\"45\" /><br /><br /> <span class=dingbat>Type the body of your post:</span><br />     <textarea name=\"message\" cols=\"80\" rows=\"15\" class=\"Viner-Pargraph\"></textarea><br />     *Note that Full Html may be used and is most casses encouraged until the BBCode system has been implemented!   <br /> <input name=\"post\" type=submit class=title value=\"post\">   </div><br />   </form> "); } } else { echo'Sorry but you are not authorized to enter this area!'; } ?> </p> </body> </html> [/code]
  21. my website is frameset based, and once i made a login script i figured out that i can't actualy make it go to the right target (i.e. main ect.) heres a peice of code that needs it done: echo "[<a href=\"admin/admin.php\">Admin Center</a>] &nbsp;&nbsp;"; and i want it to load that into the frameset named "feature". thanks in advance, and any help is appreciated!
×
×
  • 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.