php

php PHPExcel split Excel cell coordinate

currently, I used PHPExcel to import excel file, there is a function $cell->getCoordinate(); I would like to ask any solution for split the cell coordinate alphabet and integer? e.g A1, A2, I need to know currently which row, and until which column. I do some research about split, but not luck for it. Any idea? ...

maximum URI length for file_get_contents()

Is there a maximum length for the URI in the file_get_contents() function in PHP? ...

How would the conversion of a custom CMS using a text-file-based database to Drupal be tackled?

Just today I've started using Drupal for a site I'm designing/developing. For my own site http://jwm-art.net I wrote a user-unfriendly CMS in PHP. My brief experience with Drupal is making me want to convert from the CMS I wrote. A CMS whose sole method (other than comments) of automatically publishing content is by logging in via SSH a...

How to easily upload files without form submission (with jQuery + AJAX)

So I have some form processing code which processes the standard text inputs and also uploaded files (through the $_FILES array) I want to have the submission done through AJAX Will jQuery's post(). method still pass that stuff through -> $_FILES or do I need to do something special? ...

Parsing Line Breaks in PHP/JavaScript

EDIT: Ok, thanks for your help guys. Using zerkms' suggestion, I have managed to get <br> tags inserted instead of carriage returns, so it is displayed properly on the page and doesn't break the javascript. The problem is now that when the user clicks on this text, it becomes a textarea and is therefore inline editable. However, the text...

symfony - setting a different php class name for a table

Hi, My tables are named in a plural form - Models / Entities, is there a way to make the generated classes named Model / Entity? (Don't know if this is relevant, but I'm using Propel as the ORM) Thanks. ...

$_SESSION['user']->getURL()

$_SESSION['user']->getURL() Is it to call the method of getURL() of object $_SESSION['user']? ...

PHP passing parameters while creating new object, call_user_func_array for objects

Hi all, I would like to dynamically create a PHP object, and parameters would be optional. For example, instead of doing this: $test = new Obj($param); I would like to do something like this (create new ob is fictional): $test = create_new_obj('Obj', $param); Is there such function in php? Something similar to call_user_func_arra...

PHP and MySQL problem?

When my code is stored and saved and out putted I keep getting these slashes \\\\\ in my output text. how can I get rid of these slashes? Here is the PHP code. if (isset($_POST['submitted'])) { // Handle the form. require_once '../../htmlpurifier/library/HTMLPurifier.auto.php'; $config = HTMLPurifier_Config::createDefault(); $config...

retriving hearders in all pages of word

Hi I am exporting data from php page to word,, there i get 'n' number of datas in each page .... How to set the maximum number of data that a word page can contain ,,,, I want only 20 datas in a single page This is the coding i use to export the data to word i got the data in word format but the headers are not available for all the pag...

Email tracking techniques in php

Hi Everyone, I am doing a newsletter Management in php. I need to track the visitors who opens our newsletter, I have inserted the tracking image in newsletter thats seems to work little. Using Shift mailer there is option to embed an inline image to newsletter. Is it possible to track using this inline image? Is there any other techn...

Setting LD_LIBRARY_PATH in Apache PassEnv/SetEnv still cant find library

I am trying to test the Cybersource 3d party implementation. I was able to get the test files running fine from the command line, which requires that on Linux I export the path to the payment libraries to LD_LIBRARY_PATH. to try to test this on my server I have created the apache config below <VirtualHost 127.0.0.1:12345> AddHandler ...

Does this PHP function protect against SQL injection?

I have this function I'm using and I want to be sure that it fully protects against SQL injection attacks: function MakeSafeForQuery($string) { // replace all of the quote // chars by their escape sequence $ret = str_replace("\\","\\\\",$string); $ret = str_replace("'","\\'",$ret); $ret = str_replace("\"","\\\"",$re...

PHP regular expression find and append to string

I'm trying to use regular expressions (preg_match and preg_replace) to do the following: Find a string like this: {%title=append me to the title%} Then extract out the title part and the append me to the title part. Which I can then use to perform a str_replace(), etc. Given that I'm terrible at regular expressions, my code is faili...

What characters can cause "The request line contained invalid characters following the protocol string." message to appear?

When using PHP file_get_contents(), What characters will cause the following error to appear: "The request line contained invalid characters following the protocol string." Here's my URL: http://MySite.com/File.php?dummy=235&amp;data1=103.019|103.019|99.973|98.086|100|105.584|94.499|91.76|74.257|65.862|63.528&amp;data2=103.019|103.019|9...

resolving localhost in php so can be views outside VM

I'm running Windows 7. Within, I'm running Virtualbox and Ubuntu. Within Ubuntu, I'm running Apache and using PHP codeigniter. To reference our CSS and JS files, we use this syntax: <?php echo site_url('css/styles.css'); ?> When viewing the site locally (within Ubuntu VM) that resolves to: http://localhost/styles.css So works fine....

How to play a embedded code in lightbox type popup

Hi all How to play a embedded code in lightbox type pop up? Here is the whole code <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"&gt; <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> <meta http-equiv="Content-Type" content="text/html; charset=U...

PHP SQL Server Connection

I am using SQL Server as my backend for program.when i am try to connect with database which not shows any type of errors,but it is not working.Which is not getting connection. My code is like mssql_connect('servername', 'db_user', 'db_password') or die('Error'); The funny thing is which is not connecting and also which is not show m...

Get all model details in zend.

Hi, I have one doubt in zend framework. I need all model details from project which i have done in zend framework. Is there any possibility to get all model details in zend framework. Please help me.. Thanks and regards, Prasanth P ...

PHP code to convert text blocks indented by four spaces into a <pre><code> block [Markdown]

Hi, I'm not very good at PHP and would like to have a PHP function which turns this (text block indented by four spaces): printf("goodbye world!"); /* his suicide note was in C */ Into this: <pre><code> printf("goodbye world!"); /* his suicide note was in C */<...