Jump to content

reportingsjr

Members
  • Posts

    1,183
  • Joined

  • Last visited

Everything posted by reportingsjr

  1. Well you know, you can do your own work.. Its not very nice to just bust in here saying to do this and that and thats it, you will probably leave this forum right after you find a solution.. Plus you are extremly unclear on what you want to do. Maybe you should try learning html which takes about 2 or 3 days or google your issues.. not just post some rude post..
  2. Eh its alright. Someone voted they didnt like my new site design they should have seen it before.. then they would say they like it
  3. Ah no, check out my site (link in siggy) and scroll to the bottom.What it is, is that you insert the ip and time that the site was viewed at,then you do a select query for any time that was in the past X minutes. Heres my code for my counter and visit thing now: $query= "DELETE FROM `counter` WHERE `ip` = '{$_SERVER['REMOTE_ADDR']}'";$result=mysql_query($query);$time = time();$query= "INSERT INTO `counter` VALUES ('NULL', '{$_SERVER['REMOTE_ADDR']}', '{$time}')";$result= mysql_query($query);$query= "SELECT * FROM `counter` ORDER BY `number` DESC LIMIT 1";$result = mysql_query($query);$row = mysql_fetch_object($result);echo "This page has been viewed {$row->number} times.<br />";$maxtime = time() - (60 * 10); $query = "SELECT * FROM `counter` WHERE `timeviewed` >= $maxtime";$result = mysql_query($query) or die ("Error in query: $query. " . mysql_error());$num = "0";if(mysql_num_rows($result) > 0){while($row = mysql_fetch_row($result)){ $num++;}}else{echo "No one on this site currently!";}if($num >= "2"){echo "{$num} people are online or have visited the site in the past 10 minutes.";}else{echo "{$num} person is online or has visited the site in the past 10 minutes.";} Now if you go to my site and scroll to the bottom you will see what it says :)Thanks aspnetguy!!
  4. True, I shoulda googled it. Ill check that out aspnetguy. Thank you!EDIT: read it.. Wow, shoulda realized how simple it is lol. Kinda what I wanted, but it only shows users that have gone to the page/refreshed it in the past 5 minutes. Thats okay I guess.. Thank you!
  5. I know how to create a list that says "7 guests online" and such and it goes up everytime someone visits, but how do you make it go back down when someone leaves? I realize you can make a logout page or a leave site page but in my case people will always be just hitting the close button or going to another website. How can I make it go up and down according to how many people are at your website? I know of a site that does this (uiv2.com, scroll to the bottom and there will be a lin k that says X users online, click it and you will see a list) but I cant figure out how to do it...I really want to know how this is done!!
  6. You can use clipping. Just google "how to make a div scroll with javascript" I saw a really nice one somewhere.. always google before you ask is my method
  7. I see . Ill have to talk to him about it..My host is my brother in law lucky me. He gave me a free domain and free hosting with around 300mb of space and lots of other features. I wouldnt be able to do this otherwise because im only 13 .Oh yeah, he said that he can do cron jobs on the server and he can give me shell access he just needs to change my admin cp to have it on there. Ill email him. He has bad memory
  8. So I couldnt just like find the gd library with all the functions defined it in then include it? How would I go about adding it to my site. or will the host have to do that?
  9. Well, you can use eregi_replace or str_ireplace to remove whatever you need to. Then use the split function to seperate the string at every space and put it into an array.. Ill look more into this later.. too tired.
  10. Well, I wanted to be able to learn how to use and use the gd library (creates images on the page) but my host doesnt have it. Is there a way I can like include it on whatever page I want to use it? Or will I have to go through and edit my php.ini files?
  11. instead of using xml could you use phps include?
  12. Ah yes, the highlight_file one is what I tried out.
  13. justsomeguys approve decline wont work because the page wont be able to tell what to delete, considering you dont send it an id. heres a way you can do it. $result = mysql_query("SELECT * FROM fileinfo WHERE approval=0 ORDER BY date_added ASC");while ($row = mysql_fetch_assoc($result)){ echo "<tr>"; echo "<td><input type=\"radio\" name=\"decline\" value=\"{$row['id']}\">Decline</td>"; echo "<td><input type=\"radio\" name=\"accept\" value=\"{$row['id']}\">Approve</td>"; echo "<td>" . format_date . "</td>"; echo "<td>" . link_to_file . "</td>"; echo "</tr>"; } Then on the page that accepts the form do this: if(isset($_POST['accept'])){$query = "UPDATE `fileinfo` SET approval='1' WHERE id='{$_POST['accept']}'";mysql_query($query) or die("Error:" . mysql_error());}else{$query = "DELETE FROM `fileinfo` WHERE id = '{$_POST['decline']}'";mysql_query($query) or die("Error:" . mysql_error());} Oh yeah, you messed up your mysql connection page lol. Its giving a bunch of errors now..
  14. d'oh! what was I thinking lol. and the highlight function I tried gives the source code.. what exactly is the syntax for that function?
  15. You never thought of using the <pre> tag lol? I tried this once a chat but what happened was like 2 or 3 spaces were added inbetween every letter. You can try it out though.
  16. actually its not hosted by godaddy.com, justsomeguy said they were hosted by theplanet.com and yes the forums got hacked..
  17. Could you use the split function to put it into an array? And what you probably want to do is use the gd library, which is a library that allows you to create custom images by putting strings of text and colors onto it.So what you could probably do is this, look up all the dodad on the gd library and hw to create images, then make it so you can put php in a .gif or some extension like that.. then I beleive there is a highlight page function or something that can pull the source code of a page so you might be able to just put html on the image and it will automatically look like that page. so for the thumbnail you would put this:<img src="render.gif?site=http://w3schools.com" />, I think you know what to do for the rest now
  18. PHP can also do OOP another way, I use this ALOT when using mysql. makes it way easier $var->fooso you can take arrays and do that. for example:$array[name] = reportingsjr;echo $array->name;Now thats just an example. not entirely sure if it will in fact work. It should though. This is used widely with classes by doing this: class mysql{public $host;public $user;public $password;public $db;public $connection;public $result; public function connect(){ $this->connection = mysql_connect($this->host, $this->user, $this->pass) or die ("Unable to connect!"); mysql_select_db($this->db) or die ("Unable to select database!"); } public function close(){ mysql_close($this->connection); } public function query($query) { $this->result = mysql_query($query); }}$foo = new mysql;$foo->host = "localhost";$foo->user = "me";$foo->password = "neverguess";$foo->database = "forum";$foo->connect();$foo->query("SELECT * FROM `users` ORDER BY `id`");while($row = mysql_fetch_object($foo->result)){echo "{$row->id} : {$row->name} <br />";}$foo->close(); Thats probably the first ever actual use of a class Ive ever seen lol.Anyways, hope this helped you understand classes and OOP a bit better lol.
  19. No, I think the closest thing to this would be like javascripts window print function.Why would you need this anyways? Im sure you could use the gd library with variables and such to acheive what you want.
  20. Mines AJAX combined with PHP, that WILL rule the world! It makes for awesome web applications. No more loading to get new serverside data for me!! woohoo
  21. an affiliate is like a partnership, like someone will put your sites link on there site at the bottom or something for free or for a price.Would you put mine on there? Ill put yours on mine lol. Http://www.rsbattlehelp.com
  22. reportingsjr

    Ajax

    Its ok for the bad english.. not everyone has to learn it...Anyways, you have a big problem. You need to first make the xmlhttp request.. Put this somewhere: //make request and such is all below until next commentr = 0; request = new Array();reqChanges = new Array();response = new Array();function Ajax(a, url, mode, data) { var requester = null; reqChanges[a] = 0; try { requester = new XMLHttpRequest(); } catch (error) { try { requester = new ActiveXObject("Microsoft.XMLHTTP"); } catch (error) { try { requester = new ActiveXObject("Msxml2.XMLHTTP"); } catch (error) { alert("Failed to Initiate Request"); return false; } } } requester.open(mode, url); if (mode == "POST") { requester.setRequestHeader("Content-type", "application/x-www-form-urlencoded"); requester.setRequestHeader("Content-length", data.length); requester.setRequestHeader("Connection", "close"); } requester.send(data); return requester;}function AjaxHandle(requester, a) { reqChanges[a]++; // If XMLHR object has finished retrieving the data if (requester.readyState == 4) { try { if (requester.status == 200) { response[a] = requester.responseText; return true; } else if (requester.status != 0) { alert("Error retrieveing URL: "+requester.status); return false; } } catch (error) { alert(error); return false; } return false; } else { return false; }}//end of ajax requests The code above is for actually making a request to the http server, to see if it can and then the second function handles the request, it actually sends and receives informatoin.. basically.Im not sure how to do what you would want but heres one example script of using my code: //pulls the chat out and puts it on the pagefunction fetchChat(){chatter = document.getElementById("chatbox"); request[r] = Ajax(r, "test4.php", "POST", ""); request[r].onreadystatechange = getIt; function getIt(){ if (request[r].readyState == 4 && request[r].status == 200 ) { if (reqChanges[r] < 5) { if (AjaxHandle(request[r], r)) { if (response[r] != null) { chatter.innerHTML = response[r]; } else { alert(response[r]); chatter.innerHTML = "Error"; return false; } } } else { request[r] = null; alert("Connection for chat failed."); chatter.innerHTML = "Error"; return false; } } }} All I did to learn AJAX was disect codes and learn from that. I reccomed you do the same. get a basic understanding of it from tutorials, then google AJAX scripts and source codes or something like that. Then just take the scripts and take them apart. :)Hope this helped you!
  23. okay, I found one error. After you post once, and try it again my javascript error thing says "post is not a function", do you guys think that it stops the javascript or something.
  24. reportingsjr

    Basic

    flahs sites used to be cool a neat and everyone had them, then they got annoying because of the animation and music. Flash sites usually arent too good and people try to stay away from them, so I would recommend making an entire site with flash. maybe like a little thing here or there would be nice but thats it.
  25. Well, if he wanted to spend some time, just make an array, like so: picname = new array(name, counter);picname[0] = shuttle.png,0picname[1] = space.png,0etc... I think thats right, not sure. I hardly every work with arrays
×
×
  • Create New...