php

CDATA xml parsing extra greater than problem

Hi, I am creating an xml using php and parsing that xml in iphone application code. In description field there is some html tags and text. I am using following line to convert this html tags in to xml tag using CDATA. $response .= '<desc><![CDATA['.trim($feed['fulltext']).']]></desc>'; Now, here my $feed['fulltext'] value is like t...

How to raise CComponent event in Yii

Let's assume I have Component (say Graph like Yahoo Finance) rendered on the page. Component view template contains bunch of a_hrefs which I wanto to switch period in graph. I created Event and Event handler in Component. I have two questions: How to raise event on Graph Component via those a_hrefs (should they be part of Graph?)? How ...

PHP strpos preg_match

Hi, I want to copy a substring of a string using PHP. The regex for the first pattern is /\d\|\d\w0:/ The regex for the second pattern is: /\d\w\w\d+:\s-\s:/ Is it possible combining preg_match with strpos to get the exact positions from start to end and then copy it with substr( $string, $firstPos,$secPos ) ? ...

Security header is not valid - using curl php

Hi all, Im implementing the Express Checkout, Paypal API using PHP. I have no problem with the first step:SetExpressCheckout. I a have awk=success. But in method GetExpressCheckout I get "Security header is not valid". I try to figure out the problem and i think found out maybe it was the curl not working well.. What i did i copy th...

How to alter the auto_increment of a mysql-table using Doctrine

Hi, the question says it all it think :-) What is the best way to execute a query such as: ALTER TABLE tablename AUTO_INCREMENT = 1; using Doctrine? ...

PHP connecting Oracle and mySQL

I' trying to get some data from Oracle via ODBC to mySQL database. And then Insert some lines in mySQL database. I manage to list the lines from ORACLE but fail to Insert into mySQL. $time_start = microtime(true); set_time_limit(10000); //ligação ODBC ORACLE $connect = odbc_connect("acatex32", "acatex", "acatex"); $query = "select b...

If I used ftp_put to upload a file to an ftp server, how would I get the full url of the uploaded file?

For example, I use file_put() to upload file.rar to public_html/rar/. Would it be possible for me to get the web address of that .rar file? ...

Using ftp_*, how could I determine the public html directory?

If I don't know the public web directory, is there a way my script could determine the web directory, so that the script would know which directory to upload the file to? ...

Cakephp change model's title without rename model/dbtable

I have a table that store all information about class, but because Class is reserved for class name I had to rename the table from classes to types. But in the view section I need it to be displayed as "Class", including the Paginator links. Anyway to achieve this by adding something in the Type model, without completely customize Pagi...

Get to know what HTML-button is clicked with PHP, no Name of value available

I have a wizard with 4 steps and in one of the steps, you can add items. By default, there are 3 time 5 empty input-fields listed. When you click a button, there have to be added some more. The 3 times 5 fields are added by a loop. How can I determine where I have to add some fields (in the first 5 field of the second or the third). I c...

Compute column widths in a HTML-like manner (based on cell contents)

Hi, I have a grid of data that I want to export to RTF, PDF etc. using various (and not perfect) PHP converters/generators. What I am missing most is the HTML table automatic adjustment of column widths based on the lengths of strings in the cells (strings contain line breaks which complicate things a bit, as they should be preserved)....

Pass a query in URL using jquery

Hello, I want to pass a $_GET[''] to a php file, when a word is clicked in a div,it must display data from the db. It displays the data without the query. The process.php contains SQL statement to query the db and display values. Thanks Jean ...

fb:comments does not showing Log out link

fb.comments does not showing Log out link here is my code < fb:comments xid="mahfuz" canpost="true" candelete="false" > < /fb:comments> here is JS SDK code <div id="fb-root"></div> <script type="text/javascript"> window.fbAsyncInit = function() { FB.init({appId: 'my app id', status: true, cookie: true, xfbml: tru...

Get reply mail to my server for a mail sent through php mail function

Hi, I am developing a system to send mail to all of our clients. If they reply to that mail, I want to retrieve the reply mails to my server. There is a way to connect through the IMAP/POP3 server, But it is taking a long time to load the mails. Is there any way to get the reply mails directly to my server. or ay other alternate way to g...

I want to store a php $_SESSION variable and retrieve it on another page.

<?php session_start(); // store session data $_SESSION['count']=0; ?> <html><head></head> <body> <?php include ("getElement.php"); echo getLinkButton("myscript.php", "myscript.php"); echo $_SESSION['count']++; ?> </body> </html> The code above works, but when I click the link to navigate to myscript.php: <?php echo $_SESSION['cou...

how to manage the use of both $_SERVER['PHP_SELF'] in action of form and htaccess for urlrewriting together for same page?

how to manage the use of both $_SERVER['PHP_SELF'] in action of form and htaccess for url-rewriting? If I submit a form and in the action attribute of it i pass "$_SERVER['PHP_SELF']" and at the same time i am using url rewriting for the same page.. then these two things will contradict each other resulting in the display of action valu...

[PHP] - Memory usage/profiling

I'm using Netbeans + Xdebug + Winchachegrind and finally got it to work, but there is no memory usage information. Is it an Xdebug or WinCachegrind limit? ...

Why I cannot create DB in MySQL throw PHP?

I have this code: $link = mysql_connect("localhost", "ctmanager", "blablabla"); if ( ! $link ) die ("I cannot connect to MySQL.<br>\n"); else print "Connection is established.<br>\n"; // Create the "ct" database. mysql_query("create database ct", $link) or die("I cannot create the DB: ".mysql_error()."<br>\n"); And I get thi...

AJAX Div Retrieval every 60 seconds

Hello everyone! What I would like to do is retrieve the contents of a PHP file and insert it into a div every 60 seconds, basically refreshing the dynamic div. I've come up with the following code so far, however it doesn't seem to be working. The code is just like this, nothing extra, apart from the MYSQL login. PHP to grab: <?php ...

PHP + MongoHQ : MongoCursorException

Hi, I'm trying to use mongodb with PHP. For that, I have created a MongoHQ instance, but for some reasons when I try to insert something or any other operation from my php server I get the following error: Fatal error: Uncaught exception 'MongoCursorException' with message 'unauthorized for db [datab] lock type: -1 ' in C:\Program File...