php

How to integrate Flash and MySQL

Hi all - tutorials (e.g. ) show how to integrate Flash and MySQL. Also Flash can manipulate and sent this back to server (http://www.kirupa.com/developer/actionscript/create_edit_xml.htm). To integrate flash and MySQL one can do the following: (1) MySQL -> php -> Flash (e.g. (http://)library.creativecow.net/articles/brimelow_lee/php_my...

Opening php file declaration question

I've inherited an existing php web site. The file names end with the php extension and the code appears to be php. Just wondering why the opening file declaration is "<?" instead of "<?php". What is the difference between the 2 and why would one be used over the other. Thanks! ...

Is it possible to "escape" a method name in PHP, to be able to have a method name that clashes with a reserved keyword?

I'm doing MVC in PHP, and i'd like to have a list() method inside my Controller, to have the URL /entity/list/parent_id, to show all the "x" that belong to that parent. However, I can't have a method called list(), since it's a PHP reserved keyword. In VB.Net, for example, if I need to have something with a name that clashes with a res...

Managing quotes when using CKEditor setData function

Hey! I want to print a table in PHP, each row has a button to load it's content (HTML codes) into the CKEditor instance. $column = '<td><a href="#" onclick="CKEDITOR.instances.editor.setData(' . "'" . $HTMLcode . "');" . '">Load</a></td>'; echo $column; The HTML code also contains quotes because of the CSS styles: <p style='text-a...

What's the principle of autoloading in PHP?

spl_autoload_register can do this kind of job,but I don't understand how is that kind of job done? spl_autoload_register(array('Doctrine', 'autoload')); ...

ASP.net vs PHP - performance, future-proofing & ease of development

I was asked yesterday by a client whether it was better for him to run his high-availability / throughput shopping site on ASP.net or PHP. He's ready to make a "Ten Year Decision," so he needs to know that the platform he picks will continue to be well supported and that developers will be available with the skills to work on it. I've ...

xml parsing in php issue

I have this code/function method as part of a class in php: function defaulthome(){ $fp = null; $err =''; $xml_parser = xml_parser_create(); $rss_parser = new Rssparser(); xml_set_object($xml_parser,&$rss_parser); xml_set_element_handler($xml_parser, "startElement", "endElement"); xml_set_c...

incompatibility error - element is not allowed to be self closing in current schema

I had a html page that showed no incompatibility issues. I added some php code at the top for security purposes and now I get these following incompatibility issues due to the page now being a php page This element is not allowed to be self-closing in the current schema. The schema is Internet Explorer 8.0. I tried removing the trail...

Using HTML Entities in a Zend Form Select

I am populating a Select form element, and if I try to use HTML Entities in the value, it get's converted, rather than displaying the special character. This code: $form->field_name->addMultiOption('value', '&nbsp;&bull; label'); Renders: <option value="one">&amp;nbsp;&amp;bull; label</option> But I want it to be: <option value="...

implimenting refactoring setup as one-man team (PHP project)?

Hi folks, I had a web-based application outsourced (all PHP with jQuery and some other scripts and ajax). Now I am finished with the provider, and I'm slowly learning php and I'm wanting to begin refactoring this application so I can begin to more deeply understand it, and then begin adding more of the features I'm needing. I have seen...

Image Upload to rackspace cloud files using PHP

I am trying to upload file to rackspace cloud file using the following code: Upload.html <form action="upload.php" enctype="multipart/form-data" method="POST"> File: <input name="upload" type="file" /> <input name="submit" type="submit" value="Upload To Rackspace!" /> </form> Upload.php <?php // include the API requir...

PHP validate input alphanumeric plus a few symbols

Need a way to validate an input field (in PHP) so it can contain only the following: Any letter Any number any of these symbols: - (dash) _ (underscore) @ (at) . (dot) or a SPACE Field can start or end with any of these (but not a space, but I can trim it before passing into validation function), and contain none, one, or any number...

Are there any artificial intelligence projects in PHP out there?

I'm interested in this field,but I'm only familiar with PHP so far. If not,can you recommend a tiny but not so bad project that's easy enough to learn? ...

retrieve and display multiple mysql records with jquery

This is what I have got. It displays just one single record. Can anyone please tell me how can I retrieve multiple records from the table. $.getJSON('getinfo.php', { id:id }, parseInfo); function parseInfo(data) { $('div#info').html(data.name +': '+ data.title); } The getinfo.php part is as follows: $id = (isset($_GET['id'])...

Create a folder if it doesn't already exist

I've run into a few cases with wordpress installs with bluehost where I've encountered errors with my wordpress theme because the uploads folder (wp-content/uploads) was not present. Apparently the bluehost cpanel WP installer does not create this folder, though HostGator does. So I need to add code to my theme that checks for the fold...

Is there a tool to convert php built-in functions to c implementation?

I'm curious about how some built in functions are implemented,but it's very time consuming to look it up directly in the source,is there a tool that can automate this? EDIT Or is there a tool that can debug into the c code that's actually executed? ...

why is this ajax call not reading my internal php?

Hi folks, Too many edits to keep track of, but I have simplified the issue. I have this code in my index.php: <div class="calendar_top"> <?php include(SITE_ROOT . "/includes/sub_top_divs.php"); ?> </div> <table class="tablebodycontainer"><tr><td> <?php include(SITE_ROOT . "/includes/view-monthly-calendar-ajax.php"); ?> </td></t...

"New Content Avaliable!" PHP message checking a cookie

Hello guys, I'm trying to set up a cookie which would store the time when the user leaves a website, so in the next visit he can find a "There's new content" message (if any) - checked against his "last seen" stored time. The things I'm stuck with are two : how do I send a cookie when he leaves the site ? And, then, how do I check that...

How to get the affected rows of the Zend_DB_table?

After you do get the number of rows affected when you do $table->delete($query) does it return the number affected rows?? ...

Simple regular expression question: How to find all @username mentions on a page of html?

I'm new to regular expressions in php. I have a long string of html. I want to find all occurences of: @any_username_after_an_at_sign Could somebody help me recover all of the usernames on a page? I think you use preg_match but I don't know the regular expression to use. Thanks!! ...