Click here to Skip to main content
15,917,005 members
Home / Discussions / Web Development
   

Web Development

 
QuestionPrompt user to save file when clicking on link to download Pin
sito4215-May-09 9:09
sito4215-May-09 9:09 
AnswerRe: Prompt user to save file when clicking on link to download Pin
Marc Firth17-May-09 23:27
Marc Firth17-May-09 23:27 
AnswerRe: Prompt user to save file when clicking on link to download Pin
Marc Firth17-May-09 23:47
Marc Firth17-May-09 23:47 
GeneralRe: Prompt user to save file when clicking on link to download Pin
sito4218-May-09 18:28
sito4218-May-09 18:28 
QuestionHow to Add web Deplayment Setup in ASPSAjaxExe ! Pin
avon.purushottam15-May-09 3:26
avon.purushottam15-May-09 3:26 
Questioncontent management editor Pin
jobitha15-May-09 1:02
jobitha15-May-09 1:02 
AnswerRe: content management editor Pin
Marc Firth17-May-09 23:50
Marc Firth17-May-09 23:50 
QuestionPHP: how to display the image after upload? Pin
Member 323010714-May-09 17:53
Member 323010714-May-09 17:53 
Based on my coding, i can upload image to my server,and all image is renamed absed on the time()...so if i wan to display it out, what should i do since the filename may b different?

<?php
define ("MAX_SIZE","100");

function getExtension($str) {
$i = strrpos($str,".");
if (!$i) { return ""; }
$l = strlen($str) - $i;
$ext = substr($str,$i+1,$l);
return $ext;
}

$errors=0;
if(isset($_POST['Submit']))
{
$image=$_FILES['image']['name'];
if ($image)
{
$filename = stripslashes($_FILES['image']['name']);
$extension = getExtension($filename);
$extension = strtolower($extension);
if (($extension != "jpg") && ($extension != "jpeg") && ($extension != "png") && ($extension != "gif"))
{
echo '<h1>Unknown extension!</h1>';
$errors=1;
}
else
{

$size=filesize($_FILES['image']['tmp_name']);

if ($size > MAX_SIZE*1024)
{
echo '<h1>You have exceeded the size limit!</h1>';
$errors=1;
}

$image_name=time().'.'.$extension;
$newname="images/".$image_name;
$copied = copy($_FILES['image']['tmp_name'], $newname);
if (!$copied)
{
echo '<h1>Copy unsuccessfull!</h1>';
$errors=1;
}}}}

if(isset($_POST['Submit']) && !$errors)
{
echo "<h1>File Uploaded Successfully! Try again!</h1>";
}

?>

<form name="newad" method="post" enctype="multipart/form-data" action="upload.php">
<table>
<tr><td><input type="file" name="image"></td></tr>
<tr><td><input name="Submit" type="submit" value="Upload image"></td></tr>
</table>
</form>

http://CodeBasic.net
AnswerRe: PHP: how to display the image after upload? Pin
Marc Firth17-May-09 23:22
Marc Firth17-May-09 23:22 
QuestionEJB help Pin
crain198114-May-09 8:31
crain198114-May-09 8:31 
AnswerRe: EJB help Pin
Member 194340425-Nov-09 18:42
Member 194340425-Nov-09 18:42 
QuestionJavascript function works only the first time it's called Pin
Bjohnson3314-May-09 8:07
Bjohnson3314-May-09 8:07 
AnswerRe: Javascript function works only the first time it's called Pin
Yusuf14-May-09 8:17
Yusuf14-May-09 8:17 
GeneralRe: Javascript function works only the first time it's called Pin
Bjohnson3314-May-09 9:50
Bjohnson3314-May-09 9:50 
QuestionRE: Quick Search [modified] Pin
CHANDUA14-May-09 1:53
CHANDUA14-May-09 1:53 
AnswerRe: RE: Quick Search Pin
Yusuf14-May-09 6:01
Yusuf14-May-09 6:01 
AnswerRe: RE: Quick Search Pin
Marc Firth17-May-09 23:56
Marc Firth17-May-09 23:56 
QuestionPublishing a Website with VS2005 Pin
scotlandc13-May-09 23:00
scotlandc13-May-09 23:00 
AnswerRe: Publishing a Website with VS2005 Pin
Jeff Circeo14-May-09 5:02
Jeff Circeo14-May-09 5:02 
QuestionPrint iframes content pdf file using javascript in safari browser Pin
bganesan13-May-09 17:48
bganesan13-May-09 17:48 
QuestionASP.NET and Localized Content Pin
ahayw0113-May-09 16:59
ahayw0113-May-09 16:59 
AnswerRe: ASP.NET and Localized Content Pin
Samer Aburabie13-May-09 20:42
Samer Aburabie13-May-09 20:42 
Questiongetting userid on the time of loging in. help Pin
orsini4413-May-09 5:47
orsini4413-May-09 5:47 
AnswerRe: getting userid on the time of loging in. help Pin
Samer Aburabie13-May-09 20:48
Samer Aburabie13-May-09 20:48 
QuestionHelp needed with javascript function for validating textbox data Pin
Brendan Vogt12-May-09 20:32
Brendan Vogt12-May-09 20:32 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.