Re: [PHP] Regular Expressions
preg_replace("/aIone/", "alone", "I am not aIone"); But you don't need regular expressions for this. Jacob On Thu, 2003-10-16 at 14:35, Shmuel wrote: > I have a misspelled sentence like this: "I am not aIone". > I want to change the capital I to small l, but only in > the beginning of a word. > > How is this done in regular expression ? > > Any help appreciated. > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > -- Venlig hilsen / Best regards, Jacob Vennervald System Developer Proventum Solutions ApS Tuborg Boulevard 12 2900 Hellerup Denmark Phone: +45 36 94 41 66 Mobile: +45 61 68 58 51 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP and java
Why can't you do this using PHP? Have a php script generate a directory listing the user can choose from and when the user chooses a picture load that picture. Jacob On Thu, 2003-10-30 at 02:27, David Miller wrote: > I have written PHP code to upload and download files to my server through my > browser. >On the local side I have generated a java applet to do a few things that I just > can't do with a browser. There are some things that I need the java on the local > machine to have access to on the server. I started to generate a java servlet to do > this when I found out that my service provider doesn't support servlets. > For example, I need for the java to be able to make a request of the server for a > directory listing, then fetch an image from the directory to display in the applet. > I am a little new to java applets. > > Any ideas on how to do this? > > JDM > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > -- Venlig hilsen / Best regards, Jacob Vennervald System Developer Proventum Solutions ApS Tuborg Boulevard 12 2900 Hellerup Denmark Phone: +45 36 94 41 66 Mobile: +45 61 68 58 51 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] passing random variables names
On Fri, 2003-11-07 at 09:40, Yonatan Ben-Nes wrote: > Hi all, > > I made a form which pass constant variables which never change (Ex. product_name) > and dynamic variables which i withdraw from the db (Ex. attribute_id = 1, value = > color). > Now my problem is with the passing of the dynamic variables. > Because the fields can change their name (id's) i need to design my functions so > they will "know" how to receive them. > I used to make an array in the form (Ex. attribute_id[0], attribute_id[1] where the > numbers in the [] are the id numbers from the db) and then at the function i used to > $_POST['attribute_id'] and then withdraw from them their id's and values. > I read that this kind of passing variables is making problems with javascripting > (and maybe it violate W3C standards). > Is there a way that i can pass names like attribute_id_X where X is the changing > name and the function will be able to withdraw it like $_POST['attribute_id_X'], or > any other way which doesnt violate W3C standards? > > Any help will be greatly appreciated, It should be possible to access these kind of fields in javascript. Eg. if you have an input field named attribute_id[1] you access that field by doing like this: documents.form_name.elements['attribute_id[1]'].value Try that > Thanks > -- > "My friends are worth gold to me, so I prefer to sell them and get rich!" > > Ben-Nes Yonatan > Canaan Surfing Ltd > Tel: 972-4-6991122 > Fax: 972-4-6990098 > http://www.canaan.net.il > -- -- Venlig hilsen / Best regards, Jacob Vennervald System Developer Proventum Solutions ApS Tuborg Boulevard 12 2900 Hellerup Denmark Phone: +45 36 94 41 66 Mobile: +45 61 68 58 51 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] PHP code beautifier?
Hi List Does anybody know any good PHP code beautifiers/formaters? Preferably one which is configurable so I can specify the exact format I want. Cheers, Jacob Vennervald -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: PHP code beautifier?
Thanks a lot. Jacob Vennervald On Thu, 2003-07-17 at 15:29, Joseph Szobody wrote: > Jacob, > > http://www.tote-taste.de/X-Project/beautify/ > > http://www.semdesigns.com/Products/Formatters/PHPFormatter.html > > http://www.trita.com/features/php-beautifier.jsp > > http://www.bierkandt.org/beautify/ > > http://www.trita.com/ > > http://www.beautifier.org/ > > This should get you started. I think PHPEdit has a code beautifier feature too. > > Btw, I found all of these on the first two pages of a simple Google search. Might be > worth trying in the future. :-) > > Joseph > > "Jacob Vennervald Madsen" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > > Hi List > > > > Does anybody know any good PHP code beautifiers/formaters? > > Preferably one which is configurable so I can specify the exact format I > > want. > > > > Cheers, > > Jacob Vennervald > > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > -- Venlig hilsen / Best regards, Jacob Vennervald System Developer Proventum Solutions ApS Toldbodgade 51C 1253 Copenhagen K Denmark Phone: +45 33 45 43 61 Mobile: +45 61 68 58 51 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: PHP code beautifier?
Actually I did search Google first and I did get the same results you got. But what I was looking for was actually not a list of different beautifiers but comments from developers having experience with a specific beautier that they find does the job well. Jacob Vennervald On Thu, 2003-07-17 at 15:40, John Manko wrote: > I really think that this depends on the topic. I know that if I'm > looking for an editor (esp for a language just starting in), I can > search google all day, but end up with a list full of fud. In > situations like this, I would prefer to go straight to the source and > ask the people who have put most editors for that languange to the test, > and sometimes that means I need to post to a mailing list. Now, I''m > not saying that you don't have a point (All too often people ask without > even trying to find the answer themselves. I sometimes find myself doing > this, and it's a shame becuase there is so much information a person > misses out on that he/she would not normally be exposed to.), but you > have to ask yourself "A beginner, or a veteran?" Othertimes, I just > want to be sure I didn't miss something that would be ideal. I don't > know...just my .02. > > Joseph Szobody wrote: > > >Btw, I found all of these on the first two pages of a simple Google search. Might > >be worth trying in the future. :-) > > > > > > > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > -- Venlig hilsen / Best regards, Jacob Vennervald System Developer Proventum Solutions ApS Toldbodgade 51C 1253 Copenhagen K Denmark Phone: +45 33 45 43 61 Mobile: +45 61 68 58 51 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Passing Serialized Array via Hidden field
Just tried it out and you should use htmlspecialchars() instead of urlencode(). When you put it in a hidden field the browser is responsable for urlencoding the data. Jacob On Mon, 2003-07-21 at 09:24, Andrei Verovski wrote: > Hi, > > I am need to pass serialized assotiative array via form hidden field > (not GET or POST). In order to do it, I did the following: > urlencode(serialize($my_array)). However, after retrieving data from > hidden field and unserialize I've got junk. > > Someone can explain me what I did wrong? > > Also, do I need to do addslashes/stripslashes with serialized (or > encoded ?) data? > > Thanks in advance for any suggestion. > > > * > * Best Regards --- Andrei Verovski > * > * Personal Home Page > * http://snow.prohosting.com/guru4mac > * Mac, Linux, DTP, Development, IT WEB Site > * > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > -- Venlig hilsen / Best regards, Jacob Vennervald System Developer Proventum Solutions ApS Tuborg Boulevard 12 2900 Hellerup Denmark Phone: +45 36 94 41 66 Mobile: +45 61 68 58 51 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Array cookie
You could serialize your an array and save it in the cookie, but I would also recommend using a session and then save the serialized array in this instead. Jacob Vennervald On Tue, 2003-07-22 at 09:36, Curt Zirzow wrote: > * Thus wrote Shantanu Oak ([EMAIL PROTECTED]): > > Hi, > > I have written a feed reader for my personal use. The > > php code given below does work. But it works only with > > a single feed. How can I save multiple cookies > > (array?) and display a few more RSS feeds. The example > > page can be found at... > > http://shantanuoak.com/test1.php > > I would not store the urls in a cookie, but use sessions. Cookies have > limits on how long your data can be and how many you can have. > > If you insist on using cookies you have to set up cookie variables like > > FeedCookie1 > FeedCookie2 > ... > > I'm not sure if you can use the array method (like in a form) to access > them. Being that you have to set up variables like that it also make > the program that much more complicated. > > HTH, > > > > Curt > -- > "I used to think I was indecisive, but now I'm not so sure." > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > -- Venlig hilsen / Best regards, Jacob Vennervald System Developer Proventum Solutions ApS Tuborg Boulevard 12 2900 Hellerup Denmark Phone: +45 36 94 41 66 Mobile: +45 61 68 58 51 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] CLI php: how to use different php.ini file
php -c Jacob Vennervald On Tue, 2003-07-22 at 12:52, Jean-Christian IMbeault wrote: > I am running some cronjob scripts that are written in PHP. However > things are not working as expected because my php.ini file auto-prepends > a file. This auto-prepending is meant for my PHP web pages and I don't > want it loaded when I run PHP from the command line. > > Is there a way from me to either use a different php.ini file for my CLI > PHP calls or to tell PHP *not* to auto-prepend the file? > > Thanks, > > Jean-Christian Imbeault > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > -- Venlig hilsen / Best regards, Jacob Vennervald System Developer Proventum Solutions ApS Tuborg Boulevard 12 2900 Hellerup Denmark Phone: +45 36 94 41 66 Mobile: +45 61 68 58 51 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] a stupid question
Download it and then check it. But if you need to check a lot of files that's probably to slow. Jacob Vennervald On Thu, 2003-07-24 at 06:03, Joe wrote: > how to check the filetype of remote file > because is_dir(), is_file() can't work on remote file > thx a lot > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > -- Venlig hilsen / Best regards, Jacob Vennervald System Developer Proventum Solutions ApS Tuborg Boulevard 12 2900 Hellerup Denmark Phone: +45 36 94 41 66 Mobile: +45 61 68 58 51 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Displaying MySQL data inside of a table
Hi Next time you can find a lot of information about this on www.php.net. Check out this example: Best regards, Jacob Vennervald On Mon, 2003-07-28 at 16:08, SP Computing wrote: > Hi all, > > I have this code so far: > > > mysql_connect(localhost, USER, PASS); > mysql_select_db(DB); > > $result = mysql_query("SELECT * FROM tbl"); > > ?> > > Inside one of my tables, I have one field called IP which contains just over > a thousand IP addresses. I would like these IP addresses to be displayed > inside of a table like this: > > > > IP Address #1 > IP Address #2 > IP Address #3 > And so on... > > > > How do I go about acheiving this? > > TIA, > > SP Computing > > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > -- Venlig hilsen / Best regards, Jacob Vennervald System Developer Proventum Solutions ApS Tuborg Boulevard 12 2900 Hellerup Denmark Phone: +45 36 94 41 66 Mobile: +45 61 68 58 51 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Running script produces no output
Does the script work when you run it by hand? Try to insert an echo "TESTER" in the top the shell script to make sure something is sent to stdout. And then check in your php script that you receive the message. Best regards, Jacob Vennervald On Wed, 2003-08-06 at 08:38, Chris Blake wrote: > Greetings learned PHP(eople); > > I have a small script sitting in my web directory which I have called > upon as follows : > > shell_exec('./info.sh'); > ?> > > The script is not being run, yet I can do things like > > $info=shell_exec('ls -l'); > echo '$info'; > ?> > > ..which produce output to the browser... > > I have tried 'chown apache:apache info.sh' but this doesn`t change > anything > I have also tried using './info.sh' with no result > > Any pointers much appreciated as to why this won`t work. The permissions > are as follows for the script file : > > -rwxrwxrwx1 root root 2456 Aug 5 16:35 info.sh > > Regards > > -- > Chris Blake > Office : (011) 782-0840 > Cell : 083 985 0379 > > Join the army, see the world, meet interesting, exciting people, and > kill them. > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > -- Venlig hilsen / Best regards, Jacob Vennervald System Developer Proventum Solutions ApS Tuborg Boulevard 12 2900 Hellerup Denmark Phone: +45 36 94 41 66 Mobile: +45 61 68 58 51 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php