PHP, CSS, Ajax, webdevelop and everything else.
    php (17)

PHP programming language and PHP development.

7 September 2009

Mysql client uses older authentication method in PHP 5.3 on windows?

Just found out the if I use PHP5.3 on windows, I can’t connect to my Mysql5 server. It says my client is too old. After I switch back to PHP5.2.9, things get normal. So, it means the PHP5.3 for windows used a older version of library to compile the code? I don’t know. It took me a while to find out the problem.

2 May 2008

Curl better than simplexml_load_file when web screen scrapping

As in my previous post, I briefly introduced how you can use SimpleXML object to load various web services’ API query urls, if you so choose to mashup a website with data provided by the various websites, such as YouTube and Amazon. Of course, the pay off comes when you use some affiliate code in your query, such as the famouse Amazon’s ECS and you did a pretty well job on your page layout & design, and seo to attract many visitors to you sites. (more…)

last comments  
lakshan
lakshan

thank you very much for this article..
19 April 2008

How to use SimpleXML parsing XML data with namespace and CDATA

There are many social network websites (e.g. YouTube) and big brand websites(e.g. Amazon, Yahoo) use REST or SOAP or even RSS web services to provide the enormous data for developers. Using these data, we can build a website virtually with no own database at all, all the information are come from these big sites. The nice thing is that, virtually all of the data returned for your web service client request are a XML data stream. So, we can use the nice PHP5 built in SimpleXML object to parsing the XML data stream, and format the representation of the data according our own website needs. However, the XML data format vary from site to site, some of the XML data returned from the sever, includes namespace and CDATA; if this is the case, you need find a way to access a sub item in the XML data use the same ” -> ” syntax. (more…)

last comments  
jcvangent
jcvangent

What is the url you are using for getting the xml feed, currently I'm using 'http://gdata.youtube.com/feeds/base/videos/-/dance' for example as a ...
David Adam
David Adam

Are you sure the live feed you got is in correct format. Here is the code I run on the ...
jcvangent
jcvangent

even when doing it like the example above it gives me an empty string: $media = $item->children('http://search.yahoo.com/mrss/'); $videoDescription = $media->group->description; ...
jcvangent
jcvangent

To speed things up (since I only want the description),if I do an: $entry->children('http://search.yahoo.com/mrss/')->group->description; It should give me the contents of ...
clonks
clonks

Thanks! GREAT!
26 January 2008

Zend PHP5 certification Exam study review 12: supplementary III

Ok, this is the last part of my reviews. This post listed some WEIRD and STRANGE questions I found in the phparch’s simulator exam. You may think these are some advanced features of the PHP5 language, but some of them are actually mention in the GUIDE also. However, some of the questions, I found that there maybe some errors in the question itself; in this case, I marked with the “*” in front of the question. Therefore, some of the answer I gave maybe not right, or maybe I get the meaning of the questions wrong. So, if you have any comment on this post, please feel free to comment or send me a message. Thanks!
(more…)

last comments  
David Adam
David Adam

I suggest to do some mock test.
charan
charan

thank you for posting. its really helpful. I have got my ZCE exam day after tomorrow. Please suggest what all ...
felicia
felicia

Thanks for this study guide!!! It was really useful and easy to understand. I just passed the exam this afternoon ...
David Adam
David Adam

Hello, it is the 2nd answer. :)
sarah
sarah

hi, what is the right answer for this * When writing portable database code using PDO, what is the PDO::ATTR_CASE attribute ...
24 January 2008

Zend PHP5 certification Exam study review 11: supplementary II

In this and the up-coming Post, I listed some extra questions I found during I took the phparch’s Vulcan Zend PHP 5 Certification Testings. This post listed some EASIER but will not be frequently asked in the actual exam I think. But, they are worthy noted here, they can also serve as check points for you previously learned knowledge.
(more…)

last comments  
James Dunmore
James Dunmore

"The ????? function is used to generate a file resource in the file system with a randomly-generated filename to be ...
Jevgenijus
Jevgenijus

(2) and (3) of course, and I would also consider taking (4) "Setting credential information as system environment variables", as, according to ...
Richard
Richard

Unlike the old MySQL extension, the new MySQLi extension requires that you provide what when performing a query when using ...
Jahid
Jahid

My Answer would be: (2) Moving all database credentials outside of the document root (3) Restricting access to files not designed ...
john smith
john smith

Hello I am prepareing ZCE. Anybody can the answer of the following question when working with a database which of ...
22 January 2008

Zend PHP5 certification Exam study review 10: Supplementary I

Since I mentioned before, I didn’t included the Language Basic and Function topics in these series of reviews, because I think you should already have a good knowledge about them. Anyway, if you have more time, then you can following this post to review some of these features in PHP. It mainly includes PHP’s String(since it is so important), Array, and Function feature; also, it contain some extra information just I think worthy to be reminded.
(more…)

last comments  
Henry Lu
Henry Lu

