php

Problem in Uploaded Webpages on site.

Warning: include(html\download.html) [function.include]: failed to open stream: No such file or directory in /home/jamia/public_html/download.php on line 4 this message is displayed when open any page. it is index page. ...

Database Abstraction & Factory Methods

I'm interested in learning more about design practices in PHP for Database Abstraction & Factory methods. For background, my site is a common-interest social networking community currently in beta mode. Currently, I've started moving my old code for object retrieval to factory methods. However, I do feel like I'm limiting myself by ke...

How to check a complex condition in Smarty(PHP)

I need to display a section or another in a smarty template. My condition is simple: if a smarty value starts with a string I should display one section, otherwise the other smarty section should be displayed. I can change only the tpl files. {php} if (substr($url,0,4) != 'http') { {/php} section 1 ...

My jQuery and PHP give different results on the same thing?

Hey all, Annoying brain numbing problem. I have two functions to check the length of a string (primarily, the js one truncates as well) heres the one in Javascript: $('textarea#itemdescription').keyup(function() { var charLength = $(this).val().length; // Displays count $('span#charCount').css({'color':'#666'}); $('sp...

L-Soft LISTSERV TCPGUI Interface for PHP Creation

I'm trying to use LISTSERV's "API" in PHP. L-Soft calls this TCPGUI, and essentially, you can request data like over Telnet. To do this, I'm using PHP's TCP socket functions. Here's the C code provided by L-Soft: C: http://www.lsoft.com/manuals/16.0/htmlhelp/advanced%20topics/TCPGUI.html#2334328 I've provided the PHP conversion I'm us...

Unserialize in ActionScript 3

I have an array that I am constructing in PHP which I am serializing then returning to Flex through AMFPHP. Can someone point me towards a solution for unserilizing said data once it gets into Flex via ActionScript 3? ...

Real time web site using PHP or ASP.NET

Hey Guys, I'm looking for a way to put real time features into my web site. The idea is asynchronous communication between 2 people - like a chat session. If I use the chat example - I'd like the second person to know that the first one has sent a message to him, without refreshing or doing something active on the web page. Polling is...

Problem in making custom syntax highlighting in TextMate. Help!

Hi, I am trying to highlight a custom language in TextMate. However, the following definition does not highlight PHP insertions (I do select it for my *.serpent files): { scopeName = 'source.serpent'; fileTypes = ( 'serpent' ); patterns = ( { begin = '<\?'; end = '\?>'; patterns = ( { include = 'source.php'; } ); }, ); } ...

Why doesn't this short php script send email?

I can't seem to get my php script to send email. <?php echo "Does this page work?"; mail('my email address', 'test subject', 'test message'); ?> First, I have set the mail function settings in the php.ini file as follows: I checked my email account settings on outlook. It does not require authentication, its port is 25, and its typ...

How to make <option selected="selected"> set by MySql and PHP?

How to make <option selected="selected"> set by MySql and PHP? My code: echo '<select>'; $tempholder = array(); $rs = mysql_query("SELECT * FROM id ORDER BY year"); $nr = mysql_num_rows($rs); for ($i=0; $i<$nr; $i++){ $r = mysql_fetch_array($rs); //if($year==$r["year"]){ $selected=' selected="selected"'; }//doesn't work so ...

Text box added using javascript doesnot respond as expected to the js attached to it.

Hello, I am adding a text box using javascript: This is what is generated: <dd id="text3-element" style="width: 350px;"> <input type="text" size="50" id="text3" name="text3" onblur="return getFieldValue(this.id);" value=""> </dd> This is what is present in the getFieldValue function: function ge...

Memcache - How extend expiration of value with keeping consistency of value?

See this simple piece of code in PHP: //Documentation: //memcache_set ( string $key , mixed $var [, int $flag [, int $expire ]] ) //memcache_increment ( string $key [, int $value = 1 ] ) //part 1 memcache_set ( 'id' , 1 , 0 , 60 ); //part 2 $id = memcache_increment ( 'id' , 1 ); And now imagine that the incrementing "part 2" is call...

PHP Interpreter/Compiler

I am trying to understand how the php compiler/interpretor works. I tried to download the php source code and tried to understand how it works. I was not able to find proper documentation. WOuld be great if someone could throw light on th modules that make the php compiler and also how the apache server uses the php compiler.. Thanks ...

PHP Losing variable data

Hi, I'm having an issue with PHP losing data in a variable. There is quite a bit of data in the variable, because it basically contains a binary file, but I'm wondering if this is cause for it to completely lose it's information. Looking at a snippet from my code which is used to deal with email attachments: var_dump($data); if (ar...

Recommendation for a Pagination procedure AJAX PHP

Hi, I am not sure the correct terminology for the process that I am trying to describe. I don't even know which platform is underlying the technique. If you understand my description, please give the link to the site(s) and or the keyword name of the process. I think it is done by AJAX, but I am not certain. I use php as the backend ...

Is there any opensource Flash+PHP multyuser whiteboard?

Is there any opensource Flash+PHP multyuser whiteboard? ...

Repeated bootstrapping in Zend Framework

I have a fresh install of Zend Framework v1.10.5 on my application server. The only modifications are the two init methods below in which I simply set up a logger and write to it as a part of the bootstrap process. class Bootstrap extends Zend_Application_Bootstrap_Bootstrap { protected $_log; protected function _initLogging() ...

Best PHP xml2array function

I need a function that takes a string as XML input and change that into an array. Example: <a> <b> <c></c> </b> </a> So I can read it in PHP like this: $array = xml2array($xmlcode); echo $array['a']['b']['c']; Note: I tried all xml2array functions in PHP's documentation on xml_parse, and they all didn't work or had problems. ...

Zend getNumber() not working with thousands separators properly.

I'm having a problem getting some numbers to display properly using zend. The country code is for france "fr_FR" Here's the code: include_once '../classes/zend/library/zend/currency.php'; $value = '2 123,25'; $number = Zend_Locale_Format::getNumber($value, array('precision' => 4, 'locale' => 'fr_FR') ); return $number; I'm expecting...

PHP redirection/popup: Keep existing page and pop up a new tab

Hi all, I read that we can use the following in the meta tags for redirection to another page after desired number of minutes: <meta http-equiv="Refresh" content="10; url=http://www.example.com/" /> That is fine if it's acceptable to navigate away from the page that user is on. But what I am trying to do is that instead of navigating...