Re: [PHP] PGP
On Sun, 28 Apr 2002, Richard Lynch wrote: On Sat, 27 Apr 2002, Richard Lynch wrote: $test = escapeshellarg($cleartext); exec(cat $test | /usr/bin/pgpe -a -t -f -r '[EMAIL PROTECTED]' . . . ^Kb^Estdin^H^@^@^@ $cleartext is the actual text? What if you used 'echo' instead of 'cat'? miguel D'oh! Different output, for sure, but still nothing decodable into the original... Maybe cat's bugging on the line breaks (if any) in $cleartext. You might try, for starters, dumping the message into a temp file and passing that through pgpe... TIPS for the archives, in case I die before I figure this out completely: 1. You may or may not need to use putenv(PGPPATH=/home/yourusername/.pgp); 2. If you are going to use --pubring and --secring, note that the filename extension for SECRING is .skr, not .pkr D'oh! 3. When you copypaste from your browser to the SSH session where you can use pgpv to decode your message, the newlines are critical to get *EXACTLY* right, including the extra one after the Message ID: line that was getting lost in my copy/paste 4. It may have been significant that I tried re-ordering the args to pgpv the way they are in man: pgpv -r [EMAIL PROTECTED] -atfz --pubring=/home/.../.pgp/pubring.pkr --secring=/home/.../.pgp/secring.skr Or, maybe not. 5. I am also using addslashes() which might or might not be helping with the newlines... Again, not sure that was the critical thing. #3 was the last thing that made the big difference. I still haven't gotten popen to work, but at least I can do it with exec now, if nothing else. Yes, that's *NOT* good for security, but I'm getting closer to the correct solution. -- Got Music? http://l-i-e.com/artists.htm -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] reg-ex again
I'm trying to find files in my array for example =lg_imode.gif and =/db/imodeklein/edgar-IMODE-1-.gif I want to differentiate between the files with slash at the front and ones without so that I can add a server path ! but as usual I' m having problems with the correct regex At the moment I've got this to find files with forward slash eregi_replace(([^\]+[/+]+[a-z_/-]+[gif]+[/$]) and it seems to work.(although I think it's wrong) And I'm trying this to find the files without the slash at the front eregi_replace(([^\]+(a-z_)+[gif]$) which is definately not working. help ! thanks ! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Changing field size
Anthony Rodriguez a écrit : I've a VARCHAR(4) field that I want to change to a VARCHAR(6) field. What would happen to the existing data in MySQL db? nothing :) read mysql manual Thanks! Tony ([EMAIL PROTECTED]) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- Marius Ursache (3563 || 3494) \|/ \|/ @'/ ,. \`@ /_| \__/ |_\ \__U_/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] reg-ex again
On Monday 29 April 2002 15:22, John Fishworld wrote: I'm trying to find files in my array for example =lg_imode.gif and =/db/imodeklein/edgar-IMODE-1-.gif I want to differentiate between the files with slash at the front and ones without so that I can add a server path ! but as usual I' m having problems with the correct regex Assuming that all those files which have a '/' at the front already have a valid path, and thus it is only those without a '/' that needs a path, then wouldn't it be far simpler to just check the first character to see whether it is a '/' and act accordingly? -- Jason Wong - Gremlins Associates - www.gremlins.com.hk Open Source Software Systems Integrators * Web Design Hosting * Internet Intranet Applications Development * /* WAIT */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: reg-ex again
[EMAIL PROTECTED] (John Fishworld) wrote: I'm trying to find files in my array for example =lg_imode.gif and =/db/imodeklein/edgar-IMODE-1-.gif I want to differentiate between the files with slash at the front and ones without so that I can add a server path ! but as usual I' m having problems with the correct regex what about something simple as: $str = /db/skod.gif; if (strpos($str, /) == 0) { echo Slash first; } else { echo Slash not first; } -- Henrik Hansen -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] text problem.
Greetings all, Special greetings to all my new PHP list pals, you know who you are. Sorry to be so mysterious in the subject line but i dont know how to explain this in one line. ever visit a site and you get this text (Or something like this...heheh) This morning shockingly Bill Gates claims he is broke! The kooky billionaire is...(link)subscribe / login to read this fully. This morning shockingly Bill Gates claims he is GAY! The kooky billionaire is...(link)subscribe / login to read this fully. This morning shockingly Bill Gates claims he is impotent! The kooky billionaire is...(link)subscribe / login to read this fully. etc etc Basically, its querying the database and instead of displaying the whole results it just taking the first 2 lines or X number of characters and then adding the link stuff.any idea how to do this? NOTE:Before i get you microsoft lovers coming after my throat...I HAVE NOTHING AGAIN BILL GATES/MICROSOFT. I actually use a lot of his companys software...am running win2k myself. Get off my back. And for the rest of you who think that i am suffering from insanityyou are wrong...I am enjoying every minute of it! heheheh ahhahahah ahahhah GAGAGAGAG HAHAHA HEHEH ANY help appreciated. Cheers, -Ryan -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Best BBS
Hey all, This email is not for any questions/suggestions etc but a thank you note. Some time back i posted an email asking if anyone had any recomendation for a BBS system and I got a lot of replies. I thank each and every one of you who wrote in, after checking out the links or software names you gave me I have decided to use PHPBB2 Will post a link to my site where this is installed after a week or so, tell me what you think. If you have any comments on why PHPbb2 is BAD for me lemme know. Cheers all god bless. -Ryan. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Date and Time
seems like you echo an 1 before print $time is called. Look through your code, there must be something printed or echod. Perhaps it's simple some html (?1?php) or something. Regards, Michael Baldey_uk [EMAIL PROTECTED] schrieb im Newsbeitrag [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Hi all, Anyone know any reason that the date function would return 2am in the morning as 102 if i use it in the following manner? $time=date(H:i:s); print $time; this outputs 102:14:51 instead of 02:14:51, anyone know where the 1 comes from? and why its there? Cheers From baldey_uk -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: reg-ex again
No the problem is I'm reading a file into an array and then need to change any of the links in the file from relative links to absolute links ! So that my lg_mode.gif gets the full server path in front of it http://www.ltest.com/lg_mode.gif and exactly the same with the other one but of course I don't won't http://www.test.com//folder/name.gif I'm trying to find files in my array for example =lg_imode.gif and =/db/imodeklein/edgar-IMODE-1-.gif I want to differentiate between the files with slash at the front and ones without so that I can add a server path ! but as usual I' m having problems with the correct regex what about something simple as: $str = /db/skod.gif; if (strpos($str, /) == 0) { echo Slash first; } else { echo Slash not first; } -- Henrik Hansen -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Hey PHP PPL - Great Question !!!
if you need access to your session among different servers, it's the best way to store session data inside a database, so every server can access it easily. The file container is accessible only for local users on the server, at least when you set up normal server configuration and not some nasty stuff with servers shareing hdds or partitions or something. There's no other difference between the file container and the database container. Perhaps the database driven container is running a bit slower, for you have to connect to the database, and that costs some time, at least if you don't use persistent connections. Persistent connections are only possible if you're running PHP as Apache Module, not in CGI version. So it's up to you to decide what you need. Regards Michael Vins [EMAIL PROTECTED] schrieb im Newsbeitrag [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... For example: one form... - First name - last name - address - country - phone - email - mobile number After you click submit on the first page, it sends you to a preview data page where you can check all the data. instead of inserting tons of hidden input form fields and waist download time, use a session. after the button on the preview page is clicked, submit to a save page, where data will be entered into a db but all values my be called from the session. now would it be wise, faster and more safer to use a database or a file to save the sessions ? Vins [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Session Data. What is the best. to save in database, or to save as file ??? let me know. Cheerz Vins -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] text problem.
On Monday 29 April 2002 17:44, r wrote: Greetings all, Special greetings to all my new PHP list pals, you know who you are. Sorry to be so mysterious in the subject line but i dont know how to explain this in one line. ever visit a site and you get this text (Or something like this...heheh) This morning shockingly Bill Gates claims he is broke! The kooky billionaire is...(link)subscribe / login to read this fully. Basically, its querying the database and instead of displaying the whole results it just taking the first 2 lines or X number of characters and then adding the link stuff.any idea how to do this? You yourself have already outlined how to do it: get text from db get the first 100 chars from the text drop the last 'word' (it may be incomplete), using explode(), array_pop() You may have to refine the process to suit your needs. -- Jason Wong - Gremlins Associates - www.gremlins.com.hk Open Source Software Systems Integrators * Web Design Hosting * Internet Intranet Applications Development * /* The discerning person is always at a disadvantage. */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] text problem.
If you want to do it on a # of char's (the easiest), check out substr() in the manual. Otherwise, to break on a full word, this will do the job: Do your query as per usual, the below assumes your text thing is $fulltext. ? $fulltext = one two three four five six seven eight nine; // config $word_count = 5; // number of words desired minus 1 $append = ... subscribe or log-in to read this fully.; // create teaser text $teaser = strip_tags($fulltext); $teaser = explode( , $teaser, $word_count); array_pop($teaser); $teaser = implode( , $teaser); $teaser .= $append; echo $teaser; // this will print: // one two three four five six... subscribe or log-in to read this fully. ? I put strip_tags() in there, because if you have a tag it will: a) screw up the word count (A HREF=foo TARGET=foo contains 3 spaces) b) screw up the page if Bfoo bah/B gets trimmed to Bfoo... the rest of the page will be bold Like I said, substr() is a helluva lot easier, but could break mid-word. Justin French Creative Director http://Indent.com.au on 29/04/02 7:44 PM, r ([EMAIL PROTECTED]) wrote: Greetings all, Special greetings to all my new PHP list pals, you know who you are. Sorry to be so mysterious in the subject line but i dont know how to explain this in one line. ever visit a site and you get this text (Or something like this...heheh) This morning shockingly Bill Gates claims he is broke! The kooky billionaire is...(link)subscribe / login to read this fully. This morning shockingly Bill Gates claims he is GAY! The kooky billionaire is...(link)subscribe / login to read this fully. This morning shockingly Bill Gates claims he is impotent! The kooky billionaire is...(link)subscribe / login to read this fully. etc etc Basically, its querying the database and instead of displaying the whole results it just taking the first 2 lines or X number of characters and then adding the link stuff.any idea how to do this? NOTE:Before i get you microsoft lovers coming after my throat...I HAVE NOTHING AGAIN BILL GATES/MICROSOFT. I actually use a lot of his companys software...am running win2k myself. Get off my back. And for the rest of you who think that i am suffering from insanityyou are wrong...I am enjoying every minute of it! heheheh ahhahahah ahahhah GAGAGAGAG HAHAHA HEHEH ANY help appreciated. Cheers, -Ryan -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: reg-ex again
On Monday 29 April 2002 17:10, John Fishworld wrote: No the problem is I'm reading a file into an array and then need to change any of the links in the file from relative links to absolute links ! So that my lg_mode.gif gets the full server path in front of it http://www.ltest.com/lg_mode.gif and exactly the same with the other one but of course I don't won't http://www.test.com//folder/name.gif I'm trying to find files in my array for example =lg_imode.gif and =/db/imodeklein/edgar-IMODE-1-.gif I want to differentiate between the files with slash at the front and ones without so that I can add a server path ! but as usual I' m having problems with the correct regex Not sure if I understand your problem correctly. Define your server path as: http://www.myserver.com/some/path (NB no trailing slash) If the first char of file contains '/' use: $server_path$file otherwise use: $server_path/$file -- Jason Wong - Gremlins Associates - www.gremlins.com.hk Open Source Software Systems Integrators * Web Design Hosting * Internet Intranet Applications Development * /* Why is the alphabet in that order? Is it because of that song? -- Steven Wright */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Java-Object
Hi everyone, I use the apache FOP tool to transform render an XML-XSL pair to a PDF. The following code shows my trial to perform the transformation and rendering within a php-script. ?php 1.$trtool = new Java(de.smc.util.PDFTransformer); 2.$result = $trtool-renderXmlXsl('data.xml', 'style.xsl'); 3.if (!$result) { 4.die(Cannot process PDF-tarnsformation!); 5.} 6.Header(Content-type: application/pdf\nContent-Length: . strlen($result)); 7.print $result; 8.$fo = result.pdf; 9.$fp = fopen($fo, w+); 10.fwrite($fp, $result); 11.fclose($fp); ? It appears that the transformation and rendering is performed without errors ( according to the System-output). However, in the context I used, $result contains the 6 characters 'Object' which was supposed to contain the pdf document. NB.: 1. de.smc.util.PDFTransformer is a custom class that uses FOP. 2. renderXmlXsl(xml,xsl) returns a java.io.ByteArrayInputStream. Any idea on how to extract the content out of a Java-Object in php? hoping... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] mail() problem with email mail@dom.com
Hello, I have a pb with mail() function. my script run ok on a linux but not on a nt: ? ini_set(SMTP, 192.168.0.126); ini_set(sendmail_from, info [EMAIL PROTECTED]); mail(fred [EMAIL PROTECTED], the subject, message); ? On my windows nt server I can only run: ? ini_set(SMTP, 192.168.0.126); ini_set(sendmail_from, [EMAIL PROTECTED]); mail([EMAIL PROTECTED], the subject, message); ? I have an error as soon as i use eaml like: mail [EMAIL PROTECTED] It is allways the same smtp server. Is someone have an idea ?? Thanks for your support. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: reg-ex again
Sorry don't think I've explained this very clearly ! :-)) Start again People can enter a url with code in, this gets copied to a different server and read as an array ! At this point, the original server path needs to be added to the links in the copied file. The basics of this do actually already work - I just need the regex expression to find any files with name.gif (only allowing letters,numbers and _) and to find files /pics/name.gif - that is same rule but starting with a forward slash And at that point they all get replaced with the server path and written to the file ! On Monday 29 April 2002 17:10, John Fishworld wrote: No the problem is I'm reading a file into an array and then need to change any of the links in the file from relative links to absolute links ! So that my lg_mode.gif gets the full server path in front of it http://www.ltest.com/lg_mode.gif and exactly the same with the other one but of course I don't won't http://www.test.com//folder/name.gif I'm trying to find files in my array for example =lg_imode.gif and =/db/imodeklein/edgar-IMODE-1-.gif I want to differentiate between the files with slash at the front and ones without so that I can add a server path ! but as usual I' m having problems with the correct regex Not sure if I understand your problem correctly. Define your server path as: http://www.myserver.com/some/path (NB no trailing slash) If the first char of file contains '/' use: $server_path$file otherwise use: $server_path/$file -- Jason Wong - Gremlins Associates - www.gremlins.com.hk Open Source Software Systems Integrators * Web Design Hosting * Internet Intranet Applications Development * /* Why is the alphabet in that order? Is it because of that song? -- Steven Wright */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] lookin for a Menuing System...
Yes too true.. Quite well put.. That's why. I haven't read the rest of the posts on this topic yet as there are heaps.. but when I started working on my project with my graphics man we discussed the issue of using JS menus very thoroughly as yes Netscape and IE both have very different implementations when it comes to using DIV's and layers.. check it out: http://spectrum.ausgamers.com/ Hopefully it should all go well, and for NS users the dynamic menu simply won't be there and they can use the sidemenu navigation system... For IE they can utilise both systems.. Please give feedback if you do run into problems though.. Would love to get some broader testing on it.. If you wanna know how it runs I coded it myself and it uses a nice little linked list-type PHP array system which can be dynamically modified through each page (since the whole site runs off this really intergrated mysql principle) which will reflect the changes in the navbar menu and popup JS menus.. Ok.. well thx for feedback anyway.. Hope I can help.. - Original Message - From: michael kimsal [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Monday, April 29, 2002 2:46 PM Subject: Re: [PHP] lookin for a Menuing System... Miguel Cruz wrote: Do it in JavaScript, it works and it's client side so it will be faster. But take care - using JavaScript for site navigation is tricky business. Some people don't use it, some people can't use it (not supported by their browsers / hardware / corporate policy), and search engines certainly won't follow those links. Can someone point me to hardware that is still in active use that can't handle javascript? Similarly, can someone point me to a company that specifically disables javascript as 'corporate policy'? Back in 96-97, the 'no javascript' argument held, and probably holds today some if you're targetting handhelds and other 'non standard' devices. But if someone specifically disables Javascript these days, a good portion of their web experience will not be as robust as it would otherwise be, and they probably won't notice that using your site is any worse than any other site. IMO, it's now like targetting only websafe colors because some people might only browse in 256 colors. If they do that, about 80% of the web's content will look like crap anyway, and they won't specifically think my stuff looks all that much worse than anyone else's. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Java-Object
Hello, Are you sure the method renderXmlXsl() returns the rendered document ?, from the output you get, it sounds like it is not returning anything, y'd better document your self on the java class to see if there is another method to use to get the output pdf file back from it. Regards, __ Hassan El Forkani http://WarmAfrica.com EveryOne's Africa __ At 11:09 29/04/02, Bedilu Habte wrote: Hi everyone, I use the apache FOP tool to transform render an XML-XSL pair to a PDF. The following code shows my trial to perform the transformation and rendering within a php-script. ?php 1.$trtool = new Java(de.smc.util.PDFTransformer); 2.$result = $trtool-renderXmlXsl('data.xml', 'style.xsl'); 3.if (!$result) { 4.die(Cannot process PDF-tarnsformation!); 5.} 6.Header(Content-type: application/pdf\nContent-Length: . strlen($result)); 7.print $result; 8.$fo = result.pdf; 9.$fp = fopen($fo, w+); 10.fwrite($fp, $result); 11.fclose($fp); ? It appears that the transformation and rendering is performed without errors ( according to the System-output). However, in the context I used, $result contains the 6 characters 'Object' which was supposed to contain the pdf document. NB.: 1. de.smc.util.PDFTransformer is a custom class that uses FOP. 2. renderXmlXsl(xml,xsl) returns a java.io.ByteArrayInputStream. Any idea on how to extract the content out of a Java-Object in php? hoping... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php __ hassan el forkani http://WarmAfrica.com EveryOne's Africa __ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Null character as field seperator in a string.
For historic reasons, I have a file that contains a number of records in which the fields are seperated by the NULL character, i.e, field1\0field2\0field3\0field4 I need to parse out the fields from this string. The string is read into the program using $buffer = fgets(...). This would be no problem in Perl or C but I cannot get this to work in PHP. I have tried using preg_split(/\0/, $buffer); But this fails. I've tried walking through the string but it seems that $buffer only has the content up to the first NULL character. Does anyone have a simple solution to this problem. Regards Dave -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: GET question
Thanks to all for your kind attention. What I need is exactly what Miguel Cruz wrote. What I wanted to do was a multidelete, eg: I show the content of a table in a php page and near every row I put a checkbox binding its checked value with ID column. When I submit a form I send the form vars to the script that deletes the rows checked from the DB. Till now I used the escamotage described by David Freeman with this variant: ID_N (where N is integer). Then I split(_, ID_N), got the second elemnt of the array and then build the string ID=5 OR ID=6 ... But I didn't like it, it seemed not very elegant to me. By the way does someone know where can I find some technical information on how GET or POST parameters are passed (HTTP specs?) and handled by various scripting languages (APIs?) ? Bye, Evanghelos PS nice name ;) :-) Evan Nemerson [EMAIL PROTECTED] ha scritto nel messaggio news:[EMAIL PROTECTED]... Thats because that query string is like saying: $ID = 5; $ID = 6; $ID = 23; If this is a form that you can't change the ID field names to ID1, ID2, ID3, etc. (which would probably be best) you could try something like: -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] OOP-related question
This is done on PHP 3.0.16 Hi folks, I have a problem with these HTTP_ vars. I have a mainpage, call it main. There is an include which carries several settings and other includes like my abstract db-layer class. I include this in my class-function, which works fine for the most variables but $SERVER_ADDR It seems that I cannot get these variable in the function of my class so I have to pass them as argument to the function. I have made an init() function where I pass these vars inside the object But I don´t like to do this, vars like $SERVER_ADDR or *_NAME should be available inside the objects-functions. Is this behaviour normal, or are there any workarounds for it? Hope someone could help. TIA Oliver -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] RE:
PHP cannot open that file. If youre on a *nix type system, adjust the permissions of the file so that the user that PHP runs as has access to the file. Also, the beginning / is probably causing trouble, because its looking from the root of your server for a file named public_html. ---John Holmes -Original Message- From: Rodrigo [mailto:[EMAIL PROTECTED]] Sent: Sunday, April 28, 2002 8:51 PM To: [EMAIL PROTECTED]; 'Miguel Cruz'; 'John Holmes' Subject: Ok, but I'm trying the following code wich is basicaly the same Miguel sent me and I still get the same message. Please excuseme for being so repetitive but Í don't seem to see where is the mistake, Sorry guys for the trouble. ?php $file_pointer = fopen('/public_html/emails.txt', a) || exit; $string_to_write = ($newemail) . \n; fwrite($file_pointer, $string_to_write); fclose($file_pointer); ? Warning: Supplied argument is not a valid File-Handle resource in /home/restricted/home/h4ck3r/public_html/write.php on line 4 Warning: Supplied argument is not a valid File-Handle resource in /home/restricted/home/h4ck3r/public_html/write.php on line 6
Re: [PHP] Java-Object
Hi Hassen, Are you sure the method renderXmlXsl() returns the rendered document ?, Yes, the method 'renderXmlXsl' performs the necessary transformation and rendering, after which it returns the pdf. It is in the custom class : de.smc.util.PDFTransformer and it has been tested outside php - as a java application. The problem here is how to extract the content of an Object. Methods that return java.lang.String and other java-primitive types return the corresponding values as a php-string. What if the method returns an InputStream? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] text problem.
Either use LEFT() in your query, or substr() on the text after it's pulled out to limit it's length. There was a huge discussion on this on the Devshed.com forums on how to do this to break on a word, before or after X characters, etc... It's on the PHP forum, maybe you can find it if you search. ---John Holmes... -Original Message- From: r [mailto:[EMAIL PROTECTED]] Sent: Monday, April 29, 2002 2:45 AM To: [EMAIL PROTECTED] Subject: [PHP] text problem. Greetings all, Special greetings to all my new PHP list pals, you know who you are. Sorry to be so mysterious in the subject line but i dont know how to explain this in one line. ever visit a site and you get this text (Or something like this...heheh) This morning shockingly Bill Gates claims he is broke! The kooky billionaire is...(link)subscribe / login to read this fully. This morning shockingly Bill Gates claims he is GAY! The kooky billionaire is...(link)subscribe / login to read this fully. This morning shockingly Bill Gates claims he is impotent! The kooky billionaire is...(link)subscribe / login to read this fully. etc etc Basically, its querying the database and instead of displaying the whole results it just taking the first 2 lines or X number of characters and then adding the link stuff.any idea how to do this? NOTE:Before i get you microsoft lovers coming after my throat...I HAVE NOTHING AGAIN BILL GATES/MICROSOFT. I actually use a lot of his companys software...am running win2k myself. Get off my back. And for the rest of you who think that i am suffering from insanityyou are wrong...I am enjoying every minute of it! heheheh ahhahahah ahahhah GAGAGAGAG HAHAHA HEHEH ANY help appreciated. Cheers, -Ryan -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] image generation Problems (jpeg)
= PLEASE CC ALL AWNSERS TO [EMAIL PROTECTED] == hi, im having a few problems installing GD, ill start from the top: I need Jpeg support in my PHP installation, and unfortunatly, GD (the verison i have) does not support them, so i figure, ill install it, installing the libary jpeg-6b works easily however, i attempt to compile from there GD, but the following error is produced: [root gd-1.8.4]# make gcc -I. -I/usr/include/freetype2 -I/usr/include/X11 -I/usr/X11R6/include/X11 -I/usr/local/include -c -o gd_gd2.o gd_gd2.c In file included from /usr/include/errno.h:36, from gd_gd2.c:14: /usr/include/bits/errno.h:25: linux/errno.h: No such file or directory make: *** [gd_gd2.o] Error 1 I also tried recompiling PHP and got a similar error, which is very worrying, i think i might be missing some files Basically, waht i would really like, is a way to modify my CURRENT php config or my CURRENT gd config to take advantage of my shiny new jpeg libary, is there any method u can recommend to accomplish this? Thanks Peter = PLEASE CC ALL AWNSERS TO [EMAIL PROTECTED] == -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Null character as field seperator in a string.
Hey.. yeah I might.. I don't know if I am right or just blabbering crap but try to add these param's to your regex statement.. preg_split(/\0/i, $buffer); note the i.. It should let it read past newlines.. although you're prob is with null (\0) chars.. as I said.. Don't know if I am on the right track.. but it's worth a go eh?? good luck.. - Original Message - From: Dave MacRae [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Monday, April 29, 2002 8:26 PM Subject: [PHP] Null character as field seperator in a string. For historic reasons, I have a file that contains a number of records in which the fields are seperated by the NULL character, i.e, field1\0field2\0field3\0field4 I need to parse out the fields from this string. The string is read into the program using $buffer = fgets(...). This would be no problem in Perl or C but I cannot get this to work in PHP. I have tried using preg_split(/\0/, $buffer); But this fails. I've tried walking through the string but it seems that $buffer only has the content up to the first NULL character. Does anyone have a simple solution to this problem. Regards Dave -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
AW: [PHP] Java-Object
Hallo Henning, thanks for your suggestion. The result... print_r($result); resulted in: Objectjava Object ( [0] = 2 ) var_dump($result); had given me: object(java)(1) { [0]= int(2) } Can you make something out of this. -Ursprungliche Nachricht- Von: Henning [mailto:[EMAIL PROTECTED]] Gesendet: Montag, 29. April 2002 11:40 An: Habte, Bedilu Betreff: Re: [PHP] Java-Object Bedilu Habte wrote: It appears that the transformation and rendering is performed without errors ( according to the System-output). However, in the context I used, $result contains the 6 characters 'Object' which was supposed to contain the pdf document. that just means that the variable contains data of type object Any idea on how to extract the content out of a Java-Object in php? not exactly right now, i don't know nothing about the things you do there, but as much as i know of data handling and objects, you could maybe use print_r($result) or var_dump(result) to examine the data in your object, maybe the data you need is just some property of your object. take care if your pdf is really large, these commands result in dumping all the data of the variable on the screen... henning -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Php and XML
Hi there, I would like to create an XML parser using Php. Any good references for doing this?? Philip
RE: [PHP] Null character as field seperator in a string.
Hey.. yeah I might.. I don't know if I am right or just blabbering crap but try to add these param's to your regex statement.. preg_split(/\0/i, $buffer); note the i.. It should let it read past newlines.. although you're prob is with null (\0) chars.. as I said.. Don't know if I am on the right track.. but it's worth a go eh?? Unfortunatly I get the message Warning: No ending delimiter '/' found in when I try this. It appears that PHP is interpreting the \0 as a string terminator for the pattern match :( Dave -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Php and XML
Hi there, I would like to create an XML parser using Php. Any good references for doing this?? Philip -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] parsing mail files
Hello! I am looking for some sample code that will parse a file in Unix mbox format. I want to write an app that will examine mail messages for email-registration info. Parsing the mail with the registration is what I will do, but Im hoping someone has already done some relatively simple code that will return the next mail message from the file. I've checked phpbuilder.com but I have only found one thread about this and that thread pretty much says read the RFC's, write RegExps. I don't have a problem with doing that, it's just that if someone has already done it and is willing to offer up their work, it would save me the trouble of doing it myself. Thanks! -Michael -- In light of the terrorist attack on the U.S.: They that give up essential liberty to obtain a little temporary safety deserve neither liberty nor safety. -- Benjamin Franklin, 1759 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] parsing mail files
Hello, try sourceforge.net or freshmeat.net. There are very usefull programs. Try search: mail mime Regards Michal Dvoracek [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Sessions with register_globals = off
-Original Message- From: Padraig Kitterick [mailto:[EMAIL PROTECTED]] Sent: 26 April 2002 20:16 To: [EMAIL PROTECTED] Subject: [PHP] Sessions with register_globals = off Am in need of help or I will loose my sanity!!! Im runnin Php 4.1.2 with Apache 1.3.22 on Win32 with register_globals set to off. My script is as follows: Well, here's you first problem -- sessions are broke in PHP 4.1.2 on Windows. Either roll back to 4.1.1 or (preferably) upgrade to 4.2.0. Cheers! Mike - Mike Ford, Electronic Information Services Adviser, Learning Support Services, Learning Information Services, JG125, James Graham Building, Leeds Metropolitan University, Beckett Park, LEEDS, LS6 3QS, United Kingdom Email: [EMAIL PROTECTED] Tel: +44 113 283 2600 extn 4730 Fax: +44 113 283 3211 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Re: Translation Request--Altavista Babelfish can't do it
-Original Message- From: Hugh Bothwell [mailto:[EMAIL PROTECTED]] Sent: 27 April 2002 01:15 Vins [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... if(!ereg(^#(.)*$, $buffer[$i])) { echo ok; } what does this mean? [...] Boiled down, it is 'ok' if the string doesn't start with '#'. Um -- I'm no regex expert, but isn't ^ the start of string character? -- so this is looking for strings which *do* begin with a hash! Cheers! Mike - Mike Ford, Electronic Information Services Adviser, Learning Support Services, Learning Information Services, JG125, James Graham Building, Leeds Metropolitan University, Beckett Park, LEEDS, LS6 3QS, United Kingdom Email: [EMAIL PROTECTED] Tel: +44 113 283 2600 extn 4730 Fax: +44 113 283 3211 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Last time Append line to text file
-Original Message- From: Miguel Cruz [mailto:[EMAIL PROTECTED]] Sent: 29 April 2002 05:34 On Sun, 28 Apr 2002, Richard Emery wrote: The answer is: $file_pointer = fopen('/public_html/emails.txt', a) or exit; The || is a binary operation. You want or, the logical operation. Yeah, Perl habit. But || is logical too (it's | that's binary), it just seems to result in $file_pointer being recast from 'resource' to 'boolean' for some reason. This side effect is not mentioned at http://www.php.net/manual/en/language.operators.logical.php where it imples that the only difference is precedence. I'd say this is a bug either in the manual or in PHP itself. Surely this is *precisely* due to the difference in precedence. The or operator has lower precedence than =, whereas || has higher precedence, so: $file_pointer = fopen(...) or exit; would be ($file_pointer = fopen(...)) or exit; (i.e. evaluate the assignment expression first, and if it returns a false value then exit) whereas $file_pointer = fopen(...) || exit; would be $file_pointer = (fopen(...) || exit); (i.e. evaluate the Boolean or first, casting the fopen() result in the process, then assign the result to $file_pointer (assuming exit hasn't already terminated execution by then!)). So, no bug, no unexpected side-effects, just a logical result of applying the precedence rules strictly as advertised! Cheers! Mike - Mike Ford, Electronic Information Services Adviser, Learning Support Services, Learning Information Services, JG125, James Graham Building, Leeds Metropolitan University, Beckett Park, LEEDS, LS6 3QS, United Kingdom Email: [EMAIL PROTECTED] Tel: +44 113 283 2600 extn 4730 Fax: +44 113 283 3211 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] load testing utility
anyone have a recommendation for a good free/cheap load testing utility for php/mysql sites? thanx adrian
Re: [PHP] parsing mail files
On Mon, Apr 29, 2002 at 02:42:01PM +0200, Michal Dvoracek wrote: try sourceforge.net or freshmeat.net. There are very usefull programs. Try search: mail mime Great suggestion, thanks! -- In light of the terrorist attack on the U.S.: They that give up essential liberty to obtain a little temporary safety deserve neither liberty nor safety. -- Benjamin Franklin, 1759 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Translation Request--Altavista Babelfish can't do i t
On Monday 29 April 2002 20:52, Ford, Mike [LSS] wrote: -Original Message- From: Hugh Bothwell [mailto:[EMAIL PROTECTED]] Sent: 27 April 2002 01:15 Vins [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... if(!ereg(^#(.)*$, $buffer[$i])) { echo ok; } what does this mean? [...] Boiled down, it is 'ok' if the string doesn't start with '#'. Um -- I'm no regex expert, but isn't ^ the start of string character? -- so this is looking for strings which *do* begin with a hash! Well the ereg is looking for strings beginning with # but then the whole if expression is negated (!), so the statement it is 'ok' if the string doesn't start with '#' is correct. -- Jason Wong - Gremlins Associates - www.gremlins.com.hk Open Source Software Systems Integrators * Web Design Hosting * Internet Intranet Applications Development * /* When it comes to broken marriages most husbands will split the blame -- half his wife's fault, and half her mother's. */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Null character as field seperator in a string.
On Monday 29 April 2002 18:26, Dave MacRae wrote: For historic reasons, I have a file that contains a number of records in which the fields are seperated by the NULL character, i.e, field1\0field2\0field3\0field4 I need to parse out the fields from this string. The string is read into the program using $buffer = fgets(...). This would be no problem in Perl or C but I cannot get this to work in PHP. I have tried using preg_split(/\0/, $buffer); But this fails. I've tried walking through the string but it seems that $buffer only has the content up to the first NULL character. Try using fread() to get your file (it's binary safe). Then use: explode(chr(0), $buffer); to separate your fields. -- Jason Wong - Gremlins Associates - www.gremlins.com.hk Open Source Software Systems Integrators * Web Design Hosting * Internet Intranet Applications Development * /* I have gained this by philosophy: that I do without being commanded what others do only from fear of the law. -- Aristotle */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Re: Translation Request--Altavista Babelfish can't do i t
-Original Message- From: Jason Wong [mailto:[EMAIL PROTECTED]] Sent: 29 April 2002 14:12 To: [EMAIL PROTECTED] On Monday 29 April 2002 20:52, Ford, Mike [LSS] wrote: Well the ereg is looking for strings beginning with # but then the whole if expression is negated (!), so the statement it is 'ok' if the string doesn't start with '#' is correct. Oh! Yeah. Duh. (Retires sheepishly to corner with dunce's cap!) Cheers! Mike - Mike Ford, Electronic Information Services Adviser, Learning Support Services, Learning Information Services, JG125, James Graham Building, Leeds Metropolitan University, Beckett Park, LEEDS, LS6 3QS, United Kingdom Email: [EMAIL PROTECTED] Tel: +44 113 283 2600 extn 4730 Fax: +44 113 283 3211 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] image generation Problems (jpeg)
At 29.04.2002 20:02, you wrote: = PLEASE CC ALL AWNSERS TO [EMAIL PROTECTED] = hi, im having a few problems installing GD, ill start from the top: I need Jpeg support in my PHP installation, and unfortunatly, GD (the verison i have) does not support them, so i figure, ill install it, installing the libary jpeg-6b works easily however, i attempt to compile from there GD, but the following error is produced: [root gd-1.8.4]# make gcc -I. -I/usr/include/freetype2 -I/usr/include/X11 -I/usr/X11R6/include/X11 -I/usr/local/include -c -o gd_gd2.o gd_gd2.c In file included from /usr/include/errno.h:36, from gd_gd2.c:14: /usr/include/bits/errno.h:25: linux/errno.h: No such file or directory make: *** [gd_gd2.o] Error 1 I also tried recompiling PHP and got a similar error, which is very worrying, i think i might be missing some files Basically, waht i would really like, is a way to modify my CURRENT php config or my CURRENT gd config to take advantage of my shiny new jpeg libary, is there any method u can recommend to accomplish this? Thanks Peter = PLEASE CC ALL AWNSERS TO [EMAIL PROTECTED] == Check out the config file for gd, the path to the jpeg-6b must be included. There´s some problem of the order of the files, but there are more info in the config file. Also the path where the jpg libs are installed, is sometimes different, so you have to check them too. HTH Oliver -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] image generation Problems (jpeg)
On Monday 29 April 2002 20:02, Peter Revill wrote: hi, im having a few problems installing GD, ill start from the top: I need Jpeg support in my PHP installation, and unfortunatly, GD (the verison i have) does not support them, so i figure, ill install it, installing the libary jpeg-6b works easily however, i attempt to compile from there GD, but the following error is produced: It's usually a good idea to state what kind of setup you have (OS, version etc). [root gd-1.8.4]# make gcc -I. -I/usr/include/freetype2 -I/usr/include/X11 -I/usr/X11R6/include/X11 -I/usr/local/include -c -o gd_gd2.o gd_gd2.c In file included from /usr/include/errno.h:36, from gd_gd2.c:14: /usr/include/bits/errno.h:25: linux/errno.h: No such file or directory make: *** [gd_gd2.o] Error 1 Have you checked that you have the file linux/errno.h anywhere in your system? On my RH7.1 system, /usr/include/linux/errno.h is provided by kernel-headers, so if don't have it and you're using RH, install kernel-headers. If you're using something else check with your distro vendor. -- Jason Wong - Gremlins Associates - www.gremlins.com.hk Open Source Software Systems Integrators * Web Design Hosting * Internet Intranet Applications Development * /* That unit is a woman. A mass of conflicting impulses. -- Spock and Nomad, The Changeling, stardate 3541.9 */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] image generation Problems (jpeg)
Jason Wong wrote: On Monday 29 April 2002 20:02, Peter Revill wrote: hi, im having a few problems installing GD, ill start from the top: I need Jpeg support in my PHP installation, and unfortunatly, GD (the verison i have) does not support them, so i figure, ill install it, installing the libary jpeg-6b works easily however, i attempt to compile from there GD, but the following error is produced: It's usually a good idea to state what kind of setup you have (OS, version etc). Im not even sure myself, linux on 2.2.14 on what should be a redhat box i know theres a command something like dsmod to get the info, hmm.. oot gd-1.8.4]# make gcc -I. -I/usr/include/freetype2 -I/usr/include/X11 -I/usr/X11R6/include/X11 -I/usr/local/include -c -o gd_gd2.o gd_gd2.c In file included from /usr/include/errno.h:36, from gd_gd2.c:14: /usr/include/bits/errno.h:25: linux/errno.h: No such file or directory make: *** [gd_gd2.o] Error 1 Have you checked that you have the file linux/errno.h anywhere in your system? yes, but it wasnt around, errno.h was, but not errno.h like that On my RH7.1 system, /usr/include/linux/errno.h is provided by kernel-headers, so if don't have it and you're using RH, install kernel-headers. If you're using something else check with your distro vendor. i found the kernel-headers package, but it msut be damaged or something (rpm --query says it exists, but i have my doubts as to the files still existing) is it OK to install kernel headers of a diffirent kernel number? i.e. if i install kernel-headers 2.4.1 or wahtever is that ok? or will that cause problems? (im betting money on it will cause problems) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] image generation Problems (jpeg)
On Monday 29 April 2002 21:40, Peter Revill wrote: Im not even sure myself, linux on 2.2.14 on what should be a redhat box i know theres a command something like dsmod to get the info, hmm.. Never mind, as long as you're reasonably sure it's a RH system you're running on . Have you checked that you have the file linux/errno.h anywhere in your system? yes, but it wasnt around, errno.h was, but not errno.h like that So there's your problem :) i found the kernel-headers package, but it msut be damaged or something (rpm --query says it exists, but i have my doubts as to the files still existing) rpm -ql kernel-headers Would show you what files kernel-headers had installed. is it OK to install kernel headers of a diffirent kernel number? I don't know. But if you do try it, let us know what happens :) i.e. if i install kernel-headers 2.4.1 or wahtever is that ok? or will that cause problems? (im betting money on it will cause problems) If there aren't any special reasons, I would just use the corresponding headers for your kernel. -- Jason Wong - Gremlins Associates - www.gremlins.com.hk Open Source Software Systems Integrators * Web Design Hosting * Internet Intranet Applications Development * /* Silence is the only virtue you have left. */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] image generation Problems (jpeg)
Jason Wong wrote: On Monday 29 April 2002 21:40, Peter Revill wrote: Im not even sure myself, linux on 2.2.14 on what should be a redhat box i know theres a command something like dsmod to get the info, hmm.. Never mind, as long as you're reasonably sure it's a RH system you're running on . Its a colbat cube running some sort of modified linux, i think based on Redhat i doint know what kind of colbat cube Have you checked that you have the file linux/errno.h anywhere in your system? yes, but it wasnt around, errno.h was, but not errno.h like that So there's your problem :) Yer, i think that must be it i found the kernel-headers package, but it msut be damaged or something (rpm --query says it exists, but i have my doubts as to the files still existing) rpm -ql kernel-headers yep, returns kernel-headers-2.2.14C11-1 If there aren't any special reasons, I would just use the corresponding headers for your kernel. There is a special reason, namely: i cant find: kernel-headers-2.2.14C11-1.rpm anywhere :~( -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Null character as field seperator in a string.
On Monday 29 April 2002 18:26, Dave MacRae wrote: For historic reasons, I have a file that contains a number of records in which the fields are seperated by the NULL character, i.e, field1\0field2\0field3\0field4 I need to parse out the fields from this string. The string is read into the program using $buffer = fgets(...). This would be no problem in Perl or C but I cannot get this to work in PHP. I have tried using preg_split(/\0/, $buffer); But this fails. I've tried walking through the string but it seems that $buffer only has the content up to the first NULL character. Try using fread() to get your file (it's binary safe). Then use: explode(chr(0), $buffer); to separate your fields. I'm beginning to think this may be the only solution. I now have to figure out how to process the records as I'm looking for the data in a particular line in the file, this should be fairly easy. Thanks. Dave -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] image generation Problems (jpeg)
At 29.04.2002 15:24, you wrote: At 29.04.2002 20:02, you wrote: = PLEASE CC ALL AWNSERS TO [EMAIL PROTECTED] = hi, im having a few problems installing GD, ill start from the top: I need Jpeg support in my PHP installation, and unfortunatly, GD (the verison i have) does not support them, so i figure, ill install it, installing the libary jpeg-6b works easily however, i attempt to compile from there GD, but the following error is produced: [root gd-1.8.4]# make gcc -I. -I/usr/include/freetype2 -I/usr/include/X11 -I/usr/X11R6/include/X11 -I/usr/local/include -c -o gd_gd2.o gd_gd2.c In file included from /usr/include/errno.h:36, from gd_gd2.c:14: /usr/include/bits/errno.h:25: linux/errno.h: No such file or directory make: *** [gd_gd2.o] Error 1 I also tried recompiling PHP and got a similar error, which is very worrying, i think i might be missing some files Basically, waht i would really like, is a way to modify my CURRENT php config or my CURRENT gd config to take advantage of my shiny new jpeg libary, is there any method u can recommend to accomplish this? Thanks Peter = PLEASE CC ALL AWNSERS TO [EMAIL PROTECTED] == Check out the config file for gd, the path to the jpeg-6b must be included. There´s some problem of the order of the files, but there are more info in the config file. Also the path where the jpg libs are installed, is sometimes different, so you have to check them too. HTH Oliver TYPO Oops I meant makefile for gd instead of config file -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] return multiple value from function
Hi List, I am new to php programming and wanted to know if it is possible to return multiple value from a function like cgi programs. How can I get the following result using php. ($var1, $var2) = myfunction($a,$b); function myfunction($c,$d) { // code // code return ($e,$f); } -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] return multiple value from function
no, it's not possible to do it that way. If you need to return multiple values from a function, your best bet is to return an array or some kind of record structure. By design, in almost all languages, functions only return a single value. =C= * * Cal Evans * Journeyman Programmer * Techno-Mage * http://www.calevans.com * -Original Message- From: sanjay [mailto:[EMAIL PROTECTED]] Sent: Monday, April 29, 2002 9:11 AM To: [EMAIL PROTECTED] Subject: [PHP] return multiple value from function Hi List, I am new to php programming and wanted to know if it is possible to return multiple value from a function like cgi programs. How can I get the following result using php. ($var1, $var2) = myfunction($a,$b); function myfunction($c,$d) { // code // code return ($e,$f); } -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] return multiple value from function
?php function funca($a,$b) { $q=$a; $w=$b; return array($w,$q); } $e=123; $r=456; list($z,$x) = funca($e,$r); print $z, $x\n; ? - Original Message - From: sanjay [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Monday, April 29, 2002 9:11 AM Subject: [PHP] return multiple value from function Hi List, I am new to php programming and wanted to know if it is possible to return multiple value from a function like cgi programs. How can I get the following result using php. ($var1, $var2) = myfunction($a,$b); function myfunction($c,$d) { // code // code return ($e,$f); } -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: AW: [PHP] Java-Object
Bedilu Habte wrote: print_r($result); resulted in: Objectjava Object ( [0] = 2 ) var_dump($result); had given me: object(java)(1) { [0]= int(2) } it means that you have an object with a property field of type integer and a value of 2. possibly nmot what you want or need. but it could mean that you did something wrong in the usage of the class or in the usage of java with php in general. what irritates me a bit is the java in the brackets of the var_dump output, that could mean that the object is somehow of type java or something like that could it be one has to transform that to use it in php? are you sure you did everything right with the java/php combination? did you test that with other, easier things? did you test the class on the command line with success? did you read the manual of everything that is involved in your task? ok, that should be everything i have to say about that, as i said, i have no experience in using java classes from php. i could only help you until now in finding out more about the data and type of your object... henning -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] build array dinamicaly
Hi list, I want to buil an multidimensional array with the results of Mysql, but I don't know how to do it. What I need is: SELECT name,adress from tbl_. array name will receive the names array adress will receive the adresses and array clientes will contain both, so when i try to access i will have something like $cliente['nome'][0] or $clientes['adress'][1] and so on. Someone can help??? Thank's in advace Rodrigo Peres -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] return multiple value from function
On Monday 29 April 2002 22:11, sanjay wrote: Hi List, I am new to php programming and wanted to know if it is possible to return multiple value from a function like cgi programs. How can I get the following result using php. ($var1, $var2) = myfunction($a,$b); function myfunction($c,$d) { // code // code return ($e,$f); } No. But it is possible to get similar results. a) Return an array $result = myfunction($a, $b); echo $result['e']; echo $result['f']; function myfunction($c, $d) { do something $result['e'] = $this_is_e; $result['f'] = $this_is_f; return $result; } b) Use references myfunction($c, $d, $e, $f); echo $e; echo $f; function myfunction($c, $d, $e, $f) { do something $e = $this_is_e; $f = $this_is_f; } -- Jason Wong - Gremlins Associates - www.gremlins.com.hk Open Source Software Systems Integrators * Web Design Hosting * Internet Intranet Applications Development * /* I didn't know it was impossible when I did it. */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] return multiple value from function
Best you can do is return an array and call it like this: function myfunction($a,$b) { $r[0] = $a + 1; $r[1] = $b + 1; return $r; } list($c,$d) = myfunction(10,20); Adapt to your needs. ---John Holmes... - Original Message - From: sanjay [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Monday, April 29, 2002 10:11 AM Subject: [PHP] return multiple value from function Hi List, I am new to php programming and wanted to know if it is possible to return multiple value from a function like cgi programs. How can I get the following result using php. ($var1, $var2) = myfunction($a,$b); function myfunction($c,$d) { // code // code return ($e,$f); } -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: build array dinamicaly
$name = Array(); $address = Array(); $clients = Array('nome' = 0, 'address' = 0); $i = 0; while (list($client_name, $cliente_add) = mysql_fetch_array($res)) { $name[$i] = $client_name; $address[$i] = $client_address $clients['nome'][$i] = $client_name; $clients['address'][$i] = $clients_address; $i++; } Alguma coisa do genero :-) -- Julio Nobrega. Um dia eu chego lá: http://sourceforge.net/projects/toca Ajudei? Salvei? Que tal um presentinho? http://www.submarino.com.br/wishlistclient.asp?wlid=664176742884 Rodrigo Peres [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Hi list, I want to buil an multidimensional array with the results of Mysql, but I don't know how to do it. What I need is: SELECT name,adress from tbl_. array name will receive the names array adress will receive the adresses and array clientes will contain both, so when i try to access i will have something like $cliente['nome'][0] or $clientes['adress'][1] and so on. Someone can help??? Thank's in advace Rodrigo Peres -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] image generation Problems (jpeg)
On Monday 29 April 2002 21:55, Peter Revill wrote: Its a colbat cube running some sort of modified linux, i think based on Redhat i doint know what kind of colbat cube I presume you mean Colbalt ;-) in which case you cannot use the RH rpms. If there aren't any special reasons, I would just use the corresponding headers for your kernel. There is a special reason, namely: i cant find: kernel-headers-2.2.14C11-1.rpm anywhere :~( Well, you can try installing a newer kernel-headers, I don't know what effect it will have. Or your better bet is to upgrade the kernel as well. -- Jason Wong - Gremlins Associates - www.gremlins.com.hk Open Source Software Systems Integrators * Web Design Hosting * Internet Intranet Applications Development * /* Wouldn't this be a great world if being insecure and desperate were a turn-on? -- Broadcast News */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] $this-
I am not an expert at PHP and have been learning it through questions, books, online help, etc I guess like most people. :) Anyway, I see a lot of scripts that use $this-something and was wondering if this was just another variable or if the - has any special meaning. One script from the PHPLIB (menu.inc) has this: $this-setup(); and there are no other times in that .inc file that lists that. The only other thing that comes close is just the funtion setup(). This is not the only program that I see this in and am just wondering about it and trying to see if it is something that I should be using in my scripts. The only time that I use this is when getting results from a mysql query like this: $result=mysql_query(SELECT $team from games where game_id = '$game_id'); while (($row = mysql_fetch_object($result))){ $input = $row-$team; Hopefully somebody can explain this to me. Thanks in Advance Steve -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] parse errors not displayed (2nd time I ask!)
*This message was transferred with a trial version of CommuniGate(tm) Pro* Hi, I am sorry I ask this for a second time. Come on guys ! I am sure somebody can help, please I set my own error handler. It is in a file general_includes.php (please find it below) and all pages do a require on it. It works Ok with the exception of parse errors. They are not trapped by my error handler (which I know it's the expected behaivor) but they don't either show up in the browser. My php.ini file has: display_errors = On error_reporting = E_ALL E_NOTICE And general_includes.php is: ?php // Esto se ejecutara en todos los ficheros que incluyan a este fichero error_reporting( E_ALL ^ E_NOTICE ); $old_error_handler = set_error_handler(userErrorHandler); function userErrorHandler ($errno, $errmsg, $filename, $linenum, $vars) { $dt = date(d-m-Y H:i:s); // Paso del path $filename = basename ( $filename ); // Define an assoc array of error string. In reality the only entries we should // consider are 2,8,256,512 and 1024 $errortype = array ( 1 = Error, 2 = Warning, 4 = Parsing Error, 8 = Notice, 16 = Core Error, 32 = Core Warning, 64 = Compile Error, 128 = Compile Warning, 256 = User Error, 512 = User Warning, 1024= User Notice ); // Errors for which execution can go on. $errores_suaves = array(E_WARNING, E_NOTICE, E_USER_NOTICE); $err = errorentry\n; $err .= \tdatetime.$dt./datetime\n; $err .= \terrornum.$errno./errornum\n; $err .= \terrortype.$errortype[$errno]./errortype\n; $err .= \terrormsg.$errmsg./errormsg\n; $err .= \tscriptname.$filename./scriptname\n; $err .= \tscriptlinenum.$linenum./scriptlinenum\n; $err .= /errorentry\n\n; // For testing. NOTICE errors do not disturb the browser but are immediatly shown // to the programmer. Remaining errors are displayed in the browser. if ( ( $errno == E_USER_NOTICE ) || ( $errno == E_NOTICE ) ) system (echo $errno $errortype[$errno] $errmsg $filename $linenum | write pedro pts/0 ); else echo br=br$err brbr; // My own log method, which eventualy sends an email logea ( C_ERROR_DEL_HANDLER, 0, $filename, $err ); // Stop processing if serious error if ( ! in_array($errno, $errores_suaves) ) die(Error Interno. Por favor pruebe más tarde); } ? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] $this-
Hi, Steve. $this refers to a specific instance of a class. The - accesses a property or method associated with this class. So, in your class, say it's class car, and in your constructor you want to initialize the color to red, you'd do $this-color = $red; Outside of the class, with your $car variable, you'd change it by using $car-color = $red; It's similar to the Java . accessor (and the this is also similar to Java's this). I hope this helped! -Natalie -Original Message- From: Steve Buehler [mailto:[EMAIL PROTECTED]] Sent: Monday, April 29, 2002 10:38 AM To: [EMAIL PROTECTED] Subject: [PHP] $this- I am not an expert at PHP and have been learning it through questions, books, online help, etc I guess like most people. :) Anyway, I see a lot of scripts that use $this-something and was wondering if this was just another variable or if the - has any special meaning. One script from the PHPLIB (menu.inc) has this: $this-setup(); and there are no other times in that .inc file that lists that. The only other thing that comes close is just the funtion setup(). This is not the only program that I see this in and am just wondering about it and trying to see if it is something that I should be using in my scripts. The only time that I use this is when getting results from a mysql query like this: $result=mysql_query(SELECT $team from games where game_id = '$game_id'); while (($row = mysql_fetch_object($result))){ $input = $row-$team; Hopefully somebody can explain this to me. Thanks in Advance Steve -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] $this-
It's used in object oriented programming (OOP) with classes. $this refers to the current object. So $this-setup() in PHPLib is referring to the setup() function within the object. You can get a better explanation and examples by reading the manual page on OOP. http://www.php.net/manual/en/language.oop.php ---John Holmes... - Original Message - From: Steve Buehler [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Monday, April 29, 2002 10:37 AM Subject: [PHP] $this- I am not an expert at PHP and have been learning it through questions, books, online help, etc I guess like most people. :) Anyway, I see a lot of scripts that use $this-something and was wondering if this was just another variable or if the - has any special meaning. One script from the PHPLIB (menu.inc) has this: $this-setup(); and there are no other times in that .inc file that lists that. The only other thing that comes close is just the funtion setup(). This is not the only program that I see this in and am just wondering about it and trying to see if it is something that I should be using in my scripts. The only time that I use this is when getting results from a mysql query like this: $result=mysql_query(SELECT $team from games where game_id = '$game_id'); while (($row = mysql_fetch_object($result))){ $input = $row-$team; Hopefully somebody can explain this to me. Thanks in Advance Steve -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] _SERVER variable insd prnt sttmnt
Hi All, Thanks alot for all your help with the _SERVER['PHP_SELF'] earlier, I have another question related to that: What is the correct syntax for the above if I want to use it in a print statement like so (I included the whole piece of code so you guys could at least see what I'm trying to do): $string=ABCDEFGHIJKLMNOPQRSTUVWXYZ; $chars = preg_split('//', $string, -1, PREG_SPLIT_NO_EMPTY); for ($cnt=0; $cnt 26; $cnt++) { //commented out the next line since I couldn't get it to work //print LIA HREF='$_SERVER['PHP_SELF']?letter=$chars[$cnt]' . $chars[$cnt] . /A/LI; print LIA HREF='$PHP_SELF?letter=$chars[$cnt]' . $chars[$cnt] . /A/LI; } Now that I'm learning a bit about running with register_globals = Off I will try to implement it everywhere I can! -Kirk side msg: big thanx to Nathan for the short tutorial on globals and security -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] $this-
Thanks to Natalie, Jason and John. Plus anybody who responds after this email. I will have to do some reading up on this now to see if and where i can use this. Thanks Again Steve At 09:50 AM 4/29/2002, 1LT John W. Holmes wrote: It's used in object oriented programming (OOP) with classes. $this refers to the current object. So $this-setup() in PHPLib is referring to the setup() function within the object. You can get a better explanation and examples by reading the manual page on OOP. http://www.php.net/manual/en/language.oop.php ---John Holmes... - Original Message - From: Steve Buehler [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Monday, April 29, 2002 10:37 AM Subject: [PHP] $this- I am not an expert at PHP and have been learning it through questions, books, online help, etc I guess like most people. :) Anyway, I see a lot of scripts that use $this-something and was wondering if this was just another variable or if the - has any special meaning. One script from the PHPLIB (menu.inc) has this: $this-setup(); and there are no other times in that .inc file that lists that. The only other thing that comes close is just the funtion setup(). This is not the only program that I see this in and am just wondering about it and trying to see if it is something that I should be using in my scripts. The only time that I use this is when getting results from a mysql query like this: $result=mysql_query(SELECT $team from games where game_id = '$game_id'); while (($row = mysql_fetch_object($result))){ $input = $row-$team; Hopefully somebody can explain this to me. Thanks in Advance Steve -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] _SERVER variable insd prnt sttmnt
On Monday 29 April 2002 23:05, Kirk Babb wrote: Hi All, Thanks alot for all your help with the _SERVER['PHP_SELF'] earlier, I have another question related to that: What is the correct syntax for the above if I want to use it in a print statement like so (I included the whole piece of code so you guys could at least see what I'm trying to do): $string=ABCDEFGHIJKLMNOPQRSTUVWXYZ; $chars = preg_split('//', $string, -1, PREG_SPLIT_NO_EMPTY); for ($cnt=0; $cnt 26; $cnt++) { //commented out the next line since I couldn't get it to work //print LIA HREF='$_SERVER['PHP_SELF']?letter=$chars[$cnt]' . Normally you would use: $_SERVER['PHP_SELF'] But inside a double-quoted string like above you would use: $_SERVER[PHP_SELF] -- Jason Wong - Gremlins Associates - www.gremlins.com.hk Open Source Software Systems Integrators * Web Design Hosting * Internet Intranet Applications Development * /* Work expands to fill the time available. -- Cyril Northcote Parkinson, The Economist, 1955 */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Text File Formating.
Hi there, I have got various text files which I need to convert on the fly to HTML with PHP. How do I convert this: --- TEXT --- CHART RETURN Chart Date: blah No. Artist - 'Track (Remix)' (Label) 1. blah - 'blah (blah mix)' (blah) --- END TEXT--- to this: --- HTML --- CHART RETURNbr / br / Chart Date: blahbr / br / No. Artist - 'Track (Remix)' (Label)br / br / 1. blah - 'blah (blah mix)' (blah)br / --- END TEXT--- Any help much appreciated, Ian. --- Randum Ian DJ / Reviewer / Webmaster, DancePortal (UK) Limited [EMAIL PROTECTED] http://www.danceportal.co.uk DancePortal.co.uk - Global dance music media -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Text File Formating.
the manual is your friend. http://www.php.net/manual/en/function.nl2br.php * * Cal Evans * Journeyman Programmer * Techno-Mage * http://www.calevans.com * -Original Message- From: Randum Ian [mailto:[EMAIL PROTECTED]] Sent: Monday, April 29, 2002 10:20 AM To: PHP Subject: [PHP] Text File Formating. Hi there, I have got various text files which I need to convert on the fly to HTML with PHP. How do I convert this: --- TEXT --- CHART RETURN Chart Date: blah No. Artist - 'Track (Remix)' (Label) 1. blah - 'blah (blah mix)' (blah) --- END TEXT--- to this: --- HTML --- CHART RETURNbr / br / Chart Date: blahbr / br / No. Artist - 'Track (Remix)' (Label)br / br / 1. blah - 'blah (blah mix)' (blah)br / --- END TEXT--- Any help much appreciated, Ian. --- Randum Ian DJ / Reviewer / Webmaster, DancePortal (UK) Limited [EMAIL PROTECTED] http://www.danceportal.co.uk DancePortal.co.uk - Global dance music media -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Secure MySQL connections in PHP with 'stunnel'
Hello all I have written a very simple PHP script to copy the data from one MySQL database table on SERVERA to another MySQL database table on SERVERB. Using PHP, I simply connect to each server and copy the data across. That works well. However, natively, MySQL works with clear text. i.e. the data is copied across the Internet in clear text (a bad thing). I would now like encrypt the MySQL data between SERVERA and SERVERB. After searching with Google, I see that stunnel is a tool to use. However, I have been trying with no avail to create an encrypted connection between the two servers from MySQL to work. Following the instructions at: http://www.zataz.net/php-stunnel-tuneling.php I have come up with the following: SERVERA (master) /usr/local/sbin/stunnel -f -P/tmp/ -c -d 3308 -r SERVERA:3307 /usr/local/sbin/stunnel -f -P/tmp/ -p /usr/local/ssl/certs/stunnel.pem -d 3307 -r 3306 SERVERB (slave) /usr/local/sbin/stunnel -f -P/tmp/ -c -d 3308 -r SERVERB:3307 /usr/local/sbin/stunnel -f -P/tmp/ -p /usr/local/ssl/certs/stunnel.pem -d 3307 -r 3306 This does not work. When I connect to the slave with: ?PHP $db_link = mysql_connect(SERVERB:3308, User, Pwd) or die(Cannot connect to db); mysql_select_db(DBNAME,$db_link) or die(Cannot select MASTER db\n); ? and select / insert data into SERVERB, the data is selected / inserted to the database on SERVERA. This is very strange. Has anyone else tried using stunnel to achieve what I want to do? If so, I would REALLY like to hear how you achieve the encrypted link. Or are there other ways of securely coping data from one MySQL server to another? Using stunnel seems rather fiddly Any comments on this subject will be well received. Stefen _ Chat with friends online, try MSN Messenger: http://messenger.msn.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] _SERVER variable insd prnt sttmnt
//print LIA HREF='$_SERVER['PHP_SELF']?letter=$chars[$cnt]' . This is the problem with not breaking out of a string to display a variable. Ideally, you would do it this way: print LIA HREF=' . $_SERVER['PHP_SELF'] . ?letter= . $chars[$cnt] . '; But some people just have a problem with doing it that way, so you can use braces. print LIA HREF='{$_SERVER['PHP_SELF']}?letter={$chars[$cnt]}'; If you don't use the braces, how is PHP supposed to know what you mean. Do you mean to print a variable called $_SERVER, followed by a literal ['PHP_SELF'], or do you mean an array? How is PHP supposed to decide for you? Like your second variable, $chars. Is that an array? Do you mean to print out the value of an $chars element, or do you mean to print out value of $char, followed by [, value of $cnt, followed by ] ?? Hope that helps. ---John Holmes... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] javascript and PHP
Does anybody know of a good/short tutorial about passing variables from JavaScript to/from PHP? For example, how to do the following: html head SCRIPT LANGUAGE=JavaScript data = hello world; /script /head body ? echo $databr; ? /body /html The above might at least give me a clue. Just a note. I really know nothing to speak of about JavaScript. Thanks in Advance Steve
RE: [PHP] Secure MySQL connections in PHP with 'stunnel'
My suggestion, if you just want to move data between the 2 servers, is to mysqldump to a file, scp the file to the destination server and then mysql filename to get it into the second server. You can't do it under programmatic control but it will work and your data will remain secure in transport. =C= * * Cal Evans * Journeyman Programmer * Techno-Mage * http://www.calevans.com * -Original Message- From: Stefen Lars [mailto:[EMAIL PROTECTED]] Sent: Monday, April 29, 2002 10:24 AM To: [EMAIL PROTECTED] Subject: [PHP] Secure MySQL connections in PHP with 'stunnel' Hello all I have written a very simple PHP script to copy the data from one MySQL database table on SERVERA to another MySQL database table on SERVERB. Using PHP, I simply connect to each server and copy the data across. That works well. However, natively, MySQL works with clear text. i.e. the data is copied across the Internet in clear text (a bad thing). I would now like encrypt the MySQL data between SERVERA and SERVERB. After searching with Google, I see that stunnel is a tool to use. However, I have been trying with no avail to create an encrypted connection between the two servers from MySQL to work. Following the instructions at: http://www.zataz.net/php-stunnel-tuneling.php I have come up with the following: SERVERA (master) /usr/local/sbin/stunnel -f -P/tmp/ -c -d 3308 -r SERVERA:3307 /usr/local/sbin/stunnel -f -P/tmp/ -p /usr/local/ssl/certs/stunnel.pem -d 3307 -r 3306 SERVERB (slave) /usr/local/sbin/stunnel -f -P/tmp/ -c -d 3308 -r SERVERB:3307 /usr/local/sbin/stunnel -f -P/tmp/ -p /usr/local/ssl/certs/stunnel.pem -d 3307 -r 3306 This does not work. When I connect to the slave with: ?PHP $db_link = mysql_connect(SERVERB:3308, User, Pwd) or die(Cannot connect to db); mysql_select_db(DBNAME,$db_link) or die(Cannot select MASTER db\n); ? and select / insert data into SERVERB, the data is selected / inserted to the database on SERVERA. This is very strange. Has anyone else tried using stunnel to achieve what I want to do? If so, I would REALLY like to hear how you achieve the encrypted link. Or are there other ways of securely coping data from one MySQL server to another? Using stunnel seems rather fiddly Any comments on this subject will be well received. Stefen _ Chat with friends online, try MSN Messenger: http://messenger.msn.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] javascript and PHP
since php runs on the server, not on the client, you have to pass the value of data back to the server. Normally, this is done via a GET or a POST from a form or by building a URL and using javascript to load it. (i.e. document.location = 'http://myserver.com/mypage.php?data=Hello%20World';) Then your PHP script can execute and see the value of $_GET['data'] HTH, Cal * * Cal Evans * Journeyman Programmer * Techno-Mage * http://www.calevans.com * -Original Message- From: Steve Buehler [mailto:[EMAIL PROTECTED]] Sent: Monday, April 29, 2002 10:30 AM To: [EMAIL PROTECTED] Subject: [PHP] javascript and PHP Does anybody know of a good/short tutorial about passing variables from JavaScript to/from PHP? For example, how to do the following: html head SCRIPT LANGUAGE=JavaScript data = hello world; /script /head body ? echo $databr; ? /body /html The above might at least give me a clue. Just a note. I really know nothing to speak of about JavaScript. Thanks in Advance Steve -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] javascript and PHP
Ok. My last post didn't go throught the list software because of the tags. I am replacing the and 's with *'s now so that hopefully it will go through so that people can see it. --Original message Does anybody know of a good/short tutorial about passing variables from JavaScript to/from PHP? For example, how to do the following: *html* *head* *SCRIPT LANGUAGE=JavaScript* $data = hello world; */script* */head* *body* *? echo $data*br*; ?* */body* */html* The above might at least give me a clue. Just a note. I really know nothing to speak of about JavaScript. Thanks in Advance Steve -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Random number Question
Try something like this and see if it works??? ? $another = 'a'; if (isset($guess)) $another = 'another'; echo form action='number.php' method='post' BR The computer has picked $another number between 1 and 10.BR Guess the number and you win!BR BR Enter your guess: input type='text' size='3' INPUT TYPE='submit' VALUE='Submit my number' NAME='guess' /form; if (isset($guess)) { srand((double)microtime()*100); $number = rand(1,10); echo The number is: $numberBR; if ($guess == $number) { echo 'BRYou have won!'; }else{ echo BRSorry that wasn't the answer; } } ? = Jennifer Downey wrote: Hi all, I having a hard time understanding why this won't work. I have a form which is suppose to pass the guess to the script. Here it is: the form is guess.php: form action=number.php method=post The computer has picked a number between 1 and 10. Guess the number and you win!BR Enter your guess: input type=text size=3 INPUT TYPE=submit VALUE=Submit my number NAME=guess /form The script is number.php: ?php echoThe number is:; srand((double)microtime()*100); $number = rand(1,10); echo $number; if($guess = = $number) { echoBRYou have won!; }else{ print(BRSorry that wasn't the answer); } ? Any help would be appreciated. Thanks in advance Jennifer Downey -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] xml/xslt capability?
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Hi all I want to get started with xml/xslt, I've read a few things about sablotron but am unsure what support my host is running. If any of you know anything about this subject would you be kind enough to look at the phpinfo() I've set up here: http://www.explodingnet.com/phpinfo.php and let me know your thoughts as to what i have/need to get cracking? many thanks... - -- Nick Wilson // www.explodingnet.com -BEGIN PGP SIGNATURE- Version: GnuPG v1.0.6 (GNU/Linux) iD8DBQE8zWnJHpvrrTa6L5oRAv5DAJ9Fp8vq7+PPqIiM1Mnqf5sGZlhD5wCfWqan TWH60NiXJh5ESsHP0QNLsUY= =dJq7 -END PGP SIGNATURE- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] javascript and PHP
All you can do is use PHP to print out Javascript code. ? $data = hello world; ? script language=javascript var something; something = '?=$data?'; /script etc...It's no different than using PHP to print out HTML code. Now, if you want to get that Javascript variable something sent back to PHP, you have to assign it to a form element or tack it onto a URL. ---John Holmes... - Original Message - From: Steve Buehler [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Monday, April 29, 2002 11:29 AM Subject: [PHP] javascript and PHP Does anybody know of a good/short tutorial about passing variables from JavaScript to/from PHP? For example, how to do the following: html head SCRIPT LANGUAGE=JavaScript data = hello world; /script /head body ? echo $databr; ? /body /html The above might at least give me a clue. Just a note. I really know nothing to speak of about JavaScript. Thanks in Advance Steve -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] xml/xslt capability?
Only one letter difference between PGP and PHP yet makes no sense... ;) -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 -BEGIN PGP SIGNATURE- Version: GnuPG v1.0.6 (GNU/Linux) iD8DBQE8zWnJHpvrrTa6L5oRAv5DAJ9Fp8vq7+PPqIiM1Mnqf5sGZlhD5wCfWqan TWH60NiXJh5ESsHP0QNLsUY= =dJq7 -END PGP SIGNATURE- Kiko -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] javascript and PHP
This is what I do in one of my programs. I set hidden values in my HTML and then JS can access them, change them, and then when the form is submitted (JS can do that too if you want it to be automatic) the PHP reads in the hidden values. -Natalie -Original Message- From: 1LT John W. Holmes [mailto:[EMAIL PROTECTED]] Sent: Monday, April 29, 2002 11:40 AM To: [EMAIL PROTECTED]; Steve Buehler Subject: Re: [PHP] javascript and PHP All you can do is use PHP to print out Javascript code. ? $data = hello world; ? script language=javascript var something; something = '?=$data?'; /script etc...It's no different than using PHP to print out HTML code. Now, if you want to get that Javascript variable something sent back to PHP, you have to assign it to a form element or tack it onto a URL. ---John Holmes... - Original Message - From: Steve Buehler [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Monday, April 29, 2002 11:29 AM Subject: [PHP] javascript and PHP Does anybody know of a good/short tutorial about passing variables from JavaScript to/from PHP? For example, how to do the following: html head SCRIPT LANGUAGE=JavaScript data = hello world; /script /head body ? echo $databr; ? /body /html The above might at least give me a clue. Just a note. I really know nothing to speak of about JavaScript. Thanks in Advance Steve -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Secure MySQL connections in PHP with 'stunnel'
Thank you Carl, for your suggestion. You are correct. In this case, it would be possible to use mysqldump to create a file, then SSH to transfer it and then pipe it into the database. However, I am interested in learning how to connect directly to the MySQL port, as in a second step of the project I am working on, various data from various servers will be handled. The 'dump to a file' approach, while fine in my little example below, will no longer be manageable in step two. Do you have any experience with stunnel or indeed, any other method of securely transferring data between 2 MySQL servers?? Stefen From: Cal Evans [EMAIL PROTECTED] Reply-To: [EMAIL PROTECTED] To: Stefen Lars [EMAIL PROTECTED], [EMAIL PROTECTED] Subject: RE: [PHP] Secure MySQL connections in PHP with 'stunnel' Date: Mon, 29 Apr 2002 10:31:00 -0500 My suggestion, if you just want to move data between the 2 servers, is to mysqldump to a file, scp the file to the destination server and then mysql filename to get it into the second server. You can't do it under programmatic control but it will work and your data will remain secure in transport. =C= * * Cal Evans * Journeyman Programmer * Techno-Mage * http://www.calevans.com * -Original Message- From: Stefen Lars [mailto:[EMAIL PROTECTED]] Sent: Monday, April 29, 2002 10:24 AM To: [EMAIL PROTECTED] Subject: [PHP] Secure MySQL connections in PHP with 'stunnel' Hello all I have written a very simple PHP script to copy the data from one MySQL database table on SERVERA to another MySQL database table on SERVERB. Using PHP, I simply connect to each server and copy the data across. That works well. However, natively, MySQL works with clear text. i.e. the data is copied across the Internet in clear text (a bad thing). I would now like encrypt the MySQL data between SERVERA and SERVERB. After searching with Google, I see that stunnel is a tool to use. However, I have been trying with no avail to create an encrypted connection between the two servers from MySQL to work. Following the instructions at: http://www.zataz.net/php-stunnel-tuneling.php I have come up with the following: SERVERA (master) /usr/local/sbin/stunnel -f -P/tmp/ -c -d 3308 -r SERVERA:3307 /usr/local/sbin/stunnel -f -P/tmp/ -p /usr/local/ssl/certs/stunnel.pem -d 3307 -r 3306 SERVERB (slave) /usr/local/sbin/stunnel -f -P/tmp/ -c -d 3308 -r SERVERB:3307 /usr/local/sbin/stunnel -f -P/tmp/ -p /usr/local/ssl/certs/stunnel.pem -d 3307 -r 3306 This does not work. When I connect to the slave with: ?PHP $db_link = mysql_connect(SERVERB:3308, User, Pwd) or die(Cannot connect to db); mysql_select_db(DBNAME,$db_link) or die(Cannot select MASTER db\n); ? and select / insert data into SERVERB, the data is selected / inserted to the database on SERVERA. This is very strange. Has anyone else tried using stunnel to achieve what I want to do? If so, I would REALLY like to hear how you achieve the encrypted link. Or are there other ways of securely coping data from one MySQL server to another? Using stunnel seems rather fiddly Any comments on this subject will be well received. Stefen _ Chat with friends online, try MSN Messenger: http://messenger.msn.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php _ Join the worlds largest e-mail service with MSN Hotmail. http://www.hotmail.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] parse errors not displayed (2nd time I ask!)
Just fix your parse errors. Who cares what error handler it goes to. Are you going to release code with parse errors in it and do you really want to get an email each time someone gets one? ---John Holmes... - Original Message - From: Pedro Garre [EMAIL PROTECTED] To: php-general [EMAIL PROTECTED] Sent: Monday, April 29, 2002 5:37 PM Subject: [PHP] parse errors not displayed (2nd time I ask!) *This message was transferred with a trial version of CommuniGate(tm) Pro* Hi, I am sorry I ask this for a second time. Come on guys ! I am sure somebody can help, please I set my own error handler. It is in a file general_includes.php (please find it below) and all pages do a require on it. It works Ok with the exception of parse errors. They are not trapped by my error handler (which I know it's the expected behaivor) but they don't either show up in the browser. My php.ini file has: display_errors = On error_reporting = E_ALL E_NOTICE And general_includes.php is: ?php // Esto se ejecutara en todos los ficheros que incluyan a este fichero error_reporting( E_ALL ^ E_NOTICE ); $old_error_handler = set_error_handler(userErrorHandler); function userErrorHandler ($errno, $errmsg, $filename, $linenum, $vars) { $dt = date(d-m-Y H:i:s); // Paso del path $filename = basename ( $filename ); // Define an assoc array of error string. In reality the only entries we should // consider are 2,8,256,512 and 1024 $errortype = array ( 1 = Error, 2 = Warning, 4 = Parsing Error, 8 = Notice, 16 = Core Error, 32 = Core Warning, 64 = Compile Error, 128 = Compile Warning, 256 = User Error, 512 = User Warning, 1024= User Notice ); // Errors for which execution can go on. $errores_suaves = array(E_WARNING, E_NOTICE, E_USER_NOTICE); $err = errorentry\n; $err .= \tdatetime.$dt./datetime\n; $err .= \terrornum.$errno./errornum\n; $err .= \terrortype.$errortype[$errno]./errortype\n; $err .= \terrormsg.$errmsg./errormsg\n; $err .= \tscriptname.$filename./scriptname\n; $err .= \tscriptlinenum.$linenum./scriptlinenum\n; $err .= /errorentry\n\n; // For testing. NOTICE errors do not disturb the browser but are immediatly shown // to the programmer. Remaining errors are displayed in the browser. if ( ( $errno == E_USER_NOTICE ) || ( $errno == E_NOTICE ) ) system (echo $errno $errortype[$errno] $errmsg $filename $linenum | write pedro pts/0 ); else echo br=br$err brbr; // My own log method, which eventualy sends an email logea ( C_ERROR_DEL_HANDLER, 0, $filename, $err ); // Stop processing if serious error if ( ! in_array($errno, $errores_suaves) ) die(Error Interno. Por favor pruebe más tarde); } ? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Secure MySQL connections in PHP with 'stunnel'
You may also look at SSH port forwarding, this allows you to create an encrypted tunnel between the two machines, then you connect to the local port, the data gets encrypted sent across the wire and decrypted at the destination. Look at -L in your ssh man or search google for ssh tunneling stunnel is nice because you don't have to leave an ssh connection open. Checkout http://www.commandprompt.com/ppbook/index.lxp?lxpwrap=x16230%2ehtm#USINGSTUN NELREMOTELY for more info on configuring stunnel, the reference is for PostgreSQL but the stunnel part is not db dependant. Jason -Original Message- From: Stefen Lars [mailto:[EMAIL PROTECTED]] Sent: Monday, April 29, 2002 9:24 AM To: [EMAIL PROTECTED] Subject: [PHP] Secure MySQL connections in PHP with 'stunnel' Hello all I have written a very simple PHP script to copy the data from one MySQL database table on SERVERA to another MySQL database table on SERVERB. Using PHP, I simply connect to each server and copy the data across. That works well. However, natively, MySQL works with clear text. i.e. the data is copied across the Internet in clear text (a bad thing). I would now like encrypt the MySQL data between SERVERA and SERVERB. After searching with Google, I see that stunnel is a tool to use. However, I have been trying with no avail to create an encrypted connection between the two servers from MySQL to work. Following the instructions at: http://www.zataz.net/php-stunnel-tuneling.php I have come up with the following: SERVERA (master) /usr/local/sbin/stunnel -f -P/tmp/ -c -d 3308 -r SERVERA:3307 /usr/local/sbin/stunnel -f -P/tmp/ -p /usr/local/ssl/certs/stunnel.pem -d 3307 -r 3306 SERVERB (slave) /usr/local/sbin/stunnel -f -P/tmp/ -c -d 3308 -r SERVERB:3307 /usr/local/sbin/stunnel -f -P/tmp/ -p /usr/local/ssl/certs/stunnel.pem -d 3307 -r 3306 This does not work. When I connect to the slave with: ?PHP $db_link = mysql_connect(SERVERB:3308, User, Pwd) or die(Cannot connect to db); mysql_select_db(DBNAME,$db_link) or die(Cannot select MASTER db\n); ? and select / insert data into SERVERB, the data is selected / inserted to the database on SERVERA. This is very strange. Has anyone else tried using stunnel to achieve what I want to do? If so, I would REALLY like to hear how you achieve the encrypted link. Or are there other ways of securely coping data from one MySQL server to another? Using stunnel seems rather fiddly... Any comments on this subject will be well received. Stefen _ Chat with friends online, try MSN Messenger: http://messenger.msn.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Random number Question
OOPS! You are right on.. I noticed my error after I sent it. The name='guess' was on the input.?? Daaa! it's Monday .. OK!! This should work: === ? $another = 'a'; if (isset($guess)) $another = 'another'; echo form action='number.php' method='post' BR The computer has picked $another number between 1 and 10.BR Guess the number and you win!BR BR Enter your guess: input type='text' size='3' NAME='guess' INPUT TYPE='submit' VALUE='Submit my number' /form; if (isset($guess)) { srand((double)microtime()*100); $number = floor(rand(1,10)); echo The number is: $numberBR; if ($guess == $number) echo 'BRYou have won!'; else echo BRSorry that wasn't the answer; } ? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Java-Object
Hi, First some info about my working environment: OS - Win2000 PHP - 4.1.1 Java - 1.3.1 (Apache - 1.3.22) are you sure you did everything right with the java/php combination? did you test that with other, easier things? I've modified the php.ini (and http.conf) to be able to call java from php. All the examples in the php-manual work correctly. did you test the class on the command line with success? I am trying it first on the command line, though my aim is to use it later as a server side script as part of a project implemented mainly in php. did you read the manual of everything that is involved in your task? I can't say I've read everything. I've read the java, classes/object sections, but such details are not provided in the manual. i could only help you until now in finding out more about the data and type of your object... Code snippet of the renderXmlXsl(string,string) method: public InputStream renderXmlXsl(String xmlSource, String xslSource) { ... /**HERE IS THE TRANSFORMATION*/ TraxTransform tt = new TraxTransform(); tt.transform(xmlSource, xslSource, stres); ... ByteArrayInputStream bis = null; ByteArrayOutputStream out = new ByteArrayOutputStream(); /**HERE IS THE RENDERER TO PDF*/ Driver driver = new Driver(foFile, out); ... try { driver.run(); } catch (Exception ex) { ex.printStackTrace(); } byte[] content = out.toByteArray(); bis = new ByteArrayInputStream(content); ... /**RETURNED java.io.ByteArrayInputStream*/ return bis; } I think I made the problem clearer. kindly, Bedilu -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Pixel Length of text message
In html/css you can set a font size in pixels -- in my experience this means a letter takes the same number of pixels, regardless of resolution. With php, can I use string length and font pixel size to determine the length of a given string on a screen? Does anyone know an algorithm for this that works for any/every font? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] sort and maintain varible names
I have a basic sort: $orderd_list = array ($onec_rounded_total, $aps_rounded_total, $bo_rounded_total, $cap3_rounded_total, $cap3_rounded_total, $cap_rounded_total, $cfl_rounded_total, $ecg_rounded_total, $ldd_rounded_total, $png_rounded_total, $spr_rounded_total, $ist917_rounded_total, $tciac_rounded_total, $tcicl_rounded_total, $utl_rounded_total); sort ($orderd_list); reset ($orderd_list); while (list ($key, $val) = each ($orderd_list)) { echo [.$key.] = .$val.br\n; It returns [0] = 4.90 [1] = 4.99 [2] = 5.06 [3] = 5.60 [4] = 6.00 [5] = 6.00 [6] = 6.90 [7] = 6.90 [8] = 6.95 [9] = 7.00 [10] = 9.00 [11] = 10.50 [12] = 11.00 [13] = 11.26 [14] = 13.10 How do I maintain a varible name (for identification) in this output list ie: onec = 4.90 //from the varible $onec_rounded_total cfl = 4.99 bo = 5.06 and so on... Thanks In Advance, j -- http://jimlong.net/web -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] PHP ignoring dotfiles
Hello list, My PHP acts unexpected when requiring files with a leading dot. I'm on FreeBSD 4.3 In a directory I have the following two files: .mydotfile.php: ?php echo I am here!; ? myfile.php: ?php require '.mydotfile.php'; ? When I run myfile.php there is no output! If I rename .mydotfile to something without a leading dot and change the name in the require-statement it writes I am here!, as expected. If I try to require a non-existing dot file PHP complains, as expected. So - why don't I get an output from the run when written as above? I know that it has worked as expected earlier, but after an upgrade (I think) I now get this strange problem. I have tried to play with the include_path but without result. Anyone have a clue? Best, Frank -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Pixel Length of text message
On Tuesday 30 April 2002 00:17, District Webmaster wrote: In html/css you can set a font size in pixels -- in my experience this means a letter takes the same number of pixels, regardless of resolution. That may (or may not) be true, but that's referring to the height of the font. With php, can I use string length and font pixel size to determine the length of a given string on a screen? Does anyone know an algorithm for this that works for any/every font? Here I would assume you're referring to the width of the text. Thus what you want to do is not possible. You can use a fixed-width font and hope for the best. -- Jason Wong - Gremlins Associates - www.gremlins.com.hk Open Source Software Systems Integrators * Web Design Hosting * Internet Intranet Applications Development * /* If the very old will remember, the very young will listen. -- Chief Dan George */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP ignoring dotfiles
Works fine on WinXP, PHP 4.1.1, IIS 5.1 ---John Holmes... - Original Message - From: Frank [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Monday, April 29, 2002 12:19 PM Subject: [PHP] PHP ignoring dotfiles Hello list, My PHP acts unexpected when requiring files with a leading dot. I'm on FreeBSD 4.3 In a directory I have the following two files: .mydotfile.php: ?php echo I am here!; ? myfile.php: ?php require '.mydotfile.php'; ? When I run myfile.php there is no output! If I rename .mydotfile to something without a leading dot and change the name in the require-statement it writes I am here!, as expected. If I try to require a non-existing dot file PHP complains, as expected. So - why don't I get an output from the run when written as above? I know that it has worked as expected earlier, but after an upgrade (I think) I now get this strange problem. I have tried to play with the include_path but without result. Anyone have a clue? Best, Frank -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] sort and maintain varible names
On Tuesday 30 April 2002 01:19, Jim Long wrote: I have a basic sort: $orderd_list = array ($onec_rounded_total, $aps_rounded_total, $bo_rounded_total, $cap3_rounded_total, $cap3_rounded_total, $cap_rounded_total, $cfl_rounded_total, $ecg_rounded_total, $ldd_rounded_total, $png_rounded_total, $spr_rounded_total, $ist917_rounded_total, $tciac_rounded_total, $tcicl_rounded_total, $utl_rounded_total); sort ($orderd_list); reset ($orderd_list); while (list ($key, $val) = each ($orderd_list)) { echo [.$key.] = .$val.br\n; It returns [0] = 4.90 [1] = 4.99 [2] = 5.06 [3] = 5.60 [4] = 6.00 [5] = 6.00 [6] = 6.90 [7] = 6.90 [8] = 6.95 [9] = 7.00 [10] = 9.00 [11] = 10.50 [12] = 11.00 [13] = 11.26 [14] = 13.10 How do I maintain a varible name (for identification) in this output list ie: onec = 4.90 //from the varible $onec_rounded_total cfl = 4.99 bo = 5.06 and so on... First you need to define your array so that it encapsulates some form of identification: $orderd_list = array ('onec_rounded_total' = $onec_rounded_total, 'aps_rounded_total' = $aps_rounded_total, ...); Then use asort(). -- Jason Wong - Gremlins Associates - www.gremlins.com.hk Open Source Software Systems Integrators * Web Design Hosting * Internet Intranet Applications Development * /* Welcome to Lake Wobegon, where all the men are strong, the women are pretty, and the children are above-average. -- Garrison Keillor */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP ignoring dotfiles
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 * and then Frank declared .mydotfile.php: ?php echo I am here!; ? myfile.php: ?php require '.mydotfile.php'; ? When I run myfile.php there is no output! Just a hunch: do you get the same permissions output for the dotfiles as the normal ones? - -- Nick Wilson // www.explodingnet.com -BEGIN PGP SIGNATURE- Version: GnuPG v1.0.6 (GNU/Linux) iD8DBQE8zXewHpvrrTa6L5oRAidhAKCGr2hzugQzTH0gxu9Y777iWhjmFQCgsTOG TMRk8VWUlw0Pb4dAkeTiuqo= =bkaC -END PGP SIGNATURE- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] xml/xslt capability?
Nick Wilson wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Hi all I want to get started with xml/xslt, I've read a few things about sablotron but am unsure what support my host is running. If any of you know anything about this subject would you be kind enough to look at the phpinfo() I've set up here: http://www.explodingnet.com/phpinfo.php and let me know your thoughts as to what i have/need to get cracking? it seems you have this: http://www.php.net/manual/en/ref.xml.php when you read this manual you'll find that it's said there for this type of xml functions expat is used, and the phpinfo says something about expat. further on, this type of xml support is turned on with the configure command --with-xml, which you see on the very top of the output of phpinfo(). xslt seems not to be supported by your provider, dunno how you can still use it, but i heard of some php classes that do xml things without those modules, but dunno again if they do something with xslt, too. what you need to get started must be said in conjunction with the task you have to solve, read the manual and find you a good tutorial if you just want to play around. and look for xslt functions in the manual to find out more about this. henning -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] xml/xslt capability?
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 * and then Henning declared it seems you have this: http://www.php.net/manual/en/ref.xml.php Yes, I've read that thanks. xslt seems not to be supported by your provider, dunno how you can still use it, but i heard of some php classes that do xml things without those modules, but dunno again if they do something with xslt, too. Hmmm wonder how my provider will react if I ask him to recomplile, I expect not favourably :-) what you need to get started must be said in conjunction with the task you have to solve, read the manual and find you a good tutorial if you just want to play around. Yep, already on it. Though I'd hoped to use Sablotron. - -- Nick Wilson // www.explodingnet.com -BEGIN PGP SIGNATURE- Version: GnuPG v1.0.6 (GNU/Linux) iD8DBQE8zXpAHpvrrTa6L5oRAtyRAKCY00NZYfagm4UDJ6iMCMQU6r7n4ACdHuCp xmB8/YNircJEqEUfOczJx2s= =2UKP -END PGP SIGNATURE- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Pixel Length of text message
On Mon, 29 Apr 2002, District Webmaster wrote: In html/css you can set a font size in pixels -- in my experience this means a letter takes the same number of pixels, regardless of resolution. With php, can I use string length and font pixel size to determine the length of a given string on a screen? Does anyone know an algorithm for this that works for any/every font? PHP is used to generate HTML. So anything you can type into your HTML file, PHP can output instead. However, your base assumption, that it's possible to guess reliably how many pixels wide a text string will be, is incorrect. Different people use different browsers and have different fonts installed, and get different results. The best you can do is test in multiple environments and average the results - or use GD to create GIFs containing the text, in which case you can control the size precisely because it's using the fonts on your server instead of on someone else's client. miguel -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Pixel Length of text message
Just my $0.02, but it's generally a bad idea to use fixed pixel size fonts. Some people need to be able to enlarge and decrease the font size within the browser, and this will not allow them to do it. Maybe if you explain what you're trying to accomplish, somone here can help you out a little more. ---John Holmes... - Original Message - From: Jason Wong [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Monday, April 29, 2002 12:31 PM Subject: Re: [PHP] Pixel Length of text message On Tuesday 30 April 2002 00:17, District Webmaster wrote: In html/css you can set a font size in pixels -- in my experience this means a letter takes the same number of pixels, regardless of resolution. That may (or may not) be true, but that's referring to the height of the font. With php, can I use string length and font pixel size to determine the length of a given string on a screen? Does anyone know an algorithm for this that works for any/every font? Here I would assume you're referring to the width of the text. Thus what you want to do is not possible. You can use a fixed-width font and hope for the best. -- Jason Wong - Gremlins Associates - www.gremlins.com.hk Open Source Software Systems Integrators * Web Design Hosting * Internet Intranet Applications Development * /* If the very old will remember, the very young will listen. -- Chief Dan George */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Pixel Length of text message
Font-size is the height of text, the width is changing w/ every font (e.g. i and m). If you use exactly one font, you may use an array of widths(which you measured before), but that's not really exact. Perhaps, a way would be to use temporarly gd (ttfbox and/or imagefontwidth), but I don't know how exactly, it's just an idea, regards, jan - Original Message - From: District Webmaster [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Monday, April 29, 2002 6:17 PM Subject: [PHP] Pixel Length of text message In html/css you can set a font size in pixels -- in my experience this means a letter takes the same number of pixels, regardless of resolution. With php, can I use string length and font pixel size to determine the length of a given string on a screen? Does anyone know an algorithm for this that works for any/every font? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] OOP-related question
On Mon, 29 Apr 2002 [EMAIL PROTECTED] wrote: I include this in my class-function, which works fine for the most variables but $SERVER_ADDR It seems that I cannot get these variable in the function of my class so I have to pass them as argument to the function. I have made an init() function where I pass these vars inside the object But I don´t like to do this, vars like $SERVER_ADDR or *_NAME should be available inside the objects-functions. Is this behaviour normal, or are there any workarounds for it? function cheeseTaster() { global $SERVER_ADDR; } miguel -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] load testing utility
On Mon, 29 Apr 2002, Adrian Murphy wrote: anyone have a recommendation for a good free/cheap load testing utility for php/mysql sites? Apache comes with 'ab'. http://httpd.apache.org/docs/programs/ab.html miguel -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP ignoring dotfiles, permissions
Just a hunch: do you get the same permissions output for the dotfiles as the normal ones? Thanks for the idea. I am not sure what you mean by permissions output but it is same owner and an ls -la gives -rwxr-xr-x 1 frank wheel 27 Apr 29 23:05 .mydotfile.php -rwxr-xr-x 1 frank wheel0 Apr 29 23:08 myfile.php - - - I BTW forgot to tell that I am on PHP 4.1.1 BTW - if I introduce syntax errors in .mydotfile they are ignored - it is like PHP does not read the content at all. But take away the leading dot and it is all as expected. Mystified! Frank * and then Frank declared .mydotfile.php: ?php echo I am here!; ? myfile.php: ?php require '.mydotfile.php'; ? When I run myfile.php there is no output! Just a hunch: do you get the same permissions output for the dotfiles as the normal ones? - -- Nick Wilson // www.explodingnet.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Last time Append line to text file
On Mon, 29 Apr 2002, Ford, Mike [LSS] wrote: From: Miguel Cruz [mailto:[EMAIL PROTECTED]] This side effect is not mentioned at http://www.php.net/manual/en/language.operators.logical.php where it imples that the only difference is precedence. I'd say this is a bug either in the manual or in PHP itself. So, no bug, no unexpected side-effects, just a logical result of applying the precedence rules strictly as advertised! Sounds good to me! I withdraw my aspersion. miguel -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] SID problem?
Is this behaviour normal. I can't destroy SID. Take a look at the following code. session_start(); session_unset(); session_destroy(); echo SID;// SID still exists ?! some code session_start(); echo SID; // this SID is equivalent to the one above $sess_id = session_id(); // now we get a new session id echo $sess_id; // this is different from the SID above header(Location: skript.php?.SID); Thanks, Hrvoje -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP ignoring dotfiles, permissions
At 30.04.2002 00:01, you wrote: Just a hunch: do you get the same permissions output for the dotfiles as the normal ones? Thanks for the idea. I am not sure what you mean by permissions output but it is same owner and an ls -la gives -rwxr-xr-x 1 frank wheel 27 Apr 29 23:05 .mydotfile.php -rwxr-xr-x 1 frank wheel0 Apr 29 23:08 myfile.php - - - I BTW forgot to tell that I am on PHP 4.1.1 BTW - if I introduce syntax errors in .mydotfile they are ignored - it is like PHP does not read the content at all. But take away the leading dot and it is all as expected. snip You know that dot files are hidden files ? I´m not shure, but I think they cannot be read by other users then these, where the user id is smaller then 500. If you want to use them, try to fread() them. If you try to hide a file for listing, set the approbiate filetype in the httpd.conf. So just rename this to mydotfile.secret and avoid listing via: Files ~ *.secret Order allow,deny Deny from all /Files then add this type to allow php to parse them AddType application/x-httpd-php .secret and include them as normal includemydotfile.secret HTH Oliver -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Pixel Length of text message
At 29.04.2002 10:17, you wrote: In html/css you can set a font size in pixels -- in my experience this means a letter takes the same number of pixels, regardless of resolution. With php, can I use string length and font pixel size to determine the length of a given string on a screen? Does anyone know an algorithm for this that works for any/every font? The chance that this works, even if you would have an algorithm is nearly null, as you don´t know which fonts are installed on the client, nor which version they have. Also what if the user disables JavaScript, then your nice css-stuff will not work either. To have text output to a specified length, you have to make it using gd. Then you are able to make a picture, containig the text you want . From this, you know it´s dimensions. but don´t forget the alt= attribute for people who have load graphics set off, or are not able to see graphics. HTH Oliver -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php