I have this problem, i have an upload and i would like to replace all spacing with no spacing, the problem is that i have used $abcd = str_replace (" ", "", $abcd);
this should work but i dont know where to put it in or what parameters to use and so on, anyone got some brain storming they want to share please?
the site code, tell me if you want to see the class
<?php
if (isset($_POST['send_billed'])) {
unset($error);
$type = mysql_prep($_POST['type']);
$pris = mysql_prep($_POST['pris']);
$dato_str = mysql_prep($_POST['dato']);
$navn = mysql_prep($_POST['navn']);
if (empty ($pris)) $error[] = "Du skal udfylde pris.";
if (empty ($dato_str)) $error[] = "Du skal udfylde dato.";
if (empty ($navn)) $error[] = "Du skal udfylde navn.";
$dato_array = explode('/',$dato_str);
$dato = mktime(0,0,0,$dato_array[1], $dato_array[0], $dato_array[2]);
if ($_FILES['file']['error']==0){
include("class.billede.php");
$mitBillede = new billede("img/postkort/");
$mitBillede->setBillede($_FILES['file']);
$nytBillede = $mitBillede->upload();
if($nytBillede != ""){
$mitBillede->lavProportionalThumb($nytBillede);
$mitBillede->lavThumb($nytBillede);
}
}
$sql_opretbilled = "insert into galleri (type_id, pris, dato, navn, img_src)
values('$type','$pris','$dato','$navn','$nytBillede')"; mysql_query($sql_opretbilled) or die(mysql_error());
$finished = "finished"; redirect_to("admin.php?side=3&&msg=$finished");
}
?>