Jump to content

axiom82

Members
  • Posts

    95
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

axiom82's Achievements

Member

Member (2/5)

0

Reputation

  1. I'm trying to replace the Microsoft Office Link Code found in the source code of Word docs. You may have seen this before: $msword_text = ' HYPERLINK "http://www.website.com" http://www.website.com'; Here is what I'd like to see: <a href="http://www.website.com">http://www.website.com</a> Here is what I've tried: $msword_text = preg_replace('/ HYPERLINK "(.+)" (.+)/', '<a href="\\1">\\2</a>', $msword_text); It doesn't work and I've been banging my head on this one for hours. Please help!
  2. I've been programming for years. Wow, I feel like a tool right now LOL. So really it's just a processing thing.
  3. So then what you are saying is that I could have a 2 megabyte custom php framework built for xyz.com and as a result the client and server would not have to download this extra information which makes the framework so easy to manage from class files?
  4. Are PHP files downloaded by the client during execution? One of the major issues I have with Object-oriented PHP is the framework becomes sizable fast. You include 10 classes just for one small page to have all of the base functionalities required to make the page run...and after all of these includes you have spent a massive amount of unnecessary bandwidth...or so it seems? This returns me back to the original question? Does the client actually download the php class files or does the server just execute them and push the html out for download? If there is no downloading of the php framework, then I can see how Object-oriented programming is a much better idea...that is, if it does not overload bandwidth and other factors of website performance. Please respond. Thanks!
  5. I am using the latest version of sendmail on a Fedora Core 5 box. Port 25 is open when I run netstat from the command line via SSH. I've tried using port 587 for outgoing via Plesk Control Panel's assistance. I also allowed connections incoming to destination port 587 in the Webmin firewall for this. I configured Outlook to work with outgoing 587 and it still wouldn't work :/ Should I flush the ip tables? Is this similar to flushing dns on a local machine or will this wipe my server firewall configuration?
  6. I have a dedicated server with SMTP unblocked on port 25 and POP3 unblocked on port 110. In my webmail application (Horde) everything is fine. Email works as expected. In my home computer in Outlook however, I can only receive messages. When I send, I get an error. I can't even open command prompt and telnet example.com 25 though I can telnet example.com 110 just fine. Both of these ports are unblocked in the webmin firewall. My only guess is that the SMTP server doesn't know how to communicate with remote hosts??? I opened an SSH connection to my server and typed in HELO example.com and ELHO example.com and I get nothing. In fact it says: HELO: command not found. Microsoft released this article which seems to address the error number I get with Outlook...however it doesn't in my case. (http://support.microsoft.com/kb/191687) Does anyone know what this means and how to fix it? Thank you!
  7. I have been working on this issue for days now. I feel very stupid finding the answer now LOL. Apparently my server's php.ini does not recognize "X-Sender:bla@email.com/r/n"; for carriage return new lines. I fixed the issue with an ugly hack: "X-Sender:bla@email.com ";
  8. My dedicated server is a $29/mo lease (yeah, it's self-managed and the tech support guys are terrible). I have a major problem sending multi-part emails via PHP's mail() function which include text/plain and text/html mime types. Simply put, I cannot send HTML emails (using the PHP mail() function) which is core to my website working. I have narrowed down the problem: it seems that the mail headers are getting cut off. This would explain why the mail program (e.g. Microsoft Outlook) is not interpreting the emails as HTML and also why I see HTML source code written in plain text. I have attached two screenshots. You will see two versions of the same exact email message coming from different servers - one version comes from my faulty server, the other from a working server owned by a friend. Because my friend's server has no problem sending HTML emails via my PHP mailer script, the issue must be on my server and not in the PHP script. My guess is that my sendmail.cf file has a misconfiguration??? Here are my specs: Linux Fedora Core 5 sendmail.i386 8.13.8-1.fc5 sendmail-cf.i386 8.13.8-1.fc5 Please help. I really need this to work desperately. Axiom82 [attachment deleted by admin]
  9. That is a valid point. Either way, it's a performance increase - even if it is offset by excessive file storage. I've noticed that if I add a random hash generated by md5 or sha1 and append it the the image src...the images load no matter what because the name is unique. You see, I store my images as image source code in a MySQL MEDIUMBLOB field. I have a script called image-viewer.php (e.g. image-viewer.php?member-id=123) that retrieves the image source from the database, echoes the image source, and sets http headers that turn the source back into a working image again. It's very convenient for member profile images because there is no need to set file permissions, file names, storage folders, etc. I just insert it as a field in a member record and pull it as needed. When I append the hash string on the image url it fixes the issue (e.g. image-viewer.php?member-id=123&hash=0cc175b9c0f1b6a831c399e269772661). Do you think using this technique is causing the problem?
  10. Firefox issue ONLY. 1. I have a website where images load 90% of the time. It's that 1 out of every 10 times the page loads and one image decides it doesn't feel like showing up. 2. If I rollover the image, it shows up magically. If I view the image directly from the address bar, it never fails to load. 3. I have cleared my cache and started a new browser session to find the same problem continues to happen. 4. Most of my images are PNG, some GIF and JPG. You can test this issue live on my website: celebrityhappening dot com. Please help me find the issue Oh and please join! We are live and building a reeeeaaally cool community!
  11. I have a result table (which will be the subquery) that returns the count of all `users` who have a greater `count` than the value supplied. The objective is to return the `position` of the user with u.`id` given this subquery condition. Here I am using u.`count` as the conditional value. SELECT COUNT(*) FROM ( SELECT `id` FROM `users` WHERE `count` > u.`count` ) u.`count` is actually a value from the main query. u.count is not accessible in my subquery. How can I make it accessible. Below was my best idea... SELECT u.`id`, ( SELECT COUNT(*) FROM ( SELECT `id` FROM `users` WHERE `count` > u.`count` ) tbl ) AS `position` FROM `users` u WHERE u.`id`=1 If you look in the code above, I get a MySQL error stating that u.`count` is unknown...yet it is known to the parent query. Please help.
  12. Have you ever wished to have the power of a regular windowed popup (e.g. calling window.open) without creating a library of ajax requests and php responses? Have you ever created an entire popup generated by javascript by the DOM to find out you can't upload images or post forms in the popup else it will reload your main page? Annoying yes? I thought so, too! Here is the solution and it is very clear cut. 1. Create your AJAX object (in global.js): // Ajax // ajax = new Object(); ajax.initialize = function(){ ajax.xml_http = null; try { ajax.xml_http = new XMLHttpRequest (); } catch (e){ try { ajax.xml_http = new ActiveXObject ('Msxml2.XMLHTTP') } catch (e){ ajax.xml_http = new ActiveXObject ('Microsoft.XMLHTTP'); } } } ajax.post = function (url, params, onreadystatechange, sync){ if (typeof sync == 'undefined') sync = true; ajax.initialize(); ajax.xml_http.open ('POST', url, sync); ajax.xml_http.onreadystatechange = function(){ if (onreadystatechange != null && (ajax.xml_http.readyState == 4 || ajax.xml_http.readyState == 200)) onreadystatechange.call(); } ajax.xml_http.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded'); ajax.xml_http.setRequestHeader('Content-Length', params.length); ajax.xml_http.setRequestHeader('Connection', 'close'); ajax.xml_http.send (params); if (onreadystatechange != null){ try { if (document.addEventListener && ajax.xml_http.onreadystatechanged == null){ if (ajax.xml_http.readyState == 4 || ajax.xml_http.readyState == 200){ onreadystatechange.call(); } } } catch (e) { return false; } } } 2. Create your popup opening, filling, and closing code: (in popup.js) // Popup // popup = new Object(); // Popup: Open // popup.open = function(){ ajax.post('ajax_response.php', 'open_popup=1', popup.open_changed, false); } // Popup: Open (Changed) // popup.open_changed = function(){ var popup = document.createElement('div'); popup.id = 'popup'; popup.innerHTML = ajax.xml_http.responseText; popup.style.height = '256px'; popup.style.width = '512px'; popup.style.position = 'absolute'; popup.style.left = '16px'; popup.style.top = '16px'; document.body.appendChild(popup); } popup.close = function(){ if (document.getElementById('popup')) document.body.removeChild(document.getElementById('popup')); } 3. Create your php response page for ajax posts: (in ajax_response.php) <?php // Popup: Open // if (isset ($_REQUEST['open_popup'])){ ?> <iframe src="your_popup.html" width="512" height="256" frameborder="0" scrolling="no"></iframe> <?php } ?> 4. Create your popup page html (in your_popup.html) <html> <head> <title>I love posting forms in ajax popups</title> </head> <body> <h1>I love posting forms in ajax popups</h1> </body> </html> That's it. You created your ajax object, created your javascript popup controls (open, fill, close), sent a response back with an iframe (which is compatible if its the child node of a div), the iframe code is inserted as the child of the new div, and the new div appears. It's seamless! Enjoy
  13. I have a web 2.0 time tracking application on chronopolicy.com. There are some obvious design flaws with my current design so I'm working with someone who is creating a new design. I have a design mockup that I've attached to this thread. Please critique the design and let me know what you think needs to be changed...or should I just scrap this new design altogether and start over? Thank you, Michael [attachment deleted by admin]
  14. I have this mysql query: SELECT COUNT(DISTINCT IF(p.registered >= CURDATE() AND p.registered < DATE_ADD(CURDATE(), INTERVAL 1 DAY), p.id, NULL)) AS publishers, COUNT(DISTINCT IF(a.registered >= CURDATE() AND a.registered < DATE_ADD(CURDATE(), INTERVAL 1 DAY), a.id, NULL)) AS advertisers, SUM(IF(acs.`date`=CURDATE(), acs.viewed, NULL)) AS viewed, SUM(IF(acs.`date`=CURDATE(), acs.emailed, NULL)) AS emailed, SUM(IF(acs.`date`=CURDATE(), acs.printed, NULL)) AS printed, COUNT(DISTINCT IF(ac.created >= CURDATE() AND ac.created < DATE_ADD(CURDATE(), INTERVAL 1 DAY), ac.id, NULL)) AS coupons_total, COUNT(DISTINCT IF(ac.created >= CURDATE() AND ac.created < DATE_ADD(CURDATE(), INTERVAL 1 DAY) AND ac.`type`=7, ac.id, NULL)) AS coupons_7day, COUNT(DISTINCT IF(ac.created >= CURDATE() AND ac.created < DATE_ADD(CURDATE(), INTERVAL 1 DAY) AND ac.`type`=14, ac.id, NULL)) AS coupons_14day, COUNT(DISTINCT IF(ac.created >= CURDATE() AND ac.created < DATE_ADD(CURDATE(), INTERVAL 1 DAY) AND ac.`type`=30, ac.id, NULL)) AS coupons_30day, earnings.total, earnings.payout, earnings.net FROM publisher p LEFT JOIN (publisher_advertiser pa) ON (pa.publisher_id=p.id) LEFT JOIN (advertiser a) ON (a.id=pa.advertiser_id) LEFT JOIN (advertiser_coupon ac) ON (ac.advertiser_id=a.id AND ac.transaction_id != 0) LEFT JOIN (advertiser_coupon_stats acs) ON (acs.advertiser_coupon_id=ac.id) LEFT JOIN ( SELECT advertiser_id, SUM(IF(created >= CURDATE() AND created < DATE_ADD(CURDATE(), INTERVAL 1 DAY), amount - tax, NULL)) AS total, SUM(IF(created >= CURDATE() AND created < DATE_ADD(CURDATE(), INTERVAL 1 DAY), (amount - fee) - tax, NULL)) AS payout, SUM(IF(created >= CURDATE() AND created < DATE_ADD(CURDATE(), INTERVAL 1 DAY), fee, NULL)) AS net FROM advertiser_coupon WHERE transaction_id != 0 ) earnings ON (earnings.advertiser_id=ac.advertiser_id) You can see it isn't a beginner query. In fact, it joins 5 tables. One of these joins is a subquery selecting sums. The problem is with this portion of the query: LEFT JOIN ( SELECT advertiser_id, SUM(IF(created >= CURDATE() AND created < DATE_ADD(CURDATE(), INTERVAL 1 DAY), amount - tax, NULL)) AS total, SUM(IF(created >= CURDATE() AND created < DATE_ADD(CURDATE(), INTERVAL 1 DAY), (amount - fee) - tax, NULL)) AS payout, SUM(IF(created >= CURDATE() AND created < DATE_ADD(CURDATE(), INTERVAL 1 DAY), fee, NULL)) AS net FROM advertiser_coupon WHERE transaction_id != 0 ) earnings ON (earnings.advertiser_id=ac.advertiser_id) When there are no coupon records, there is NOTHING to join `earnings` with `ac` (a.k.a. `advertiser_coupon`). Which means the join is basically ON NULL=NULL. Is there a workaround for this where the REST of the query will still retrieve values even with the earnings table returning NULL? Because it is SUMMING earnings for each advertiser_coupon record...for accurate results it has to be in a sub query...unless that's not true? Please help!
  15. Yeah, I had to topic removed because I'm turning the script into a hosted web utility with ad space. The free server I was using, net84.net, thinks what I'm doing is hacking so I'll have to get a different server and research the legalities involved in pulling data from search engine pages. It seems to me like public information. What do you think?
×
×
  • 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.