1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

Form Help

Discussion in 'PHP' started by dannbkk, Aug 12, 2007.

  1. #1
    I have put together a form but is only submitting when all 4 photos have been submited. If i want to browse and submit 1 photo it wont go through. I dont see where in my code i need to edit this?

    <?php
    
    require_once('db.inc.php');
    
    include("upload.class.php");
    
    
    
    if (isset($_POST['submit'])){
    
    	
    
    	//change all the post to variables
    
    	$name=$_POST['name'];
    
    	$address=$_POST['address'];
    
    	$city=$_POST['city'];
    
    	$state=$_POST['state'];
    
    	$country=$_POST['country'];
    
    	$zip=$_POST['zip'];
    
    	$phone=$_POST['phone'];
    
    	$email=$_POST['email'];
    
    	$paypal_20_photo=$_POST['paypal'];
    	
    	$paypal_40_photo=$_POST['paypal'];
    	
    	$paypal_60_photo=$_POST['paypal'];
    
    
    
    
    
    	if ($name=="" || $address=="" || $city=="" || $state=="" || $country=="" || $zip=="" || $phone=="" || $email=="" || $paypal_20_photo="" || $paypal_40_photo="" || $paypal_60_photo=""){
    
    		$errors .= "<span class=\"red\">All fields marked with '*' are required to be filled up.</span>\n";
    
    		$error = true;
    
    	}
    
    
    
    	if(!eregi("^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,3})$",$email)){
    
    		$errors .= "<span class=\"red\">Email is not valid.</span>\n";
    
    		$error = true;
    
    	}
    
    
    
    	$MyObject = new upload($_FILES['imagefile']);
    
    	if ($MyObject->uploaded) {
    
    		$MyObject->file_new_name_body   = $name."image".md5(mktime()*rand());
    
    		$MyObject->file_safe_name 		= true;
    
    		$MyObject->file_max_size        = 1048576;
    
    		$MyObject->jpeg_quality 		= 80;
    
    		$MyObject->process("../files/");
    
    			if ($MyObject->processed) {
    
    				$image = $MyObject->file_dst_name;
    
    				$MyObject->clean();
    
    			} else {
    
    				$error = true;
    
    				$errors .= $MyObject->error;
    
    			}
    
    	} else {
    
    		$error = true;
    
    		$errors .= $MyObject->error;
    
    	}
    
    
    
    	$MyObject = new upload($_FILES['imagefile2']);
    
    	if ($MyObject->uploaded) {
    
    		$MyObject->file_new_name_body   = $name."image2".md5(mktime()*rand());
    
    		$MyObject->file_safe_name 		= true;
    
    		$MyObject->file_max_size        = 1048576;
    
    		$MyObject->jpeg_quality 		= 80;
    
    		$MyObject->process("../files/");
    
    			if ($MyObject->processed) {
    
    				$image2 = $MyObject->file_dst_name;
    
    				$MyObject->clean();
    
    			} else {
    
    				$error = true;
    
    				$errors .= $MyObject->error;
    
    			}
    
    	} else {
    
    		$error = true;
    
    		$errors .= $MyObject->error;
    
    	}
    	
    	$MyObject = new upload($_FILES['imagefile3']);
    
    	if ($MyObject->uploaded) {
    
    		$MyObject->file_new_name_body   = $name."image3".md5(mktime()*rand());
    
    		$MyObject->file_safe_name 		= true;
    
    		$MyObject->file_max_size        = 1048576;
    
    		$MyObject->jpeg_quality 		= 80;
    
    		$MyObject->process("../files/");
    
    			if ($MyObject->processed) {
    
    				$image2 = $MyObject->file_dst_name;
    
    				$MyObject->clean();
    
    			} else {
    
    				$error = true;
    
    				$errors .= $MyObject->error;
    
    			}
    
    	} else {
    
    		$error = true;
    
    		$errors .= $MyObject->error;
    
    	}
    	
    	
    	$MyObject = new upload($_FILES['imagefile4']);
    
    	if ($MyObject->uploaded) {
    
    		$MyObject->file_new_name_body   = $name."image4".md5(mktime()*rand());
    
    		$MyObject->file_safe_name 		= true;
    
    		$MyObject->file_max_size        = 1048576;
    
    		$MyObject->jpeg_quality 		= 80;
    
    		$MyObject->process("../files/");
    
    			if ($MyObject->processed) {
    
    				$image2 = $MyObject->file_dst_name;
    
    				$MyObject->clean();
    
    			} else {
    
    				$error = true;
    
    				$errors .= $MyObject->error;
    
    			}
    
    	} else {
    
    		$error = true;
    
    		$errors .= $MyObject->error;
    
    	}
    
    
    
    	if($error == true){
    
    		$errors = nl2br($errors);
    
    		//exit;
    
    	}
    
    
    
    	if($error == false){
    
    		//send the email
    
    		$title="(Buy Photo/Upload)";
    
    		$youremail="myemail@email.com";
    
    		$body="Data:<br><br>Name: $name<br>Email: $email<br>Address: $address<br>Zip: $zip<br>City: $city<br>State: $state<br>Country: $country<br>Phone: $phone<br>Cheque: $cheque<br>electronic_transfer: $electronic_transfer<br>Paypal $33 1 photo: $paypal_20_photo<br>Paypal $44 2 photo: $paypal_40<br>Paypal $55 3 photo: $paypal_60_photo<br>Quote: $paypal_80_photo
    		
    		<br><BR>
    
    		Image1: www.mywebsite.com/files/$image<br>
    		
    		Image2: www.mywebsite.com/files/$image2<br>
    				
    		Image3: www.mywebsite.com/files/$image3<br>
    
    		Image4: www.mywebsite.com/files/$image4<br>";
    
    		mail($youremail,$title,$body,"From:$email\r\nReply-to: $email\r\nContent-type: text/html; charset=us-ascii") or die("oops! mail is not sent.");
    
    		$x5=1;
    
    		
    
    		$query = "INSERT INTO application (id, name, address, city, state, country, zip, phone, email, image, image2, image3, image4, paypal_20_photo) 
    
    						VALUES (NULL, '$name', '$address', '$city', '$state', '$country', '$zip', '$phone', '$email', '$image', '$image2', '$image3', '$image4', '$paypal')";
    
    		
    
    		
    
    		
    
    		mysql_query($query) or die('Error '.mysql_error().' ,query failed'); 
    
    		
    
    		header("Location: ?sendpaypal=send&paypal=".$_POST['paypal']);
    
    	}
    
    
    
    }// close
    
    
    
    if($_GET['sendpaypal']){
    
    
    		echo "Thank you, we will get back to you as soon as possible.<BR><BR>";
    
    	echo "<BR><BR><B>Please wait white we transfer you to paypal.com</b><BR><BR>";
    
    	echo '<form id="submitpaypal" name="submitpaypal" method="post" action="https://www.paypal.com/cgi-bin/webscr">';
    
    
    
    switch($_GET['paypal']){
    
    	case"1":
    
    	echo'<input type="hidden" name="cmd" value="_s-xclick" />
    
    		<input name="submit" type="image" id="submit" src="https://www.paypal.com/en_US/i/btn/x-click-but20.gif" alt="Make payments with PayPal"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hzGCAZowggGWAgEBMIGUMIGOMQswCQYDVQQGEwJVUzELMAkGA1UECBMCQ0ExFjAUBgNVBAcTDU1vdW50YWluIFZpZXcxFDASBgNVBAoTC1BheVBhbCBJbmMuMRMwEQYDVQQLFApsaXZlX2NlcnRzMREwDwYDVQQDFAhsaXZlX2FwaTEcMBoGCSqGSIb3DQEJARYNcmVAcGF5cGFsLmNvbQIBADAJBgUrDgMCGgUAoF0wGAYJKoZIhvcNAQkDMQsGCSqGSIb3DQEHATAcBgkqhkiG9w0BCQUxDxcNMDcwNzA5MDM0MTQ4WjAjBgkqhkiG9w0BCQQxFgQUUjOrmbYnu/2ZLlU+uECkoqcYMNEwDQYJKoZIhvcNAQEBBQAEgYCiHH0WF/93tYqvFrV+GIIgF+9m9HEvdDClO4QXF86Ha2CIz879iRWFdvipPSf2x4d8J+NB/vEpFROyKg07RK4U8/7HGgUuoWwnqX0DoXDrK6gPgVW+TEXHt9qYFkzWxMjbUsV/Xc1QvWqkcvyh/Qx65aodkpulKWkSP1Q5zXKsIA==-----END PKCS7-----" />
    
    		';
    
    	break;
    
    	case"2":
    
    	echo'<input type="hidden" name="cmd" value="_s-xclick" />
    
    <input type="image" src="https://www.paypal.com/en_US/i/btn/x-click-but20.gif" border="0" name="submit2" alt="Make payments with PayPal" />
    
    <input type="hidden" name="encrypted" value="-----BEGIN PKCS7-----JBgNVBAYTAlVTMQswCQYDVQQIEwJDQTEWMBQGA1UEBxMNTW91bnRhaW4gVmlldzEUMBIGA1UEChMLUGF5UGFsIEluYy4xEzARBgNVBAsUCmxpdmVfY2VydHMxETAPBgNVBAMUCGxpdmVfYXBpMRwwGgYJKoZIhvcNAQkBFg1yZUBwYXlwYWwuY29tMB4XDTA0MDIxMzEwMTMxNVoXDTM1MDIxMzEwMTMxNVowgY4xCzAJBgNVBAYTAlVTMQswCQYDVQQIEwJDQTEWMBQGA1UEBxMNTW91bnRhaW4gVmlldzEUMBIGA1UEChMLUGF5UGFsIEluYy4xEzARBgNVB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AQkDMQsGCSqGSIb3DQEHATAcBgkqhkiG9w0BCQUxDxcNMDcwNzA5MDc1ODEzWjAjBgkqhkiG9w0BCQQxFgQUy2TdxncKA5+c4Gz+EB2e8u6dmhEwDQYJKoZIhvcNAQEBBQAEgYCsi32rCmEpGaVijU2Eqc26nuPPeqM49A6uwWYE61a54HCObsqj9zp0Lf5aGirMnjUgJWRgzyL7BuaOUVCjnlM9RUgJDvK+MrG42VwKZ0UzMo7Q7bKfWoI3wR5dY1pnXaIGsXLxXiO0IVXCKXK6hwn4eWF0EGzUpmimQ1DAA4I0tg==-----END PKCS7-----" />
    
    ';
    
    	break;
    
    	case"3":
    
    	echo'<input type="hidden" name="cmd" value="_s-xclick" />
    
    <input type="image" src="https://www.paypal.com/en_US/i/btn/x-click-but20.gif" border="0" name="submit6" alt="Make payments with PayPal" />
    
    <input type="hidden" name="encrypted" value="-----BEGIN PKCS7-----b26dyxbOEjq8K0cqp+0MgLxHhBvOCJiYclZKgwNUKGYgvMAqWy3wLUMsZvkWNRi5JDCoIIDhzCCA4MwggLsoAMCAQICAQAwDQYJKoZIhvcNAQEFBQAwgY4xCzAJBgNVBAYTAlVTMQswCQYDVQQIEwJDQTEWMBQGA1UEBxMNTW91bnRhaW4gVmlldzEUMBIGA1UEChMLUGF5UGFsIEluYy4xEzARBgNVBAsUCmxpdmVfY2VydHMxETAPBgNVBAMUCGxpdmVfYXBpMRwwGgYJKoZIhvcNAQkBFg1yZUBwYXlwYWwuY29tMB4XDTA0MDIxMzEwMTMxNVoXDTM1MDIxMzEwMTMxNVowgY4xCzAJBgNVBAYTAlVTMQswCQYDVQQIEwJDQTEWMBQGA1UEBxMNTW91bnRhaW4gVmlldzEUMBIGA1UEChMLUGF5UGFsIEluYy4xEzARBgNVBAsUCmxpdmVfY2VydHMxETAPBgNVBAMUCGxpdmVfYXBpMRwwGgYJKoZIhvcNAQkBFg1yZUBwYXlwYWwuY29tMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQ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ZIhvcNAQEBBQAEgYAcWiITPcsUqgPCOmGlNRB2alA72TKNx+qpARAwDIbOGv+FIipIleLuKKPWKsKzUayLLukSaalMPHHrc1KotbyY6lp6oChFu+nJ2r0cee9VotNmQMTuP5I7wlZvmkWMv5yQQJUjbj9+m/GnB957EwfoFrkOoGTbmDcyU+kODOlG3w==-----END PKCS7-----" />
    
    ';
    
    	break;
    
    	case"4":
    
    	echo'<input type="hidden" name="cmd" value="_s-xclick" />
    
    <input type="image" src="https://www.paypal.com/en_US/i/btn/x-click-but20.gif" border="0" name="submit7" alt="Make payments with PayPal" />
    
    <input type="hidden" name="encrypted" value="-----BEGIN PKCS7-----MQswCQYDVQQIEwJDQTEWMBQGA1UEBxMNTW91bnRhaW4gVmlldzEUMBIGA1UEChMLUGF5UGFsIEluYy4xEzARBgNVBAsUCmxpdmVfY2VydHMxETAPBgNVBAMUCGxpdmVfYXBpMRwwGgYJKoZIhvcNAQkBFg1yZUBwYXlwYWwuY29tMB4XDTA0MDIxMzEwMTMxNVoXDTM1MDIxMzEwMTMxNVowgY4xCzAJBgNVBAYTAlVTMQswCQYDVQQIEwJDQTEWMBQGA1UEBxMNTW91bnRhaW4gVmlldzEUMBIGA1UEChMLUGF5UGFsIEluYy4xEzARBgNVBAsUCmxpdmVfY2VydHMxETAPBgNVBAMUCGxpdmVfYXBpMRwwGgYJKoZIhvcNAQkBFg1yZUBwYXlwYWwuY29tMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDBR07d/ETMS1ycjtkpkvjXZe9k+6CieLuLsPumsJ7QC1odNz3sJiCbs2wC0nLE0uLGaEtXynIgRqIddYCHx88pb5HTXv4SZeuv0Rqq4+axW9PLAAATU8w04qqjaSXgbGLP3NmohqM6bV9kZZwZLR/klDaQGo1u9uDb9lr4Yn+rBQIDAQABo4HuMIHrMB0GA1UdDgQWBBSWn3y7xm8XvVk/UtcKG+wQ1mSUazCBuwYDVR0jBIGzMIGwgBSWn3y7xm8XvVk/UtcKG+wQ1mSUa6GBlKSBkTCBjjELMAkGA1UEBhMCVVMxCzAJBgNVBAgTAkNBMRYwFAYDVQQHEw1Nb3VudGFpbiBWaWV3MRQwEgYDVQQKEwtQYXlQYWwgSW5jLjETMBEGA1UECxQKbGl2ZV9jZXJ0czERMA8GA1UEAxQIbGl2ZV9hcGkxHDAaBgkqhkiG9w0BCQEWDXJlQHBheXBhbC5jb22CAQAwDAYDVR0TBAUwAwEB/zANBgkqhkiG9w0BAQUFAAOBgQCBXzpWmoBa5e9fo6ujionW1hUhPkOBakTr3YCDjbYfvJEiv/2P+IobhOGJr85+XHhN0v4gUkEDI8r2/rNk1m0GA8HKddvTjyGw/XqXa+LSTlDYkqI8OwR8GEYj4efEtcRpRYBxV8KxAW93YDWzFGvruKnnLbDAF6VR5w/cCMn5hzGCAZowggGWAgEBMIGUMIGOMQswCQYDVQQGEwJVUzELMAkGA1UECBMCQ0ExFjAUBgNVBAcTDU1vdW50YWluIFZpZXcxFDASBgNVBAoTC1BheVBhbCBJbmMuMRMwEQYDVQQLFApsaXZlX2NlcnRzMREwDwYDVQQDFAhsaXZlX2FwaTEcMBoGCSqGSIb3DQEJARYNcmVAcGF5cGFsLmNvbQIBADAJBgUrDgMCGgUAoF0wGAYJKoZIhvcNAQkDMQsGCSqGSIb3DQEHATAcBgkqhkiG9w0BCQUxDxcNMDcwNzA5MDM0OTUzWjAjBgkqhkiG9w0BCQQxFgQUvycSJ2mKpNnd2TnN19wSqXUvPL8wDQYJKoZIhvcNAQEBBQAEgYAqOvP9U+R1KRt+A+gV1BSyo4AJJom9eaGZ3pTm6CbSVUESdOQm85SFptrBE6FY1HR/uKQDtq1vpO/Xn8k2CTWkHzzKsf/ouRokaBpNZzQIIxMLpEdPq688Ax67EjdzAco7oTs3HAb21tpg4xHjTgBcxHCZD+ksOZ09o4KNaF6stg==-----END PKCS7-----" />
    
    ';
    
    	break;
    
    	case"5":
    
    	echo'<input type="hidden" name="cmd" value="_s-xclick" />
    
    <input type="image" src="https://www.paypal.com/en_US/i/btn/x-click-but20.gif" border="0" name="submit5" alt="Make payments with PayPal" />
    
    <input type="hidden" name="encrypted" value="-----BEGIN PKCS7-----MQswCQYDVQQIEwJDQTEWMBQGA1UEBxMNTW91bnRhaW4gVmlldzEUMBIGA1UEChMLUGF5UGFsIEluYy4xEzARBgNVBAsUCmxpdmVfY2VydHMxETAPBgNVBAMUCGxpdmVfYXBpMRwwGgYJKoZIhvcNAQkBFg1yZUBwYXlwYWwuY29tMB4XDTA0MDIxMzEwMTMxNVoXDTM1MDIxMzEwMTMxNVowgY4xCzAJBgNVBAYTAlVTMQswCQYDVQQIEwJDQTEWMBQGA1UEBxMNTW91bnRhaW4gVmlldzEUMBIGA1UEChMLUGF5UGFsIEluYy4xEzARBgNVBAsUCmxpdmVfY2VydHMxETAPBgNVBAMUCGxpdmVfYXBpMRwwGgYJKoZIhvcNAQkBFg1yZUBwYXlwYWwuY29tMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDBR07d/ETMS1ycjtkpkvjXZe9k+6CieLuLsPumsJ7QC1odNz3sJiCbs2wC0nLE0uLGaEtXynIgRqIddYCHx88pb5HTXv4SZeuv0Rqq4+axW9PLAAATU8w04qqjaSXgbGLP3NmohqM6bV9kZZwZLR/klDaQGo1u9uDb9lr4Yn+rBQIDAQABo4HuMIHrMB0GA1UdDgQWBBSWn3y7xm8XvVk/UtcKG+wQ1mSUazCBuwYDVR0jBIGzMIGwgBSWn3y7xm8XvVk/UtcKG+wQ1mSUa6GBlKSBkTCBjjELMAkGA1UEBhMCVVMxCzAJBgNVBAgTAkNBMRYwFAYDVQQHEw1Nb3VudGFpbiBWaWV3MRQwEgYDVQQKEwtQYXlQYWwgSW5jLjETMBEGA1UECxQKbGl2ZV9jZXJ0czERMA8GA1UEAxQIbGl2ZV9hcGkxHDAaBgkqhkiG9w0BCQEWDXJlQHBheXBhbC5jb22CAQAwDAYDVR0TBAUwAwEB/zANBgkqhkiG9w0BAQUFAAOBgQCBXzpWmoBa5e9fo6ujionW1hUhPkOBakTr3YCDjbYfvJEiv/2P+IobhOGJr85+XHhN0v4gUkEDI8r2/rNk1m0GA8HKddvTjyGw/XqXa+LSTlDYkqI8OwR8GEYj4efEtcRpRYBxV8KxAW93YDWzFGvruKnnLbDAF6VR5w/cCMn5hzGCAZowggGWAgEBMIGUMIGOMQswCQYDVQQGEwJVUzELMAkGA1UECBMCQ0ExFjAUBgNVBAcTDU1vdW50YWluIFZpZXcxFDASBgNVBAoTC1BheVBhbCBJbmMuMRMwEQYDVQQLFApsaXZlX2NlcnRzMREwDwYDVQQDFAhsaXZlX2FwaTEcMBoGCSqGSIb3DQEJARYNcmVAcGF5cGFsLmNvbQIBADAJBgUrDgMCGgUAoF0wGAYJKoZIhvcNAQkDMQsGCSqGSIb3DQEHATAcBgkqhkiG9w0BCQUxDxcNMDcwNzA5MDM0NTQxWjAjBgkqhkiG9w0BCQQxFgQUYTmiTGR+Y5x1IOPtdP5mZbCaLQowDQYJKoZIhvcNAQEBBQAEgYB50euqy4YANw38oNqpAlhjcc5ljFw8Y9XmCRmiKQmhfX56LtwCNkvWREQ5VGWutt7b9k8vFcs34Qi14tE9elx8pbQC/uMV+2BEgavMZFntNzpbQp5V9lawKunk4PxHIedvRASgzFSaR7PXMeF07FTiXMWClrKLmANEUKx86Bk3Aw==-----END PKCS7-----" />
    
    ';
    
    	break;
    
    	case"6":
    
    	echo'<input type="hidden" name="cmd" value="_s-xclick" />
    
    <input type="image" src="https://www.paypal.com/en_US/i/btn/x-click-but20.gif" border="0" name="submit4" alt="Make payments with PayPal" />
    
    <input type="hidden" name="encrypted" value="-----BEGIN PKCS7-----MQswCQYDVQQIEwJDQTEWMBQGA1UEBxMNTW91bnRhaW4gVmlldzEUMBIGA1UEChMLUGF5UGFsIEluYy4xEzARBgNVBAsUCmxpdmVfY2VydHMxETAPBgNVBAMUCGxpdmVfYXBpMRwwGgYJKoZIhvcNAQkBFg1yZUBwYXlwYWwuY29tMB4XDTA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C1BheVBhbCBJbmMuMRMwEQYDVQQLFApsaXZlX2NlcnRzMREwDwYDVQQDFAhsaXZlX2FwaTEcMBoGCSqGSIb3DQEJARYNcmVAcGF5cGFsLmNvbQIBADAJBgUrDgMCGgUAoF0wGAYJKoZIhvcNAQkDMQsGCSqGSIb3DQEHATAcBgkqhkiG9w0BCQUxDxcNMDcwNzA5MDM0NDMzWjAjBgkqhkiG9w0BCQQxFgQUMO98bJJd2V3TCQu8u0bhr7piw8cwDQYJKoZIhvcNAQEBBQAEgYBdy/CWH6iQhD7MSjE1lcWgca1I9MltuAB4P/3X7sXm5kuWalVk8dk/gJ2uKqEaKXn37CVQCTbuwhiCl6epfwDfaZsA2gJhhue5x2HkRjwxPBEt1WwugxdnI0LeKNZXnvZAeNeIMoZ3XlkFdCRLJGrtXq9iFhy1gQ1azcCfYcA1OQ==-----END PKCS7-----" />
    
    ';
    
    break;
    
    }
    
    echo "</form>
    
    			<script language='JavaScript' type='text/javascript'>
    
    				<!--
    
    				document.getElementById('submitpaypal').submit();
    
    				//-->
    
    			</script>";
    
    	
    
    	echo '</div></body></html>';
    
    	exit;
    
    }
    
    
    
    ?>
    
    PHP:

    SEMrush
     
    dannbkk, Aug 12, 2007 IP
    SEMrush
  2. killerj

    killerj Active Member

    Messages:
    765
    Likes Received:
    34
    Best Answers:
    0
    Trophy Points:
    95
    #2
    you might want to put the number of photos to be uploaded in a loop .
    for example Ask the user in a form field
    How many photos you want to upload ? [Max 4.]
    get the variable
    $maxpic = $_POST['maximage'] ; 
    PHP:
    then delete 4 instances of these codes
    
    $MyObject = new upload($_FILES['imagefile']);
    
        if ($MyObject->uploaded) {
    
            $MyObject->file_new_name_body   = $name."image".md5(mktime()*rand());
    
            $MyObject->file_safe_name     = true;
    
            $MyObject->file_max_size        = 1048576;
    
            $MyObject->jpeg_quality         = 80;
    
            $MyObject->process("../files/");
    
                if ($MyObject->processed) {
    
                    $image = $MyObject->file_dst_name;
    
                    $MyObject->clean();
    
                } else {
    
                    $error = true;
    
                    $errors .= $MyObject->error;
    
                }
    
        } else {
    
            $error = true;
    
            $errors .= $MyObject->error;
    
        }
    
    PHP:
    and replace it by this
    
    for($i=1; $i< $maxpic ;$i++)
    {
    $MyObject = new upload($_FILES['imagefile$i']);
    
        if ($MyObject->uploaded) {
    
            $MyObject->file_new_name_body   = $name."image".md5(mktime()*rand());
    
            $MyObject->file_safe_name     = true;
    
            $MyObject->file_max_size        = 1048576;
    
            $MyObject->jpeg_quality         = 80;
    
            $MyObject->process("../files/");
    
                if ($MyObject->processed) {
    
                    $image = $MyObject->file_dst_name;
    
                    $MyObject->clean();
    
                } else {
    
                    $error = true;
    
                    $errors .= $MyObject->error;
    
                }
    
        } else {
    
            $error = true;
    
            $errors .= $MyObject->error;
    
        }
    
    PHP:

    good luck
    P.S : I haven't tested nor debugged this code. It will be left to you .
    My intentions were to provide you with an idea
     
    killerj, Aug 13, 2007 IP
  3. dannbkk

    dannbkk Well-Known Member

    Messages:
    1,403
    Likes Received:
    19
    Best Answers:
    0
    Trophy Points:
    120
    #3
    dannbkk, Aug 24, 2007 IP