File-handling; Special Characters In Folder Names?
I am using rename() to move a file from one folder to another with php.It works fine with folders which don't have the swedish å ä ö characters involved.Is there any way around this? (except for changing the folder names to something without special chars)
View 3 Replies (Posted: Feb 7 10 at 13:16)
Sponsored Links:
Related Forum Messages:
Special Characters In File/folder Names On Linux; Rename Function Not Working?
I am using a function Rename() (php) to move some images from one folder to another. The destination folder has special characters in them.However, when doing this on the server I get the error that the folder isn't found with the name. And in that error, the folder names special characters are replaced with Squares: Warning: rename(../temp_images/668635375_1.jpg,../ad_images/B�tar/thumbs/668635375_1.jpg) [function.rename]: No such file or directory in /var/www/etc.... It works on my local machine though (windows xp)
Posted: Jun 3 10 at 10:06
View 2 Replies!
View Related
Removing Special Characters If They Are Not Part Of The Tag Names?
I am trying to edit html code using regular expressions. Html code is something like this: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> <title></title> [Code]..... I woud like to replace all the special charecters with entities nut not if they are part of the tag names. For example in the quates woud not be replaced but in "egsge" they woud be.
Posted: May 9 at 9:01
View 2 Replies!
View Related
Regex For Names With Special Characters (Unicode)?
I have read about regex all day now, and still don't understand it properly. What i'm trying to do is validate a name, but the functions i can find for this on the internet only use [a-zA-Z], leaving characters out that i need to accept to.I basically need a regex that checks that the name is at least two words, and that it does not contain numbers or special characters like however the words can contain characters likeand so on...An example of an accepted name would be: " "André Svenson"An non-accepted name would be: "Hans", "H4nn3 Andersen" or "Martin Henriksen!"If it matters i use the javascript .match() function client side and want to use php's preg_replace() only "in negative" server side. (removing non-matching characters).But as the page from LightWing's answer suggests, i'm unable to find anything about unicode support for javascript, so i ended up with half a solution for the client side, just checking for at least two words and minimum 5 characters like this: if(name.match(/S+/g).length >= minWords && name.length >= 5) { //valid } An alternative would be to specify all the unicode characters as suggested in shifty's answer, which i might end up doing something like, along with the solution above, but it is a bit unpractical though.
Posted: May 11 at 11:08
View 4 Replies!
View Related
Variable / Function / Class Names Using Special Characters?
I understand that the underscore _ is an acceptable character for naming variables / functions / classes etc. However I was wondering if there are any other special characters which can be used. I tested out a few with no luck and have assumed for a long time that there are not, however I figured I would see if anyone else knows for certain. This would be mostly for aesthetic purposes, however I imagine a special character naming convention would be useful when working with other developers to define value types etc.
Posted: Jun 15 at 18:08
View 4 Replies!
View Related
DOMXpath->query() Returns Weird Characters When Source File Has Special Characters?
I am scraping HTML and XML information. When the HTML is queried with DOMXpath->query() weird characters are returned when there are special characters. For an example, the characters are returned when there is a ” character. I have the database collation set correctly, and that's not the problem. The sites I am scraping from have improper (unescaped) entities, and it seems that DOMXpath isn't flexible enough to capture these characters correctly. I don't want junk in my database.Is there a way to fix this, or should I just scrape things using a RegExp instead of using the DOMXpath. Wouldn't scraping with a RegExp be faster anyway? Would I avoid messed up characters if I do it this way? I want to see if there is a way to fix my problem before rewriting portions of my scripts.
Posted: May 17th, 2009, 01:35 AM
View 5 Replies!
View Related
Parsing Out A File Using Special Characters
I am creating a site where someone would enter data into a few text boxes, with the potential for them to be fairly long. I am therefore saving them into a text file instead of a database. With these, there is a potential for someone to use the enter key in these boxes, therefore making it very difficult to just parse it out by line. I am currently trying to figure out how to parse it by special characters (or groups of characters such as "%%$$%%" or something that noone would ever type, on purpose or by accident) I was wondering if there was a way to parse this out by these special characters, or if there was a way to save those line returns that the people enter as something other than a line return.
Posted: April 19, 2007, 03:51:06 PM
View 8 Replies!
View Related
Upload File With Special Characters
I have an upload script that works great except for when a file with special characters is used. If eric'sfile.txt is uploaded it will do this eric'sfile.txt is there a way to have it remove the special characters instead? //path to storage $storage = 'Files'; //path name of file for storage $uploadfile = "$storage/" . basename( $_FILES['Filedata']['name'] ); //if the file is moved successfully if ( move_uploaded_file( $_FILES['Filedata']['tmp_name'] , $uploadfile ) ) { echo( '1 ' . $_FILES['Filedata']['name']); //file failed to move }else{ echo( '0'); }
Posted: October 18, 2007, 01:43:31 PM
View 6 Replies!
View Related
File Name With Special Characters Like Not Found
I have a folder on my website just for random files. I used php opendir to list all the files so i can style the page a bit. But the files that I uploaded with special characters in them don't work. when i click on them it says the files are not found. but when i check the directory, the files are there. seems like the links are wrong. how i can get a correct link to these file names with special characters in them?
Posted: Oct 16 09 at 21:15
View 2 Replies!
View Related
Reading File Names From A Folder?
have a bunch of uploaded files in a folder. Now I want to be able to get the names of these files that are stored in the folder using PHP so that can I create direct links to each file from my page. ie can PHP read the names of files from a folder?
Posted: Mar 15th, 2006
View 3 Replies!
View Related
Use Special Characters Or Spaces In The Video File.
Ok this is my problem. Im running a website that uses a youtube clone script i bought the code it all works, the problem now is when i wanna upload a video it doesn't let me use special characters or spaces in the video file. For example my first - video.wmv wont work myfirst-video.wmv will work
Posted: 06-26-2007, 07:11 PM
View 14 Replies!
View Related
Reading Data From File Special Characters?
My previous question and this question both are related a bit. please have a look at my previous question I did not found any other way to unserialize the data so coming with the string operation.I am able to get the whole content from file but not able to get the specific string from this content. I want to search a specific string from these content but function stop working when the reach at first special character in the string. If I am searching something found before the special character the works properly.String operation function of PHP not working properly when the encounter first special character in the string and stop processing immediately, Hence they does not give me the correct output. Originally they looks like (^@) :"Mage_Core_Model_Message_Collection" but when I did echo they are display as ? Here is the code what I tried $file='/var/www/html/products/var/session/sess_ciktos8icvk11grtpkj3u610o3'; $contents=file_get_contents($file);[code].... I changed the default_charset to iso-8859-1 and also utf-8 but not working with both
Posted: Jan 15 at 10:16
View 1 Replies!
View Related
Read File Names From Folder Only Keep Files With .iso Extention?
I have a script that gets a string from a config file and based on that string grabs the file names of a folder. I now only need the iso files. Not sure if the best way is to check for the .iso string or is there another method? <?php // Grab the contents of the "current.conf" file, removing any linebreaks. $dirPath = trim(file_get_contents('current.conf')).'/'; $fileList = scandir($dirPath); [Code]....
Posted: Mar 29 at 19:36
View 3 Replies!
View Related
Generate Short And Unique File/folder Names?
The criteria is basically this: folders will exist for about 24-48hrs folders names can not be readily guessable by a user (if used in a URL) folder names should be short 5-15 chars Initial thoughts: [code].. When uploading a file, I basically want to keep the unique file name as named by the uploader, so to avoid any naming collision I would like to put it in a uniquely named directory
Posted: Apr 30 09 at 22:21
View 8 Replies!
View Related
TCPDF HTML With Special Characters Displays Empty PDF File
I am using TCPDF Library Version: 5.9.011. I am trying to execute HTML layout as PDF. For which I tried with example provide with the site $html = '<h1>HTML Example</h1> <h2>List</h2> Some special characters: < € € € & è è © > \slash \\double-slash \\\triple-slash '; // output the HTML content $pdf->writeHTML($html, true, false, true, false, ''); //Close and output PDF document $pdf->Output('example_006.pdf', 'I'); Apparently found that generated PDF only default header and footer with middle content blank. However if I remove special characters like: [Code]... PDF gets its middle content as specified in $html Am I missing something or doing something wrong?
Posted: Nov 10 10 at 6:40
View 2 Replies!
View Related
Sorting An Array Of Folder Names For Displaying The Content Of A Folder?
I have wrote a function for getting all the subfolders of a folder. It also has the option of going the an upper level and displaying the folders....much like a file manager but it works only for folders and has a restriction to not go upper than the base folder so to prevent users from browsing the entire hard disk. am returning the result as a json object to be put in a div. My problem is this: On my windows box (using wamp) the folder "Up one Level" is always displayed on top of the folder list. When I upload it on my website it doesn't display on top but somewhere in the middle. I have wrote a function ( fixArray($array) ) to correct this...but it doesn't seem to work. The entire solution for this feature is provided so please help to make it work and for others to benefit from it.Just to mention: there is nothing wrong in the JS code. JSON object is parsed in the order it is sent by the php file. function fixPath($path) { $path = str_replace('/../', '/', $path); $path = str_replace('/./', '/', $path); [code]...
Posted: Jun 30 10 at 22:30
View 2 Replies!
View Related
Read A Folder And Split Sub-Folder Names Into MySQL Inserts?
I have a folder named "Comics" and sub folders in that directory with the names of comics + the issue Example: /Comics <-- Main Folder /Amazing Spider-Man 129 <-- Sub Folder /Hellblazer 100 <-- Sub Folder /Zatanna 01 <-- Sub Folder Now what i want to do is scan the Comics directory and output each folder name as a mysql insert query. The actual folder name needs to be seperated as "Comic Name" & "Comic Issue".Example Querymysql_query("INSERT INTO comics (name, issue) VALUES ('Amazing Spider-Man', '129')");I got this far and now i want to add a query check to see if the comic exists or not. <?php $main_folder = 'K:/Comics/'; // should be K:Comics but I changed it because of the highlighting issue [code]....
Posted: Jul 14 at 15:45
View 2 Replies!
View Related
Check Special Characters And Change To Normal HTML Characters
I'm writting a news management script and I have run into a problem. When some submits a news artical it sometime contain special characters that might now show up on all browsers. Is there a way to makeit check for the characters and switch them to html that can be read by browsers. Is there a way to do this and name it as like, filter.inc then just tell the program to just use this inc file before sending the content to the database. I want to be able to use the special character to html lib for other programs.
Posted: February 10th, 2001, 03:27 PM
View 3 Replies!
View Related
Handling Special URLs In PHP
I'm creating a classified ad site where each ad is identified by a number - say 234563. The user wishing to view the ad will something like this - http://www.abcclassfieds.com/234563 I want this url to be redirect to a php display page say - http://www.abcclassfieds.com/showad.php?adid=234563 How does one do this?
Posted: July 17th, 2005 10:36 AM
View 1 Replies!
View Related
Special Character Handling
I have a forum and in add/edit/quote/reply, people can preview what they have entered, but if they entered special charecter like " ' (double or single quote), the php will generate a " ' in the preview and in the form field, so when they submit, the will also appear. How can I handle this.
Posted: April 10th, 2003, 09:40 PM
View 2 Replies!
View Related
PHP Handling Special Redirections
Id like to have my host redirect the user on special URLS, much like seen in wikipedia, i.e. www.wiki.com/AlbertEinstein, www.wiki.com/LeonardoDaVinci Ideally, Ill have this redirect url path in my database, wich is a db of several image galleries of various artists. Id like the user to access galleries with this ease, as typing www.galleries.com/LeonardoDaVinci to access Leonardo's gallery. (this is not my actual hostname). A friend of mine told me I should look up on ISAPI filters, and I did google and read some of it, but am a little lost on the proper procedures to achieve this functionality with PHP.
Posted: November 07, 2007, 06:00:18 PM
View 7 Replies!
View Related
Special Character Handling - XML Feed
I have an XML feed which appears to have a bullet in it. When I parse it in PHP, it turns into a question mark. I'm completely ignorant on character sets and handling of special characters. I searched around but couldn't find any good resources....
Posted: 05-16-2006, 12:07 PM
View 6 Replies!
View Related
Javascript And Html : Automatically Generate The Html Code That Shows The Photos By Reading The File Names In The Photo Folder?
UPDATE:The php code worked perfectly on my PC (wamp server) but i've now uploaded it on a free webhost server and while the php part runs perfectly (it produces the array) the javascript function itself doesn't work cause there are no photos in the website when it's loaded. I tried to test it by putting in the function's first line an alert to see if it runs but never showed up. I think that the server for some reason doesn't realise that it is a javascript function because i also had in the getphotos.php this: window.onload = photos(); which appart from starting the photos function, shows a text. When i moved that line in js file and put the show text line first, it run showing the text but still no photos. END OF UPDATE:I want the site to automatically generate the html code that shows the photos by reading the file names in the photo folder, but i need also to use javascript. So I found through the web a solution with php generating javascript which than generates the html code I want and I think this is what I need. But... it doesn't work X_X. Firstly, here is the php/javascript(in getPhotos.php): <? header("content-type: text/javascript"); //This function gets the file names of all images in the current directory //and ouputs them as a JavaScript array[code].... This is it, and it doesn't work! I know I ask to much by just giving all the code and asking for help but i can't even think what's wrong,
Posted: Mar 19 at 17:41
View 2 Replies!
View Related
Handling Case Of Field Names In Multiple Db's
(Bottom line: I think what I'm looking for is an easy way of changing the case of key values in an array.) I've got code that I'm trying to make agnostic about the underlying database system I'm using. That is, I want the code to work whether the underlying db is MS SQL, MySQL, Oracle, etc. I'm using the PEAR DB package, and it's great for what I'm trying to do...except in one area. I get the returned row fields in an associative array, where the element key is the field name and the element value is the field value. The problem is that MS SQL returns field names in mixed case (actually, it returns the field names in the case the user used to define the field names in MS SQL in the first place), while Oracle returns the field names all caps. So, if I have the same db on MS SQL and on Oracle, I can't easily access the field values. For example: $row*=*$result->fetch_row(DB_FETCHMODE_ASSOC); Now, if I print_r($row), I see something like: Array*( ***[My_Id]*=*1; ***[Name]*=*"Fred Flintstone"; ) If I run this under an Oracle db, I might get this, instead: Array*( ***[MY_ID]*=*1; ***[NAME]*=*"Fred Flintstone"; ) So my code cannot say something such as: $id*=*$row["My_Id"]; That would work for the MS SQL version, but not for the Oracle version. I certainly don't want to say something like: if*($IsMsSql)*$id*=*$row["My_Id"]; else*$id*=*$row["MY_ID"]; I really don't have control of how the users define the case of their field names, otherwise I could tell them to upper-case them all the time. But that might not work, if a different set of db routines that DB uses returns field names in all lower case. I could do the following, but I'm not sure I want to take the efficiency hit (maybe it isn't so bad; I don't know): foreach*($row*as*$key*=>*$value)*{ ***$row*[strtoupper($key)]*=*$value; ***unset($row[$key]); }
Posted: July 17th, 2005 01:25 AM
View 4 Replies!
View Related
Special Characters - Foreign Characters
I'm experiencing a strange problem in displaying some text I have extracted from an XML file that I haven't had much success in solving. I am retrieving some remote XML, placing it in an array, and extracting the data I need, then inserting that into a MySQL database so it can be manipulated and merged with other data. Some of the data includes location names, such as the one below, which include foreign characters that have been translated into a special character. For some reason, these are actually being displayed in the form shown below. For example and ampersand appears as & and not as &. PHP Code: Côte d'Ivoire
Posted: 03-16-2006, 11:49 AM
View 2 Replies!
View Related
Special Characters In R And OS PDF?
I am using the R&OS PDF library to generate pdf documents in PHP. Living in Italy, unfortunately we have accented characters, which I just cannot manage to generate. I've looked through the instructions, and I found: 'setup the helvetica font for use with german characters $diff=array(196=>'Adieresis',228=>'adieresis', 214=>'Odieresis',246=>'odieresis', 220=>'Udieresis',252=>'udieresis', 223=>'germandbls'); $pdf->selectFont('./fonts/Helvetica.afm' ,array('encoding'=>'WinAnsiEncoding' ,'differences'=>$diff)); Which I tried, to generate agrave and Agrave (and the big A with an accent).
Posted: May 20, 2010, 07:08
View 4 Replies!
View Related
Displaying Special Characters
My PHP script uses XML SAX functions to extract data from an XML document. In the XML, I have something like: Code: <myelement>Steak & Cheese</myelement> My PHP script extracts the data between the two elements, but when it displays it to the screen, it returns it to HTML as 'Steak & Cheese', but I need it to return 'Steak & Cheese'. Not to be confused with how it looks on the screen to the user. It SHOULD look like 'Steak & Cheese' to the user, but in the page source generated by my script, I want it to be 'Steak & Cheese'.
Posted: April 17th, 2003, 09:25 PM
View 1 Replies!
View Related
Can't Echo Special Characters
A simple form that asks a player Nick, a Quake 3 Nick Where: ^1 = Red ^4= Blue, etc. Through ^1 to ^8 you get the colors. For example: ^4<LGG>^2Ozzman Will display: <LGG>Ozzman The problem is that special characters causes errors or I can't echo the variables correctly. < and > is a TAG for PHP so it disapear when I echo the $nick var. And what about the ^ or other special characters? How Can I do this?
Posted: December 2nd, 2001, 03:36 PM
View 2 Replies!
View Related
Setcookie And Special Characters
I searched, but couldn't find anything, so I'm asking you guys. I got some strange behavior from setcookie when special characters are involved in a string. example: when you want to write a username posted via form into a cookie and the user types this: [input] It's [/input] and you read the data out of the cookie it comes out like this: [input] It's [/input] A call to stripslashes() won't remove those backslashes, any ideas?
Posted: December 18th, 2001, 03:37 AM
View 3 Replies!
View Related
Special Characters (æøå) And Zipfiles
I've been searching google about this for days but can't find anything, so I'm hoping someone here can help me out. I'm trying to create zip-files without needing the zip-file extension in PHP, mainly because I need the ability to both create and extract zip-files. I've tried a couple of classes found here and there, and they all seem to have the same problem. I'm currently using PclZip (http://phpconcept.net/pclzip/) but even the simplest one I've tried (zip.lib.php from phpMyAdmin) gives the same result. This is the problem: When I create a zip-file containing any file with special characters in their filenames, the characters gets translated into different special characters. The three characters I myself am having problems with is the Norwegian æ, ø and å (uppercase Æ, Ø and Å), all of which are very common in my language. The zip-file itself can contain these characters without any problems, the only files affected are the ones put into the zip-file. Same happens with directories, obviously. The funny thing is, if I extract a zip-file using the same class, the conversion gets reversed, so the files do end up with the correct names after extraction. This of course means that if I upload a zip-file created using WinZip or any other zip-application, any files with special characters will get translated into completely different characters again. I've made a table showing the converted characters which can be found here: http://akkar.sourceforge.net/zipchars.html Also very strange - I tried making a zip-file containing a zero-length file with the special characters in the filename, and when opening that zip-file in a hex-editor I wasn't able to find the hex values for the converted characters anywhere in the file, but the original filename characters were found at the places where I expected them to be. If someone can help me figure out what's going on I would really appreciate it. I've submitted it as a bug for PclZip but it hasn't gotten any response yet, and since I've seen the same thing happen with other classes I sort of doubt it's only related to PclZip. I've tried it on different servers as well, and with the same result. I've got the impression that PclZip is a popular class for managing zip-files,
Posted: July 17th, 2005 10:32 AM
View 7 Replies!
View Related
Special Characters (apostrophes, Etc.)
I tried the escaping code in a variety of ways in my script and still no luck. My server is running PHP3 and MySQL 3.22. The only fields where apostrophes will need to be dealt with are the 'name' and 'location1' thru 'location3'. Here is the code from the form generating PHP script for modifying the database: Code:
Posted: September 3rd, 2000, 07:25 AM
View 1 Replies!
View Related
How To Handle Special Characters Like Ü,Ä Etc In Php
I am passing company name entered by the user on our site to a system command. But whenever a user enter's some special char like Ü or É then the command fails. I want to know how to handle these character's while passing them to a system command. I am using Exec() of php. any help is appreciated.
Posted: May 4th, 2001, 06:53 PM
View 6 Replies!
View Related
Removing Special Characters
I have a form that has a text box: <input name="weight" type="text" id="weight" size="10" maxlength="5"> When to form is submitted, how do i make it to where the users cannot add any special characters like a comma for instance. This field is for a weight result value, but i need it to be all numeric at result. How can i strip it or make it return an erro on submit. Currently my error system is like so: if($weight == ) { //This is where i want to add the check for special characters// $msg[] = $error7; header("Location: quote_error.php?"); }
Posted: September 27, 2007, 12:42:11 AM
View 2 Replies!
View Related
|