PHP programs can run on various platforms like Linux, Unix, Windows and Solaris whereas ASP is mainly associated with Windows platforms. However, ASP can run on a Linux platform with ASP-Apache installed on the server.
Platform Compatibility

PHP programs can run on various platforms like Linux, Unix, Windows and Solaris whereas ASP is mainly associated with Windows platforms. However, ASP can run on a Linux platform with ASP-Apache installed on the server.
http://blog.ouseful.info/2010/09/17/a-quick-play-with-google-static-maps-dallas-crime/
<?php
if ($a > $b) {
echo "a is bigger than b";
} elseif ($a == $b) {
echo "a is equal to b";
} else {
echo "a is smaller than b";
}
?>
The elseif statement is only executed if the preceding if expression and any preceding elseif expressions evaluated to FALSE, and the current elseif expression evaluated to TRUE.
I recently had a problem to solve: run some Javascript from inside PHP on a web server.
I needed to evaluate a web browser's PAC (proxy auto config) file exactly the way a browser would, by executing the Javascript function FindProxyForURL() (see here for a good guide). The browser uses its Javascript engine, so to simulate it, I wanted to run Javascript inside PHP (an example is here in another post).
On the web there were some solutions for Javascript engines, written in PHP, such as:
start-msvc9.bat
", as documented on the Windows page. It opens a Mozilla command window (a unix bash simulation).PHP SOAP Extension is one of the most popular PHP implementations of SOAP 1.1 and 1.2, developed by The PHP Group. SOAP is a lightweight protocol for exchange of information in a decentralized, distributed environment. , So SOAP is the most popular web services format. It's a SIMPLE way to allow programs written in different languages running on different computers to communicate and share data. SOAP is a W3C standard for passing messages across the network and calling functions on remote computers.
SOAP, formerly known as Simple Object Access Protocol (until the acronym was dropped in version 1.2), came around shortly after XML-RPC was released. It was created by a group of developers with backing from Microsoft. Interestingly, the creator of XML-RPC, David Winer, was also one of the primary contributors to SOAP. Winer released XML-RPC before SOAP, when it became apparent to him that though SOAP was still a way away from being completed, there was an immediate need for some sort of web service protocol.
PHP 5's SOAP extension is the first attempt to implement the SOAP protocol for PHP in C. SOAP is included in the PHP 5.0.4 package for Windows distributed by Zend Technologies. It has some advantages over the existing implementations written in PHP itself, the main one being speed. The extension is currently marked as experimental, but should gradually become more stable and reliable as time progresses.
SOAP is an XML based protocol that consists of four parts: an envelope that defines a framework for describing what is in a message and how to process it, a set of encoding rules for expressing instances of application-defined data types, a convention for representing remote procedure calls and responses and a binding convention for exchanging messages using an underlying protocol. SOAP can potentially be used in combination with a variety of other protocols; however, the only bindings defined in this document describe how to use SOAP in combination with HTTP and the experimental HTTP Extension Framework. XML SOAP uses XML for transmitting data.
To show you an example of how PHP SOAP Extension can be used in a SOAP client application, here is my first SOAP PHP program, soapClient.php
Example : soapClient.php
<?php
$client = new SoapClient("http://[insert real path here]/productOrder.wsdl");
print_r($client->serverFunction('UserName', password', $Integer1, $string1));
?>
This client function will communicate with productOrder.wsdl file on the server. WSDL (Web Services Definition Language) is an XML based standard designed to describes protocol bindings and message formats of Web services. WSDL is often pronounced as "Whiz-Dull.
Being XML-based, this allows clients to automatically discover everything about the functionality of the web service. Human-readable documentation is technically not required for a SOAP service that uses a WSDL document, though it is still highly recommended. Let's take a look at the structure of a WSDL document and how we can use it to figure out what is available to us in a SOAP-based web service. Out of all three specifications that we're going to look at in relationship to SOAP, WSDL is the most ethereal. Both supporters and detractors often call writing WSDL documents a black art.
The only argument against using it is that the client has to load the relevant WSDL document from the server before the RPC can be made, and this can take a significant amount of time in a Web environment. In order to speed things up, PHP's ext/soap uses a WSDL caching feature that can be controlled through setting the soap.wsdl_cache_enabled, soap.wsdl_cache_dir and soap.wsdl_cache_ttl configuration directives, either in your php.ini or by using ini_set()(see SOAP Server Example ). By default, WSDL caching is turned on and caches WSDL files for one day.
Beginning with a root definitions element, WSDL documents follow this basic structure:
Link Listing Script links.zip
Links Exchange Website conservatory.zip
Live Help Script livehelp.zip
MySQL Database Backup Perl Script backupscript.zip
News Publishing Script topstory.zip
Office Intranet Suite intranet.zip
Online Classifieds Script classifieds.zip
Online MultiPlayer Chess webchess.zip
osCommerce PHP Shopping Cart oscommerce.zip
PassGen passgen.zip
PaymentPal paymentpal.zip
Perpetual Traffic Generator trafficgenerator.zip
PHP & MySQL Content Management System contentm.zip
PHP Form To Email Script SECURE! emailer.zip
PHP Message Boards Script messageboard.zip
PHP-based eCard Script/Website gcards.zip
POP-UP Creator popup.zip
Powerful Portal with Content Management phpx.zip
Secure Authentication Script authentication.zip
Simple Yet Powerful Download Counter Script hitcounter.zip
Sophisticated PHP Ecommerce Site xtcommerce.zip
Sports League, Fixture and Prediction Management Script phpfootball.zip
Toplist Website Manager #1 toplist.zip
Toplist Website Manager #2 topsites.zip
USENET News Client newsgroup.zip
Visitor Logging Script tollbooth.zip
Web Event Calendar calendar.zip
Web Portal System geeklog.zip
Web-Based Address Book Script wa-boo.zip
Web-based Image Management System photoseek.zip
Web-based POP Email Client webmail.zip
Website Stats Business trafficgopher.zip
Whois Lookup whois.zip
Yahoo Style Link Directory/Search Engine sslinks.zip
Submit-A-Link Style Script linksubmit.zip
Suggest My Site Script suggest.zip
Users Online Script #1 usersonline.zip
Users Online Script #2 cjusersonline.zip
Advanced Guestbook Script guestbook.zip
Affiliate Banner Rotation Script adrotator.zip
Affiliate Linkmaster affiliatemask.zip
Affiliate Program (Advanced Version) postaffiliate.zip
Affiliate Program (Basic Version) phpaffiliate.zip
Another PHP Web FTP Program webftp.zip
Auction Website phpauction.zip
Auto Hits Script scau.zip
Automated Form Submission Prevention human.zip
Bookmarks/Favorites Script bookmarks.zip
Build a Webring webring.zip
ClickBank "Thank You" Page Protector Script cbscript.zip
Client Invoicing Script myinvoice.zip
Document Management System sdms.zip
Easy Administration Program easyadmin.zip
EasyStream easystream.zip
Electronic Reminder Script ereminder.zip
Expired Domain Finder wgs-expire.zip
FAQ Generator whatdafaq.zip
FAQ Manager faqmanager.zip
FFA Links Page Script ffalinks.zip
File Transfer Script net2ftp.zip
Hot Mailing List Script newsletter.zip
ICQ Pager Script pager.zip
Image to ASCII Generator img2ascii.zip
Image Watermarking Script watermark.zip
Instant Photo Gallery Script instantgallery.zip
Instant Site Maker instantsm.zip
.........................................................
Download Link: http://rapidshare.com/files/112471002/20_Scripts.rar
Con este script podemos contar los usuarios activos con PHP.
No vamos a usar ninguna base de datos. En su lugar usaremos un archivo llamado usuarios.dat
Creamos nuestro script PHP y lo llamamos activos.php
<?php
$tiempo_logout = 600; // segundos tras los cuales un usuario es marcado como inactivo
$arr = file("usuarios.dat");
$contenido = $REMOTE_ADDR.":".time()." ";
for ( $i = 0 ; $i < sizeof($arr) ; $i++ )
{
$tmp = explode(":",$arr[$i]);
if (( $tmp[0] != $REMOTE_ADDR ) && (( time() - $tmp[1] ) < $tiempo_logout ))
{
$contenido .= $REMOTE_ADDR.":".time()." ";
}
}
$fp = fopen("usuarios.dat","w");
fputs($fp,$contenido);
fclose($fp);
$array = file("usuarios.dat");
$USUARIOS_ACTIVOS = count($array);
?>
La explicación de lo que hace el codigo anterior es la siguiente:
Para utilizar este Script, al principio de cualquier página ponemos
<?php
include(”activos.php”)
?>
y donde queremos mostrar el número de usuarios, usamos la variable $USUARIOS_ACTIVOS.
After N days in MySQL
Simply Use INTERVAL function in MySQL to get the date after N days
Syntax
SELECT NOW(), NOW()+INTERVAL 180 DAY;
prints
2012-08-03 10:12:13 20 | 2013-01-30 10:12:13 20
eg: To Insert into DB table use
INSERT INTO myTable (signup_date, exp_date) VALUES (NOW(), NOW() + INTERVAL 180 DAY);
The PHP Hypertext Preprocessor (PHP) is a programming language that allows web developers to create dynamic content that interacts with databases. PHP is basically used for developing web based software applications. This tutorial helps you to build your base with PHP. Audience: This tutorial is designed for PHP programmers who are completely unaware of PHP concepts but they have basic understanding on computer programming. Prerequisites: Before proceeding with this tutorial you should have at least basic understanding of computer programming, Internet, Database, and MySQL etc is very helpful. |