Jump to content

Tonic-_-

Members
  • Posts

    108
  • Joined

  • Last visited

    Never

Contact Methods

  • AIM
    xTonicxIsxL33T
  • Website URL
    http://www.yourgamercards.net

Profile Information

  • Gender
    Not Telling

Tonic-_-'s Achievements

Member

Member (2/5)

0

Reputation

  1. Hello, It's been awhile since i've used Nginx and a website that I am running on the server uses include_once to include the header, sidebar and footer. The problem is they don't actually load under Nginx and was wondering if anyone else encountered this and knows how to solve this? Nothing logs into the php error log related to it. Here is the conf file. server { listen 80; server_name _; #charset koi8-r; access_log /home/web/logs/host.access.log main; location / { root /home/web/public_html; index index.php index.html index.htm; } error_page 404 /404.html; location = /404.html { root /usr/share/nginx/html; } location ~* ^.+.(jpg|jpeg|gif|css|png|js|ico|xml)$ { access_log off; expires 30d; root /home/web/public_html; } # redirect server error pages to the static page /50x.html # error_page 500 502 503 504 /50x.html; location = /50x.html { root /usr/share/nginx/html; } # proxy the PHP scripts to Apache listening on 127.0.0.1:80 # #location ~ \.php$ { # proxy_pass http://127.0.0.1; #} # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000 # location ~ .php$ { fastcgi_split_path_info ^(.+\.php)(.*)$; fastcgi_pass 127.0.0.1:9000; fastcgi_param PHP_VALUE "error_log=/home/web/logs/php.error.log"; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME /home/web/public_html$fastcgi_script_name; include fastcgi_params; fastcgi_param QUERY_STRING $query_string; fastcgi_param REQUEST_METHOD $request_method; fastcgi_param CONTENT_TYPE $content_type; fastcgi_param CONTENT_LENGTH $content_length; fastcgi_intercept_errors on; fastcgi_ignore_client_abort off; fastcgi_connect_timeout 60; fastcgi_send_timeout 50; fastcgi_read_timeout 50; fastcgi_buffer_size 128k; fastcgi_buffers 4 256k; fastcgi_busy_buffers_size 256k; fastcgi_temp_file_write_size 256k; } # deny access to .htaccess files, if Apache's document root # concurs with nginx's one # location ~ /\.ht { deny all; } }
  2. It returns 76561198509709728 when it was suppose to return 76561198509709722 only the last digit is incorrect :3, tested it on a few other strings and it seems to only be off by a few, but the amount it's off by is not always the same.
  3. Ahh, I kind of thought it may have to be with the servers OS, I went from a 64-bit OS to a 32-bit OS. I tried what you said, sadly it didn't return exactly what I wanted. Suppose I'll just have to reload it with 64-bit again or maybe make a API on a 64-bit OS to call it, thanks anyways :3
  4. Hmm... Alright, I did this a few months ago, I reloaded the OS on my VPS and now I'm getting issues. I'm converting a value like 110000120bfd99a from hex to decimal, it's suppose to return 76561198509709722, but instead, it's returning 7.656119850971E+16 Any ideas how to fix this? It's really starting to annoy me.. I use hexdec($value); Like I said, it worked before I reloaded my OS now it just won't work :\
  5. That coding will work, the issue may be that GD Lib is not installed on the system with freetype. make a test page with <?php phpinfo(); ?> and scroll through it to double check all the PHP modules that are installed on the system and make sure GD is on the list.
  6. Tried browsing the web and didn't find much but what's an effective way to execute shell commands as root through php, I know there's exec but I couldn't get it to work the last time I tried.
  7. Try going into your php.ini file (PHP configuration) and find the line memory_limit and try to raise it to maybe 15M or something? Something a bit higher then whatever the default value may be. I noticed this is a SMF related file so it's safe to assume that this is just a PHP configuration thing that needs to be bumped up a bit more.
  8. Didn't feel right not testing and this will work. <?php $txtfile = "/path/to/file/name.txt"; $handle = fopen($txtfile, "r"); $data = fread($handle, filesize($txtfile)); preg_match_all("/token (.*): (.*?)\n/", $data, $return); foreach($return['1'] as $key=>$value) { echo "Token: " . $return['1'][$key] . "<br />Runtime: " . $return['2'][$key] . "<br /><br />"; } ?>
  9. Maybe... <?php $txtfile = "/path/to/file/name.txt"; $data = fopen($txtfile, "r"); preg_match_all("/runtime (ms) for token (.*?): (.*?)/", $data, $return); $array[token] = $return['1']['0']; $array[runtime] = $return['1']['1']; foreach($array as $var) { echo "Token: " . $var['token'] . "<br />Runtime: " . $var['runtime'] . "<br /><br />"; } fclose($data); ?>
  10. You can use either: while ($row = mysql_fetch_assoc($result)) { $array[id] = $row['gameid']; $array[title] = $row['gametitle']; $array[cover] = $row['cover']; echo "<div class=\"noticia\">$array['title']</div>"; } or while ($row = mysql_fetch_assoc($result)) { $array[id][] = $row['gameid']; $array[title][] = $row['gametitle']; $array[cover][] = $row['cover']; } foreach($array as $key=>$value) { echo "<div class=\"noticia\">$array['title'][$key]<div> }
  11. Could be a problem I did somewhere if you used the while statement instead of for, to confirm this use your original code with the <?php }}?> fix and the echo, if it still does it then it can be the SQL Query statement or somewhere else in the code. I'm not all to familiar with using mysql_query or mysql_fetch_assoc as I use a different connector. Or maybe changing this coding if($nuser){ $userfinal=$nuser; }elseif($auser){ $userfinal=$auser; } to if(!empty($nuser)){ $userfinal=$nuser; }elseif(!empty($auser)){ $userfinal=$auser; } else { echo "No sessions found"; }
  12. To me this sounds like a permissions problem or a misconfiguration in PHP. If you are running this on a linux box try chmodding the file to 0750 (750 via FTP)
  13. I see the problem now, I didn't see notice the if statement above the $members query. Above </table> change it to <?php } } ?> You are not closing if(isset($userfinal)){
  14. Well the syntax fix that I posted automatically echo's the $title variable, I was just suggesting if you don't want to echo / print that result within the while statement that you should load each game into a array and $array[xxxx][] can do it. Hope you get it working though
  15. I suggest fixing this: echo '<td><a href="member_profile.php?username=' . $name['user'] . '">' . $name['user'] . '</a></td>'; Maybe changing it to echo "<td><a href=\"member_profile.php?user=" . $name['user'] . "\">" . $name['user'] . "</a></td>"; Another suggestion is to use a while loop instead of for. <?php session_start(); require 'database.php'; $nuser=$_SESSION['user']; $auser=$_SESSION['admin']; if($nuser){ $userfinal=$nuser; }elseif($auser){ $userfinal=$auser; } if(isset($userfinal)){ $Members = mysql_query("SELECT user FROM characters WHERE level ='1' ORDER BY exp DESC") or die(mysql_error()); ?> <table border="0"> <?php while($name = mysql_fetch_assoc($Members)) { ?> <tr> <?php echo "<td><a href=\"member_profile.php?user=" . $name['user'] . "\">" . $name['user'] . "</a></td>"; ?> </tr> <?php } ?> </table> Either way it should work.
×
×
  • 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.