php,zend-framework,magentoRelated issues-Collection of common programming errors


  • user3367639
    php codeigniter
    So, I am making a from select with the code below: // Controller Code $data[‘message_to_options’] = array(‘1’ => ‘username 1′,’2’ => ‘username 2’, );// View Code <?php echo form_dropdown(‘message_to’, $message_to_options); ?>This all works great. Except the users needs to be dynamically created not hard coded. I have the following code from ion_auth for code igniter. This gets all the users in the system. Which Is what I want to do. $users = $this->ion_auth->users()->resul

  • Ed Cottrell
    php mysql database
    Here is my database connection code, whenever i sign up in form it always says “syntax error, unexpected T_STRING in”<?php//Database Connection Settingsmysql_connect(“localhost”, “root”, “”);mysql_select_db(“project mix”);global $connection;$connection = @mysql_connect(“”) or die(‘Connection could not be made to the SQL Server. Please report this system error at <font color=”blue”>[email protected]</font>’);@mysql_select_db(project mix,$connection) or die(‘Connec

  • Timothy Carter
    php javascript jsp splash-screen
    I want to know how to show a splash screen (like a gif or jpeg file) on the user screen during my script execution.Thank you for your help.

  • mikeTheLiar
    php try-catch composer-php
    I am trying to install Composer (http://getcomposer.org/download/) on a GoDaddy-hosted Linux server but it’s not working. No matter which method I try, I eventually run up against some version of the following error:Parse error: syntax error, unexpected ‘{‘ on line 290.Line 290 refers to line 290 in this file: https://getcomposer.org/installer which is the start of a try-catch block. And, indeed, even a simple script like:echo ‘<?php echo “Hello World “; try {echo “Goodbye”;} catch (Except

  • Pieter
    php strpos
    This is my code:<?php $url = “http://www.uhasselt.be/collegeroosters/2009_2010_298_5_10.html”; $headers = get_headers($url, 1); print_r($headers); $contloc = $headers[“Content-Location”]; echo “Content-Location: ” . $contloc . “\n”; $soft404test = strpos($contloc, “http://www.uhasselt.be/404b.htm”) ? true : false; var_dump($soft404test); ?>This is its output:Array ([0] => HTTP/1.1 200 OK[Content-Length] => 2030[Content-Type] => text/html[Content-Location] => http://www.uhasselt

  • Guillermo Phillips
    php oracle blobs
    I am attempting to transfer a set of photos (blobs) from one table to another across databases. I’m nearly there, except for binding the photo parameter. I have the following code:$conn_db1 = oci_pconnect(‘username’, ‘password’, ‘db1’); $conn_db2 = oci_pconnect(‘username’, ‘password’, ‘db2’);$parse_db1_select = oci_parse($conn_db1, “SELECTREF PID,BINARY_OBJECT PHOTOGRAPH FROMBLOBS”);$parse_db2_insert = oci_parse($conn_db2, “INSERT INTOPHOTOGRAPHS(PID,PHOTOGRAPH) VALUES(:pid,:photo)”); oci_e

  • Tianyu
    php c gcc llvm llvm-gcc
    I tried to generate LLVM intermediate code by callingllvm-gcc -emit-llvm -I/mypath/ -c main.c -o main.oIt works perfectly without any warnings or errors if I manually type this command in the terminal. However I have built a website that can automate this process by calling exec function in PHP like below.exec(“llvm-gcc -emit-llvm -I/mypath/ -c main.c -o main.o”,$msg,$ret);It will still generate .o file with a warning. The warning says that Potential incompatible plugin version. GCC: 4.5.3. Expe

  • John Conde
    javascript php jquery ajax
    I’m simply trying to read in a field from a text box, pass the value via ajax to PHP and then store the data in a mysql table. The table is already set up and ready to go, all I need is to insert values. Here is my js file var address = $(“input#email”).val(); //If submission is valid if(submitForm == “true”){$.ajax({ url: “bin/process.php”, type: “POST”, data: {email: address}, success: function(response) { $(‘#message’).html(response); }}); return false; }And then my PHP looks like this

  • user2718671
    php wordpress
    Is it possible to create sub menu pages depending on the options? In my plugin option page I got an input field for titles (of the submenu pages). These titles are separated by commas. I tried following in my plugin script:function my_menu() {global $page_hook_suffix;$page_hook_suffix = add_menu_page(…); //adding main menu$titles=get_option(‘my_option_name’);$titles=explode(“,”,$titles);if(!empty(get_option(‘my_option_name’))){foreach($titles as $title){ $slug = str_replace(‘ ‘, ‘_’, $titl

  • FoolishSeth
    php forms html-select
    I am trying to save what state a user select after ‘POST’ the form action runs on the same page, but I keep getting unexpected T_IS_EQUAL, expecting ‘}’ error. What am I missing? I have the following code:<select style=’width:50px; float:left; position:relative; left:-160px; top:2px; border-radius:3px; ‘ project=’statelist’ class=’statelist’ name=’statelist’>$state = array( ‘AZ’,’AL’,’AK’,’AR’, ‘CA’,’CO’, ‘CT’,’DE’,’DC’,’FL’, ‘GA’, ‘HI’,’ID’,’IL’, ‘IN’,’IA’,’KS’,’KY’,’LA’,’ME’,’MT’,’NV’,’

  • hakre
    mysql zend-framework pdo zend-db
    I came across what looks like an odd issue with either Zend_Db or PHP’s PDO MySQL driver, that perhaps stems from my lack of knowledge of those two.Let’s assume I have a MySQL Table with a NULLable TIME field. If I run a query like this in MySQL client:UPDATE mytable SET mytime = NULL WHERE id = 1;Everything works as expected and mytime field will hold NULL as value after this query.However, if I run the exact same query in PHP through the Zend_Db_Adapter, the mytime field is set to ‘0:0:0’ afte

  • erenon
    php zend-framework
    Hey, so I’m coding a php application, and I’ve run into an error, which I am for some reason not seeing (me being really bad at coding and lack of sleep may have something to do with it.Anyway, here’s my tricky problem :)Parse error: syntax error, unexpected $end, expecting T_FUNCTIONand the code:The modelclass Model_DbTable_Users extends Zend_Db_Table_Abstract {protected $_name = ‘users’;public function addUser($username, $password, $email){$data = array( ‘username’ => $username,’password’

  • Whitewall
    php jquery zend-framework popup
    I am working on zend framework, PHP and jQuery. I am working on popups sometimes. When any popup is open on the screen, we can still clicks links on webpage behind popup which causes some unexpected behaviour. How can I disable a webpage behind popup. I have seen some web application in which when popup appears then webpage behind popup become shady.I have read some tutorial about this. In each tutorial a link is used to open a dialog and an special attribute is added in anchor tag for modal. Bu

  • LazyOne
    zend-framework .htaccess redirect error-handling
    I developed a website using Zend Framework. In order to handle errors, I want to add to the htaccess file the following lines so I can redirect the user to the corresponding every time there is an error.ErrorDocument 500 /errors/500.html ErrorDocument 404 /errors/404.html ErrorDocument 403 /errors/403.htmlso my htaccess file now in the /public folder looks like this:RewriteEngine on # Rewrite rules for Zend FrameworkRewriteCond %{REQUEST_FILENAME} !-f RewriteRule .* index.php# Security: Don’t al

  • Charles
    php zend-framework session destructor zend-session
    I’m noticing some slightly unexpected behaviour using __destruct to write data using Zend_Session_Namespace in PHP 5.3:public function __destruct(){$this->getSession()->data = $this->data; } // …. private function getSession() {if (! self::$zendSession) {// this next line is fine because the object is a singletonself::$zendSession = new Zend_Session_Namespace(self::SESSION_NAMESPACE);}return(self::$zendSession); }The destructor is getting called, but the data isn’t getting written. H

  • Charles
    php zend-framework zend-controller-router
    I’m trying to make a Router that can respond to this structure:module/controller/action/id and module/controller/action/pageThe only difference is is ‘id’ or ‘page’. I’m using this code:$routeAdmin = new Zend_Controller_Router_Route(‘administrador/:controller/:action/:id/:pg’,array(‘module’ => ‘administrador’,’controller’ => ‘index’,’action’ => ‘index’,’id’ => 0,’pg’ => 1),array(‘id’ => ‘\d+’,’pg’ => ‘\d+’) ); $router->addRoute(‘administrador’, $routeAdmin);The problem is

  • emkay
    php codeigniter zend-framework amazon internal-server-error
    I am having a really frustrating problem with my Zend Service Amazon package integrated into my codeigniter framework. The library works perfectly fine in my localhost but when I try it from the live site it doesn’t work, it gives me an internal server error. Why could this be?The error in the PHP log is:[22-Nov-2012 21:29:02] PHP Warning: Unexpected character in input: ‘\’ (ASCII=92) state=1 in /home5/tradejun/public_html/application/controllers/dev.php on line 30[22-Nov-2012 21:29:02] PHP Pa

  • k314
    zend-framework doctrine
    I got problem with Doctrine. I add this lines in my application.ini:includePaths.model = APPLICATION_PATH “/models”autoloaderNamespaces[] = “Doctrine”doctrine.dns = “mysql://root@localhost/translators” dectrine.data_fixtures_path = APPLICATION_PATH “/doctrine/data/fixtures” doctrine.models_path = APPLICATION_PATH “/models” doctrine.migrations_path = APPLICATION_PATH “/doctrine/migrations” doctrine.sql_path = APPLICATION_PATH “/doctrine/data/sql” doctrine.yaml_schema_path = “APPLICATION_PATH “/do

  • Tanvir
    zend-framework
    I wonder if anyone of you ever have had problem reading ZendFramework-1.12.3-apidoc.The index page doesnt allow moving the left slider, everything is so stiff n fixed.I cant see the full class name of the classes in left frame.I changed to Chrome/Opera from Firefox but to no avail. There is also no search option in the api docI also want to know how I can get netbeans code auto completion to find the doc api.Auto completion works but API doc is not found in hints popup.Is there any other version

  • JoeyD473
    php mysql zend-framework pdo zend-db
    I am using Zend Framework and am trying to connect to a database by it’s IP address.. I keep getting the following errorFatal error: Uncaught exception ‘Zend_Config_Exception’ with message’syntax error, unexpected ‘=’ inC:\xampp\htdocs\App\application/configs/application.ini on line27 ‘ in C:\xampp\php\zf\library\Zend\Config\Ini.php:182 (I removed thefull stack trace)I traced the error to the application.iniresources.db.adapter = PDO_MYSQL resources.db.params.host = 192.168.1.34 resources.db.pa

  • 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/.”}

  • user3179784
    php jquery html css magento
    I am trying to put a jquery dropdown for “My Account” in the header after you login (try username test and password test@123) but I keep getting this error:Uncaught TypeError: Cannot call method ‘dropit’ of nullI even moved:<script type=”text/javascript”>jQuery.noConflict();jQuery(document).ready(function () { $(‘#myaccountmenu’).dropit(); }); </script>to the bottom before the footer, to no avail. Any ideas?

  • Abhijit Navale
    html magento caching block
    My magento homepage contents are displayed more than one time. I expect them to appear only once per page. I tried to put this code to \app\code\core\Mage\Catalog\Block\Product\List.php file as a solution:protected function _construct(){$this->addData(array(‘cache_lifetime’ => 900,’cache_tags’ => array(Mage_Catalog_Model_Product::CACHE_TAG),’cache_key’ => $this->getCacheKey()));} public function getCacheKey(){return $this->getRequest()->getRequestUri().$

  • Diego
    magento block
    I found an unexpected issue while attempting to load a block within a magento module. The block name was *Mycompany_CustomerModule_Block_CustomerModuleDashboardDataBlock* (yes, the name is very long, but I added the module name all blocks related to the module to avoid confusing a dashboard.html with the one used by Magento Core). The issue is that, if I try to load such block, with the following command:$this->getLayout()->createBlock(‘customermodule/customermoduledashboarddatablock’)Mage

Web site is in building