php

Regular expression help in PHP

I'm currently trying to learn regular expressions with some simple "real world" examples. Take in consideration the following string: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.9.2a1pre) Gecko I want to find the RV value (1.9.2a1pre). I need to apply the following rules: RV: can be in any case (RV, rv, rV, Rv...). RV...

Semi-Colon In String in PHP

Hi! I am retrieving an html document from a MySQL db through PHP, and it has semi-colons in the style tags like this style="background-color:black;display:block" I've had issues with the quotes, and escaped them with slashes however I can't do the same with a semi-colon. Is there any way to escape this? Thanks for any help! ...

Platform to manage multiple websites on multiple domains with multiple layouts

Is there an existing PHP/MySQL CMS that would be appropriate to manage multiple websites with one backend? The sites will most likely exist on multiple servers and will have different domains. I took a look at wordpress MU, however it doesn't appear to have features for sites on different domains or servers. A CMS that also has an API fo...

Anyone know about a good multiple file upload script using php/mysql and ajax/javascript?

Hi, as the title says: Anyone know about any good/simple multiple file upload script that uses php/mysql and ajax/javascript? I want it to show a progress-bar, and easy customization. I've tried uploadify and fancyupload, but I would want the option of adding a description and title. (and I've got some bad experience with uploaders usi...

Can two variables be used in a function at once?

Hello, The function check_porn_terms below checks to see if a variable contains terms that are not family friendly, and it it does, then re-directs the user back to the main page. As listed below, it checks to see if the variable $title has non-family friendly terms. I would like to perform this check on another variable, $cleanurl....

How can i mix OR and AND in ORM queries

I am developing a site using kohana 2.3 and am having trouble with a specific ORM query. Essentially what I am doing is the following query SELECT * FROM 'records' WHERE ('ServRepSupervisor' = name AND 'Followup_read' = 0) OR ('ServRepSupervisor' = name AND `read` = 0) when I try the ORM query like this... $unread = ORM::factor...

special character in php soap request wrongly displayed in xml out package

Hi, I'm using a webservice that in my request includes a ¥ symbol (chr 0165). I have set the encoding on my soap client to: $soap = new MySoapClient('address.wsdl', array('trace' => 1, 'encoding'=>'ISO-8859-1')); But when I look at my outgoing soap package the "¥" is changed to "Â¥" I'm not good at encoding but I've tried a number...

How To Get 'echo'-ed content from URL-external-php-file

Hi everybody! I have 2 files on 2 different servers: file1.php - resides on site 1 - I pass a parameter, and the script echo-ed answer which depends on (is function of) passed parameter - everithink is OK when I access file by browser like http://site1.com/file1.php?parameterValue file2.php - resides on site 2 - file2 has to sen...

A form that writes to excel

I was wondering what the easiest way to write a simple form program or web page that will output to a text file that can be opened in excel easily. I know how to write in C++ but I dont know any GUI and I wanted a simple form. I was thinking I could just write an HTML/PHP page but it has to be able to run without the internet, but I dont...

Doctrine and aliases from the select clause in the where clause.

I am using an alias in my select clause ("AVG(u.rating) as avg_rating") and would then like to add this in my where clause "avg_rating > 3" but when I try and run this query I get a "Unknown column 'u3__1' in 'where clause'." Does anyone happen to know how I can get my where clause to see the alias? This alias works in the orderBy with ...

What type of webservice works best with iOS?

I'm going to be creating an internal app for the iPhone and iPad that will keep track of sales calls, the associated quotes, photos, and drawings for those quotes. I'm still in the concept design phase and I'm trying to read up on the different ways to communicate between my app and the webservice. Obviously since this will be used mostl...

jaiku php oauth authentication

how i can i complete oauth authentication with php for jaiku? i completed authentications for google, facebook,friendfeed, etc. but for jaiku there is a problem. can you send an example for jaiku oauth? ...

Blocking a submission to MySQL if conditions are met

Hello, The code below works well. It submits some variables into a MySQL database. How could I block the submission and redirect the user back to domain.com/index.php if the conditions below are met? Conditions: $uid has been used more 11 or more times in a calendar day. $cleanurl has ever been used before. Thanks in advance, J...

PHP grouped form and some has extra data

Have a form that is emailed with checkboxes. Some checkboxes have an optional field to enter text. Like "other and more info" How can I attach the text people entered to those check boxes that this option. This is one group. <form action="sendemail.php" method="POST" name="Contact Form"> <div><input type="checkbox" class="checkb...

Handshake between a socket server and Flash AS3

Hi, What's an example of a simple handshake between a php socket server and flash? A test I can run command line would be ideal, since I don't have a server for this experiment. I'm need a good example that's easy, and something I can run off my laptop without internet:) Thanks FLASH CLIENT //SOCKET CLIENT IN FLASH AS3 var xmlSoc=ne...

Should I use PHP or Ajax for dynamically loading content into a social website profile?

Getting some data from a MySQL database and loading it into the page. None of the stuff really needs to be retrieved at any point other than page load, so that advantage of Ajax is moot. Is there any other advantage to Ajax? ...

Correct Location for Custom Zend_Action_Controller

The ZF Docs reference 'Subclassing the Action Controller' (bottom of the page), but don't reference a standard place to put the new Action_Controller class. Application_Module_Autoloader sets up pats for a bunch of things, but never controllers. I guess putting it on library/APPNAMESAPCE/Action/Contoller would work. But that seems a bi...

Validate passwords with CakePHP 1.3

How do I run validation checks on a password field in CakePHP, seeing that the password is hashed before I get a chance to run any checks on it? ...

Is CakePHP's routing messing up my .htaccess 301 redirect?

I just migrated a site to an updated version, but want to put 301 redirects in place for some of the most common entry pages of the site to their counterparts So here's the rule I'm adding to the .htaccess: Redirect 301 /oldhomepage.htm http://www.thesite.com/ It sort of works, but it redirects to http://www.thesite.com/?url=oldho...

How to make TLS connection from PHP in web server, and safely

Suppose I have some PHP code running inside a web server, for example, running a simple CakePHP app. From this app, I want to occasionally make a TLS connection out to some server to exchange some data. How is this typically done? (I have little experience with PHP.) What PHP plug-ins or libraries or whatever, are recommended to accompl...