|
|
|
Wednesday, 25 January 2012 11:27 |
// Picture upload PHP script http://www.htmlgoodies.com/beyond/webmaster/article.php/3548746/PHP-Tips--Tricks---A-Picture-Upload-Part-1.htm
//print_r($_POST);
if($_POST["action"] == "Upload Image")
{
unset($imagename);
if(!isset($_FILES) && isset($HTTP_POST_FILES))
$_FILES = $HTTP_POST_FILES;
if(!isset($_FILES['image_file']))
$error["image_file"] = "An image was not found.";
$imagename = basename($_FILES['image_file']['name']);
//echo $imagename;
if(empty($imagename))
$error["imagename"] = "The name of the image was not found.";
if(empty($error))
{
$newimage = "images/" . $imagename;
//echo $newimage;
$result = @move_uploaded_file($_FILES['image_file']['tmp_name'], $newimage);
if(empty($result))
$error["result"] = "There was an error moving the uploaded file.";
}
}
?>
if(is_array($error))
{
while(list($key, $val) = each($error))
{
echo $val;
echo " \n";
}
}
?>
Credits::: Websites Lists and Web4Link.Com Read more: |
|
|
Tuesday, 20 December 2011 00:12 |
There is one main class in the ASP.NET Framework included for working with Javascript: the ClientScriptManager class. This class is exposed by the Page.ClientScript property. The ClientScriptManager class has several useful methods for working with Javascript including:
RegisterClientScriptBlock():
Adds a script to a page right after the opening server-side tag
StringBuilder cstext2 = new StringBuilder();
cstext2.Append(" function DoClick() {");
cstext2.Append("Form1.Message.value='Text from client script.'} ");
cstext2.Append("script>");
RegisterClientScriptBlock(csname2, cstext2.ToString());
RegisterStartupScript():
Adds a script to a page right before the closing server-side tag
String cstext1 = "" +
"alert('Hello World');" + "script>";
RegisterStartupScript(csname1, cstext1);
RegisterClientScriptInclude():
Adds a reference to an external Javascript file
GetWebResourceUrl() - Returns the URL to a server-side resource
// Define the name, type and url of the client script on the page.
String csname = "ButtonClickScript";
String csurl = "~/script_include.js";
Type cstype = this.GetType();
// Get a ClientScriptManager reference from the Page class.
ClientScriptManager cs = Page.ClientScript;
// Check to see if the include script exists already.
if (!cs.IsClientScriptIncludeRegistered(cstype, csname))
{
cs.RegisterClientScriptInclude(cstype, csname, ResolveClientUrl(csurl));
}
 Read more: |
|
Monday, 19 December 2011 00:53 |
Database Publishing Wizard is very flexible and works with modes like schema only, data only or both. It generates a single SQL script file which can be used to recreate the contents of a database by manually executing the script on a target server.
You may find at following location in your machine:
File Name:
SqlPubWiz.exe
Path:
C:\Program Files\Microsoft SQL Server\90\Tools\Publishing
Download Database Publishing Wizard from here http://sqlhost.codeplex.com/wikipage?title=Database%20Publishing%20Wizard&ProjectName=sqlhos Read more: |
|
|
Friday, 02 December 2011 11:40 |
|
Simple Bash Script To Work As A Daemon
If you need some snippets or codes to run for ever, but not more that
one instance, you need to rapidly check the code, or script and if it
has died! It's the time to run it again. To be sure of this function, just add the following lock handler at the top of your script Read more: |
|
Monday, 20 June 2011 13:43 |
|
Script For Automatically Setting Up A Perfect Server On OpenSUSE 11.4 And Installing ISPConfig 3
Here's a little script that automates the task of setting up a Perfect Server - OpenSUSE 11.4 x86_64 [ISPConfig 3],
and in the end it also installs ISPConfig 3. Read more: |
|
|
|
|
|
|
|