php

A PostgreSQL timestamp field not formated in the same way when updated with PHP.

I have a timestamp with timezone field in PostgreSQL. When I update this field, I use something like this: $date = date('Y-m-d H:i:s'); Although the SQL works fine, the date saved seem a little bit different to a classic timestamp with timezone date. Example: Default value set to "now()": date 2009-04-06 14:39:53.662522+02 Update ...

Replacing Tags with Includes in PHP with RegExps

I need to read a string, detect a {VAR}, and then do a file_get_contents('VAR.php') in place of {VAR}. The "VAR" can be named anything, like TEST, or CONTACT-FORM, etc. I don't want to know what VAR is -- not to do a hard-coded condition, but to just see an uppercase alphanumeric tag surrounded by curly braces and just do a file_get_cont...

WordPress + mod_rewrite

Hi guys, I use Wordpress as a CMS, where the front page is static for the most part and the actual blog part of it has been moved to a new page that uses a custom page template that basically acts as if it were the front page on a standard Wordpress install. It works pretty well but it still has a few bugs. The main one is that paginati...

php array to xml, using same array key names

We are using pear's xml serializer to turn our request arrays into XML to submit to other servers for an XML response. The problem is, for one of the attributes we will need to submit an XML similar to this <totalRooms> <Room> ... </Room> <Room> ... </Room> </totalRooms> How do we compile this in PHP arrays so the Ser...

PHP and the goto statement to be added in PHP 5.3

The "goto" statement comes straight out of ASM or any other assembler language. Here's a link: http://be2.php.net/manual/en/control-structures.goto.php I'm wondering: what can this do to make my code more well-organized? How can I implement this in larger projects, without screwing it up. Since the goto will allow you to jump back and ...

PHP Server to Server Transfers

We are storing a Final Image, Back and Front proof and a thumbnail on one server, but what I need to is when the user goes to took at their images, it needs to transfer the image from the image server on to our web server. I have tried opening the the server connection and the transferring the image from where it is to where the .php fi...

Flash and PHP, live user environment: how do I use sockets?

I've been scouring Google to find out how I can make Flash bring at least two users together in an environment. What I've been trying to do is, for example: both users load http://example.com/myflashenvironment.html, and on that page is the same flashenv.swf file that they both see from two different computers. In the flashenv.swf there ...

What are best practices for self-updating PHP+MySQL applications?

It is pretty standard practice now for desktop applications to be self-updating. On the Mac, every non-Apple program that uses Sparkle in my book is an instant win. For Windows developers, this has already been discussed at length. I have not yet found information on self-updating web applications, and I hope you can help. I am building...

Removing an Item from Magento's Admin Panel Navigation

Using the Magento Ecommerce system, is is possible to remove an item from the Admin Panel Navigation menu? More generally, is there a way to use the config override system to remove existing elements from a configuration? I know I can add to the navigation with an override that looks something like this ...

redirect with code igniter

can anyone tell me why my redirect helper doesn't work the way i'd expect. i'm trying to redirect to the index method of my main controller like so: if($provider == '') { redirect('/index/provider1/', 'location'); } but that takes me www.mysite.com/index/provider1/ when it should go to www.mysite.com/provider1. does that make sen...

Which web-development language is best for a C programmer?

Question I program in C (ANSI C89/ISO C90) in a *n*x environment on a regular basis. I am now in a position where it would be beneficial for me to learn a web-development language. In particular, I'm looking to learn a language which: ...exploits my background as a C programmer. ...can produce the level of interactiveness of a web-sit...

When are the most recommended times to use mysql_real_escape_string()

Hi all, Im actually new to using this function.. and was using preg_replace and addslashes previous to finding it. I'm mostly curious, because Im about to go through, and tighten security in the posting areas in my first large app, and wanted to know the best instances where this function is effective, and highly recommended. I've seen ...

Take image input from folder and after resizing store it to a output folder

Hi experts, I need to take sequence of images as input from a folder and after resizing the resized image should store on output folder. I write a code. But in my code after resizing image, out put folder only show black image. To debug this code pls create input & output folder and put some gif image on input folder and see the outpu...

Wordpress autologin using CURL or fsockopen in PHP

Client wants to click a link and auto login to Wordpress backend admin section. I tried using fsockopen, code below. Didn't work. $post_data['user_login'] = 'admin'; $post_data['user_pass'] = 'password'; $post_data['wp-submit'] = 'Log In'; $post_data['redirect_to'] = 'http://example.com/wp-admin/'; //traverse array and prepare data fo...

Installing Html Tidy

I'm running Mac OS X with Apache/2.0.59 (Unix) PHP/5.2.5 DAV/2. I've never administered Apache or PHP before so somethings aren't really that obvious to me. I'm trying to get PHP Tidy to run as mentioned here http://th.php.net/manual/en/tidy.installation.php It says I need to "In PHP 5 you need only to compile using the --with-tidy opt...

running showdown.js serverside to conver Markdown to HTML (in PHP)

Hi, I am trying to implement WMD onto my website and was wondering how would I go about running showdown.js server side to convert markdown to HTML? (in order to store both in the DB) I am using PHP...any tips would be helpful (never ran any sort of js from php before) Thanks, Andrew ...

save image from php url using php

Hi, i need to save a image from a php URL to my pc. Let have a page "http://example.com/image.php" holding a single "flower" image, nothing else. How can i save this image from URL with a new name? [Using PHP] Pls help. ...

Call PHP script from .Net application

Is there anyway to call PHP script from a .Net application and pass in some parameters? ...

php resize script doesn't work for transparent gif's

How Can I get this working for transparent gif's and png's? function resizeImage($image,$newImage,$target_width,$target_height, $type="") { if (is_file($image)) { if($type == ".gif"){ $image_org=@imagecreatefromgif($image); }else{ $image_org=@imagecreatefromjpeg($image); } if ($image_org) { list($w,$h,$type,$attr) = ge...

Error , can anybody help me

hi , im getting this error while trying to run a page http://localhost/sf_sandbox/web/frontend_dev.php/post ERROR: " 500 | Internal Server Error | PropelException Unable to open PDO connection [wrapped: could not find driver] " what is the problem , what i need to do eliminate this problem? thanks ...