[PHP] SQL: INSERT using subqueries
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 First off, sorry it's a SQL question not PHP, but I don't subscribe to mysql-general (or whatever it's called), and I have a feeling someone on this list will be able to help... Anyways, my question is rather simple- how do I do an INSERT using a subquery? I want something like this- only one that works: INSERT INTO myTable SET owner=(SELECT id FROM users WHERE username='myUsername'); Actually, I want to set a few more fields too, but not using subqueries. I would prefer the ..() VALUES ()... syntax, but I converted to this when I suspected that was the problem- it wasn't. I realize that I _could_ get put the id into a PHP variable, then make another query from that (which is what I'll be doing until i get a response ;)), but I'd prefer not to. Any help would be much appreciated, and thanks in advance! - -Evan - -- To achieve adjustment and sanity and the conditions that follow from them, we must study the structural characteristics of this world first and, then only, build languages of similar structure, instead of habitually ascribing to the world the primitive structure of our language. - -Alfred Korzybski -BEGIN PGP SIGNATURE- Version: GnuPG v1.0.7 (GNU/Linux) iD8DBQE9/YiD/rncFku1MdIRAg13AJ0VWveL8D79oMGuD+LVXpliqecbYgCeKlBw S+j22cnoMS/WNm0Iwbxjzlo= =EC92 -END PGP SIGNATURE- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] SQL: INSERT using subqueries
At 09:01 16.12.2002, Evan Nemerson said: [snip] >Anyways, my question is rather simple- how do I do an INSERT using a >subquery? >I want something like this- only one that works: > >INSERT INTO myTable >SET owner=(SELECT id FROM users WHERE username='myUsername'); [snip] INSERT INTO myTable SELECT id as "owner" FROM users where username='myUsername'; other columns, not selected from source table: INSERT INTO myTable SELECT id as "owner", 92 as "data1", 'hello world' as "data2" FROM users where username='myUsername'; should do it (untested on mySQL) -- >O Ernest E. Vogelsinger (\)ICQ #13394035 ^ http://www.vogelsinger.at/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] needle in a haystack (Can't find :)
http://www.php.net/manual/en/function.in-array.php Can't find the °ù¢# $needle in my $haystack. Why? :p (It is a serious example :) http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] SQL: INSERT using subqueries
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Ohhh you're close. A little tweak, and it works. Here's what I came up with: INSERT INTO myTable (owner, name) SELECT id as "owner", 'myName' as "name" FROM users where username='myUserName'; I think if you omit the (owner, name), it thinks you want to fill the whole table, so by doing it this way you can specify only what you want to change. Thanks for your help, Ernest! - -Evan On Monday 16 December 2002 12:13 am, you wrote: > At 09:01 16.12.2002, Evan Nemerson said: > [snip] > > >Anyways, my question is rather simple- how do I do an INSERT using a > >subquery? > >I want something like this- only one that works: > > > >INSERT INTO myTable > >SET owner=(SELECT id FROM users WHERE username='myUsername'); > > [snip] > > INSERT INTO myTable >SELECT id as "owner" FROM users where username='myUsername'; > > other columns, not selected from source table: > > INSERT INTO myTable >SELECT id as "owner", 92 as "data1", 'hello world' as "data2" >FROM users where username='myUsername'; > > should do it (untested on mySQL) - -- Cats are intended to teach us that not everything in nature has a function. - -Garrison Keillor -BEGIN PGP SIGNATURE- Version: GnuPG v1.0.7 (GNU/Linux) iD8DBQE9/Y+w/rncFku1MdIRAtjFAJ9k8CaAVyHxe3Rdubo0cXPYMMP14gCfdZoN /AXg9bAvjtt+xWCJMmY8r3E= =byql -END PGP SIGNATURE- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] needle in a haystack (Can't find :)
On Monday 16 December 2002 16:23, John Taylor-Johnston wrote: > http://www.php.net/manual/en/function.in-array.php > > Can't find the °ù¢# $needle in my $haystack. Why? :p > > (It is a serious example :) > > > $needle = "Ten things I hate about you"; > > if(in_array($needle, $haystack)) { > echo "Found it"; > }else{ > echo "Not there"; > } > > > $haystack = array ("Ten Things I Hate About You", > "10 Things I Hate About You", > "Ten things I hate about you", > "10 things I hate about you", > "Ten Things That I Hate About You", > "10 Things That I Hate About You", > "Ten things that I hate about you", > "10 things that I hate about you", > "ten things I hate about you"); How about defining $haystack *before* trying to use it? -- Jason Wong -> Gremlins Associates -> www.gremlins.biz Open Source Software Systems Integrators * Web Design & Hosting * Internet & Intranet Applications Development * /* Fay: The British police force used to be run by men of integrity. Truscott: That is a mistake which has been rectified. -- Joe Orton, "Loot" */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] needle in a haystack (Can't find :)
Define the haystack _before_ you look into it, and you'll find it. At 09:56 16.12.2002, Jason Wong said: [snip] >On Monday 16 December 2002 16:23, John Taylor-Johnston wrote: >> http://www.php.net/manual/en/function.in-array.php >> >> Can't find the °ù¢# $needle in my $haystack. Why? :p >> >> (It is a serious example :) >> >> > >> $needle = "Ten things I hate about you"; >> >> if(in_array($needle, $haystack)) { >> echo "Found it"; >> }else{ >> echo "Not there"; >> } >> >> >> $haystack = array ("Ten Things I Hate About You", >> "10 Things I Hate About You", >> "Ten things I hate about you", >> "10 things I hate about you", >> "Ten Things That I Hate About You", >> "10 Things That I Hate About You", >> "Ten things that I hate about you", >> "10 things that I hate about you", >> "ten things I hate about you"); > >How about defining $haystack *before* trying to use it? > >-- >Jason Wong -> Gremlins Associates -> www.gremlins.biz >Open Source Software Systems Integrators >* Web Design & Hosting * Internet & Intranet Applications Development * > >/* >Fay: The British police force used to be run by men of integrity. >Truscott: That is a mistake which has been rectified. > -- Joe Orton, "Loot" >*/ > > >-- >PHP General Mailing List (http://www.php.net/) >To unsubscribe, visit: http://www.php.net/unsub.php [snip] -- >O Ernest E. Vogelsinger (\)ICQ #13394035 ^ http://www.vogelsinger.at/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Mail() Not working right
Dear all, Sorry for my English...I am not a native speaker... I am experiencing the same problem with the mail function. I am using exactly the same test php script to test the PHP mail function. I have two RedHat linux boxes. In one box, the PHP mail function work and in the other one doesnt work. In both using sendmail command line work fine. I have checked the maillogs and I only can see any maillog in the one that PHP mail function works. In both I have set SMTP like localhost, sendmail_path=/usr/sbin/sendmail -t besides I have double checked the permissions for the nobody user to either execute the php script or the sendmail command. Could it be an issue of either the PHP version or the sendmail version? How could I use PHP logs or whatever tool to check what is going on? Many thanks in advance and sorry if this is considered a lame question Miguel -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] PDF Lib
hi folks Is there any way to include in PDF file .gif file with more than 8 colors? Error:Warning: Internal PDFlib warning: Color depth other than 8 bit not supported in GIF file regards Bogomil -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Print bgcolors in table
As far as I can see, this is not even an HTML question - it's more of a user agent question. Lars Espelid wrote: Hello, I have been looking for a newsgroup where I can post questions about css/html. I did not find any. Any suggestions? If you want a break from php, my problem is as follows: Have got a table in html with different background colors on the rows. When I print the page to my printer, the colors won't show. I have tried to specify output media, but it won't work. Tried f.ex. this: in print.css: @media print { TR.graaOver { BACKGROUND-COLOR: #E5E5E5; } } in report.html: . .. thanks, Lars -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Can php auto execute it's script in schedule without opening a webpage?
> Dear all > I just wonder did anyone know if php can act as a scheduler rather than > execute script manually? > i want to set a schedule for php to run certain script at specify time, to > what i understood in php is : the script can only be process when a > homepage > had been execute. but i want the script to be excute even no one open a > homepage contain php script in it! Sure. Write the PHP script you want to use. There shouldn't be any output from the script or it should all go to a database or file, since no one will be executing it to see it. Use "cron" on a *nix server to schedule when you want it to run. You should have a standalone version of PHP installed somewhere and you can just do php -q filename.php as what you want to run. You can also run it through lynx or wget if you don't have a standalone version of PHP available. Lynx --dump http://yourdomain/file.php. If you're on Windows, you can use task scheduler to run the program through php.exe like php.exe -q c:\path\to\file.php. Or you can load it up through Internet Explorer, iexplore.exe http://youdomain/file.php. If you use IE, there is a checkbox in the Task Scheduler program that will end the program after X minutes. Check that to have it shut down IE after a couple minutes, you PHP script should be done executing by then. Hope that helps. ---John W. Holmes... PHP Architect - A monthly magazine for PHP Professionals. Get your copy today. http://www.phparch.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
php-general Digest 16 Dec 2002 10:17:04 -0000 Issue 1766
php-general Digest 16 Dec 2002 10:17:04 - Issue 1766 Topics (messages 128347 through 128382): Re: how to send an MSWORD email? 128347 by: Chris Shiflett 128349 by: Andy Turegano 128360 by: Jonathan Sharp 128367 by: See kok Boon select * From 128348 by: Bruce Levick 128350 by: Martin Towell 128353 by: Seraphim 128355 by: Martin Towell 128357 by: Javier Re: Getting full HTTP request the page was requested with? 128351 by: Chris Shiflett Re: Querying two tables 128352 by: Javier Re: Executing a Perl/CGI program from PHP 128354 by: John W. Holmes 128361 by: Jonathan Sharp Print bgcolors in table 128356 by: Lars Espelid 128381 by: Bogdan Stancescu Print text and image in the same page. 128358 by: Naif M. Al-Otaibi 128359 by: Chris Shiflett Re: Simple text editor for Windows? 128362 by: David T-G 128363 by: Chris Shiflett Re: approaching a relational database 128364 by: David T-G to php or to perl, that is the question 128365 by: David T-G 128366 by: Rasmus Lerdorf could an audio streaming reflector be written in php? 128368 by: Kendal Can php auto execute it's script in schedule without opening a webpage? 128369 by: Jack 128370 by: Chris Shiflett 128382 by: John W. Holmes notice prevents setting cookie in 4.3.0RC2? 128371 by: Alex Pukinskis Re: Passing text info using $PHP_SELF 128372 by: Ernest E Vogelsinger Re: INSERT using subqueries 128373 by: Evan Nemerson 128374 by: Ernest E Vogelsinger 128376 by: Evan Nemerson needle in a haystack (Can't find :) 128375 by: John Taylor-Johnston 128377 by: Jason Wong 128378 by: Ernest E Vogelsinger Re: Mail() Not working right 128379 by: Miguel González Castaños PDF Lib 128380 by: Bogomil Shopov Administrivia: To subscribe to the digest, e-mail: [EMAIL PROTECTED] To unsubscribe from the digest, e-mail: [EMAIL PROTECTED] To post to the list, e-mail: [EMAIL PROTECTED] -- --- Begin Message --- --- See Kok Boon <[EMAIL PROTECTED]> wrote: > I want to send emails that have graphics, for example > the pub logo. I know that there are 2 ways to do so > (maybe there are more, pls enlighten me): > > 1. use html email with >http://www.mydomain.com/logo.gif";> > > 2. use MSWORD to insert the logo into the email. >MSWORD will then send the logo.gif as an >attachment and will ALSO use tags. I doubt anyone on this list is going to know what your second method is, though I would guess that MS Word does nothing special and does the same thing you mention in your first method, except that it attaches the image to the email rather than reference it via URL. You can probably search the archives for more information on sending HTML email as well as sending attachments, which is all you are trying to do. I detest such email myself, so I cannot offer any help. Chris --- End Message --- --- Begin Message --- The easiest way to include a picture in the email would be through the html. The second way sounds much more complex. Right now, I really don't know of any other ways. Perhaps copy and paste? On Sun, 15 Dec 2002, Chris Shiflett wrote: > --- See Kok Boon <[EMAIL PROTECTED]> wrote: > > I want to send emails that have graphics, for example > > the pub logo. I know that there are 2 ways to do so > > (maybe there are more, pls enlighten me): > > > > 1. use html email with > >http://www.mydomain.com/logo.gif";> > > > > 2. use MSWORD to insert the logo into the email. > >MSWORD will then send the logo.gif as an > >attachment and will ALSO use tags. > > I doubt anyone on this list is going to know what your > second method is, though I would guess that MS Word does > nothing special and does the same thing you mention in your > first method, except that it attaches the image to the > email rather than reference it via URL. > > You can probably search the archives for more information > on sending HTML email as well as sending attachments, which > is all you are trying to do. I detest such email myself, so > I cannot offer any help. > > Chris > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > --- End Message --- --- Begin Message --- search google for RFC HTML email, or look at phpmailer.sourceforge.net. It's roughly along the lines of: Subject: My html email Content-type: multipart/mime Content-boundry(): BOUNDRY-ABC ---BOUNDRY-ABC--- Content-type: text/html ...more headers... Hello! This is an html email with an image -> cid:abc123";> ---BOUNDRY-ABC--- Content-type: image/jpeg Content-id: abc123 Content-encoding: base64 BKJSDFIWEIJELFJSELIFJEL On Sun, 15 Dec 2002 14:35:48 -080
Re: [PHP] PDF Lib
On Monday 16 December 2002 17:50, Bogomil Shopov wrote: > hi folks > Is there any way to include in PDF file .gif file with more than 8 colors? > > Error:Warning: Internal PDFlib warning: Color depth other than 8 bit not > supported > in GIF file If I'm not mistaken, doesn't standard GIF only have 8 bit (256 colours)? -- Jason Wong -> Gremlins Associates -> www.gremlins.biz Open Source Software Systems Integrators * Web Design & Hosting * Internet & Intranet Applications Development * /* Lie, n.: A very poor substitute for the truth, but the only one discovered to date. */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Print bgcolors in table
At 10:55 16.12.2002, Bogdan Stancescu said: [snip] >As far as I can see, this is not even an HTML question - it's more of a >user agent question. [snip] Actually the user agent has the final authority on how documents look like. For example, in Internet Explorer, you may go to Extras/Options/Advanced and specify to print (or not) background colors or images. In Netscape this option exists in the preferences dialog. There's no way for the page to override the agents settings. -- >O Ernest E. Vogelsinger (\)ICQ #13394035 ^ http://www.vogelsinger.at/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PDF Lib
yes thats right but what that error mean: Error:Warning: Internal PDFlib warning: Color depth other than 8 bit not supported in GIF file regards Bogomil -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PDF Lib
On Monday 16 December 2002 18:36, Bogomil Shopov wrote: > yes thats right but what that error mean: > Error:Warning: Internal PDFlib warning: Color depth other than 8 bit not > supported > in GIF file It probably means you need to use GIFs that are 8-bits (256 colours), nothing more, nothing less. -- Jason Wong -> Gremlins Associates -> www.gremlins.biz Open Source Software Systems Integrators * Web Design & Hosting * Internet & Intranet Applications Development * /* Better tried by twelve than carried by six. -- Jeff Cooper */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Can php auto execute it's script in schedule without openinga webpage?
The other replies you received are correct - but if you somehow DON'T have a CLI PHP (e.g. using PHP3 for some strange reason, or too lazy to upgrade), you can use the same crontab/scheduler to execute wget (recommended on *nix) or lynx (available for both Win and *nix) to retrieve the actual page via HTTP. Bogdan Jack wrote: Dear all I just wonder did anyone know if php can act as a scheduler rather than execute script manually? i want to set a schedule for php to run certain script at specify time, to what i understood in php is : the script can only be process when a homepage had been execute. but i want the script to be excute even no one open a homepage contain php script in it! is there anyway i can do that? thx Jack -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Error 155 using exec
Here is what i do to parse a file with a perl script from PHP to get a formatted output from the file : error_reporting(E_ALL); $cmd="/pathto/dump.pl \"".$HTTP_POST_VARS["filename"]."\" 2>&1"; $res=exec($cmd,$tab,$err); With small files all goes fine, but when parsing a big file i get the 155 error code in $err, while PHP doesn't report any error ($tab stays empty) Of course if I launch the same command directly from the shell, all goes fine even with very very big files. Where can i find more info about that error code ? Is it returned by perl, sh, Apache or PHP ? Probably because of some memory limit, where can i tune that memory limit ? I'am on FreeBSD4+Apache 1.3+PHP4 apache module+perl 5 Thanks for any help. David. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Error 155 using exec
Here is what i do to parse a file with a perl script from PHP to get a formatted output from the file : error_reporting(E_ALL); $cmd="/pathto/dump.pl \"".$HTTP_POST_VARS["filename"]."\" 2>&1"; $res=exec($cmd,$tab,$err); With small files all goes fine, but when parsing a big file i get the 155 error code in $err, while PHP doesn't report any error ($tab stays empty) Of course if I launch the same command directly from the shell, all goes fine even with very very big files. Where can i find more info about that error code ? Is it returned by perl, sh, Apache or PHP ? Probably because of some memory limit, where can i tune that memory limit ? I'am on FreeBSD4+Apache 1.3+PHP4 apache module+perl 5 Thanks for any help. David. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PGP/PHP
Jonathan -- ...and then Jonathan said... % % I have necessary PGP client software on my machine and have tested the % functionality of PGP from my site, however, I want to know how to use % PHP to send a PGP email. 1) Do you know how to use pgp to encrypt and decrypt a file? 2) Do you know how pgp is used by a mail user agent to encrypt a mail message? % % This is the scenario, % % I have a shopping cart which directs to SSL, then while in SSL, the % customer will input their information, including credit card info. OK. In general, you send a mail message to someone with the mail() function, and many people choose to predefine their headers, recipient, and content. To wit: [From the manual:] mail (PHP 3, PHP 4 ) mail -- send mail Description bool mail ( string to, string subject, string message [, string additional_headers [, string additional_parameters]]) and All you have to do is encrypt your message body and then paste that into this example as $body. You could do it either by capturing $body or just doing an inline replacement. To wit: bash-2.05a$ echo "this is text" \ | gpg --encrypt --armor --recipient 7B9F4700 \ | gpg --armor --decrypt You need a passphrase to unlock the secret key for user: "David T-G <[EMAIL PROTECTED]>" 2048-bit ELG-E key, ID 1AEFE05A, created 2001-12-16 (main key ID 7B9F4700) gpg: encrypted with 2048-bit ELG-E key, ID 1AEFE05A, created 2001-12-16 "David T-G <[EMAIL PROTECTED]>" this is text Of course, leaving off the decrypt side will spit out a lovely encrypted text block -- but that takes up more lines to demo :-) % % I want to show a receipt, (no cc #'s of course) and send the order to an % administrator of the site using PGP after all the information has been % gathered and send it from SSL. The site's admin will be able decrypt the % information using the client software. So the site's admin will get a encrypted mail message, right? What's this about no cc number -- you won't print one on the receipt, or you won't give one to the admin, or the receipt without the number is what the admin gets? % % % Thanks in advance. HTH & HAND :-D -- David T-G * There is too much animal courage in (play) [EMAIL PROTECTED] * society and not sufficient moral courage. (work) [EMAIL PROTECTED] -- Mary Baker Eddy, "Science and Health" http://www.justpickone.org/davidtg/Shpx gur Pbzzhavpngvbaf Qrprapl Npg! msg89713/pgp0.pgp Description: PGP signature
[PHP] newbie having problem with SID
Hi, I'm just a few weeks into learning PHP, and now wants to understand sessions. But I've run into trouble with the very first script I've tried, even though it's more or less copied from the PHP manual. include ("html_functions.php"); $title = "Anders testing SID"; $header = " "; html_begin ($title, $header); if (!session_is_registered('count')) { session_register('count'); $count = 1; } else { $count++; } ?> Hello visitor, you have seen this page times. To continue, click here html_end(); ?> The session id isn't attached to the link in the end of the script, and therefore $count always is '1', even after I click the link. But the $_COOKIE["PHPSESSID"] does contain a value. I'm using PHP 4.2.2 and according to phpinfo() session.use_trans_sid is set to '1'. What I'm missing? Best regards, Anders Thoresson -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Mail() Not working right
Miguel González Castaños wrote: I am testing the php mail function with the typical script $mailsuccess = mail(...); if (!$mailsuccess) { echo "Mail could not be sent"; } In one redhat linux box I got that the email was sent succesfully and in the other box, it cant send it, but the script is executed (no parse errors). I have sendmail 8.11-2 and php 4.1.2. As i have said in my other email, I have checked if I have set properly the nobody privileges to execute sendmail and set the smtp and sendmail_path variables in the php.ini. Do you know how I could figure out what is going on? Any way of debugging or testing? What does the mail log say? Its usually /var/log/maillog. You say that the email is not sent, but what error message do you get? I think we need to know a little more about the error. HTH Chris -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] FTP UPLOAD
Hi all I have a problm uploading a simple file to my server using the PHP FTP functions. I would appreciate it if anyone could help: The HTML part: Upload file : The PHP: (which gives me the error: (Warning: error opening C:\Inetpub\wwwroot\mario\phpftp\phpftp\FTPonline\12.txt in /home/virtual/site490/fst/var/www/html/ftp/ftp.php on line 90 - the line with the ftp_put() function) $picture = "thefile_name"; $picture1 = $$picture; $theimage = $picture1; $source_file = "C:\\Inetpub\\wwwroot\\mario\\phpftp\\phpftp\\FTPonline\\" . $theimage; $destination_file = "/var/www/html/ftp/" . $theimage; $upload = ftp_put($conn_id, $destination_file, $source_file, FTP_BINARY); // check upload status if (!$upload) { echo "FTP upload has failed!"; } else { echo "Uploaded $source_file to $ftpServer as $destination_file"; } _ Marios Adamantopoulos Senior Developer Tonic +44 (0)20 7691 2227 +44 (0)7970 428 372 www.tonic.co.uk Recent projects www.polydor.co.uk www.adcecreative.org www.sony-europe.com/pocketlife Opinions, conclusions and other information in this message that do not relate to the official business of Tonic Design Limited shall be understood as neither given nor endorsed by them. -Original Message- From: Chris Hewitt [mailto:[EMAIL PROTECTED]] Sent: 16 December 2002 11:54 To: Miguel González Castaños; [EMAIL PROTECTED] Subject: Re: [PHP] Re: Mail() Not working right Miguel González Castaños wrote: >I am testing the php mail function with the typical script > >$mailsuccess = mail(...); >if (!$mailsuccess) { >echo "Mail could not be sent"; >} > >In one redhat linux box I got that the email was sent succesfully and >in the other box, it cant send it, but the script is executed (no parse >errors). > >I have sendmail 8.11-2 and php 4.1.2. > >As i have said in my other email, I have checked if I have set properly >the nobody privileges to execute sendmail and set the smtp and >sendmail_path variables in the php.ini. > >Do you know how I could figure out what is going on? Any way of >debugging or testing? > What does the mail log say? Its usually /var/log/maillog. You say that the email is not sent, but what error message do you get? I think we need to know a little more about the error. HTH Chris > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] newbie having problem with SID
At 12:46 04.12.2002, Anders Thoresson spoke out and said: [snip] > > > >Hello visitor, you have seen this page times. > >To continue, click here > > The session id isn't attached to the link in the end of the script, and >therefore $count always is '1', even after I click the link. > > But the $_COOKIE["PHPSESSID"] does contain a value. [snip] Your system date is way off (Dec 4th instead of Dec 16th), so I may be late in noticing your post... The SID constant is only set if necessary, which means if you don't (or can't) use a session cookie. If your server is setup to use session cookies, and the client browser returns it, SID will be empty. In this situation even the trans_sid mechanism would change nothing in HTML output. Anyway your problem is most certainly not tied to that, as the session should perfectly being set up using the session cookie. You're using session_register in version 4.2.2, where globals are not registered by default (check the register_global setting in php.ini). You should use the session array ($_SESSION['count']) to handle session persistent data: html_begin ($title, $header); if (!array_key_exists('count', $_SESSION)) { $_SESSION['count'] = 1; } else { $_SESSION['count']++; } end then Hello visitor, you have seen this page times. To continue, click here -- >O Ernest E. Vogelsinger (\) ICQ #13394035 ^ http://www.vogelsinger.at/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Creating reports in database systems implemented over Web interface
Hi everybody: Over linux, I'm using PostgreSQL , Apache server, and PHP pages to create a database systems with web interface. I need to know how programmers have solved the problem about printing high quality reports using the databases information. Thanks in advance Enediel Happy who can penetrate the secret causes of the things ¡Use Linux! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: PDF Lib
Bogomil Shopov wrote: hi folks Is there any way to include in PDF file .gif file with more than 8 colors? Error:Warning: Internal PDFlib warning: Color depth other than 8 bit not supported in GIF file regards Bogomil No, there's no *standard* way. I dare say that PDFlib itself could be hacked to accomodate things differently, but that's a PDFlib issue itself, not PHP's issue. If you have the option, PNGs might be better in this situation because they can be greater than 8 bits. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Creating reports in database systems implemented over Web interface
Quality HTML/embedded with PHP? (Same way any reports are printed from the web) -or- Perhaps, check out PDFLib. -Brad > Hi everybody: > > Over linux, I'm using PostgreSQL , Apache server, and PHP pages to create> a > database systems with web interface. > > I need to know how programmers have solved the problem about printing hig> h > quality reports using the databases information. > > Thanks in advance > Enediel > > Happy who can penetrate the secret causes of the things > ¡Use Linux! > > > -- > 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 resize with database
(PHP 4.23, GD 1.6.2 or higher) Hiya, I have code to place the picture in a database, and I normally shrink it when the user requests a picture. What I would like it to change to is that it should shrink or expand the picture to be 300 pixels wide and then place it into the database. I thought the function below would work to do to return a text resized version. It does sort of works, but makes a picture where only part of it is the picture (top part), the rest is blank. Any help would be gr8! THanks, Steve function shrink_picture($tmp_name,$size,$name) { $result = ereg(".gif$",strtolower($name)); if($result) { $img = imagecreatefromgif($tmp_name); } else { $img = imagecreatefromjpeg($tmp_name); } $width = imagesx($img); $height = imagesy($img); $new_height = abs(300.0 * ($height/$width)); $new_img = imagecreate(300, $new_height ); imagecopyresized($new_img,$img,0,0,0,0,300,$new_height,imagesx($img),imagesy ($img)); imagejpeg($new_img,$tmp_name."a",70); imagedestroy($new_img); imagedestroy($img); $data = addslashes(fread(fopen($tmp_name."a","r"),$size)); return $data; } -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] mail()
Is there anything special you have to do to send a link in an e-mail with the mail function? I used the mail function this weekend and set the mail contents like this: $mailcontents="Thank you for registering with us /n" ."http://www.oursite.com";; But in the actual e-mail sent, the link was plain text,not a link. Can I force it to be a link? Thanks, Eddie -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: PDF Lib
thanks a lot -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] mail()
You need to use HTML mail. There's an example on how to this in the manual. Marco -- php|architect - The Magazine for PHP Professionals The monthly magazine dedicated to the world of PHP programming Check us out on the web at http://www.phparch.com! --- Begin Message --- Is there anything special you have to do to send a link in an e-mail with the mail function? I used the mail function this weekend and set the mail contents like this: $mailcontents="Thank you for registering with us /n" ."http://www.oursite.com";; But in the actual e-mail sent, the link was plain text,not a link. Can I force it to be a link? Thanks, Eddie -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php --- End Message --- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] mail()
On Monday 16 December 2002 22:47, Edward Peloke wrote: > Is there anything special you have to do to send a link in an e-mail with > the mail function? > > I used the mail function this weekend and set the mail contents like this: > $mailcontents="Thank you for registering with us /n" > ."http://www.oursite.com";; > > But in the actual e-mail sent, the link was plain text,not a link. Can I > force it to be a link? If you're sending an HTML email then you have to write the links yourself ("http://www.example.com rather than just www.example.com. -- Jason Wong -> Gremlins Associates -> www.gremlins.biz Open Source Software Systems Integrators * Web Design & Hosting * Internet & Intranet Applications Development * /* Most people can't understand how others can blow their noses differently than they do. -- Turgenev */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] PHP shell scripting not working right?
I'm trying to do shell scripting in PHP. I have PHP installed in /usr/bin/php. I have the following script: #!/usr/bin/php -q print "Success!\n"; ?> It's saved as test.php and CHMODed to 777. When I type "test.php" at the command line, it says: bash: test.php: command not found When I type "test", it acts like I just hit enter. Typing "/usr/bin/php -q test.php" does work. Does anyone know what I'm doing wrong? -- The above message is encrypted with double rot13 encoding. Any unauthorized attempt to decrypt it will be prosecuted to the full extent of the law. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP shell scripting not working right?
Ever answered your own question five seconds after asking it? Apparently, I have to type "/path/to/test.php" even though I'm already in the right directory. Leif K-Brooks wrote: I'm trying to do shell scripting in PHP. I have PHP installed in /usr/bin/php. I have the following script: #!/usr/bin/php -q print "Success!\n"; ?> It's saved as test.php and CHMODed to 777. When I type "test.php" at the command line, it says: bash: test.php: command not found When I type "test", it acts like I just hit enter. Typing "/usr/bin/php -q test.php" does work. Does anyone know what I'm doing wrong? -- The above message is encrypted with double rot13 encoding. Any unauthorized attempt to decrypt it will be prosecuted to the full extent of the law. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP shell scripting not working right?
In Unix you need to specify the working folder when you are launching an executable, otherwise Bash will try to look into its search path, which does not include the current folder. Try: ./test.php That should work. BTW--running "test" by itself only *looks* like hitting enter--it's really a valid command. Try man test for more info. Cheers, Marco -- php|architect - The Magazine for PHP Professionals The monthly magazine dedicated to the world of PHP programming Check us out on the web at http://www.phparch.com! --- Begin Message --- I'm trying to do shell scripting in PHP. I have PHP installed in /usr/bin/php. I have the following script: #!/usr/bin/php -q print "Success!\n"; ?> It's saved as test.php and CHMODed to 777. When I type "test.php" at the command line, it says: bash: test.php: command not found When I type "test", it acts like I just hit enter. Typing "/usr/bin/php -q test.php" does work. Does anyone know what I'm doing wrong? -- The above message is encrypted with double rot13 encoding. Any unauthorized attempt to decrypt it will be prosecuted to the full extent of the law. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php --- End Message --- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] FTP UPLOAD
Well I think the error is telling you whats up The file C:\Inetpub\wwwroot\mario\phpftp\phpftp\FTPonline\12.txt Doesn't exist Try changing the line to something like this: $source_file = $HTTP_POST_FILES['thefile']['tmp_name']; This or $source_file = $_FILES['userfile']['tmp_name']; (if you are using the more lastest PHP version) Hope this helps Andrew - Original Message - From: "Marios Adamantopoulos" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Monday, December 16, 2002 12:11 PM Subject: [PHP] FTP UPLOAD Hi all I have a problm uploading a simple file to my server using the PHP FTP functions. I would appreciate it if anyone could help: The HTML part: Upload file : The PHP: (which gives me the error: (Warning: error opening C:\Inetpub\wwwroot\mario\phpftp\phpftp\FTPonline\12.txt in /home/virtual/site490/fst/var/www/html/ftp/ftp.php on line 90 - the line with the ftp_put() function) $picture = "thefile_name"; $picture1 = $$picture; $theimage = $picture1; $source_file = "C:\\Inetpub\\wwwroot\\mario\\phpftp\\phpftp\\FTPonline\\" . $theimage; $destination_file = "/var/www/html/ftp/" . $theimage; $upload = ftp_put($conn_id, $destination_file, $source_file, FTP_BINARY); // check upload status if (!$upload) { echo "FTP upload has failed!"; } else { echo "Uploaded $source_file to $ftpServer as $destination_file"; } _ Marios Adamantopoulos Senior Developer Tonic +44 (0)20 7691 2227 +44 (0)7970 428 372 www.tonic.co.uk Recent projects www.polydor.co.uk www.adcecreative.org www.sony-europe.com/pocketlife Opinions, conclusions and other information in this message that do not relate to the official business of Tonic Design Limited shall be understood as neither given nor endorsed by them. -Original Message- From: Chris Hewitt [mailto:[EMAIL PROTECTED]] Sent: 16 December 2002 11:54 To: Miguel González Castaños; [EMAIL PROTECTED] Subject: Re: [PHP] Re: Mail() Not working right Miguel González Castaños wrote: >I am testing the php mail function with the typical script > >$mailsuccess = mail(...); >if (!$mailsuccess) { >echo "Mail could not be sent"; >} > >In one redhat linux box I got that the email was sent succesfully and >in the other box, it cant send it, but the script is executed (no parse >errors). > >I have sendmail 8.11-2 and php 4.1.2. > >As i have said in my other email, I have checked if I have set properly >the nobody privileges to execute sendmail and set the smtp and >sendmail_path variables in the php.ini. > >Do you know how I could figure out what is going on? Any way of >debugging or testing? > What does the mail log say? Its usually /var/log/maillog. You say that the email is not sent, but what error message do you get? I think we need to know a little more about the error. HTH Chris > -- 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] PHP shell scripting not working right?
You don't have ./ in your $PATH so you must type ./test.php to execute it Leif K-Brooks wrote: I'm trying to do shell scripting in PHP. I have PHP installed in /usr/bin/php. I have the following script: #!/usr/bin/php -q print "Success!\n"; ?> It's saved as test.php and CHMODed to 777. When I type "test.php" at the command line, it says: bash: test.php: command not found When I type "test", it acts like I just hit enter. Typing "/usr/bin/php -q test.php" does work. Does anyone know what I'm doing wrong? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] $HTTP_POST_VARS problem
Hi there, I'm currently using PHP 4.2.2 and I am have encountered some problems when trying to access $HTTP_POST_VARS. The following statements have the following return values: echo $HTTP_POST_VARS['userfile']; => C:\\Documents and Settings\\Administrator\\Desktop\\IR Files\\gmp1.ir echo $userfile; => C:\\Documents and Settings\\Administrator\\Desktop\\IR Files\\gmp1.ir echo $HTTP_POST_VARS['userfile']['name']; => NOTHING RETURNED echo $HTTP_POST_VARS['userfile']['size']; => NOTHING RETURNED echo $userfile_size; => NOTHING RETURNED echo $userfile_name; => NOTHING RETURNED Does anyone know what the problem is? I suspect that the '\\' in the path may have something to do with it. Thanks, Lee -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] $HTTP_POST_VARS problem
On Monday 16 December 2002 23:48, Lee P. Reilly wrote: > Hi there, > > I'm currently using PHP 4.2.2 and I am have encountered some problems > when trying to access $HTTP_POST_VARS. The following statements have the > following return values: > > echo $HTTP_POST_VARS['userfile']; > => C:\\Documents and Settings\\Administrator\\Desktop\\IR Files\\gmp1.ir Better to use $_POST. > echo $userfile; > => C:\\Documents and Settings\\Administrator\\Desktop\\IR Files\\gmp1.ir > > echo $HTTP_POST_VARS['userfile']['name']; > => NOTHING RETURNED Use $_FILES. -- Jason Wong -> Gremlins Associates -> www.gremlins.biz Open Source Software Systems Integrators * Web Design & Hosting * Internet & Intranet Applications Development * /* In a gathering of two or more people, when a lighted cigarette is placed in an ashtray, the smoke will waft into the face of the non-smoker. */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] $HTTP_POST_VARS problem
Think you want $HTTP_POST_FILES rather than $HTTP_POST_VARS. As in $HTTP_POST_FILES['userfile']['name']; HTH, Richy == Richard Black Senior Developer, DataVisibility Ltd - http://www.datavisibility.com Tel: 0141 951 3481 Email: [EMAIL PROTECTED] "Lee P. Reilly" To: PHP <[EMAIL PROTECTED]> Subject: [PHP] $HTTP_POST_VARS problem 16/12/2002 15:48 Hi there, I'm currently using PHP 4.2.2 and I am have encountered some problems when trying to access $HTTP_POST_VARS. The following statements have the following return values: echo $HTTP_POST_VARS['userfile']; => C:\\Documents and Settings\\Administrator\\Desktop\\IR Files\\gmp1.ir echo $userfile; => C:\\Documents and Settings\\Administrator\\Desktop\\IR Files\\gmp1.ir echo $HTTP_POST_VARS['userfile']['name']; => NOTHING RETURNED echo $HTTP_POST_VARS['userfile']['size']; => NOTHING RETURNED echo $userfile_size; => NOTHING RETURNED echo $userfile_name; => NOTHING RETURNED Does anyone know what the problem is? I suspect that the '\\' in the path may have something to do with it. Thanks, Lee -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php This email has been scanned for all viruses by the MessageLabs SkyScan service. For more information on a proactive anti-virus service working around the clock, around the globe, visit http://www.messagelabs.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] newbie having problem with SID
You should use the session array ($_SESSION['count']) to handle session persistent data: Thanks. That solved my problem. At least for the moment. I know realize that all books and all web site-prints I have covering sessions are not using the session array, but the older way to handle sessions with session_register(),session_is_registered() and session_unregister(). There are obviously differences in how things are handled now and how they were handled then. Can someone point me to a good session tutorial based on the session array rather than the pre-PHP 4.2 (I think that's the version when this was changed)? Best regards, Anders Thoresson -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Default argument values for functions
I want to use the value of a variable that is defined in a text.inc.php file as a default argumant value for a function. $t_email_afzender_rtg It doesn't work !!! I tried it without quotes and with. If I just put a string value in it it works, but that defeats the purpose of my inc.php file! So this is just a theoretical thing ! function htmlemailheaders($from="$t_email_afzender_rtg",$CC="",$BCC="") { $mailheaders = "From: $from\r\n $mailheaders .= "Reply-To: $from\r\n"; if($CC!="") { $mailheaders .= "Cc: $CC\r\n } if($BCC!="") { $mailheaders .= "Bcc: $BCC\r\n"; } $mailheaders .= "MIME-Version: 1.0 \r\n"; $mailheaders .= "Content-type: text/html;charset=us-ascii \r\n"; $mailheaders .= "Content-Transfer-Encoding: 7bit \r\n"; return $mailheaders; }//end function htmlemailheaders()- thanks for your help -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] $HTTP_POST_VARS problem
--- "Lee P. Reilly" <[EMAIL PROTECTED]> wrote: > The following statements have the following return > values: > > echo $HTTP_POST_VARS['userfile']; > => C:\\Documents and Settings\\Administrator\\Desktop\\IR > Files\\gmp1.ir > > echo $userfile; > => C:\\Documents and Settings\\Administrator\\Desktop\\IR > Files\\gmp1.ir > > echo $HTTP_POST_VARS['userfile']['name']; > => NOTHING RETURNED > > echo $HTTP_POST_VARS['userfile']['size']; > => NOTHING RETURNED > > echo $userfile_size; > => NOTHING RETURNED > > echo $userfile_name; > => NOTHING RETURNED > > Does anyone know what the problem is? What do you think the problem is? I don't see anything unexpected, unless I'm missing something. Chris -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] newbie having problem with SID
--- Anders Thoresson <[EMAIL PROTECTED]> wrote: > There are obviously differences in how things are > handled now and how they were handled then. Yes, but I don't think there are as many differences as you think. > Can someone point me to a good session tutorial > based on the session array rather than the pre-PHP > 4.2 (I think that's the version when this was > changed)? I would recommend the online manual for date-sensitive information: http://www.php.net/manual/en/ref.session.php Chris -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] REQUIRE_ONCE AND CLASSES
Hi all. I got a problem. When i include a external file using require_once('my_file.php'); in a class file i cant use my_file´s vars and functions. Example: tpl_home->loadTemplatefile("index.tpl.html", true, true); $this->tpl_home->setCurrentBlock("GEREN"); $this->tpl_home->setVariable("GEREN","b"); $this->tpl_home->parseCurrentBlock("GEREN"); $this->tpl_home->setCurrentBlock("PRINCIPAL"); $this->tpl_home->setVariable("DADOS","a"); $this->tpl_home->parseCurrentBlock("PRINCIPAL"); } function show(){ $this->tpl_home->show(); } } $alo=new Home(); $alo->show(); ?> DONT WORK!!! why? im new in php. i will thank any help. sorry my english!!! :) Mauro!
[PHP] Java check
Hello Please, tell me how i can check if exists JAVA machine on the client computer? or if this cant be done with php, any other methods... Thank you. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] $HTTP_POST_VARS problem
Thanks for all the replies. However, I still have problems as the following code produces the following output: -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= echo "0: " . $userfile . ""; echo "1: " . $HTTP_POST_FILES['userfile']['size'] . ""; echo "2: " . $HTTP_POST_FILES['userfile']['name'] . ""; echo "3: " . $HTTP_POST_FILES['userfile']['type'] . ""; echo "4: " . $HTTP_POST_FILES . " (" . sizeof($HTTP_POST_FILES) . ")"; echo "5: " . $HTTP_POST_FILES['userfile_size'] . ""; echo "6: " . $HTTP_POST_FILES['userfile']['type'] . ""; echo "7: " . $HTTP_POST_FILES['userfile_type'] . ""; echo "8: " . $usefile_type . ""; -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= 0: C:\\Documents and Settings\\Administrator\\Desktop\\IR Files\\gmp05.iR 1: 2: 3: 4: Array (0) 5: 6: 7: 8: -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] REQUIRE_ONCE AND CLASSES
Hiya Try it like this: require_once "HTML/IT.php"; class Home { var $tpl_home = NULL; function Home () { $this->tpl_home = new IntegratedTemplate("../templates"); } function Home(){ $this->tpl_home->loadTemplatefile("index.tpl.html", true, true); $this->tpl_home->setCurrentBlock("GEREN"); $this->tpl_home->setVariable("GEREN","b"); $this->tpl_home->parseCurrentBlock("GEREN"); $this->tpl_home->setCurrentBlock("PRINCIPAL"); $this->tpl_home->setVariable("DADOS","a"); $this->tpl_home->parseCurrentBlock("PRINCIPAL"); } function show(){ $this->tpl_home->show(); } } $alo=new Home(); $alo->show(); ?> P.S. you can assign 'dynamic' content to a class var in a (class) function, not with var $var = aFunction() or something At 16:24 16-12-02 +, Mauro Romano Trajber wrote: Hi all. I got a problem. When i include a external file using require_once('my_file.php'); in a class file i cant use my_file´s vars and functions. Example: require_once "HTML/IT.php"; class Home{ var $tpl_home= new IntegratedTemplate("../templates"); function Home(){ $this->tpl_home->loadTemplatefile("index.tpl.html", true, true); $this->tpl_home->setCurrentBlock("GEREN"); $this->tpl_home->setVariable("GEREN","b"); $this->tpl_home->parseCurrentBlock("GEREN"); $this->tpl_home->setCurrentBlock("PRINCIPAL"); $this->tpl_home->setVariable("DADOS","a"); $this->tpl_home->parseCurrentBlock("PRINCIPAL"); } function show(){ $this->tpl_home->show(); } } $alo=new Home(); $alo->show(); ?> DONT WORK!!! why? im new in php. i will thank any help. sorry my english!!! :) Mauro! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: errorno error codes
Yes I know that. It returns a number. Meanwhile I found out that 11 (what is returned in my case) means that I have to try again, something like a temporary unavailable resource. It is weird that the same program on the command line returns a string to stdout without a problem. When I used it from PHP then I get the errorno 11. Most likely it is a problem with the program, not PHP or anything else, don't you agree? Unfortunately it is not my program, I am obliged to use it, so I'm kind of stuck. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Encrypt and decrypt cookie
I am not a specialist, but I discovered the parameter iv and the related function create_iv. Most likely you must provide an created iv before encryption, store the cypher and the iv together in the cookie and at retreaval, use both in decrypt. So in between: /* Terminate encryption handler */ mcrypt_generic_deinit ($td); /* Initialize encryption module for decryption */ mcrypt_generic_init ($td, $key, $iv); you store and retreave from the cookie both $iv and $td. $key must be on your server. $iv must be some random stuff that changes between encryption and decryption (between sessions). Play with it and you will find out. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] question
Hi all, I've got a question about the echo function. If I have a variable (string) with a ` in it, and I use echo, the output is \` instead. This I use this in a form (if people fill in the form incorrectly, they get the form again, with the values they entered filled in) and it looks rather weird when a ' used in a textline becomes a \` when they get the form again. (In between, I have $comment = preg_replace ("[\']","`",$comment).) Besides, when they resubmit the form, the \ is kept and when they get the form for the third time, it thus becomes \\` - kind of messy :) ... So, what do I do? Is there a way I can use echo without having it translate ` to \`? And what do other people do to replace ' in strings (I can't have them because I use mySQL to store the data). Thanks in advance for any responses ... Jos -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] REQUIRE_ONCE AND CLASSES
Ofcourse there can only be one home function: require_once "HTML/IT.php"; class Home { var $tpl_home = NULL; function Home(){ $this->tpl_home = new IntegratedTemplate("../templates"); $this->tpl_home->loadTemplatefile("index.tpl.html", true, true); $this->tpl_home->setCurrentBlock("GEREN"); $this->tpl_home->setVariable("GEREN","b"); $this->tpl_home->parseCurrentBlock("GEREN"); $this->tpl_home->setCurrentBlock("PRINCIPAL"); $this->tpl_home->setVariable("DADOS","a"); $this->tpl_home->parseCurrentBlock("PRINCIPAL"); } function show(){ $this->tpl_home->show(); } } $alo=new Home(); $alo->show(); ?> At 17:36 16-12-02 +0100, Wico de Leeuw wrote: Hiya Try it like this: require_once "HTML/IT.php"; class Home { var $tpl_home = NULL; function Home () { $this->tpl_home = new IntegratedTemplate("../templates"); } function Home(){ $this->tpl_home->loadTemplatefile("index.tpl.html", true, true); $this->tpl_home->setCurrentBlock("GEREN"); $this->tpl_home->setVariable("GEREN","b"); $this->tpl_home->parseCurrentBlock("GEREN"); $this->tpl_home->setCurrentBlock("PRINCIPAL"); $this->tpl_home->setVariable("DADOS","a"); $this->tpl_home->parseCurrentBlock("PRINCIPAL"); } function show(){ $this->tpl_home->show(); } } $alo=new Home(); $alo->show(); ?> P.S. you can assign 'dynamic' content to a class var in a (class) function, not with var $var = aFunction() or something At 16:24 16-12-02 +, Mauro Romano Trajber wrote: Hi all. I got a problem. When i include a external file using require_once('my_file.php'); in a class file i cant use my_file´s vars and functions. Example: require_once "HTML/IT.php"; class Home{ var $tpl_home= new IntegratedTemplate("../templates"); function Home(){ $this->tpl_home->loadTemplatefile("index.tpl.html", true, true); $this->tpl_home->setCurrentBlock("GEREN"); $this->tpl_home->setVariable("GEREN","b"); $this->tpl_home->parseCurrentBlock("GEREN"); $this->tpl_home->setCurrentBlock("PRINCIPAL"); $this->tpl_home->setVariable("DADOS","a"); $this->tpl_home->parseCurrentBlock("PRINCIPAL"); } function show(){ $this->tpl_home->show(); } } $alo=new Home(); $alo->show(); ?> DONT WORK!!! why? im new in php. i will thank any help. sorry my english!!! :) Mauro! -- 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] $HTTP_POST_VARS problem
It looks to me like you are trying to get an uploaded file? If so, it isn't $HTTP_POST_VARS, it is $HTTP_POST_FILES or $_FILES if you are using a version of PHP that has super globals. See the PHP manual for more info: http://www.php.net/manual/en/language.variables.predefined.php - Original Message - From: "Chris Shiflett" <[EMAIL PROTECTED]> To: "Lee P. Reilly" <[EMAIL PROTECTED]>; "PHP" <[EMAIL PROTECTED]> Sent: Monday, December 16, 2002 10:04 AM Subject: Re: [PHP] $HTTP_POST_VARS problem > --- "Lee P. Reilly" <[EMAIL PROTECTED]> wrote: > > The following statements have the following return > > values: > > > > echo $HTTP_POST_VARS['userfile']; > > => C:\\Documents and Settings\\Administrator\\Desktop\\IR > > Files\\gmp1.ir > > > > echo $userfile; > > => C:\\Documents and Settings\\Administrator\\Desktop\\IR > > Files\\gmp1.ir > > > > echo $HTTP_POST_VARS['userfile']['name']; > > => NOTHING RETURNED > > > > echo $HTTP_POST_VARS['userfile']['size']; > > => NOTHING RETURNED > > > > echo $userfile_size; > > => NOTHING RETURNED > > > > echo $userfile_name; > > => NOTHING RETURNED > > > > Does anyone know what the problem is? > > What do you think the problem is? I don't see anything > unexpected, unless I'm missing something. > > Chris > > -- > 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] question
> I've got a question about the echo function. If I have a variable (string) > with a ` in it, and I use echo, the output is \` instead. This I use this > in a form (if people fill in the form incorrectly, they get the form > again, with the values they entered filled in) and it looks rather weird > when a ' used in a textline becomes a \` when they get the form again. (In > between, I have $comment = preg_replace ("[\']","`",$comment).) Besides, > when they resubmit the form, the \ is kept and when they get the form for > the third time, it thus becomes \\` - kind of messy :) ... So, what do I > do? Is there a way I can use echo without having it translate ` to \`? And > what do other people do to replace ' in strings (I can't have them because > I use mySQL to store the data). PHP is adding those escape slashes to your quotes because magic_quotes_gpc is on in your php.ini. That is the default setting and makes it so that if you use those variable directly in a database query, you'll be safer from SQL injection. You can remove the with the stripslashes() function. You'll need to use that function to re-display the user entered data back into a form. On a side note, you should be getting an error from your preg_replace function as your search pattern is not correctly formed. ---John Holmes... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] mail()-function/sendmail
I have big problems getting the mail()-function working -> the error I always get is as follows: syserr(apache): can not chdir (/var/spool/mqueue/): Permission denied Has anybody a clue what might be the reason for this error? Should I change the rights of the mqueue directory? The mqueue directory has currently these rights: drwx-- -> root root --- . The sendmail_path i use is as usual /usr/sbin/sendmail -t -i). thanks for your help in advance! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] $HTTP_POST_VARS problem
Problem solved: I forgot to add the enctype to the original FORM tag. Cheers, Lee, -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] FTP Can't create temp file?
Hi all again I'm trying to upload to a unix server. The program I use works fine on my 2000 IIS machine but it has a problem on the online one. Permittions have been checked and I've been looking all day to find something, but natha... I would appreciate it if someone can have a look and suggest something. Here is the script: $conn_id = ftp_connect($ftpServer); $login_result = ftp_login($conn_id, $ftpUser, $ftpPass); if ((!$conn_id) || (!$login_result)) { echo "FTP connection has failed!"; echo "Attempted to connect to $ftpServer for user $ftpUser"; exit; } else { //echo "Connected to $ftpServer, for user $ftpUser"; } $phpftp_dir = ""; echo "--" . ftp_pwd($conn_id) . ""; $phpftp_tmpdir="/tmp"; srand((double)microtime()*100); $randval = rand(); $tmpfile=$phpftp_tmpdir . "/" . $thefile_name . "." . $randv; echo "Temp file: " . $tmpfile . ""; if (!@move_uploaded_file($thefile,$tmpfile)) { echo "Upload failed! Can't create temp file"; } else { ftp_chdir($conn_id,$phpftp_dir); ftp_put($conn_id,$thefile_name,$tmpfile,FTP_BINARY); //ftp_quit($conn_id); unlink($tmpfile); } --- I always get: "Upload failed! Can't create temp file" Thank you guys in advance Mario _ Marios Adamantopoulos Senior Developer Tonic +44 (0)20 7691 2227 +44 (0)7970 428 372 www.tonic.co.uk Recent projects www.polydor.co.uk www.adcecreative.org www.sony-europe.com/pocketlife Opinions, conclusions and other information in this message that do not relate to the official business of Tonic Design Limited shall be understood as neither given nor endorsed by them.
[PHP] Divide into words
Hi! For example i have some words: Today is very beautiful day and sun is shining What i want to get from this is array words [Today] => 0 [Is] => 6,30 [Very] => 8 [beautiful] => 12 .. Can somebody please help me with this. Those nubers are position of special word in above sentence. If word repeates i want to have both positions saved in same row like word is. I tried something but i think it's to lame. -- bye, Uros -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] stop script on browser closing
I was wondering when a script stops executing server side. I am sending out a large number of mails. This takes some time ( 30 secs) before it is done. If I close the browser window before the execution of the script, a lot of emails do not arrive. is there a way to prevent this? and how does this function? how does the server side script know that I close the browser window? Is all of the above true? thanks a lot -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] stop script on browser closing
--- rolf vreijdenberger <[EMAIL PROTECTED]> wrote: > If I close the browser window before the execution > of the script, a lot of emails do not arrive. is > there a way to prevent this? Try this at the top of your script: ignore_user_abort(true); Chris -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] stop script on browser closing
yes, thank you, found it in the manual thanks -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Divide into words
You could use strpos--there are easier ways if you don't need the offsets. Example: This is from memory, but it looks like it should work even for weird strings like the one above. Cheers, Marco -- php|architect - The magazine for PHP Professionals The monthly worldwide magazine dedicated to PHP programmers Come visit us at http://www.phparch.com! --- Begin Message --- Hi! For example i have some words: Today is very beautiful day and sun is shining What i want to get from this is array words [Today] => 0 [Is] => 6,30 [Very] => 8 [beautiful] => 12 .. Can somebody please help me with this. Those nubers are position of special word in above sentence. If word repeates i want to have both positions saved in same row like word is. I tried something but i think it's to lame. -- bye, Uros -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php --- End Message --- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Divide into words
> For example i have some words: > > Today is very beautiful day and sun is shining > > What i want to get from this is array > > words > [Today] => 0 > [Is] => 6,30 > [Very] => 8 > [beautiful] => 12 > .. > > Can somebody please help me with this. Those nubers are > position of special word in above sentence. If word repeates > i want to have both positions saved in same row like word is. > > I tried something but i think it's to lame. Well you could've at least shown us what you had so far instead of letting us solve the problem for you: $string = "Today is a very beautiful day and the sun is shining"; $words = explode(" ",$string); $pos = 0; foreach($words as $word) { if(isset($w[$word])) { $w[$word] .= ",$pos"; } else { $w[$word] = $pos; } $pos += strlen($word) + 1; } print_r($w); ---John W. Holmes... PHP Architect - A monthly magazine for PHP Professionals. Get your copy today. http://www.phparch.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Divide into words
John, I'm not sure this will work if there is more than one space between words. Also, my previous example won't work if there are duplicate words (although it's easy to make an array out of each word and solve the problem), nor if the words are delimited by any character other than spaces, in which case regex are probably our best bet. Cheers, Marco -- php|architect - The magazine for PHP Professionals The monthly worldwide magazine dedicated to PHP programmers Come visit us at http://www.phparch.com! --- Begin Message --- > For example i have some words: > > Today is very beautiful day and sun is shining > > What i want to get from this is array > > words > [Today] => 0 > [Is] => 6,30 > [Very] => 8 > [beautiful] => 12 > .. > > Can somebody please help me with this. Those nubers are > position of special word in above sentence. If word repeates > i want to have both positions saved in same row like word is. > > I tried something but i think it's to lame. Well you could've at least shown us what you had so far instead of letting us solve the problem for you: $string = "Today is a very beautiful day and the sun is shining"; $words = explode(" ",$string); $pos = 0; foreach($words as $word) { if(isset($w[$word])) { $w[$word] .= ",$pos"; } else { $w[$word] = $pos; } $pos += strlen($word) + 1; } print_r($w); ---John W. Holmes... PHP Architect - A monthly magazine for PHP Professionals. Get your copy today. http://www.phparch.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php --- End Message --- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Odd Strpos Behavior
At 12/14/2002 12:50 AM, John W. Holmes wrote: > And here's a good example of why you should always test each solution > and time it to see what's better. I was recommending a > preg_replace_callback solution which I thought, as a lot of other people > would also think, is a lot faster that your own "method" of doing it. Thanks John, for both the time tests and for fixing my original method. I appreciate the help. -- S. Keller UI Engineer The Health TV Channel, Inc. (a non - profit organization) 3820 Lake Otis Pkwy. Anchorage, AK 99508 907.770.6200 ext.220 907.336.6205 (fax) Email: [EMAIL PROTECTED] Web: www.healthtvchannel.org -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Array
I have an array I set up like this: $monthschedule = array(1 => "Jan", 2 => "Feb", 3 => "Mar", 6 => "Jun"); When I try to access them, doing this: $r = $monthschedule[6]; nothing comes up ($r is blank). Any thoughts? There are missing elements (4,5,7-12) in $monthschedule. __ Do you Yahoo!? Yahoo! Mail Plus - Powerful. Affordable. Sign up now. http://mailplus.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Divide into words
True, but it answers the original question. :) You can easily throw in a if($word == ' ') then don't save it, but still increment $pos. You could use a regular expression to check/remove punctuation, too. ---John W. Holmes... PHP Architect - A monthly magazine for PHP Professionals. Get your copy today. http://www.phparch.com/ > -Original Message- > From: Marco Tabini [mailto:[EMAIL PROTECTED]] > Sent: Monday, December 16, 2002 12:37 PM > To: [EMAIL PROTECTED] > Cc: 'Uros Gruber'; PHP-General > Subject: RE: [PHP] Divide into words > > John, > > I'm not sure this will work if there is more than one space between > words. > > Also, my previous example won't work if there are duplicate words > (although it's easy to make an array out of each word and solve the > problem), nor if the words are delimited by any character other than > spaces, in which case regex are probably our best bet. > > Cheers, > > > Marco > -- > > php|architect - The magazine for PHP Professionals > The monthly worldwide magazine dedicated to PHP programmers > > Come visit us at http://www.phparch.com! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] URL field receiving Array for others
Hello All! I have a script which inserts a users info into mysql via PHP. Here is the code which does so: $sql = ("INSERT INTO `business` (`id`, `bt_id`, `bus_name`, `bcity`, `phone`, `cell`, `email`, `url`, `details`, `duration`, `s_id`, `license`, `datime`, `comments`,`ip`,`user_id`,`user_pass`) VALUES ('', '$bus_type_id', '$bus_name', '$city_id', '$phone', '$cell', '$email', '$url', '$details', '$duration', '$state_id', '$license', '$date','$comments', '$REMOTE_ADDR', '$user_id', password('$userpass2'))"); and it sends a mail to me, however crude: 100% ASAP Plumbing and Rooter Specialist, City ID: 2647 1-866-FIX- GUARD, l Array (this is supposed to be a url) PlumberASAP.com Specializing in Drains, Faucets, Filters, Repairs, Sprinkers, Installations, Water Heaters, Disposals, Copper Plumbing, Leak Detection. Fast, Clean and Courteous Service Danny McGowan Owner/Operator , 12 months, I can't duplicate the problem. Any idea what is happening here? Thanks -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] FTP Can't create temp file?
What happens when you remove the suppresion operator (@) from the move_upload_file and why not just use ftp_put()? That has always worked fine for me. - Original Message - From: "Marios Adamantopoulos" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Monday, December 16, 2002 11:06 AM Subject: [PHP] FTP Can't create temp file? > > Hi all again > > I'm trying to upload to a unix server. The program I use works fine on my > 2000 IIS machine but it has a problem on the online one. Permittions have > been checked and I've been looking all day to find something, but natha... > > I would appreciate it if someone can have a look and suggest something. Here > is the script: > > > $conn_id = ftp_connect($ftpServer); > $login_result = ftp_login($conn_id, $ftpUser, $ftpPass); > if ((!$conn_id) || (!$login_result)) { > echo "FTP connection has failed!"; > echo "Attempted to connect to $ftpServer for user $ftpUser"; > exit; > } else { > //echo "Connected to $ftpServer, for user $ftpUser"; > } > > > $phpftp_dir = ""; > > echo "--" . ftp_pwd($conn_id) . ""; > > > $phpftp_tmpdir="/tmp"; > > > srand((double)microtime()*100); > $randval = rand(); > $tmpfile=$phpftp_tmpdir . "/" . $thefile_name . "." . $randv; > > echo "Temp file: " . $tmpfile . ""; > > > if (!@move_uploaded_file($thefile,$tmpfile)) { > echo "Upload failed! Can't create temp file"; > } else { > ftp_chdir($conn_id,$phpftp_dir); > ftp_put($conn_id,$thefile_name,$tmpfile,FTP_BINARY); > //ftp_quit($conn_id); > unlink($tmpfile); > } > > --- > I always get: "Upload failed! Can't create temp file" > > Thank you guys in advance > > Mario > > > > _ > Marios Adamantopoulos > Senior Developer > > Tonic > +44 (0)20 7691 2227 > +44 (0)7970 428 372 > www.tonic.co.uk > > Recent projects > www.polydor.co.uk > www.adcecreative.org > www.sony-europe.com/pocketlife > > > Opinions, conclusions and other information in this message that do not > relate to the official business of Tonic Design Limited shall be > understood as neither given nor endorsed by them. > > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Array
On Tuesday 17 December 2002 01:43, Mako Shark wrote: > I have an array I set up like this: > > $monthschedule = array(1 => "Jan", 2 => "Feb", 3 => > "Mar", 6 => "Jun"); > > When I try to access them, doing this: > $r = $monthschedule[6]; > > nothing comes up ($r is blank). Any thoughts? There > are missing elements (4,5,7-12) in $monthschedule. Use print_r($monthschedule) to see what's really inside the array. -- Jason Wong -> Gremlins Associates -> www.gremlins.biz Open Source Software Systems Integrators * Web Design & Hosting * Internet & Intranet Applications Development * /* I bought some used paint. It was in the shape of a house. -- Steven Wright */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] URL field receiving Array for others
Whatever variable that is suppose to contain the URL is an array. If you try to print a variable that is an array the value you get is 'Array'. You will either have to step through it, or implode it, or something of that nature to get what the array contains. - Original Message - From: <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Monday, December 16, 2002 11:50 AM Subject: [PHP] URL field receiving Array for others > > Hello All! > > I have a script which inserts a users info into mysql via PHP. > > Here is the code which does so: > > $sql = ("INSERT INTO `business` (`id`, `bt_id`, `bus_name`, `bcity`, `phone`, > `cell`, `email`, `url`, `details`, `duration`, `s_id`, `license`, `datime`, > `comments`,`ip`,`user_id`,`user_pass`) > VALUES > ('', '$bus_type_id', '$bus_name', '$city_id', '$phone', '$cell', > '$email', '$url', '$details', '$duration', '$state_id', '$license', > '$date','$comments', '$REMOTE_ADDR', '$user_id', password('$userpass2'))"); > > and it sends a mail to me, however crude: > > > 100% ASAP Plumbing and Rooter Specialist, City ID: 2647 > 1-866-FIX- GUARD, > l > > Array (this is supposed to be a url) > > PlumberASAP.com Specializing in Drains, Faucets, Filters, Repairs, Sprinkers, > Installations, Water Heaters, Disposals, Copper Plumbing, Leak Detection. Fast, > Clean and Courteous Service Danny McGowan Owner/Operator > , > 12 months, > > > I can't duplicate the problem. > > Any idea what is happening here? > > Thanks > > > -- > 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[2]: [PHP] Divide into words
Hi! I have dome almost the same $input = 'Today is a very beautiful day and the sun is shining'; $output = array(); $words = explode(' ',$input); $cur_pos = 0; foreach($words as $word) { if(!empty($output[$word])){ $output[$word] .= ','.$cur_pos; } else { $output[$word] = $cur_pos; } $cur_pos += strlen($word) + 1; } unset ($word); but i thought if there is some better way. I also tried Marco's example and adjust it a little bit to get the same results. And here is some benchmark i have. with this example i get 0.0024310350418091 and with Marco's i get 0.0034389495849609s So using two array is faster anyway. Probably of explode speed. -- bye, Uros Monday, December 16, 2002, 6:36:37 PM, you wrote: >> For example i have some words: >> >> Today is very beautiful day and sun is shining >> >> What i want to get from this is array >> >> words >> [Today] => 0 >> [Is] => 6,30 >> [Very] => 8 >> [beautiful] => 12 >> .. >> >> Can somebody please help me with this. Those nubers are >> position of special word in above sentence. If word repeates >> i want to have both positions saved in same row like word is. >> >> I tried something but i think it's to lame. JWH> Well you could've at least shown us what you had so far instead of JWH> letting us solve the problem for you: JWH> $string = "Today is a very beautiful day and the sun is shining"; JWH> $words = explode(" ",$string); JWH> $pos = 0; JWH> foreach($words as $word) JWH> { JWH> if(isset($w[$word])) JWH> { $w[$word] .= ",$pos"; } JWH> else JWH> { $w[$word] = $pos; } JWH> $pos += strlen($word) + 1; JWH> } JWH> print_r($w); JWH> ---John W. Holmes... JWH> PHP Architect - A monthly magazine for PHP Professionals. Get your copy JWH> today. http://www.phparch.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] URL field receiving Array for others
But what could the user be typing into the field to return an array? I'm completely at a loss. Quoting "Joseph W. Goff" <[EMAIL PROTECTED]>: ### Whatever variable that is suppose to contain the URL is an array. If you ### try to print a variable that is an array the value you get is 'Array'. ### You ### will either have to step through it, or implode it, or something of that ### nature to get what the array contains. ### - Original Message - ### From: <[EMAIL PROTECTED]> ### To: <[EMAIL PROTECTED]> ### Sent: Monday, December 16, 2002 11:50 AM ### Subject: [PHP] URL field receiving Array for others ### ### ### > ### > Hello All! ### > ### > I have a script which inserts a users info into mysql via PHP. ### > ### > Here is the code which does so: ### > ### > $sql = ("INSERT INTO `business` (`id`, `bt_id`, `bus_name`, `bcity`, ### `phone`, ### > `cell`, `email`, `url`, `details`, `duration`, `s_id`, `license`, ### `datime`, ### > `comments`,`ip`,`user_id`,`user_pass`) ### > VALUES ### > ('', '$bus_type_id', '$bus_name', '$city_id', '$phone', ### '$cell', ### > '$email', '$url', '$details', '$duration', '$state_id', '$license', ### > '$date','$comments', '$REMOTE_ADDR', '$user_id', ### password('$userpass2'))"); ### > ### > and it sends a mail to me, however crude: ### > ### > ### > 100% ASAP Plumbing and Rooter Specialist, City ID: 2647 ### > 1-866-FIX- GUARD, ### > l ### > ### > Array (this is supposed to be a url) ### > ### > PlumberASAP.com Specializing in Drains, Faucets, Filters, Repairs, ### Sprinkers, ### > Installations, Water Heaters, Disposals, Copper Plumbing, Leak ### Detection. ### Fast, ### > Clean and Courteous Service Danny McGowan Owner/Operator ### > , ### > 12 months, ### > ### > ### > I can't duplicate the problem. ### > ### > Any idea what is happening here? ### > ### > Thanks ### > ### > ### > -- ### > 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] FTP Can't create temp file?
It gives me an error "Warning: error opening none in Line 51 (which is the ftp_put()) -Original Message- From: Joseph W. Goff [mailto:[EMAIL PROTECTED]] Sent: 16 December 2002 17:53 To: php-general; Marios Adamantopoulos Subject: Re: [PHP] FTP Can't create temp file? What happens when you remove the suppresion operator (@) from the move_upload_file and why not just use ftp_put()? That has always worked fine for me. - Original Message - From: "Marios Adamantopoulos" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Monday, December 16, 2002 11:06 AM Subject: [PHP] FTP Can't create temp file? > > Hi all again > > I'm trying to upload to a unix server. The program I use works fine on > my 2000 IIS machine but it has a problem on the online one. > Permittions have been checked and I've been looking all day to find > something, but natha... > > I would appreciate it if someone can have a look and suggest > something. Here > is the script: > > > $conn_id = ftp_connect($ftpServer); > $login_result = ftp_login($conn_id, $ftpUser, $ftpPass); > if ((!$conn_id) || (!$login_result)) { > echo "FTP connection has failed!"; > echo "Attempted to connect to $ftpServer for user $ftpUser"; > exit; > } else { > //echo "Connected to $ftpServer, for user $ftpUser"; } > > > $phpftp_dir = ""; > > echo "--" . ftp_pwd($conn_id) . ""; > > > $phpftp_tmpdir="/tmp"; > > > srand((double)microtime()*100); > $randval = rand(); > $tmpfile=$phpftp_tmpdir . "/" . $thefile_name . "." . $randv; > > echo "Temp file: " . $tmpfile . ""; > > > if (!@move_uploaded_file($thefile,$tmpfile)) { > echo "Upload failed! Can't create temp file"; > } else { > ftp_chdir($conn_id,$phpftp_dir); > ftp_put($conn_id,$thefile_name,$tmpfile,FTP_BINARY); > //ftp_quit($conn_id); > unlink($tmpfile); > } > > --- > I always get: "Upload failed! Can't create temp file" > > Thank you guys in advance > > Mario > > > > _ > Marios Adamantopoulos > Senior Developer > > Tonic > +44 (0)20 7691 2227 > +44 (0)7970 428 372 > www.tonic.co.uk > > Recent projects > www.polydor.co.uk > www.adcecreative.org > www.sony-europe.com/pocketlife > > > Opinions, conclusions and other information in this message that do not > relate to the official business of Tonic Design Limited shall be > understood as neither given nor endorsed by them. > > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: Re[2]: [PHP] Divide into words
Yes, but my example was geared towards trying to work through a more generic scenario. I'll bet if you try using perl regex with callback it'll be even faster. Marco -- php|architect - The magazine for PHP Professionals The monthly worldwide magazine dedicated to PHP programmers Come visit us at http://www.phparch.com! --- Begin Message --- Hi! I have dome almost the same $input = 'Today is a very beautiful day and the sun is shining'; $output = array(); $words = explode(' ',$input); $cur_pos = 0; foreach($words as $word) { if(!empty($output[$word])){ $output[$word] .= ','.$cur_pos; } else { $output[$word] = $cur_pos; } $cur_pos += strlen($word) + 1; } unset ($word); but i thought if there is some better way. I also tried Marco's example and adjust it a little bit to get the same results. And here is some benchmark i have. with this example i get 0.0024310350418091 and with Marco's i get 0.0034389495849609s So using two array is faster anyway. Probably of explode speed. -- bye, Uros Monday, December 16, 2002, 6:36:37 PM, you wrote: >> For example i have some words: >> >> Today is very beautiful day and sun is shining >> >> What i want to get from this is array >> >> words >> [Today] => 0 >> [Is] => 6,30 >> [Very] => 8 >> [beautiful] => 12 >> .. >> >> Can somebody please help me with this. Those nubers are >> position of special word in above sentence. If word repeates >> i want to have both positions saved in same row like word is. >> >> I tried something but i think it's to lame. JWH> Well you could've at least shown us what you had so far instead of JWH> letting us solve the problem for you: JWH> $string = "Today is a very beautiful day and the sun is shining"; JWH> $words = explode(" ",$string); JWH> $pos = 0; JWH> foreach($words as $word) JWH> { JWH> if(isset($w[$word])) JWH> { $w[$word] .= ",$pos"; } JWH> else JWH> { $w[$word] = $pos; } JWH> $pos += strlen($word) + 1; JWH> } JWH> print_r($w); JWH> ---John W. Holmes... JWH> PHP Architect - A monthly magazine for PHP Professionals. Get your copy JWH> today. http://www.phparch.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php --- End Message --- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: Re[2]: [PHP] Divide into words
> Yes, but my example was geared towards trying to work through a more > generic scenario. I'll bet if you try using perl regex with callback > it'll be even faster. I'll take that bet and say using preg_*_callback will be slower. :) I'll try and time each of them tonite and post what I find. Something else to distract me from writing my column! ---John Holmes... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Stumped!
I am trying to display a column from my database as a list. Each listing needs to be a URL that links to another script that brings up all of the data in the row to edit. I keep getting a parser error and I can't figure it out. Here is the code and any help is greatly appreciated. $meetingName"); ?>
[PHP] Reject some?
What Im trying to do is, reject all email address strings ending in yahoo.com, except [EMAIL PROTECTED] Im trying -> if (preg_match('/[^[EMAIL PROTECTED]|yahoo.com]$/', '[EMAIL PROTECTED]')) { echo 'match found'; } else { echo 'match not found'; } ?> The search pattern must also be capable of expanding to something like -> ^[EMAIL PROTECTED]|yahoo.com|^foo@hotmail|hotmail.com Basically what Im trying to perform is to reject all email address strings ending in either yahoo.com or hotmail.com, except strings ending in [EMAIL PROTECTED] or [EMAIL PROTECTED] Thanks for any insight you may provide... -- Gerard Samuel http://www.trini0.org:81/ http://dev.trini0.org:81/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Stumped!
> I am trying to display a column from my database as a list. Each listing > needs to be a URL that links to another script that brings up all of the data > in the row to edit. I keep getting a parser error and I can't figure it out. > Here is the code and any help is greatly appreciated. > > $db = mysql_connect("localhost", "Uname", "PW"); > > $select_db = mysql_select_db("machmedi_meetingRequest",$db); > $sql = "SELECT * FROM requests"; You're never executing your query, for one thing... $res = mysql_query($sql) or die(mysql_error()); > while ($result = mysql_fetch_array($query)) { > $id= $result["id"]; > $meetingName= $result["meetingName"]; > > echo ("$meetingName"); > ?> ---John Holmes... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Stumped!
$sql = "SELECT ."; $sql_e = mysql_query($sql); while ($result = mysql_fetch_array($query_e)) { . } You were missing the mysql_query <[EMAIL PROTECTED]> escribió en el mensaje [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > I am trying to display a column from my database as a list. Each listing > needs to be a URL that links to another script that brings up all of the data > in the row to edit. I keep getting a parser error and I can't figure it out. > Here is the code and any help is greatly appreciated. > > $db = mysql_connect("localhost", "Uname", "PW"); > > $select_db = mysql_select_db("machmedi_meetingRequest",$db); > $sql = "SELECT * FROM requests"; > > while ($result = mysql_fetch_array($query)) { > $id= $result["id"]; > $meetingName= $result["meetingName"]; > > echo ("$meetingName"); > ?> > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Creating reports in database systems implemented over Web interface
Thanks [EMAIL PROTECTED] for your answer. I'll verify the PDFLib, create dinamically a pdf file and add a link to it into a result web page could be the solution I need. Sometimes the asked report could be extremely large, and include all resulting information inside the web page won't be the solution I need. I hope that PDFLib will let me create dinamically a PDF file. Greetings Enediel Happy who can penetrate the secret causes of the things ¡Use Linux! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Stumped!
Hmm, I am still getting a parse error on the last line of code... In a message dated 12/16/2002 1:49:26 PM Eastern Standard Time, [EMAIL PROTECTED] writes: > $sql = "SELECT ."; > $sql_e = mysql_query($sql); > > while ($result = mysql_fetch_array($query_e)) { > . > } > > You were missing the mysql_query > > > <[EMAIL PROTECTED]> escribió en el mensaje > [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > >I am trying to display a column from my database as a list. Each listing > >needs to be a URL that links to another script that brings up all of the > data > >in the row to edit. I keep getting a parser error and I can't figure it > out. > > Here is the code and any help is greatly appreciated. > > > > >$db = mysql_connect("localhost", "Uname", "PW"); > > > >$select_db = mysql_select_db("machmedi_meetingRequest",$db); > >$sql = "SELECT * FROM requests"; > > > >while ($result = mysql_fetch_array($query)) { > >$id= $result["id"]; > >$meetingName= $result["meetingName"]; > > > >echo ("$meetingName "); > >?> > > > > Christopher Parker Senior Corporate Technical Specialist, Corporate Events America Online Inc. Phone: 703.265.5553 Fax: 703.265.2007 Cell: 703.593.3199
[PHP] php setup
I recently got a laptop and was in the process this weekend of installing, php, apache, mysql etc. One thing I noticed is when I ran the code (that works fine everywhere else) on the laptop, I got errors of 'Variable not defined' and I have pictures that just won't show. I am not sure if this is the problem but most of the scripts giving the 'Variable not defined problem and the images where in other folders and referenced in the php page like /images/picture.gif and /includes/template1.inc. Is there something I need to look at in my config file? Thanks, Eddie -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Stumped!
--- [EMAIL PROTECTED] wrote: > I keep getting a parser error and I can't figure > it out. Here is the code and any help is greatly > appreciated. > > $sql = "SELECT * FROM requests"; > > while ($result = mysql_fetch_array($query)) While this is not related to your parse error, it is a major logic flaw, as mysql_fetch_array() takes a result set as an argument, not an SQL statement. > echo ("$meetingName"); This is your parse error. Get rid of the parentheses. The parse error should tell you on exactly which line you had an error, so read those error messages carefully next time. Good luck. Chris -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] php setup
Turn on register_globals in your php.ini file. On Mon, 16 Dec 2002, Edward Peloke wrote: > I recently got a laptop and was in the process this weekend of installing, > php, apache, mysql etc. One thing I noticed is when I ran the code (that > works fine everywhere else) on the laptop, I got errors of 'Variable not > defined' and I have pictures that just won't show. I am not sure if this is > the problem but most of the scripts giving the 'Variable not defined problem > and the images where in other folders and referenced in the php page like > /images/picture.gif and /includes/template1.inc. Is there something I need > to look at in my config file? > > Thanks, > Eddie > > > -- > 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] Re: Stumped!
Check out your while { } <--- i don´t see a closing one echo ("$meetingName "); try: echo ''.$meetingName.''; <[EMAIL PROTECTED]> escribió en el mensaje [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Hmm, I am still getting a parse error on the last line of code... In a message dated 12/16/2002 1:49:26 PM Eastern Standard Time, [EMAIL PROTECTED] writes: > $sql = "SELECT ."; > $sql_e = mysql_query($sql); > > while ($result = mysql_fetch_array($query_e)) { > . > } > > You were missing the mysql_query > > > <[EMAIL PROTECTED]> escribió en el mensaje > [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > >I am trying to display a column from my database as a list. Each listing > >needs to be a URL that links to another script that brings up all of the > data > >in the row to edit. I keep getting a parser error and I can't figure it > out. > > Here is the code and any help is greatly appreciated. > > > > >$db = mysql_connect("localhost", "Uname", "PW"); > > > >$select_db = mysql_select_db("machmedi_meetingRequest",$db); > >$sql = "SELECT * FROM requests"; > > > >while ($result = mysql_fetch_array($query)) { > >$id= $result["id"]; > >$meetingName= $result["meetingName"]; > > > >echo ("$meetingName "); > >?> > > > > Christopher Parker Senior Corporate Technical Specialist, Corporate Events America Online Inc. Phone: 703.265.5553 Fax: 703.265.2007 Cell: 703.593.3199 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] URL field receiving Array for others
I don't know. You need to show your code. - Original Message - From: <[EMAIL PROTECTED]> To: "Joseph W. Goff" <[EMAIL PROTECTED]> Cc: "php-general" <[EMAIL PROTECTED]> Sent: Monday, December 16, 2002 12:01 PM Subject: Re: [PHP] URL field receiving Array for others > > But what could the user be typing into the field to return an array? > > I'm completely at a loss. > > Quoting "Joseph W. Goff" <[EMAIL PROTECTED]>: > > ### Whatever variable that is suppose to contain the URL is an array. If you > ### try to print a variable that is an array the value you get is 'Array'. > ### You > ### will either have to step through it, or implode it, or something of that > ### nature to get what the array contains. > ### - Original Message - > ### From: <[EMAIL PROTECTED]> > ### To: <[EMAIL PROTECTED]> > ### Sent: Monday, December 16, 2002 11:50 AM > ### Subject: [PHP] URL field receiving Array for others > ### > ### > ### > > ### > Hello All! > ### > > ### > I have a script which inserts a users info into mysql via PHP. > ### > > ### > Here is the code which does so: > ### > > ### > $sql = ("INSERT INTO `business` (`id`, `bt_id`, `bus_name`, `bcity`, > ### `phone`, > ### > `cell`, `email`, `url`, `details`, `duration`, `s_id`, `license`, > ### `datime`, > ### > `comments`,`ip`,`user_id`,`user_pass`) > ### > VALUES > ### > ('', '$bus_type_id', '$bus_name', '$city_id', '$phone', > ### '$cell', > ### > '$email', '$url', '$details', '$duration', '$state_id', '$license', > ### > '$date','$comments', '$REMOTE_ADDR', '$user_id', > ### password('$userpass2'))"); > ### > > ### > and it sends a mail to me, however crude: > ### > > ### > > ### > 100% ASAP Plumbing and Rooter Specialist, City ID: 2647 > ### > 1-866-FIX- GUARD, > ### > l > ### > > ### > Array (this is supposed to be a url) > ### > > ### > PlumberASAP.com Specializing in Drains, Faucets, Filters, Repairs, > ### Sprinkers, > ### > Installations, Water Heaters, Disposals, Copper Plumbing, Leak > ### Detection. > ### Fast, > ### > Clean and Courteous Service Danny McGowan Owner/Operator > ### > , > ### > 12 months, > ### > > ### > > ### > I can't duplicate the problem. > ### > > ### > Any idea what is happening here? > ### > > ### > Thanks > ### > > ### > > ### > -- > ### > 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 > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Stumped!
--- Chris Shiflett <[EMAIL PROTECTED]> wrote: > --- [EMAIL PROTECTED] wrote: > > I keep getting a parser error and I can't figure > > it out. Here is the code and any help is greatly > > appreciated. > > > > $sql = "SELECT * FROM requests"; > > > > while ($result = mysql_fetch_array($query)) > > While this is not related to your parse error, it is a > major logic flaw, as mysql_fetch_array() takes a result > set > as an argument, not an SQL statement. > > > echo (" href=\"edit.php?id='$id'\">$meetingName"); > > This is your parse error. Get rid of the parentheses. Actually, the parse error is that you never close the while loop. Still, the error message would point you in the right direction. Chris -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Reject some?
On Tuesday 17 December 2002 02:46, Gerard Samuel wrote: > What Im trying to do is, reject all email address strings ending in > yahoo.com, except [EMAIL PROTECTED] > Im trying -> > > if (preg_match('/[^[EMAIL PROTECTED]|yahoo.com]$/', '[EMAIL PROTECTED]')) > { > echo 'match found'; > } > else > { > echo 'match not found'; > } > > ?> > > The search pattern must also be capable of expanding to something like -> > ^[EMAIL PROTECTED]|yahoo.com|^foo@hotmail|hotmail.com > Basically what Im trying to perform is to reject all email address > strings ending in either yahoo.com or hotmail.com, > except strings ending in [EMAIL PROTECTED] or [EMAIL PROTECTED] I'm not going to try writing the regex for you, but I can point out at least two problems with it: 1) ^ inside square brackets means logical NOT 2) A period (.) means "any character". If you want to match a literal period you need to escape it using a backslash. -- Jason Wong -> Gremlins Associates -> www.gremlins.biz Open Source Software Systems Integrators * Web Design & Hosting * Internet & Intranet Applications Development * /* There's something the technicians need to learn from the artists. If it isn't aesthetically pleasing, it's probably wrong. */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] php setup
it is turned on -Original Message- From: Rasmus Lerdorf [mailto:[EMAIL PROTECTED]] Sent: Monday, December 16, 2002 2:03 PM To: Edward Peloke Cc: php Subject: Re: [PHP] php setup Turn on register_globals in your php.ini file. On Mon, 16 Dec 2002, Edward Peloke wrote: > I recently got a laptop and was in the process this weekend of installing, > php, apache, mysql etc. One thing I noticed is when I ran the code (that > works fine everywhere else) on the laptop, I got errors of 'Variable not > defined' and I have pictures that just won't show. I am not sure if this is > the problem but most of the scripts giving the 'Variable not defined problem > and the images where in other folders and referenced in the php page like > /images/picture.gif and /includes/template1.inc. Is there something I need > to look at in my config file? > > Thanks, > Eddie > > > -- > 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] Re: Stumped!
You don't have a closing french brace for your while loop. - Original Message - From: <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Cc: <[EMAIL PROTECTED]> Sent: Monday, December 16, 2002 12:57 PM Subject: Re: [PHP] Re: Stumped! Hmm, I am still getting a parse error on the last line of code... In a message dated 12/16/2002 1:49:26 PM Eastern Standard Time, [EMAIL PROTECTED] writes: > $sql = "SELECT ."; > $sql_e = mysql_query($sql); > > while ($result = mysql_fetch_array($query_e)) { > . > } > > You were missing the mysql_query > > > <[EMAIL PROTECTED]> escribió en el mensaje > [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > >I am trying to display a column from my database as a list. Each listing > >needs to be a URL that links to another script that brings up all of the > data > >in the row to edit. I keep getting a parser error and I can't figure it > out. > > Here is the code and any help is greatly appreciated. > > > > >$db = mysql_connect("localhost", "Uname", "PW"); > > > >$select_db = mysql_select_db("machmedi_meetingRequest",$db); > >$sql = "SELECT * FROM requests"; > > > >while ($result = mysql_fetch_array($query)) { > >$id= $result["id"]; > >$meetingName= $result["meetingName"]; > > > >echo ("$meetingName "); > >?> > > > > Christopher Parker Senior Corporate Technical Specialist, Corporate Events America Online Inc. Phone: 703.265.5553 Fax: 703.265.2007 Cell: 703.593.3199 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] regex for fqdn test
Hi- I was wondering if someone could help me with a regex to test for a valid domain name (foo.com). Thanks in advance, Max -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] php setup
You have the error_reporting set at E_ALL in the ini file. Set it to E_ALL & ~E_NOTICE - Original Message - From: "Edward Peloke" <[EMAIL PROTECTED]> To: "php" <[EMAIL PROTECTED]> Sent: Monday, December 16, 2002 1:29 PM Subject: [PHP] php setup > I recently got a laptop and was in the process this weekend of installing, > php, apache, mysql etc. One thing I noticed is when I ran the code (that > works fine everywhere else) on the laptop, I got errors of 'Variable not > defined' and I have pictures that just won't show. I am not sure if this is > the problem but most of the scripts giving the 'Variable not defined problem > and the images where in other folders and referenced in the php page like > /images/picture.gif and /includes/template1.inc. Is there something I need > to look at in my config file? > > Thanks, > Eddie > > > -- > 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] Error 155 using exec - please help !
Here is what i do to parse a file with a perl script from PHP to get a formatted output from the file : error_reporting(E_ALL); $cmd="/pathto/dump.pl \"".$HTTP_POST_VARS["filename"]."\" 2>&1"; $res=exec($cmd,$tab,$err); With small files all goes fine, but when parsing a big file i get the 155 error code in $err, while PHP doesn't report any error ($tab stays empty) Of course if I launch the same command directly from the shell, all goes fine even with very very big files. Where can i find more info about that error code ? Is it returned by perl, sh, Apache or PHP ? Probably because of some memory limit, where can i tune that memory limit ? I'am on FreeBSD4+Apache 1.3+PHP4 apache module+perl 5 Thanks for any help. David. -- 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] Socket_connect() timeout
Hi- Warning: socket_connect() unable to connect [60]: Operation timed out in /usr/home/maxc/public_html/admin/functions.inc on line 66 Is there any way to time out this function? I only want to wait 5 seconds. Thanks in advance, Max -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] php setup
thanks, I will give that a shot. -Original Message- From: Joseph W. Goff [mailto:[EMAIL PROTECTED]] Sent: Monday, December 16, 2002 2:25 PM To: php-general; Edward Peloke Subject: Re: [PHP] php setup You have the error_reporting set at E_ALL in the ini file. Set it to E_ALL & ~E_NOTICE - Original Message - From: "Edward Peloke" <[EMAIL PROTECTED]> To: "php" <[EMAIL PROTECTED]> Sent: Monday, December 16, 2002 1:29 PM Subject: [PHP] php setup > I recently got a laptop and was in the process this weekend of installing, > php, apache, mysql etc. One thing I noticed is when I ran the code (that > works fine everywhere else) on the laptop, I got errors of 'Variable not > defined' and I have pictures that just won't show. I am not sure if this is > the problem but most of the scripts giving the 'Variable not defined problem > and the images where in other folders and referenced in the php page like > /images/picture.gif and /includes/template1.inc. Is there something I need > to look at in my config file? > > Thanks, > Eddie > > > -- > 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] Code appearing suddenly!.
Hi, I've just recompiled PHP 4.2.3 on RedHat w/Apache, after having upgraded from Perl 5.6.0 to 5.8.0 (I had to disable mod_perl for now, due to incompatible libraries). But now something weird is happening: sometimes as a page with PHP code loads in the browser, it's not processed by PHP, but the PHP code is shown (!), and the weird part of the problem is that sometimes the very same page gets executed correctly! (no code is displayed, and of course no modification is done in httpd.conf or mime types, etc.). Any idea of the cause of this weird problem?. Thanks. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Divide into words
Uros Gruber wrote: Hi! For example i have some words: Today is very beautiful day and sun is shining What i want to get from this is array words [Today] => 0 [Is] => 6,30 [Very] => 8 [beautiful] => 12 .. Can somebody please help me with this. Those nubers are position of special word in above sentence. If word repeates i want to have both positions saved in same row like word is. I tried something but i think it's to lame. how about ... -- Sean -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Socket_connect() timeout
--- Max Clark <[EMAIL PROTECTED]> wrote: > Warning: socket_connect() unable to connect [60]: > Operation timed out in > /usr/home/maxc/public_html/admin/functions.inc on line 66 > > Is there any way to time out this function? I only want > to wait 5 seconds. Now that you mention it, I am not aware of any way to override that timeout setting. The socket extension is still experimental, I believe, with hopes of changing its status soon. Perhaps this is something someone is working on. As a possible way around this, could you possible solve your problem by opening a socket as a virtual file pointer instead? For example, this would only wait 5 seconds for a connection: $fp=fsockopen($host, $port, $err_num, $err_message, "5"); You can treat $fp like any other file pointer, so it is actually a pretty convenient way to read/write to sockets. Hope that helps. Chris -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] PHP Auto-Responder
I need a solution to activate a PHP script when somebody sends an email to a specified account. I've looked into procmail and sork and find that I am in way over my head. I know my way around PHP well enough but I'm more than a little dense when it comes to Unix commands. I wouldn't even know how to install procmail, let alone use it. So is there a more "Plug n' Play" solution that I can unzip, upload to my FTP account, modify a few variables, and just have it work? Perhaps through sendmail which is already installed on the server? Surely the problem is universial enough that somebody has come up with a solution. I appreciate any help tracking it down. -Kevin -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Hi!!
Hi ALL! I'm new on PHP (just a few mounths) and i'm learning , my problem is that i dont have good projects to do., can someone tell me where can i enroll in a good proyect o someone to help.. Thank you so much. Tomas Lopez _ MSN. Más Útil Cada Día http://www.msn.es/intmap/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php