Jump to content

crimsonmoon

Members
  • Posts

    36
  • Joined

  • Last visited

    Never

Everything posted by crimsonmoon

  1. I just need to compare and make sure that user X has loaded this page within the past 5 seconds. Could I compare a PHP time variable maybe. I don't care if they run in more than once but I just want to keep it from running so fast that the script runs before I'm able to change the variables.
  2. I want to make it where every user can only access a certain script every 5 seconds. Would a session be the best way. Any examples anyone could share? Just trying to make sure that someone doesn't click so fast the script runs twice.
  3. Basically in my site many are opening tons of tabs and setting them to refresh at certain intervals which creates more load and creates an unfair environment for everyone else. Firefox or Opera does it easily. The only thing to to would be to increase the time allowed before a new page is allowed to open?
  4. Is that a way through coding to stop people from opening 1000 tabs and just refreshing them. I would like to place a limit on the number of tabs someone can have open.
  5. Would this still have some load being done several times? I went ahead and set it up different. I let them know if they are in the top 5 and then on the page that displays the ranking in detail I give the exact rank since that page only has one table call on it. The server likes it much better. Still if this would not have much load done 20 times on the page it would be nice.
  6. I might have to scratch that idea and just show it if they are in the top 5. The Issue I'm running into is I'm going to have around 20 of these rankings on one page and when you x that query by 20 I"m getting page load times around 1 to 3 seconds and I'm afraid if too many go to look it my really spike up the server load. I'm going to have an option to view all of that type on one page broken up by different pages so I'll just show it on there that why there's only one query.
  7. Tried that and it didn't work. here is what I have mysql_query("SELECT @rank:=0;"); $myrank = mysql_fetch_array(mysql_query("SELECT id,user,rankfield,@rank:=@rank+1 AS rank FROM table ORDER BY rankfield desc HAVING id=$user[id];")); Your Rank Is: <?php print "$myrank[rank]"; ?>
  8. The only way I can think of would be to do a select on the table and order by asc and then increment a PHP variable until $yourid = $select[yourid] or something and then print the value of the rank. I know that will work just fine. Just wondering if they was a select that would do it without need to loop through the entire table to find out.
  9. If I add the limit clause it won't pull the entire table of around 6000 rows. I want to take the table and sort it by a field and be able to pull a rank out for the current user no matter where they are. Is there any way to do this without make a PHP variable that increments until it picks you out.
  10. So the way it sounds there's not a way to do it limited without pulling the whole table. For intance I wanted to show the top five by doing a order by field asc limit 5 But to do this I have to search it until I find the right row. There'll be several of these charts on a page so I was trying to limit the load.
  11. I have a table with data in it. I sort that data by doing an order by FIELD ASC Now after doing my Order By how would I tell what rank or position one field was in the table. Basically I'm wanted to rank a bunch a field and let the user know what rank they are at.
  12. Also I've looked at Zend and it looks pretty good and says it works with Vista. They offer two version the pro and standard. I would probably still use it just like FP and hard code but I do notice the PRO includes an FTP feature. Is that worth another 200? Or should I just DL a program like smartftp or something?
  13. I know alot of you probably dropped your jaw at that title. I've always done my php editing in Frontpage and just hard coded as that gave me the most control. The reason I used Frontpage is my server has the extensions and I found it really easy to publish more than anything. They seemed faster than FTP and I liked how it kept the directory tree in tact. Anyways my home computer now has Vista on it and I heard about Expression Web so I bought it. It works like FP but royally messes up PHP with the Byte Mark Order it adds to every page. That stupid program cost me hours of time changing the ecoding on my files and fixing the issue. So here I sit...EW is on sale at ebay and I need a new editor/ftp. I'm not against paying as I code for a living and it's a tax deduction so what programs are good at this? I wouldn't complain if I had a cool editor that color coded some of the PHP though. Although if something would work free just as good as a pay feature I wouldn't be against that either. Keep in mind I also need something that will work on Vista Ultimate Edition. thanks!
  14. string(74) "http://www.toprpgames.com/vote.php?idno=437&field1=$var[id]&field2=$var2" http://www.toprpgames.com/vote.php?idno=437&field1=$var[id]&field2=$var2 when i try doing a $db['field'] i get the error about encapsulated white space [Wed Feb 28 21:54:18 2007] [error] PHP Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING
  15. Tried that and it's still not working...Still leave the variable like it's a string. I was doing $field[dblink] but I tried the other way as well and still no luck.
  16. This is the field in the DB (It's a link) : http://site.com/home.php?id=$x Now we're on the php page. at the top of the page $x = 23; We pull the field into $field[dblink]. So $field[dblink] is the link I have above. in the php page I print: print "<a href=$field[dblink]>Click Here</a>"; instead of <a href=http://site.com/home.php?id=23>Click Here</a> I get <a href=http://site.com/home.php?id=$x>Click Here</a> So the $x is not changing over to 23 .....what am I doing wrong?
  17. I know how variable work. What I'm asking is if I have a database field that hold a link like I posted above with a variable in it. Then I print the link out in a page right now it just print the variable like $variable. It's not converting the variable to it's actual value. How do you get a variable to change it it's value when the variable in within a variable.
  18. I'm printer a url with php in it from a database field and all that's printing is the link and the variable code. The variable is not changing to the actual #. For example this is what I'm using. This in in the DB. http://link.com/home.php?x=$variable I use this print "$DBField"; and this prints. http://link.com/home.php?x=$variable The variable in not changing over to it's value when it = 1 for instance. Any suggestions?
  19. Is there a statement or way in MySQL to update a several fields in a database to the default value? Basically reseting the value with out deleting it. I can go through an manually do that by looking at the number and manually setting it to that but it would be easier to just say: Update table set field=default That didn't work but that's what I'm trying to do. While at it is there any easy way to do it with PHPMYADMIN which is what I manage my DB's with. Thx
  20. Is there a way to only allow number and letter in a field and not allow all those ASCII characters like ‡¤ñ etc etc I don't like them for usernames as sometimes the browser doesn't read them and they make searching a pain!
  21. Where would I put this? This is how I'm going it. I have this page being called. [code] <?php mysql_connect("localhost", "user", "pass"); mysql_select_db("db"); $click = mysql_fetch_array(mysql_query("select * from table")); $image = imagecreate(140, 30); $white = imagecolorallocate($image, 255, 255, 255); $gray = imagecolorallocate($image, 210, 210, 210); $black = imagecolorallocate($image, 0, 0, 0); $string = "$click[variable]"; for ($i=0; $i<25; $i++) {   $x1 = rand(0,140);   $y1 = rand(0,30);   $x2 = rand(0,140);   $y2 = rand(0,30);   imageline($image, $x1, $y1, $x2, $y2 , $gray);  } $size = rand(4, 5); $x = rand(12 , 80); $y = rand(7 , 12);   imagestring($image, $size, $x, $y, $string , $black); header("content-type: image/png"); imagepng($image); imagedestroy($image); [/code] Then I call the page above is the actual page showing it. [code] <img src=\"thepage.php\"/> [/code]
  22. Players use a program to read the text on the screen if it's a high number then the program clicks and uses the script. Basically their cheating and taking the randomness away. They leave the program running at all times to montior this page.
  23. I have a script that displays a rate on a page. This rate changes every minute and can be from 1 to 200. They get more benifits if they use the script when the rate is higer. So the page displays what the rate is by pulling it from the MYSQL table. I've got some who have a program that reads the text on the screen and if it's a high number then it uses the script. How can I stop this. I thought about a GD image for the rate but I've had issues with those not showing correctly almost like they are being cached. Any other suggestions? They're obviously refreshing numerous times. I've thought about limited the amount of times you can visit the page per hour but that might ruin the fun.
  24. Here is a question then. I've been using Frontpage at work and I'm familiar with it and like the FTP engine. I've never really used Frontpage as frontpage. I just hard code everything. But I've found with frontpage the text is all black. I like how these php editors color code the text for you. Frontpage does this for html/css etc but the second you save the file as .php it goes to crap. There is a PHP Rocket add in for FP but it doesn't seem to work. If I want this feature am I most likely going to leave FP? Will Dreamweaver work ok?
×
×
  • 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.