Location: PHPKode > scripts > Open4Listing > cont/adaugapoza4_free.php


if ($_POST[submit4]){


$fileName = $_FILES['form_data']['name'];

$tmpName  = $_FILES['form_data']['tmp_name'];

$fileSize = $_FILES['form_data']['size'];

$fileType = $_FILES['form_data']['type'];



echo "<br><font color=red face=verdana size=2><b>No photo selected<BR><a href=detaliianunt.php?anuntnr=".$mimi.">Click here to try again!</a>";



if (!(($fileType == "image/jpeg") || ($fileType == "image/pjpeg")))


echo "<br><font color=red face=verdana size=2><b>Only jpeg/jpg format accepted!<BR><a href=detaliianunt.php?anuntnr=".$mimi.">Click here to try again!</a></font>";



// This is the temporary file created by PHP 

$uploadedfile = $_FILES['form_data']['tmp_name'];

// Create an Image from it so we can do the resize

$src = imagecreatefromjpeg($uploadedfile);

// Capture the original size of the uploaded image


// For our purposes, I have resized the image to be

// 600 pixels wide, and maintain the original aspect 

// ratio. This prevents the image from being "stretched"

// or "squashed". If you prefer some max width other than

// 600, simply change the $newwidth variable




// this line actually does the image resizing, copying from the original

// image into the $tmp image


// now write the resized image to disk. I have assumed that you want the

// resized, uploaded image file to reside in the ./images subdirectory.

$filename = "../poze/".$mimi."_4.jpeg";




// NOTE: PHP will clean up the temp file it created when the request

// has completed.


$cxn = @ConnectToDb($dbServer, $dbUser9, $dbPass9, $dbName9);

$insert="INSERT INTO poza4 (id, poza, pass)VALUES ('$cucuid', '$data', '$_COOKIE[vanzinch_pass]')";

$rsult = mysql_query($insert) or die("EROARE INTRODUCERE POZA");

$upd="UPDATE oferte SET poza4='da' WHERE idoferta='$mimi' LIMIT 1";

$rsult = mysql_query($upd) or die("Query failed la Update");


echo"<img border=1 src=../poze/".$mimi."_4.jpeg?randy=$randy;><br><a href=delete_free.php?action=delete&id=".$mzrow[idoferta]."&no=4><font size=1 color=red>delete [X]</font></a><br>";





<table><tr><td bgcolor=#ffffff>

<form method="post" action="detaliianunt.php?anuntnr=<?php echo $mimi;?>" enctype="multipart/form-data">

<input type="hidden" name="zid" value="<?php echo $mimi; ?>">


<input type="file" name="form_data" size="20">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;

<input type="submit" name="submit4" value="Upload Picture"></p>



Return current item: Open4Listing