[PHP] University researcher's question
[i] How or why do researchers adapt technology to their research projects? Should they adapt their projects to technology? Indeed, how often does the research assistant end up reinventing the wheel? [/i] I know most of you are E-Commerce oriented, but I would appreciate your feedback. I use PHP MySQL in a university research setting. I'm writing a conference paper on this problematic and I would appreciate your input. Am I the only university type online tonight :) ? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Permission Denied
Stephen, It seems like I wen tdown that road once? I'm wondering/remembering two things to check? First what are the permissions of the directory your are working in? Go up one level and see what the CHMOD was on that? Second, it might be immaterial and I'm not sure how to do it on a command line, but who is the owner of the files you are trying to delete? Seriously! Maybe your script does not have the permission to delete them? With CuteFTP, I can read who the owner of a file is. I know this was an issue for me once, but I don't remember why. Craton wrote: Hello, I'm having a few problems with deleting items. When I do the unlink() function, it gives me a permission denied error. For example..here's the code: unlink($this-currentfolder().'/packs/'.$title.'/'.$intname); Here's the error returned: Warning: unlink() failed (Permission denied) in /usr/local/plesk/apache/vhosts/piw.melchior.us/httpdocs/phpiw/classes/class. delete.php on line 45 The problem with all this is, I dynamically create the directories and files and dynamically CHMOD them all to 777 with no problems. I don't see why I'm getting all this! Please help ASAP! Thanks in advance! -- John Taylor-Johnston - If it's not open-source, it's Murphy's Law. Université de Sherbrooke: http://compcanlit.ca/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Question about replacing \r\n with br
I think this is what you want? http://www.php.net/manual/en/function.nl2br.php John Al wrote: I can't find a way to replace \r\n codes with br in a text file. I'm reading a text file that was prepared with windows notepad The hex code shows OD OA for CR/LF as I expect. I'd like to replace the OD/LF with brs. I spent hours trying every User Notes in the PHP Manual for this simple operation. e.g., $txt= preg_replace(\r\n, br, $words); and this version $txt = preg_replace(/(\015\012)|(\015)|(\012)/,br /, $txt); I can substitute other characters and dec equivalents and the substations just won't work for \r\n [or just \r or just \n] or \015 or \15. And, I've tried using 10 and 010 and 13 and 013. And nl2br doesn't work either. Can anyone help? Thanks -- John Taylor-Johnston - If it's not open-source, it's Murphy's Law. ' ' ' Collège de Sherbrooke: ô¿ô http://www.collegesherbrooke.qc.ca/languesmodernes/ - Université de Sherbrooke: http://compcanlit.ca/ 819-569-2064 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: sending results by email
http://www.php.net/manual/en/function.mail.php TEXTAREA NAME=MyText ROWS=10 COLS=26 width =15 input type=checkbox name=checkbox2 Note my changes in your HTML! mail([EMAIL PROTECTED], Subject: sending results by email, MyText: \n$MyText \ncheckbox2: $checkbox2); HTH? John form name=form1 method=post action= TEXTAREA NAME= ROWS=10 COLS=26 width =15 /TEXTAREA input type=submit name=Submit value=Enviar table width=100% border=0 height=27 tr tdinput type=checkbox name=checkbox2 value=checkbox no /td /tr /table -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Help with Multiple Checkboxes
input name=add type=checkbox id=add[] value=179 Does id even exist? HTH -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Help with Multiple Checkboxes
Yup, id is a valid attribute for virtually every HTML tag. I can't remember for sure which W3C specification that was in, but you can refer to most elements through JavaScript by using their ID's in both IE and Netscape 6+. ---Matt -Original Message- From: John Taylor-Johnston [mailto:[EMAIL PROTECTED] Sent: Sunday, February 23, 2003 2:42 AM To: [EMAIL PROTECTED] Subject: Re: [PHP] Help with Multiple Checkboxes input name=add type=checkbox id=add[] value=179 Does id even exist? HTH -- 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: Permission Denied
u might have something on the ownership issue. i ran into the same thing... play with php's chown command. look it up php.net may help, i was having a similar issue a few months back. Joel John Taylor-Johnston [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Stephen, It seems like I wen tdown that road once? I'm wondering/remembering two things to check? First what are the permissions of the directory your are working in? Go up one level and see what the CHMOD was on that? Second, it might be immaterial and I'm not sure how to do it on a command line, but who is the owner of the files you are trying to delete? Seriously! Maybe your script does not have the permission to delete them? With CuteFTP, I can read who the owner of a file is. I know this was an issue for me once, but I don't remember why. Craton wrote: Hello, I'm having a few problems with deleting items. When I do the unlink() function, it gives me a permission denied error. For example..here's the code: unlink($this-currentfolder().'/packs/'.$title.'/'.$intname); Here's the error returned: Warning: unlink() failed (Permission denied) in /usr/local/plesk/apache/vhosts/piw.melchior.us/httpdocs/phpiw/classes/class. delete.php on line 45 The problem with all this is, I dynamically create the directories and files and dynamically CHMOD them all to 777 with no problems. I don't see why I'm getting all this! Please help ASAP! Thanks in advance! -- John Taylor-Johnston -- --- If it's not open-source, it's Murphy's Law. Université de Sherbrooke: http://compcanlit.ca/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: cookie problem..
make sure u run a session_start(); before anything on the page u cant access any session vars without it. Joel Terry Lau [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Hello, I want to set a cookie when I enter a text into the text field, and it shows the text I submitted immediately, thus I write a sample php code like this: ?php if (isset($HTTP_POST_VARS['Name'])) { setcookie(name, $HTTP_POST_VARS['Name'], time()+86400*10); } echo $name; ? (I set the text field is Name and the data will be sent to another page) In another page, I insert ?php echo $HTTP_COOKIE_VARS['name']; ? in the beginning of the code. Is the code right? Then I run the test, I enter a name into the text field and submit it. But it shows Notice: Undefined index: name in .., it can't show the name I submitted. Why?Anything wrong?? Thanks!! Terry _ ¤µ¤é¬P®y http://www.msn.com.hk/fortune/west/ ¹Bµ{ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Why use persistent connections? || Data driven site
I stopped using pconnect. Don't see the sense in it. Why take the chance? http://www.php.net/manual/en/function.mysql-pconnect.php blockquoteWarning Using persistent connections can require a bit of tuning of your Apache and MySQL configurations to ensure that you do not exceed the number of connections allowed by MySQL./blockquote Search also for consistency and read that note. Begin using: http://www.php.net/manual/en/function.mysql-connect.php I had real trouble with this on a Windows server once. I stopped using pconnect. Too many connections. Crashed my server more than once. # $link = mysql_pconnect($MyHost,$MyAccount,$MyPass); $link = mysql_connect($MyHost,$MyAccount,$MyPass); ... mysql_close($link); Should we be using persistent connections, or are we better off opening and closing connections on each query? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Help with Multiple Checkboxes
Style sheet stuff? style type=text/css Matt Honeycutt wrote: Yup, id is a valid attribute for virtually every HTML tag. I can't remember for sure which W3C specification that was in, but you can refer to most elements through JavaScript by using their ID's in both IE and Netscape 6+. ---Matt -Original Message- From: John Taylor-Johnston [mailto:[EMAIL PROTECTED] Sent: Sunday, February 23, 2003 2:42 AM To: [EMAIL PROTECTED] Subject: Re: [PHP] Help with Multiple Checkboxes input name=add type=checkbox id=add[] value=179 Does id even exist? HTH -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- John Taylor-Johnston - If it's not open-source, it's Murphy's Law. ' ' ' Collège de Sherbrooke: ô¿ô http://www.collegesherbrooke.qc.ca/languesmodernes/ - Université de Sherbrooke: http://compcanlit.ca/ 819-569-2064 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Editors
Anyone have the link on where I can download maguma php editor? Whatever the latest version is. I need if for my class. I tried to do a search on google and they are were dead links. Karl
RE: [PHP] Editors
Hi, The site is http://www.maguma.com Pierre -Message d'origine- De : Karl James [mailto:[EMAIL PROTECTED] Envoye : dimanche 23 fevrier 2003 10:19 A : [EMAIL PROTECTED] Objet : [PHP] Editors Anyone have the link on where I can download maguma php editor? Whatever the latest version is. I need if for my class. I tried to do a search on google and they are were dead links. Karl -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] using function()[subscript] directly
Hi! I started out with $stat = stat($gallery_dir/$pix_base) ; $mode = decoct($stat[mode]) ; print mode = '$mode'br\n ; and moved to $stat = stat($gallery_dir/$pix_base) ; print decoct(stat[mode]) is ' . decoct($stat[mode]) . 'br\n;### but I would like to get rid of $stat as well. How can I feed the proper subscript output of the stat call to decoct? I've found that print decoct(stat(file)[mode] is ' . decoct($stat($gallery_dir/$pix_base)[mode]) . 'br\n ;### gives me a parse error, while print decoct(stat(file)[mode] is ' . decoct(${stat($gallery_dir/$pix_base)}[mode]) . 'br\n ; ### just returns 0. Do I *have* to use a temp array here? TIA 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://justpickone.org/davidtg/ Shpx gur Pbzzhavpngvbaf Qrprapl Npg! pgp0.pgp Description: PGP signature
Re: [PHP] University researcher's question
At 09:21 23-2-2003, you wrote: [i] How or why do researchers adapt technology to their research projects? Should they adapt their projects to technology? Indeed, how often does the research assistant end up reinventing the wheel? [/i] 'Research' is an extremely broad field, with many places where technology can jump in: observation, data collection, data entry, making mathematical models, making statistics, making graphs or GIS pictures Walk through the average university corridor and most ppl will use something existing, like office, SPSS, MatLab... But you will also find ppl writing their own models, not in PHP but rather in other languages. I think your would need to make some very specific questions and ask at your local university whether they can help you. I know most of you are E-Commerce oriented, but I would appreciate your feedback. I use PHP MySQL in a university research setting. I'm writing a conference paper on this problematic and I would appreciate your input. Am I the only university type online tonight :) ? On courses you can have a look at the Moodle site: developer of the PHP course support sytem Moodle.org has written papers on this distant learning (and is writing his dissertation now). But 99% of universities and highschools buy Blackboard 'because everybody else does'. I am only using PHP/MySQL to let researchers put their work online, and will use it to let PhD's administrate their own progress, which will be a big relief for the administration people. So it is university related but not really research related. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] PHP not supporting method overloading.
Hi! I have a website whose pages are written in PHP.. using some classes I have made that extensively use method overloading.. Before, my webhosting company was using PHP 4.0.6 but just this january, they have upgraded to PHP 4.3.0... that is when I started to receive errors. My website is currently down because all of my scripts are reporting error: Cannot Redeclare .. blablah blah.. It seems to me that the support for method overloading was removed. Even my FastTemplate class is issuing the same error. What will I do to minimize the time in re-doing all of my scripts. And also, why did the PHP guys removed the support for method overloading..? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: preg_replace question
[EMAIL PROTECTED] (Electroteque) wrote in news:[EMAIL PROTECTED]: yet another regex question how could i hange the value within the quotes with preg_replace php_value upload_max_filesize 5M $str = preg_replace(#php_value upload_max_filesize\s?['\](.+?)[\']#i, php_value upload_max_filesize\\\1\, $str); Should work. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Dynamic combobox in Flash with PHP
I have the following PHP code to generate output to the flash //=== $query = SELECT currencyCode,currencyName,country,buyPrice,sellPrice FROM $CURRENCIES_TABLE order by currencyCode;; $db_linker = db_connection(); db_selection($db_linker); $result = mysql_query($query); $num=mysql_num_rows($result); echo array_num=.$num; for($i=0; $imysql_num_rows($result); $i++){ echo list_label.$i.=.mysql_result($result,$i,currencyCode).,.mysql_resul t($result,$i,currencyName); } db_close($db_linker); //== == also the following code in actionscript use to receivesend data. but when I run the *.swf it cann't get the output from PHP, so anyone can help // loadVariables(link.php, this, POST); // get the data from php file /* //== iList = new Array(); myItem = new Object(); iList[0] = myItem; for (i=0; iarray_num; i++) { myItem = new Object(); test = this[list_label+i] myItem.label = test myItem.data = i; iList[i+1] = myItem; } list_currency.setDataProvider(iList); // thx. -- Sincerely your; pei_world ( .::IT::. ) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: OOP and object references, not copies - how to do?
[EMAIL PROTECTED] (Erik FranzéN) wrote in news:[EMAIL PROTECTED]: Say the you are going to create a simple forum and you want to have a number of classes: Class Sql - handles the DB interface Class User - handles users Class Messages - handles messages When you are writing the code, you first creates a new sql object in order to read or write data from or to the database. Secondly you create a user object in order to handle users, for an example, to authenticate the user which is going to write a new message in your forum. The user object have a method which reads user information from the database. Since you alread have created a sql object, this method should use the sql object in order to fecth data from the database. I nice way to do this, would be to send the sql object as an reference to the user object constructor and store the object reference to the sql object in the user object. This is not working very well in PHP yet because PHP cannot treat objects as references. When you send the sql object to the user object constructor method, it will be a copy, not a reference! How do I get around this? There must be a way to handle this and create nice OOO PHP-code? I don't like using global variables as object handles. You need to use the chracter when passing assigning. $obj = new Object; function func($obj) { } To return an object: function func() { return $obj; } -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Constant Arrays Possible?
At 20:28 22.02.2003, Daniel R. Hansen said: [snip] Is it possible to define a constant that is an array of other predefined constants? If so, what would the syntax be? I'm trying something like the following (all items prefixed with an uppercase G are constants) without success: [snip] No, it is not possible. From the online manual (http://www.php.net/manual/en/language.constants.php): Syntax You can define a constant by using the define()-function. Once a constant is defined, it can never be changed or undefined. -- 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] Re: Tutorials on OOP
[EMAIL PROTECTED] (Davy Obdam) wrote in news:[EMAIL PROTECTED]: Hi people,. I have to build several classes for a project i am doing, but i am quite new to OOP programming. I need to make a database abstraction layer class and a user login class.. Does anyone know some good tutorials about these things and OOP in general. Thanks in advance.. http://www.phppatterns.com/ is a good place to learn about OO PHP design. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Downloading files
Hi! In PHP, is there a way to allow the user to download a file (e.g.: sample.txt) to their computer? And, then, automatically return to the PHP-generated Web page. How can the file be stored in C:\sample.txt, for example? Thanks! Tony -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
php-general Digest 23 Feb 2003 14:02:18 -0000 Issue 1900
php-general Digest 23 Feb 2003 14:02:18 - Issue 1900 Topics (messages 136692 through 136722): Writing to COM-Port with PHP 4.3.0 on OS/2 with Apache 2.0.44 136692 by: Thorolf Godawa Re: Question about str_replace() 136693 by: Hans Prins Re: upgrade to 4.3.0 nearly doubled execution time 136694 by: Rasmus Lerdorf Re: Sitewide Header Footer Includes || Trouble with Relative Paths.. 136695 by: Tom Rogers Permission Denied 136696 by: Stephen Craton 136697 by: Stephen Craton 136703 by: John Taylor-Johnston 136708 by: Joel Colombo Re: flashing text possible on PDA? 136698 by: John W. Holmes Re: preg_match question: locating unmatched HTML tags 136699 by: Tom Rogers 136701 by: Tom Rogers Re: Printer Friendly page 136700 by: Justin French University researcher's question 136702 by: John Taylor-Johnston 136715 by: Chris Hayes Re: Question about replacing \r\n with br 136704 by: John Taylor-Johnston Re: sending results by email 136705 by: John Taylor-Johnston Re: Help with Multiple Checkboxes 136706 by: John Taylor-Johnston 136707 by: Matt Honeycutt 136711 by: John Taylor-Johnston Re: cookie problem.. 136709 by: Joel Colombo Re: Why use persistent connections? || Data driven site 136710 by: John Taylor-Johnston Editors 136712 by: Karl James 136713 by: Pierre Vaudrey using function()[subscript] directly 136714 by: David T-G PHP not supporting method overloading. 136716 by: Jun Re: preg_replace question 136717 by: Phil Roberts Dynamic combobox in Flash with PHP 136718 by: pei_world Re: OOP and object references, not copies - how to do? 136719 by: Phil Roberts Re: Tutorials on OOP 136720 by: Phil Roberts Re: Constant Arrays Possible? 136721 by: Ernest E Vogelsinger Downloading files 136722 by: Anthony Rodriguez 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] -- ---BeginMessage--- Hi, how can I write to a COM-Port on OS/2 using PHP 4.3.0 with Apache 2.0.44? With $fp = fopen (COM1, w+); $string = chr($OutCmd) . chr($Platine) . chr($OutData) . chr($OutPruef); fputs ($fp, $string ); fclose ($fp); it seems not to work ($fp returns Resource id #2), and $fp = fopen (COM1:, w+); ... .. . creates an error: Warning: fopen(COM1:) [function.fopen]: failed to create stream: No such file or directory in x:\htdocs\test.php on line 3 :-( The same functionality with Rexx is working! Thanks a lot, Thorolf ---End Message--- ---BeginMessage--- Assuming that you do want to replace [p] with br, the code you posted worked for me. The following printed: leadingtextbrtrailingtext to the screen ?php $find = array(' ','WOD', '', chr(146), '[p]'); $replace = array(amp; ,Wamp;OD, 'amp;', ', 'br'); $text = leadingtext[p]trailingtext; $words = str_replace ($find, $replace, $text); print $words; ? Al [EMAIL PROTECTED] schreef in bericht news:[EMAIL PROTECTED] I have a simple str_replace function that obviously has a syntax problem. The [p] in the $find array ignores the brackets. Every p in my text is replaced by a br. Just for the heck of it, I've tried instead of ', and preg_replace(), etc. $find= array(' ','WOD', '', chr(146), '[p]'); $replace= array(amp; ,Wamp;OD, 'amp;', ', 'br'); $words= str_replace ($find, $replace, $text); Thanks. ---End Message--- ---BeginMessage--- Yes, I have noticed some performance issues as well, but we need to nail it down better before we can start really going after this. Could we call on the collective masses of php-general users to run some benchmark tests? Just build yourselves a libphp4.so for both 4.2.x and 4.3.x and switch the LoadModule line back and forth to benchmark the two versions. Then use something like http_load (http://www.acme.com/software/http_load/) to check various simple scripts. We need to figure out if this is an across-the-board performance problem or if it is one particular aspect which has slowed down. -Rasmus On Sat, 22 Feb 2003, Jason k Larson wrote: I'm betting this is related... I upgraded to 4.3.0 on my production linux servers and began to have serious socket connection issues. Rolling back to 4.2.3 cleared everything up. I also saw an increase in script execution times with 4.3.0, which became much better using 4.2.3. I noticed some very strange behavior which leads me to believe 4.3.0 is not stable, and shouldn't be used in a production environment. So, all I can suggest for now is to determine what it is you need, and if a newer version of PHP will suit, go for it. But stay away from 4.3.0 and 4.3.1 (which I've read up on
Re: [PHP] Downloading files
on 24/02/03 1:01 AM, Anthony Rodriguez ([EMAIL PROTECTED]) wrote: In PHP, is there a way to allow the user to download a file (e.g.: sample.txt) to their computer? And, then, automatically return to the PHP-generated Web page. why do you need to re-run the page? it can be done with a bit of messing around, but i can't imagine why :) you can force the download of a file by setting the correct headers using header() and passing the file through. see the user notes on http://php.net/header. if you're only talking about text files, then why not simply do a href='blah/sample.txt' target='_blank'click/a ??? This will pop it up in a new window, leave the original window untouched, and they can choose save as from the file menu. if for some reason you DO want the original window to be refreshed, this could easily be done with a javascript onclick event in the above a tag. How can the file be stored in C:\sample.txt, for example? you have no control over where the user downloads the file to -- it's entirely up to them and/or their browser settings. actually, forcing a download really isn't true... in most cases your really forcing a 'save file as...' dialogue window. Justin -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Image problems
I want to change resolution and set as a black white image. Any idea ? Thks [MsR] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
FW: [PHP] Constant Arrays Possible?
I know constants can't be changed or undefined; the use I have in mind won't be; the array size and elements would be completely static. I'm just looking to do this for the sake of ease of access to its elements and to eliminate the need to redeclare the array as global in every bleeping function that uses its data. -Original Message- From: Ernest E Vogelsinger [mailto:[EMAIL PROTECTED] Sent: Sunday, February 23, 2003 6:56 AM To: Daniel R. Hansen Cc: [EMAIL PROTECTED] Subject: Re: [PHP] Constant Arrays Possible? At 20:28 22.02.2003, Daniel R. Hansen said: [snip] Is it possible to define a constant that is an array of other predefined constants? If so, what would the syntax be? I'm trying something like the following (all items prefixed with an uppercase G are constants) without success: [snip] No, it is not possible. From the online manual (http://www.php.net/manual/en/language.constants.php): Syntax You can define a constant by using the define()-function. Once a constant is defined, it can never be changed or undefined. -- 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 General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] table width problems
Hi, I've got a table that gets it's contents from a database, the problem is that even though I specify the width of the table, it is still wider than it's supposed to be, cause some of the info from the table doesn't wrap.my question is if there is a way to force td wrapping when it exceeds the allowed width?? Please help thanks Adriaan -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] table width problems
You can use the code below to trim a string to a specified number of charecters. Change 64 to how long you want the string to be. This won't cut words in half. wordwrap( $text, 64, Br, 0); -Original Message- From: Adriaan Nel [mailto:[EMAIL PROTECTED] Sent: Sunday, February 23, 2003 10:27 AM To: [EMAIL PROTECTED] Subject: [PHP] table width problems Hi, I've got a table that gets it's contents from a database, the problem is that even though I specify the width of the table, it is still wider than it's supposed to be, cause some of the info from the table doesn't wrap.my question is if there is a way to force td wrapping when it exceeds the allowed width?? Please help thanks Adriaan -- 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] Another Logging Question
I'd like for my counter/logger to be fairly scalable, so I'm toying with two possible implementation routes: 1. Have the counter dump visitor info to a text file, then run a cron job on that nightly to process the data and perform a full analysis. 2. Have the counter dump the visitor info into a DB (probably MySQL), then process the data whenever the administrator wants to view his stats. Anyone have any suggestions or considerations on which method would work better? Is there something else I should do instead? Thanks for any input, ---Matt -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Another Logging Question
On Sun, 23 Feb 2003 10:30:27 -0600, you wrote: 1. Have the counter dump visitor info to a text file, then run a cron job on that nightly to process the data and perform a full analysis. Consider what will happen when two people hit the counter at exactly the same time. You'll have to code to deal with that. (But if you're going to process your counter data nightly, why not just lift it from the access.log?) 2. Have the counter dump the visitor info into a DB (probably MySQL), then process the data whenever the administrator wants to view his stats. Databases are designed to deal with concurrent access. All other things being equal, go with this one. Just a table with one number in it, incremented with an UPDATE statement. Simple. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] table width problems
If your html table is too wide that is useually due to a pixel size or a percentage which is too large. You could try playing around with those values and calculate how much columns you have and maybe how much of a percentage size they should have relative to the screen width tables can be a bit tricky though especially when nesting them.. if wordwrap( ) doesnt help you, you could post your html source, and we can take a look at it gl Dennis Cole [EMAIL PROTECTED] schreef in bericht news:[EMAIL PROTECTED] You can use the code below to trim a string to a specified number of charecters. Change 64 to how long you want the string to be. This won't cut words in half. wordwrap( $text, 64, Br, 0); -Original Message- From: Adriaan Nel [mailto:[EMAIL PROTECTED] Sent: Sunday, February 23, 2003 10:27 AM To: [EMAIL PROTECTED] Subject: [PHP] table width problems Hi, I've got a table that gets it's contents from a database, the problem is that even though I specify the width of the table, it is still wider than it's supposed to be, cause some of the info from the table doesn't wrap.my question is if there is a way to force td wrapping when it exceeds the allowed width?? Please help thanks Adriaan -- 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] table width problems
Yeah you could try table width=100% valign=top align=left (plus, of course, the rest of the parameters for this tag.) td width=100% align=left is good along with that too. That should keep it from exceeding the width of the page, unless you have one or more other tables next to it... In that case you need to specify the correct percentage of 100 % to make them all fit the way you need. -Tom Hi, I've got a table that gets it's contents from a database, the problem is that even though I specify the width of the table, it is still wider than it's supposed to be, cause some of the info from the table doesn't wrap.my question is if there is a way to force td wrapping when it exceeds the allowed width?? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Question about str_replace()
That's what's blowing my mind. It is so simple it should work. The php/apache [Zend] on my virtual host just seems to ignore the the brackets. Hans Prins wrote: Assuming that you do want to replace [p] with br, the code you posted worked for me. The following printed: leadingtextbrtrailingtext to the screen ?php $find = array(' ','WOD', '', chr(146), '[p]'); $replace = array(amp; ,Wamp;OD, 'amp;', ', 'br'); $text = leadingtext[p]trailingtext; $words = str_replace ($find, $replace, $text); print $words; ? Al [EMAIL PROTECTED] schreef in bericht news:[EMAIL PROTECTED] I have a simple str_replace function that obviously has a syntax problem. The [p] in the $find array ignores the brackets. Every p in my text is replaced by a br. Just for the heck of it, I've tried instead of ', and preg_replace(), etc. $find= array(' ','WOD', '', chr(146), '[p]'); $replace= array(amp; ,Wamp;OD, 'amp;', ', 'br'); $words= str_replace ($find, $replace, $text); Thanks. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Help Please
Hi All, i am new to qmail and linux so bear with me.first of all i would like to clearly state my situation here.we have to servers linux+windows.we have qmail installed on linux.wesite is hosted on windows.now i want to create user from my webbased signin form.(which is on win2k).how can i do this?. 2nd thing.is it necessary to create system accounts for users on linux.(just want to give them email account from qmail).what is the best colution for this. please help me.as i am new to qmail. thanx Haseeb --- Msg sent via Mail - http://atmail.nl/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] problem with ftp browsing
I have a php script that is like and ftp client, only is just browsers the server and displays file names and folders. If you click on the name of a folder that it displays, it will then display the files and folders inside that directory, and so on for all directories. It works perfectly when I connect to my internet hosting company through ftp to browse, but it doesn't work right when I connect to my personal ftp server. I have tried using both Serv-U and Bulletproof ftp servers to host my ftp site. The script won't display my server correctly with either of these. Can anyone give me some advice? I would really appreciate it. Thanks. Matt -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] ftp browsing
I have a php script that is like and ftp client, only is just browsers the server and displays file names and folders. If you click on the name of a folder that it displays, it will then display the files and folders inside that directory, and so on for all directories. It works perfectly when I connect to my internet hosting company through ftp to browse, but it doesn't work right when I connect to my personal ftp server. I have tried using both Serv-U and Bulletproof ftp servers to host my ftp site. The script won't display my server correctly with either of these. Can anyone give me some advice? I would really appreciate it. Thanks. Matt -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Help with fonts
I want to create an image using outlined fonts. Is it possible? HOW? And, secondly: I would like the first character to be a different font -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Efficient db connect function?
Hey all. I'm currently using the following db connection function, but I'm not sure if it's as efficient as it could be. function dbConnect($SQL) { global $result; // Connect to DB if (!$link = mysql_connect($db_host, $db_user, $db_pass)) { $result = 0; echo mysql_errno() . : . mysql_error() . \n; } else // Select DB if ([EMAIL PROTECTED]($db_name, $link)) { $result = 0; echo mysql_errno() . : . mysql_error() . \n; } else { // Execute query if (!$result = mysql_query($SQL, $link)) { $result = 0; echo mysql_errno() . : . mysql_error() . \n; } } } return $result; } *** Is there a faster way to establish a connection run a query, or am I wasting my time over nothing? * --Noah -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Constant Arrays Possible?
Daniel -- ...and then Daniel R. Hansen said... % % Is it possible to define a constant that is an array of other predefined Nope. From the manual: Only scalar data (boolean, integer, float and string) can be contained in constants. 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://justpickone.org/davidtg/ Shpx gur Pbzzhavpngvbaf Qrprapl Npg! pgp0.pgp Description: PGP signature
RE: [PHP] ftp browsing
-Original Message- From: Matt Palermo [mailto:[EMAIL PROTECTED] Sent: 23 February 2003 09:46 To: [EMAIL PROTECTED] Subject: [PHP] ftp browsing I have a php script that is like and ftp client, only is just browsers the server and displays file names and folders. If you click on the name of a folder that it displays, it will then display the files and folders inside that directory, and so on for all directories. It works perfectly when I connect to my internet hosting company through ftp to browse, but it doesn't work right when I connect to my personal ftp server. I have tried using both Serv-U and Bulletproof ftp servers to host my ftp site. The script won't display my server correctly with either of these. Can anyone give me some advice? I would really appreciate it. Thanks. Matt What version of PHP are you running on your personal ftp server? Is your personal server Win32? There was a bug with ftp_nlist()/ftp_rawlist() on Windows that wasn't fixed till v4.3.x IIRC Rich -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Efficient db connect function?
$db = mysql_connect$db_host, $db_user, $db_pass) or die (Cannot connect to database); mysql_select_db($db_name, $db) or die (Cannot select database); $result = mysql_query($query ,$db) or die (Query not executed); and all the outputting code... grace michiel Cf High [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Hey all. I'm currently using the following db connection function, but I'm not sure if it's as efficient as it could be. function dbConnect($SQL) { global $result; // Connect to DB if (!$link = mysql_connect($db_host, $db_user, $db_pass)) { $result = 0; echo mysql_errno() . : . mysql_error() . \n; } else // Select DB if ([EMAIL PROTECTED]($db_name, $link)) { $result = 0; echo mysql_errno() . : . mysql_error() . \n; } else { // Execute query if (!$result = mysql_query($SQL, $link)) { $result = 0; echo mysql_errno() . : . mysql_error() . \n; } } } return $result; } *** Is there a faster way to establish a connection run a query, or am I wasting my time over nothing? * --Noah -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] ftp browsing
I am using Windows XP Pro, and I am using Serv-U to run my FTP server. It is just a server running from my machine. Is it supposed to have PHP installed somewhere? -Original Message- From: Rich Gray [mailto:[EMAIL PROTECTED] Sent: Sunday, February 23, 2003 9:05 PM To: Matt Palermo; [EMAIL PROTECTED] Subject: RE: [PHP] ftp browsing -Original Message- From: Matt Palermo [mailto:[EMAIL PROTECTED] Sent: 23 February 2003 09:46 To: [EMAIL PROTECTED] Subject: [PHP] ftp browsing I have a php script that is like and ftp client, only is just browsers the server and displays file names and folders. If you click on the name of a folder that it displays, it will then display the files and folders inside that directory, and so on for all directories. It works perfectly when I connect to my internet hosting company through ftp to browse, but it doesn't work right when I connect to my personal ftp server. I have tried using both Serv-U and Bulletproof ftp servers to host my ftp site. The script won't display my server correctly with either of these. Can anyone give me some advice? I would really appreciate it. Thanks. Matt What version of PHP are you running on your personal ftp server? Is your personal server Win32? There was a bug with ftp_nlist()/ftp_rawlist() on Windows that wasn't fixed till v4.3.x IIRC Rich -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Dynamic combobox in Flash with PHP
my experience is that interaction between flash and php runs best through GET so, you could try using GET instead of POST and in your actionscript insert the ';' on the end of the lines for: test = this[list_label+i] myItem.label = test grace michiel Pei_world [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] I have the following PHP code to generate output to the flash //=== $query = SELECT currencyCode,currencyName,country,buyPrice,sellPrice FROM $CURRENCIES_TABLE order by currencyCode;; $db_linker = db_connection(); db_selection($db_linker); $result = mysql_query($query); $num=mysql_num_rows($result); echo array_num=.$num; for($i=0; $imysql_num_rows($result); $i++){ echo list_label.$i.=.mysql_result($result,$i,currencyCode).,.mysql_resul t($result,$i,currencyName); } db_close($db_linker); //== == also the following code in actionscript use to receivesend data. but when I run the *.swf it cann't get the output from PHP, so anyone can help // loadVariables(link.php, this, POST); // get the data from php file /* //== iList = new Array(); myItem = new Object(); iList[0] = myItem; for (i=0; iarray_num; i++) { myItem = new Object(); test = this[list_label+i] myItem.label = test myItem.data = i; iList[i+1] = myItem; } list_currency.setDataProvider(iList); // thx. -- Sincerely your; pei_world ( .::IT::. ) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Permission Denied
Thanks for the replies, it turns out, for some reason, that the variables were empty after they were supposedly assigned for the values in a MySQL table. I fixed the problem so it's all resloved. Sorry for the delayed time in my replies, my email was down all night. Thanks, Stephen Craton http://www.melchior.us - Original Message - From: John Taylor-Johnston [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Sunday, February 23, 2003 3:32 AM Subject: [PHP] Re: Permission Denied Stephen, It seems like I wen tdown that road once? I'm wondering/remembering two things to check? First what are the permissions of the directory your are working in? Go up one level and see what the CHMOD was on that? Second, it might be immaterial and I'm not sure how to do it on a command line, but who is the owner of the files you are trying to delete? Seriously! Maybe your script does not have the permission to delete them? With CuteFTP, I can read who the owner of a file is. I know this was an issue for me once, but I don't remember why. Craton wrote: Hello, I'm having a few problems with deleting items. When I do the unlink() function, it gives me a permission denied error. For example..here's the code: unlink($this-currentfolder().'/packs/'.$title.'/'.$intname); Here's the error returned: Warning: unlink() failed (Permission denied) in /usr/local/plesk/apache/vhosts/piw.melchior.us/httpdocs/phpiw/classes/class. delete.php on line 45 The problem with all this is, I dynamically create the directories and files and dynamically CHMOD them all to 777 with no problems. I don't see why I'm getting all this! Please help ASAP! Thanks in advance! -- John Taylor-Johnston - If it's not open-source, it's Murphy's Law. Université de Sherbrooke: http://compcanlit.ca/ -- 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 browsing
I am using Windows XP Pro, and I am using Serv-U to run my FTP server. It is just a server running from my machine. Is it supposed to have PHP installed somewhere? OK I've probably misunderstood - I assumed you were running your PHP scripts locally - what platform are you running the PHP scripts on and what version of PHP is it? Rich -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Efficient db connect function?
As the previous post of using die would be better. Also try using mysql_pconnect (for persistant connections) and also, if you are running more than one query per script execution, then DON'T keeping trying to connect/select database. I suggest you do the first two things at the start of ALL the scripts that will need to connect to the database, so make an include file with 2 things (connecting and selecting a database). Then make another function just for queries, this way on the second and onward queries will save overhead some from connecting and selecting a database. bobby Cf High [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Hey all. I'm currently using the following db connection function, but I'm not sure if it's as efficient as it could be. function dbConnect($SQL) { global $result; // Connect to DB if (!$link = mysql_connect($db_host, $db_user, $db_pass)) { $result = 0; echo mysql_errno() . : . mysql_error() . \n; } else // Select DB if ([EMAIL PROTECTED]($db_name, $link)) { $result = 0; echo mysql_errno() . : . mysql_error() . \n; } else { // Execute query if (!$result = mysql_query($SQL, $link)) { $result = 0; echo mysql_errno() . : . mysql_error() . \n; } } } return $result; } *** Is there a faster way to establish a connection run a query, or am I wasting my time over nothing? * --Noah -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Question about replacing \r\n with br
At 22:15 22.02.2003, Al said: [snip] I spent hours trying every User Notes in the PHP Manual for this simple operation. e.g., $txt= preg_replace(\r\n, br, $words); and this version $txt = preg_replace(/(\015\012)|(\015)|(\012)/,br /, $txt); I can substitute other characters and dec equivalents and the substations just won't work for \r\n [or just \r or just \n] or \015 or \15. And, I've tried using 10 and 010 and 13 and 013. And nl2br doesn't work either. [snip] nl2br() doesn't work? Then you don't have newline characters in your text. Maybe this is some Mac issue - I've heard that it might be possible that sometimes lines come separated by CR only. Try this: $asrch = array(/\n\r/s, /\r\n/s, /\n/s, /\r/s, /br \//s); $arrpl = array(br /, br /, br /, br /, br /\n); $result = preg_replace($asrch, $arepl, $text); Should catch all possible variations, and finally substitute your br / with a br / followed by a newline character, to beautify the output. Note the s modifier that tells the regex parser to handle $text as a single line. If this is missing it will not find newline characters... -- 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: FW: [PHP] Constant Arrays Possible?
At 15:35 23.02.2003, Daniel R. Hansen said: [snip] I know constants can't be changed or undefined; the use I have in mind won't [snip] Sorry, copied/pasted the wrong paragraph. The paragraph I wanted to include here is -- Only scalar data (boolean, integer, float and string) can be contained in constants. -- If you had a look into the online manual at the url http://www.php.net/manual/en/language.constants.php (I had included it in my first response) you could see this immediately by yourself. HTH, -- 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] mcrypt dll's for php 4.3.x on windows
Hello folks, I found a working version of the php_mcrypt.dll and libmcrypt.dll for php 4.3.x. It may working on earlier versions, but I don't know for sure. You can download it from: http://home.earthlink.net/~dguerrier/data/mcrypt.zip __ Do you Yahoo!? Yahoo! Tax Center - forms, calculators, tips, more http://taxes.yahoo.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Re: Efficient db connect function?
As the previous post of using die would be better. Also try using mysql_pconnect (for persistant connections) and also, if you are running more than one query per script execution, then DON'T keeping trying to connect/select database. Only use persistent connections if you really sure you need them and you understand the implications. Sometimes they can help, sometimes they can hurt. Don't just take the buzzword persistent and assume you need to use it. I suggest you do the first two things at the start of ALL the scripts that will need to connect to the database, so make an include file with 2 things (connecting and selecting a database). Then make another function just for queries, this way on the second and onward queries will save overhead some from connecting and selecting a database. Second that... ---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] ftp browsing
The web server is RedHat Linux and it's PHP version 4.2.3. -Original Message- From: Rich Gray [mailto:[EMAIL PROTECTED] Sent: Sunday, February 23, 2003 9:21 PM To: Matt Palermo; [EMAIL PROTECTED] Subject: RE: [PHP] ftp browsing I am using Windows XP Pro, and I am using Serv-U to run my FTP server. It is just a server running from my machine. Is it supposed to have PHP installed somewhere? OK I've probably misunderstood - I assumed you were running your PHP scripts locally - what platform are you running the PHP scripts on and what version of PHP is it? Rich -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: sending results by email
HEY PAL i been tri that but its send it to me this this is the source form action=http://www2/LUIS/mai.php3; method=POST TEXTAREA NAME= ROWS=10 COLS=26 width =15 /TEXTAREA input type=submit name=Submit value=Enviar table width=100% border=0 height=27 tr tdinput type=checkbox name=checkbox2 value=checkbox no /td /tr /table /form ** ? mail([EMAIL PROTECTED],Subject:sendingresultsbyemail,MyT ext:\n$MyText\ncheckbox2:$checbox2); ? * Warning: Unknown error in e:\usuarios\sites\hwt\luis\mai.php3 on line 18 ANY SUBJEST ABOUT THIS ERROR ??? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] why this ?????????
what du u think about that ?? look form action=http://www2/LUIS/mai.php3; method=POST INPUT TYPE=text NAME=emailBR INPUT TYPE=text NAME=subjectBR INPUT TYPE=text NAME=senderBR TEXTAREA NAME=message ROWS= COLS=mensage/TEXTAREA INPUT TYPE=submit name =enviar form *** an this is the php script his name is mai.php3 *** ?php mail ([EMAIL PROTECTED], $subject, $message, From: $sender\n. Reply-To: $sender\n); ? whereís the error mai.php3 on line 1
[PHP] Image Resize
Hi guys, Is it possible to resize an uploaded file to 10% of it's size and rename it accordingly? I have the filename for the full-size image as filename-WWWxHHH.jpg where WWW is the width and HHH is the height. I want the re-sized image to have the filename filename-thumb-WWWxHHH.jpg where WWW is the resized width and HHH is the resized height. Does this make any sense, would it be possible automatically? I am grateful for any help, Ian. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] why this ?????????
hi Luis, I would like to ask you to _please_ (--see i used the magic word so you have to do it! :) ) make your mails fitting to the generally accepted formats: 1) Keep the mail title the same if the question is the same. Use the reply button of your program, in such a way that in in replies we can see 'Re: existing title ' , so we can all follow what belongs together and what suggestions already have been made, 2) do not repeat the same question within one day, or even within two hours, like on 22/2/03, 3) Save us and yourself time: read the answers given! I gave you a link that explains your question very clearly and also explains why your piece of code does not work anymore. But obviously you did not read it. So here it is again: http://www.thickbook.com/extra/php_email.phtml. (Google gave me after a 1 search - maybe Google wants to be your friend too!) 4) Make your titles more explicit than 'why this ??' thanks, Chris -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] TO JOSH
what du u think about that ?? look form action=http://www2/LUIS/mai.php3; method=POST INPUT TYPE=text NAME=emailBR INPUT TYPE=text NAME=subjectBR INPUT TYPE=text NAME=senderBR TEXTAREA NAME=message ROWS= COLS=mensage/TEXTAREA INPUT TYPE=submit name =enviar form *** an this is the php script his name is mai.php3 *** ?php mail ([EMAIL PROTECTED], $subject, $message, From: $sender\n. Reply-To: $sender\n); ? whereís the error ERROR IN mai.php3 on line 1 ANY SUBJEST?
[PHP] Re: Image Resize
You will need the GD library of image functions for this to work. You can find more information at the following page: http://www.php.net/manual/en/ref.image.php gl Randum Ian [EMAIL PROTECTED] schreef in bericht news:[EMAIL PROTECTED] Hi guys, Is it possible to resize an uploaded file to 10% of it's size and rename it accordingly? I have the filename for the full-size image as filename-WWWxHHH.jpg where WWW is the width and HHH is the height. I want the re-sized image to have the filename filename-thumb-WWWxHHH.jpg where WWW is the resized width and HHH is the resized height. Does this make any sense, would it be possible automatically? I am grateful for any help, Ian. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] TO JOSH
Please do not send the same message over and over! And use more descriptive titles! Your code is right, It problem only a problem with your form, browser, or a platform specific platform. Please read http://www.thickbook.com/extra/php_email.phtml Dennis -Original Message- From: Luis A [mailto:[EMAIL PROTECTED] Sent: Sunday, February 23, 2003 3:38 PM To: [EMAIL PROTECTED] Subject: [PHP] TO JOSH what du u think about that ?? look form action=http://www2/LUIS/mai.php3; method=POST INPUT TYPE=text NAME=emailBR INPUT TYPE=text NAME=subjectBR INPUT TYPE=text NAME=senderBR TEXTAREA NAME=message ROWS= COLS=mensage/TEXTAREA INPUT TYPE=submit name =enviar form *** an this is the php script his name is mai.php3 *** ?php mail ([EMAIL PROTECTED], $subject, $message, From: $sender\n. Reply-To: $sender\n); ? whereís the error ERROR IN mai.php3 on line 1 ANY SUBJEST? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Frustation with data validation
First, thanks to all who offered suggestions with my simple ereg question. I have been unable to get anything to work properly in spite of many good suggestions. The problem I want to solve is to ensure that input fields have either an integer number or are blank before the program proceeds. I am approaching the problem thusly: for ($i=1;$i=3;$i++) { echo $_POST[grass_$i]; // Pollen name echo $_POST[gamt_$i]; // Pollen amount if (is_int($_POST[gamt_$i])) { continue; } else { die(Non-numeric data entered in grass entry field(s).); } } The two echo statements accurately return what data is in the two input fields. The program dies when there is integer data returned in the echo $POST[gamt_$i] statement. If I negate the expression in the if statement like so : if (!is_int($_POST[gamt_$i])) the program runs. Isn't that a bit weird? It gets weirder. If I enter an alpha character with if (!is_int($_POST[gamt_$i])), the program still runs but treats the alpha character as a 0. How should I construct that if statement so that the program will only run with integer data or no data entered into the input fields? TIA Bob Harvey -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Frustation with data validation
any $_POST data is actually string data. Use these functions from a class of mine I plan on making public when I have it thoroughly tested. function isString( $var_name, $var ) { /*Nothing else I can do in this case.. I don't think any other data type can have a length of zero. If I jsut check for is_string and empty string will not register as a string.*/ if ( strlen( $var ) == 0 ) { return; } if ( !is_string( $var ) ) { $this-{$this-log_func} ( $var_name, '$var', does not contain valid string data. ); } } function strIsInt( $str ) { $this-isString( 'str', $str ); if ( strlen( $str ) == 0 ) { return FALSE; } for ( $i = 0; $i strlen($str); $i++ ) { if ( !ctype_digit ( $str[$i] ) $str[$i] != '-' ) { return FALSE; } } return TRUE; } On February 23, 2003 05:02 pm, Robert E. Harvey, M.D. wrote: First, thanks to all who offered suggestions with my simple ereg question. I have been unable to get anything to work properly in spite of many good suggestions. The problem I want to solve is to ensure that input fields have either an integer number or are blank before the program proceeds. I am approaching the problem thusly: for ($i=1;$i=3;$i++) { echo $_POST[grass_$i]; // Pollen name echo $_POST[gamt_$i]; // Pollen amount if (is_int($_POST[gamt_$i])) { continue; } else { die(Non-numeric data entered in grass entry field(s).); } } The two echo statements accurately return what data is in the two input fields. The program dies when there is integer data returned in the echo $POST[gamt_$i] statement. If I negate the expression in the if statement like so : if (!is_int($_POST[gamt_$i])) the program runs. Isn't that a bit weird? It gets weirder. If I enter an alpha character with if (!is_int($_POST[gamt_$i])), the program still runs but treats the alpha character as a 0. How should I construct that if statement so that the program will only run with integer data or no data entered into the input fields? TIA Bob Harvey -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Test message
Rohin Gosling [EMAIL PROTECTED] wrote in message news:... Hi everybody Please ignor this message. I am having dificulty geting messages to apear in this news group, so this is just a test message I am sending in a desperate efort to try and work out how to get messages into the news group. Can't work out why my message are no geting in. They apear to send, but then they stay in my out box and never go to my sent folder. Very frustrating actualy, can't work out whats going on. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Test message
Hi everybody Please ignor this message. I am having dificulty geting messages to apear in this news group, so this is just a test message I am sending in a desperate efort to try and work out how to get messages into the news group. Can't work out why my message are no geting in. They apear to send, but then they stay in my out box and never go to my sent folder. Very frustrating actualy, can't work out whats going on. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Is it possible to Include a php source file ?
First up, I sent this same message a few hours ago, but I do not see it in the news group, and neither does it appear in my sent messages folder. Therefore I am presuming that it never made it to the news group. How ever, if it did get to the news group and I am just unable to see it, then just ignore this message and hopefully my first attempt to post this question will show up latter. I did receive a warning message saying that the message may not appear strait away. So I'm not quite sure what's it going on here. Anyway, back to my question. Hopefully it will make it into the news group this time ! Is it possible to include a *.php source file from inside another php source file, an a fashion similar to that of using the include directive in C or C++ ? Or alternatively, is there a way to call a php script stored in another file from inside a php script. Rohin -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Is there a way to include php source files in a php script ?
Is there a way to include a *.php source file from inside another php source file, in a similar fashion to the way you use the include directive in C or C++ ? Rohin -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Is it possible to Include a php source file ?
include() include_once() require() require_once() Look those functions up in the PHP docs. On 23 February 2003 at 21:32:46, Rohin Gosling wrote: First up, I sent this same message a few hours ago, but I do not see it in the news group, and neither does it appear in my sent messages folder. Therefore I am presuming that it never made it to the news group. How ever, if it did get to the news group and I am just unable to see it, then just ignore this message and hopefully my first attempt to post this question will show up latter. I did receive a warning message saying that the message may not appear strait away. So I'm not quite sure what's it going on here. Anyway, back to my question. Hopefully it will make it into the news group this time ! Is it possible to include a *.php source file from inside another php source file, an a fashion similar to that of using the include directive in C or C++ ? Or alternatively, is there a way to call a php script stored in another file from inside a php script. Rohin -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Please help!!
Hi!! I have installed a script named ALUMNI in www.alipso.com/alumni but there is an error somewhere, and I can´t find it... Please enter to http://alipso.com/alumni/addschool.php3 and try to add a school... you will receive an error... To access through FTP Host address: www.alipso.com User: fu0442 Password: alumni Please help me! If not.. may you tell me where can I find any other PHP mailing list where I can find help? Thanks!!! Francisco _ Francisco Mosse - [EMAIL PROTECTED] - Webmaster de http://www.alipso.com - Centro de Capacitación DELFOS (http://www.delfosweb.com.ar). 4821-3353 / 4823-9334 - http://www.TangoStore.com 4371-7500 _
Re: [PHP] Please help!!
I have installed a script named ALUMNI in www.alipso.com/alumni but there is an error somewhere, and I can´t find it... Please post the code here if it's not too long (in your email, not as an attachment) so that we can see it. Please enter to http://alipso.com/alumni/addschool.php3 and try to add a school... you will receive an error... What error do you receive? Could you give us some details? What are you doing that causes the error? What script causes the error (addschool.php3 or a script that handles the form on addschool.php3)? To access through FTP Host address: www.alipso.com User: fu0442 Password: alumni You really, really, really shouldn't be giving us your FTP access. First, it's not good security. Second, you can't really expect people to FTP to your server to debug your scripts. Please help me! If not.. may you tell me where can I find any other PHP mailing list where I can find help? This is a great place to come for help and I'm sure we'll get you going in no time, but please let us know what errors you are receiving and show any relevant code. That being said... The error you are seeing (presumably the one you're talking about) is this QUERY: INSERT INTO Schools (LongName, Abbreviation) VALUES ('safadssfdfds','afdafsdsf') Error de MySQL: Duplicate entry '' for key 2 in addschool2.php3 Basically the query is failing because a column in your database must have unique values for each row and your query doesn't accomplish that. This is a MySQL database issue and can be solved once you take a look at your query (which is printed by the script) and the database scheme. Best wishes, Larry -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Flash interaction with PHP
do you know how to load the variables from php automatically when the flash start? I need to stick the loadvariable into a button click action,which is not what i want. thx -- Sincerely your; pei_world ( .::IT::. ) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] update query not working
I wonder if anyone can see why the following code is not working. this is taken from a larger functions, the rest of which seems to be working well: print INPUT TYPE=\Submit\ NAME=\Submit\ Value=\Update\/td; print td/tdtd/td/tr; print /table; print /form; if ($_POST['Update']) { print updated!!; $rank = $HTTP_POST_VARS['rank']; $title_new = $HTTP_POST_VARS['titles']; $query_update = UPDATE choices_peter SET rank = $rank, workshop_id = $title_new WHERE choice_ID = $choice_id; $update = mysql_query($query_update, $link) or die(display_db_query: . mysql_error()); } I do not see the statement updated!!! printed, but I cannot see anything wrong with my syntax. Any help would be appreciated. Peter Gumbrell [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] MIME help needed please...
I got this from the user contributed notes in the php.net manual. It seems to work fine most of the time, but Eudora and Pegasus users either get mangled attachments or no attachments. Can anyone see a problem (most files are zip, but sometimes tar.gz or sit) I tried using Content-Type: application/zip with the same results. I'm thinking it is some issue with the headers, content-types, boundaries or something. Or maybe Pegasus/Eudora don't understand MIME or base64 (doubtful)??? Help appreciated. Thanks! function send_mail($from_name, $from_email, $to_name, $to_email, $subject, $text, $path, $filename) { // encode file attachments foreach($filename as $key = $file) { $fp = fopen($path[$key].$file, r); $content = fread($fp, filesize($path[$key].$file)); $attachment[$key] = chunk_split(base64_encode($content)); } // headers need to be in the correct order... $headers = From: $from_name$from_email\n; $headers .= Reply-To: $from_email\n; $headers .= MIME-Version: 1.0\n; // the following must be one line (post width too small) $headers .= Content-Type: multipart/related; type=\multipart/alternative\; boundary=\=MIME_BOUNDRY_main_message\\n; $headers .= X-Sender: $from_name$from_email\n; $headers .= X-Mailer: PHP4\n; //mailer $headers .= X-Priority: 3\n; //1 UrgentMessage, 3 Normal $headers .= Return-Path: $from_email\n; $headers .= This is a multi-part message in MIME format.\n; $headers .= --=MIME_BOUNDRY_main_message \n; $headers .= Content-Type: multipart/alternative; boundary=\=MIME_BOUNDRY_message_parts\\n; // plaintext section begins $message = --=MIME_BOUNDRY_message_parts\n; $message .= Content-Type: text/plain; charset=\iso-8859-1\\n; $message .= Content-Transfer-Encoding: quoted-printable\n; $message .= \n; // your text goes here $message .= $text\n; $message .= \n; // this ends the message part $message .= --=MIME_BOUNDRY_message_parts--\n; $message .= \n; // now we add attachments (images, etc) foreach($filename as $key = $file) { $message .= --=MIME_BOUNDRY_main_message\n; $message .= Content-Type: application/octet-stream; name=\$file\\n; $message .= Content-disposition: attachment\n; $message .= Content-Transfer-Encoding: base64\n; $message .= \n; $message .= $attachment[$key]\n; $message .= \n; } // message ends $message .= --=MIME_BOUNDRY_main_message--\n; // send the message $stat = mail($to_name$to_email, $subject, $message, $headers); return $stat; } -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] update query not working
print INPUT TYPE=\Submit\ NAME=\Submit\ Value=\Update\/td; print /form; if ($_POST['Update']) { print updated!!; } I do not see the statement updated!!! printed, but I cannot see anything wrong with my syntax. Any help would be appreciated. You are looking for a value, where the array is of the form $_POST['form_element_NAME'='form_element_VALUE' So try looking for if ($_POST['Submit']=='Update') { } -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] update query not working
On Monday 24 February 2003 06:56, Peter Gumbrell wrote: I wonder if anyone can see why the following code is not working. this is taken from a larger functions, the rest of which seems to be working well: print INPUT TYPE=\Submit\ NAME=\Submit\ Value=\Update\/td; print td/tdtd/td/tr; print /table; print /form; if ($_POST['Update']) [snip] print_r($_POST) to see what it contains. It probably contains an entry named 'Submit' as that is what you have named your submit button. -- 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 -- /* Trying to be happy is like trying to build a machine for which the only specification is that it should run noiselessly. */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Test message - Last one, I promise !
Sorry to bomb the news groups with so many test messages. I'll have this problem fixed in a jiffy. Please be patient with me. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Test message - Last one, I promise !
Excellent ! Now I can actually send messages to this place. Rohin Gosling [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Sorry to bomb the news groups with so many test messages. I'll have this problem fixed in a jiffy. Please be patient with me. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Another Logging Question
on 24/02/03 3:30 AM, Matt Honeycutt ([EMAIL PROTECTED]) wrote: I'd like for my counter/logger to be fairly scalable, so I'm toying with two possible implementation routes: what are you logging (what kind of data) 1. Have the counter dump visitor info to a text file, then run a cron job on that nightly to process the data and perform a full analysis. Archiving a report, rather than archiving the raw data can save lots of space, and yes a cron would be the best way. the downside is that the report is the ONLY record of the data. 2. Have the counter dump the visitor info into a DB (probably MySQL), then process the data whenever the administrator wants to view his stats. On-demand stats will use up more space long-term than generating monthly reports or something... but there are obvious benefits. The biggest issue IMHO is that if your site is processing a large amount of data, processing it over and over and over on demand is going to burden the server. Anyone have any suggestions or considerations on which method would work better? Is there something else I should do instead? If you're going to be dealing with large amounts of data, a combination. Perhaps perform a monthly analysis and consolidation of data to keep on demand / real time processing to the current month only... However, make sure you keep the long-term data SOMEWHERE, in case you want to change the reporting, method, or analyse the data a different way. If we're only talking about a counter on a few pages, real-time should be fine. Justin -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] [!NEWBIE ALERT!] fread() question
trying to parse a URL and write html code to a file, then search the file for a string between TITLE ... /TITLE how would I implement the fread function below, and regular expressions to read the specific conent. thx or is there a php function that can return the TITLE of a URL? ?php $string = implode(, file($url)); $fp = fopen(temp.txt, w); fwrite($fp, $string); fclose($fp); ? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] University researcher's question
Chris et al. need to make some very specific questions Ok :). A lot of great research is published, but little is known of how the research is produced technologically speaking. Do you or does anyone know of any discussions of how and why PHP MySQL were used in the humanities? I would settle for discussions in other fields. Maybe even e-commerce or business, seeing as though PHP MySQL are the main generators for online business. I'm writng a case-study of how why my research project evolved around PHP MySQL, and then discuss the validity of my choices. P.S. moodle.org was a great starting place. [i] How or why do researchers adapt technology to their research projects? Should they adapt their projects to technology? Indeed, how often does the research assistant end up reinventing the wheel? [/i] I think your would need to make some very specific questions and ask at your local university whether they can help you. I know most of you are E-Commerce oriented, but I would appreciate your feedback. I use PHP MySQL in a university research setting. I'm writing a conference paper on this problematic and I would appreciate your input. Am I the only university type online tonight :) ? On courses you can have a look at the Moodle site: developer of the PHP course support sytem Moodle.org has written papers on this distant learning (and is writing his dissertation now). But 99% of universities and highschools buy Blackboard 'because everybody else does'. I am only using PHP/MySQL to let researchers put their work online, and will use it to let PhD's administrate their own progress, which will be a big relief for the administration people. So it is university related but not really research related. -- John Taylor-Johnston - If it's not open-source, it's Murphy's Law. ' ' ' Collège de Sherbrooke: ô¿ô http://www.collegesherbrooke.qc.ca/languesmodernes/ - Université de Sherbrooke: http://compcanlit.ca/ 819-569-2064 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Is there a way to include php source files in a php script ?
At 20:59 23.02.2003, Rohin Gosling said: [snip] Is there a way to include a *.php source file from inside another php source file, in a similar fashion to the way you use the include directive in C or C++ ? [snip] rant Oh my god, it's soon you'll be asking is there a way I can do programs with PHP ... Why is it SOOO difficult to do at least SOME reading in the online manual before asking in public? Isn't it embarrassing to demonstrate general ignorance? /rant Ok, I'm feeling better now - yes it is possible. See these pages at the online manual: http://www.php.net/manual/en/function.include.php http://www.php.net/manual/en/function.include-once.php http://www.php.net/manual/en/function.require.php http://www.php.net/manual/en/function.require-once.php -- 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] Another Logging Question
Right now, it's logging the client's IP, the page that they're viewing, the page that they came from, the time of the visit, and their system and browser info. I think I'm going to go with a database to store the information, but do a mixture of long term and short term storage. I think I'll add an admin command that causes it to go through and generate statistics from the unprocessed data that's been collected, then move that data to a flat, compressed file for archiving purposes and just store the summary information. Ideally, processing of the raw data would only be performed as needed (and infrequently), so the majority of the database interaction would be inserts. Wow, that was a mouth full. I'd like to have the counter on each page of my site, and (hopefully) it will be getting quite a few hits. I still think the database will probably be the best way to go though as it keeps me from having to even think about file locking issues. ---Matt -Original Message- From: Justin French [mailto:[EMAIL PROTECTED] Sent: Sunday, February 23, 2003 5:12 PM To: Matt Honeycutt; Php-General Subject: Re: [PHP] Another Logging Question on 24/02/03 3:30 AM, Matt Honeycutt ([EMAIL PROTECTED]) wrote: I'd like for my counter/logger to be fairly scalable, so I'm toying with two possible implementation routes: what are you logging (what kind of data) 1. Have the counter dump visitor info to a text file, then run a cron job on that nightly to process the data and perform a full analysis. Archiving a report, rather than archiving the raw data can save lots of space, and yes a cron would be the best way. the downside is that the report is the ONLY record of the data. 2. Have the counter dump the visitor info into a DB (probably MySQL), then process the data whenever the administrator wants to view his stats. On-demand stats will use up more space long-term than generating monthly reports or something... but there are obvious benefits. The biggest issue IMHO is that if your site is processing a large amount of data, processing it over and over and over on demand is going to burden the server. Anyone have any suggestions or considerations on which method would work better? Is there something else I should do instead? If you're going to be dealing with large amounts of data, a combination. Perhaps perform a monthly analysis and consolidation of data to keep on demand / real time processing to the current month only... However, make sure you keep the long-term data SOMEWHERE, in case you want to change the reporting, method, or analyse the data a different way. If we're only talking about a counter on a few pages, real-time should be fine. Justin -- 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] includes || perl
I have a php script with an include(mydomain.com/script.pl); it includes a bit of perl, but will not include it if I do it using /home/path/ only full URL, and when i use the full URL it causes one of my other php includes not to function correctly. unfortunately, I do not think !--#include file= will work inside a .php file.. any solutions? warm regards, Sebastian
Re: [PHP] includes || perl
At 00:26 24.02.2003, Sebastian said: [snip] I have a php script with an include(mydomain.com/script.pl); it includes a bit of perl, but will not include it if I do it using /home/path/ only full URL, and when i use the full URL it causes one of my other php includes not to function correctly. unfortunately, I do not think !--#include file= will work inside a .php file.. any solutions? [snip] I believe you cannot direct Apache to allow both PHP and the server-parsed handler to work on the same URL. You could however execute your perl script as URL with PHP being the client, and add the output of this script to the output of your page, something like ?php // do some stuff // now call your script $buffer = null; $hf = fopen('http://localhost/myscript.pl', 'r'); if ($hf) { while ($chunk = fread($hf, 4096)) $buffer .= $chunk; fclose($hf); } // include the script's output in your page echo $buffer; This is basically what Apache does when it encounters an SSI directive. -- 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] Another Logging Question
Right now, it's logging the client's IP, the page that they're viewing, the page that they came from, the time of the visit, and their system and browser info. Ummm, you do understand that, for Apache at least, all of this information can be made available through it's logging? You also understand that by doing it through php you are, in effect, duplicating information that you can already access? Just checking... Seems a waste to me, that's all... Dave -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] simple ereg question
John W. Holmes wrote: I'd like to verify input data transferred from a form and make sure it is numeric data or null before my program executes. I am using this syntax, which doesn't work: for ($i=1;$i=3;$i++) { if (ereg('[0-9]+','$_POST[gamt_$i]')) { continue; } else { die(Non-numeric data entered in grass entry field(s).); } } No matter what I put in the fields, the program dies and I get the death message. What can I do to fix this? Why not just use is_numeric() and empty()? No need for regular expressions. ---John W. Holmes... PHP Architect - A monthly magazine for PHP Professionals. Get your copy today. http://www.phparch.com/ The is_numeric function works. However, when I try to make an or option out of the if clause, like this: if (is_numeric($_POST[gamt_$i]) or empty($_POSTgamt_$i)) or this: if (is_numeric($_POST[gamt_$i]) || empty($_POSTgamt_$i)) I get this error message (my if statement is on line 5): *Parse error*: parse error, unexpected '\', expecting ')' in */var/www/html/calc/pad_test.php* on line *5 * Now, where did that come from? TIA Bob Harvey -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] [!NEWBIE ALERT!] fread() question
At 00:05 24-2-2003, you wrote: trying to parse a URL and write html code to a file, then search the file for a string between TITLE ... /TITLE how would I implement the fread function below, and regular expressions to read the specific conent. thx or is there a php function that can return the TITLE of a URL? ?php $string = implode(, file($url)); $fp = fopen(temp.txt, w); fwrite($fp, $string); fclose($fp); i would read in the entire file, and use a 'regular expression' such as ereg() http://nl.php.net/manual/nl/function.ereg.php explained on http://www.phpbuilder.com/columns/dario19990616.php3 or preg_match http://nl.php.net/manual/nl/function.preg-match.php I think this may work, with the $string from your code: $pattern=/title(.*)\/title/i; preg_match($pattern, $string, $matches); $title=$matches[1]; echo $title; -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Downloading files - Plz hlp
Hi! In PHP, is there a way to allow the user to download a demo file (e.g.: sample.exe) to their computer? And, then, automatically return to the Web site? Thanks! Tony -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] simple ereg question
At 01:01 24.02.2003, Robert E. Harvey, M.D. said: [snip] if (is_numeric($_POST[gamt_$i]) or empty($_POSTgamt_$i)) or this: if (is_numeric($_POST[gamt_$i]) || empty($_POSTgamt_$i)) I get this error message (my if statement is on line 5): *Parse error*: parse error, unexpected '\', expecting ')' in */var/www/html/calc/pad_test.php* on line *5 * Now, where did that come from? [snip] try to always use square brackets when accessing an array element, like if (is_numeric($_POST[gamt_$i]) or empty($_POST[gamt_$i])) or this: if (is_numeric($_POST[gamt_$i]) || empty($_POST[gamt_$i])) -- 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] PHP_SELF syntax
Could someone tell me why this code prompts a parse error. I have tried it several different way. The statement is called from within a function: print form method=\POST\ name=\update_workshop\ action=\$_SERVER['PHP_SELF']\\n; Many thanks Peter -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Another Logging Question
Yeah, I know, but I'd like this counter to provide that functionality for those that don't have access to Apache's logging capabilities (either because their hosts don't allow it or because of the platform they're being hosted on). At some point, I'd like to provide a toggle to have the counter grab statistics directly from Apache's logs, but that's going to be much later on after I finish up some other projects. ---Matt -Original Message- From: David Freeman [mailto:[EMAIL PROTECTED] Sent: Sunday, February 23, 2003 5:44 PM To: 'Php-General' Subject: RE: [PHP] Another Logging Question Right now, it's logging the client's IP, the page that they're viewing, the page that they came from, the time of the visit, and their system and browser info. Ummm, you do understand that, for Apache at least, all of this information can be made available through it's logging? You also understand that by doing it through php you are, in effect, duplicating information that you can already access? Just checking... Seems a waste to me, that's all... Dave -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] simple ereg question
Ernest E Vogelsinger wrote: At 01:01 24.02.2003, Robert E. Harvey, M.D. said: [snip] if (is_numeric($_POST[gamt_$i]) or empty($_POSTgamt_$i)) or this: if (is_numeric($_POST[gamt_$i]) || empty($_POSTgamt_$i)) I get this error message (my if statement is on line 5): *Parse error*: parse error, unexpected '\', expecting ')' in */var/www/html/calc/pad_test.php* on line *5 * Now, where did that come from? [snip] try to always use square brackets when accessing an array element, like if (is_numeric($_POST[gamt_$i]) or empty($_POST[gamt_$i])) or this: if (is_numeric($_POST[gamt_$i]) || empty($_POST[gamt_$i])) That did it! Thank you, Professor! Bob Harvey -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: PHP_SELF syntax
Works great for me. The error may be from a previous line. What is the error? -Shawn Peter Gumbrell [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Could someone tell me why this code prompts a parse error. I have tried it several different way. The statement is called from within a function: print form method=\POST\ name=\update_workshop\ action=\$_SERVER['PHP_SELF']\\n; Many thanks Peter -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Downloading files - Plz hlp
At 00:52 24.02.2003, Anthony Rodriguez said: [snip] In PHP, is there a way to allow the user to download a demo file (e.g.: sample.exe) to their computer? And, then, automatically return to the Web site? [snip] A couple of. Generally a browser will not leave the current page when starting a file download - it simply remains on the page. As for your question: 1) Generate a link to the exe file within your HTML output: echo 'a href=sample.exeGet the sample.exe file/a'; 2) If you don't have a file but need to construct it on the fly (or it is not directly accessible from within your webserver), simply echo out the data after sending an appropriate MIME headers. Assuming you have the file contents in a variable called $export: header('Content-Type: application/octet-stream'); header('Content-Length: ' . strlen($export)); header('Content-Disposition: attachment;filename=sample.exe'); echo $export; exit(); -- 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] includes || perl
Thank you, that worked like a charm :) I appreciate it. warm regards, Sebastian - Original Message - From: Ernest E Vogelsinger [EMAIL PROTECTED] To: Sebastian [EMAIL PROTECTED] Cc: php list [EMAIL PROTECTED] Sent: Sunday, February 23, 2003 6:37 PM Subject: Re: [PHP] includes || perl | I believe you cannot direct Apache to allow both PHP and the server-parsed | handler to work on the same URL. You could however execute your perl script | as URL with PHP being the client, and add the output of this script to the | output of your page, something like | | ?php |// do some stuff |// now call your script |$buffer = null; |$hf = fopen('http://localhost/myscript.pl', 'r'); |if ($hf) { | while ($chunk = fread($hf, 4096)) | $buffer .= $chunk; | fclose($hf); |} |// include the script's output in your page |echo $buffer; | | This is basically what Apache does when it encounters an SSI directive. | | | -- |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] PHP_SELF syntax
At 00:55 24.02.2003, Peter Gumbrell said: [snip] Could someone tell me why this code prompts a parse error. I have tried it several different way. The statement is called from within a function: print form method=\POST\ name=\update_workshop\ action=\$_SERVER['PHP_SELF']\\n; [snip] When using array elements within a string you must enclose it in curly brackets, like this: print form method=\POST\ name=\update_workshop\ action=\{$_SERVER['PHP_SELF']}\\n; HTH, -- 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] Locality from URL
Does anyone know of an intelligent way to establish a user's location (roughly) from either IP address or some other variable available to the server from the browser? (Other than polling the user) Mike -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] adding to an array
Hello , I need a way to read the following text file and add to or delete from or change the data. I have been able to move it all into an array using this code $groups= file(group); for ($i=0; $i$number_in_group; $i++){ } But I can not figure out how to search the array and delete from or add to the array at a given point. I would like to say add another user to the end of site6 or delete a user from site3. Could sombody give me a hand here. I have read the manual for arrays and still can't figure it out. site1:x:503:tester1 site2:x:504:tester2,tester2a site3:x:505:tester3,tester3a,tester3b site4:x:506:tester4 site5:x:507:tester5,tester5a,tester5b site6:x:508:tester6 site7:x:509:tester7,tester7a,tester7b -- Best regards, rdkurth mailto:[EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Variables not being received from form
Thanks to those who have helped me with my two other questions this afternoon. In the function below, the update query at the end is inserting empty values into the database. For some reason the lines: $rank = $HTTP_POST_VARS['rank']; $title_new = $HTTP_POST_VARS['titles']; re not picking up the form values. Here is the complete function. I do not have a form action set so that I can read the SQL message. The update query is working. function retrieve_select_listing($link, $workshop, $session, $username) { $query_retrieve = SELECT choice_ID, rank, workshop_id FROM choices_peter WHERE workshop_ID = '$workshop' AND username ='$username'; $result1 = mysql_query($query_retrieve, $link) or die(display_db_query: . mysql_error()); $row1 = mysql_fetch_array($result1); $choice_id = $row1[0]; $query_title = SELECT title, CONCAT(sessionlet, sesnumber) AS SessionID FROM ECOO2003 WHERE sessionlet = '$session'; $result2 = mysql_query($query_title, $link) or die(display_db_query: . mysql_error()); while ($columns = mysql_fetch_array($result2)) { $column = $columns['title']; $sessionid = $columns['SessionID']; $selected = ; if ($sessionid == $row1['workshop_id']) { $selected = SELECTED; } $title_block .= OPTION name='title' value=\$sessionid\ $selected$column/OPTION\n; } print trtd colspan=\4\; $selected_session = $HTTP_POST_VARS['titles']; print form method=\POST\ name=\update_workshop\ action=\\\n; print Change the rank of this workshop, or select another workshop from this session and click the update button.brbr/td/tr; print trtd colspan=\4\table border=\1\ width=\80%\; print trthworkshop/ththRank/ththWorkshop Title/th/tr; print trtd$row1[2]/tdtdinput type = \text\ name =\rank\ value=$row1[1]/tdtdSELECT NAME=\titles\$title_block/SELECT/td/tr\n; print trtd colspan =\3\; print input type=\hidden\ name=\update_select\ value=\v\; print brAfter you have made your changes, click the Update button to confirm these.br/td/trtrtd; print INPUT TYPE=\Submit\ NAME=\Submit\ Value=\Update\/td; print td/tdtd/td/tr; print /table; print /form; if ($_POST['Submit']=='Update') { print updated!!; $rank = $HTTP_POST_VARS['rank']; $title_new = $HTTP_POST_VARS['titles']; print rank =$rankbr; print title# = $title_newbr; $query_update = UPDATE choices_peter SET rank = '$rank', workshop_id = '$title_new' WHERE choice_ID = '$choice_id'; $update = mysql_query($query_update, $link) or die(display_db_query: . mysql_error()); } } Many thanks Peter -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Variables not being received from form
cann't see any thing without your form! I think it is misstyping error, check your form variables name, specially upper case or lower case! but try $rank = $HTTP_POST_VARS[rank]; $title_new = $HTTP_POST_VARS[titles]; -- Sincerely your; pei_world ( .::IT::. ) Peter Gumbrell [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Thanks to those who have helped me with my two other questions this afternoon. In the function below, the update query at the end is inserting empty values into the database. For some reason the lines: re not picking up the form values. Here is the complete function. I do not have a form action set so that I can read the SQL message. The update query is working. function retrieve_select_listing($link, $workshop, $session, $username) { $query_retrieve = SELECT choice_ID, rank, workshop_id FROM choices_peter WHERE workshop_ID = '$workshop' AND username ='$username'; $result1 = mysql_query($query_retrieve, $link) or die(display_db_query: . mysql_error()); $row1 = mysql_fetch_array($result1); $choice_id = $row1[0]; $query_title = SELECT title, CONCAT(sessionlet, sesnumber) AS SessionID FROM ECOO2003 WHERE sessionlet = '$session'; $result2 = mysql_query($query_title, $link) or die(display_db_query: . mysql_error()); while ($columns = mysql_fetch_array($result2)) { $column = $columns['title']; $sessionid = $columns['SessionID']; $selected = ; if ($sessionid == $row1['workshop_id']) { $selected = SELECTED; } $title_block .= OPTION name='title' value=\$sessionid\ $selected$column/OPTION\n; } print trtd colspan=\4\; $selected_session = $HTTP_POST_VARS['titles']; print form method=\POST\ name=\update_workshop\ action=\\\n; print Change the rank of this workshop, or select another workshop from this session and click the update button.brbr/td/tr; print trtd colspan=\4\table border=\1\ width=\80%\; print trthworkshop/ththRank/ththWorkshop Title/th/tr; print trtd$row1[2]/tdtdinput type = \text\ name =\rank\ value=$row1[1]/tdtdSELECT NAME=\titles\$title_block/SELECT/td/tr\n; print trtd colspan =\3\; print input type=\hidden\ name=\update_select\ value=\v\; print brAfter you have made your changes, click the Update button to confirm these.br/td/trtrtd; print INPUT TYPE=\Submit\ NAME=\Submit\ Value=\Update\/td; print td/tdtd/td/tr; print /table; print /form; if ($_POST['Submit']=='Update') { print updated!!; $rank = $HTTP_POST_VARS['rank']; $title_new = $HTTP_POST_VARS['titles']; print rank =$rankbr; print title# = $title_newbr; $query_update = UPDATE choices_peter SET rank = '$rank', workshop_id = '$title_new' WHERE choice_ID = '$choice_id'; $update = mysql_query($query_update, $link) or die(display_db_query: . mysql_error()); } } Many thanks Peter -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Dynamic combobox in Flash with PHP
how to active the variablesLoad(test.php,0) when the flash start to play I mean auto load the variables -- Sincerely your; pei_world ( .::IT::. ) Michiel Van Heusden [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] my experience is that interaction between flash and php runs best through GET so, you could try using GET instead of POST and in your actionscript insert the ';' on the end of the lines for: test = this[list_label+i] myItem.label = test grace michiel Pei_world [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] I have the following PHP code to generate output to the flash //=== $query = SELECT currencyCode,currencyName,country,buyPrice,sellPrice FROM $CURRENCIES_TABLE order by currencyCode;; $db_linker = db_connection(); db_selection($db_linker); $result = mysql_query($query); $num=mysql_num_rows($result); echo array_num=.$num; for($i=0; $imysql_num_rows($result); $i++){ echo list_label.$i.=.mysql_result($result,$i,currencyCode).,.mysql_resul t($result,$i,currencyName); } db_close($db_linker); //== == also the following code in actionscript use to receivesend data. but when I run the *.swf it cann't get the output from PHP, so anyone can help // loadVariables(link.php, this, POST); // get the data from php file /* //== iList = new Array(); myItem = new Object(); iList[0] = myItem; for (i=0; iarray_num; i++) { myItem = new Object(); test = this[list_label+i] myItem.label = test myItem.data = i; iList[i+1] = myItem; } list_currency.setDataProvider(iList); // thx. -- Sincerely your; pei_world ( .::IT::. ) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Locality from URL
Does anyone know of an intelligent way to establish a user's location (roughly) from either IP address or some other variable available to the server from the browser? (Other than polling the user) Not really - the problems you face are: 1. Processing Delays - if you need to do whois lookups on an ip address to try and guess where they are coming from you slow down page processing while this happens. Even if you cache the information you'll still be dealing with reasonable numbers on any busy site. 2. IP/Proxy Issues - a good many ISP's proxy web traffic - so all web clients using that ISP may appear to come from a single IP address (or a group of IP addresses in cases where an ISP runs a group of proxy servers). The proxy servers may, or may not, be in similar geographic locations to the web client (another state or possibly even another country). 3. IP/Firewall Issies - a number of entities run firewalls of various sorts. In these cases you'll often only see the IP address of the firewall and nothing else. As with the previous point, you could have multiple web clients all appearing to come from one IP address. Also as above, the web client may not be in the same location as the firewall (I can think of many corporate/govt. entities in Australia that run private IP networks with a single Internet gateway for the entire entity). 4. IP Address Assignments - just because a US corporation owns a particular address space doesn't mean that all of those IP addresses are actually being used in a single geographic location. Some multinationals use assigned IP addresses across multiple countries. As such, ownership of a range does not necessarily equate to geographical location. 5. IP/Domain Resolution - even if you resolve the IP to a domain, the country code (or lack of one) in a domain won't necessarily tell you where the actual web client it. There's five different reasons why it's unreliable and I don't claim this to be either exhaustive or completely detailed. There's no doubt more reasons I've not listed. Of course, if you're dealing with a relatively small group of web clients with known information that you have some control over - ie. a corporate Intranet where you know what IP's are assigned to what locations - then you've got a better chance of doing something. CYA, Dave -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Variables not being received from form
Please, please, PLEASE don't correct code that isn't wrong with code that is! Read http://www.php.net/manual/en/language.types.array.php. To answer the original question, the $HTTP_POST_VARS variable is out of scope in your function. Either use $_POST superglobal array if you're using 4.1.0 or higher, or use $GLOBALS['HTTP_POST_VARS']['formvarhere'] pei_world wrote: cann't see any thing without your form! I think it is misstyping error, check your form variables name, specially upper case or lower case! but try $rank = $HTTP_POST_VARS[rank]; $title_new = $HTTP_POST_VARS[titles]; -- Sincerely your; pei_world ( .::IT::. ) Peter Gumbrell [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Thanks to those who have helped me with my two other questions this afternoon. In the function below, the update query at the end is inserting empty values into the database. For some reason the lines: re not picking up the form values. Here is the complete function. I do not have a form action set so that I can read the SQL message. The update query is working. function retrieve_select_listing($link, $workshop, $session, $username) { $query_retrieve = SELECT choice_ID, rank, workshop_id FROM choices_peter WHERE workshop_ID = '$workshop' AND username ='$username'; $result1 = mysql_query($query_retrieve, $link) or die(display_db_query: . mysql_error()); $row1 = mysql_fetch_array($result1); $choice_id = $row1[0]; $query_title = SELECT title, CONCAT(sessionlet, sesnumber) AS SessionID FROM ECOO2003 WHERE sessionlet = '$session'; $result2 = mysql_query($query_title, $link) or die(display_db_query: . mysql_error()); while ($columns = mysql_fetch_array($result2)) { $column = $columns['title']; $sessionid = $columns['SessionID']; $selected = ; if ($sessionid == $row1['workshop_id']) { $selected = SELECTED; } $title_block .= OPTION name='title' value=\$sessionid\ $selected$column/OPTION\n; } print trtd colspan=\4\; $selected_session = $HTTP_POST_VARS['titles']; print form method=\POST\ name=\update_workshop\ action=\\\n; print Change the rank of this workshop, or select another workshop from this session and click the update button.brbr/td/tr; print trtd colspan=\4\table border=\1\ width=\80%\; print trthworkshop/ththRank/ththWorkshop Title/th/tr; print trtd$row1[2]/tdtdinput type = \text\ name =\rank\ value=$row1[1]/tdtdSELECT NAME=\titles\$title_block/SELECT/td/tr\n; print trtd colspan =\3\; print input type=\hidden\ name=\update_select\ value=\v\; print brAfter you have made your changes, click the Update button to confirm these.br/td/trtrtd; print INPUT TYPE=\Submit\ NAME=\Submit\ Value=\Update\/td; print td/tdtd/td/tr; print /table; print /form; if ($_POST['Submit']=='Update') { print updated!!; $rank = $HTTP_POST_VARS['rank']; $title_new = $HTTP_POST_VARS['titles']; print rank =$rankbr; print title# = $title_newbr; $query_update = UPDATE choices_peter SET rank = '$rank', workshop_id = '$title_new' WHERE choice_ID = '$choice_id'; $update = mysql_query($query_update, $link) or die(display_db_query: . mysql_error()); } } Many thanks Peter -- 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.
Re: [PHP] PHP_SELF syntax
On Sun, 23 Feb 2003 18:55:06 -0500, you wrote: Could someone tell me why this code prompts a parse error. I have tried it several different way. The statement is called from within a function: print form method=\POST\ name=\update_workshop\ action=\$_SERVER['PHP_SELF']\\n; echo ('form method=POST name=update_workshop action=' . $_SERVER['PHP_SELF'] . '' . \n); works for me (moved the variable outside the string). I first thought it might be a scope problem, but $_SERVER is apparently a superglobal so that's not it. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php