Nix
-
Posts
12 -
Joined
-
Last visited
Never
Posts posted by Nix
-
-
Oh, I noticed that very few members actually filled out required data (region and instrument from their profiles)!
That's why query was returning weird results :D
Thank you for your time and effort in solving this "issue", kickstart!
King regards!!!
-
Tnx for reply
Worked fine, listing significant amount of users. Also worked when I added
WHERE prn_user_profile.up_instrument='". $instrument ."'
at the end, but not when added
WHERE prn_user_profile.up_instrument='". $instrument ."' AND prn_user_list.ul_region_id = '". $region ."'
Any way that could be fixed?
-
Hi, mates!
The following query acts very strange, it returns only 1 result instead of X...
I might be doing it wrong somewhere
<?php $query = "SELECT ul_user_id, ul_nick, ul_region_id, up_user_id, up_instrument FROM prn_user_list, prn_user_profile WHERE (prn_user_list.ul_region_id='". $region ."') AND (prn_user_list.ul_user_id = prn_user_profile.up_user_id) AND (prn_user_profile.up_instrument = '". $instrument ."')"; $result = mysql_query($query) or die(mysql_error()); while($row = mysql_fetch_array($result)) { echo "User: ". $row['ul_nick'] ."<br />"; echo "Region: ". $row['ul_region_id'] ."<br /><br />"; } } ?>
Tnx in advance!
-
Sorry for double posting, browser bug. Delete one of them.
-
Hi, mates!
I'm having a headache since I tried messing up with mod_rewrite...
The story follows:
[*]Visitor types: http://abc.example.com
[*]htaccess calls for http://example.com/profile.php?id=abc and displays abc's profile within abc virtual subdomain
everything is cool and calm until I try to call any page from root:
http://abc.example.com/page1.php
The page doesn't show, neither displays any error. It just returns to the previous page with the same content as before opening page1.php from root.
At the moment, I use the following .htaccess code:
Options +FollowSymlinks RewriteEngine on # as I hate www, I hide it with this: RewriteCond %{HTTP_HOST} ^www\.(.+)$ [NC] RewriteRule ^(.*)$ http://%1/$1 [R=301,L] RewriteCond %{HTTP_HOST} !^(www\.)?distorzija\.com$ [NC] RewriteCond %{HTTP_HOST} ^(www\.)?([^\.]+)\.distorzija\.com$ [NC] RewriteCond %{DOCUMENT_ROOT}/%2%{REQUEST_URI}/ -d RewriteRule [^/]$ %{REQUEST_URI}/ [R=301,L] # with this I call for user ID and display the content via profile.php RewriteCond %{ENV:REDIRECT_STATUS} ^$ RewriteCond %{HTTP_HOST} !^(www\.)?distorzija\.com$ [NC] RewriteCond %{HTTP_HOST} ^(www\.)?([^\.]+)\.distorzija\.com$ [NC] RewriteRule ^(.*)$ /profile.php?username=%2 [QSA,L] ErrorDocument 404 /404.php
The point of my agony is: i need to keep the url (abc.example.com) even when opening files from root...
Hope I explained the issue understandable...
Tnx in advance!
Nix
-
Hi, mates!
I'm having a headache since I tried messing up with mod_rewrite...
The story follows:
[*]Visitor types: http://abc.example.com
[*]htaccess calls for http://example.com/profile.php?id=abc and displays abc's profile within abc virtual subdomain
everything is cool and calm until I try to call any page from root:
http://abc.example.com/page1.php
The page doesn't show, neither displays any error. It just returns to the previous page with the same content as before opening page1.php from root.
At the moment, I use the following .htaccess code:
Options +FollowSymlinks RewriteEngine on # as I hate www, I hide it with this: RewriteCond %{HTTP_HOST} ^www\.(.+)$ [NC] RewriteRule ^(.*)$ http://%1/$1 [R=301,L] RewriteCond %{HTTP_HOST} !^(www\.)?distorzija\.com$ [NC] RewriteCond %{HTTP_HOST} ^(www\.)?([^\.]+)\.distorzija\.com$ [NC] RewriteCond %{DOCUMENT_ROOT}/%2%{REQUEST_URI}/ -d RewriteRule [^/]$ %{REQUEST_URI}/ [R=301,L] # with this I call for user ID and display the content via profile.php RewriteCond %{ENV:REDIRECT_STATUS} ^$ RewriteCond %{HTTP_HOST} !^(www\.)?distorzija\.com$ [NC] RewriteCond %{HTTP_HOST} ^(www\.)?([^\.]+)\.distorzija\.com$ [NC] RewriteRule ^(.*)$ /profile.php?username=%2 [QSA,L] ErrorDocument 404 /404.php
The point of my agony is: i need to keep the url (abc.example.com) even when opening files from root...
Hope I explained the issue understandable...
Tnx in advance!
Nix
-
Place the following code before anything in page:
<?php ob_start(); ?>
and the following at the end:
<?php ob_end_flush(); ?>
-
No worries! Glad that helped
Cheers!
-
Not sure I got your point, but try with this:
<?php $referer = preg_replace("/(http:\/\/(.*)\/)[\S]*/", "\\1", $_SERVER['HTTP_REFERER']); $name = preg_replace("/http:\/\//", "", $referer); echo $name; ?>
-
You should use utf8_unicode_ci as charset for any table in order to use Cyrillic characters... Also, be sure you've placed this meta in r document:
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
Or, if even then fails, try defining the charset for use with queries:
$query = "SELECT something FROM somewhere WHERE id = 1"; mysql_query("SET CHARACTER SET utf8"); mysql_query("SET NAMES utf8"); $result = mysql_query($query) or die(mysql_error());
cheers!
-
@d_barszczak, how did you managed it? ???
Best Way to Database for Messaging
in Application Design
Posted
Don't know if this is going to help, but I found this on the net:
http://www.pixel2life.com/publish/tutorials/608/simple_private_messaging_system/
Regards!
Nix