php

SQL syntax errors when using php echo $_SERVER['PHP_SELF'];

I'm trying to submit a page onto itself by using php echo $_SERVER['PHP_SELF']; but keep receiving the following error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1.... There are different forms on the page and I am having the same prob...

PHP script to execute at certain times

Is there a simple way to have a php script execute some html at a certain times of the day? For example i have on my home page a header and at certain times i want to be able to add something right under the header, in this case a iframe. I know everyone mentioned cron jobs but how would this work with that? also is there an alternativ...

How to speed up image resizing in a CodeIgniter PHP application?

I have an application that allows users to upload images. The test case I use is a jpeg of 1.6MB with dimensions 3872 x 2592px. The upload script in the back-end will resize the uploaded image into 6 additional formats: square (small 75 x 75) Small Thumb (50 x 38) Thumb (100 x 76) Small (240 x 161) Medium (500 x 378) Large (1024 x 774)...

Multiple items with PayPal button and PHP

I'm building a website where I basically want my checkout to work like this website: http://www.solutionkaizen.com/html/boutique.php It allows you to enter the quantity for each item and then press a button which brings you to PayPal and lists how many Products you have. On PayPal's website, all the info I found seems to lead to me ne...

When I have an abstract class, can I let another abstract class extend that one?

Let's say I have an abstract class called ViewController, and another abstract class called FormViewController. When someone wants to create a form, he must subclass FormViewController and implement its abstract classes. ViewController defines an abstract method loadView() and viewDidLoad(). FormViewController implements loadView() but ...

replace eurosign in json

Hello, Can anyone help me with this one I have this query and only after adding the last one wich is indexed against the euro I get invalid json. $url = 'http://www.google.com/finance/info?client=ig&q=goog,yhoo,AMS:TOM2'; $response= json_decode($response,true); The only thing different if I directly echo the output is the quest...

Setting public class variables in PHP

How do I set a public variable. Is this correct?: class Testclass { public $testvar = "default value"; function dosomething() { echo $this->testvar; } } $Testclass = new Testclass(); $Testclass->testvar = "another value"; $Testclass->dosomething(); ...

Which is the best TimeZone settings for php mysql site?

hi, i am running a site and i need to set the timezone. which is the most preferable time zone?? my server is in GoDaddy.com. So any one help me to set the time zone via php. ...

php mail and multiple css classes do not work?

I can't seem to get multiple css classes working with php's mail, I've gotten inline styles to work just fine but when I try to associate classes with elements it's a no go.. Yes, I know there are other options that are probably better than php's mail. Yes, the classes are local and not from an external style sheet. Only 1 class will ...

Using PECL to install extensions on Windows 7

I've been trying to install some PECL extensions on my laptop, but I've ran into a few problems. Whenever I run pecl install whatever from the command line I get a message saying ".\php.exe appears to have a suffix .exe, but config variable php". It seems like PECL is using PEAR to perform installations. I checked and php_suffix is locat...

Download a file that is forced as attachment with PHP

Hi, I am trying to download a file with PHP from an FTP server which i can access from http too. For example: FTP://username:[email protected]/file_name_here.gz. The file is forced as an attachment from the server (not as a PDF or TXT would do eg: output). I tried it with 3 different methods: file_get_contents -> Return a zero ...

MySQL Triggers: How to know which script called it?

I have a mysql trigger that logs every time a specific table is updated. Is there a way to also log WHICH PHP SCRIPT triggered it? (without modifying each php script of course, that would defeat my purpose) Also, is there a way to log what was the SQL statement right before the UPDATE that triggered it? Thanks Nathan ...

How can I make DIVs do this with jquery?

I am trying to reproduce the lock function on posts on facebook with jquery and php/mysql. Below is an image showing the different actions it does when clicked on. I think you would do somehing like on hover, show a hidden div with a tooltip, on hover off remove it. On click event show another hidden div but somehow has to change the ...

Embedding an AHAH form element into a theme_table-generated table (Drupal)

Hi, I am trying to include a Drupal form element in a table I am generating with theme_table/theme('table',..). Specifically, I am trying to include a submit button with an AHAH attached. Currently, I am just including as one cell in each row a call to drupal_render to render my dynamically generated AHAH element. The button renders ...

How would I access this object value?

I'm trying to echo and access the values stored in ["_aVars:private"] $obj->_vars and $obj->_vars:private doesnt work :( Here's the var_dump of $obj object(test_object)#15 (30) { ["sDisplayLayout"]=> string(8) "template" ["bIsSample"]=> bool(false) ["iThemeId"]=> int(0) ["sReservedVarname:protected"]=> string(6) "test"...

Get a value from a form item in PHP

Basically Iv got PayPal items set up and I have for instance a text input feild called ItemQuantity1 When I press the corosponding add to cart button, I want it to use the value of ItemQuantity1 to fill the variable for quantity which PayPal uses. so if I have: |15___| |Add to cart| when I push add to cart I want it to say that I add...

Is my PHP script cache (public) friendly?

I have finalized a small PHP application that can serve many documents. These documents must be cacheable by clients and proxies. Since proxies can cache my results I must be extra careful because the documents I serve can have different MIMEs types (content negotiation based on $_SERVER['HTTP_ACCEPT']) and different languages (based in...

How can I reduce time to generate PDF dynamically using PHP?

Hi all, I am generating PDF dynamically using html2ps PHP library. I want to decrease time of generating that PDF .I want to reduce that PDF generation time .Is there any way to reduce the time or optimize it? Help me please. ...

Storing real time data

Hello, I am building a website in which the user can select what list items they see in their navigation menu, my idea is to store the menu items that the user selects in a cookie as this will stop the need for the user to be registered member on the website, is it possible to store realtime data in a cookie and how would I do this? ...

Running a PHP application in a desktop environment

I have been pondering about this for a few days, and I'm surprised this hasn't been done yet or isn't very popular. What I would like to see was a way to run a PHP application inside a desktop application. For example, the application would need its own mini webserver that doesn't handle requests, but allows PHP to be run. Sometimes I ...