php

Removing double quotes in Smarty PHP

Hi, Im attempting to remove double quotes passed in a request parameter string. I know Smarty has a escape:'html' function however Id rather just remove all ". Thanks. ...

PHP strlen question

Ok I am checking that a string is at least 4 characters long and 25 or less characters short I tried to use strlen like this $userNameSignupLength = strlen($userNameSignup); else if($userNameSignupLength<4 && $userNameSignupLength>25) { $userNameSignupError = "Must be between 4 to 25 characters long"; } but it ...

Sending wordpress title-value across PHP-pages

I recently made this wordpress blog, where you can sign up a team for an event, when clicking a link under the event post. This link takes you to a sign-up form on another php-page. The link is added in the loop of the events-template like this: <?php query_posts('cat=8');?> <?php if (have_posts()) : while (have_posts()) : the_post(...

pass object from JS to PHP and back

This is something that I don't think can't be done, or can't be done easy. Think of this, You have an button inside a div in HTML, when you click it, you call a php function via AJAX, I would like to send the element that start the click event(or any element as a parameter) to PHP and BACK to JS again, in a way like serialize() in PHP, ...

How to use eclipse for both java and PHP?

There are Eclipse IDE for Java EE Developers (190 MB) and Eclipse for PHP Developers (139 MB) I've already installed eclipse for PHP. I don't want to install another eclipse for java. Is it possible to use the same eclipse for both java and PHP? EDIT I decide to install another eclipse for java finally.... ...

XML creation using DOM and MYSQL

I am trying to create a XML document from information extracted from a mysql table. I am using a tutorial to accomplish this http://www.tonymarston.net/php-mysql/dom.html#a5 what I want to do is to create each element separately, instead of creating them all at once as shown in the tutorial. In order to do that I am trying to place th...

ajax: don't wait for response, but check for it periodically

I have a PHP process that takes a long time to run. I don't want the AJAX process that calls it to wait for it to finish. When the PHP process finishes it will set a field in a database. There should be some kind of AJAX polling call to check on the database field periodically and set a message. How do I set up a jQuery AJAX call to po...

get list of ODBC data source in local pc using PHP

I'm looking for a way to get a list of ODBC data sources in local PC using PHP is there any body can help me ...

PHP OOP - Is it a good/bad directly adressing properties?

I will try to show this by an example: class DogShelter { private $dog; public function handleDogDirect( ) { $this->dog = trim( $this->dog ); $this->dog = rtrim( $this->dog, 'abc' ); $this->dog = strtolower( $this->dog ); $this->dog = basename( $this->dog ); } public function handleDogIndirect( ) { ...

Why is PHP date() adding +1 hour in diff calculation?

Hi there, I've got kind of a tricky question, I already searched every related question on Stackoverflow and neither solved my conundrum, although I think I'm running in circles, so here's the question: I've got this code: $val = (strtotime('2010-03-22 10:05:00')-strtotime('2010-03-22 09:00:00')) This returns correctly $val = 3900 ...

Display number of retweets of a blog post

Hi, I was wondering if anyone has a link to any information regarding building in Twitter Mention functionality into a website like here, http://paul.boagworld.com/?page=2, where each post dispays the number of times it has been mentioned on twitter. Many thanks, C ...

Choose variable based on users choice from picklist.

I have this form. Basically what I want is to send a auto-response with a different URL based on what the user picks in the "attn" picklist. I've been thinking I could have a different variable for each drop down value. It will then pass this variable on to the mail script that will choose which URL to insert inside the auto response tha...

How to use Wordpress' http.php in external projects?

Answer : Implemented using Curl... $file = "http://abc.com/data//output.txt"; $ch = curl_init($file); $fp = @fopen("out.txt", "w"); curl_setopt($ch, CURLOPT_FILE, $fp); curl_setopt($ch, CURLOPT_HEADER, 0); curl_exec($ch); curl_close($ch); fclose($fp); $file = "out.txt"; $fp = fopen($file, "r"); I am trying to parse data from a pipe-de...

How to extract text using Zend_Pdf from pdf page

Can anyone help with extracting text from a page in a pdf? <?php $pdf = Zend_Pdf::load('example.pdf'); $page = $pdf->page[0]; I would assume a page method would exist but I could not find anything to let me extract the contents. Example: $page->getContents(); $page->toString(); $page->extractText(); ...Help!!!! This is driving me cr...

how to write this conditions in php

hey guys , im writing a class and im wondering how i can write a condition statement in this way : $this->referer= (!empty($_SERVER['HTTP_REFERER'])) ? htmlspecialchars((string) $_SERVER['HTTP_REFERER']) : ''; i need to find my user_id and this is the usual condtion : if(is_user($user)){ $cookie=cookiedecode($user); ...

When does a MySQL Query actually execute in PHP?

This sounds like a really simple question, but I am new to PHP. If I have a statement like this: $r =& $db->query("insert into table (col1, col2) values (10, 20)"); Do I have to still execute it, or does it get executed when I reference it? I have another case where I have a select query, which seems logically to run only when I cal...

"echo" in functions or "echo" all page?

Is this a good method to save to all index in a variable and then echo this? for example <?php $txt='<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt; <html xmlns="http://www.w3.org/1999/xhtml"&gt; <head> <meta http-equiv="Content-Type" conten...

How to use PHP Load Data Infile to replace the current copy of the table with the new one?

We get a new copy of data in a pipe-delimited text file from time to time. I have to refresh the table or in other words, replace the existing copy with that of the newly generated copy (output.txt). Any ideas are highly appreciated. Thank you.. TRUNCATE Table elements; LOAD DATA INFILE '/data/out.txt' IGNORE INTO TABLE elements FIELD...

send email from PHP with outgoing mail server & userid and password authantication

what is best way to send email from PHP using server authantication. Userid & Password & outgoing mail server... Thanks ...

PHP array and foreach help

Hello, I need some help with an array and a foreach loop, I have an array that is data returned from a database, basically it is a list of titles and images associated with it, it looks a little like this, Array ( [0] => Array ( [contentImageId] => 28 [contentImageName] => yellow.png ...