php

Difference between two commands of fetching Shopping Cart Items in Magento

In Magento, if you need to get / fetch the Shopping Cart's Item details, you can do it in any of the two possible ways, which will provide you with all the shopped Items in an array:- $cartItems1 = $cart->getQuote()->getAllItems(); $cartItems2 = $cart->getItems()->getData(); But before using any one of the above two methods, you need...

how to send email from php application to a local email

I have a local network in the company with a mail server, how can i make php application built locally on the server to send and email to a local email address? thanks in advance ...

Does the order of conditions in a WHERE clause affect MySQL performance?

Say that I have a long, expensive query, packed with conditions, searching a large number of rows. I also have one particular condition, like a company id, that will limit the number of rows that need to be searched considerably, narrowing it down to dozens from hundreds of thousands. Does it make any difference to MySQL performance whe...

What is PHP as "Personal Home Page" and "PHP Hypertext Preprocessor"?

What is PHP as "Personal Home Page" and "PHP Hypertext Preprocessor"? ...

How to get a list of unrepeatable date from my db in PHP?

Hi in my db there are 5 fields (id, list_date, amount, total, m_from) and contain data, for example : 1 - 1/1/2010 - 10 - 50 - 'example111' 1 - 1/1/2010 - 10 - 50 - 'example111' 1 - 1/4/2010 - 10 - 50 - 'example154 1 - 1/1/2010 - 10 - 50 - 'example111' 1 - 1/5/2010 - 10 - 50 - 'test' I need to know how I can g...

Unable to show a division tag using JS

Consider, I've got this code in PHP <?php if($count==0) { ?> <script> show_my_div(); </script> <?php } ?> the show_my_div() is supposed to show a division tag. But It doesn't work. Please help. ...

how to fix gateway timeout error in php???

Iam having a php file that sends text messages on mobile to all the users that i have in my database's particular table. Now the entries are like 2000 or so in number and this number will keep on increasing. On my page there is a small form that selects a list of the users to whom message is to be sent from a drop down and then user writ...

Login to icq account to receive messages from contact #12345678

Is there a way to have a php-script running, that does the following things: - log into icq-account - receive all (if any) messages from an existing contact #12345678 and - write those messages into an array like e.g. $messages = array(); edit I'd like to have answer like: "bla" is good, active community, frequently updated, as icq chan...

How to split a space separated file?

Hi I am trying to import this: http://en.wikipedia.org/wiki/List_of_countries_by_continent_%28data_file%29 which is of the format like: AS AF AFG 004 Afghanistan, Islamic Republic of EU AX ALA 248 Åland Islands EU AL ALB 008 Albania, Republic of AF DZ DZA 012 Algeria, People's Democratic Republic of OC AS ASM 016 American Samoa EU AD ...

htaccess in php

I am using htaccess in my projec.there is login section i want to show the my account page as http:///www/domain.com/username . But there is a problem because i have also made a cms which is open as http:///www/domain.com/cms . Although i have validate the user name But there is same page open whe...

How can we execute linux commands from php programs??

I want to see the output of the following code in the web browser: code: <?php $var = system('fdisk -l'); echo "$var"; ?> When I open this from a web browser there is no output in the web browser. So how can I do this? Please help! Thanks Puspa ...

A way to search form table in MySQL database.

I looked for a way to scan database for a specific table. For example i have: Database: system_ultimate Table: system_settings And let us say, that one doesn't know precise name of the table. He only knows, that it is some how connected to the word settings. How could he search for that table name then? I understand, that usually pe...

[PHP] - Lowering script memory usage in a "big" file creation

Hi there people, it looks like I'm facing a typical memory outage problem when using a PHP script. The script, originally developed by another person, serves as an XML sitemap creator, and on large websites uses quite a lot of memory. I thought that the problem was related due to an algorithm holding data in memory until the job was do...

Logout problem /session not destroyed

I am having a problem when trying to login.. below is my code for the login <?php session_start(); include("functions.php"); connecttodb(); if(!empty($_SESSION['loggedin']) && !empty($_SESSION['username'])) { echo "already logged in"; header("refresh:3; url=main.php"); } if(!empty($_POST['username']) && !empty($_POST['passwo...

Zend Framework Project - Calendar: Need web calendar with events (like google calendar) for every user separately

Hi, I doing multi users website (it should works for more than 100,000 users) with Zend Framework. I need to create event calendar like google calendar (If it was possible to use google calendar i will do it- please tell me). I have to do that from zero or exist some good Calendar that will work well with Zend? Thanks ...

How to build a dynamic checkbox choices from database data?

Currently, my checkboxes are built by a static array: $choices = array( 'key_1' => 'Name 1', 'key_2' => 'Name 2', ... 'key_n' => 'Name n'); <? foreach (@choices as $key => $choice) { echo "<input type="checkbox" name='keys[]' value='$key'/> $choice <br />"; } ?> and I access the return values by: $_POST['keys']...

PHP Programming Spam Prevention

What is the most secure way to fight spam?Any algorithm?Or way to fight back spammers? ...

Can I setup a specific login action for each module?

Hi, I'm working on a symfony 1.4 project which contains a frontend and a backend. I want to know if it's possible to configure a different login action for each module. I've tried to add a settings.yml file in the config folder of each module but it doesn't work. Thanks, ...

How to get php form data to pdf

Hi I am displaying all the users in the form using php where the data are fetched from db. When i click on the icon all users data should be show in a pdf. How should this can be done. kindly advice. thanks in advance ...

PHP regular expression subpattern behaviour

I want to match both the src and title attributes of an image tag: pattern: <img [^>]*src=["|\']([^"|\']+["|\'])|title=["|\']([^"|\']+) target: <img src="http://someurl.jpg" class="quiz_caption" title="Caption goes here!"> This pattern gives me one unwanted match, title="content", and the match I actually want which is the value b...