Examples Of Using Inherance And Interfaces In PHP 5
As many of you knows, Zend has relased the Beta version of PHP 5. I
have allready make some tests of interfaces, classes inherance, static
and public variables, etc, and everything looks ok. Now, when you work
with PHP the most common thing is to do something with databases, you
have somehow the "same kind of pattern" like: logins, update, add,
delete data from de db, show data and that is it.
Now, I will like to use the new PHP 5 features in my next project. I
was trying to desing some clases and inferfaces for the "pattern" that
PHP use to have, and have not come with any good worthy idea. I know
Java too, so I was very happy about the the new features in PHP5 and
looking to use object model features. Im looking for very clear
examples on, how you have used the new features in PHP5 to do the "old
PHP thing"?
View Complete Forum Thread with Replies
Related Forum Messages:
SQL_Connect And Interfaces File?
What is the 'interfaces' file referred to here? I defined the strings as $string = server, etc. But this connection string wont't connect to SQL7. int mssql_connect(string [servername] , string [username] , string [password] ); Mssql_connect() establishes a connection to a MS SQL server. The servername argument has to be a valid servername that is defined in the ****'interfaces'**** file.
View Replies !
Get A List Of Network Interfaces In PHP?
I've got a utility I'm working on, and I want to be able to list for the user all the current network interfaces on the machine. Is there a way to do this in PHP? PHP 5.0.3, Mandriva Linux 2005 (2.6 kernel). I'm not actually in front of the machine in question, and I don't recall the minor kernel version, or the minor version of Mandriva... Any thoughts? I'd prefer not to have to run the script as root, incidentally. I realize I could run as root and then just parse the output of ifconfig, but I assume there's a more intelligent way to go about what I'm trying to do. The purpose of this utility is to allow me to issue a ping, from a specified interface (including virtual interfaces, e.g., eth0:1), and test for connectivity from the webserver to the the address i am pinging, through the specified network interface (rather than always pinging from the default/primary interface of the machine). Any thoughts? How would I go about this? I haven't been able to come up with a way to do this, short of running as root and parsing ifconfig, as I mentioned above.
View Replies !
Java Or PHP 5.0 Question About Interfaces
Do interfaces enforce how many arguments can be passed to a method? If two classes inherit from the same interface, can one have formatThisText($text) and another have formatThisText($text, $formatter) ??? I'm assuming the answer is yes, interfaces do enforce the number of arguments.
View Replies !
GD Module Examples
Anyone here used, or is using PHP's GD module in their web design? I would be real interested in seeing what anyone has done with it on their web site with perhaps some sample code which demonstrates how they did it.
View Replies !
E-Mailing Examples Help.
I have created a form, which will allow a person to upload a picture, and leave me mail. What I am having problems doing is, having the form actually upload the picture and attach it to an email that is then sent to me. If anyone knows of any sample code I could look at,
View Replies !
Pagination Examples
Basically im asking if anybody knows of any example code or tutorials where i can learn how to paginate a PHP page. I have a mySQL news table which holds stories as mark up. Ive had a look at a few examples and tutroials but most seem to have the the pages of the story in seperate rows in the database. Im also just confusing my self now with the multitude of options. Im using e107 as the back end by the way.
View Replies !
Printing Examples
Does anyone have any examples of how to send web page content to the printer? I've looked at the PHP manual and I think I know how to do it but I'd like be sure: I have to open the printer first Then I use the print write call? Then I close the printer
View Replies !
Looking For Examples Of Huge MySQL & PHP
Does anyone know of any existing operational web sites where a massive (ie. millions of records) MySQL database combines with PHP to provide a directory service? I'm thinking along the lines of the White or Yellow Pages or similar. I ask because I'm researching a project which provides a (large) web-based specialist directory service, and I'd like to be in contact with people who've already done it with MySQL and PHP. I use MySQL and PHP all the time for small applications, but I'm not sure how they compare (in terms of speed and reliability) in the commercial world against the expensive alternatives.
View Replies !
PHP Tutorial Or Project Examples
I've worked with ASP, ASP.NET and WebSpeed in the past, but now I'd like to learn PHP. I've already gotten a Fedora web server up and running with Apache and MySQL. I'm looking for some examples - or even better a free project - to look over and see how other are using PHP to read/write records to and from MySQL. I'm trying to create a very simple web based contact management system that will store data in a couple of tables. Can someone recommend any examples or web sites to refer to? I'm about to dive into the PHP manual, but I'd like some other material to study as well.
View Replies !
Printing Code Examples
I am building a tutorial site, all is working apart from 1 thing. If i type in some php code even basic stuff like <?php echo date ('Y'); ?> then when its submitted into the database the php gets stripped away i'm using the tinymce editor if that helps make it clear. I need to be able to show code examples as my tutorials are for web design does anyone know a way of showing code. I can disable the tinycme editor and type code right into the textfeild and use the html safe values like: <?php echo date ('Y'); ?> but thats not a good solution as i want to use the tinymce editor as my members will be able to write some tutorials.
View Replies !
Pointer Examples Of Cleaning
I have managed to create a very basic CMS, the CMS cover 6 pages and each page can have its title, pagetext, image link 1 and 2 altered. I have doen the best I can but, I imagine that the code I have produced is somewhat ugly and could be clearer and slimlined. I have included the code for both the form page and the post page. Code:
View Replies !
Examples Of Autoloading Object
I'm a bit confused with autoloading objects. This is only for PHP5, correct? All autoloading functions start with "__" correct? And can someone give me a easy to understand example of an autoloading object? I googled, but I still have questions about it.
View Replies !
MySQL Transactional Examples
Does anyone have any examples of using Transactional processing of MySQL with PHP? I'm not sure if the BEGIN statement needs to be in front of my SELECT statement or processed before hand by itself.
View Replies !
Examples Of Well Written Large PHP Projects
To improve my PHP I've decided to study the source code of a medium to large open source PHP application. Can anyone recommend any applications that they would consider prime examples of well written PHP? The sort of attributes I'm interested in are basically just good software engineering such as clean internals, being well designed, good use of abstraction and also perhaps being well tested (things where there is a lot of room for improvement in my code ).
View Replies !
Looking For Recent Visitor Code Examples/ideas
I am working on updating my content management page and wanted to overhaul my "recent visitor" code. The code that tracks who has been and is still on my pages. I have not been able to find some examples I saw here a few months ago and was wondering if anyone could point me to some examples. The more versatile the better.
View Replies !
File Upload :: Good Working Examples?
I want to make a file upload using php, but everytime i get an error "File name not given". Any hints why this is happening? I used a sample from php.net, and other php sites, but all samples are basically the same. Maybe someone from you has a good and working example?
View Replies !
Real Life Examples Of Mysql+session_set_save_handler
In my test setup using my own session handlers with session_set_save_handler and mysql, the session handler opens and close mysql connections. But what if my page also requires some mysql queries? Should I open a new connection or use the already opened one (opened by the session handler)? I have made it a good practice to close a connection after a query but if I do it with only connection open no session data will be written to my mysql table. I have seen some scripts using persistent connections but are not sure what would be the best for a real world environment.
View Replies !
|