
sspoke
Members-
Posts
282 -
Joined
-
Last visited
Everything posted by sspoke
-
I just started working with my first .htaccess RewriteRule because when submitting a facebook app, it must end with either a trailing slash or be a dynamic URL. My domain already is used for another project so I put my app into a sub-directory so it looks like this http://www.example.com/app/index2.html I'm trying to convert it to be in this format http://www.example.com/app/fbapp/ I can't use app's sub-directory as index.html or index.php which is already used outside of a facebook with Google Ads, since Google Ads are illegal to be used on facebook, I created a copy of the index.html called index2.html without any Google ads on it. I started messing around with .htaccess and I got it semi-working but in Google Chrome it seems to detect the URL as being a folder and starts loading the stylesheets and javascript scripts from the fake virtual directory assuming that fbapp is a directory when it should be app/file.xxx instead of app/fbapp/file.xxx Here is what I got so far I still don't understand how to use Rewrite Condionals but from my understanding if the RewriteCond is triggered it will run the line right under it, otherwise it will skip it somehow and go to the third line which works fine as long as it's not a script/image/stylesheet/etc... RewriteEngine on RewriteCond $1 !^(favicon\.ico|favicon\.png|robots\.txt|css|js) [NC] RewriteRule ^(.*)$ $1 [E=BASE:%1] RewriteRule ^fbapp index2.html [E=BASE:%1]
-
Hey guys I want to sort the messages by poster_time instead of the usual id incrementing as I have restored a database with auto incrementing id's and very old messages show up on top i'd like to be able to sort them by poster_time to fix that problem. I've attempted to fix this myself but I don't want to lose any functionality, here is my attempt. SELECT t.id_topic FROM {db_prefix}topics AS t' . ($context['sort_by'] === 'last_poster' ? ' INNER JOIN {db_prefix}messages AS ml ON (ml.id_msg = t.id_last_msg)' : (in_array($context['sort_by'], array('starter', 'subject')) ? ' INNER JOIN {db_prefix}messages AS mf ON (mf.id_msg = t.id_first_msg)' : '')) . ($context['sort_by'] === 'starter' ? ' LEFT JOIN {db_prefix}members AS memf ON (memf.id_member = mf.id_member)' : '') . ($context['sort_by'] === 'last_poster' ? ' LEFT JOIN {db_prefix}members AS meml ON (meml.id_member = ml.id_member)' : '') . ' WHERE t.id_board = {int:current_board}' . (!$modSettings['postmod_active'] || $context['can_approve_posts'] ? '' : ' AND (t.approved = {int:is_approved}' . ($user_info['is_guest'] ? '' : ' OR t.id_member_started = {int:current_member}') . ')') . ' ORDER BY ' . (!empty($modSettings['enableStickyTopics']) ? 'is_sticky' . ($fake_ascending ? '' : ' DESC') . ', ' : '') . $_REQUEST['sort'] . ($ascending ? '' : ' DESC') . ' LIMIT {int:start}, {int:maxindex}', to this for testing purposes SELECT t.id_topic FROM topics AS t INNER JOIN messages AS ml ON (ml.id_msg = t.id_last_msg) INNER JOIN messages AS mf ON (mf.id_msg = t.id_first_msg) LEFT JOIN members AS memf ON (memf.id_member = mf.id_member) LEFT JOIN members AS meml ON (meml.id_member = ml.id_member) WHERE t.id_board = 1 ORDER BY ml.poster_time DESC LIMIT 0, 500 Using the code above I've figured out I need ml.poster_time DESC how do I bundle it up with the code at the very top. Here the structures boards structure topics structure messages structure $topic_ids = array(); $context['topics'] = array(); // Sequential pages are often not optimized, so we add an additional query. $pre_query = $start > 0; if ($pre_query && $maxindex > 0) { $request = $smcFunc['db_query']('', ' SELECT t.id_topic FROM {db_prefix}topics AS t' . ($context['sort_by'] === 'last_poster' ? ' INNER JOIN {db_prefix}messages AS ml ON (ml.id_msg = t.id_last_msg)' : (in_array($context['sort_by'], array('starter', 'subject')) ? ' INNER JOIN {db_prefix}messages AS mf ON (mf.id_msg = t.id_first_msg)' : '')) . ($context['sort_by'] === 'starter' ? ' LEFT JOIN {db_prefix}members AS memf ON (memf.id_member = mf.id_member)' : '') . ($context['sort_by'] === 'last_poster' ? ' LEFT JOIN {db_prefix}members AS meml ON (meml.id_member = ml.id_member)' : '') . ' WHERE t.id_board = {int:current_board}' . (!$modSettings['postmod_active'] || $context['can_approve_posts'] ? '' : ' AND (t.approved = {int:is_approved}' . ($user_info['is_guest'] ? '' : ' OR t.id_member_started = {int:current_member}') . ')') . ' ORDER BY ' . (!empty($modSettings['enableStickyTopics']) ? 'is_sticky' . ($fake_ascending ? '' : ' DESC') . ', ' : '') . $_REQUEST['sort'] . ($ascending ? '' : ' DESC') . ' LIMIT {int:start}, {int:maxindex}', array( 'current_board' => $board, 'current_member' => $user_info['id'], 'is_approved' => 1, 'id_member_guest' => 0, 'start' => $start, 'maxindex' => $maxindex, ) ); $topic_ids = array(); while ($row = $smcFunc['db_fetch_assoc']($request)) $topic_ids[] = $row['id_topic']; } // Grab the appropriate topic information... if (!$pre_query || !empty($topic_ids)) { // For search engine effectiveness we'll link guests differently. $context['pageindex_multiplier'] = empty($modSettings['disableCustomPerPage']) && !empty($options['messages_per_page']) && !WIRELESS ? $options['messages_per_page'] : $modSettings['defaultMaxMessages']; $result = $smcFunc['db_query']('substring', ' SELECT t.id_topic, t.num_replies, t.locked, t.num_views, t.is_sticky, t.id_poll, t.id_previous_board, ' . ($user_info['is_guest'] ? '0' : 'IFNULL(lt.id_msg, IFNULL(lmr.id_msg, -1)) + 1') . ' AS new_from, t.id_last_msg, t.approved, t.unapproved_posts, t.is_solved, ml.poster_time AS last_poster_time, ml.id_msg_modified, ml.subject AS last_subject, ml.icon AS last_icon, ml.poster_name AS last_member_name, ml.id_member AS last_id_member, IFNULL(meml.real_name, ml.poster_name) AS last_display_name, t.id_first_msg, mf.poster_time AS first_poster_time, mf.subject AS first_subject, mf.icon AS first_icon, mf.poster_name AS first_member_name, mf.id_member AS first_id_member, IFNULL(memf.real_name, mf.poster_name) AS first_display_name, SUBSTRING(ml.body, 1, 385) AS last_body, SUBSTRING(mf.body, 1, 385) AS first_body, ml.smileys_enabled AS last_smileys, mf.smileys_enabled AS first_smileys FROM {db_prefix}topics AS t INNER JOIN {db_prefix}messages AS ml ON (ml.id_msg = t.id_last_msg) INNER JOIN {db_prefix}messages AS mf ON (mf.id_msg = t.id_first_msg) LEFT JOIN {db_prefix}members AS meml ON (meml.id_member = ml.id_member) LEFT JOIN {db_prefix}members AS memf ON (memf.id_member = mf.id_member)' . ($user_info['is_guest'] ? '' : ' LEFT JOIN {db_prefix}log_topics AS lt ON (lt.id_topic = t.id_topic AND lt.id_member = {int:current_member}) LEFT JOIN {db_prefix}log_mark_read AS lmr ON (lmr.id_board = {int:current_board} AND lmr.id_member = {int:current_member})'). ' WHERE ' . ($pre_query ? 't.id_topic IN ({array_int:topic_list})' : 't.id_board = {int:current_board}') . (!$modSettings['postmod_active'] || $context['can_approve_posts'] ? '' : ' AND (t.approved = {int:is_approved}' . ($user_info['is_guest'] ? '' : ' OR t.id_member_started = {int:current_member}') . ')') . ' ORDER BY ' . ($pre_query ? 'FIND_IN_SET(t.id_topic, {string:find_set_topics})' : (!empty($modSettings['enableStickyTopics']) ? 'is_sticky' . ($fake_ascending ? '' : ' DESC') . ', ' : '') . $_REQUEST['sort'] . ($ascending ? '' : ' DESC')) . ' LIMIT ' . ($pre_query ? '' : '{int:start}, ') . '{int:maxindex}', array( 'current_board' => $board, 'current_member' => $user_info['id'], 'topic_list' => $topic_ids, 'is_approved' => 1, 'find_set_topics' => implode(',', $topic_ids), 'start' => $start, 'maxindex' => $maxindex, ) ); Thanks guys i've been suffering with this for a whole week now.
-
This is probably the wrong section, hell wrong forum but it's worth a try as SMF forums are abandoned this from MessageIndex.php function MessageIndex() which shows the list of topics on the current board you are viewing each topics table (threads) can hold many messages table (replies) each message has a poster_time which is the epoch unix timestamp Now the problem is it's not properly getting sorted. The topics (threads) are sorted by the primary ID and are bumped to top if messages (replies) which contain also a primary id are highest. Pretty much what i'm trying to say messages or topics doesn't matter the highest primary id wins the spotlight. Now I am restoring my database I did some edits to it so it would be compatible with SMF 2.0. Some threads are as old as 1997 yet the last thread posted is on top of the page.. So my question is how do I convert the below SQL queries so I can sort by the timestamp and not the highest Id. ( I know this won't be a problem if you run the forum properly but if I restored a database what can I do now ). Thank you. function MessageIndex() { $topic_ids = array(); $context['topics'] = array(); // Sequential pages are often not optimized, so we add an additional query. $pre_query = $start > 0; if ($pre_query && $maxindex > 0) { $request = $smcFunc['db_query']('', ' SELECT t.id_topic FROM {db_prefix}topics AS t' . ($context['sort_by'] === 'last_poster' ? ' INNER JOIN {db_prefix}messages AS ml ON (ml.id_msg = t.id_last_msg)' : (in_array($context['sort_by'], array('starter', 'subject')) ? ' INNER JOIN {db_prefix}messages AS mf ON (mf.id_msg = t.id_first_msg)' : '')) . ($context['sort_by'] === 'starter' ? ' LEFT JOIN {db_prefix}members AS memf ON (memf.id_member = mf.id_member)' : '') . ($context['sort_by'] === 'last_poster' ? ' LEFT JOIN {db_prefix}members AS meml ON (meml.id_member = ml.id_member)' : '') . ' WHERE t.id_board = {int:current_board}' . (!$modSettings['postmod_active'] || $context['can_approve_posts'] ? '' : ' AND (t.approved = {int:is_approved}' . ($user_info['is_guest'] ? '' : ' OR t.id_member_started = {int:current_member}') . ')') . ' ORDER BY ' . (!empty($modSettings['enableStickyTopics']) ? 'is_sticky' . ($fake_ascending ? '' : ' DESC') . ', ' : '') . $_REQUEST['sort'] . ($ascending ? '' : ' DESC') . ' LIMIT {int:start}, {int:maxindex}', array( 'current_board' => $board, 'current_member' => $user_info['id'], 'is_approved' => 1, 'id_member_guest' => 0, 'start' => $start, 'maxindex' => $maxindex, ) ); $topic_ids = array(); while ($row = $smcFunc['db_fetch_assoc']($request)) $topic_ids[] = $row['id_topic']; } // Grab the appropriate topic information... if (!$pre_query || !empty($topic_ids)) { // For search engine effectiveness we'll link guests differently. $context['pageindex_multiplier'] = empty($modSettings['disableCustomPerPage']) && !empty($options['messages_per_page']) && !WIRELESS ? $options['messages_per_page'] : $modSettings['defaultMaxMessages']; $result = $smcFunc['db_query']('substring', ' SELECT t.id_topic, t.num_replies, t.locked, t.num_views, t.is_sticky, t.id_poll, t.id_previous_board, ' . ($user_info['is_guest'] ? '0' : 'IFNULL(lt.id_msg, IFNULL(lmr.id_msg, -1)) + 1') . ' AS new_from, t.id_last_msg, t.approved, t.unapproved_posts, t.is_solved, ml.poster_time AS last_poster_time, ml.id_msg_modified, ml.subject AS last_subject, ml.icon AS last_icon, ml.poster_name AS last_member_name, ml.id_member AS last_id_member, IFNULL(meml.real_name, ml.poster_name) AS last_display_name, t.id_first_msg, mf.poster_time AS first_poster_time, mf.subject AS first_subject, mf.icon AS first_icon, mf.poster_name AS first_member_name, mf.id_member AS first_id_member, IFNULL(memf.real_name, mf.poster_name) AS first_display_name, SUBSTRING(ml.body, 1, 385) AS last_body, SUBSTRING(mf.body, 1, 385) AS first_body, ml.smileys_enabled AS last_smileys, mf.smileys_enabled AS first_smileys FROM {db_prefix}topics AS t INNER JOIN {db_prefix}messages AS ml ON (ml.id_msg = t.id_last_msg) INNER JOIN {db_prefix}messages AS mf ON (mf.id_msg = t.id_first_msg) LEFT JOIN {db_prefix}members AS meml ON (meml.id_member = ml.id_member) LEFT JOIN {db_prefix}members AS memf ON (memf.id_member = mf.id_member)' . ($user_info['is_guest'] ? '' : ' LEFT JOIN {db_prefix}log_topics AS lt ON (lt.id_topic = t.id_topic AND lt.id_member = {int:current_member}) LEFT JOIN {db_prefix}log_mark_read AS lmr ON (lmr.id_board = {int:current_board} AND lmr.id_member = {int:current_member})'). ' WHERE ' . ($pre_query ? 't.id_topic IN ({array_int:topic_list})' : 't.id_board = {int:current_board}') . (!$modSettings['postmod_active'] || $context['can_approve_posts'] ? '' : ' AND (t.approved = {int:is_approved}' . ($user_info['is_guest'] ? '' : ' OR t.id_member_started = {int:current_member}') . ')') . ' ORDER BY ' . ($pre_query ? 'FIND_IN_SET(t.id_topic, {string:find_set_topics})' : (!empty($modSettings['enableStickyTopics']) ? 'is_sticky' . ($fake_ascending ? '' : ' DESC') . ', ' : '') . $_REQUEST['sort'] . ($ascending ? '' : ' DESC')) . ' LIMIT ' . ($pre_query ? '' : '{int:start}, ') . '{int:maxindex}', array( 'current_board' => $board, 'current_member' => $user_info['id'], 'topic_list' => $topic_ids, 'is_approved' => 1, 'find_set_topics' => implode(',', $topic_ids), 'start' => $start, 'maxindex' => $maxindex, ) ); // Begin 'printing' the message index for current board. while ($row = $smcFunc['db_fetch_assoc']($result)) { //... } }
-
trim whitespace from left and right of html tags
sspoke replied to sspoke's topic in PHP Coding Help
nice one abra and also thanks rifts good read -
How am i to do this either a php builtin function i am unaware about or something simple with regular expressions replacing I need a way to remove whitespace (tabs,spaces,newlines,etc) and anything else that seperates <> tags such as <td class="subject solvedbg"> <div> <span id="msg_1">blah blah space see <a href="blahblah> </div> </td> to <td class="subject solvedbg"><div><span id="msg_1">blah blah space see<a href="blahblah></div></td> Thank you.
-
You did mean DELETE u.*, c.*, c2.*, t.* FROM users u LEFT JOIN chats c ON c.userId = $row['id'] LEFT JOIN chats c2 ON c2.randomUserId = $row['id'] LEFT JOIN typing t ON t.id = $row['id'] WHERE u.userId = $row['id'] right? c2.randomUserId not c.randomUserId ?
-
nevermind solved: tag issue thanks to stackoverflow peeps replaced var N = $('<td><td />').attr('id', 'chattypeorcell').append('or'); to var N = $('<td></td>').attr('id', 'chattypeorcell').append('or');
-
Thanks fenway you're awesome, very smart man. Works like a charm! Although if a user's userId is already deleted all the other queries fail but i doubt that will happen any other way except if I edit the database by hand.
-
I'm trying to generate a small part of the page using jquery which is generating in the wrong matter even though the code looks solid. $('#stages').html(""); var stage = $("#stages"); var L = $('<h2></h2>').attr('id', 'startachat').append('Who do you wish to connect to?'); stage.append(L); var k = $('<table></table>').attr('id', 'chattypes'); stage.append(k); var G = $('<tr></tr>'); k.append(G); var m = $('<td></td>'); var s = $('<img />').attr({'src' : 'data/male_off.png', 'alt' : 'Male', 'class' : 'gender', 'id' : 'genderM'}); var N = $('<td><td />').attr('id', 'chattypeorcell').append('or'); var j = $('<td></td>'); var D = $('<img />').attr({'src' : 'data/female_off.png', 'alt' : 'Female', 'class' : 'gender', 'id' : 'genderF'}); var x = $('<td><td />').attr('id', 'chattypeorcell').append('or'); var l = $('<td></td>'); var z = $('<img />').attr({'src' : 'data/any_off.png', 'alt' : 'Anyone', 'class' : 'gender', 'id' : 'genderA'}); G.append(m); m.append(s); G.append(N); G.append(j); j.append(D); G.append(x); G.append(l); l.append(z); the html it generates has way to many "or" table data output <div id="stages"> <h2 id="startachat">Who do you wish to connect to?</h2> <table id="chattypes"> <tbody> <tr> <td><img src="data/male_off.png" alt="Male" class="gender" id="genderM"></td> <td id="chattypeorcell">or</td><td id="chattypeorcell">or</td> <td><img src="data/female_off.png" alt="Female" class="gender" id="genderF"></td> <td id="chattypeorcell">or</td><td id="chattypeorcell">or</td> <td><img src="data/any_off.png" alt="Anyone" class="gender" id="genderA"></td> </tr> </tbody> </table> </div> I want it to generate something similar to this <div id="stages"> <h2 id="startachat">What's your gender?</h2> <table id="chattypes"> <tr> <td id="chattypetextcell"><img src="data/male_off.png" alt="Male" class="gender" id="genderM"/></td> <td id="chattypeorcell">or</td> <td id="chattypevideocell"><img src="data/female_off.png" alt="Female" class="gender" id="genderF"/></td> <td id="chattypeorcell">or</td> <td id="chattypevideocell"><img src="data/any_off.png" alt="Anyone" class="gender" id="genderA"/></td> </tr> </table> </div> thank you for reading
-
Well problem solved you just have to disable the error page checking in godaddy strangely enough that fixed it.
-
I've tested it out fine on localhost and it works perfectly. Using swfobject.embedSWF("data/videochat.swf", "flash", 322, 516, "10.0.0", null, null, null, null, function (a) { if (!a.success) { //........ } }); on my domain i've used swfobject.embedSWF("/data/videochat.swf", "flash", 322, 516, "10.0.0", null, null, null, null, function (a) { if (!a.success) { //........ } }); still doesn't work i am confused what the problem is.. I've checked out the file @ http://mydomain.com/data/videochat.swf (it exists and it loads up) I did go with the Linux host and all testing was done on a windows host.. although this is strictly clientside code so i have no idea why that matters Thanks i've been trying to solve this for 7 hours also snapped my neck.
-
yah what hosting is this anyways?
-
Check that multiple variables aren't empty?
sspoke replied to rockstarrem's topic in PHP Coding Help
check all at once. replace $_REQUEST WITH $_POST OR $_GET or leave $_REQUEST to check both if you are unsure. foreach($_REQUEST as $name => $value) { if($value == "") { echo $name." is empty"; } } this supports POSTS/GETS i'm not sure what you are using. you can ofcourse use strlen() to get length of string if it's 0 in size then it's empty.. or even the function empty() although if you are submitting a number 0 is considered empty too.. so up 2 u. -
http://phpsysinfo.sourceforge.net/ you can't actually check how much CPU your script is running although you can add a timestamp to start at top of page and a subtract it from a new timestamp reading to get a value how long it took your site to load but it doesn't reflect the cpu usage i guess.. and you can tell that you site loads under a second etc.. blah completely off topic tbh nothing can really do this unless you have remote access of the machines desktop/terminal
-
DELETE users.*, chats.*, typing.* FROM users u, chats c, typing t WHERE u.userId = $row['id'] AND c.userId = $row['id'] AND c.randomUserId = $row['id'] AND t.id = $row['id'] like that? but some places *could* be already empty like typing/chats. i've looked into LEFT JOIN seems it only joins one other table how can I do 3 at once? To delete data from all 3 tables based on that one row[id] variable
-
alright man that was completely something odd i don't send it i just put it in the html markup on the very top above <HTML> yah but the DOCTYPE has a url http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd which is 40 KB meaning every user that goes to my website will have to download this file? or it's just a version stamp? doesn't actually go to that site (probably it does but whatever if it makes it work i guess it's no big deal)
-
can someone do this for me just saying i need a left join won't help me that much sorry if this makes anyone angry but i am one of these simple thousand query coder who wishes that sometime someone can provide me with something awesome as a one liner.. btw just realized that there is another query i have to run to delete from mysql_query("DELETE FROM typing WHERE id = $row['id']"); which makes it now mysql_query("DELETE FROM users WHERE userId = $row['id']"); mysql_query("DELETE FROM chats WHERE userId = $row['id']"); mysql_query("DELETE FROM chats WHERE randomUserId = $row['id']"); mysql_query("DELETE FROM typing WHERE id = $row['id']"); 3 different table accessors will that require 2 left joins?
-
yup actually it solved all resizing issues no need for that new topic after all.. Seems strange.. I put all the logic in css file and it should display in IE.. as it does in firefox/chrome perfectly.. strange but i never liked IE anyways, slow,bad parsing html/css/javascript even.. But gotta support it as half the users still use it due to it being part of most operating systems hehe. So you telling me everytime a person visits the site it will download that 40 KB dtd file? does it cache up ? or not
-
Yeah there is no logical way around this other then logging each guest's ip to some table and timestamp of accessed time. Then weed off the guests that exceeded the timestamp to get a fresher count.
-
Database content not displaying after deleting login code
sspoke replied to skyrank's topic in PHP Coding Help
Your question is poorly written hardly no one can actually help you due to the fact no code is presented from login.php so we don't know what login.php actually did to make the data appear.. yup it's impossible but i'd wing it and say it's a session problem -
New to PHP; Question about storing variables in a db
sspoke replied to jerryisgood's topic in PHP Coding Help
of course you can like something like this mysql_query("INSERT INTO test ('CostReadiness', 'BudgetReadiness','Recommendations') VALUES('$CostReadiness', '$BudgetReadiness', '$BudgetReadiness' ) ") or die(mysql_error()); create your mysql table anyway you want it to be named note you don't need to create variables even well after you checked them for injections you can simply do this. mysql_query("INSERT INTO test ('CostReadiness', 'BudgetReadiness','Recommendations') VALUES('{$_POST['tfa_ReadinessCostEst']}', '{$_POST['ReadinessBudgetc']}', '{$_POST['tfa_ReadinessITAsses']}' ) ") or die(mysql_error()); they will still get stored in database as CostReadiness BudgetReadiness Recommendations then you can read them up or email them any format you wish. -
replace $adsused .= $tarray['adnr'].', '; to $adsused[] = $tarray['adnr']; remove $array2 = array($adsused); replace $diff = array_diff($array1, $array2) with $diff = array_diff($array1, $adsused) should work.
-
Wow i was about to make a topic saying my site looks perfect on firefox/chrome but doesn't look good on internet explorer. Something wrong with div's not resizing when i resize internet explorer.. I added <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> somehow magically it fixed up nearly most of the div resizing problems (still one exists, but it's not that noticeable). How does it do it? I always thought those doctypes were bs added to make browsers feel important or some shit Nvm making new topic.
-
then all you can do is inside that subdomain add a upload script which works of some $_REQUEST field that holds the data of bytes? i'm guessing.. then call the upload script using php with proper parameters but yah i guess someone else who understands this more will help you out. Haha yah it's similar to my needs too only i need a txt file not a image.. strange how phpfreaks forum works.. every week i ask a question there is atleast a few similar to my needs questions
-
How to force file download of non-existing file?
sspoke replied to sspoke's topic in PHP Coding Help
yup before you wrote that I got this. header('Content-Description: File Transfer'); header('Content-Type: application/octet-stream'); header('Content-Disposition: attachment; filename=chatlog-'.date("m.d.y").'.txt'); header('Content-Transfer-Encoding: binary'); header('Expires: 0'); header('Cache-Control: must-revalidate, post-check=0, pre-check=0'); header('Pragma: public'); header('Content-Length: ' . strlen($log)); ob_clean(); flush(); echo $log; I just don't know should I leave that ob_clean(); then flush(); then start outputting my data.?? forgot that echo is outputting to browser