0

Hoi hope someone can help.

my question is

preg_replace dosn't work 100%

the code i have

$description = preg_replace('/[^a-zA-Z0-9 .,]/', '', ($_POST));

it works with all strange sings but only not when i use sign - between a string like in test-test.

like the code it must remove everyting exept a-z A-Z 0-9 and ., and blank space

then i have the following error

Warning: imagejpeg() [function.imagejpeg]: Unable to open 'test-test/thumbs/thumb083.jpg' for writing: No such file or directory in C:\xampp\htdocs\voor_server_narrengilde\php\login\create_album_prinzenfuhrungen.php on line 772

Warning: imagejpeg() [function.imagejpeg]: Unable to open 'test-test/slides/083.jpg' for writing: No such file or directory in C:\xampp\htdocs\voor_server_narrengilde\php\login\create_album_prinzenfuhrungen.php on line 773


and here i have the code where the line 772 aand 773 is

if (isset($_POST['senden']))
		{
$mapbeschrijving = preg_replace('/[^a-zA-Z0-9 .,]/', '', ($_POST ['expl'])); 
						
							
						 if(mkdir("$mapbeschrijving", 0777)){ if (mkdir("$mapbeschrijving/$slides", 0777)){ if (mkdir("$mapbeschrijving/$thumbs", 0777)){
						include "includes/album_Prinzenfuhrungen_angemacht.php";
							} }}
							else {
						echo "Er is iets niet goed gegaan.";
								}
								$loc1="$slides/$thename";	
						$loc="$thumbs/$thenames";
						$location1="$mapbeschrijving/$slides/$thename";
						$location="$mapbeschrijving/$thumbs/$thenames";
						imagejpeg($image_p1,$location, 100);
						imagejpeg($img,$location1, 100);
						unlink($thename);
											
						include "includes/iffile_Prinzenfuhrungen_exist.php";			
						}

line 12 is line 772 and line 13 is line 773

but it's only when i use - between strings

thanks john

2
Contributors
3
Replies
5
Views
5 Years
Discussion Span
Last Post by johnnyd1963
0

Works fine for me. What version of PHP are you using.

What happens when you try this:

$mapbeschrijving = preg_replace('/-|[^a-zA-Z0-9 .,]/', '', $_POST['expl']);
0

i use the latest version i know it's strange
but i have it only where i create a folder for my images

0

i have found the problem

there was a mistype somewhere in the php code of my site.

i checked everything about 1400 rules.

i was wondering wy it not worked

thanks for your help

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.