Hi admin, About the question "Can you define an abstract method as private?". I don't think abstract method can be private, ...
David Adam
David Adam

Hi, This is why: The first time, str_replace replace the "a" to "b" in string "abc", ...
Kirill
Kirill

Could you explain why str_replace(array('a','b','c'),array('b','c','a'),'abc') returns 'aaa' string instead of 'bca' ? Simply can`t understand thist trick!
20 January 2008

Zend PHP5 certification Exam study review 9: OOP Design&Theory

Here is the second topic regarding the OOP paradigm. Trust me, read more about Design Pattern, don’t just for pass the exam sake. The exam regard to the Design Pattern and general OOP theory is very basic. Anyway, following I listed some basic Design Pattern may tested in the exam. Also, I think you should look into the SPL(standard PHP Library) and PECL(PHP Extension Community Library) and PEAR(PHP Extension and Application Repository).
(more…)

last comments  
David Adam
David Adam

No, the real exam was actually easier than the mock exam. At least when I took it. :)
Zzzz
Zzzz

I am really appreciate your effort for ZCE. My Questions: sure if you have a free time to answer me ...
David Adam
David Adam

Hi Max. I don't know the completed list. I have watched this tutoiral: http://www.vtc.com/products/Design-Patterns-tutorials.htm This may help?
Max
Max

Since there are many types of design patterns, would you please give us a list here? Thank you very much ...
David Adam
David Adam

J, thanks for your comment. I knew the 2nd version of the study guide is out. Not sure if it ...
18 January 2008

Zend PHP5 certification Exam study review 8: OOP In PHP 5

Object Oriented Programming is the norm in modern software programming. Sadly, prior PHP4, PHP lack a great OOP language support. PHP5 changes all that. That’s why the Exam has two topics especially regarding this area: the actual OOP feature in PHP5 and OOP design and theory. This post is a brief review on PHP5 OOP feature, you will spent some time on OOP in PHP if you are a well experienced structure-style programmer in PHP4 I think. OOP is actually easier once you shift you ideas around :) . Because, in life, not in one moment, we are not dealing with OBJECTS.
(more…)

last comments  
David Adam
David Adam

the answer is 1.
jo
jo

Hi admin, I have a question, please give me a help, Q: The __method is automatically called when the object is created, ...
David Adam
David Adam

Oops, you are right. Yes, it is obvious that the "This is never displayed" is never displayed! :)
Henry Lu
Henry Lu

Hi admin, Thank you for your post. It is a good article for ZCE review. I just have a question to ask ...
16 January 2008

Zend PHP5 certification Exam study review 7: PHP4 And PHP5

Due to the fact that many hosting providers and live web sites are still using PHP4, and this situation is likely remaining for some time; the PHP5 Certification Exam has a topic on the difference between PHP4 and PHP5. You should have very good knowing that PHP5 has great improvement on which subject as well as deprecations on older code. I did post review on the Language Basic and Function topics in the exam, because I think these topic is too “basic” to write out and you should quickly or already know them. However, this post do start with some basic concept then migrating to the difference made in PHP5 as compare to older version; because I think this post is consider the “Language Level” subjects on PHP. So, here comes “what exactly language construct”…
(more…)

last comments  
Henry Lu
Henry Lu

I agree mcloide for the following reasons: You should never use parentheses around your return variable when returning by reference, ...
mcloide
mcloide

Hi Heena, about the first question, the correct answer would be 3. PHP4 will throw a notice error for using ...
David Adam
David Adam

The answer is 4>$obj1 and $obj2 must be the same instance in php5.
Heena
Heena

yes I tried to post with tag… btw code is here if($obj1===$obj2){ //do something }
David Adam
David Adam

Do you mean post the code containing the php tags: < ?php and ?>?
14 January 2008

Zend PHP5 certification Exam study review 6: Security

Security is very important for any application, particularly for web application. So the exam requires you have at least a very well understanding how the security problems actually affect todays web applications innovation. You must know some common security issues, the security issues not just regarding PHP itself. Since PHP is an embedded language, you should know the security defense on all three level, that is Web Server level, Data base level and PHP itself. In the rest of this post, list out a summary on this vast topic on Security. Be sure to check other sections(such as topics on Web Programming, Database, PHP Command Line Interface, etc) that related to security considerations.
(more…)

last comments  
Linx
Linx

Eniglhteinng the world, one helpful article at a time.
David Adam
David Adam

bOro, I think another answer maybe 1). The session here maybe refer to the linux session, not the the "session" ...
Max
Max

I am puzzled by the following question: When using a function such as strip_tags, are markup-based attacks still possible? a. No, ...
b0ro
b0ro

Hi since a while I've been searching the web to find any information about Zend Cert and I have to ...
mescalito2
mescalito2

Hi, very nice brief, well done. About the Heena's question: "A fingerprint of a string can be determined using w..." ...
page 1 of 2 »