Guys CK is out! Hope you guys enjoy it and also get the message we are trying to give out in a fun way. CK has taken maximum efforts. Hope you all love it. Enjoy, keep laughing and Happy SDEing!!!
Create The HTML Form Create an HTML form, so you can choose file want to upload: *********************** Code *********************** <form action="upload.php" method="post" enctype="multipart/form-data"> Please choose a file: <input type="file" name=" uploadFile " accept="image/*" /> <br> <input type="submit" value="Upload File" /> </form> *********************** End of Code *********************** On the Above code accept is use for accepting only Image file as a File Input. If no accept is specify, All File are accepted. Create a upload.php file , whose code will be as Follow: *********************** Code *********************** ?php $target_dir = "uploads/"; $target_dir = $target_dir . basename( $_FILES["uploadFile"]["name"]); $uploadOk=1; // Check if file already exists if (file_exists($...
Put the Following Function here: <?php function uploadimgfile($index,$folder="other",$prefix="other") { $target_dir = "upload_directory_path/"; // try to put full physical path // identity accstatement address advtimg other $uploadOk = 1; $senddata = array(); $senddata['data'] = "NILL"; $notallowed = array("php","js","css","html"); // defined here the extesion not to upload $shownotallowed = "PHP, JS, CSS, HTML fie is not allowed to upload."; $extension = explode(".",basename($_FILES[$index]["name"])); $extension = end($extension); ECHO "<hr/>" . $realfilnename = basename($_FILES[$index]["name"]); $datetofolder = date("Y/M/d"); $datetofolder = strtolower($datetofolder); $checkdirectory = $targ...
PHP is a server side language, which means it execute on the server machine and send output to the client machine. so Server is like a computers which store information on it memory and display data on the machine connected to Internet. This system is setup via assigning a Fixed IP to that machine, so that the file on the machine can executed anywhere in world, The system we are using will called as client machine, Which ask data from the server machine to display the information on the screen or output device like Printer. So PHP is sever side languages, which actually create the HTML with some numeric or Theoretical calculation done by the programmer. so here are a Basic PHP Program , which simply print hello in the webpage. The PHP start with <?php and end with ?> This sign tell the server to execute the PHP code between these sign. The Following is the code: (Use spaces and tab, so the programm is easily readable for future reading/ reviewing of the code) ...
Comments
Post a Comment