php

php "script tried to execute a method or access a property of an incomplete object" error

Hey everyone, I have looked up this error, and it seems the common issue is caused by not putting include()'s or require()'s BEFORE session_start(). However, this is not the case for me. I am getting the following error: Fatal error: Zend_Http_Client::request() [zend-http-client.request]: The script tried to execute a method or acces...

Run cronjob as a logged in user

Hi, I am currently running a php cronjob to crawl through some HTML. I have come to a scenario where I have to be logged in to access some data. How can this be achieved? The cronjob is running on a server which I dont have access to. Basically, let's just say, I am trying to access some HTML data which is only available after a use...

mysql fetching only one field

Is there an easy method to extract only one field. For instance: $sql = "SELECT field1 FROM table"; $res = mysql_query($sql) or die(mysql_error()); $arr = mysql_fetch_assoc($res); $field1 = $arr['field1']; My feeling says this could be done much easier. ...

Construct PHP strings to time from XML

I'm trying to convert the following XML into a Time: <time hour="18" minute="05" timezone="Eastern" utc-hour="-4" utc-minute="00" /> I'm parsing the XML using SimpleXML, and storing that in a class. I also tried printing out the following: print strtotime($x->time->attributes()->hour . ":" . $x->time->attributes()->minute) . "<br>\...

Question about freeing memory in a php script

I just saw this in a script mysql_free_result($rawdb); I saw it on a script somewhere, it ran a mysql query and saved the results to an array, right after adding to the array, it ran that which I assume free's the memory used from the mysql query. I am just asking to verify, is it a good idea to do this? I have a couple mysql querie...

Does mysql_real_escape_string() FULLY protect against SQL injection?

On http://www.justinshattuck.com/2007/01/18/mysql-injection-cheat-sheet/?akst_action=share-this , there is a section that claims you can bypass mysql_real_escape_string with certain Asian character encodings Bypassing mysql_real_escape_string() with BIG5 or GBK "injection string" に関する追加情報: the above chars are Chinese Big5...

Where can I find a recent version of the Zend Debug Protocol?

I am interessted in using the Zend Debugger. The newest and only document about the Zend Debug Protocol seems to be this http://www.eclipse.org/pdt/documents/PDT%20-%20Debug%20Protocol.pdf document from 2006. Aptana and PDT are using Zend Debug Protocol, or at least have it as an option. Any idea where I can find a more recent version of...

How to compare 2 variables

I have these declared $username = $this->users->getUsernameById($file->user); $sessionuser = $this->session->userdata('username'); How would i go about comparing to the two values and if they match, execute code. I had if ( $username == $sessionuser){ blalghalhalhalhllahblahhblahhblahhh } However, even when the two variables are th...

PHP Chat Bot: Google Talk

Hi, I was wondering how to create a chat bot for Google Talk via special client. I know it uses XMPP to send messages, but I do not know how to use this at all. It is my understanding that I should be able to make a bot which chats for me when I am away if I were to create my own client page, which would parse the chats with my data. W...

Ajax image upload form returns forbidden 403 Error

HI all, I am currently tinkering with this pre-authored ajax/php image uploading script, but after almost 2 days of trying to figure out why it throws 403 forbidden error(You don't have permission to access /ajaxupload.php on this server), I am out of options but to ask the gurus here. I suspect it has something to do with my hosts ser...

php domain availability function

I cannot find a working php domain availability function that can check if a domain is available or not, and then define a $status variable with available or unavailable, so i can include it in my message. Any tips on how to do this? Ive tried various native php functions like getdnsrr and others, but cannot get them to work. I simply n...

PHP\MySql Multiuser System Backend Structure

Hey guys I'm writing a multiple user log in system using PHP and MySql, the way i have done it in the past is to have a central "processing" file that will handle all of the code on the backend, like logging in, messaging other users etc..., I've used forms with hidden fields to define which action to perform in the processing file. he...

Different types of WAMP's?

"WAMP" is an acronym formed from the initials of the operating system (Windows) and the package's principal components: Apache, MySQL and PHP (or Perl or Python). Personally I use XAMPP Lite, but thats because I haven't tried anything else. I've just been looking as to how to install SQLBuddy on it, and can't find out. I've heard about...

Does anyone have recommendations for a good (and lightweight!) PHP mailer library?

Pretty much as the title says. I'm currently using the SwiftMailer (http://swiftmailer.org), but I'm just wondering how it stacks up to the other libraries out there. ...

view as html feature..

hey i am maintaining a site on a linux server. its in php. the registered members can upload files and download it. But I want to implement " view as html " feature (as google do it). Can anyone help me out.. ...

smarty php CMS error

hi when i open my site (made in smarty) i got this error plz resolve im very new in smarty Smarty error: unable to read resource: "pagetemplate.tpl" in /var/www/vhosts/example.com/htdocs/includes/smarty/Smarty.class.php on line 1083 Warning: Smarty error: unable to read resource: "pagetemplate.tpl" in /var/www/vhosts/example.com/htdocs...

How to add links to a html formatted text? (randomly, using program)

I am using PHP. I have some articles stored in MySQL and they all have some style (like with some css or tags). Now I have to add some links to some text randomly and automatically. This means I have to add links to the text and make sure the links do not break the style. I think the most difficult part is how to add links but not to ...

php read product data txt file

Hi, I have a .txt file with product data, which I want to read in php. Each line contains one product, and the product details (number, name and price) are separated by tabs. As you can see below, it is not always true that the prices are nicely aligned vertically, because of the difference in length for the prodcut names. The data look...

pamentgateway in php

Hi friends i would like to learn the Paymentgateway [interaction with bank and make transaction] in PHP . Please guide me a website to go through .. Thanks in advance.. ...

pear php translit gives error

hi i'm working on a multilanguage project and. and i'm having some problemsi with iconv's //TRANSLIT. so i found this package. i succesfuly installed that package to my linux box but when i tried to install it on windows pear gives this error: ERROR: The DSP translit.dsp does not exist. i couldn't find i compiled dll eigther. can you h...