|
I'm not too sure about ASP, but basically the way YouTube does it is:
You upload using the "files" input type (HTML).
They use php.
In php to get a file that was uploaded you call the global variable "$_FILES['filename']"
once they file passes a serious of security checks it is stored in a temporary directory. They then connect to Macromedia Flash encoder using PHP's command line abilities.
When it is encoded into flash it is stored on a server ready to be requested by TouTubers.
See:
Here for Uploading in PHP[^]
Here for PHP command line stuff[^]
Here for info on the Flash encoder[^]
Brad
Australian
"Keyboard? Ha! I throw magnets over the RAM chips!" - peterchen
|
|
|
|
|
mujin03 wrote: But not sure whether it can load video file.
Right... because a "video file" is not a "file".
mujin03 wrote: I searched google and didn't find any samples.
Yes I can understand your difficulty since they hide that information in the documentation[^]
led mike
|
|
|
|
|
|
hi friends
i am retriving data from xml .i got all the xml value
in dropdown list.i have done this
<asp:dropdownlist id="dropdl" autopostback="true" runat="server" onselectedindexchanged="rnd">
asp:DropDownList id="dropdl"
AutoPostBack="true" runat="server"
OnSelectedIndexChanged ="rnd"
but when i select any value from dropdownlist it gives only first value
even if i am selected other value
why???????????????????????
|
|
|
|
|
Yes, this is very annoying. Can't tell you why it happens, but I usually avoid the problem by using .selecteditem instead of .selectedvalue.
|
|
|
|
|
I have html text document.Obviously it contains tag at the end of each sentence.
I will select some part of the text.
My requirement is to insert an image at the starting point of selected text.So iam considering starting and ending indexes of the selected text in the document as input for inserting an image.
Some conflicts are occuring when i select more than one line.
So i thought of filtering out the all html tags that appears.
So how do u fliter these html tags out of the html document.
|
|
|
|
|
Could you please provide your source code so you that we can know more about what you are trying to do.
Brad
Australian
"Keyboard? Ha! I throw magnets over the RAM chips!" - peterchen
|
|
|
|
|
I think you didn't understand the problem.My source code will help you nothing.
I have document in html format.So we will have "BR" in between <> at the end of each sentence.I want to filter all these "BR" tags from my document.
My question is are there any filters to filters these kind of tags like "BR" ...............?????
Hope you understood now!!!!!!!!!!
|
|
|
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
Registration Page
//////////////////
getTableValue("memberId ","membertable ","m_userName ='$VARS[uname]'")!="")
$errmsg = "User Already Exist";
elseif($dbc->getTableValue("memberId","membertable ","m_emailAddr ='$VARS[email]'")!="")
$errmsg = "E_mail Already Exist";
if (strlen($errmsg)==0) {
$now = time();
$insertArray = array("m_firstName"=>$VARS[fname],"m_lastName"=>$VARS[lname],"m_userName"=>$VARS[uname],
"m_password"=>$VARS[pword],"m_address"=>$VARS[address],"m_emailAddr"=>$VARS[email],
"m_jointDate"=>$now,"m_city"=>$VARS[city],"m_zipcode"=>$VARS[zip],"m_phone"=>$VARS[phone], "m_mobile"=>$VARS[mobile],"m_accountStatus"=>"A","accountType"=>"M");
$dbc->InsertQuery("membertable",$insertArray);
header("location:index.php");
}
echo $errmsg;
}
?>
| |
Member Registration |
| * Fields are mandatory | First Name* | | Last Name* | | Address* | | City | | Zip | | Phone | | Mobile | | Email* | | Username* | | Password* | | | |
|
|
function emailok(str,form,inputval)
{
var reg1 = /(@.*@)|(\.\.)|(@\.)|(\.@)|(^\.)/; // not valid
var reg2 = /^.+\@(\[?)[a-zA-Z0-9\-\.]+\.([a-zA-Z]{2,4}|[0-9]{1,3})(\]?)$/; // valid
if (!reg1.test(str) && reg2.test(str))
{
return true;
}
else{
alert("\"" + str + "\" is an invalid e-mail!");
form = eval("document."+ form );
eval("form."+inputval+".focus()");
return false;
}
}
function formValidate() {
if(document.frm1.fname.value=="") {
alert("Please enter the Firstname");
document.frm1.fname.focus();
return false;
} else if(document.frm1.lname.value=="") {
alert("Please enter the Lastname");
document.frm1.lname.focus();
return false;
} else if(document.frm1.address.value=="") {
alert("Please enter the Address");
document.frm1.address.focus();
return false;
} else if(Trim(frm1.email.value)==0) {
alert("Please enter Contactemail");
frm1.email.focus();
return false;
} else if (!emailok(frm1.email.value,"frm1","email")) {
return false;
} else if(document.frm1.uname.value=="") {
alert("Please enter the Username");
document.frm1.uname.focus();
return false;
} else if(document.frm1.pword.value=="") {
alert("Please enter the Password");
document.frm1.pword.focus();
return false;
} else return true;
}
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
To Update the registration details
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
$VARS[fname],"m_lastName"=>$VARS[lname],"m_userName"=>$VARS[uname],
"m_password"=>$VARS[pword],"m_address"=>$VARS[address],"m_emailAddr"=>$VARS[email],
"m_updateDate"=>$now,"m_city"=>$VARS[city],"m_zipcode"=>$VARS[zip],
"m_phone"=>$VARS[phone],"m_mobile"=>$VARS[mobile],"m_accountStatus"=>"A",
"accountType"=>"M");
}
else {
$updateArray = array("m_firstName"=>$VARS[fname],"m_lastName"=>$VARS[lname],"m_userName"=>$VARS[uname],
"m_address"=>$VARS[address],"m_emailAddr"=>$VARS[email],
"m_updateDate"=>$now,"m_city"=>$VARS[city],"m_zipcode"=>$VARS[zip],
"m_phone"=>$VARS[phone],"m_mobile"=>$VARS[mobile],"m_accountStatus"=>"A",
"accountType"=>"M");
}
$dbc->UpdateQuery("membertable",$updateArray,"memberId ='$memId'");
$errmsg = "Your profile updated.";
}
$query = "SELECT * FROM membertable WHERE memberId='$memId'";
$result = mysql_query($query);
//$result = $dbc->ExecuteQuery($query);
$row = mysql_fetch_array($result);
?>
| |
Update Profile Details |
| * Fields are mandatory | First Name* | " size="30"> | Last Name* | " size="30"> | Address* | <?=$row["m_address"]?> | City | " size="30"> | Zip | " size="20"> | Phone | " size="20"> | Mobile | " size="20"> | Email* | " size="30"> | Username* | " size="30"> | Password* | | |
|
|
/////////////////////////////////
To display it in Admin Side.
//////////////////////////////////
";
}elseif($sby=='D'){
$sortquery = " ORDER BY m_firstName DESC, memberId DESC";
$sby="A";
$fnamesortarrow = "";
}
break;
case "lname":// Member lastname sorting...
if ($sby=='A'){
$sortquery = " ORDER BY m_lastName ASC, memberId ASC";
$sby="D";
$lnamesortarrow = "";
}elseif($sby=='D'){
$sortquery = " ORDER BY m_lastName DESC, memberId DESC";
$sby="A";
$lnamesortarrow = "";
}
break;
case "email":// Member email sorting...
if ($sby=='A'){
$sortquery = " ORDER BY m_emailAddr ASC, memberId ASC";
$sby="D";
$emailsortarrow = "";
}elseif($sby=='D'){
$sortquery = " ORDER BY m_emailAddr DESC, memberId DESC";
$sby="A";
$emailsortarrow = "";
}
break;
case "uname":// Member username sorting...
if ($sby=='A'){
$sortquery = " ORDER BY m_userName ASC, memberId ASC";
$sby="D";
$unamesortarrow = "";
}elseif($sby=='D'){
$sortquery = " ORDER BY m_userName DESC, memberId DESC";
$sby="A";
$unamesortarrow = "";
}
break;
case "accstatus":// Member accountstatus sorting...
if ($sby=='A'){
$sortquery = " ORDER BY m_accountStatus ASC, memberId ASC";
$sby="D";
$accstatussortarrow = "";
}elseif($sby=='D'){
$sortquery = " ORDER BY m_accountStatus DESC, memberId DESC";
$sby="A";
$accstatussortarrow = "";
}
break;
default: //Default , it will be in the posted order...
$sortquery = " ORDER BY m_firstName DESC, memberId DESC";
$sby="A";
$namesortarrow = "";
break;
}
$query = "SELECT * FROM membertable WHERE accountType='M' and memberId IS NOT NULL $sortquery ";
//$query = "SELECT mem.*,con.country_name FROM membertable mem LEFT JOIN country_list con
// ON mem.m_country = con.country_id WHERE accountType='M' and memberId IS NOT NULL $sortquery ";
//echo $query ;
//$res=mysql_query($sql);
$result = $dbc->ExecuteQuery($query);
?>
function ChangeStatus(id,status) {
switch(status) {
case "A":
str = "Do you want to de-activate this account?";
break;
case "D":
str = "Do you want to acitvate this account?";
break;
}
if (confirm(str)) {
document.location.href='aord.php?memberId='+id;
}
}
//////////////////
Active or deactive
//////////////////
getTableValue("m_accountStatus","membertable ","memberId ='$id'");
//$accountType = $dbc->getTableValue("accountType","membertable ","memberId ='$id'");
if($status=='A'){
$updateArray = array("m_accountStatus" => "D");
$dbc->UpdateQuery("membertable ",$updateArray,"memberId ='$id'");
}else {
$updateArray = array("m_accountStatus" => "A");
$dbc->UpdateQuery("membertable",$updateArray," memberId ='$id'");
}
//if($accountType=='M')
header("location:display.php");
//else
// header("location:displayadmin.php");
//exit();
?>
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
I only read through the first section which was to add a user. I read it quickly, but from what i saw you have no server side input validation.
It is incredibly important to validate user input ON THE SERVER because the user can simply turn javascript off or create their own form.
You have left the database wide open to attacks.
Also it appeared as though a lot of script was missing. Did you copy and paste everything?
(By script I mean some things like "<?php" were missing in a couple of instances.)
-- modified at 2:34 Friday 15th December, 2006
Brad
Australian
I assume Microsoft would not use doors, because using Windows is faster.
|
|
|
|
|
That's a really long page!
I'm on-line therefore I am.
JimmyRopes
|
|
|
|
|
Hi,
I have an application (ASP.net with C#) which allows users to view 3 pages with data in GridViews. Page 1 shows GridView A, page 2 shows GridView B, and page 3 shows both A & B to allow comparison. In order to do this I have created 2 UserControls to show the GridViews.
The database is also linked to by a separate application, which may make changes while the user is viewing the data in a GridView. Therefore, I am using AJAX and have placed the GridViews inside an UpdatePanel within the UserControls.
AJAX refreshes the UpdatePanels every 5 seconds. It also refreshes the scroll position of the page.
I have managed to prevent re-setting the scroll position for the whole page by using the Page directive MaintainScrollPositionOnPostback="true" on the pages which use the UpdatePanels.
However, page 3 (the comparison page) users 2 ContentPlaceHolders, one above the other, which each display one of the UserControls. While I can prevent the whole page scroll position resetting, I can't stop the scroll position of these ContentPlaceHolders (or is it the UserControls?) resetting.
Anyone got any ideas how to do this? It's really important that my users are able to scroll through the contents of both ContentPlaceHolders to where they want them, and then look at them for more than the few seconds they get before the scroll position.
Thanks ever so much,
Alice
|
|
|
|
|
I finally decided to just along with VS.NET's Designer and use of Style for my custom web/server-side combobox component style attributes instead of ComponentStyle to store my component's main style attributes in. There were several reasons I tried to use ComponentStyle component:
1) Adding attributes with letters of different cases causes multiple enteries in the string.
2) The Designer doesn't show a default style property editor for Styles
3) You can not create a Shadowed Read/Write Property for Style, so you can't address the previous two issues.
4) A minor point, my component exposes four styles, maybe five in the future, so I wanted to make it clear which style does what. So while style is the conventional name for this property, it isn't immediately clear that it only applies to the component and not any of the sub-components, like the text-box, list-box, or the image-button.
It would be very nice if there were a way to tell the designer to use my style property, even if it isn't named Style. Also, it would be nice if in the Designer you could use the built-in style property editor for custom web/server-side components. It's not perfect, but it's better than directly editing the HTML inline style string. It would go along way to solving my issues with using Style.
Has anyone out there been able to add a style property editor to their components?
|
|
|
|
|
The following code does not solve this problem, but it does make the property visable in the VS.NET 2003 Design Property Window.
However, because it is ReadOnly it can not be edited. Also, because it is not recognized as one of the supported properties (Int, Unit, String, Boolean, etc.) the property window does not offer an editor.
Private ReadOnly Property [Style]() As System.Web.UI.CssStyleCollection
Get
Dim cbx As cwcComboBox = CType(Me.Component, cwcComboBox)
Return cbx.Style
End Get
End Property ' Style
Protected Overrides Sub PreFilterProperties(ByVal properties As IDictionary)
MyBase.PreFilterProperties(properties)
'
' Modify Style property to allow it to be seen in the properties window.
'
properties("Style") = _
TypeDescriptor.CreateProperty( _
Me.GetType(), _
"Style", _
Style.GetType(), _
CategoryAttribute.Design, _
DesignOnlyAttribute.No)
End Sub
Does anyone know what needs to be done to allow the built-in Style editor to be used with this property, or for that matter any other custom style property?
Also, I'm using CategoryAttribute.Design to make Style appear in the Design group of the property window, but help seems to indicate that you can put in in any category, including a custom one such at "Component", but it doesn't show how to do this. Anyone know how I can do this?
Thank you
|
|
|
|
|
Aloha,
I get the following exception when I try to run my program:
Client found response content type of 'text/html; charset=utf-8', but expected 'text/xml'.
It occurs when I call a webmethod. The strange thing is that it fails on one machine, but no on the other.
Right now I haven't got a clue about where to search for the error, so any ideas will really be appreciated (and make both me and my chieftain happy).
Thank you,
|
|
|
|
|
It would appear as though your server is trying to output a html page where the browser or whatever is expecting an xml output.
Try modifying the headers to make the mime-type "text/xml"
Brad
Australian
I assume Microsoft would not use doors, because using Windows is faster.
|
|
|
|
|
The usual cause for this is a compilation error in the asmx page - when this ocurrs, the usual IE error page is sent down the response stream, which is text/html, rather than the XML that should be output
I'd check what is actually being returned (use a js alert() or write to a text field) - my guess is that it will be the error page, which will then tell you where the error ocurrs in the asmx...
(Or of course a Build -> Build Page should help if this is the cause)
"Now I guess I'll sit back and watch people misinterpret what I just said......"
Christian Graus At The Soapbox
|
|
|
|
|
It turned out that the error occured because of a call to some resources. The resources exist on the development machine, but not on production and this cause an exception to be thrown.
|
|
|
|
|
I have musical Database on my WEB site. I want to make valid links from my musical compositions to the Amazon retail of CD/DVD discs with appropriate musical composition, How can i did it ?
Thanks in advance !
Regards.
|
|
|
|
|
You can find lots of information (a 300+ page pdf file) on the Amazon associates website if I remember correctly.
It's quite easy to implement, I did http://www.cheapoo.com ages ago using the Amazon API.
|
|
|
|
|
Oops - on URL : http://www.cheapoo.com returned answer :
"The requested URL could not be retrieved"
is everything correct ?
And where actually is it : "(a 300+ page pdf file) on the Amazon associates website if " ? Did you have link ?
Thanks in advance.
|
|
|
|
|
I am creating a web site for playing music and videos.But I am not sure how to go for it.
Do I need to embed the media player in htm file and then play my media files
OR is there any other or better way to do it.
Thanks
|
|
|
|
|
You can just use the Embed tag. Like so:
<embed src="C:\Song.mp3" autostart="true" hidden="false" loop="0"></embed>
Then change the file name to any file you want to embed. And you can change the Loop to the number of times you want the Video/Audio file to repeat (or set it to "Infinite").
Keep in mind though, if you have a QuickTime video (.mov) that you want to embed in your website, the computer that is viewing the website must have QuickTime installed.
|
|
|
|
|
Encoding a video in flash has become very popular.
Brad
Australian
I assume Microsoft would not use doors, because using Windows is faster.
|
|
|
|
|
This will really depend on your goals. Is this for an Intranet or the Internet? Do you want cross platform? Do you want to protect your media content? Do you want to users to have to use a special player to see your video? Do you want the users to easily link to the video?
Assuming you don't care about protected content and you want cross platform support then use MPEGs embeded r otherwise. If you want a fine grained control over your media, but don't necessarily want to protect it, then I agree with Brad's suggestion in that Flash is quite the attractive option now.
If you go the flash route though, make sure you pick up a copy of Flash 7.0 or newer. Anything older than that will be a pain (without 3rd party plug-ins) to work with video on.
|
|
|
|
|