Search the Community
Showing results for tags 'white space'.
-
Hello, i have the following code: php 5, ms server 2008, iis 7 I pass this script a csv list of file paths like so... ,C:\path\path\path\file.name,C:\path\path\anotherFile.name,C:\path\path\path\file3.file (yes there is a leading comma in the string for some reason..) $files = $_POST['files']; $files = explode(',', $files) foreach($files as $filename){ if(file_exists($filename)){ echo '":' . $filename .':"Does Exist<br />'; } else { echo 'Sorry ":' . $filename . ':" Does Not Exist<br />'; } } My problem: the first file path shows it exists and there is no white space in the string, all the file paths after the first one show like such: ":C:\path\path\path\file.name:" Does Exist // 1st path (good) ": C:\path\path\anotherFile.name :" Does Not Exist ": C:\path\path\file3.file:" Does Not Exist pleas note... i put the ": and :" in there to show that there is indeed a white space character in front of and behind the filepaths. EXCEPT for the last path.. there is no trailing white space there. Please explain why you think the white space is being added to these and what i can do to get rid of it. thanks, dogdaynoon
-
I've been trying to solve this for the past 2 days! Please help. I get this message while trying to validate the code in W3c valifation service. bad value %20images/image_name%20 for attribute src on element img: Whitespace in path component. Use %20 in place of spaces. There is no white space in the lines below. OR is there? I have put %20 in all white spaces that I could find with no effect. if (is_file(MM_UPLOADPATH . $row['picture']) . filesize(MM_UPLOADPATH . $row['picture']) > 0){echo'%20<a href="pictures.php">%20<img src="%20' . MM_UPLOADPATH . $row['picture'] . '%20" alt="sevenoaks latest pic" style="width:75px; maxheight:110px; margin:5px; padding:5px;"></a>'; if (is_file(MM_UPLOADPATH . $row['picture']) . filesize(MM_UPLOADPATH . $row['picture']) > 0){echo'%20<a href="pictures.php">%20<img src="%20' . MM_UPLOADPATH . $row['picture'] . '%20" alt="sevenoaks latest pic" style="width:75px; maxheight:110px; margin:5px; padding:5px;"></a>';
- 8 replies
-
- php5
- white space
-
(and 1 more)
Tagged with: