
crashmaster
Members-
Posts
169 -
Joined
-
Last visited
Never
Everything posted by crashmaster
-
Hi there, have 1 question: I have a table "users" with 2 columns (for.ex) user_name - user_residence Also I have a "comments" table. Example: I have a page, where are 20 comments by different users. Is it possible to get by 1 query all users information? Now my script works like this $q = mysql_query ("SELECT comment_id, comment_author, comment_text FROM comments LIMIT 20"); while ($z = mysql_fetch_array($q)) { $user_residence = mysql_result(mysql_query("SELECT user_residence FROM users WHERE user_name = '".$z[comment_author]."'"),0); ....etc.... } To show 20 comments I am using 20 queries - to get residence of each user (comment_author). Is there more simple way, how to get residence of all users, that posted comments by a single query? Thank you
-
[SOLVED] Dont understand... very simple
crashmaster replied to crashmaster's topic in PHP Coding Help
Hey, thanks a lot - such an amateur mistake )))) -
Hi, got an error "Fatal error: Function name must be a string in C:\localhost\www\DNBSTEP\pages\lol.php on line 6" lol.php: $video_types = array('videos','tutorials'); $video_url_format = array('videos'=>'video','tutorials'=>'tutorial); $type = 'videos'; echo $video_url_format($type); //this is line 6 How to understand that ?? Thx for any help...
-
Works !! Thx a lot )
-
without any error.. Query accepted by sql engine without any problem.. by order is stil "BY id ASC" .. ((
-
without result...doesnt work.
-
Hi there, have 1 problem. For.ex: I have a $str = '11,23,5,15'; I use this $str in mysql SQL query: mysql_query(" SELECT * FROM tab_table WHERE id IN (".$str.") "); but when I am echoing results, results are ordered by id asc (5,11,15,23)... Hot to make query like this without reordering IDs ??? I need ID order like in $str Thank you for any help or suggestion
-
Hi there, how to make sql query, where I can choos several IDs (primary keys) ?? For example: I have tabel where I have 1000 rows with unique ID each,, Hot can I choose rows with ID (for ex.) 10, 13,22,45,50 by ONE query ?? $q = mysql_query(" SELECT id,img_src,copyright FROM videa WHERE id = '138' AND id = '137' "); It doesnt work... (((
-
Removing "www" from address bar, for any domain
crashmaster replied to adrianTNT's topic in Apache HTTP Server
have you tried to user (.*) instead of ($any_domain) ?? -
Hi there, I have a problem with mod_rewrite. I have a htaccess where I've used code below: RewriteCond %{REQUEST_URI} (page-) RewriteRule ^inzerce-(.*)/page-([0-9]+)$ /index.php?page=inzerce¶ms=$1&pagenumber=$2 [NC] On my local server, when I use this url: localhost/inzerce-xxxx/page-13 script INDEX.php gets 2 vars - $params = xxxx; and $pagenumber=13; WHen I use this on webhosting's server - my script get ONLY 1 var = $params = xxxx/page-13; I dont know how to fix it... Any suggestions .. ?? Thank you
-
[SOLVED] DESIGN critique www.dnbstep.cz
crashmaster replied to crashmaster's topic in Website Critique
If you have Firefox installed, you can get yslow, (but you will need to have firebug installed first, as yslow is an extension of firebug). So on that note, I fired up Firefox, and pushed your site through yslow.. Things to consider.. Consider obfuscating or minifying your scripts (just Google those terms, you'll find plenty of tools that handle those). This will help reduce script sizes. If possible, try to put as many scripts at the bottom of the page, as scripts being downloaded halts the progress of everything else.. having these at the bottom of your page (if possible that is), helps the page visuals load first, then the scripts afterwards. Depending on your server's configuration, perhaps try gzipping some stuf.. by example, I noticed that your index.php is not gzipped...try adding the following line to the top of your page: if (substr_count($_SERVER['HTTP_ACCEPT_ENCODING'], 'gzip')) ob_start("ob_gzhandler"); else ob_start(); If supported, your server will send over a gzipped version, which reduces bandwidth. Checking your total homepage download info, you have 19 HTTP Requests (very nice!.. lower is better), but a total of 221.1k. The breakdown is as such: 12.9K 1 HTML/Text 65.5K 4 JavaScript Files 4.5K 4 Stylesheet Files 8.9K 3 CSS Images 129.2K 7 Images ---------------------------- 221.1K Total size 19 HTTP requests As you can see, your scripts and images add some weight..optimizing both will help things move along faster. When I passed your homepage through smush.it!, I noticed a possible savings of approx. 13% on images... So overall, I do like the site. Clean and nice..but there are optimizations that can be had for sure. Very nice review! THanks a lot, now I will use FIreBug =) -
Why dont you use $_POST ??
-
$url = urlencode($url); ?
-
if you have access to mod_rewrite - just do it like me: create .htaccess file - store this file in the web root folder and add this: RewriteEngine on RewriteCond %{HTTP_HOST} ^yourweb\.com$ [NC] RewriteRule ^(.*)$ http://www.yourweb.com/$1 [NC,L]
-
Hi there, I've decided to create Sitemap.xls for my web, but I have several question's about it. Should I create <url> <loc>http://www.xyz.com/index.html</loc> <priority>1</priority> <lastmod>2006-04-13T03:44:30+00:00</lastmod> <changefreq>daily</changefreq> </url> for EVERY page on my web ?? I have a web portal, where users can posts video, should I record every added video in sitemap.xls ?? I think after several years, this file will be bigger than some MB.. is it normal ? And what about priority ?? What the meaning of this param ?? Thx
-
Try CSS: #bar { position: absolute; bottom: 0px; width: 100%; height:25px; } HTML <div id="bar">Content</div> IT should work ;-)
-
[SOLVED] DESIGN critique www.dnbstep.cz
crashmaster replied to crashmaster's topic in Website Critique
Hey everybody, you dont have your opinion on design ?? -
any IDEAS ?? (((
-
I dont know, where this topic should I post... Hi there, I have index.php which every 60 seconds does AJAX request (checking if user has a new messages), and if response is positive AJAX inputs into HIDDEN <div> (style="display:none") => iframe, where is mp3 player is.. But the problem is: if <div> is hidden - sound doesn't play if <div> isn't hidden - it's shows IFRAME where I can see player, and the sound is played.. Any idea's how to play sound on background without showing hidden div and iframe ?? HTML: <body> <div id="play_sound" style="display:none"></div> ... {JS code} </body> {JS code} is: function check_updates() { var RESP = $.ajax({ type: 'post', url : '/pages/ajax/check_updates.php', cache: false, async: false }).responseText; if (RESP != ''){ $('#play_sound').html('<iframe src="http://www.dnbstep.cz/pages/ajax/play_sound.php" border="0" width="0" height="0"></iframe>'); } setTimeout("check_updates()",60000); } setTimeout("check_updates()",60000); PLAY_SOUND.php CODE is: <embed src="../../files/prehravac/player.swf" width="300" height="100" allowscriptaccess="always" allowfullscreen="true" flashvars="file=../../alarm.mp3&autostart=true" /> Btw: all PATH's are good.
-
[SOLVED] DESIGN critique www.dnbstep.cz
crashmaster replied to crashmaster's topic in Website Critique
I tried to write secure code - you can try whatever you want )) So I will translate some Links: Domu - Home Videa - Videos Navody - Tutorials Fotky - Fotos Souteze, Srazy - isn't ready yet Forum - Forum I will register test account for you (if you want to try some functions..). username: test password: test But I think your exploits won't work )) Almost complete XSS and SQL Injection protection )) But you can try to HACK it )) Future plant: EN, RU - localizations -
[SOLVED] DESIGN critique www.dnbstep.cz
crashmaster replied to crashmaster's topic in Website Critique
do you know any WEB-tool, where I can check total web size to load ?? -
I dont know, where this topic should I post... Hi there, I have index.php which every 60 seconds does AJAX request (checking if user has a new messages), and if response is positive AJAX inputs into HIDDEN <div> (style="display:none") => iframe, where is mp3 player is.. But the problem is: if <div> is hidden - sound doesn't play if <div> isn't hidden - it's shows IFRAME where I can see player, and the sound is played.. Any idea's how to play sound on background without showing hidden div and iframe ?? HTML: <body> <div id="play_sound" style="display:none"></div> ... {JS code} </body> {JS code} is: function check_updates() { var RESP = $.ajax({ type: 'post', url : '/pages/ajax/check_updates.php', cache: false, async: false }).responseText; if (RESP != ''){ $('#play_sound').html('<iframe src="http://www.dnbstep.cz/pages/ajax/play_sound.php" border="0" width="0" height="0"></iframe>'); } setTimeout("check_updates()",60000); } setTimeout("check_updates()",60000); PLAY_SOUND.php CODE is: <embed src="../../files/prehravac/player.swf" width="300" height="100" allowscriptaccess="always" allowfullscreen="true" flashvars="file=../../alarm.mp3&autostart=true" /> Btw: all PATH's are good.
-
Your opinion on www.dnbstep.cz design ?? (if you understand Czech - you can also try some functions )