php

jQuery & PHP and MYSQL IE Problem

Now All of this code works fine in Firfox but in IE the divs dont change when the php infomation changes. Can some one help me please as i am working on a project and this is holding me back Thank you. Here is the jQuery Code: $.ajaxSetup({ cache: false }); $(document).ready(function(){ $("#not").css('display','none'); $("#fonline")....

How is the sausage made tour of apache/php/mysql interaction

I am having trouble understanding how apache/php/mysql stack works on a low level (including interaction with the browser). Is there a good description somewhere (a book, a website, etc) that will walk me through the whole path and explaining how starting with a browser reqesting a url, http requests is being sent, how apache talks to ph...

General MVC Questions - naming, structure (PHP)

Hello, I have tried many PHP MVC frameworks and I noticed that in many frameworks you can do things like this: $this->security->encodeForHTML(); So, basically there is a class Security, which contains a method encodeForHTML(). Isn't this Security class a singleton? Is there a specific name for this kind of "internal" singleton class?...

PHP - How to get object from array when array is returned by a function?

Hi, how can I get a object from an array when this array is returned by a function? class Item { private $contents = array('id' => 1); public function getContents() { return $contents; } } $i = new Item(); $id = $i->getContents()['id']; // This is not valid? //I know this is possible, but I was looking for a 1 li...

How to make menu navigation structures with Kohana?

I had created my own little lightweight framework for small projects, and now switched to Kohana. But I wonder what's the way to go to achieve navigation hierarchies. Example: I have a menu like this: Home | Products | Support | Contact In my old framework, when the user clicked on "Products", my framework knew which navigation laye...

PHP Form Sending Information to Limbo!

I was told my client's quote form has not been generating very many emails. I have learned that although the form brings you to a confirmation page, the information never reaches the recipient. I have altered the code so it goes to my office email for testing purposes. If I post code for the form elements below, would someone be able to...

Refactoring or Rewriting Monolithic PHP Spaghetti Codebase

I've inherited a really poorly designed PHP spaghetti code project. It's been gaining a good bit of traffic recently and is starting to have performance issues on top of the poor monolithic code base. Its maxing out performance on a chunky 16GB dedicated machine when it really shouldn't be. I'm planning on doing some performance twe...

how to convert .cdr (corel draw file) vector images to jpg on imagick PHP API

hi ; how to convert .cdr (corel draw file) vector images to jpg on imagick PHP API ...

What comparable Javascript function can reference a file like PHP's include()?

What is the best way to reference or include a file using Javascript, looking for the closest functionality of PHP's include() ability. ...

checkboxes checked when mysql row = true?

Hi, I am making a page where the user can set there own settings. I need a loop to check the checkbox when the row is true and to be unchecked when its not. How would I go about this? in php/javascript. Thanks echo "<form method=\"post\">"; echo "<table> <tr> <td>1</td> <td><input name=\"checkbox[]\" type=\"checkbox\" id=\"checkb...

PHP: Include file from different root directory

I have 2 root directories for a site, httpdocs and httpsdocs. I am sure its obvious what the 2 are for. But I want to keep things consistent through-out the site like global navigation. Right now I have two separate files for this (one in each side) and I would like to only have one. This is hard to maintain because each time I change on...

[ZendAMF for Flex, PHP] Can ZendAMF have private members?

I've worked with AMFPHP for a while, but with Adobe supporting ZendAMF, I was wondering if I should migrate. One of the major disadvantages for AMFPHP is that class mappings need to be public, so not only does that mean public members on the PHP side, but also on the Flex side. I was wondering if it is the same case for ZendAMF. ...

Shorten String in PHP (full words only)

I have asked a similar question here before, but I need to know if this little tweak is possible. I want to shorten a string to 100 characters and use $small = substr($big, 0, 100); to do so. However, this just takes the first 100 characters and doesn't care whether it breaks up a word or not. Is there any way to take up to the first ...

Passing strange text as variables via post method in php

I have an odd problem. Our company collects data and we use a HORRIBLE piece of software to handle all of our phone interviewing. It uses binary files instead of SQL and uses no compression. As of right now we have to manually run all reports for the clients. I am working on building a web interface to our data and common reports. Now I...

PHP Profiler for a live system on top of Apache

I have a PHP website on a Apache server, and I would like to know if there are tools and other ways I can profile this to find bottlenecks on the code. What I need to know is what functions are taking long to process, etc. Something like gprof, except for PHP on live apache server. What are other ways to find bottlenecks in a PHP sys...

If statement

What the heck is wrong with this: if ($bb[$id][0] == "bizz") { $BoxType = "bus_box"; } else { $Boxtype = "home_box"; } <div class="<? echo $BoxType; ?>"> $bb[$id][0] can either be 'bizz' or 'home' but no matter what it stops after the first step... It is driving me crazy! ...

php performance: template files in database or file?

Hi, I just wonder what is best practice to store template files? In CMS I have using templates and some of parameters are stored in database... But there are some issues then i need to change something in templates or change one of parameter in many pages. Site has 100K unique visits every day... and I don't really want to make experimen...

How to code a simple versioning system ?

I want to do a simple versioning system but i don't have ideas on how to structure my datas, and my code. Here is a short example: User logs in User has two options when uploading a file: Submit a new file Submit a new version of a file Users should be able to see the tree. (the different version) The tree can only be up to 2 leve...

YUICompressor or similar in PHP?

I've been using yuicompressor.jar on my test server for on-the-fly minimisation of changed JavaScript files. Now that I have deployed the website to the public server, I noticed that the server's policies forbid the use of exec() or its equivalents, so no more java execution for me. Is there a decent on-the-fly JS compressor implemented...

Persistent/keepalive HTTP with the PHP Curl library?

I'm using a simple PHP library to add documents to a SOLR index, via HTTP. There are 3 servers involved, currently: The PHP box running the indexing job A database box holding the data being indexed The solr box. At 80 documents/sec (out of 1 million docs), I'm noticing an unusually high interrupt rate on the network interfaces on...