php,seo,opencart,semView the original page-Collection of common programming errors

UnKnown Error


  • Lars
    mysql replication innodb php failover 2013-12-10 15:39:27
    Afternoon gents,I’m currently stress testing a Master-Master replication setup using InnoDB as database engine.We’re using this simple script for testing which we run in Linux CLI from a remote server.<?phpwhile(true) {try {$conn = mysql_connect(‘10.0.10.210’, ‘test’, ‘test’);if ($conn) {mysql_select_db(‘testdb’);$random = rand(0, 1000);$res = mysql_query(“INSERT INTO test VALUES(0, ‘test’, $random)”);if ($res) {echo “\n inserted ” . microtime();} else {echo “\n not inserted ” . microtime(

  • Mat
    php crash ffmpeg cpu 2013-12-10 15:14:01
    I have a youtube mp3 converter site, and to do this I am using FFMPEG.The problem is that the FFMPEG is using 100% CPU when there are some converting process together, so users can’t access my site until the processes are finished.How can I limit the CPU usage of FFMPEG? Is there another solution to solve my problem?

  • Domezchoc
    mysql php 2013-12-10 12:53:39
    My web application is real time site that need a speed of access on every query (SELECT, UPDATE, INSERT) that must less than 200msBecause one of my php script task is query (SELECT, UPDATE, INSERT) the work on every secound and then loop every secound alway across web server running.Well, On average 98% each query time is less than 0.001-0.005 secound on each query stagement. the problem is Sometime around 3 time per hour, the query (SELECT, UPDATE, INSERT) can take up to 1s and may be 5s, so th

  • patrick.j.goodwin
    mysql innodb myisam php 2013-12-10 12:05:28
    I have a PHP website, which is using the third-party software ResourceSpace, that when I installed it, it used my default storage engine to create the tables, which at the time was MyISAM. Now that the site has grown very large in size, I have started to see performance on my MySQL server slow down, and due to the intense queries that ResourceSpace runs, the site will start having issues loading pages due to very long running queries. When I login to MySQL, I will see multiple of the same queri

  • user916011
    php refactoring mvc 2013-12-10 11:05:51
    I’m hoping that the more experienced devs here can help me improve these methods. I’m building a basic MVC framework for myself (as a learning project,) and I’d really appreciate your insights. Things I’m looking for specifically are:Efficiency: can these methods be improved (particularly with the Request:parseURI() method.)? Clarity: do these methods make sense the way they’re written, or should I refactor?I’m including two key methods of my request routing system:RequestRouter RequestRequestRo

  • Loki Astari
    php oop sql database 2013-12-10 11:03:16
    **EDIT I asked this question yesteday when I was unregistered, and now I can’t seem to comment on the question or mark the answer as correct but I would like to say thank you for taking the time to write the answer, I found it very helpful and informative and have implemented as many of the changes as I can (I still think its abit wet in places) **I followed this tutorial to create an sql “factory” http://tomszuszai.com/content/articles/tutorials/how_to_write_a_simple_sql_factory_in_phpThe link

  • Jamal
    php oop mysql 2013-12-10 10:52:30
    I’ve created a method which is useful for executing multiple queries, and it works perfectly. Is this a good way to handle this? public function foo($rQuery) {try {$this->done->beginTransaction();foreach($rQuery as $val) {$rSql = $this->done->prepare($val);$rSql->execute();}$commitCode = $this->done->commit(); }catch (PDOException $ex) {$errorInfo = “Ooops: “.$ex->getMessage();$roalBackCode = $this->done->rollBack();}return array(‘errorInfo’ => $errorInfo, ‘com

  • Winston Ewert
    php 2013-12-10 10:42:04
    <?php $p1speed = 5; $p2speed = 3;//way for next turn: 1 for turn $p1 = 0; $p2 = 0;if($p1speed>$p2speed) {$p1 = 1;$p2 = 0;} else if($p2speed>$p1speed) {$p1 = 0;$p2 = 1;}$count=0;//begin while($count<5){if($p1==1) {echo ‘P1 turns <br>’;//adjust$p1 = 0;$p2 = 1;}else if($p2==1) {echo ‘P2 turns <br>’;//adjust$p1 = 1;$p2 = 0;}$count++;} ?>This is just my simple structure, I want to know if there is a better way than this because I have so much of line code already please hel

  • Garrett Burke
    php mysql pdo 2013-12-10 9:54:05
    Can I make any further improvements to simplify / speed up this code? My reason for creating new arrays for the variables $name, $business, $email, $orderstatus is because when displaying results there will be identical order ID numbers stored in $orderid.My script filters out the duplicates then with the remaining results matches up the keys from $orderid with the correct key in $name, $business, $email, $orderstatus<?php session_start(); if (!isset($_SESSION[‘username’])){ header(“location:

  • JDelage
    php best-practice readability 2013-12-10 9:49:04
    All,I am a beginner and am creating a small web app. I’m working on the registration process for new users, and as this is largely a learning project I’m doing it from scratch.Here is my user class: Class_user.php <?phpclass User {// The class variables are the same and have the same name as the db fields.private $userID; // Must be incremental + unique. Also used as salt.private $userName; // Must be unique.private $hashedPassword;private $userEmail;function __construct($userID, $userName

  • Shannon Hyland
    wordpress plugins seo 2013-11-4 15:19:30
    I am using Yoast SEO for wordpress and suddenly I cannot open the Title & Meta tabs in the options page.I am receiving this errorUncaught TypeError: Object [object Object] has no method ‘masonry’ (anonymous function) admin.php:50l load-scripts.php:2c.fireWith load-scripts.php:2v.extend.ready load-scripts.php:2Aand if I open the error it showsjQuery(function() {jQuery(‘#normal-sortables’).masonry({Uncaught TypeError: Object [object Object] has no method ‘masonry’itemSelector : ‘.postbox’});})

  • freaky
    html5 seo links pushstate 2013-10-19 19:04:25
    I try to implement pushstate history on my website in order to load content from a single.php page inside a index.php container.My website have two main page : index.php and single.php .On the index.php there are links that call pushstate script:<a class=”phplink” href=”/Formlabs-3D-printer” title=”Formlabs 3D printer”>Post 12</a> <a class=”phplink” href=”/Minimal-Bumper-for-iPhone-5″ title=”Minimal Bumper for iPhone 5″>Post 11</a>On my single.php page I use isset get me

  • Renan
    seo google robots 2013-9-22 13:54:36
    I usually disallow subdirectories in the robots.txt file and I was wondering if it’s possible to do it the other way: block everything and list the main index file and the others pages I’d like search engines to index. Is that possible?My current robots.txt is as follows:User-agent: * Disallow: /example/ Disallow: /example/ Disallow: /example/ Disallow: /example/ Disallow: /example/ Disallow: /example/ Disallow: /example/ Disallow: yea.html Allow: /

  • Su’
    seo microdata construction 2013-9-22 13:45:56
    Here is the example:<div itemprop=”offers” itemscope itemtype=”http://schema.org/Offer”><p>some text and lorem ipsum</p><div class=”random”><span itemprop=”price”>$40</span></div> </div>

  • Anton Gildebrand
    plugins errors seo plugin-qtranslate 2013-9-21 12:48:42
    I have an issue with a clients site. I installed the Yoast SEO-plugin (which i find to be great), but when i activate it i get lot’s of error messages (See below)./storage/content/10/104610/mydomain.com/public_html/wp-content/plugins/qtranslate/qtranslate_hooks.php on line 54 Notice: Undefined index: language in /storage/content/10/104610/mydomain.com/public_html/wp-content/plugins/qtranslate/qtranslate_hooks.php on line 55 Notice: Undefined index: language in /storage/content/10/104610/mydomain

  • Alexander Varwijk
    javascript node.js seo 2013-9-17 20:51:52
    Using NodeJs I’m trying to do something quite similar to Meteor: I want to send only the parts of a page that actually changed. My dilemma is that I know how to create such a framework to respond to link clicks and send partial updates but such a framework won’t cater to direct browsing to a page other than the index (which is what is required for search engines and people without javascript to use your site).I can also figure out how to make a framework to support entire page reloads, handlebar

  • Robert Harvey
    c# html asp.net-mvc seo 2013-9-15 10:43:52
    I have noticed that many blogs use URLs that look like this:http://www.hanselman.com/blog/VirtualCamaraderieAPersistentVideoPortalForTheRemoteWorker.aspxI assume this is done for search engine optimization.How is this read from the underlying data model? Do you really search for VirtualCamaraderieAPersistentVideoPortalForTheRemoteWorkerin the database? If so, how is the description managed? If it is a key, is the rule that it can never be changed once it is created, without breaking web links

  • TheBlackBenzKid
    php seo opencart sem 2013-9-12 6:54:48
    I currently have User SEO URL’s set to Yes in OpenCart Admin.System -> Settings -> Store -> Server -> User SEO URL’sSo far, all tags and SEO links are working; the command has done the desired effect.However for the homepage and a few other links; how do I remove:index.php?route=common/homeFrom the URL? Do I have to literally do a find and replace in the hardcode PHP files and risk upgrades or is there another way?(without vQmod)

  • Wired
    javascript jquery html ajax seo 2013-9-9 21:03:55
    I have been looking for an answer in the web but never got any precise answer.I have an index.php page with two particular DIV’s: #post-title and #post-content, whose content is loaded thorugh jQuery function. This function is called everytime a link is clicked<a onclick=”showPage(‘page’)”></a>Function:function showPage(page, fadeInSpeed, fadeOutSpeed) {fadeInSpeed = typeof fadeInSpeed !== ‘undefined’ ? fadeInSpeed : 500;fadeOutSpeed = typeof fadeOutSpeed !== ‘undefined’ ? fadeOutSpe

  • Lance Roberts
    html seo canonical-link 2013-9-4 12:27:05
    Let’s say several external sites are scraping/harvesting your content and posting it as their own. Let’s also say that you maintain a single unique/permanent URL for each piece of content, so that content aliasing (on your site) is never an issue.Is there any value from an SEO perspective to including a canonical link in your header anyway, such that when your site is “scraped”, the canonical indication is injected into whatever site is stealing your content (assuming they harvest the raw HTML r

  • Cris
    javascript jquery opencart 2013-11-2 14:53:37
    I have an opencart shop. Locally, uploading images work without a glitch. Online, it works only if the image is very small. If I upload an image of, say 300kb, the loading gif next to upload keeps spinning and I get the errors:ajaxupload.js:Line 609: if (response) { Line 610: response = eval(“(” + response + “)”); Line 611: } else { Line 612: response = {}; Line 613: }Why is this happening?EDIT: I did console.log(response) and you were right, what came back was the HTML of the 404 page. Bu

  • kalingga
    javascript json opencart 2013-10-21 10:59:00
    I would like to show the geozone in the registration account step as dropdown menu, just like the zone (region). But the value of the geozone is dependent to what customer choose in the zone (region).The PictureIn the process, I already did some modifications to the controller, view, including controller. Just like in the pic below :The geozone field is Kotamadya/Kabupaten. But when I choose the region Aceh, the geozone field is not refreshed.Error MessageI got error message like below :SyntaxEr

  • teresko
    php opencart 2013-10-20 14:00:58
    Hi i downloaded opencart version 1.5.2.1…now i am developing an API using the opencart flow.i developed the form using using tpl,controller,language files. i wrote model also.what the exact concept is when i enter the form data that should be loaded into database…but it showing an error saying undefined index in model.how to get the form data in controller and how to pass that data to the model… please help me. this is my controller file:<?phpclass ControllerSaleAd extends Controller {

  • Jay Gilford
    debugging opencart 2013-10-20 12:06:00
    I have an ecommerce site built on OpenCart (1.5.0 i believe), which after inserting tracking code from Alexa.com and a block of code for redirecting to another site went entirely blank. Initially it worked, so I felt it was safe to save over my backups. But after refreshing the pages it was blank, and the ‘view source’ option in all my browsers (firefox, chrome, safari) revealed that there was no code reaching them. I then began to follow a series of debugging steps:As my text editor was still o

  • NewUser
    php variables opencart 2013-10-19 1:25:06
    I am new to the opencart.By default Opencart featured product shows product description and price but now I want product discounted prices in featured product section so I changed my featured product code and added code to show discount price. Here is the complete code for featured product<?php class ControllerModuleFeatured extends Controller {protected function index($setting) {$this->language->load(‘module/featured’); $this->data[‘heading_title’] = $this->language->get(‘head

  • user2763685
    opencart category 2013-10-11 23:51:24
    I just start with Opencart. I need to have list of brands, like llist of catgories. I try so:<div class=”box”><div class=”box-heading”><?php echo “?? ???????” ?></div><div class=”box-content”><ul class=”box-category”><?php foreach ($manufacturers as $manufacturer) { ?><li><?php if ($manufacturer[‘manufacturer_id’] == $manufacturer_id) { ?><a href=”<?php echo $manufacturer[‘href’]; ?>” class=”active”><?php echo $manufacturer[‘na

  • shadyyx
    php opencart shopping-cart 2013-9-16 9:39:06
    I want to add a new session[‘abc’] during the checkout Step 5: Payment Method (1.5.5.1).What I’ve done so far:/template/checkout/payment_method.tpl add<input type=”hidden” name=”abc” value=”1111″ id=”abc”>/template/checkout/checkout.tpldata: $(‘#payment-method input[type=\’radio\’]:checked, #payment-method input[type=\’checkbox\’]:checked, #payment-method textarea’),changed todata: $(‘#payment-method input[type=\’radio\’]:checked, #payment-method input[type=\’checkbox\’]:checked, #payment

  • Ziinloader
    php javascript opencart 2013-9-16 3:18:16
    I am currently working on a project in Open Cart 1.5.4. I slighty moved the cart into another div without any problems. The thing is on new computers and first time they enter the site it´s not possible for the customer to add a product to cart. If they go into another page and then back it works just fine. The javascript file is loaded properly without any problems.Hope this explanation explains the problem or bug pretty good.Thanks in advance.JAVASCRIPTfunction addToCart(product_id, quantity)

  • bernie
    php opencart 2013-9-15 22:53:37
    I’m using Opencart am trying to call a variable to be displayed just under the product name in the featured module. This featured module is displayed on the frontpage.I’ve already added a new column in the database and was able to add data into the db through the admin page. Verified by going through PHPmyadmin.I can’t however, display the variable on the main page. I’ve edited catalog/view/theme/*/template/module/featured.tpl to include the following code but with no success. If i remove the is

  • terrid25
    opencart 2013-9-14 12:33:30
    I am setting a custom session in the catalog/controller/checkout/cart.php controller. All it does, it checks if a value is set or not.if (isset($this->request->post[‘no_tax’]) && $this->request->post[‘no_tax’] == ‘1’) {$this->session->data[‘no_tax’] = true; } elseif (isset($this->request->post[‘no_tax’]) && $this->request->post[‘no_tax’] === ‘0’) {unset($this->session->data[‘no_tax’]); }I can then access this in the catalog/model/shipping/to

  • TheBlackBenzKid
    php seo opencart sem 2013-9-12 6:54:48
    I currently have User SEO URL’s set to Yes in OpenCart Admin.System -> Settings -> Store -> Server -> User SEO URL’sSo far, all tags and SEO links are working; the command has done the desired effect.However for the homepage and a few other links; how do I remove:index.php?route=common/homeFrom the URL? Do I have to literally do a find and replace in the hardcode PHP files and risk upgrades or is there another way?(without vQmod)