php

Ajax : Internet Explorer error

I am working on a login form. The Ajax code is as follows: /* ---------------------------- / / XMLHTTPRequest Enable / / ---------------------------- */ function createObject() { var request_type; var browser = navigator.appName; if(browser == "Microsoft Internet Explorer"){ request_type = new ActiveXObject("Microsoft.XMLHTTP");...

Efficient data importing?

We work with a lot of real estate, and while rearchitecting how the data is imported, I came across an interesting issue. Firstly, the way our system works (loosely speaking) is we run a Coldfusion process once a day that retrieves data provided from an IDX vendor via FTP. They push the data to us. Whatever they send us is what we get. ...

Need a distributed key-value lookup system in PHP

This question asks for one in java, what's the best candidate in PHP? BTW,does the following establish: distributed key value store == distributed cache ? ...

How to get ref of an array in PHP 5 ?

In php 5, all variable and objects are passed by reference, but i can't get my codes work My codes is: $arrayA = array(); $array = $arrayA; ... if(!in_array(thedata, $array) $array[] = thedata; var_dump($arrayA); The result is empty, am i missing something simple? ...

RSA Encrypt in PHP to decrypt in .NET

In PHP I am RSA encrypting a message to be decrypted by .NET application... but I keep getting a "Bad Key" exception from .NET.... For RSA encryption, I am using PEAR class Crypt_RSA-> encrypting with the public key (which is a modulus, exponent pair) I get from working encryption system in .NET... I guess the easiest question would be...

Managing timezone in php with ics date/time format

Ok, I'm using an ICS parser utility to parse google calendar ICS files. It works great, except google is feeding me the times of the events at UCT.. so I need to subtract 5 hours now, and 6 hours when daylight savings happens. To get the start time I'm using: $timestart = date("g:iA",strtotime(substr($event['DTSTART'], 9, -3))); //$eve...

Custom Drupal Module help

Hello, just started creating my own module. below is my code for the admin.inc file. in the administrative settings im looking to be able to enter numbers into a series of textfields. ideally this data is represented into a table format, however ive found this process to be very long winded and although it does as i want, i still feel i...

How to send an array of complex type in PHP using Soap_Client?

Hello I want to know how to send this array of complex data to a SOAP server (that uses .NET / IIS). <xs:complexType name="SampleStruct"> <xs:sequence> <xs:element name="title" type="xs:string"/> <xs:element name="description" type="xs:string"/> </xs:sequence> </xs:complexType> <x...

how to loop through php object and replace a string in each property ( variable )

I need to remove these ' & ' characters from each property of a php object I tried the code below but it's not working...what am I missing? thanks dudes foreach($query_item as $key => $value) { $key = str_replace(' & ',' &amp; ',$value); } ...

PHP Load variables from external file

Hello, How can I import a variable from an external file? What I want to do is to have a configuration file in which I can write all my website settings and then to import these settings to every file, so I can set the website skin and things like that.. How can I do this? Thanks! ...

Are there any differences between SQL Server and MySQL when it comes to preventing SQL injection?

I am used to developing in PHP/MySQL and have no experience developing with SQL Server. I've skimmed over the PHP MSSQL documentation and it looks similar to MySQLi in some of the methods I read about. For example, with MySQL I utilize the function mysql_real_excape_string(). Is there a similar function with PHP/SQL Server? What step...

[PHP & TCPDF] How to center html table?

Trying to create proper PDF document, using PHP and TCPDF. Can you help me, how can I use writeHTML function to create and center table, in TCPDF? Tryed with: $html = ' <div style="margin-left: auto; margin-right: auto; width: 50%"> <table border="1" width="200" align="center"><tr><td><b>Invoice number: '.$this->xInvoiceNumber.'...

Storing pictures per user on website (php)

Users of the website need to able to store images in their "area" , should I store these in the database directly or create a directory for each user. Or should I just have a single directory for all images and in the database store a list of images that each user owns? I'm looking for the most effecient way, which I think is a folder fo...

problem when uploading file

i have the form, and i want to upload two files. here is the script <form action="form.php" method="post" enctype="multipart/form-data" /> <input type="file" name="video" /> <input type="file" name="picture" > <input type="submit" class="input" value="Հիշել" /> <input type="hidden" name="MAX_FILE_SIZE" value="100000000" /> </form> f...

Hooking into comment_text() to add surrounding tag

Trying to hook into the function comment_text() supplied by Wordpress API to wrap the output of every comment into a <div>...</div> container I am running into the following problem: Without my added filter the output of comment_text() looks like this: <p>Hello User!</p> <p>Thank you for your comment.</p> <p>Stefan</p> Thats fine but...

Downloading Amazon and eBay Product Categories

I'm new on a client project where the old offshore developer was fired by the client in a fit of anger and all I have is spaghetti code. Somehow the last developer was using developer APIs to get Amazon and eBay top-level product categories, but the developer stored them as static files (not even a timelimit cache file), and then elimina...

Why isn't my variable expanded in this string?

$q = $_GET['q']; // Load and parse the XML document $rss = simplexml_load_file('http://search.twitter.com/search.atom?lang=en&amp;q=$q&amp;rpp=100&amp;page=1'); This returns results containing "$q" instead of results containing the value of $q. Why won't it work? ...

wordpress functions.php

Hi I'm having issues with the functions.php file with variables $prev_dept = 0; $comment_count = 0; $comment_index = 0; function setCommentCount($size){ $comment_count = $size; } function flowhub_comment($comment, $args, $depth) { $comment_index ++; ...

PHP: Problem with filesize

I need a little help here: I get a file from an HTML upload form. And I have a "target" filename in $File. When I do this: copy($_FILES['binfile']['tmp_name'], $File); echo '<hr>' . filesize($_FILES['binfile']['tmp_name']); echo '<hr>' . filesize($File); Everything works fine. I get the same number twice. However when I delete the ...

Kohana ORM syntax question

I'm using the "join_table" function with Kohana's ORM to build a query. The following works: $category = ORM::factory('category')->join_table('product'); But this doesn't: $category = ORM::factory('category'); $category->join_table('product'); The documentation uses the second as an example, but it returns 0 while the first example...