flash + php ÎļþÉÏ´«
import flash.net.FileFilter;
import flash.net.FileReferenceList;
import fl.controls.Button;
import flash.events.MouseEvent;
import flash.events.Event;
import flash.events.ProgressEvent;
import flash.events.HTTPStatusEvent;
import flash.display.Loader;
import flash.net.URLRequest;
var choose_button:Button=new Button();
var upload_button:Button=new Button();
var loader:Loader=new Loader();
var reference_list:FileReferenceList=new FileReferenceList();
var url:URLRequest=new URLRequest("http://localhost/flashupload.php");
choose_button.label="Ñ¡ÔñÎļþ";
upload_button.label="ÉÏ´«Îļþ";
upload_button.move(100,50);
addChild(choose_button);
choose_button.move(300,100);
addChild(upload_button);
addChild(loader);
choose_button.addEventListener(MouseEvent.CLICK,choose_file);
upload_button.addEventListener(MouseEvent.CLICK,upload_start);
reference_list.addEventListener(Event.SELECT, selectHandle);
reference_list.addEventListener(Event.CANCEL, cancelHandle);
//reference_list.addEventListener(ProgressEvent.PROGRESS, progressHandler);
//reference_list.addEventListener(Event.COMPLETE, completeHandle);
//reference_list.addEventListener(HTTPStatusEvent.HTTP_STATUS, httpStatusHandle);
loader.contentLoaderInfo.addEventListener(Event.COMPLETE,load_complete);
function progressHandler(evt:ProgressEvent):void{
trace("ProgressEvent");
trace(evt.target.name+"="+evt.bytesLoaded)
}
function load_complete(evt:Event):void{
trace("load_complete");
}
function selectHandle(evt:Event):void{
trace("select file successfully");
trace("ÄãÑ¡ÔñÁË"+evt.target.fileList.length+"Îļþ")
for(var i:int=0;i<evt.target.fileList.length;i++){
trace(evt.target.fileList[i].name);
evt.target.fileList[i].addEventListener(ProgressEvent.PROGRESS, progressHandler);
evt.target.fileList[i].addEventListener(Event.COMPLETE, completeHandle);
evt.target.fileList[i].load();
}
//trace("type"+evt.target.fileList[
Ïà¹ØÎĵµ£º
ѧ¹ýCµÄÈËÓÃphpµÄʱºòÒ»°ã»áÏ൱˳ÊÖ£¬¶øÇҸе½phpÌ«·½±ãÌ«ÇáËÉ¡£µ«ÔÚ±äÁ¿×÷ÓÃÓòÕâ·½ÃæÈ´Óë
cÓв»Í¬µÄµØ·½£¬¸ã²»ºÃ»áÏ൱ÓôÃÆ£¬¾ÍÕÒ²»µ½´íÎóËùÔÚ¡£×òÍí¾ÍÓëµ½Õâôһ¸öÎÊÌ⣬ÊÇÈ«¾Ö±äÁ¿ÔÚº¯ÊýÖеÄÎÊÌâ¡£½ñÌìËÑË÷ÁËһϣ¬·¢ÏÖһƪÏ൱²»´íµÄÎÄÕ£¬½²ÁËphpÖеıäÁ¿×÷ÓÃÓò¡£ÊÇÒ»Î»ÍøÓÑ·ÒëµÄ ÔÚÕâÌùһϣº
±äÁ¿·¶Î§
±äÁ¿µÄ·¶ ......
±í´ïʽÊÇ PHP ×îÖØÒªµÄ»ùʯ¡£ÔÚ PHP ÖУ¬¼¸ºõÄãËùдµÄÈκζ«Î÷¶¼ÊÇÒ»¸ö±í´ïʽ¡£¼òµ¥µ«È´×ȷµÄ¶¨ÒåÒ»¸ö±í´ïʽµÄ·½Ê½¾ÍÊÇ“anything that has a value”¡£
×î»ù±¾µÄ±í´ïʽÐÎʽÊdz£Á¿ºÍ±äÁ¿¡£µ±Äã¼üÈë“$a = 5”£¬¼´½«Öµ '5' ·ÖÅ䏸±äÁ¿ $a¡£'5'£¬ºÜÃ÷ÏÔ£¬ÖµÎª 5£¬»»¾ä»°Ëµ '5' ÊÇÒ»¸öֵΪ5µÄ±í´ïʽ£ ......
¾¹ý2¸öÐÇÆÚµÄ¼è¿à·Ü¶·£¬ÖÕÓÚСÓгɾ͡£ÏêϸµÄÁ÷³ÌÎÒ֮ǰҲÓÐ˵¹ý¡£ËùÒÔ²»ÔÙÌá³ö¡£Ö±½ÓÉÏ´úÂ룬ϣÍû¶Ô´ó¼ÒÓÐËù°ïÖú¡£
1.LOGIN.php
<?php
include_once"conn2.php";
$uname=$_POST['uname'];//½ÓÊÕ´«¹ýÀ´µÄÓû§Ãû
$upwd=$_POST['upwd'];//½ÓÊÕ´«¹ýÀ´µÄÃÜÂë²¢md5()
$sql="SELECT * from pv_master WH ......
PHPÖеÄMYSQL³£Óú¯Êý×ܽá
1¡¢mysql_connect()-½¨Á¢Êý¾Ý¿âÁ¬½Ó
¸ñʽ£º
resource mysql_connect([string hostname [:port] [:/path/to/socket] [, string username] [, string password]])
Àý£º
$conn = @mysql_connect("localhost", "username", "password") or dir( ......
ÔÌûµØÖ·£ºhttp://www.phpma.com/english/20071215/640.html
Description
array explode
( string separator, string string [, int limit])phpma.com
Returns an array of strings, each of which is a substring of string
formed by splitting it on boundaries formed by the string separator
. If limit
is ......