Jump to content

roopurt18

Staff Alumni
  • Posts

    3,746
  • Joined

  • Last visited

    Never

Everything posted by roopurt18

  1. I'm guessing that $item['Avatar'] is a string. In your if-statement you were comparing a string to an int. When this occurs, PHP will attempt to convert the string to an int. When you convert a string to an int, if the first character is not a digit then the string is converted to 0. When that happens, your if-statement became: if( 0 > 0 )
  2. Oops. I have the [OR] on the wrong line. RewriteEngine on #MYSITE.net/WHATEVER > MYSITE.net/_forum/WHATEVER (Note: I want it to show as MYSITE.net but be at /_forum) #forum.MYSITE.net/WHATEVER > MYSITE.net/WHATEVER RewriteCond %{HTTP_HOST} ^MYSITE\.net [OR] RewriteCond %{HTTP_HOST} ^forum\.MYSITE\.net RewriteRule (.*) _forum/$1 [QSA,L] I'm not sure what you want with the blog.MYSITE.net anymore. If you redirect from blog.MYSITE.net to MYSITE.NET it's going to redirect again to _forum. Is that what you want?
  3. Well I didn't do anything to your code that would stop it from displaying results from the database. So if it's not doing that then you have a problem with your mysql_query(), mysql_fetch() code. What does this output: <?php $num_printed = 0; $sql = mysql_query("SELECT Avatar FROM users WHERE Activated = '1' ORDER BY RAND() LIMIT 12"); var_dump( $sql );echo "<br />";//REMOVE ME LATER if (mysql_num_rows($sql) > 0) { while ($item = mysql_fetch_array($sql)) { echo "<pre>" . var_export( $item, true ) . "</pre>";//REMOVE ME LATER if ($item['Avatar'] > 0) { // <-- I'M NOT REALLY SURE WHAT THE INTENT OF THIS LINE IS echo "<img src=\"".$item['Avatar']."\" alt=\"user\" />"; $num_printed += 1; } } } // The following echo is the default pic that you'll need to use. while( $num_printed < 12 ) { echo '<img src="profile/photos/default/default.jpg" alt="default" />'; $num_printed += 1; } ?>
  4. This might do it: RewriteEngine on #MYSITE.net/WHATEVER > MYSITE.net/_forum/WHATEVER (Note: I want it to show as MYSITE.net but be at /_forum) #forum.MYSITE.net/WHATEVER > MYSITE.net/WHATEVER RewriteCond %{HTTP_HOST} ^MYSITE\.net RewriteCond %{HTTP_HOST} ^forum\.MYSITE\.net [OR] RewriteRule (.*) _forum/$1 [QSA,L] #blog.MYSITE.net/WHATEVER > MYSITE.net/STATIC-PAGE RewriteCond %{HTTP_HOST} blog\.MYSITE\.net RewriteRule .* STATIC-PAGE [L]
  5. The only problem I can see with a long-lived connection is if your program isn't using it, i.e. it goes idle, the server may kill it. You'd want your program to detect if the server has killed the connection and re-open it if it has. Other than that I'm not sure it really matters.
  6. If you're using PHP5 and have access to it, I'd recommend using HttpRequest instead of cURL. http://usphp.com/manual/en/book.http.php I primarily use: http://usphp.com/manual/en/class.httprequest.php It's really just a cURL wrapper, but I find it easy to use.
  7. I'm not really sure why you'd want to repeat the default pic over and over, but whatever. <?php $num_printed = 0; $sql = mysql_query("SELECT Avatar FROM users WHERE Activated = '1' ORDER BY RAND() LIMIT 12"); if (mysql_num_rows($sql) > 0) { while ($item = mysql_fetch_array($sql)) { if ($item['Avatar'] > 0) { // <-- I'M NOT REALLY SURE WHAT THE INTENT OF THIS LINE IS echo "<img src=\"".$item['Avatar']."\" alt=\"user\" />"; $num_printed += 1; } } } // The following echo is the default pic that you'll need to use. while( $num_printed < 12 ) { echo '<img src="profile/photos/default/default.jpg" alt="default" />'; $num_printed += 1; } ?>
  8. My editor displays the offending line: $puppy$iplace="$place"."$puppy$i";
  9. if($send) {header( "Location: http://thegrowframe.com/return.html" );} You typically want to call exit() after setting header-location: if($send) {header( "Location: http://thegrowframe.com/return.html" ); exit(); }
  10. Line #2 is an empty line, which still counts as output.
  11. Detect when the db connection has gone away and re-open it.
  12. You're not using mysql_real_escape_string(). I don't see what purpose $got_you even serves; you assign to it and then never use it. What's to stop me from putting whatever I want into delete_id and deleting stuff other people posted?
  13. When it says some items are not secure, that usually occurs because the page itself is delivered over https but some of the images, javascript, css, or other files are still delivered over http. You can use FireBug in FireFox to figure out which resources are being delivered via HTTP on the HTTPS page. Chances are you have absolute links or references in your pages that begin with http://
  14. Hell if I know. Probably some basic linux utilities.
  15. When an attacker gains a known session id the only thing they're able to inherently do is mimic or imitate the user the session id belongs to. If the session id they obtain belongs to a guest who is not logged in and can not do anything, then no harm no foul. If the session id they obtain belongs to a site administrator they can do anything the site administrator can do. But they don't have to decompile your flex application to obtain a session id. The user's browser stores it in a plain text file on the users machine or passes it via the URL, both of which are easily monitored by malicious users.
  16. If you want an actual carriage return in the output, you use a "\n". Try writing a PHP console program that has to fit its output in a display 80 characters wide.
  17. I would start with a VPS or similar, code the site, launch it, and track performance. When your memory, cpu, or hard drive are approaching their limits you need to profile the code to figure out why and update bottlenecked sections of code. At that point you'd also want to start playing with indexes on queries and making sure all of that is optimal. When there's nothing left you can do config or programming wise, then it's time to invest in better or multiple servers.
  18. The OP probably has the method right. As far as efficiency is concerned you'll notice that the "unread topics" only lists 3 pages of topics, i.e. the current day's topics. It doesn't list every topic ever posted. There is probably a cron job to remove entries from this table every day at midnight or something.
  19. Well I notice you have a closing bracket in the code you posted. So maybe they're null.
  20. You're trying to set the location of the iframe, right? Why aren't you using the variable theFrame?
  21. Why don't you try doing a var_dump( $funcall ) right before the offending line and see what's in the variable.
  22. Do you receive a JavaScript error? Does it attempt to load anything? What exactly is the problem?
  23. On top of what mjdamato said, this sounds like you'll be using an HTML table-tag. My experience with dynamically creating tables and elements with DOM is that it works like crap in some browsers. You're much better off creating a DIV and doing something like: mydiv.innerHTML = '<table><tbody><tr><td>A</td><td>B</td></tr></tbody></table>';
×
×
  • 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.