php

getting notice in php file while executing.

what is the meaning of undefined property DOMElement::$node Vaoue I searched in google I didn't get any annswer for this. ...

Persistent SMTP connection in PHPMailer

How to enable persistent SMTP connections in PHPMailer? I will send many emails, so with persistent connections probably I will get performance gain. ...

With Zend Framework, what is the difference between Module and Package

Hi all, I devlopp web applications with Zend Framework. For now, I have a huge library, wich contains each an every things, used by a couple of web applications. I am thinking of reorganising it, using the concept of "Module". But I am not sure about the difference between Module and Package. What I understand is : a Module contain...

Process an array in a function, with external formatting

I want to pass an array to a function and iterate through it in this function. But I would like to be able to change the way the single entries are displayed. Suppose I have an array of complicated objects: $items = array($one, $two, $three); Right now I do: $entries = array(); foreach($items as $item) { $entries[] = create_li($...

PHP Sessions are locking up with ajax long-polling

I have an ajax long-polling request that works fine on the first page load. The problem is when the page is reloaded or a new page is browsed to then the PHP session is locked until the old PHP session times out. I have the following long polling code... while (time() - $time < 55) { if ($userid != 0) { updateUserSession(); ...

URL matching using preg_match_all in PHP and regex

I am trying to build a crawler that gets the movie urls from an imdb list. I am able to get all the links on the page into an array and want to select only those ones with "title" in them. preg_match_all($pattern, "[125] => href=\"/chart/2000s?mode=popular\" [126] => href=\"/title/tt0111161/\" ", $matches); where $pattern='/title/'. ...

Warning: mail() [function.mail]: Failed to connect to mailserver at "localhost" port 25, verify your "SMTP" and "smtp_port" setting in php.ini or use ini_set()

i've been trying to set up a forgot password facility on a website which i am building but each time i try to load the page i am greeted by the above error. how do i go about resolving this? here is the code i have so far... <?php if (array_key_exists('forgot',$_POST)) { $email = $_POST['email']; mysql_selec...

Get realpath of uploaded file

I need to get the aboslute path of a file uploaded by the user in PHP. How can I do that? Im doing this cause I need to post the information to an API via cURL ...

PHPTAL i18n Call to a member function on a non-object Error

I'm using PHPTAL in my project I'm able to successfully implement it almost all the cases except when I want to use its i18n services. I constantly get errors "Call to a member function on a non-object" I've tried searching the net forums etc. but not found any solution, will really appreciate if somebody can help me out. ...

Reasons why you wouldn't use a foreign key? [php + MySQL]

I'm working on an old web application my company uses to create surveys. I looked at the database schema through the mysql command prompt and thought the tables looked pretty solid. Though I'm not a DB guru I'm well versed in the theory behind it (having taken a few database design courses in my software engineering program). That being...

Zend_Gdata_Spreadsheets gives 'Namespace Error' on inserting data?

I'm trying to insert a row in my Google spreadsheet. While other functions like counting rows, columns etc work fine; inserting a row gives me 'Namespace Error'. An exception of type DOMException was thrown, but did not get caught during the execution of the request. You will find information provided by the exception along with a stac...

Help with windows path - PHP

I have this path and it is correct however, the browser will not include the source file unless I put "file:///" in front of it. I'm still developing and this will ultimately be on a Linux machine but in the mean time, I'd like to see my work as well as be able to troubleshoot it. Is there a solution for this? This fails: C:\Program Fi...

Making a local connection between a mysql database and php

I already have the mysql database made, I just need to connect php to mysql locally but I don't know the php commands for that. cheers ...

selecting consecutive numbers using SQL query

Here is a theater seats booking plan. Seat No Status 1 Booked 2 Available 3 Available 4 Available 5 Available 6 Available 7 Booked 8 Available 9 Available 10 Available If someone wants to book 6 tickets, he will get Seat No. 2 to 6 and seat No. 8 And if someone wants to book only 5 tickets, he will get Seat No. 2 to 6 How do I know u...

pspell global namespace dictionary

Hi there, is it possible to create something like "a global dictionary" for pspell? I tried a lot but i can only create a personal dictionary for languages which are installed. Am im blind, or is there a better way than just insert a word for the global dictionary to the personal dictionary for each language? Best Regards, Beerweasle...

PHP: Cookie problem

Can anyone tell me what is wrong with my code? <?php class MyCookie { private $expiration = 0; private $path = ""; private $domain = ""; private $secure = false; private $httponly = false; private $names = array(); public function __construct($e, $p = "/temp/", $s = false, $h = false) { $this->expira...

What are the real advantages of templating engines over just using PHP?

I develop my web applications using only PHP for the view files and I don't feel limited in any way, but I hear there's a consistent number of developers advocating "external" templating engines. So what do template engines offer that simple PHP lacks? I'm looking for practical things, so I exclude the following: babysitting bad devel...

LEFT JOIN or REGULAR JOIN, and how to compare MySql table to an array? Need performance!

I have six tables: t1, t2, t3, t4, t5, t6. And I also have one main table: main_table. TOTAL 7 TABLES! Now, I am using SOLR for the searching of classifieds, and the results from solr are put into an array. The array results are ID:nrs which I use to match agains the same ID:s in MySql. The first column of ALL tables in MySql is called...

how to prevent rapid page request in php

hey these days im searching internet to secure my codes and my websites , and one point that i crossed and couldn't find a good and easy to learn solution was how to prevent rapid page request or in easy term DDOS ( not exactly that ) . its really likely to happen if some bot or hackers trying to ddos a page , i want a way to s...

How can I unbind JQZOOM in my JQuery Script?

Hello, I have this script at the moment, which changes an image when a thumbnail has been changed. I then want JQZOOM to be added to that new image. However, if I put it inside the Onclick event, it gets slower and slower the more times you click on it... I guess because its running multiple instances. Is there anyway to unbind the JQZ...