I'm struggling with an odd error. I have a simple web app that grabs stuff from a DB then outputs it as a downloadable csv file. It works on firefox and chrome, but IE fails to recognize it as a csv file (thinking it is a html fle) and when I click save I get the error, "Unable to download {name of file} from {name of site}. Unable to op...
I have a script that does a lot of legwork nightly.
It uses a PDO prepared statement that executes in a loop.
The first few are running fine, but then I get to a point where they all fail with the error:
"MySQL server has gone away".
We run MySQL 5.0.77.
PHP Version 5.2.12
The rest of the site runs fine.
...
Here is the 'id' and (path) 'name' in the MySql table called "upload":
rec_id | name
--------+------------------------------------------------------
1 | C:\Apache Tomcat 5.0.28\htdocs\ajax\images\blob1.jpg
2 | C:\Apache Tomcat 5.0.28\htdocs\ajax\images\blob3.jpg
3 | C:\Apache Tomcat 5.0.28\htdocs\ajax\images\blob2.jpg...
SOLVED:
This URI works:
/controller/action?ret=%2F
I want to pass an additional "/" parameter to the controller action. So I did this:
$par1 = urlencode('/');
$this->_redirect('/controller/action/par1/' . $par1);
But I get this error message:
Not Found
The requested URL /controller/action/ret// was not found on this server.
...
I'm really stumped by this. Here is the php:
Update: I have escaped the inputs (before I did this a different way, but didn't know about mysql_real_escape_string). Also, I replace the double quotes with single quotes, yet the same problem is happening. Below is the updated code:
$request = mysql_real_escape_string($_POST['id']);
$c...
Tables:
Province hasMany County, County belongsTo Province, County hasMany City, City belongsTo County
So basically something like: City belongsThroughCountyTo Province
Situation:
In a search form I have a select drop down menu with provinces.
The "code":
When I list the results, I first get ids of counties that belong to the speci...
What's this database design and it is displaying three rows of id in names in products and three rows of prices, and three row of each field when I am looking for to display the name, variety and price in one row then the next row display another different set of field values different than the first row. How can I achieve that with that...
I made a simple web crawler using PHP (and cURL). It parses rougly 60 000 html pages and retreive product information (it's a tool on an intranet).
My main concern is the concurrent connection. I would like to limit the number of connection, so whatever happens, the crawler would never use more than 15 concurrent connections.
The serv...
Hey, I've a application written with a MVC framework it has about 10 forms to insert new data or update existing data. Now every time i extend a feature i have to retest the hole application, and that takes time. how can i automate this? I don't have experience with this unit test thing and as far as i understood the concept its not that...
In order to make use of a particular jQuery menu in WordPress, I need the child UL (dropdown part of the menu) to have a selector added to it (third line, below):
<ul class="dropdown">
<li>the first list item
<ul class="sub_nav">
<li>child list item</li>
</ul>
</li>
</ul>
Note: I left out the link ...
I'm trying to use call_user_func_array and mysqli_stmt::bind_param like so:
# A. prepare an insert query statement
$this->_stmt = $db_link->prepare('INSERT INTO foo (col1, col2) VALUES (?,?)');
# B. bind a placeholder array to the statement
$bound = array('col1' => null, 'col2' => null);
call_user_func_array(array($this->_stmt, 'bind_p...
Hello, I am still new at PHP/Javascript/Ajax and am having a very hard time (been going on for weeks) trouble shooting this problem.
My site has a registration to be a member page that requires all fields to be filled out. This is a website for the Cystic Fibrosis community, so there is a section on the form where you choose your relat...
I have some objects that I wish to cache on disk. I use serialize() in this process. The objects contain some references to other objects. I don't want those to be serialized as well (that is done in some other place) because it would give me duplicate instances of the same real-world object when unserializing.
Is there a way to change ...
is there any equivalent to response.end in PHP?
...
how can i resize an image like this: resize it to a specified width, keep the proportions and if the height is bigger than a specified value to crop to the specified height ? ok actually i know how to do that but i don't want to do this in a different file and refer the picture something like <img src="picture.php" />.
I need to proces...
I am currently trying to build a simple custom layer that I will extend instead of Zend_Form. For instance, My_Form.
I want all my forms to look the same so I am setting this in My_Form. Here is what it is so far.
class My_Form extends Zend_Form
{
protected $_elementDecorators = array(
'ViewHelper',
'Errors',
...
I'm hoping someone can help me. I'm trying to upload an image via a form, resize it to 600px, create a 100px thumbnail and then add a watermark image to the 600px version, but the code below is just creating two versions of the original image.
$image = $this->upload->data();
$resized = base_url()."images/artwork/".$image['orig_name'];
...
I've set up a local dev environment on snow leopard, and have set postfix up to send email via my isp mail server.
I eventually got postfix to work after much frustration, but now when my emails send the header information is bunged up!
I'm using the following php code:
$email = "me@mydomain";
$subject = "Email tester";
$body = "Simp...
I'm writing a small app that needs to have a super easy install process. Version one used a csv file instead of a database, so priority #1 for v2 is getting sqlite going instead. I've used sqlite a lot with Ruby, and love it, but this is my first time using it with PHP.
Basically, in order to get SQlite3 to be able to insert into the db...
I'm building an application in the Zend Framework, but I'd like to implement a "Data Mapper" style ORM layer, constructing Model classes that only include the specific pieces of data they need to represent the domain concept (regardless of which tables those fields happen to belong to). Since my DB structure is highly normalized, the ben...