Re: [PHP] Using constructs like unset() in expressions like ()()
Ciao Tomas, I'm not sure if I followed your question completely but do you mean to test a variable or an array element and unset it if it matches a certain type? If so, then maybe: http://it.php.net/is_int is_bool(), is_float(), is_numeric(), is_string(), is_array(), and is_object() will be of help? Ian On Wed, 2004-12-15 at 22:36 +0100, Tomas Tintera wrote: Hi all. Is there some construct, which evaluates any type of its parameter (like t_echo, t_unset) and returns some value with normal type (like 0)? What? I would like to unset a variable in an operation like ()?unset():() and I can not use if because if does not return normal type of value (like 0 or 'a') and can not be used in operations like () (). Tomas Tintera -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] fsockopen to own server
Hello. I'm having a problem with fsockopen and was wondering has anyone ever noticed a case where it will work from machine1 (dev machine) to machine2. But when the was placed onto machine2 it wouldn't work connecting to it's own ip address; when connecting via telnet it returns: Escape character is '^]'. * OK [CAPABILITY IMAP4REV1 LOGIN-REFERRALS AUTH=LOGIN] serverip IMAP4rev1 2003.339-cpanel at Wed, 15 Dec 2004 19:33:27 + (GMT) so I don't think it's the firewall. the error it returns is No such file or directory. So it seems that when it connects (which it does without failing), the file seems to be deleted, as the file the variable refers to doesn't exist on the fs either. if(($s = fsockopen($id[sockname], 0, $errno, $errstr)) === FALSE) $id[sockname] is in the format /tmp/filename with the filename changing based on a random value and there are no files with that format in /tmp it always returns false for some reason on this server. Thanks in advance for your help. Dave -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Question in posting form-data
Yao, Minghua wrote: Hi, all, I am testing how to post form-data to a host using the following code (test.php): ?php function PostToHost($host, $path, $name, $value) { // Test of posting form-data $fp = fsockopen($host,80); fputs($fp, POST $path HTTP/1.1\n); fputs($fp, Host: $host\n); fputs($fp, Content-Type: multipart/form-data\n); fputs($fp, content-disposition: form-data; name=$name\n); fputs($fp, Connection: close\n\n); fputs($fp, $value\n); $res = ; while(!feof($fp)) { $res .= fgets($fp, 128); } fclose($fp); return $res; } Check your function carefully. Where are you using the $name of the value? Nowhere! Therefore the receiving script cannot identify the value as x. Try: fputs($fp, $name=$value\n); Erwin -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Good and free encoder for PHP5
On Thu, 16 Dec 2004 01:57:42 -0200, Manuel Lemos [EMAIL PROTECTED] wrote: The point is that old software versions that work on old environment versions do not need you to upgrade the environment version even the vendor deprecates the old version. Wrong. Security issues force upgrades. Operating systems being depricated forces upgrades. While you think that newer versions will not have old bugs that probably were not affecting you, chances are that newer versions have newer bugs that may break your applications, especially if you upgrade right after those new versions are released. I never said anything of the sort. What I am trying to tell you is that you need to use your brain Yeah, I probably never use my brain, thanks for that. -- Greg Donald Zend Certified Engineer http://gdconsultants.com/ http://destiney.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: counting chars..
strlen is not accurate unless its a raw string, meaning just alpha chars, or numbers.. otherwise you should run trim, strip_tags and the likes first. - Original Message - From: M. Sokolewicz [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, December 16, 2004 6:09 AM Subject: [PHP] Re: counting chars.. Louie Miranda wrote: ?php $string = function yes good; $display = count_chars($string); echo $display; ? i know this is wrong, but how can i count chars used here? strlen() -- 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] Possible to make $$ distributing PHP as Shareware?
I would say it depends on how much money your are looking to make. You're not going to get rich selling it as shareware, but you may build a user base. You could then try switching it to a commercial product. Just remember, if it's a commercial product, people will expect a certain level of support (like with basic installation). I know of at least one person making money on a commercial php product that started out as shareware. Personally, I think it is an excellent product, although I've only used the old shareware version. http://www.taskspro.com/ On Dec 15, 2004, at 9:50 PM, Jonathan wrote: Hi, I have developed a full email marketing application (using php, mysql) which supports tracking technology (i.e. whether the recipient has read the email, view online, unsubscribe, click on any of the link etc), bounce mail management, backend engine. Is it possible to make some $$ if I distribute the application as a shareware or should I just sell it as an commercial package. If you have any experience with this, kindly enlighten me. Thanks, Jonathan -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- Brent Baisley Systems Architect Landover Associates, Inc. Search Advisory Services for Advanced Technology Environments p: 212.759.6400/800.759.0577 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] smtp server
Hi there.. I´m trying to use the mail function but I have a problem. I´m working in a LAN with more or less 30 pcs, that places inside a huge network, and I just can´t use the enterprise smtp server. How can i set a valid smtp server? I thought about installing some good-free smtp server on my own pc, and then use it for the mail function. What do you think of this idea? Would you recommend any free smtp server currently available? That largely depends on your OS. If you're on Windows, there's a TON of free SMTP servers. I just use IIS because it's as easy as popping in the Windows CD and I know well enough to lock down the SMTP settings as to not have an open relay. If you're on any of the *nix'es, it's hard to go wrong with sendmail. -M -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] How to distribute php codes safely?
Hi, Is there a replace to Zend encoder that I can use for free? Zend encoder is too expensive for a small fry developer like me. Thanks for your help. Jonathan Tang -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Database Framework
[snip] Is there an on-going initiative as far as creating a PHP framework somewhat the same as .Net's framework implementation? Like for instance, the System.Data namespace where PHP developer can just create something like a DataAdapter which can connect to a datastore and fill a DataSet object? I think that would make our life a little easier? This post is by not any means a way to start a flame war or something, I just thought about it and I think it makes sense. [/snip] If you think so, write it. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] smtp server
On Thursday 16 December 2004 23:00, Mike wrote: If you're on any of the *nix'es, it's hard to go wrong with sendmail. I think you mean it's hard not to go wrong with sendmail ;-) -- Jason Wong - Gremlins Associates - www.gremlins.biz Open Source Software Systems Integrators * Web Design Hosting * Internet Intranet Applications Development * -- Search the list archives before you post http://marc.theaimsgroup.com/?l=php-general -- /* This isn't brain surgery; it's just television. - David Letterman */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] GD library with tiff images
hi, I am trying to write an image upload facility, which resizes the images, which I am obviously using the GD library for. Does anyone know if there are any functions I can use to read in images encoded in tiff image format? Cheers, Tom -- Working on webhosting Tel:01388 11 MTA handling, PHP Web:www.digital-data.co.uk scripting, and wireless Email:[EMAIL PROTECTED] networking, just for a change. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Database Framework
that had been my intensions, just wanna make sure i'm not reinventing the wheel :) regards, http://jonel.road14.com -- I not know English well, but I know 7 computer languages. anonymous On Dec 16, 2004, at 7:29 AM, Jay Blanchard wrote: [snip] Is there an on-going initiative as far as creating a PHP framework somewhat the same as .Net's framework implementation? Like for instance, the System.Data namespace where PHP developer can just create something like a DataAdapter which can connect to a datastore and fill a DataSet object? I think that would make our life a little easier? This post is by not any means a way to start a flame war or something, I just thought about it and I think it makes sense. [/snip] If you think so, write it. -- 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] Oversized file behaviour
Hello people. I am working on a file upload script, which has an upload limit of 2MB (set by directive in php.ini). when I try to upload a file that is larger than that it loads the page it is meant to but something strange happens to the $_POST data, it all seems to dissappear. can someone clarify quite what happens when an upload is larger than the legal limit. Cheers, Tom -- Working on webhosting Tel:01388 11 MTA handling, PHP Web:www.digital-data.co.uk scripting, and wireless Email:[EMAIL PROTECTED] networking, just for a change. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] smtp server
Jason Wong wrote: On Thursday 16 December 2004 23:00, Mike wrote: If you're on any of the *nix'es, it's hard to go wrong with sendmail. I think you mean it's hard not to go wrong with sendmail ;-) no, that means it's easy to go wrong with sendmail... I think Mike did mean that it's hard to go wrong with it ;) (IMHO) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Oversized file behaviour
[EMAIL PROTECTED] wrote: Hello people. I am working on a file upload script, which has an upload limit of 2MB (set by directive in php.ini). when I try to upload a file that is larger than that it loads the page it is meant to but something strange happens to the $_POST data, it all seems to dissappear. can someone clarify quite what happens when an upload is larger than the legal limit. Hm. Never seen that one... The $_FILES array should have blanks/false in it, plus an error value in one array element. Did you at least get that? Do you have the right ENCTYPE attribute in your FORM tag?... Just to be pedantic -- You *have* had it work with a file 2 MB, right? -- Like Music? http://l-i-e.com/artists.htm -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP Apache Upload file Permission denied
Michael Leung wrote: Hi All, My problem is finally solved by totally off SELinux Security Policies. I told you so :-)) Thank you very verry much the helps from yours! I know this is not very safe solution, but at the leasy my script can work yours, Michael -- Raditha Dissanayake. -- http://www.radinks.com/print/card-designer/ | Card Designer Applet http://www.radinks.com/upload/ | Drag and Drop Upload -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] fsockopen to own server
Doc wrote: Hello. I'm having a problem with fsockopen and was wondering has anyone ever noticed a case where it will work from machine1 (dev machine) to machine2. happens all the time :-) But when the was placed onto machine2 it wouldn't work connecting to it's own ip address; when connecting via telnet it returns: Escape character is '^]'. * OK [CAPABILITY IMAP4REV1 LOGIN-REFERRALS AUTH=LOGIN] serverip IMAP4rev1 2003.339-cpanel at Wed, 15 Dec 2004 19:33:27 + (GMT) so I don't think it's the firewall. usually a good idea to disable firewalls when having trouble with socket code. the error it returns is No such file or directory. So it seems that when it connects (which it does without failing), the file seems to be deleted, as the file the variable refers to doesn't exist on the fs either. if(($s = fsockopen($id[sockname], 0, $errno, $errstr)) === FALSE) $id[sockname] is in the format /tmp/filename with the filename changing based on a random value and there are no files with that format in /tmp it always returns false for some reason on this server. not sure what you are trying to do but it sounds like you are using unix domain sockets where you should be using tcp. That's why it might work on one machine (where web and imap are both installed) and not on the other where you only have the web server but the imap server is remote. -- Raditha Dissanayake. -- http://www.radinks.com/print/card-designer/ | Card Designer Applet http://www.radinks.com/upload/ | Drag and Drop Upload -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] GD library with tiff images
[EMAIL PROTECTED] wrote: I am trying to write an image upload facility, which resizes the images, which I am obviously using the GD library for. Does anyone know if there are any functions I can use to read in images encoded in tiff image format? As far as I know, the GD image functions of PHP do not support TIFF. A very very very brief search on Boutell's site didn't turn up TIFF either, so I'm guessing it's just not in GD at all. One option might be to convert to JPEG using ImageMagik (aka convert). At that point, depending on your application, you might as well have ImageMagik scale it too. You'll need to use http://php.net/exec and maybe mess around with shell permissions and paths a bit. GD is great, but for re-sizing your uploaded images, it might be better to write a shell script in some kind of cron job to resize/move images using ImageMagik -- If you have to pop out to a shell (which is what exec does, essentially) you might as well just start (and stay) in the shell anyway. YMMV The last paragraph really only applies if performance is a significant factor in your upload routine. -- Like Music? http://l-i-e.com/artists.htm -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Oversized file behaviour
[EMAIL PROTECTED] wrote: Hello people. I am working on a file upload script, which has an upload limit of 2MB (set by directive in php.ini). when I try to upload a file that is larger than that it loads the page it is meant to but something strange happens to the $_POST data, it all seems to dissappear. can someone clarify quite what happens when an upload is larger than the legal limit. it's probably not the upload_max_filesize but the post_max_size. File uploads are effected by settings other than the upload_max_filesize. If you happen to exceed the maximum allowed size for POST the $_POST may disappear. Cheers, Tom -- Raditha Dissanayake. -- http://www.radinks.com/print/card-designer/ | Card Designer Applet http://www.radinks.com/upload/ | Drag and Drop Upload -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Question in posting form-data
You also need to URLEncode the $value, either before you pass it in, or inside the function itself. Where did you get this PostToHost function?... Did you modify it? Cuz, like, I don't think this one is very good... Where did that content-disposition: come from? And virtually every FORM on the web has more than one input, so you're going to need to handle that. Google for PostToHost Rasmus Lerdorf to find the original and compare it with yours. Yao, Minghua wrote: Thanks. I changed fputs($fp, $value\n); to fputs($fp, $name=$value\n); But I still got the same message. -Minghua -Original Message- From: Erwin Kerk [mailto:[EMAIL PROTECTED] Sent: Thu 12/16/2004 6:30 AM To: Yao, Minghua Cc: [EMAIL PROTECTED] Subject: Re: [PHP] Question in posting form-data Yao, Minghua wrote: Hi, all, I am testing how to post form-data to a host using the following code (test.php): ?php function PostToHost($host, $path, $name, $value) { // Test of posting form-data $fp = fsockopen($host,80); fputs($fp, POST $path HTTP/1.1\n); fputs($fp, Host: $host\n); fputs($fp, Content-Type: multipart/form-data\n); fputs($fp, content-disposition: form-data; name=$name\n); fputs($fp, Connection: close\n\n); fputs($fp, $value\n); $res = ; while(!feof($fp)) { $res .= fgets($fp, 128); } fclose($fp); return $res; } Check your function carefully. Where are you using the $name of the value? Nowhere! Therefore the receiving script cannot identify the value as x. Try: fputs($fp, $name=$value\n); Erwin -- Like Music? http://l-i-e.com/artists.htm -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Question
Hi, I'm using PHP 4.3.2 and using ODBC to connect to my Access database. I want to get the value from this query statement: select count(id) as quantity from danhmucdia. How can I get this value? How can I equalize this value into variable ? Thank you for reading my email. Dennis
Re: [PHP] Database Framework
Jonel Rienton wrote: Is there an on-going initiative as far as creating a PHP framework somewhat the same as .Net's framework implementation? Like for instance, the System.Data namespace where PHP developer can just create something like a DataAdapter which can connect to a datastore and fill a DataSet object? I think that would make our life a little easier? This post is by not any means a way to start a flame war or something, I just thought about it and I think it makes sense. I thought somebody was doing a PHP Module to connect to .Net Don't ask my *why* they think that's a Good Idea, but there it is. :-) PEAR might be worth looking at. There's an ADODB interface out there for PHP, which I think works kind of like what you describe. Since I pretty much hate all these things, and have used them for a maximum of 5 minutes except when forced to use them more by circumstances, I'm not the best source, but all you have to do is dig and you'll find what you want, most likely. Good luck! -- Like Music? http://l-i-e.com/artists.htm -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] GD, problem adding text to GIF images
Hi, I'm adding text to images using the native gd in PHP 4.3.9 I have no problems with jpg images, but with gif ones, the colour of the text added to the image always results a dark grey The image itself and text are fine, but not the colour, which should be white.. Has anyone experienced this problem? Used functions are: imagecreatefromgif imagettftext imagegif Thanks in advance, Juan -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Parse Error... how to fix?
To view the terms under which this email is distributed, please go to http://disclaimer.leedsmet.ac.uk/email.htm On 16 December 2004 17:39, GH wrote: Hi All... Got a problem... here is the error: Parse error: parse error, expecting `T_STRING' or `T_VARIABLE' or `T_NUM_STRING' in /var/www/html/ahrc_computerclub/ahrc_computerclub.php on line 42... I am not sure on how to fix it... line 42 is: TITLE $language['program_name'] /TITLE\n . TITLE {$language['program_name']} /TITLE\n . But: function printHeader(){ echo !DOCTYPE HTML PUBLIC \-//W3C//DTD HTML 4.0 Transitional//EN\\n . \http://www.w3.org/TR/REC-html40/loose.dtd\;HTML\n . HEAD\n . meta name=\description\ content=\\ \n . meta name=\author\ content=\Gary H\\n . meta name=\keywords\ content=\\ \n . meta http-equiv=\Content-Type\ content=\text/html; charset=iso-8859-1\\n . TITLE $language['program_name'] /TITLE\n . /HEAD\n. BODY\n; This is messy and somewhat unreadable. I would suggest either a heredoc: function printHeader(){ echo HEAD !DOCTYPE HTML PUBLIC \-//W3C//DTD HTML 4.0 Transitional//EN http://www.w3.org/TR/REC-html40/loose.dtd\; HTML HEAD meta name=description content= meta name=author content=Gary H meta name=keywords content= meta http-equiv=Content-Type content=text/html; charset=iso-8859-1 TITLE {$language['program_name']} /TITLE /HEAD BODY HEAD; } or escaping from PHP into raw HTML: function printHeader(){ ? !DOCTYPE HTML PUBLIC \-//W3C//DTD HTML 4.0 Transitional//EN http://www.w3.org/TR/REC-html40/loose.dtd\; HTML HEAD meta name=description content= meta name=author content=Gary H meta name=keywords content= meta http-equiv=Content-Type content=text/html; charset=iso-8859-1 TITLE ?php echo $language['program_name'] ? /TITLE /HEAD BODY ?php } -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Using constructs like unset() in expressions like ()()
Tomas Tintera wrote: Is there some construct, which evaluates any type of its parameter (like t_echo, t_unset) and returns some value with normal type (like 0)? What? I would like to unset a variable in an operation like ()?unset():() and I can not use if because if does not return normal type of value (like 0 or 'a') and can not be used in operations like () (). Nor sure I understand that question at all, but... http://php.net/gettype http://php.net/assert http://php.net/is_int You may also want to look at type-casting: http://php.net/language.types.type-juggling.php http://php.net/settype If none of those solve what you want, read the whole front section of the PHP manual on-line -- Up to the Function Reference section. I think what you want is in there somewhere. -- Like Music? http://l-i-e.com/artists.htm -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Parsing php in html with IIS
Eric Lindsey wrote: How do I configure my IIS server to parse a specific .html file for php code? I know how to do this on apache, but windows scares me :-) So far, all the answers assume he wants to have *ALL* .html files parsed as PHP. He only wants *ONE* *SPECIFIC* .html file parsed. In IIS. I'm no IIS expert, but I don't think it's flexible enough to do that. Microsoft is so borg-like. Anyway, you might try mixing the answers you've got with different directories or even the IIS version of VirtualHosts to narrow things down to just the one .html file. If all else fails, install Apache :-) -- Like Music? http://l-i-e.com/artists.htm -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Parse Error... how to fix?
I will try this when i get back to my other computer where development takes place the script format was originally started by an IDE that I am starting to add my code to ... so I will look at. On Thu, 16 Dec 2004 18:19:43 -, Ford, Mike [EMAIL PROTECTED] wrote: To view the terms under which this email is distributed, please go to http://disclaimer.leedsmet.ac.uk/email.htm On 16 December 2004 17:39, GH wrote: Hi All... Got a problem... here is the error: Parse error: parse error, expecting `T_STRING' or `T_VARIABLE' or `T_NUM_STRING' in /var/www/html/ahrc_computerclub/ahrc_computerclub.php on line 42... I am not sure on how to fix it... line 42 is: TITLE $language['program_name'] /TITLE\n . TITLE {$language['program_name']} /TITLE\n . But: function printHeader(){ echo !DOCTYPE HTML PUBLIC \-//W3C//DTD HTML 4.0 Transitional//EN\\n . \http://www.w3.org/TR/REC-html40/loose.dtd\;HTML\n . HEAD\n . meta name=\description\ content=\\ \n . meta name=\author\ content=\Gary H\\n . meta name=\keywords\ content=\\ \n . meta http-equiv=\Content-Type\ content=\text/html; charset=iso-8859-1\\n . TITLE $language['program_name'] /TITLE\n . /HEAD\n. BODY\n; This is messy and somewhat unreadable. I would suggest either a heredoc: function printHeader(){ echo HEAD !DOCTYPE HTML PUBLIC \-//W3C//DTD HTML 4.0 Transitional//EN http://www.w3.org/TR/REC-html40/loose.dtd\; HTML HEAD meta name=description content= meta name=author content=Gary H meta name=keywords content= meta http-equiv=Content-Type content=text/html; charset=iso-8859-1 TITLE {$language['program_name']} /TITLE /HEAD BODY HEAD; } or escaping from PHP into raw HTML: function printHeader(){ ? !DOCTYPE HTML PUBLIC \-//W3C//DTD HTML 4.0 Transitional//EN http://www.w3.org/TR/REC-html40/loose.dtd\; HTML HEAD meta name=description content= meta name=author content=Gary H meta name=keywords content= meta http-equiv=Content-Type content=text/html; charset=iso-8859-1 TITLE ?php echo $language['program_name'] ? /TITLE /HEAD BODY ?php } -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Parse Error... how to fix?
line 42 is: TITLE $language['program_name'] /TITLE\n . Try: 'TITLE'.$language['program_name'].'/TITLE' -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Parse Error... how to fix?
GH wrote: Got a problem... here is the error: Parse error: parse error, expecting `T_STRING' or `T_VARIABLE' or `T_NUM_STRING' in /var/www/html/ahrc_computerclub/ahrc_computerclub.php on line 42... I am not sure on how to fix it... line 42 is: TITLE $language['program_name'] /TITLE\n . echo !DOCTYPE HTML PUBLIC \-//W3C//DTD HTML 4.0 Transitional//EN\\n . TITLE $language['program_name'] /TITLE\n . #1. Get rid of the ''s around program_name. Those won't work inside of s. #2. Re-read the PHP on-line manual section on strings. #3. Just break out of PHP for anything more than two lines of HTML. -- Like Music? http://l-i-e.com/artists.htm -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Question
Dennis Yang wrote: I'm using PHP 4.3.2 and using ODBC to connect to my Access database. I want to get the value from this query statement: select count(id) as quantity from danhmucdia. How can I get this value? How can I equalize this value into variable ? It's a query, just like any other query. So you're going to send it to ODBC the same as you send any other query. I don't know the ODBC syntax, but it's going to be something like: $query = select count(id) as quantity from danhmucdia; $id_count_set = odbc_query($query) or trigger_error(odbc_error() . $query, E_USER_ERROR); $id_count = odbc_result($id_count_set, 0, 0); You could also use odbc_fetch_row or odbc_fetch_array. The preceding lines all assume ODBC works the same as MySQL, which may or may not be true to varying degrees of truth. http://php.net/odbc -- Like Music? http://l-i-e.com/artists.htm -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Parse Error... how to fix?
GH wrote: Hi All... Got a problem... here is the error: Parse error: parse error, expecting `T_STRING' or `T_VARIABLE' or `T_NUM_STRING' in /var/www/html/ahrc_computerclub/ahrc_computerclub.php on line 42... I am not sure on how to fix it... line 42 is: TITLE $language['program_name'] /TITLE\n . The language.php file only has: $language['program_name'] = AHRC Computer Club Program Leader Information Managment; Thank you for any and all assistance provided This is the entire ahrc_computerclub.php file: ?PHP #AHRC Program Leader Information Management# #Copyright (C) 2004 by Gary H # #EMAIL INFORMATION HERE # # This project is intended for Gary's use only and not to be distributed # # include language file include_once(language.php); # DOCUMENT OUTPUT ##START # printHeader(); echo $language['program_name']; printFooter(); # DOCUMENT OUTPUT ##END # # FUNCTION DEFINITIONS SECTION# function printVersion(){ $version = 0.1; return $version; } function printHeader(){ echo !DOCTYPE HTML PUBLIC \-//W3C//DTD HTML 4.0 Transitional//EN\\n . \http://www.w3.org/TR/REC-html40/loose.dtd\;HTML\n . HEAD\n . meta name=\description\ content=\\ \n . meta name=\author\ content=\Gary H\\n . meta name=\keywords\ content=\\ \n . meta http-equiv=\Content-Type\ content=\text/html; charset=iso-8859-1\\n . TITLE $language['program_name'] /TITLE\n . /HEAD\n. BODY\n; } function printFooter(){ echo \n/BODY/HTML; } ? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Parse Error... how to fix?
Hi All... Got a problem... here is the error: Parse error: parse error, expecting `T_STRING' or `T_VARIABLE' or `T_NUM_STRING' in /var/www/html/ahrc_computerclub/ahrc_computerclub.php on line 42... I am not sure on how to fix it... line 42 is: TITLE $language['program_name'] /TITLE\n . Try: echo TITLE.$language['program_name']./TITLE\n; You need to concatenate your array. -- --Matthew Sims --http://killermookie.org -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: Re: [PHP] Parse Error... how to fix?
You are inside a function and not either passing the variable to the function or declaring it global within the function. In other words, as far as your function is concerned, the $language['program_name'] is empty. From: GH [EMAIL PROTECTED] Date: 2004/12/16 Thu PM 01:09:48 EST To: Marek Kilimajer [EMAIL PROTECTED] CC: php-general [EMAIL PROTECTED] Subject: Re: [PHP] Parse Error... how to fix? However, I can not get any results into the title tags all three options are not displaying On Thu, 16 Dec 2004 13:03:57 -0500, GH [EMAIL PROTECTED] wrote: Ok... thank you. On Thu, 16 Dec 2004 19:02:37 +0100, Marek Kilimajer [EMAIL PROTECTED] wrote: GH wrote: Hi All... Got a problem... here is the error: Parse error: parse error, expecting `T_STRING' or `T_VARIABLE' or `T_NUM_STRING' in /var/www/html/ahrc_computerclub/ahrc_computerclub.php on line 42... I am not sure on how to fix it... line 42 is: TITLE $language['program_name'] /TITLE\n . either one: 1. TITLE $language[program_name] /TITLE\n . 2. TITLE {$language['program_name']} /TITLE\n . 3. TITLE . $language['program_name'] . /TITLE\n . -- 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] Parse Error... how to fix?
GH wrote: However, I can not get any results into the title tags all three options are not displaying $language is in global scope, you need: function printHeader(){ global $language; More: http://sk2.php.net/manual/en/language.variables.scope.php On Thu, 16 Dec 2004 13:03:57 -0500, GH [EMAIL PROTECTED] wrote: Ok... thank you. On Thu, 16 Dec 2004 19:02:37 +0100, Marek Kilimajer [EMAIL PROTECTED] wrote: GH wrote: Hi All... Got a problem... here is the error: Parse error: parse error, expecting `T_STRING' or `T_VARIABLE' or `T_NUM_STRING' in /var/www/html/ahrc_computerclub/ahrc_computerclub.php on line 42... I am not sure on how to fix it... line 42 is: TITLE $language['program_name'] /TITLE\n . either one: 1. TITLE $language[program_name] /TITLE\n . 2. TITLE {$language['program_name']} /TITLE\n . 3. TITLE . $language['program_name'] . /TITLE\n . -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Parse Error... how to fix?
GH mailto:[EMAIL PROTECTED] on Thursday, December 16, 2004 10:10 AM said: However, I can not get any results into the title tags all three options are not displaying try: ?php echo pre; print_r($language['program_name']); echo /pre; ? If you don't see anything then there's no data in your variable. Thus the problem is not occuring during the outputting but of the data but rather the point at which the data is assigned to the variable. hth, Chris. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] GD, problem adding text to GIF images
I believe that is the nature of GIF images, I seem to recall they were very compact but limited to a maximum of 16 colors (or 32 or some number like that[maybe 64]), fewer colors that JPEG. Anyone know exactly? Warren Vail -Original Message- From: Juan Nin [mailto:[EMAIL PROTECTED] Sent: Thursday, December 16, 2004 10:20 AM To: [EMAIL PROTECTED] Subject: [PHP] GD, problem adding text to GIF images Hi, I'm adding text to images using the native gd in PHP 4.3.9 I have no problems with jpg images, but with gif ones, the colour of the text added to the image always results a dark grey The image itself and text are fine, but not the colour, which should be white.. Has anyone experienced this problem? Used functions are: imagecreatefromgif imagettftext imagegif Thanks in advance, Juan -- 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] Parse Error... how to fix?
Richard Lynch mailto:[EMAIL PROTECTED] on Thursday, December 16, 2004 10:46 AM said: TITLE $language['program_name'] /TITLE\n . #1. Get rid of the ''s around program_name. Those won't work inside of s. echo title{$language['program_name']}/title\n; http://us2.php.net/manual/en/language.types.array.php #3. Just break out of PHP for anything more than two lines of HTML. ...or use heredoc syntax. http://us2.php.net/manual/en/language.types.string.php#language.types.st ring.syntax.heredoc Chris. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Getting mail() to return false/0
On Friday 17 December 2004 02:41, Richard Lynch wrote: There are better, easier to use and more secure alternatives to sendmail. True. Many of which require that you understand the basics of sendmail before you use them. Basics such as? You definitely need to know the basics of email (the underlying technology) but I don't see why you need to know Sendmail. At least, that's been my experience. They are drop-in replacements for sendmail, but if you don't understand sendmail, you're lost. I don't understand Sendmail and have only used it through Linuxconf. But that didn't stop me from being reasonably competent with qmail and Postfix. The only thing Sendmail related that you need to understand is how to use the sendmail binary wrapper that most other MTA's provide to emulate the real Sendmail's sendmail binary. And even that is a tenuous relation because in most cases you don't need to know how the original sendmail binary works. All you need to know is that your MTA has a command called 'sendmail' that allows you to send mail and allows other programs that relies on sendmail to be able to send mail. A lot of people under-estimate the complexity of email, no matter how much they THINK they know about how it works. True, that is why using something simpler (that does not necessarily translate to less powerful) instead of the monolithic Sendmail is, for most people starting out, a better choice. The point of this is to emphasize that: - Sendmail is most definitely not the only choice of MTA - Sendmail is (IMO) definitely not the best choice of MTA - you don't need to know anything about Sendmail to be able to successfully use other MTAs - and if you're stuck with Sendmail you should be looking for a way out ;-) -- Jason Wong - Gremlins Associates - www.gremlins.biz Open Source Software Systems Integrators * Web Design Hosting * Internet Intranet Applications Development * -- Search the list archives before you post http://marc.theaimsgroup.com/?l=php-general -- /* [We] use bad software and bad machines for the wrong things. -- R.W. Hamming */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] GD, problem adding text to GIF images
On Thu, 16 Dec 2004 12:27:27 -0700, Vail, Warren [EMAIL PROTECTED] wrote: I believe that is the nature of GIF images, I seem to recall they were very compact but limited to a maximum of 16 colors (or 32 or some number like that[maybe 64]), fewer colors that JPEG. Anyone know exactly? gifs are 8bit, 256 colors. -- Greg Donald Zend Certified Engineer http://gdconsultants.com/ http://destiney.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] fsockopen to own server
Doc wrote: I'm having a problem with fsockopen and was wondering has anyone ever noticed a case where it will work from machine1 (dev machine) to machine2. But when the was placed onto machine2 it wouldn't work connecting to it's own ip address; when connecting via telnet it returns: Escape character is '^]'. * OK [CAPABILITY IMAP4REV1 LOGIN-REFERRALS AUTH=LOGIN] serverip IMAP4rev1 2003.339-cpanel at Wed, 15 Dec 2004 19:33:27 + (GMT) You *ARE* getting this when telnetting from/to the same machine, right?... so I don't think it's the firewall. the error it returns is No such file or directory. So it seems that when it connects (which it does without failing), the file seems to be deleted, as the file the variable refers to doesn't exist on the fs either. if(($s = fsockopen($id[sockname], 0, $errno, $errstr)) === FALSE) $id[sockname] is in the format /tmp/filename with the filename changing based on a random value and there are no files with that format in /tmp Despite the user contributed note on http://php.net/manual/en/transports.unix.php I'm wondering if you shouldn't use the unix:// bit -- and try udg:// as well, if that doesn't work. Finally, if there are no files with that format in /tmp, how will this work? Or is that how unix socket streams are supposed to work? I'm ignorant in this area... But it seems to me that if you try to open a file that's not there, you SHOULD get FALSE back. :-) it always returns false for some reason on this server. And what, if anything, are in $errno and $errstr? You've put them in there, you might as well use them :-) -- Like Music? http://l-i-e.com/artists.htm -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] in_array w/statement
reason it seems to always be true, ... something i'm doing wrong? btw, i cannot add the in_array to the statement because if the $buddylist is empty it will generate errors because of the empty implode. you could add the is_array() check. $buddylist = preg_split('/( )+/', trim($userinfo['buddylist']), -1, PREG_SPLIT_NO_EMPTY); if($buddylist) { $buddy = in_array($uname['uid'], array(implode(',', $buddylist))); } not sure I understand this, implode returns a string, then you are putting that string into the array() function. I dont know what kind of data you would get back from that. $buddylist should already be an array. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] smtp server
Le jeu 16/12/2004 à 14:43, Pablo D Marotta a écrit : Hi there.. I´m trying to use the mail function but I have a problem. I´m working in a LAN with more or less 30 pcs, that places inside a huge network, and I just can´t use the enterprise smtp server. How can i set a valid smtp server? You can use PEAR::Mail class to send e-mails via an external SMTP server (an account you have elsewhere), provided your smtp call isn't stopped by any firewall. Yannick -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] in_array w/statement
yeah, you're right though.. i had to use explode not implode eg, if(in_array($uname['uid'], explode(' ', trim($userinfo['buddylist'] so i ditched the preg_split() cheers. - Original Message - From: Jason Wong [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, December 16, 2004 3:39 PM Subject: Re: [PHP] in_array w/statement On Friday 17 December 2004 02:33, Sebastian wrote: I cannot solve this problem,. sorry if this looks confusing,. It is ... i have a form and don't want to set the variable if the in_array is true.. the code works, up until i add the last !$buddy in the statement, for some reason it seems to always be true, ... something i'm doing wrong? btw, i cannot add the in_array to the statement because if the $buddylist is empty it will generate errors because of the empty implode. $buddylist = preg_split('/( )+/', trim($userinfo['buddylist']), -1, PREG_SPLIT_NO_EMPTY); OK, it looks like $userinfo['buddylist'] is a string containing buddies separated by some whitespace: 'buddy1 buddy2' After the above statement $buddylist becomes an array. if($buddylist) { $buddy = in_array($uname['uid'], array(implode(',', $buddylist))); } Here implode() returns a string containing 'buddy1,buddy2', then you stick that into an array() which is effectively: array('buddy1,buddy2'); // note that there is only *1* element Now unless your $uname['uid'] really is literally 'buddy1,buddy2' then $buddy will be false. Hope that's enough to get you going. -- Jason Wong - Gremlins Associates - www.gremlins.biz Open Source Software Systems Integrators * Web Design Hosting * Internet Intranet Applications Development * -- Search the list archives before you post http://marc.theaimsgroup.com/?l=php-general -- /* The moon is made of green cheese. -- John Heywood */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Using constructs like unset() in expressions like ()()
Thanks for your answers (you probably don't understand me). I am looking for some construct (or statement or function) which allows to do this: ?php (True==False) or (construct_i_am_looking_for(unset($a))); ? Note that the unset() has no return value (and so it can't be used as a part of other expression; it can be only used as a stand-alone statement), so I thing it could be good if there were some construct which makes expression with return value from expression with no return value. It is not possible to use just ?php (True==False) or (unset($a)); ? I have read the whole front section of the PHP manual (and a lot of the rest) but haven't found a construct like that. Is there such a construct in PHP? If there is, what is its name? --Tomas_Tintera -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Question in posting form-data
Yes. I did modify the original since I need to send data to a program which takes only form-data. content-disposition: came from RFC 2388. I don't think the program can take application/x-www-form-urlencoded content. Further help needed. Thanks. -Minghua -Original Message- From: Richard Lynch [mailto:[EMAIL PROTECTED] Sent: Thu 12/16/2004 11:46 AM To: Yao, Minghua Cc: Erwin Kerk; [EMAIL PROTECTED] Subject: RE: [PHP] Question in posting form-data You also need to URLEncode the $value, either before you pass it in, or inside the function itself. Where did you get this PostToHost function?... Did you modify it? Cuz, like, I don't think this one is very good... Where did that content-disposition: come from? And virtually every FORM on the web has more than one input, so you're going to need to handle that. Google for PostToHost Rasmus Lerdorf to find the original and compare it with yours. Yao, Minghua wrote: Thanks. I changed fputs($fp, $value\n); to fputs($fp, $name=$value\n); But I still got the same message. -Minghua -Original Message- From: Erwin Kerk [mailto:[EMAIL PROTECTED] Sent: Thu 12/16/2004 6:30 AM To: Yao, Minghua Cc: [EMAIL PROTECTED] Subject: Re: [PHP] Question in posting form-data Yao, Minghua wrote: Hi, all, I am testing how to post form-data to a host using the following code (test.php): ?php function PostToHost($host, $path, $name, $value) { // Test of posting form-data $fp = fsockopen($host,80); fputs($fp, POST $path HTTP/1.1\n); fputs($fp, Host: $host\n); fputs($fp, Content-Type: multipart/form-data\n); fputs($fp, content-disposition: form-data; name=$name\n); fputs($fp, Connection: close\n\n); fputs($fp, $value\n); $res = ; while(!feof($fp)) { $res .= fgets($fp, 128); } fclose($fp); return $res; } Check your function carefully. Where are you using the $name of the value? Nowhere! Therefore the receiving script cannot identify the value as x. Try: fputs($fp, $name=$value\n); Erwin -- Like Music? http://l-i-e.com/artists.htm
[PHP] incompatibilities between php 4 and 5
Hi all, I am going to migrate my application to php 5. My application didnt use object so much. so, which area I need to be carefull about when I migrate to php 5. (if possible, could you give me the url that will explain about that) thx -- === Best Regards Adwin Wijaya www.kuya-kuya.net www.e-rhema.net === -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: incompatibilities between php 4 and 5
Adwin Wijaya wrote: Hi all, I am going to migrate my application to php 5. My application didnt use object so much. so, which area I need to be carefull about when I migrate to php 5. (if possible, could you give me the url that will explain about that) thx Search the PHP.net or zend.com sites for this it's really easy to find. There were a few functions that changed, but the biggest difference (after the OO changes) was with XML. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: web IDE
If you're looking for an easy-to-use IDE then Dreamweaver is a good choice even though it's not web-based. Given what you've said about how new you are to all of this it would probably be worth your money to purchase it. For something that is PHP-based there are PEAR packages you might use, i.e. HTML_Quickform. IMO it's not quite so simple as using Dreamweaver (in fact it's not really an IDE), but it is free and helps build forms (especially helpful for multi-page forms). I'm not aware of anything that fits your requirements exactly... so make your choice. One problem I'm having at the moment is how to create a file from an html form. I have a php script that uses fopen() to create a new file. This works fine when I call it from bash but I don't know how to do it using a button on an html form. Any ideas? Click a button and create a file? Well you need a name / value for the submit button to do this and whenever your $_GET or $_POST have this variable you can do the file-creation stuff. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: pspell on w32
Please do not post the same question twice within a few minutes! This is an active list; just wait for a day or two. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Delete files from the server
[snip] I have uploaded some pictures and thumbnails using a PHP form into a particular directory. I would like to be able to select the name of the picture and then chose to delete that picture and its thumbnail from the server using another form. The name of the picture is in the MySQL database. Is there any way to do this? [/snip] Yes. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Good and free encoder for PHP5
Hello, on 12/16/2004 02:10 AM Matthew Weier O'Phinney said the following: You *do* make valid points about making needless upgrade -- if no security vulnerabilities exist, the application works fine, and you don't need features from the new version, there really is no reason to upgrade. But when a security vulnerability *does* exist, and it *could* affect your application, you've got another issue entirely on your hands. The trick is learning to distinguish between the two. You are still missing the point. A version may have vulnerabilities that affect functions that you do not use. Upgrading in that case is pointless and risky because newer versions have new bugs. Go and read back PHP version history and notice that were times when a vulnerability fixing upgrade introduced new vulnerabilities. If the old vulnerability was not affection your application you should not have upgrade. Another point is that, if there is a patch available, apply the patch instead of upgrading to a new version. That is a common practice of high quality control Linux distributions like SuSE. Often when a vulnerability is reported, they provide a security fix that just applies the patch. This way you do not risk to break other things or be affected by new vulnerabilities. -- Regards, Manuel Lemos PHP Classes - Free ready to use OOP components written in PHP http://www.phpclasses.org/ PHP Reviews - Reviews of PHP books and other products http://www.phpclasses.org/reviews/ Metastorage - Data object relational mapping layer generator http://www.meta-language.net/metastorage.html -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] pspell on w32
I can't instantiate new instances of the pspell library. I've got the latest w32 binaries installed and the latest english dictionary installed to c:\aspell. I've got aspell and aspell\bin added to the system environment path. I've got the aspell.dll in the system32 folder. Permissions look like they are working. A phpinfo() command shows that I have php4.3.10 with pspell enabled. However, when I run the command pspell_check($pspell_link, testt) in my web scripts, the page appears to header redirect on itself indefinitely. Please help. -Ethan Nelson, Modulus, LLC -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Using constructs like unset() in expressions like ()()
Thanks for your answers (you probably don't understand me). I am looking for some construct (or statement or function) which allows to do this: ?php (True==False) or (construct_i_am_looking_for(unset($a))); ? Note that the unset() has no return value (and so it can't be used as a part of other expression; it can be only used as a stand-alone statement), so I thing it could be good if there were some construct which makes expression with return value from expression with no return value. It is not possible to use just ?php (True==False) or (unset($a)); ? I have read the whole front section of the PHP manual (and a lot of the rest) but haven't found a construct like that. Is there such a construct in PHP? If there is, what is its name? --Tomas_Tintera -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] How to distribute php codes safely?
Thanks Travis, Actually, I did search thru google but only found free trial encoder that will termiate say 30 days for Zend Encoder, 3 days for phppro, etc. Will check out the rssoftlab enconder and feedback here. Thanks for your help. Cheers, Jonathan Travis Conway [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Well a simple search on Google for PHP Encoder brougt back these: http://www.ioncube.com/ $199 http://www.rssoftlab.com/downloads.php - Appears to be Free I am sure there are more. Check http://freshmeat.net for a good Open Source product. Also try http://www.sourceforge.net. As always check to see if the encoders support your current version of PHP. Also, always do a Google search first. Trav - Original Message - From: Jonathan [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, December 16, 2004 8:21 AM Subject: [PHP] How to distribute php codes safely? Hi, Is there a replace to Zend encoder that I can use for free? Zend encoder is too expensive for a small fry developer like me. Thanks for your help. Jonathan Tang -- 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] I got the mail form blues! HTML/POST/mail() question - Also request for style suggestions
Hi! I have an html string stored in $message. I submit the form to a subroutine and the value in $message is lost. All the other variables come into feedback.php just fine. I would love any help. This is a new language for me so any suggestions for streamlining my code would also be much appreciated. Thanks -- Monique. Here's my code: ?php $message=getmsg($message,$recemail,$sendername,$mailmessage,$rsList,$rname); mysql_free_result($rsList); echo $message; // this displays perfectly ? form name=maillist method=post action=?php echo feedback.php; ? div align=right input name=email type=hidden value=?php echo $email; ? input type=hidden name=recipient value=?php echo $recipient; ? input type=hidden name=redirect value=?php echo $redirect; ? input type=hidden name=name value=?php echo $rname; ? input type=hidden name=env_report value=on input type=hidden name=message value=?php $message; ? input type=hidden name=subject size=40 value=?php echo $subject; ? class=form input type=hidden name=required value=Name,Email,Subject,Updates,Message /div div align=right input type=submit name=Submit value=Send! /div /form -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] File Locking during *other* file operations
Im talking about file locking during deleting, and moving files. Is it possible to perform file locking for these file operations? If so, can you provide psuedo code. Thanks -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: I got the mail form blues! HTML/POST/mail() question - Also request for style suggestions
On Fri, 17 Dec 2004 14:32, Monique Verrier wrote: Hi! I have an html string stored in $message. I submit the form to a subroutine and the value in $message is lost. All the other variables come into feedback.php just fine. I would love any help. This is a new language for me so any suggestions for streamlining my code would also be much appreciated. Thanks -- Monique. Here's my code: ?php $message=getmsg($message,$recemail,$sendername,$mailmessage,$rsList $rname); mysql_free_result($rsList); echo $message; // this displays perfectly ? form name=maillist method=post action=?php echo feedback.php; ? div align=right input name=email type=hidden value=?php echo $email; ? input type=hidden name=recipient value=?php echo $recipient; ? input type=hidden name=redirect value=?php echo $redirect; ? input type=hidden name=name value=?php echo $rname; ? input type=hidden name=env_report value=on input type=hidden name=message value=?php $message; ? I think if you were to actually echo $message here, it should display in the hidden field as you expect, and hence be passed as part of the form data to the target script. input type=hidden name=subject size=40 value=?php echo $subject; ? class=form input type=hidden name=required value=Name,Email,Subject,Updates,Message /div div align=right input type=submit name=Submit value=Send! /div /form -- David Robley A cat is the universe's way of showing us perfection. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Miami PHP groups?
Any computer groups or resources for learning PHP in the Miami area? I am new here ... trying to learn PHP... would like to meet other people doing the same. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Buffering
Richard Lynch [EMAIL PROTECTED] wrote in message: I need to store chunks of output into files. Which output and why? any output of the program that goes to php://stdout.. if from echo, print, var_dump, code breaking, etc... why? cuz I want to get chunks of output into variables to make a cache system.. What is the Big Picture here? I want to build a cache system and store there not the whole page, but chunks of the page.. the chunks are started then ended in some point.. all the output between the start and stop points is a chunk and I want to get it into variable... that's exactly using ob_start() then ob_get_contents() to get the chunk data then ob_end_flush()... But, when using ob_* funcs.. when calling ob_start() all output afterwards is buffered till flushing.. what i need is to to allow output being transfered imediately but still get the chunks in variables.. thanks, Lorderon. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] upload file warning
I got a php waring when I upload my file: Warning: MAX_FILE_SIZE of 20 bytes exceeded - file [imgpath=mz-n10.pdf] not saved in Unknown on line 0 In the form I write like these: input type='hidden' name='MAX_FILE_SIZE' value=20 input type='file' name='imgpath' And my configuration is : file_uploads = on upload_max_filesize = 4M upload_tmp_dir = /tmp so, what 's wrong? And can I catch the exceeded file error before it is passed back to the client? Best wishes. yangshiqi
[PHP] Re: upload file warning
Yangshiqi wrote: I got a php waring when I upload my file: Warning: MAX_FILE_SIZE of 20 bytes exceeded - file [imgpath=mz-n10.pdf] not saved in Unknown on line 0 that seems like a very descriptive warning to me... In the form I write like these: input type='hidden' name='MAX_FILE_SIZE' value=20 yes... this is where you did put it... input type='file' name='imgpath' And my configuration is : file_uploads = on upload_max_filesize = 4M upload_tmp_dir = /tmp so, what 's wrong? what do you *think* is wrong :| I mean... just *read* the warning :S And can I catch the exceeded file error before it is passed back to the client? a) it's checked for size and discarded immediately b) the file is never passed 'back' to the client. It just disappears into the abyss that is /dev/null Best wishes. yangshiqi -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] I got the mail form blues! HTML/POST/mail() question - Also request for style suggestions
On Dec 16, 2004, at 10:02 PM, Monique Verrier wrote: Hi! I have an html string stored in $message. I submit the form to a subroutine and the value in $message is lost. All the other variables come into feedback.php just fine. I would love any help. This is a new language for me so any suggestions for streamlining my code would also be much appreciated. Thanks -- Monique. Here's my code: ?php $message=getmsg($message,$recemail,$sendername,$mailmessage,$rsList,$rn ame); mysql_free_result($rsList); echo $message; // this displays perfectly ? form name=maillist method=post action=?php echo feedback.php; ? div align=right input name=email type=hidden value=?php echo $email; ? input type=hidden name=recipient value=?php echo $recipient; ? input type=hidden name=redirect value=?php echo $redirect; ? input type=hidden name=name value=?php echo $rname; ? input type=hidden name=env_report value=on input type=hidden name=message value=?php $message; ? input type=hidden name=subject size=40 value=?php echo $subject; ? class=form input type=hidden name=required value=Name,Email,Subject,Updates,Message /div div align=right input type=submit name=Submit value=Send! /div /form input type=hidden name=message value=?php $message; ? should be input type=hidden name=message value=?php echo $message; ? -ryan -- http://theryanking.com/blog -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: counting chars..
Louie Miranda wrote: ?php $string = function yes good; $display = count_chars($string); echo $display; ? i know this is wrong, but how can i count chars used here? strlen() -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Buffering
Hi, Richard Lynch [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Lorderon wrote: What I want to do is catch the output buffer, but do not delay the buffer It occurs to me that maybe you should tell us WHY you want this, because there could be existing alternatives outside the scope of PHP that we could recommend... I need to store chunks of output into files. I can get the chunk output by using ob_get_contents(), but after calling ob_start() the output is only buffered and not sent till flushing. The delay from echoing to flushing is exactly what I want to avoid. I want to echo the output imediatly and not just on flushing, but still be able to buffer the chunk and get the output into variable. I hope it's clearer now.. thanks, Lorderon. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Buffering
On Thursday 16 December 2004 19:25, Lorderon wrote: I need to store chunks of output into files. I can get the chunk output by using ob_get_contents(), but after calling ob_start() the output is only buffered and not sent till flushing. The delay from echoing to flushing is exactly what I want to avoid. I want to echo the output imediatly and not just on flushing, but still be able to buffer the chunk and get the output into variable. If you can't get want you want by manipulating the ob_*() functions then try to structure your program so that all output is the result of explicit echo/print. Then it's just a simple matter to store them into a string before you output it. -- Jason Wong - Gremlins Associates - www.gremlins.biz Open Source Software Systems Integrators * Web Design Hosting * Internet Intranet Applications Development * -- Search the list archives before you post http://marc.theaimsgroup.com/?l=php-general -- /* Happiness, n.: An agreeable sensation arising from contemplating the misery of another. -- Ambrose Bierce, The Devil's Dictionary */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] smtp server
Hi there.. I´m trying to use the mail function but I have a problem. I´m working in a LAN with more or less 30 pcs, that places inside a huge network, and I just can´t use the enterprise smtp server. How can i set a valid smtp server? I thought about installing some good-free smtp server on my own pc, and then use it for the mail function. What do you think of this idea? Would you recommend any free smtp server currently available? Thanks! Pablo Marotta American Express made the following annotations on 12/16/04 07:43:19 -- ** This message and any attachments are solely for the intended recipient and may contain confidential or privileged information. If you are not the intended recipient, any disclosure, copying, use, or distribution of the information included in this message and any attachments is prohibited. If you have received this communication in error, please notify us by reply e-mail and immediately and permanently delete this message and any attachments. Thank you. ** == -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] How to distribute php codes safely?
Well a simple search on Google for PHP Encoder brougt back these: http://www.ioncube.com/ $199 http://www.rssoftlab.com/downloads.php - Appears to be Free I am sure there are more. Check http://freshmeat.net for a good Open Source product. Also try http://www.sourceforge.net. As always check to see if the encoders support your current version of PHP. Also, always do a Google search first. Trav - Original Message - From: Jonathan [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, December 16, 2004 8:21 AM Subject: [PHP] How to distribute php codes safely? Hi, Is there a replace to Zend encoder that I can use for free? Zend encoder is too expensive for a small fry developer like me. Thanks for your help. Jonathan Tang -- 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 in posting form-data
Thanks. I changed fputs($fp, $value\n); to fputs($fp, $name=$value\n); But I still got the same message. -Minghua -Original Message- From: Erwin Kerk [mailto:[EMAIL PROTECTED] Sent: Thu 12/16/2004 6:30 AM To: Yao, Minghua Cc: [EMAIL PROTECTED] Subject: Re: [PHP] Question in posting form-data Yao, Minghua wrote: Hi, all, I am testing how to post form-data to a host using the following code (test.php): ?php function PostToHost($host, $path, $name, $value) { // Test of posting form-data $fp = fsockopen($host,80); fputs($fp, POST $path HTTP/1.1\n); fputs($fp, Host: $host\n); fputs($fp, Content-Type: multipart/form-data\n); fputs($fp, content-disposition: form-data; name=$name\n); fputs($fp, Connection: close\n\n); fputs($fp, $value\n); $res = ; while(!feof($fp)) { $res .= fgets($fp, 128); } fclose($fp); return $res; } Check your function carefully. Where are you using the $name of the value? Nowhere! Therefore the receiving script cannot identify the value as x. Try: fputs($fp, $name=$value\n); Erwin
Re: [PHP] smtp server
On Thursday 16 December 2004 22:43, Pablo D Marotta wrote: Please note that this has nothing to do with PHP. I´m trying to use the mail function but I have a problem. I´m working in a LAN with more or less 30 pcs, that places inside a huge network, and I just can´t use the enterprise smtp server. Why? Company policy? Technicality? You don't know how? Or? NB you don't *have* to setup an SMTP server to be able to send mail using PHP, look on www.phpclasses.org for some code. How can i set a valid smtp server? I thought about installing some good-free smtp server on my own pc, and then use it for the mail function. What do you think of this idea? Would you recommend any free smtp server currently available? Google should have some good answers for you if you ask nicely. -- Jason Wong - Gremlins Associates - www.gremlins.biz Open Source Software Systems Integrators * Web Design Hosting * Internet Intranet Applications Development * -- Search the list archives before you post http://marc.theaimsgroup.com/?l=php-general -- /* Don't you wish you had more energy... or less ambition? */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] smtp server
Pablo D Marotta wrote: Hi there.. I´m trying to use the mail function but I have a problem. I´m working in a LAN with more or less 30 pcs, that places inside a huge network, and I just can´t use the enterprise smtp server. How can i set a valid smtp server? If you have Microsoft licensing for them, one would assume their SMTP server is valid... Well, as valid as any MS product. :-) I thought about installing some good-free smtp server on my own pc, and then use it for the mail function. Ah. good-free... Google for Windows OpenSource SMTP What do you think of this idea? Would you recommend any free smtp server currently available? Depending on how much email you have to move, it may be easier to install something like Pegasus mail client, which works from command line, and use http://php.net/exec to invoke it. Or so other Windows users have told me. This will probably not be good to handle HEAVY loads of email, but if you just need to send out the occasional update/newsletter to a small number of recipients, it should be fine. You may want to try the PHP Windows mailing list, assuming that's still around and active. -- Like Music? http://l-i-e.com/artists.htm -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Parse Error... how to fix?
Ok... thank you. On Thu, 16 Dec 2004 19:02:37 +0100, Marek Kilimajer [EMAIL PROTECTED] wrote: GH wrote: Hi All... Got a problem... here is the error: Parse error: parse error, expecting `T_STRING' or `T_VARIABLE' or `T_NUM_STRING' in /var/www/html/ahrc_computerclub/ahrc_computerclub.php on line 42... I am not sure on how to fix it... line 42 is: TITLE $language['program_name'] /TITLE\n . either one: 1. TITLE $language[program_name] /TITLE\n . 2. TITLE {$language['program_name']} /TITLE\n . 3. TITLE . $language['program_name'] . /TITLE\n . -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Parse Error... how to fix?
However, I can not get any results into the title tags all three options are not displaying On Thu, 16 Dec 2004 13:03:57 -0500, GH [EMAIL PROTECTED] wrote: Ok... thank you. On Thu, 16 Dec 2004 19:02:37 +0100, Marek Kilimajer [EMAIL PROTECTED] wrote: GH wrote: Hi All... Got a problem... here is the error: Parse error: parse error, expecting `T_STRING' or `T_VARIABLE' or `T_NUM_STRING' in /var/www/html/ahrc_computerclub/ahrc_computerclub.php on line 42... I am not sure on how to fix it... line 42 is: TITLE $language['program_name'] /TITLE\n . either one: 1. TITLE $language[program_name] /TITLE\n . 2. TITLE {$language['program_name']} /TITLE\n . 3. TITLE . $language['program_name'] . /TITLE\n . -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Parse Error... how to fix?
Hi All... Got a problem... here is the error: Parse error: parse error, expecting `T_STRING' or `T_VARIABLE' or `T_NUM_STRING' in /var/www/html/ahrc_computerclub/ahrc_computerclub.php on line 42... I am not sure on how to fix it... line 42 is: TITLE $language['program_name'] /TITLE\n . The language.php file only has: $language['program_name'] = AHRC Computer Club Program Leader Information Managment; Thank you for any and all assistance provided This is the entire ahrc_computerclub.php file: ?PHP #AHRC Program Leader Information Management# #Copyright (C) 2004 by Gary H # #EMAIL INFORMATION HERE # # This project is intended for Gary's use only and not to be distributed # # include language file include_once(language.php); # DOCUMENT OUTPUT ##START # printHeader(); echo $language['program_name']; printFooter(); # DOCUMENT OUTPUT ##END # # FUNCTION DEFINITIONS SECTION# function printVersion(){ $version = 0.1; return $version; } function printHeader(){ echo !DOCTYPE HTML PUBLIC \-//W3C//DTD HTML 4.0 Transitional//EN\\n . \http://www.w3.org/TR/REC-html40/loose.dtd\;HTML\n . HEAD\n . meta name=\description\ content=\\ \n . meta name=\author\ content=\Gary H\\n . meta name=\keywords\ content=\\ \n . meta http-equiv=\Content-Type\ content=\text/html; charset=iso-8859-1\\n . TITLE $language['program_name'] /TITLE\n . /HEAD\n. BODY\n; } function printFooter(){ echo \n/BODY/HTML; } ? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Getting mail() to return false/0
Jason Wong wrote: On Thursday 16 December 2004 01:49, Richard Lynch wrote: You now have the joy of diving into sendmail documentation. Have fun. :-^ There are better, easier to use and more secure alternatives to sendmail. True. Many of which require that you understand the basics of sendmail before you use them. At least, that's been my experience. They are drop-in replacements for sendmail, but if you don't understand sendmail, you're lost. Also, easier has never equated to easy in my experience. A lot of people under-estimate the complexity of email, no matter how much they THINK they know about how it works. -- Like Music? http://l-i-e.com/artists.htm -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] in_array w/statement
Hi, I cannot solve this problem,. sorry if this looks confusing,. i have a form and don't want to set the variable if the in_array is true.. the code works, up until i add the last !$buddy in the statement, for some reason it seems to always be true, ... something i'm doing wrong? btw, i cannot add the in_array to the statement because if the $buddylist is empty it will generate errors because of the empty implode. $buddylist = preg_split('/( )+/', trim($userinfo['buddylist']), -1, PREG_SPLIT_NO_EMPTY); if($buddylist) { $buddy = in_array($uname['uid'], array(implode(',', $buddylist))); } if(($uname['uid'] == $ret) || ($uname['uname'] == $recipients2) ($uname['uid'] != 11) !$buddy) { $contactoptions = 'option value='.$uname['uname'].' selected'.$uname['uname'].'/option'; } else if(($uname['uid'] != $bbuserinfo['userid']) ($uname['uid'] != 11) !$buddy) { $contactoptions .= 'option value='.$uname['uname'].''.$uname['uname'].'/option'; } -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] in_array w/statement
On Friday 17 December 2004 02:33, Sebastian wrote: I cannot solve this problem,. sorry if this looks confusing,. It is ... i have a form and don't want to set the variable if the in_array is true.. the code works, up until i add the last !$buddy in the statement, for some reason it seems to always be true, ... something i'm doing wrong? btw, i cannot add the in_array to the statement because if the $buddylist is empty it will generate errors because of the empty implode. $buddylist = preg_split('/( )+/', trim($userinfo['buddylist']), -1, PREG_SPLIT_NO_EMPTY); OK, it looks like $userinfo['buddylist'] is a string containing buddies separated by some whitespace: 'buddy1 buddy2' After the above statement $buddylist becomes an array. if($buddylist) { $buddy = in_array($uname['uid'], array(implode(',', $buddylist))); } Here implode() returns a string containing 'buddy1,buddy2', then you stick that into an array() which is effectively: array('buddy1,buddy2'); // note that there is only *1* element Now unless your $uname['uid'] really is literally 'buddy1,buddy2' then $buddy will be false. Hope that's enough to get you going. -- Jason Wong - Gremlins Associates - www.gremlins.biz Open Source Software Systems Integrators * Web Design Hosting * Internet Intranet Applications Development * -- Search the list archives before you post http://marc.theaimsgroup.com/?l=php-general -- /* The moon is made of green cheese. -- John Heywood */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Delete files from the server
Greetings everyone, I have uploaded some pictures and thumbnails using a PHP form into a particular directory. I would like to be able to select the name of the picture and then chose to delete that picture and its thumbnail from the server using another form. The name of the picture is in the MySQL database. Is there any way to do this? Thanks! -- Steve Marquez -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] web IDE
Hi list, Sorry to repeat, but I thought I'd try give a clear idea of what I wanted to do with my last question entitled 'php ide scripts' to see if anyone else has done this and can direct me to or send me some 'beginners' files I can use. What I want to do is create a program I can run on my local web server that will allow me to write scripts faster. Unlike most computer programmers I do not have a very good memory and so if I want to write a table (or a form or something) in html I have to always look at my textbook and copy out the tags. The same for php. If I want to write a function, or a do-while structure I have to go back to the book and copy out the correct syntax. This is very frustrating for me and slows my learning process down. What I have in mind is this: Create a web page that allows me to create files with basic formating tags in them (i.e for html htmlbody./body/html: for shell #!/usr/bin/php: for php ?php.?). I will use a text field and button on my web-page to create a new version of whatever template I want, then open the file in a text area for editing. (Can I do this by simply turning the file into one long string and putting it in the text box? I think there's a javascript function for setting the contents of a textbox (and I've used VB's one) but can I do this with php?) On the same page (or through links to other pages) I will have buttons that will allow me to insert the 'skeleton' text of a variable declaration, or a function prototype, or a control structure into my already open template file in the text area, then using text boxes set the actual(static) values I want to use. When I'm finished, I should have the file in a text area on my web page with my completed script which I can then save and close. If I can get this basic system working, all that remains for me to do is write the string functions for appending/editing my template files as I learn more and more about the language (exploring function libraries and writing my own) and develop more complex applications. One problem I'm having at the moment is how to create a file from an html form. I have a php script that uses fopen() to create a new file. This works fine when I call it from bash but I don't know how to do it using a button on an html form. Any ideas? Thanks, Malcolm. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Pspell on win32 platform
I can't instantiate new instances of the pspell library. I've got the latest w32 binaries installed and the latest english dictionary installed to c:\aspell. I've got aspell and aspell\bin added to the system environment path. I've got the aspell.dll in the system32 folder. Permissions look like they are working. A phpinfo() command shows that I have php4.3.10 with pspell enabled. However, when I run the command pspell_check($pspell_link, testt) in my web scripts, the page appears to header redirect on itself indefinitely. Please help. -Ethan Nelson, Modulus, LLC
Re: [PHP] Delete files from the server
I have uploaded some pictures and thumbnails using a PHP form into a particular directory. I would like to be able to select the name of the picture and then chose to delete that picture and its thumbnail from the server using another form. try the manual my man http://us2.php.net/unlink -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php