Hello,
I'm kind of stupid when it comes to php and I need a tiny bit of help. I've got a form/php setup that allows a user to upload an image to my server. The upload is working well, and the code is functioning as is, however, I would like to add a timestamp to the file name before it is saved to the server, as well as making sure the time stamped file name is turned into a variable I can recall on a later php page. This is all in an effort to create unique filenames for uploaded content.
Here is my current form code:
<FORM ENCTYPE="multipart/form-data" ACTION="uploadck.php" METHOD=POST>
Upload this file: <INPUT NAME="file_up" TYPE="file">
<INPUT TYPE="submit" VALUE="Send File"></FORM>
and here is the php for that form:
<?
$file_upload="true";
$file_up_size=$_FILES['file_up'][size];
echo $_FILES[file_up][name];
if ($_FILES[file_up][size]>1000000){$msg=$msg."Your uploaded file size is more than 1MB so please reduce the file size and then upload. Visit the help page to know how to reduce the file size.<BR>";
$file_upload="false";}
if (!($_FILES[file_up][type] =="image/jpeg" OR $_FILES[file_up][type] =="image/gif")){$msg=$msg."Your uploaded file must be of JPG or GIF. Other file types are not allowed<BR>";
$file_upload="false";}
$file_name=$_FILES[file_up][name];
$add="upload/$file_name"; // the path with the file name where the file will be stored, upload is the directory name.
if($file_upload=="true"){
if(move_uploaded_file ($_FILES[file_up][tmp_name], $add)){
echo "Congratulations, file succesfully uploaded";
}else{echo "Failed to upload file Contact Site admin to fix the problem";}
}else{echo $msg;}
?>
Stumped by Third Day of Month problem
I am trying to build an algorithm that will essentially do this: Code: [Select]$this_month = October$third_sunday = CalculateThirdSunday(October)if ( ( TodaysDate before $third_sunday ) | ( TodaysDate
how make 2 column in table with data tybe long row
hi every one
Operating System
How in PHP or other language can I detect Operating system, ie Windows XP Home, Windows 7 Ultimate, Mac OS 10?Anyone know how?Thanks
PHP/Database issue
My friend is helping me make a database where you go to a certain webpage of my site and the page will use code to pull information from a database and display it on the page in a formatted way.Code:
Help a newbee save my job !
Hey guys i am dying here i am new to php and would like for someone to help me with this problemi have a script that send information from a "form" but the probelm is that i need this to be
Needing Youtube thumb nail fix.
I have a script on a site that pulls in you-tube videos,The problem is, that the thumb nails for the site, no longer show up.I have tried to add codes to remove the line causing the problem but this
Character increment
Hi,I am facing a scenario like above,but in my case i want to show up like Col A,Col B etc....The container where i am displaying this is being dynamically generated using jquery.Any help?
SWF image using php?
Hello once again.My latest en devour requires me to produce an image of a static .swf that is embedded on a page.Unfortunately, it has a selection of variables passed to it.EgCode: <object
How can you detect variable string in a massive string?
Ok guys, i need some help with this one.I am going to be getting a large string, like 10-20 paragraphs. I will also have an array or words that i would like to search it for.
Sum of Values in an Array
This is probably really simple... but it's been years since I've written anything, so bare with me!I've got a MySQL database setup with a table that has multiple fields, where one is a numerical