php

PHP Multiple Dropdown

Hello, This is my html partial code <select name="number[]" style="width: 350px;" multiple="multiple" size="2"> <option value="one">one</option> <option value="two">two</option> <option value="three">three</option> <option value="four">four</option> </select> PHP code $name = $_POST["name"]; $number= $_POST["number"]; $sql = mysql_q...

Google Maps not rendering completely on page?

Hi guys, I have a google maps on my page with a search pane I built myself which can be displayed and hidden at will. It covers like lets say 200 pixels of the map on a side. The thing is that when I resize my map or so the area where the pane overlaps is unrendered i.e the map doesn't render there for some reason. Check out this link ...

How do I compute the arcot (inverse cotangent) in PHP?

PHP has many builtin trig math functions, but the inverse cotangent does not seem to be available as one of them. This is also referred to as arccot. Does anyone have the function equivalent in PHP to compute this? ...

PHP 6 release date?

What's the current release date for PHP 6. I recall once reading that it was to be released back in 2006. We're just a few weeks away from 2010. ...

magento extension installation

I want to install a Magento extension in WAMP, but not from the Magento connect system. How can I do this? I have the module (extension) code and I already installed the sample data in the Magento installation. Thanks. ...

how can google find me if I am inside a mysql table?

I am creating a classifieds website. Im storing all ads in mysql database, in different tables. Is it possible to find these ads somehow, from googles search engine? Is it possible to create meta information about each ad so that google finds them? How does major companies do this? I have thought about auto-generating a html-page fo...

Why does Chrome show different page source?

Why is that the html code source in Chrome does not show what it should be showing when viewed from Google View Source For example, I wrote like this <div><?php echo "HELLO!" ?></div> But if I view source, "Hello" does not exist even though it displayed HELLO on page! Or if I create an input with a value inserted from PHP, it won'...

Is there a better way than mysql_real_escape_string() to filter variables from clients in PHP?

On a PHP file, I receives more than 20 variables coming from the client(submitted via a web form) and I have to apply mysql_real_escape_string() more than 20 times, it is quite troublesome, is there a better way to do this job? ...

how to extract data from CDATA

Hi, I am extracting data from an XML and some tags have data inside CDATA in this way <description><![CDATA[Changes (as compared to 8.17) include: Features: * Added a &#8216;Schema Optimizer&#8217; feature. Based on &#8220;procedure analyse()&#8221; it will propose alterations to data types for a table based on analysis on what dat...

How double underscore works in cakePHP?

which means, can i change the result of find() to another model using sth like: <?php fields = array('sum(vote.score) as Post__score_sum'), ?> and return: array( 'Post'=> array( 'score_sum' => 5 ) ); related: http://stackoverflow.com/questions/1611311/cakephp-pagination-sort-data-out-of-model ...

What is a good way to process data from a form before applying business logic in PHP?

I think this is a common issue. Whenever there is a form on a web page, there is a PHP file on the back-end processing the data sent from the form. You start with $_POST, You need to ensure that the names of input elements are not falsified, increased or decreased, and you want to make sure that no input elements are left blank, and you...

No matter what I do the same value is being stored in MySQL table field...

I have a MySQL table, with the field ('ad_id'). I store variables in different fields with PHP. One of these fields, the 'ad_id' field as mentioned above, stores the same exact nr over and over again, no matter what the "REAL" name is in the PHP file. Example: $ad_id= 12345; When trying to store this, the number 11111 is stored. ALWAY...

how to set an option for form->input( 'multiple'=>'checkbox')

i plan to set a checkbox with selected option in my form. but i am unable to show my checkbox content in the form, i cant see any value instead of just a box for me to select. how to show value while i using checkbox? i able to show my value while i using select. this is in a HABTM model. any hints? here is my selection code. input...

Find file MYME-TYPE by using file finfo_file

I am using xampplite1.7.2 which using PHP5.3.0 I am trying to find the file MIME type. But its giving me error: Call to undefined function finfo_open() I read the PHP Manual its says that this function support in PHP 5.3 and as i mention that i am using xampplite1.7.2 which using PHP5.3 then why this error occur. I also used ...

Uploading issue with IE, works properly for mozilla

Hi all, <td> <input type="hidden" name="MAX_FILE_SIZE" value="200000000" /> <input name="uploadedfile" id="Uploadfilename" type="file" /><br /> </td> td> <input type="submit" id="fileupload" value="Upload File" onclick="ValidateUpload()"/> </td> Above is working fine for Mozilla and not for IE PHP: if(move_uploaded_f...

Eclipse (PDT) annoyingly locks .phtml files to PHP Content Type

Hello, I am getting frustrated with PDT. I want the .phtml files to be opened as HTML BUT .phtml is "locked" to PHP Content Type and there is no way to unlock it! Opening the .phtml files in HTML would make more sense (for Zend Framework users) because .phtml contain more HTML and some Javascript than PHP code. The question is, wtf wo...

How to emulate XMLHttpRequest client using PHP?

I'm looking for an example how to emulate XMLHttpRequest client using PHP. In other words, send the request over HTTP POST message, and receive and process the callback message. ...

C-style Variable initialization in PHP

Is there such a thing as local, private, static and public variables in PHP? If so, can you give samples of each and how their scope is demonstrated inside and outside the class and inside functions? ...

JS cookie variable lost after post

Hi Gods! main.php: <div id="test" class="test"> <?php include("data.php");?> </div> data.php: In this php, i have a few query, and then print some list...Each list in an own DIV tag, and all DIV tag is "closed" when the page is load, except the last one that the user opened. I use cookie to save the the DIV ID to...

How to enable fileinfo.so

i am using xampplite1.7.2 which is using PHP 5.3 but when i use the fileinfo function its giving me error Call to undefined function finfo_open() I don't know rather my fileinfo.so is enabled or not. So please someone guide me how to check and how to enable it if its not enabled. Thanks ...