php

Viewing PHP Pages in Dreamweaver Design Mode

I built a php site that is hosted with an ISP. A friend who is a designer is supposed to edit the page content. There's an area on the page that is open for page content, but most of the outer "wrapper" is built with include() files. When she opens the files in design mode, everything is broken. I tried to set up a test server in DW, bu...

Port checking from php

I'm trying to connect to gmail pop server from a phplist installation and it fails, but i'm not sure whether my webhost opened port 995 or not. They say they have opened it, but i'm in doubt. Is there a way i can check it from a php script? They are running php 5.2.0 on a windows server, though i'm not sure what OS is that. phpinfo() sa...

php array parent array position

Hello, Is there a way to get the the current position of an array from within a nested array ? I have a php script that has a for loop which cycles through an array, with in this is an nested loop which cycle through a sub array. I can use pos() to get the position of the child array, is there anyway of getting the current position of...

Fix a warning thrown by HTML Validator

Hi I have some JavaScript code in my php website. This code uses jQuery, and builds a < select > menu using ajax calls. Here is the code sel.append('<option value="' + data[i].id + '">' + data[i].nombre + '</option>'); And this gives me the following warning line 240 column 82 - Warning: '<' + '/' + letter not allowed here Does any...

How to test my forms in Zend Framework 1.8+?

So I've set up testing in my ZF 1.9.5 application thanks to this tutorial, I am able to test my controllers, now I want to create a test for a form. However, I'm having the problem that PHPUnit can't find my form. Fatal error: Class 'Default_Form_AccountProfile' not found I'm extending PHPUnit_Framework_TestCase instead of Zend_Test_...

How can you test if you're on the homepage in Joomla?

Hi I'm working on a Joomla site, and I need the front page to look slightly different from the rest of the pages, but not enough to warrant the use of two themes (it's a pain to have to update two stylesheets and two sets of images every time I want to make a small change). My thoughts are to throw in a little test in the index.php of...

Different PHP results with -r option

PHP appears to be giving different hash values when I use php -r <code> on the command line and when I execute the file with php <file>, php -f <file>, or run the code inside Apache. For instance, a SHA1 usage on command line using -r: $ php -r "print sha1('$1S*90');" 77cd8b48ceca53e018f80536b0a44c5b6710425f When I try the same with ...

md5 encrypt cookiedata with serialized array

Hello, I was attempting to encrypt de cookie data with md5, but I can not validate the hash back. It has got to do, with the fact that cookie_data is a serialized array, because normal stringvalues work ok. It's actually from a codeigniter class, but it does not work?? Does anyone know what the problem might be? $hash = substr($s...

PHP DOMDocument error handling

Hi, In my application I am loading xml from url in order to parse it. But sometimes this url may not be valid. In this case I need to handle errors. I have the following code: $xdoc = new DOMDocument(); try{ $xdoc->load($url); // This line causes Warning: DOMDocument::load(...) // [domdocument.load]: failed to op...

DOMElement cloning and appending: 'Wrong Document Error'

There's something I don't fully understand about node cloning with the PHP's DOM api. Here's a sample file that quickly duplicates the issue I'm coming across. $doc = new DOMDocument( '1.0', 'UTF-8' ); $root = $doc->createElement( 'root' ); // This doesn't work either $root = new DOMElement( 'root' ); $doc->appendChild( $root ); $doc...

Open Source PHP script for HTTP streaming?

Open Source PHP script for HTTP streaming? Does anyone know something about such things? ...

app that auto-generates CRUD UI for database table

I have a MySQL database that has a few very simple tables. I would like to find an app (implemented in Perl, Python or PHP) that will do the following: Point the app to a database table, and it automatically retrieves the table's schema from the database. It then generates an HTML view of the table's data. The data is displayed as a ...

PHP: PEAR Mail connecting but not sending (no error)?

I'm using PEAR's Mail package to send email from my script. I'm pretty sure I have everything connected and declared properly, but when the script runs, it just connects then immediately disconnects to my Mail server without actually sending the email. From my Postfix logs: Nov 18 16:15:49 mailer postfix/smtpd[30346]: connect from xxx-...

Synchronize identical tables in separate databases with php

I'm trying to set up a PHP script to read a handful of MySQL tables from database A and then insert them into databases B and C. It's a really simple scenario - the tables being copied over can even be emptied or dropped before they have values inserted into them. All the databases are on the same server, and I don't need to preserve t...

add dynamic (no matter image size) shadow effect on images?

Is it possible to create a 1 pixel shadow image (say shadow.jpg) in photoshop, and then with PHP repeat that shadow just beneath or on the side of an image, for whatever the width or height of the target image is? Example: If my image is 640x420 then shadow.jpg will be repeated just beneath this image 640 times, thus creating a drop sha...

jQuery + MySQL Noob Problems

I'm trying to get this to work, but no luck. It's 3am, so that may be the problem. What am I missing here? I'm trying to insert some data via jQuery to a local MySQL table. If I run save.php on its own, it inserts a blank row in the DB, so that works. Any ideas? **index.php** <html> <head> <link rel="stylesheet" type="text/css" hre...

Where can I find information about Inotifier ?

I am looking for documentation/tutorial for Inotifier as I need to implement file notification logic in PHP. ...

php regular expression to filter out junk

So I have an interesting problem: I have a string, and for the most part i know what to expect: http://www.someurl.com/st=???????? Except in this case, the ?'s are either upper case letters or numbers. The problem is, the string has garbage mixed in: the string is broken up into 5 or 6 pieces, and in between there's lots of junk: unpri...

Verifying Uploaded File

I am working on a document that requires a user to upload a Microsoft Word Documents. Apart from checking the file extension to be .doc or .docx, is there any other way i can verify that the uploaded file is actually a Microsoft Word Document and not any other file renamed to a .doc or .docx extension. Thanks in advance. ...

Interactive Debugging and Breakpoints with Xdebug and the Zend Framework

I'm trying to get interactive debugging working with a Zend Framework application and Xdebug, using MacGDPp as the client debugger. I'm running to some problems setting breakpoints and was hoping Someone could solve my specific problem Someone could give me a high level overview of how this is supposed to work so I can track down the ...