php,magentoRelated issues-Collection of common programming errors


  • Kermit
    php windows-server-2008-r2 iis7 sql-server-2008-r2
    I am having difficulties getting the SQL Server extension to work with PHP on Windows Server. The installation went fine and I’m able to load phpinfo through the browser. However, when I enable php_sqlsrv_54_ts.dll, it throws a 500 – Internal server error. There are no errors logged to the PHP log.Here are the steps I’ve performed:Followed the PHP manual install guide and configuring IIS to process PHP requests Downloaded & installed Microsoft Drivers 3.0 for PHP for SQL Server Downloaded &a

  • ElvisLikeBear
    php sql sql-server sql-server-2008
    I’m using PDO’s to connect to a Microsoft Server running in azure and I keep receiving the error:This is the function that I’ve written (insertUser):private function generateSalt() {return dechex(mt_rand(0, 4453456454)) . dechex(mt_rand(0, 543545435)); }private function hashPassword($originalPassword, $salt) {for($round = 0; $round < 65536; $round++){$password = hash(‘sha256’, $password . $salt);}return $password; }private function insertUser() {$salt = $this->generateSalt();$password = $

  • Jacket
    php internationalization gettext
    I know there are lots of posts for internationalization, but this is something I didn’t found while searching.I have a PHP Web application, which is pretty big right now. It’s developed actively for 4 years and wasn’t built with internationalization in mind. Text is everywhere – in plain HTML, in PHP variables, in echo’s, in the DB…Now I’m familiar with the concept of gettext and this is what i plan to use for the internationalization project of the application. However the app is not written

  • darkheir
    php jpeg jfif
    When I’m trying to save an image using the native php function imagecreatefromjpeg sometimes I have the following error:gd-jpeg, libjpeg: recoverable error: Warning: unknown JFIF revision number 2.01What I understand (I could be wrong) is that the JFIF version is higher than the one supported by the native php function.How could I process the image or at least fail gracefully? (Today the page is showing a HTTP 500 error)

  • mitai
    php codeigniter form-validation native
    I want to use a central CI setup for multiple sites. The way I handle this is I created a package called MPACK and added it to autoload in the config file of each site.Folder Structure:/main/system (CI 2 System folder)/MPACK/site1/applicationsite2/applicationInside this MPACK I have share libraries, models, helpers, etc.However, I would like to have an extended MY_Form_Validation that would be common to ALL sites. Adding the class file to /MPACK/libraries fails. Adding it to /site1/application w

  • xles
    php yii
    I’m playing around with the Yii framework, and decided to do some file foo with the finfo class in php, like so:$finfo = new finfo(FILEINFO_MIME);This should work without issue (and it works just fine outside of Yii), I don’t see why it shouldn’t. However, this isn’t the case, Yii attempts to autoload the finfo class causing the obvious error:include(finfo.php): failed to open stream: No such file or directoryIs there a way to beat Yii into submission?Edit: I still haven’t figured out why it cr

  • David Rodrigues
    php mysql
    Is there any function in MySQL that is similar to function substr_count() of PHP? Actually I need to know how many items are in a set (eg. 1,2,3 is 3 items).In a search, I found nothing that was native to this. So I made a workaround with the methods LENGTH() and REPLACE().SELECT LENGTH(“1,2,3,4”) – LENGTH(REPLACE(“1,2,3,4”, “,”, “”)) + 1;But it fail set is empty. But I can solve that with a simple IF().So, I’m searching for some more native, like, for instance:SELECT SUBSTR_COUNT(“,”, “1,2,3,4”

  • palacsint
    php beginner security file static
    I am new to Code Review and PHP.Last night I made the below image uploading class. It was the first time I made a file uploader to be used on a real site, so I thought I would share it here and on Github to get some reviews, hoping if I can perfect it with your help, I will use the class on all my future projects. <?php /*** A small, secure & fast image uploader class written in all-static* class to give an extra boost in performance.* @author Simon _eQ <https://github.com/simon-eQ

  • Orangepill
    php template
    This is the second submission for Code Review for this project but since the API changed considerably I felt it should not be taped onto the original post. To see the original post and comment see Potential Problems with this templating technique .First off the goals motivation for this technique is to reduce the number of iterative includes of a template there by bypassing a lot of the i/o bottle neck that can occur, especially in I/O bound environments. Overwhelmingly the biggest eyesore in th

  • Kriem
    php javascript jquery jwplayer
    I sometimes get this error in my jwplayer: TypeError: non-native scope objectThis means that one video out of multiple videos I have has failed to load. This makes it unreliable. My question is that is there a way to make it more reliable and permanently fix this error?Below is code:<?php$key = $_GET[‘key’]; $i = $_GET[‘i’]; $v = $_GET[‘v’];?> <div id=”myElement-<?php echo $key.’-‘.$i; ?>”>Loading the player…<script type=”text/javascript”> jwplayer(“myElement-<?php e

  • Ola Eldøy
    css design magento content-management-system skinning
    I am working with a client who has already purchased Magento -eCommerce CMS. I have never worked with this program and after reading over there extremely lengthy material I am not sure if I should take on the project. I am worried that this is a little outside of my skill set. I mostly do Design and Front-End Development. I have worked with WordPress somewhat regularly without any problems, however that is extremely well documented. My understanding of actual programming is limited. Has anyone c

  • Pascut
    magento email zend-framework smtp magento-1.6
    I have a magento website. I want to send mails using SMTP. I’ve found the below script hereI created this file: app/code/local/Mage/Core/Model/Email/Template.php in order to overwrite the original core file.The problem is that I receive this error: Parse error: syntax error, unexpected T_VARIABLE in /home/xxx/public_html/app/code/local/Mage/Core/Model/Email/Template.php on line 103public function getMail() {if (is_null($this->_mail)) { $my_smtp_host = Mage::getStoreConfig(‘system/smt

  • rdrey
    magento paypal
    Since Magento 1.7.0.1, the “Place Order” button on the review page of PayPal Express is disabled by default. When the user ticks both checkboxes, it stays disabled. The user needs to tick the checkboxes and click on “Update Order Data”. After the site is reloaded, “Place Order”/”Kaufen” is enabled.How can this bug be fixed? It is also present in 1.7.0.2.

  • Bartosz Górski
    php magento authentication apache2 magento-1.6
    I’ve set up a new server for my magentocommerce.Unfortunatly when I moved the domain to the new location (tests have been done using another domain) a weird issue started happening: when the login page displays on the frontend, or the backend and I (and customers, of course) do submit the right credentials the page refresh, the cookie gets set but the form is displayed again. It’s such a cache being served instead of the right content (catalog).The only solution actually is delete the cache on t

  • Drew Hunter
    ajax magento magento-1.4
    I’m writing a Magento Admin extension that has some ajax callbacks in it. Up until now I’ve been echoing the json I’m feeding back through the ajax call with a simple echo statement in the controller. It “works” but I get a bunch of errors like this in my log file: 2010-12-14T15:37:05+00:00 DEBUG (7): HEADERS ALREADY SENT: [0] /home/simplifiedsafety/www/store/app/code/core/Mage/Core/Controller/Response/Http.php:44 [1] /home/simplifiedsafety/www/store/lib/Zend/Controller/Response/Abstract.php:7

  • rxt
    php magento magento-1.4
    I have a local magento installation to test out new extensions and configurations. Now I try to open the Connect Manager locally, but get a blank screen, and the following errors:PHP Warning: Unexpected character in input: ‘\x16’ (ASCII=22) state=0 in /var/www-vhosts/magento.local/htdocs/app/code/local/Aitoc/Aitsys/Model/Module/License/Light/Performer/Reader.php(36) : eval()’d code(18) : eval()’d code(1395) : eval()’d code on line 1 PHP Parse error: syntax error, unexpected T_STRING in /var/w

  • Marcin Orlowski
    php magento magmi
    I am using the Column Mapper to map columns from my source file to the respective system columns.I get an error when the source column header has a “(” or “)” in there. The error occurs within the magmi UI. Here is an example:Mapped columns list: Name,Syle#,Width (inches) New name for col Name: name New name for col Style#: sku New name for col Width (inches): widthUpon saving the profile, I get the following error:**Warning:** syntax error, unexpected ‘(‘ in ColumnMappingItemProcessor.conf on

  • viakondratiuk
    bash magento automation
    I am interested in automation of Magento installation. I found one nice article with steps, how to achieve this. I downloaded their script and run it from cli:./mage-install.sh localhost root test “abcABC123” “1.7.0.2”And get such error:./mage-install.sh: 21: ./mage-install.sh: Syntax error: “(” unexpected (expecting “}”)I am not familiar with bash, here is a part of code, which is responsible for it:compareVersions () {typeset IFS=’.’typeset -a v1=( $1 )typeset -a v2=( $2 )typeset n difff

  • teresko
    php magento
    Does anyone know how I can get a list of products belonging to a specific category from within a view file in Magento?

  • svick
    c# .net soap magento wsdl
    Before today my Magento soap worked fine, i could do a logon and a session string would be returned. I have tried the same thing today and it did not work. version 1.4.2.0I have tried to connect to 2 different Domains, with each set up with magento and i get the same error. Can anyone tell me why that would be?this is the error i am getting. {“Possible SOAP version mismatch: Envelope namespace http://schemas.xmlsoap.org/wsdl/ was unexpected. Expecting http://schemas.xmlsoap.org/soap/envelope/.”}

Web site is in building