Re: [PHP] Re: Creating methods runtime
On Thu, 21 Feb 2002, Matthew J Gray wrote: No there really isn't. I wrote an extension that does it for me, but I am waiting to see what the second zend engine will have for this rather that using my hack. Maybe check the Zend Engine 2 mailing list to see what the future may hold. Is you extension available somewhere? Having this option would save me a lot of coding and AFAIK Zend 2 is not in quite near future yet. -- Mika Tuupola http://www.appelsiini.net/~tuupola/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Telnet
Hi, you can find all what you want on the following url : http://phpclasses.upperdesign.com/browse.html/class/2/ Personnaly I use the SMTP class from Richard Heyes Laurent Uma Shankari T. [EMAIL PROTECTED] To: [EMAIL PROTECTED] et.res.in cc: Subject: [PHP] Telnet 22/02/02 05:17 Hello, By using telnet option how i will send a mail from my machine using php..If any one came to know this plz tell me how to do it... -Uma -- 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] Creating methods runtime
You can sort of fake it using the call handler of the overload extension. -Rasmus On Thu, 21 Feb 2002, Mika Tuupola wrote: Is there a way to create/add methods runtime to a class via constructor or static factory method? I know it is possible to create functions runtime using eval() or create_function() but I havent been able to make them appear as methods for a class. -- Mika Tuupola http://www.appelsiini.net/~tuupola/ -- 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] foreach not in reach
You didn't supply any information about you foreach() loop, but it works like foreach ($array as $string) print $elementbr\n; And explode() returns an array, so I think you need to do it like this: $array = explode(;, $string); array_push($authors, $array); // You could use foreach() here as well Niklas -Original Message- From: jtjohnston [mailto:[EMAIL PROTECTED]] Sent: 22. helmikuuta 2002 8:48 To: [EMAIL PROTECTED] Subject: [PHP] foreach not in reach Question 1: How can I append strings to my authors array? Me thinks this doesn't work :§) ? $authors .= explode(;, $mydata-KW); I'm getting Invalid argument supplied for foreach() Question 2: Once I get this working, I want to (a) alphabetise the contents of the array, (b) count repititions, (c) elimintate copies, and create an array I can print with tow things $author[i]\t$counter[i], so I end up with something like: Adam2 Louis5 John3 Mary8 $myconnection = mysql_connect($server,$user,$pass); mysql_select_db($db,$myconnection); $news = mysql_query(select KW from $table); while ($mydata = mysql_fetch_object($news)) { $authors .= explode(;, $mydata-KW); } foreach ($authors as $author) { echo $authorbr\n; } I'm learning, slowly but surely Martin :) J -- 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: foreach not in reach
In article [EMAIL PROTECTED], [EMAIL PROTECTED] says... Question 1: How can I append strings to my authors array? Me thinks this doesn't work :§) ? $authors .= explode(;, $mydata-KW); I'm getting Invalid argument supplied for foreach() Question 2: Once I get this working, I want to (a) alphabetise the contents of the array, (b) count repititions, (c) elimintate copies, and create an array I can print with tow things $author[i]\t$counter[i], so I end up with something like: See the array handling functions to resolve some of these problems. Adam2 Louis5 John3 Mary8 $myconnection = mysql_connect($server,$user,$pass); mysql_select_db($db,$myconnection); $news = mysql_query(select KW from $table); while ($mydata = mysql_fetch_object($news)) { $authors .= explode(;, $mydata-KW); Presumably your error is occurring here; it would seem that the content of $mydata-KW is not such that explode will create an array. There may be cases perhaps where you do not have a series of authors names separated by semicolons? You may have to add a test for the case where $authors is not an array. } foreach ($authors as $author) { echo $authorbr\n; } I'm learning, slowly but surely Martin :) I think this has already been said, but it seems there is scope to restructure your tables in such a manner as to be able to handle a lot of these problems with SQL from a properly designed database. Frinstance you might have a structure that has a main table with a unique ID, the abstract info, title, publisher etc and a separate table with author name and ID of the main table entry. Just at a guess, you are/have imported this information from a bibliographic package of some sort? -- David Robley Temporary Kiwi! Quod subigo farinam -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] header problem
Hi , I have a problem in using the Header() function. I want to automatically redirect the page into another php script after a form completion but im receiving this error Warning: Cannot add header information - headers already sent by .. Heres the script line: header(Location: 8D_Anaform_Admin.php?action=form); Please help im stuck here. Regards, Mike -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] header problem
You can't redirect after sending output unless you use Javascript or some other weirdness. Redirections are done before any output. -Rasmus On Fri, 22 Feb 2002, Michael P. Carel wrote: Hi , I have a problem in using the Header() function. I want to automatically redirect the page into another php script after a form completion but im receiving this error Warning: Cannot add header information - headers already sent by .. Heres the script line: header(Location: 8D_Anaform_Admin.php?action=form); Please help im stuck here. Regards, Mike -- 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] pulling text to insert in table
Hi Thanks. In some cases I would have Microsoft Excel files wich I will save as csv files. Can content be pulled from a csv in the same method. Thanks Mohamed - Original Message - From: Nick Wilson [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Friday, February 22, 2002 9:43 AM Subject: Re: [PHP] pulling text to insert in table -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 * and then Administration@myclassguide declared Hi Is it possible to pull text from a text file and insert it into a table in an html page using php. Yes. In some cases it would have to pull text from a certain part in the text file and insert it into a specific cell in the table. Check out the regexp functions in the manual, I'm no expert in that field but you should easily be able to parse your text file and extract lines/sections based on certern criterion. - -- - --- www.explodingnet.com |Projects, Forums and +Articles for website owners - -- Nick Wilson -- |and designers. -BEGIN PGP SIGNATURE- Version: GnuPG v1.0.6 (GNU/Linux) iD8DBQE8dfaYHpvrrTa6L5oRApV2AJ9j19dxxZDCtuZnyMpQ6ZgP9P9b5QCcDmyB mM9StS2gzLoowvWrKzCOkUc= =vI7o -END PGP SIGNATURE- -- 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] Zend
Hallo, I would like to try Zend studio server as possible support for the development team. Until now i found only a Zend for php4.0.5, 4.0.6 4.1.0. Does anybody know where can i find a Zend server compatible with php4.0.4 ? thanks best regards Ornella Fasolo -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Win32 compilation problems...
Hello, I'm new in use of php! I have some problems to compile Win32 Php! I want to include socket module in php and i don't because i have some compilation errors. Is there anybody who can help me? cheers! Fred
Re: [PHP] pulling text to insert in table
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 * and then Administration@myclassguide declared Hi Thanks. In some cases I would have Microsoft Excel files wich I will save as csv files. Can content be pulled from a csv in the same method. No idea Mohamed but presuming they're basically text I'm sure it can. - -- - --- www.explodingnet.com |Projects, Forums and +Articles for website owners - -- Nick Wilson -- |and designers. -BEGIN PGP SIGNATURE- Version: GnuPG v1.0.6 (GNU/Linux) iD8DBQE8diq2HpvrrTa6L5oRAu9mAJ9qY9wiFb6cI94Xf08e5I/6tgl0wgCZAVdT oSkFJGDqykp91vSQQ+M6IvA= =Me6P -END PGP SIGNATURE- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] function that extracts numbers from a string
Hi folks, Is there a function that extracts numbers from a string? I can do this with ereg but it's quite slow when you have a long list of variables to get through... thanks! dk -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] function that extracts numbers from a string
Try with preg_match_all() PCRE functions are up to 25% faster than POSIX(ereg). Best regards, Andrey Hristov - Original Message - From: DigitalKoala [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Friday, February 22, 2002 1:44 PM Subject: [PHP] function that extracts numbers from a string Hi folks, Is there a function that extracts numbers from a string? I can do this with ereg but it's quite slow when you have a long list of variables to get through... thanks! dk -- 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] Telnet
You can send mail using PHP's mail() function. On windows this works with regular SMTP (mail server), on UNIX it executes a binary (local delivery agent) that may handle the message as desired. If you really want to sent through a telnet service, you can fsockopen() to the telnet server and regular file functions to send login stuff and run the appropiatemail software on the server ('sendmail'?). Ofcourse this is not recommended, because it has unnecessary overhead and you'd be better off using an SMTP script or class (as noted before) or make one yourself according to the 'SMTP RFC' (put that in google). bvr. On Fri, 22 Feb 2002 09:47:08 +0530 (IST), Uma Shankari T. wrote: Hello, By using telnet option how i will send a mail from my machine using php..If any one came to know this plz tell me how to do it... -Uma -- 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] overwriting PHP_SELF and PHP_AUTH_xxxx
I have a special set of information retrieved from a while loop that I would like a person to be able to edit and send back into a MySQL table. I know all of the basic MySQL commands for doing such, but the PHP side to get the input from the form to go in is really stumping me. This is what I have: - $or = 0; while($or $orderidrows) { $orderinfo = mysql_fetch_row($orderidinfo); $domain[$or] = $orderinfo[2]; $cancel[$or] = $orderinfo[3]; print trtdfont size=2 face=Arial $domain[$or]/font/tdtdfont size=2 face=ArialCancel This Domain?/font/tdtdfont size=2 face=Arialinput type=text name=confirm value='$cancel[$or]' size=3/font/td; $or++; } -- The values/data I would normally insert into the MySQL from the form would be $confirm, based on $domain - however, in this case, I have a number of rows with the same name. I've received help as far as distinguishing one row from another - thanks. :) The problem I am really having is trying to insert the data back into one particular table. You see, when I select the data, I get multiple orderid's with multiple domains attached to them. When I try to UPDATE the MySQL with the data, only the last orderid seems to be the one getting updated. And, to boot, I want to update based on the domain name (since that is unique) and ignore the orderids. I only used the orderids to pull the data out. So, I've been using a query like this in a loop; $update = UPDATE table2 SET cancel='$cancel[$a]' WHERE domain = $domain[$a] Any suggestions? I'm getting pretty desparate here! :\ Thanks, -Mike -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Getting the data for MySQL and then putting it back with PHP - at a loss!
I have a special set of information retrieved from a while loop that I would like a person to be able to edit and send back into a MySQL table. I know all of the basic MySQL commands for doing such, but the PHP side to get the input from the form to go in is really stumping me. This is what I have: - $or = 0; while($or $orderidrows) { $orderinfo = mysql_fetch_row($orderidinfo); $domain[$or] = $orderinfo[2]; $cancel[$or] = $orderinfo[3]; print trtdfont size=2 face=Arial $domain[$or]/font/tdtdfont size=2 face=ArialCancel This Domain?/font/tdtdfont size=2 face=Arialinput type=text name=confirm value='$cancel[$or]' size=3/font/td; $or++; } -- The values/data I would normally insert into the MySQL from the form would be $confirm, based on $domain - however, in this case, I have a number of rows with the same name. I've received help as far as distinguishing one row from another - thanks. :) The problem I am really having is trying to insert the data back into one particular table. You see, when I select the data, I get multiple orderid's with multiple domains attached to them. When I try to UPDATE the MySQL with the data, only the last orderid seems to be the one getting updated. And, to boot, I want to update based on the domain name (since that is unique) and ignore the orderids. I only used the orderids to pull the data out. So, I've been using a query like this in a loop; $update = UPDATE table2 SET cancel='$cancel[$a]' WHERE domain = $domain[$a] Any suggestions? I'm getting pretty desparate here! :\ Thanks, -Mike -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Any way to display a changing value?
Hi! You could use a plain form and JavaScript to do this. It's fairly simple and it makes for nice little progress bars and graphs and other 'realtime' info. A few tips: - first output the form (completely) - use *implicit* flushing when outputting your JS. - use a new SCRIPT .. /SCRIPT part every time you sent commands (for Netscape) - do all calculations and stuff in PHP, minimize your JS code to something like echo(document.myform.mytext.value = ' . addslashes($newval) . ';\n); - try to do updates 'smartly', i.e. on when the values *really* change, and not with infinite speed. bvr. On Thu, 21 Feb 2002 23:00:30 -0500, Leif K-Brooks wrote: I was wondering if there's any way to display a value to the user that keeps changing? I know about flush(), but that just prints it out before the script ends, but doesn't display it in one place. Is there a way? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Getting the data for MySQL and then putting it back withPHP - at a loss!
Michael, Been there recently! You want to use variable variables: $index=0; for (index=0; $index $rowcount; $index++){ $formvar='formvar'.$index; $formvar=$$formvar; Do the last two lines for each piece of data you want to handle. Think about how you are isolating the formvars on the submitted page to make sure that you are sure you are reading the right stuff. Hope this helps. George in Edinburgh On Fri, 2002-02-22 at 12:24, Michael Romagnoli wrote: I have a special set of information retrieved from a while loop that I would like a person to be able to edit and send back into a MySQL table. I know all of the basic MySQL commands for doing such, but the PHP side to get the input from the form to go in is really stumping me. This is what I have: - $or = 0; while($or $orderidrows) { $orderinfo = mysql_fetch_row($orderidinfo); $domain[$or] = $orderinfo[2]; $cancel[$or] = $orderinfo[3]; print trtdfont size=2 face=Arial $domain[$or]/font/tdtdfont size=2 face=ArialCancel This Domain?/font/tdtdfont size=2 face=Arialinput type=text name=confirm value='$cancel[$or]' size=3/font/td; $or++; } -- The values/data I would normally insert into the MySQL from the form would be $confirm, based on $domain - however, in this case, I have a number of rows with the same name. I've received help as far as distinguishing one row from another - thanks. :) The problem I am really having is trying to insert the data back into one particular table. You see, when I select the data, I get multiple orderid's with multiple domains attached to them. When I try to UPDATE the MySQL with the data, only the last orderid seems to be the one getting updated. And, to boot, I want to update based on the domain name (since that is unique) and ignore the orderids. I only used the orderids to pull the data out. So, I've been using a query like this in a loop; $update = UPDATE table2 SET cancel='$cancel[$a]' WHERE domain = $domain[$a] Any suggestions? I'm getting pretty desparate here! :\ Thanks, -Mike _ Do You Yahoo!? Get your free @yahoo.com address at http://mail.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Getting the data for MySQL and then putting it back withPHP - at a loss!
Better is: $index=0; for (index=0; $index $rowcount; $index++){ $formvar=${'formvar'.$index}; } - Original Message - From: george Pitcher [EMAIL PROTECTED] To: Michael Romagnoli [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Sent: Friday, February 22, 2002 2:40 PM Subject: Re: [PHP] Getting the data for MySQL and then putting it back withPHP - at a loss! Michael, Been there recently! You want to use variable variables: $index=0; for (index=0; $index $rowcount; $index++){ $formvar='formvar'.$index; $formvar=$$formvar; Do the last two lines for each piece of data you want to handle. Think about how you are isolating the formvars on the submitted page to make sure that you are sure you are reading the right stuff. Hope this helps. George in Edinburgh On Fri, 2002-02-22 at 12:24, Michael Romagnoli wrote: I have a special set of information retrieved from a while loop that I would like a person to be able to edit and send back into a MySQL table. I know all of the basic MySQL commands for doing such, but the PHP side to get the input from the form to go in is really stumping me. This is what I have: - $or = 0; while($or $orderidrows) { $orderinfo = mysql_fetch_row($orderidinfo); $domain[$or] = $orderinfo[2]; $cancel[$or] = $orderinfo[3]; print trtdfont size=2 face=Arial $domain[$or]/font/tdtdfont size=2 face=ArialCancel This Domain?/font/tdtdfont size=2 face=Arialinput type=text name=confirm value='$cancel[$or]' size=3/font/td; $or++; } -- The values/data I would normally insert into the MySQL from the form would be $confirm, based on $domain - however, in this case, I have a number of rows with the same name. I've received help as far as distinguishing one row from another - thanks. :) The problem I am really having is trying to insert the data back into one particular table. You see, when I select the data, I get multiple orderid's with multiple domains attached to them. When I try to UPDATE the MySQL with the data, only the last orderid seems to be the one getting updated. And, to boot, I want to update based on the domain name (since that is unique) and ignore the orderids. I only used the orderids to pull the data out. So, I've been using a query like this in a loop; $update = UPDATE table2 SET cancel='$cancel[$a]' WHERE domain = $domain[$a] Any suggestions? I'm getting pretty desparate here! :\ Thanks, -Mike _ Do You Yahoo!? Get your free @yahoo.com address at http://mail.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Bad char Translation
Hi, I've got a text file containing blés, Châteaux ... (without quotes) I'm reading this file like this $FileName = Test.txt; $FileHand = fopen($FileName, rb); $Data = fread($FileHand, filesize($FileName)); fclose($FileHand); print_r($Data); Under Linux, by asking the script throught an HTTP server ... i've got the good text blés, Châteaux ... But when i launch the script through the console (under windows 2000) ... characters are translated : blùs, Chôteaux ... what does it means .. .? Thanks for your help ...
Re: [PHP] XML compliance with forms and trans_sid when using sessions
Lars Torben Wilson wrote: On Thu, 2002-02-21 at 14:11, James Nord wrote: Unfortunatly I know some that need to leave it. If you would state exactly what the problem with the slash being there is, perhaps we could help you. The HTML renderer that comes with Java (jfc) renders the '' due to the '/' being before it. There may well be others (or older browser versions too) that choke on it . Oh well - output buffers it is then... /James -- Technology is a word that describes something that doesn't work yet. Douglas Adams What is the actual component which is having a hard time rendering this? The JTextPane Example below, import javax.swing.*; import java.net.*; import java.awt.*; public class foo { public static void main(String[] args) throws Exception { new foo(args[0]); } public foo(String url) throws Exception { Frame f = new Frame(Trailing Slash bug); JTextPane html = new JTextPane(); f.add(html); f.pack(); f.show(); html.setPage(new URL(url)); html.setEditable(false); } } /James -- Technology is a word that describes something that doesn't work yet. Douglas Adams -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Getting the data for MySQL and then putting it back withPHP - at a loss!
Yeah, but, where does $rowcount come from, $or? Are you just renaming the variable? Thanks for your help! -Mike -Original Message- From: george Pitcher [mailto:[EMAIL PROTECTED]] Sent: Friday, February 22, 2002 7:40 AM To: Michael Romagnoli Cc: [EMAIL PROTECTED] Subject: Re: [PHP] Getting the data for MySQL and then putting it back withPHP - at a loss! Michael, Been there recently! You want to use variable variables: $index=0; for (index=0; $index $rowcount; $index++){ $formvar='formvar'.$index; $formvar=$$formvar; Do the last two lines for each piece of data you want to handle. Think about how you are isolating the formvars on the submitted page to make sure that you are sure you are reading the right stuff. Hope this helps. George in Edinburgh On Fri, 2002-02-22 at 12:24, Michael Romagnoli wrote: I have a special set of information retrieved from a while loop that I would like a person to be able to edit and send back into a MySQL table. I know all of the basic MySQL commands for doing such, but the PHP side to get the input from the form to go in is really stumping me. This is what I have: - $or = 0; while($or $orderidrows) { $orderinfo = mysql_fetch_row($orderidinfo); $domain[$or] = $orderinfo[2]; $cancel[$or] = $orderinfo[3]; print trtdfont size=2 face=Arial $domain[$or]/font/tdtdfont size=2 face=ArialCancel This Domain?/font/tdtdfont size=2 face=Arialinput type=text name=confirm value='$cancel[$or]' size=3/font/td; $or++; } -- The values/data I would normally insert into the MySQL from the form would be $confirm, based on $domain - however, in this case, I have a number of rows with the same name. I've received help as far as distinguishing one row from another - thanks. :) The problem I am really having is trying to insert the data back into one particular table. You see, when I select the data, I get multiple orderid's with multiple domains attached to them. When I try to UPDATE the MySQL with the data, only the last orderid seems to be the one getting updated. And, to boot, I want to update based on the domain name (since that is unique) and ignore the orderids. I only used the orderids to pull the data out. So, I've been using a query like this in a loop; $update = UPDATE table2 SET cancel='$cancel[$a]' WHERE domain = $domain[$a] Any suggestions? I'm getting pretty desparate here! :\ Thanks, -Mike _ Do You Yahoo!? Get your free @yahoo.com address at http://mail.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Getting the data for MySQL and then putting it back withPHP - at a loss!
So, then I have a sql command for updating the data with $formvar? I would work $domain into this because $domain is the unique identifier? Like this: $index=0; for (index=0; $index $rowcount; $index++){ $formvar=${'formvar'.$index}; $sql = UPDATE table2 SET domain = '.$domain[$index].' cancel = '.$formvar'; } ? -Mike Better is: $index=0; for (index=0; $index $rowcount; $index++){ $formvar=${'formvar'.$index}; } - Original Message - From: george Pitcher [EMAIL PROTECTED] To: Michael Romagnoli [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Sent: Friday, February 22, 2002 2:40 PM Subject: Re: [PHP] Getting the data for MySQL and then putting it back withPHP - at a loss! Michael, Been there recently! You want to use variable variables: $index=0; for (index=0; $index $rowcount; $index++){ $formvar='formvar'.$index; $formvar=$$formvar; Do the last two lines for each piece of data you want to handle. Think about how you are isolating the formvars on the submitted page to make sure that you are sure you are reading the right stuff. Hope this helps. George in Edinburgh On Fri, 2002-02-22 at 12:24, Michael Romagnoli wrote: I have a special set of information retrieved from a while loop that I would like a person to be able to edit and send back into a MySQL table. I know all of the basic MySQL commands for doing such, but the PHP side to get the input from the form to go in is really stumping me. This is what I have: - $or = 0; while($or $orderidrows) { $orderinfo = mysql_fetch_row($orderidinfo); $domain[$or] = $orderinfo[2]; $cancel[$or] = $orderinfo[3]; print trtdfont size=2 face=Arial $domain[$or]/font/tdtdfont size=2 face=ArialCancel This Domain?/font/tdtdfont size=2 face=Arialinput type=text name=confirm value='$cancel[$or]' size=3/font/td; $or++; } -- The values/data I would normally insert into the MySQL from the form would be $confirm, based on $domain - however, in this case, I have a number of rows with the same name. I've received help as far as distinguishing one row from another - thanks. :) The problem I am really having is trying to insert the data back into one particular table. You see, when I select the data, I get multiple orderid's with multiple domains attached to them. When I try to UPDATE the MySQL with the data, only the last orderid seems to be the one getting updated. And, to boot, I want to update based on the domain name (since that is unique) and ignore the orderids. I only used the orderids to pull the data out. So, I've been using a query like this in a loop; $update = UPDATE table2 SET cancel='$cancel[$a]' WHERE domain = $domain[$a] Any suggestions? I'm getting pretty desparate here! :\ Thanks, -Mike _ Do You Yahoo!? Get your free @yahoo.com address at http://mail.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] sanity check - apache/php module safe implementation
End goals - avoid using CGI - restrict PHP programs to user directory - allow PHP from http to manipulate files/links/uploads/etc... Apache main config sets user and group to nobody Apache Virtual Host for site contains # restrict web pages root in specific sub-directory DocumentRoot /www/user1/public # have web server run as user for file upload permissions, # and link/file set unset user user1 # set group nobody if user belongs to group with permissions group nobody #set base dir for PHP operations to user root directory to allow # out of web accessible folder storage of inc files etc... php_admin_value open_base_dir /www/user1 # provide upload directory within the php base directory for # permission to upload and move files to final location php_admin_value upload_tmp_dir /www/user1/tmp Logically, this should... - allow php to manipulate the users area fully but deny access to commands outside his directory - allow php to upload files into private tmp directory owned by user, which php then has permission to relocate as needed - allow php to create symlinks, delete files, any other such filesystem operations within his personal tree - require any executables to be within his directory tree for php to call them Clarifications, corrections, comments? Dave -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Next and Preview Row
My dump: # phpMyAdmin MySQL-Dump # http://phpwizard.net/phpMyAdmin/ # # Host: 192.168.1.11:3306 Database : test # # # Table structure for table 'some' # CREATE TABLE some ( id varchar(6) NOT NULL, descr varchar(250) NOT NULL ); # # Dumping data for table 'some' # INSERT INTO some VALUES ( 'ID0001', 'first line'); INSERT INTO some VALUES ( 'ID0002', 'Second line'); INSERT INTO some VALUES ( 'ID0010', 'Third row'); INSERT INTO some VALUES ( 'ID0015', 'Fourth row'); INSERT INTO some VALUES ( 'ID0023', 'Fifth row'); INSERT INTO some VALUES ( 'ID0026', 'Sixth row'); Try this sql on this table: select * from some where id'ID0015' order by id desc limit 0,1; select * from some where id'ID0015' order by id limit 0,1; Best regards, Andrey Hristov - Original Message - From: Mark Lo [EMAIL PROTECTED] To: [EMAIL PROTECTED]; [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Sent: Friday, February 22, 2002 5:15 PM Subject: [PHP] Next and Preview Row Dear All, I am using PHP + MYSQL. I have a question that I need some expert to help. That is: How do I find out a next and preview row values by using PHP and MYSQL. For examples, Row 10ID00010need this value Row 11ID00025have this value on hand Row 12ID00063need this value The questions is how do I find out the values in Row 10 and Row 12, if and only if I only have one data that is ID00025 (select * from table where field=ID00025) . But, the questions is How do I find out the data in Row 10 and Row 12 which is ID00010 and ID00063 assume I don't know the values of ID00025 is in Row 11. Thank you so much for your help. Mark Lo -- 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] difference between php3 and php4
Warning: Supplied argument is not a valid MySQL result resource in c:\program files\apache group\apache\cgi-bin\emp.php3 on line 10 $db = mysql_connect(localhost, , ); mysql_select_db(employee,$db); $result = mysql_query(SELECT * FROM employees,$db); echo table border=0; echo tr; echo td bgcolor=#FAFOE6 colspan=2BName/B/td; echo td bgcolor=#FAFOE6BAddress/B/td; echo td bgcolor=#FAFOE6BPosition/B/td; echo /tr; while($row = mysql_fetch_row($result)) { $fname = $row[1]; $lname = $row[2]; $address = $row[3]; $position = $row[4]; echo tr bgcolor=#C6E7DE; echo td$fname/td; echo td$lname/td; echo td$address/td; echo td$position/td; echo /tr; } This script works in php3 but not in windows php4. The error message above points to the mysql_fetch_row function. Does this function work differently in php4? If not, what else might cause this script to work in php3 and not in php4? __ Do You Yahoo!? Yahoo! Sports - Coverage of the 2002 Olympic Games http://sports.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
php-general Digest 22 Feb 2002 15:49:40 -0000 Issue 1187
php-general Digest 22 Feb 2002 15:49:40 - Issue 1187 Topics (messages 85810 through 85856): Transparent sid 85810 by: Richard Baskett Any way to display a changing value? 85811 by: Leif K-Brooks 85843 by: bvr Referencing a parent class' variables 85812 by: Bradley Goldsmith 85814 by: Bradley Goldsmith not recognizing changes 85813 by: sean.interconnect.is.it Telnet 85815 by: Uma Shankari T. 85828 by: DrouetL.ldnegoce.com 85840 by: bvr Re: phpmyadmin 85816 by: Ray Hunter overwriting PHP_SELF and PHP_AUTH_ 85817 by: K.Tomono 85818 by: Lars Torben Wilson 85821 by: K.Tomono 85823 by: Rasmus Lerdorf 85841 by: Michael Romagnoli pulling text to insert in table 85819 by: Administration.myclassguide 85825 by: Nick Wilson 85834 by: Administration.myclassguide 85837 by: Nick Wilson foreach not in reach 85820 by: jtjohnston 85830 by: Niklas Lampén 85831 by: David Robley How do you setup cacheing? 85822 by: Ed Lazor 85824 by: Rasmus Lerdorf Re: Apache 2.0.32 + PHP from CVS not working 85826 by: Rasmus Lerdorf 85856 by: Tyler Longren Re: Creating methods runtime 85827 by: Mika Tuupola 85829 by: Rasmus Lerdorf header problem 85832 by: Michael P. Carel 85833 by: Rasmus Lerdorf Zend 85835 by: Ornella Fasolo Win32 compilation problems... 85836 by: Frédéric Vissault function that extracts numbers from a string 85838 by: DigitalKoala 85839 by: Andrey Hristov Getting the data for MySQL and then putting it back with PHP - at a loss! 85842 by: Michael Romagnoli 85844 by: george Pitcher 85845 by: Andrey Hristov 85848 by: Michael Romagnoli 85849 by: Michael Romagnoli Bad char Translation 85846 by: -oOo HONU oOo- Re: XML compliance with forms and trans_sid whenusing sessions 85847 by: James Nord Next and Preview Row 85850 by: Mark Lo 85851 by: Chris Boget 85853 by: Andrey Hristov 85854 by: Raymond Gubala 85855 by: Chris Boget sanity check - apache/php module safe implementation 85852 by: Dave 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--- Ok not really a problem, but more of a.. Well I will let you judge :) When cookies are disabled in a browser my site shows the url: http://www.whatever.com/index.php?sname=3432432432432432432 etc etc but when I have cookies enabled it shows http://www.whatever.com/index.php? Which is fine and it works great, but I don't care much for the '?' at the end of the url just for aesthetics sake :) Anyone know a workaround for this? Cheers! Rick I haven't failed, I've found 10,000 ways that don't work. - Ben Franklin ---End Message--- ---BeginMessage--- I was wondering if there's any way to display a value to the user that keeps changing? I know about flush(), but that just prints it out before the script ends, but doesn't display it in one place. Is there a way? ---End Message--- ---BeginMessage--- Hi! You could use a plain form and JavaScript to do this. It's fairly simple and it makes for nice little progress bars and graphs and other 'realtime' info. A few tips: - first output the form (completely) - use *implicit* flushing when outputting your JS. - use a new SCRIPT .. /SCRIPT part every time you sent commands (for Netscape) - do all calculations and stuff in PHP, minimize your JS code to something like echo(document.myform.mytext.value = ' . addslashes($newval) . ';\n); - try to do updates 'smartly', i.e. on when the values *really* change, and not with infinite speed. bvr. On Thu, 21 Feb 2002 23:00:30 -0500, Leif K-Brooks wrote: I was wondering if there's any way to display a value to the user that keeps changing? I know about flush(), but that just prints it out before the script ends, but doesn't display it in one place. Is there a way? ---End Message--- ---BeginMessage--- Hi All, I am able to call parent functions ok, but can't seem to be able to reference its variables from a child class. How does a child call a member variable of it's parent in php? Cheers, Brad ---End Message--- ---BeginMessage--- How about I answer my own question :) Same as you reference a member variable when its declared within the child. I had another problem that was causing me to think differently. Amazing what a little RTFM time can do. Sorry to annoy. Cheers, Brad -Original Message- From: Bradley Goldsmith [mailto:[EMAIL PROTECTED]] Sent: Friday, 22 February 2002 3:02 PM To: [EMAIL
Re: [PHP] Re: difference between php3 and php4
This error comes when trying to fetch data from a result set but there is no such because there was a problem with the query. Try var_dump($res) and you will see - 0. 0 is not a valid number for resource of type mysql or any other resource. To prevent this every time when using a resource identificator do : if ($res){ ... }else{ echo something went wrong;;} I think the problem is etiher the sql query is not successful or php cannot connect to the mysql. $db = mysql_connect(localhost, , ); the username is empty?? Regards, Andrey Hristov - Original Message - From: Todor Stoyanov [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Friday, February 22, 2002 6:12 PM Subject: [PHP] Re: difference between php3 and php4 You must first get the number of record set rows. The warning is because you trying to fetch a non existing row. Toni Baker [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Warning: Supplied argument is not a valid MySQL result resource in c:\program files\apache group\apache\cgi-bin\emp.php3 on line 10 $db = mysql_connect(localhost, , ); mysql_select_db(employee,$db); $result = mysql_query(SELECT * FROM employees,$db); echo table border=0; echo tr; echo td bgcolor=#FAFOE6 colspan=2BName/B/td; echo td bgcolor=#FAFOE6BAddress/B/td; echo td bgcolor=#FAFOE6BPosition/B/td; echo /tr; while($row = mysql_fetch_row($result)) { $fname = $row[1]; $lname = $row[2]; $address = $row[3]; $position = $row[4]; echo tr bgcolor=#C6E7DE; echo td$fname/td; echo td$lname/td; echo td$address/td; echo td$position/td; echo /tr; } This script works in php3 but not in windows php4. The error message above points to the mysql_fetch_row function. Does this function work differently in php4? If not, what else might cause this script to work in php3 and not in php4? __ Do You Yahoo!? Yahoo! Sports - Coverage of the 2002 Olympic Games http://sports.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Re: difference between php3 and php4
The warning means the query failed in mysql. Perhaps it failed in the connect. You do not need the number of rows. To determine what the problem is, ALWAYS include a die() clause: $db = mysql_connect(localhost, , ) or die(Error: .mysql_error()); mysql_select_db(employee,$db) or die(Error: .mysql_error()); $result = mysql_query(SELECT * FROM employees,$db) or die(Error: .mysql_error()); -Original Message- From: Todor Stoyanov [mailto:[EMAIL PROTECTED]] Sent: Friday, February 22, 2002 10:13 AM To: [EMAIL PROTECTED] Subject: [PHP] Re: difference between php3 and php4 You must first get the number of record set rows. The warning is because you trying to fetch a non existing row. Toni Baker [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Warning: Supplied argument is not a valid MySQL result resource in c:\program files\apache group\apache\cgi-bin\emp.php3 on line 10 $db = mysql_connect(localhost, , ); mysql_select_db(employee,$db); $result = mysql_query(SELECT * FROM employees,$db); echo table border=0; echo tr; echo td bgcolor=#FAFOE6 colspan=2BName/B/td; echo td bgcolor=#FAFOE6BAddress/B/td; echo td bgcolor=#FAFOE6BPosition/B/td; echo /tr; while($row = mysql_fetch_row($result)) { $fname = $row[1]; $lname = $row[2]; $address = $row[3]; $position = $row[4]; echo tr bgcolor=#C6E7DE; echo td$fname/td; echo td$lname/td; echo td$address/td; echo td$position/td; echo /tr; } This script works in php3 but not in windows php4. The error message above points to the mysql_fetch_row function. Does this function work differently in php4? If not, what else might cause this script to work in php3 and not in php4? __ Do You Yahoo!? Yahoo! Sports - Coverage of the 2002 Olympic Games http://sports.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] overwriting PHP_SELF and PHP_AUTH_xxxx
Forgive me if I'm treating pseudo as real but surely print trtd ... value='$cancel[$or]' ... /td; should be print trtd ... value='{$cancel[$or]}' ... /td; same goes for the array element in the sql statement Tim Ward Internet chess www.chessish.com http://www.chessish.com -- From: Michael Romagnoli [SMTP:[EMAIL PROTECTED]] Sent: 22 February 2002 12:21 To: [EMAIL PROTECTED] Subject: Re: [PHP] overwriting PHP_SELF and PHP_AUTH_ I have a special set of information retrieved from a while loop that I would like a person to be able to edit and send back into a MySQL table. I know all of the basic MySQL commands for doing such, but the PHP side to get the input from the form to go in is really stumping me. This is what I have: - $or = 0; while($or $orderidrows) { $orderinfo = mysql_fetch_row($orderidinfo); $domain[$or] = $orderinfo[2]; $cancel[$or] = $orderinfo[3]; print trtdfont size=2 face=Arial $domain[$or]/font/tdtdfont size=2 face=ArialCancel This Domain?/font/tdtdfont size=2 face=Arialinput type=text name=confirm value='$cancel[$or]' size=3/font/td; $or++; } -- The values/data I would normally insert into the MySQL from the form would be $confirm, based on $domain - however, in this case, I have a number of rows with the same name. I've received help as far as distinguishing one row from another - thanks. :) The problem I am really having is trying to insert the data back into one particular table. You see, when I select the data, I get multiple orderid's with multiple domains attached to them. When I try to UPDATE the MySQL with the data, only the last orderid seems to be the one getting updated. And, to boot, I want to update based on the domain name (since that is unique) and ignore the orderids. I only used the orderids to pull the data out. So, I've been using a query like this in a loop; $update = UPDATE table2 SET cancel='$cancel[$a]' WHERE domain = $domain[$a] Any suggestions? I'm getting pretty desparate here! :\ Thanks, -Mike -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP-4.1.1 and freetype 2
Thanks Rasmus... You have pointed me in the right directionupon further inspection of my config.status I see that gdImageStringFTEX=no, and looking in the config.log I found... configure:21579: checking for gdImageStringFTEx in -lgd configure:21598: gcc -o onftest -g -O2 -D_POSIX_PTHREAD_SEMANTICS -R/usr/ucblib -L/usr/ucblib -R/u sr/local/lib/gcc-lib/sparc-sun-solaris2.8/2.95.2 -L/usr/local/lib/gcc-lib/sp arc-sun-solaris2.8/2.95.2 -R/usr/local/lib -L/usr/local/lib onftest.c -lgd -lgd -lfreetype -lX11 -lXpm -lpng -lz -ljpeg -lz -lcrypt -lr esolv -lresolv -lresolv -lm -ldl -lsocket -lsocket -lgcc -lcrypt 15 /var/tmp/cczf3W7n.o: In function `main': /export/home/APACHE_SOURCE/php-4.1.1/configure:21594: undefined reference to `gdImageStringFTEx' collect2: ld returned 1 exit status configure: failed program was: #line 21587 configure #include confdefs.h /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char gdImageStringFTEx(); int main() { gdImageStringFTEx() ; return 0; } So I think I have to step back to the gd install and see what happenedbut honestly, I don't know what to try..in the gd makefile I have: CFLAGS=-g -DHAVE_LIBPNG -DHAVELIBJPG -DHAVE_LIBFREETYPE LIBS=-lgd -lpng -lz -ljpeg -lfreetype -lm INCLUDEDIRS=-I. -I/usr/local/include -I/usr/local/include/freetype2 -I/usr/i nclude/X11 -I/usr/X11R6/include/X11 LIBDIRS=-L/usr/local/lib -L/usr/lib/X11 -L/usr/X11R6/lib -L/usr/lib Did I miss something...Is my INCLUDEDIRS correct for the freetype 2.. (freetype-config --cflags returns -I/usr/local/include -I/usr/local/include/freetype2).. I appreciate all your help.. Ernie Rasmus Lerdorf [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Are you trying to draw TTF fonts on a truecolor image? If so, GD-2.0.1 has a bug which turns of anti-aliasing of the fonts in that case. GD-2.0.2 will have the fix. For now, try it with a non-truecolor image and I bet the font will look just fine. You can also ask Wes Furlong nicely for the patch which fixes this bug in GD 2. In order for ImageFTText() to work you have to make sure that HAVE_LIBGD20, HAVE_LIBFREETYPE and HAVE_GD_STRINGFTEX are all defined in your php_config.h In order to get that use configure flags like these: --with-gd=/home/rasmus/gd-2.0.1 --with-jpeg-dir=/usr --with-freetype-dir=/usr --enable-gd-native-ttf --enable-gd-imgstrttf --with-png-dir=/usr Also, never put lib in a configure flag. If Freetype is somewhere under /usr/local, then use --with-freetype-dir=/usr/local Don't put /usr/local/lib or the header files will not be found since they are likely not somewhere under /usr/local/lib -Rasmus On Thu, 21 Feb 2002, Ernie Dipko wrote: Can't figure out where I am going wrong... I cant seem to use the imagefttext function in PHP..it returns a warning saying No FreeType 2 support in this PHP build. The configure, make, and make install of all programs complete without error and ImageTTFText() works (but the fonts do not look all that good), I just cant seam to use ImageFTText(). I am using: Solaris 8 Gd-2.0.1 Freetype-2.0.8 Php-4.1.1 Apache_1.3.22 Here is my php configure command.(from config.nice) #! /bin/sh # # Created by configure './configure' \ '--with-xml' \ '--with-mysql=/usr/local/mysql' \ '--with-apache=../apache_1.3.22' \ '--enable-track-vars' \ '--enable-sockets' \ '--enable-bcmath' \ '--with-gd' \ '--enable-gd-native-ttf' \ '--with-ttf=no' \ '--with-freetype-dir=/usr/local/lib' \ '--with-jpeg-dir=/usr/local/lib' \ '--with-png-dir=/usr/local/lib' \ '--with-zlib-dir=/usr/local/lib' \ '--with-xpm-dir=/usr/local/lib' \ $@ I have looked at many news posts, search engines, web pages, etc. and have seen a lot of problems mentioning the freetype is not compiled into gd...but that is not the problem I am having I did do some of the suggestions from these sources, just to try them, but the problem remains. I Have tried changing --with-freetype-dir=/usr/local/lib to /usr/local/, Also tried -enable-gd-native-tt for a bug fix, I think form php-4.0.6... I don't wat to beg, butPLEASE HELP!!! Ernie Dipko -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Uploading Files with PHP
Hi Jim, here's how I do it. I test for the file size on the processing page as well, if it's too large I redraw out the upload form. //test for file extension type if needed //determine file size -- if too big ( greater 50kb) then redirect $siz = filesize($userfile); if ($siz = 51200){ //redraw upload form print font face='verdana' size='2' class='text_size_9'The photo you attempted to upload was too large in file size. Please ensure that the file size does not exceed 50kb./font; print form method='POST' action='photoupload.php' enctype='multipart/form-data'input type='hidden' name='MAX_FILE_SIZE' value='51200' input type='file' name='userfile' size='15' style='font-family: Verdana; font-size: 8pt;'input type='submit' name='submit' value='Upload' style='font-family: Verdana; font-size: 8pt;'; print /form; } elseif ($siz 51200) { $timestamp = time(); $userfile_name = $timestamp.$userfile_name ; // copy the file being posted if(copy($userfile, /dir/dir/pics/. $userfile_name)){ print font face='verdana' size='2' class='text_size_9'Your photo has been uploaded and is viewable in the photo gallery./fontbrbr ; } else { print font face='verdana' size='2' class='text_size_9'A problem was encountered during your photo upload./fontbr; } $patharola = pics/. $userfile_name; //connect to db $connectionToDBid = odbc_connect(dgsff, sdgsdfg, sdfgsdfg); //create query statement $sqlr = INSERT INTO PHOTO (golferid, photo, caption, datesubmitted) VALUES ('$sesgolferid' , '$patharola', '$caption', '$todaysdate' ); //execute the sql statement (query) on the connection made $resultset = odbc_do($connectionToDBid, $sqlr); blah blah blah ... Hope this helps you out, Joe :) Jim Koutoumis [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Joe, Do you know when the file size is checked ?? I think it only gets checked after the form is posted and file uploading is finished ?? I don't know how it's possible to catch things before user uploads - now that would be neat :-) Jim. Lerp [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Hi there :) Did you set a max file size in your upload form? See my form below, notice the 'MAX_FILE_SIZE' value='102400' part within hidden field. This should appear before the rest of the form. You can adjust this value as you wish. form action='resumeupload.php' method='post' enctype='multipart/form-data' input type='hidden' name='MAX_FILE_SIZE' value='102400' font color='#663399' face='verdana' size=2bUpload Resume:/b/font input type='file' name='userfile' style='background-color: #FF; font-family: verdana; font-weight: bold; color: #FF; font-size: 9pt;' input type='submit' value='Upload!!!' style='background-color: #FF; font-family: verdana; font-weight: bold; color: #FF; font-size: 9pt;' name=submit /form Hope this helps, Joe :) Chuck Pup Payne [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Hi, I am trying to set a small script that would let my clients upload file with a Explorer or Netscape, but the problem is it would let me upload any file that is great than a 1MB. We get an error that the file none could not be read. I have set the upload_tmp_dir=/tempupload is has been chmod to 777, php.ini as been set to 20MB, I know that is a lot but we are engingeering company that work with CADD files. Any clues where to look? The PHP 4 Bible from IDG states that we have to under HTTP uploads, but nothing else. Is there some where on the net that explains better what I have to set up, turn on, or haven't done? Thanks, Chuck -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] imagecreate with Windows .exe installer
php4 installed with Apache on Windows ME, using as localhost. I am trying to use imagecreate with a version of php4 that was installed with the binary .exe installer, php seems to be installed OK. I have changed the .ini file line: ;extension=php_gd.dll To extension=php_gd.dll But I get an error of: Fatal error: call to undefined function: imagecreate() in c:directory Has anyone any idea what the problem is here? Thanks Mike
[PHP] Online Billing System
Hello, I'm looking for a good online billing system, something that offers reocurring billing, announcements, online invoice viewing, and the works. I would prefer something in php with mysql backend. What do you recommend? Thanks for your help. -john __John Monfort_ _+---+_ P E P I E D E S I G N S www.pepiedesigns.com The world is waiting, are you ready? -+___+- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] imagecreate with Windows .exe installer
You need to have that dll installed on your system. You need to download php-version.zip file that contains all of the dlls in it to run with. Ray Hunter Firmware Engineer ENTERASYS NETWORKS -Original Message- From: Mike Brackenridge [mailto:[EMAIL PROTECTED]] Sent: Friday, February 22, 2002 10:01 AM To: [EMAIL PROTECTED] Subject: [PHP] imagecreate with Windows .exe installer php4 installed with Apache on Windows ME, using as localhost. I am trying to use imagecreate with a version of php4 that was installed with the binary .exe installer, php seems to be installed OK. I have changed the .ini file line: ;extension=php_gd.dll To extension=php_gd.dll But I get an error of: Fatal error: call to undefined function: imagecreate() in c:directory Has anyone any idea what the problem is here? Thanks Mike
[PHP] Re: function that extracts numbers from a string
look on php.net for preg_replace and functions like that, they use regular expressions to replace characters Digitalkoala [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Hi folks, Is there a function that extracts numbers from a string? I can do this with ereg but it's quite slow when you have a long list of variables to get through... thanks! dk -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] imagecreate with Windows .exe installer
Did you restarted the Apache service? Regards, Andrey Hristov - Original Message - From: Mike Brackenridge [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Friday, February 22, 2002 7:00 PM Subject: [PHP] imagecreate with Windows .exe installer php4 installed with Apache on Windows ME, using as localhost. I am trying to use imagecreate with a version of php4 that was installed with the binary .exe installer, php seems to be installed OK. I have changed the .ini file line: ;extension=php_gd.dll To extension=php_gd.dll But I get an error of: Fatal error: call to undefined function: imagecreate() in c:directory Has anyone any idea what the problem is here? Thanks Mike -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] resolving php tags in a string
I have a question: I normally use include to include a file, which often has php tags that are then interpreted and resolved. However, in one case I am reading a text file into a string (fread), then running nl2br() on it to present it (with an echo command). However, I wish to also resolve any php tags, which obviously aren't in this case and are just presented in the browser as plain text. What's the best way to solve this one? First thought was to write it to a temporary file and then call an include on that, but that sounds plain bad. neko -- The secret of genius is to carry the spirit of the child into old age, which means never losing your enthusiasm. -- Aldous Leonard Huxley -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] resolving php tags in a string
get all from the string which is between the tags and use the substring with eval(); Best regards, Andrey Hristov - Original Message - From: neko [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Friday, February 22, 2002 5:42 AM Subject: [PHP] resolving php tags in a string I have a question: I normally use include to include a file, which often has php tags that are then interpreted and resolved. However, in one case I am reading a text file into a string (fread), then running nl2br() on it to present it (with an echo command). However, I wish to also resolve any php tags, which obviously aren't in this case and are just presented in the browser as plain text. What's the best way to solve this one? First thought was to write it to a temporary file and then call an include on that, but that sounds plain bad. neko -- The secret of genius is to carry the spirit of the child into old age, which means never losing your enthusiasm. -- Aldous Leonard Huxley -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP-4.1.1 and freetype 2
Perhaps you have another libgd on your system that the -lgd in that test program is picking up? On Fri, 22 Feb 2002, Ernie Dipko wrote: Thanks Rasmus... You have pointed me in the right directionupon further inspection of my config.status I see that gdImageStringFTEX=no, and looking in the config.log I found... configure:21579: checking for gdImageStringFTEx in -lgd configure:21598: gcc -o onftest -g -O2 -D_POSIX_PTHREAD_SEMANTICS -R/usr/ucblib -L/usr/ucblib -R/u sr/local/lib/gcc-lib/sparc-sun-solaris2.8/2.95.2 -L/usr/local/lib/gcc-lib/sp arc-sun-solaris2.8/2.95.2 -R/usr/local/lib -L/usr/local/lib onftest.c -lgd -lgd -lfreetype -lX11 -lXpm -lpng -lz -ljpeg -lz -lcrypt -lr esolv -lresolv -lresolv -lm -ldl -lsocket -lsocket -lgcc -lcrypt 15 /var/tmp/cczf3W7n.o: In function `main': /export/home/APACHE_SOURCE/php-4.1.1/configure:21594: undefined reference to `gdImageStringFTEx' collect2: ld returned 1 exit status configure: failed program was: #line 21587 configure #include confdefs.h /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char gdImageStringFTEx(); int main() { gdImageStringFTEx() ; return 0; } So I think I have to step back to the gd install and see what happenedbut honestly, I don't know what to try..in the gd makefile I have: CFLAGS=-g -DHAVE_LIBPNG -DHAVELIBJPG -DHAVE_LIBFREETYPE LIBS=-lgd -lpng -lz -ljpeg -lfreetype -lm INCLUDEDIRS=-I. -I/usr/local/include -I/usr/local/include/freetype2 -I/usr/i nclude/X11 -I/usr/X11R6/include/X11 LIBDIRS=-L/usr/local/lib -L/usr/lib/X11 -L/usr/X11R6/lib -L/usr/lib Did I miss something...Is my INCLUDEDIRS correct for the freetype 2.. (freetype-config --cflags returns -I/usr/local/include -I/usr/local/include/freetype2).. I appreciate all your help.. Ernie Rasmus Lerdorf [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Are you trying to draw TTF fonts on a truecolor image? If so, GD-2.0.1 has a bug which turns of anti-aliasing of the fonts in that case. GD-2.0.2 will have the fix. For now, try it with a non-truecolor image and I bet the font will look just fine. You can also ask Wes Furlong nicely for the patch which fixes this bug in GD 2. In order for ImageFTText() to work you have to make sure that HAVE_LIBGD20, HAVE_LIBFREETYPE and HAVE_GD_STRINGFTEX are all defined in your php_config.h In order to get that use configure flags like these: --with-gd=/home/rasmus/gd-2.0.1 --with-jpeg-dir=/usr --with-freetype-dir=/usr --enable-gd-native-ttf --enable-gd-imgstrttf --with-png-dir=/usr Also, never put lib in a configure flag. If Freetype is somewhere under /usr/local, then use --with-freetype-dir=/usr/local Don't put /usr/local/lib or the header files will not be found since they are likely not somewhere under /usr/local/lib -Rasmus On Thu, 21 Feb 2002, Ernie Dipko wrote: Can't figure out where I am going wrong... I cant seem to use the imagefttext function in PHP..it returns a warning saying No FreeType 2 support in this PHP build. The configure, make, and make install of all programs complete without error and ImageTTFText() works (but the fonts do not look all that good), I just cant seam to use ImageFTText(). I am using: Solaris 8 Gd-2.0.1 Freetype-2.0.8 Php-4.1.1 Apache_1.3.22 Here is my php configure command.(from config.nice) #! /bin/sh # # Created by configure './configure' \ '--with-xml' \ '--with-mysql=/usr/local/mysql' \ '--with-apache=../apache_1.3.22' \ '--enable-track-vars' \ '--enable-sockets' \ '--enable-bcmath' \ '--with-gd' \ '--enable-gd-native-ttf' \ '--with-ttf=no' \ '--with-freetype-dir=/usr/local/lib' \ '--with-jpeg-dir=/usr/local/lib' \ '--with-png-dir=/usr/local/lib' \ '--with-zlib-dir=/usr/local/lib' \ '--with-xpm-dir=/usr/local/lib' \ $@ I have looked at many news posts, search engines, web pages, etc. and have seen a lot of problems mentioning the freetype is not compiled into gd...but that is not the problem I am having I did do some of the suggestions from these sources, just to try them, but the problem remains. I Have tried changing --with-freetype-dir=/usr/local/lib to /usr/local/, Also tried -enable-gd-native-tt for a bug fix, I think form php-4.0.6... I don't wat to beg, butPLEASE HELP!!! Ernie Dipko -- 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] php3/php4 difference
$numresult=mysql_query($sql) or die( 4 QUERY ERR $sql); echo numresult = $numresult; $numrows=mysql_num_rows($numresult); mysql_free_result($numresult); echo P align='left'You have selected .$numrows . record(s).; When I run the script above on php4 windows I get the following result: numresult = Resource id #2 You have selected 0 record(s). When I run the script above on php3 linux I get the following result: numresult = 2 You have selected 1382 record(s). Why do I get two different values for $numresult? Thanks __ Do You Yahoo!? Yahoo! Sports - Coverage of the 2002 Olympic Games http://sports.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Uploading Files with PHP
Ammendment: Actually, I was just looking at one of my photoupload processes and I actually removed the MAX_FILE out of the upload form and only tested the file size on the processing page like in the previous message. Cheers, Joe :) Lerp [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Hi Jim, here's how I do it. I test for the file size on the processing page as well, if it's too large I redraw out the upload form. file://test for file extension type if needed file://determine file size -- if too big ( greater 50kb) then redirect $siz = filesize($userfile); if ($siz = 51200){ file://redraw upload form print font face='verdana' size='2' class='text_size_9'The photo you attempted to upload was too large in file size. Please ensure that the file size does not exceed 50kb./font; print form method='POST' action='photoupload.php' enctype='multipart/form-data'input type='hidden' name='MAX_FILE_SIZE' value='51200' input type='file' name='userfile' size='15' style='font-family: Verdana; font-size: 8pt;'input type='submit' name='submit' value='Upload' style='font-family: Verdana; font-size: 8pt;'; print /form; } elseif ($siz 51200) { $timestamp = time(); $userfile_name = $timestamp.$userfile_name ; // copy the file being posted if(copy($userfile, /dir/dir/pics/. $userfile_name)){ print font face='verdana' size='2' class='text_size_9'Your photo has been uploaded and is viewable in the photo gallery./fontbrbr ; } else { print font face='verdana' size='2' class='text_size_9'A problem was encountered during your photo upload./fontbr; } $patharola = pics/. $userfile_name; file://connect to db $connectionToDBid = odbc_connect(dgsff, sdgsdfg, sdfgsdfg); file://create query statement $sqlr = INSERT INTO PHOTO (golferid, photo, caption, datesubmitted) VALUES ('$sesgolferid' , '$patharola', '$caption', '$todaysdate' ); file://execute the sql statement (query) on the connection made $resultset = odbc_do($connectionToDBid, $sqlr); blah blah blah ... Hope this helps you out, Joe :) Jim Koutoumis [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Joe, Do you know when the file size is checked ?? I think it only gets checked after the form is posted and file uploading is finished ?? I don't know how it's possible to catch things before user uploads - now that would be neat :-) Jim. Lerp [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Hi there :) Did you set a max file size in your upload form? See my form below, notice the 'MAX_FILE_SIZE' value='102400' part within hidden field. This should appear before the rest of the form. You can adjust this value as you wish. form action='resumeupload.php' method='post' enctype='multipart/form-data' input type='hidden' name='MAX_FILE_SIZE' value='102400' font color='#663399' face='verdana' size=2bUpload Resume:/b/font input type='file' name='userfile' style='background-color: #FF; font-family: verdana; font-weight: bold; color: #FF; font-size: 9pt;' input type='submit' value='Upload!!!' style='background-color: #FF; font-family: verdana; font-weight: bold; color: #FF; font-size: 9pt;' name=submit /form Hope this helps, Joe :) Chuck Pup Payne [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Hi, I am trying to set a small script that would let my clients upload file with a Explorer or Netscape, but the problem is it would let me upload any file that is great than a 1MB. We get an error that the file none could not be read. I have set the upload_tmp_dir=/tempupload is has been chmod to 777, php.ini as been set to 20MB, I know that is a lot but we are engingeering company that work with CADD files. Any clues where to look? The PHP 4 Bible from IDG states that we have to under HTTP uploads, but nothing else. Is there some where on the net that explains better what I have to set up, turn on, or haven't done? Thanks, Chuck -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Apache 2.0.32 + PHP from CVS not working
From the list, the APR API is done. So there should be no further issues getting it to work.(As in, you should no longer have to jump through hoops every month or release, just to keep up with apr). Well, this is simply not true. Things are still changing. -Rasmus -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] JaneBUILDER
Does anyone have any experience with JaneBUILDER? http://www.seejanecode.com It looks quite interesting and I was wondering what other people thought of it? Rick I will permit no man to narrow and degrade my soul by making me hate him. - Booker T. Washington -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] random question
this is slightly o-t, but does anyone live in/near DC or the surrounding areas that i could ask questions of? thanks. robert
[PHP] php 4.1.1 vs 4.0.6
Guys, I need to upgrade a server with 4.0.3 server because of some new ldap features that I need. I am deciding between 4.0.6 and 4.1.1 (or maybe 4.1.2 if it's comming soon). I heard that there is some significant difference between 4.0.x and 4.1.x What is the main difference between 4.0.6 and 4.1.1 ? Are the 4.1.x completely backward compatible with 4.0.x? Thanks, Ezra Nugroho Web/Database Application Specialist Goshen College ITS Phone: (574) 535-7706 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Guestbook question
I have a really simple guestbook that allows someone to post to the book, then it displays all the entries. Well, there are too many entries now for just one page and it looks kinda wacky, so I wanted to do something where it only displays 10 entries per page, then there are links for pages say 11-20, 21-30, etc. I have no idea how to do this - I only know how to limit the number of entries per page. So, the script that displays all the entries looks something like this: $counter = 0; $result = mysql_query(select name, post from guestbook order by id desc, $db); while (($myrow = mysql_fetch_row($result)) ($counter 10)) { echo TRTD$myrow[0]/TD/TR\n; echo TRTD$myrow[1]/TD/TR\n; ++$counter; } Well, that shows only the latest 10 alright, but what if I wanted to show entries 11-20? I figure I could get the number of posts through mysql_num_rows, I just can't piece it all together. Any suggestions would be really helpful. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Sendmail, I've had enough of it!
I had suffered a little bit with sendmail myself last week. It took me some reading, and I got it working the second day. Here is a useful link: http://www.samag.com/documents/s=1168/sam0002f/0002f.htm Also, check out the book titled Essential System Administration. That should be all you need -- if you decide to setup sendmail... :) --- Liam MacKenzie [EMAIL PROTECTED] wrote: ARGH!!! I'm seriously sick of this! I've spent days on end reading documentation, trying settings, seeking help, and it still won't bloody work! So I've taken the ultimate step, and applied the trusty rm -rf command to everything that has to do with sendmail! In other words, sendmail is no longer on my systems. Screw it, causes more bad than good! Ok, now surprisingly enough I do have a final question regarding PHP/Mail (And I mean final!) How can I get PHP to send mail through a local SMTP server? I'm running Linux RedHat 7.1, latest Apache and PHP. I have eXtremail installed locally. It's a POP3/SMTP server. Works fine - fact. There's 3 configuration options in php.ini that I've been playing with, no matter what the combination is, I don't really see it doing anything different. I've read everything relevant on php.net and still can't find anything. I'm sorry if this is a really stupid question. Thanks s much for all your help! Liam = Anas Mughal [EMAIL PROTECTED] [EMAIL PROTECTED] Tel: 973-249-6665 __ Do You Yahoo!? Yahoo! Sports - Coverage of the 2002 Olympic Games http://sports.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Sendmail, I've had enough of it!
Go with QMAIL Lots of support (mailing lists, web-sites). Several books written on it. Easier to set-up than sendmail. Very configurable. Written by same gent that wrote ezmlm mailing list application (ezmlm handles the PHP mailing lists). goto: http://cr.yp.to/qmail.html -Original Message- From: Anas Mughal [mailto:[EMAIL PROTECTED]] Sent: Friday, February 22, 2002 1:41 PM To: Liam MacKenzie; [EMAIL PROTECTED] Subject: Re: [PHP] Sendmail, I've had enough of it! I had suffered a little bit with sendmail myself last week. It took me some reading, and I got it working the second day. Here is a useful link: http://www.samag.com/documents/s=1168/sam0002f/0002f.htm Also, check out the book titled Essential System Administration. That should be all you need -- if you decide to setup sendmail... :) --- Liam MacKenzie [EMAIL PROTECTED] wrote: ARGH!!! I'm seriously sick of this! I've spent days on end reading documentation, trying settings, seeking help, and it still won't bloody work! So I've taken the ultimate step, and applied the trusty rm -rf command to everything that has to do with sendmail! In other words, sendmail is no longer on my systems. Screw it, causes more bad than good! Ok, now surprisingly enough I do have a final question regarding PHP/Mail (And I mean final!) How can I get PHP to send mail through a local SMTP server? I'm running Linux RedHat 7.1, latest Apache and PHP. I have eXtremail installed locally. It's a POP3/SMTP server. Works fine - fact. There's 3 configuration options in php.ini that I've been playing with, no matter what the combination is, I don't really see it doing anything different. I've read everything relevant on php.net and still can't find anything. I'm sorry if this is a really stupid question. Thanks s much for all your help! Liam = Anas Mughal [EMAIL PROTECTED] [EMAIL PROTECTED] Tel: 973-249-6665 __ Do You Yahoo!? Yahoo! Sports - Coverage of the 2002 Olympic Games http://sports.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Miliseconds with PHP4
Hello there, I want to know the execution time of some scripts I made, I'm using the difference of seconds (time() function) between the start and the end of the script. But, I would like to get a greater precision... so, I was wondering if there is a chance to get miliseconds. TIA William _ Do You Yahoo!? Get your free @yahoo.com address at http://mail.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Sendmail, I've had enough of it!
Ha, I shouldn't even bother posting this as it's pretty irrelevant for this list but... forget qmail, go with Postfix :) Qmail doesn't have one centralized config file, and it gets annoying having to edit this one, then this one, then make this file, etc. Plus, I usually try to avoid Dan Bernstein projects! On Friday 22 February 2002 11:51 am, you wrote: Go with QMAIL Lots of support (mailing lists, web-sites). Several books written on it. Easier to set-up than sendmail. Very configurable. Written by same gent that wrote ezmlm mailing list application (ezmlm handles the PHP mailing lists). goto: http://cr.yp.to/qmail.html -Original Message- From: Anas Mughal [mailto:[EMAIL PROTECTED]] Sent: Friday, February 22, 2002 1:41 PM To: Liam MacKenzie; [EMAIL PROTECTED] Subject: Re: [PHP] Sendmail, I've had enough of it! I had suffered a little bit with sendmail myself last week. It took me some reading, and I got it working the second day. Here is a useful link: http://www.samag.com/documents/s=1168/sam0002f/0002f.htm Also, check out the book titled Essential System Administration. That should be all you need -- if you decide to setup sendmail... :) --- Liam MacKenzie [EMAIL PROTECTED] wrote: ARGH!!! I'm seriously sick of this! I've spent days on end reading documentation, trying settings, seeking help, and it still won't bloody work! So I've taken the ultimate step, and applied the trusty rm -rf command to everything that has to do with sendmail! In other words, sendmail is no longer on my systems. Screw it, causes more bad than good! Ok, now surprisingly enough I do have a final question regarding PHP/Mail (And I mean final!) How can I get PHP to send mail through a local SMTP server? I'm running Linux RedHat 7.1, latest Apache and PHP. I have eXtremail installed locally. It's a POP3/SMTP server. Works fine - fact. There's 3 configuration options in php.ini that I've been playing with, no matter what the combination is, I don't really see it doing anything different. I've read everything relevant on php.net and still can't find anything. I'm sorry if this is a really stupid question. Thanks s much for all your help! Liam = Anas Mughal [EMAIL PROTECTED] [EMAIL PROTECTED] Tel: 973-249-6665 __ Do You Yahoo!? Yahoo! Sports - Coverage of the 2002 Olympic Games http://sports.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] PRE-formated text into DATABASE
Hi there, I'm tryng to make an online form which update the content of a database. I have tried it and it works BUT the user has to include all of the HTML tags otherwise the text which is pulled out (displayed on the webpage) from the database loose the pre-formated form. All the paragraphs are gone... and everything is just in one line. I'm just wondering if there is another way to preserve a pre-formated text (for example from Ms Word) that the user put into the form and the insert into the database without including the HTML tags. thanks. regards, Dani -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Miliseconds with PHP4
seach the manual for microtime() -Original Message- From: William Lovaton [mailto:[EMAIL PROTECTED]] Sent: Friday, February 22, 2002 2:56 PM To: [EMAIL PROTECTED] Subject: [PHP] Miliseconds with PHP4 Hello there, I want to know the execution time of some scripts I made, I'm using the difference of seconds (time() function) between the start and the end of the script. But, I would like to get a greater precision... so, I was wondering if there is a chance to get miliseconds. TIA William _ Do You Yahoo!? Get your free @yahoo.com address at http://mail.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Miliseconds with PHP4
microtime() ? -- R'twick Niceorgaw E-Mail: [EMAIL PROTECTED] Tel: 617-761-3936 (W) 732-801-3826 (C) 617-328-6423 (R) -- - Original Message - From: William Lovaton [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Friday, February 22, 2002 2:56 PM Subject: [PHP] Miliseconds with PHP4 Hello there, I want to know the execution time of some scripts I made, I'm using the difference of seconds (time() function) between the start and the end of the script. But, I would like to get a greater precision... so, I was wondering if there is a chance to get miliseconds. TIA William _ Do You Yahoo!? Get your free @yahoo.com address at http://mail.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Miliseconds with PHP4
how out of interest ? Hello there, I want to know the execution time of some scripts I made, I'm using the difference of seconds (time() function) between the start and the end of the script. But, I would like to get a greater precision... so, I was wondering if there is a chance to get miliseconds. TIA William _ Do You Yahoo!? Get your free @yahoo.com address at http://mail.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Next and Preview Row
Good day, It should be pointed out that even with this syntax, the database will still scour all of the rows in the table. The only savings is that the database won't return all of these rows due to the limit statement. It might be more efficient to use min and max to determine which row in the database is before and after the desired row, and then only fetch those rows. This can easily done with subselects, but since MySQL does not support them one will have to use multiple queries to piece it together. Of course, if your table is small then this is mostly irrelevant anyway. It might also be worthwhile to note that this code can be made into one query with the UNION statement. However, MySQL doesn't support that part of SQL either (although the documentation says that it's provided in version 4.X ). Darren Gamble Planner, Regional Services Shaw Cablesystems GP 630 - 3rd Avenue SW Calgary, Alberta, Canada T2P 4L4 (403) 781-4948 -Original Message- From: Fournier Jocelyn [Presence-PC] [mailto:[EMAIL PROTECTED]] Sent: Friday, February 22, 2002 1:24 PM To: Chris Boget; Raymond Gubala; Mark Lo; [EMAIL PROTECTED]; [EMAIL PROTECTED] Subject: Re: [PHP] Next and Preview Row Yes, but how to get ONLY the 3 records you need ? Because often in an application, you don't care about the other records. In this case AFAIK, there is no other solution than issuing at least two queries : SELECT * FROM table WHERE field='ID00025' ORDER BY field DESC LIMIT 2 SELECT * FROM table WHERE field'ID00025' ORDER BY field ASC LIMIT 1 - Original Message - From: Chris Boget [EMAIL PROTECTED] To: Fournier Jocelyn [Presence-PC] [EMAIL PROTECTED]; Raymond Gubala [EMAIL PROTECTED]; Mark Lo [EMAIL PROTECTED]; [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Friday, February 22, 2002 9:17 PM Subject: Re: [PHP] Next and Preview Row It seems worst to me because in your case mysql has to retrieve all the rows. If it's a table with 1 million records or more, this should hurt ;) As I said, it was pseudo code. Now, imagine that you were just getting the records for a particular user? a particular application? Where there won't be millions and millions of rows? Chris - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] bbcode
I'm planning to make a forum built into my site. I know all of the forums have bbcode, and I doubt they all programmed it themselves. Is there somewhere I can get the code for bbcode? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Miliseconds with PHP4
I was looking for the same type of information a few weeks ago, I eventually found what I was looking for in the phpbb system. Here is the code that they used. //put right after your first opening PHP tag $mtime = microtime(); // page creation timers $mtime = explode( ,$mtime); $mtime = $mtime[1] + $mtime[0]; $starttime = $mtime; unset ($mtime); // put right before end of your page $mtime = microtime(); $mtime = explode( ,$mtime); $mtime = $mtime[1] + $mtime[0]; $endtime = $mtime; $totaltime = ($endtime - $starttime); printf(centerPage created in %f seconds./center, $totaltime); -Original Message- From: John Fishworld [mailto:[EMAIL PROTECTED]] Sent: Friday, February 22, 2002 1:23 PM To: William Lovaton; [EMAIL PROTECTED] Subject: Re: [PHP] Miliseconds with PHP4 how out of interest ? Hello there, I want to know the execution time of some scripts I made, I'm using the difference of seconds (time() function) between the start and the end of the script. But, I would like to get a greater precision... so, I was wondering if there is a chance to get miliseconds. TIA William _ Do You Yahoo!? Get your free @yahoo.com address at http://mail.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Finding Hostname of Browser Client.
I have a friend with a PhotoLibrary web site. I am trying to automate some of his work. I tried to create a PHP script/program? that would check for missing files and upload. I am testing on my laptop with loopback. It all works if I give the ftp routine that does the ftp_connect a hostname i.e. Localhost or the name of my machine. But if I use 127.0.0.1 it fails to connect. Ideally I would like to use $HTTP_REMOTE_ADDR to set the address but as it insist on the name I am stuck. Ideally I would like to run the script and have the ftp server on the machine that he uses to dial into the ISP i.e. Dynamically allocated IP address. I suspect that his ISP is not going to resolve an address to such a machine. Any ideas ? Thanks Keith -- Keith , Jenny Family Sloan [EMAIL PROTECTED] http://web.ukonline.co.uk/keith.sloan/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: php 4.1.1 vs 4.0.6
In article [EMAIL PROTECTED], [EMAIL PROTECTED] (Ezra Nugroho) wrote: I am deciding between 4.0.6 and 4.1.1 (or maybe 4.1.2 if it's comming soon). I heard that there is some significant difference between 4.0.x and 4.1.x What is the main difference between 4.0.6 and 4.1.1 ? Are the 4.1.x completely backward compatible with 4.0.x? http://www.php.net/release_4_1_0.php -- CC -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Array HELL!!!!
I don't know what it is but I am having a hell of a time trying to get some results of a query setup into an array or variable (too much of a newbie to know which) that can be passed to a confirmation page before deleting the record from a table. I have given up working on this but for those of you that want to finish it here is the code and the table structure... [Table Structure] id int(30) DEFAULT '0' NOT NULL auto_increment, car_type varchar(30), car_model varchar(30), car_year varchar(15), car_price varchar(15), car_vin varchar(25), dlr_num varchar(25), PRIMARY KEY (id) [Page 1 - Queries DB table for records] ?php require '../path/to/db.php'; $result = @mysql_query(SELECT * FROM cur_inv,$dbh) or die(Could not execute query, please try again later); echo table border=\0\ class=\table-body\ width=\100%\form name=\rem_inv\ method=\post\ action=\rem_conf.php3\ trtd align=\center\ colspan=\3\font size=\4\BCurrent Inventory/B/fonthr color=\33\/td/tr; $count = -1; while ($myrow = mysql_fetch_array($result)) { $id = $row[id]; $car_type = $row[car_type]; $car_model = $row[car_model]; $car_year = $row[car_year]; $car_price = $row[car_price]; $car_vin = $row[car_vin]; $count ++; echo trtd width=\30%\BType Of Car: /B/tdtd; printf(mysql_result($result,$count,car_type)); echo /tdtdinput type=\checkbox\ name=\id[]\ value=\.$myrow[id].\remove/td/tr\n; echo trtd width=\30%\BModel Of Car: /B/tdtd; printf(mysql_result($result,$count,car_model)); echo /td/tr\n; echo trtd width=\30%\BYear Of Car: /B/tdtd; printf(mysql_result($result,$count,car_year)); echo /td/tr\n; echo trtd width=\30%\BPrice Of Car: /B/tdtd$; printf(mysql_result($result,$count,car_price)); echo /td/tr\n; echo trtd width=\30%\BVIN Of Car: /B/tdtd; printf(mysql_result($result,$count,car_vin)); echo /td/trtrtd colspan=\3\hr color=\33\/td/tr\n; } echo trtdinput type=\submit\ name=\delete\ value=\delete\/td/tr/form/table; ? [Page 2 - Takes records and confirms which ones to be deleted] ?php print( table border=\0\ class=\table-body\ width=\100%\ form name=\rem_inv\ method=\post\ action=\done2.php3\ INPUT TYPE=\hidden\ NAME=\id\ VALUE=\$id\ INPUT TYPE=\hidden\ NAME=\car_type\ VALUE=\$car_type\ INPUT TYPE=\hidden\ NAME=\car_model\ VALUE=\$car_model\ INPUT TYPE=\hidden\ NAME=\car_year\ VALUE=\$car_year\ INPUT TYPE=\hidden\ NAME=\car_price\ VALUE=\$car_price\ INPUT TYPE=\hidden\ NAME=\car_vin\ VALUE=\$car_vin\ tr td align=\center\ colspan=\3\font size=\4\BConfirm Record Deletion/B/fonthr color=\33\/td /tr tr td width=\30%\BType Of Car: /B/td td$car_type/td /tr tr td width=\30%\BModel Of Car: /B/td td$car_model/td /tr tr td width=\30%\BYear Of Car: /B/td td$car_year/td /tr tr td width=\30%\BPrice Of Car: /B/td td$car_price/td /tr tr td width=\30%\BVIN Of Car: /B/td td$car_vin/td /tr tr td colspan=\3\hr color=\33\/td /tr tr tdinput type=\submit\ name=\delete\ value=\delete\/td /tr /form /table); ? [Page 3 - Connects to DB and deletes selected records] ?php require '../path/to/db.php'; $table_name = cur_inv; $sql = DELETE FROM $table_name WHERE id = '$id'; echo($sql); $result = mysql_query($sql,$dbh) or die(mysql_error()); print(body bgcolor=\ff9900\p class=\done\You have successfully removed your items from the database.); ? If anyone has the time to finish it or give me some pointers on what the hell I am doing wrong please let me know, I would be very glad to hear your opinion and the correct way to accomplish this. (And, yes I went through just about every tutorial I could find on how to delete records, which by the way did nothing for putting the results of a select statement into an array or variable for futher processing.) Have a good weekend everyone!!! Pissed and frustrated... Jas -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Guestbook question
Take a look at mysql_data_seek() Matt James Taylor wrote: I have a really simple guestbook that allows someone to post to the book, then it displays all the entries. Well, there are too many entries now for just one page and it looks kinda wacky, so I wanted to do something where it only displays 10 entries per page, then there are links for pages say 11-20, 21-30, etc. I have no idea how to do this - I only know how to limit the number of entries per page. So, the script that displays all the entries looks something like this: $counter = 0; $result = mysql_query(select name, post from guestbook order by id desc, $db); while (($myrow = mysql_fetch_row($result)) ($counter 10)) { echo TRTD$myrow[0]/TD/TR\n; echo TRTD$myrow[1]/TD/TR\n; ++$counter; } Well, that shows only the latest 10 alright, but what if I wanted to show entries 11-20? I figure I could get the number of posts through mysql_num_rows, I just can't piece it all together. Any suggestions would be really helpful. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Next and Preview Row
Dear All, I am using PHP + MYSQL. I have a question that I need some expert to help. That is: How do I find out a next and preview row values by using PHP and MYSQL. For examples, Row 10ID00010need this value Row 11ID00025have this value on hand Row 12ID00063need this value The questions is how do I find out the values in Row 10 and Row 12, if and only if I only have one data that is ID00025 (select * from table where field=ID00025) . But, the questions is How do I find out the data in Row 10 and Row 12 which is ID00010 and ID00063 assume I don't know the values of ID00025 is in Row 11. Thank you so much for your help. Mark Lo -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Next and Preview Row
How do I find out a next and preview row values by using PHP and MYSQL. For examples, Take a look at the function mysql_result(); Chris -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Next and Preview Row
The solution I have been using is to do three queries similar to the below SELECT * FROM table WHERE field='ID00025' SELECT * FROM table WHERE field'ID00025' ORDER BY field DESC LIMIT 0,1 SELECT * FROM table WHERE field'ID00025' ORDER BY field ASC LIMIT 0,1 If you whish more row returned change the number in the LIMIT -- Raymond Gubala Program Coordinator Multimedia Design and Web Developer Durham College mailto:[EMAIL PROTECTED] From: Mark Lo [EMAIL PROTECTED] Date: Fri, 22 Feb 2002 23:15:18 +0800 To: [EMAIL PROTECTED], [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Subject: [PHP] Next and Preview Row Dear All, I am using PHP + MYSQL. I have a question that I need some expert to help. That is: How do I find out a next and preview row values by using PHP and MYSQL. For examples, Row 10ID00010need this value Row 11ID00025have this value on hand Row 12ID00063need this value The questions is how do I find out the values in Row 10 and Row 12, if and only if I only have one data that is ID00025 (select * from table where field=ID00025) . But, the questions is How do I find out the data in Row 10 and Row 12 which is ID00010 and ID00063 assume I don't know the values of ID00025 is in Row 11. Thank you so much for your help. Mark Lo -- 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] Next and Preview Row
The solution I have been using is to do three queries similar to the below SELECT * FROM table WHERE field='ID00025' SELECT * FROM table WHERE field'ID00025' ORDER BY field DESC LIMIT 0,1 SELECT * FROM table WHERE field'ID00025' ORDER BY field ASC LIMIT 0,1 If you whish more row returned change the number in the LIMIT Why bother with 3 queries? It's a waste of resources, especially if you are working with the same record set... Example (pseudo)code: ? $query = SELECT * FROM table; $result = mysql( $dbname, $query ); for( $i = 0; $i mysql_num_rows( $result ); $i++ ) { echo Previous field: . mysql_result( $result, ( $i - 1 ), field ); echo Current field: . mysql_result( $result, $i, field ); echo Next field: . mysql_result( $result, ( $i + 1 ), field ); } ? Chris -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Next and Preview Row
It seems worst to me because in your case mysql has to retrieve all the rows. If it's a table with 1 million records or more, this should hurt ;) As I said, it was pseudo code. Now, imagine that you were just getting the records for a particular user? a particular application? Where there won't be millions and millions of rows? Chris -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Next and Preview Row
Hi, It seems worst to me because in your case mysql has to retrieve all the rows. If it's a table with 1 million records or more, this should hurt ;) Regards, Jocelyn Fournier Presence-PC - Original Message - From: Chris Boget [EMAIL PROTECTED] To: Raymond Gubala [EMAIL PROTECTED]; Mark Lo [EMAIL PROTECTED]; [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Friday, February 22, 2002 4:45 PM Subject: Re: [PHP] Next and Preview Row The solution I have been using is to do three queries similar to the below SELECT * FROM table WHERE field='ID00025' SELECT * FROM table WHERE field'ID00025' ORDER BY field DESC LIMIT 0,1 SELECT * FROM table WHERE field'ID00025' ORDER BY field ASC LIMIT 0,1 If you whish more row returned change the number in the LIMIT Why bother with 3 queries? It's a waste of resources, especially if you are working with the same record set... Example (pseudo)code: ? $query = SELECT * FROM table; $result = mysql( $dbname, $query ); for( $i = 0; $i mysql_num_rows( $result ); $i++ ) { echo Previous field: . mysql_result( $result, ( $i - 1 ), field ); echo Current field: . mysql_result( $result, $i, field ); echo Next field: . mysql_result( $result, ( $i + 1 ), field ); } ? Chris - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Next and Preview Row
Yes, but how to get ONLY the 3 records you need ? Because often in an application, you don't care about the other records. In this case AFAIK, there is no other solution than issuing at least two queries : SELECT * FROM table WHERE field='ID00025' ORDER BY field DESC LIMIT 2 SELECT * FROM table WHERE field'ID00025' ORDER BY field ASC LIMIT 1 - Original Message - From: Chris Boget [EMAIL PROTECTED] To: Fournier Jocelyn [Presence-PC] [EMAIL PROTECTED]; Raymond Gubala [EMAIL PROTECTED]; Mark Lo [EMAIL PROTECTED]; [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Friday, February 22, 2002 9:17 PM Subject: Re: [PHP] Next and Preview Row It seems worst to me because in your case mysql has to retrieve all the rows. If it's a table with 1 million records or more, this should hurt ;) As I said, it was pseudo code. Now, imagine that you were just getting the records for a particular user? a particular application? Where there won't be millions and millions of rows? Chris - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Click class
Hi! I have just visited a webiste and I have notice that user can't really see the .php extension at the end of the URL address. And when I look at the link address it's got 'class=click' . Could someone help me to understand this please? td bgcolor=#ffimg src=http://www.website_name.com;/td td bgcolor=#FF8000 class=click width=90 align=center any explaination is grately appriciated. regards, Dani -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Click class
to me it just seems that that site is using a frameset... and changing one frame, doesn't change the body of the parentframe... and that frame is being just for the URL shown. The class='click' thing is just used for layout purpose... check out CSS (Cascading Style Sheets) for more information on that... Edward - Original Message - From: Dani [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Saturday, February 23, 2002 2:25 AM Subject: [PHP] Click class Hi! I have just visited a webiste and I have notice that user can't really see the .php extension at the end of the URL address. And when I look at the link address it's got 'class=click' . Could someone help me to understand this please? td bgcolor=#ffimg src=http://www.website_name.com;/td td bgcolor=#FF8000 class=click width=90 align=center any explaination is grately appriciated. regards, Dani -- 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] Click class
On Sat, 23 Feb 2002, Dani wrote: Hi! I have just visited a webiste and I have notice that user can't really see the .php extension at the end of the URL address. And when I look at the link address it's got 'class=click' . Could someone help me to understand this please? td bgcolor=#ffimg src=http://www.website_name.com;/td td bgcolor=#FF8000 class=click width=90 align=center The class=... attribute, is a StyleSheet thing. It defines the lookfeel of the element that bears it (at the begining of the file you are likely to find a link to a .css file which has all the style directives) This has nothing to do with whether the user can see the .php extension or not. This has to do with the webserver configuration, and making it treat ALL files (regardless of ending) as PHP files. hope it helps, thalis any explaination is grately appriciated. regards, Dani -- 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] Click class
Thanks guys! Thalis A. Kalfigopoulos wrote: On Sat, 23 Feb 2002, Dani wrote: Hi! I have just visited a webiste and I have notice that user can't really see the .php extension at the end of the URL address. And when I look at the link address it's got 'class=click' . Could someone help me to understand this please? td bgcolor=#ffimg src=http://www.website_name.com;/td td bgcolor=#FF8000 class=click width=90 align=center The class=... attribute, is a StyleSheet thing. It defines the lookfeel of the element that bears it (at the begining of the file you are likely to find a link to a .css file which has all the style directives) This has nothing to do with whether the user can see the .php extension or not. This has to do with the webserver configuration, and making it treat ALL files (regardless of ending) as PHP files. hope it helps, thalis any explaination is grately appriciated. regards, Dani -- 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] PRE-formated text into DATABASE
The function, nl2br() swaps end-line characters for HTML br tags. This is usually adequate for this situation. Though the default end-line character (\n or \r) can differ between operating systems, I have yet to experience a major problem. -Kevin -Original Message- From: Dani [mailto:[EMAIL PROTECTED]] Sent: Friday, February 22, 2002 3:57 PM To: [EMAIL PROTECTED] Subject: [PHP] PRE-formated text into DATABASE Importance: High Hi there, I'm tryng to make an online form which update the content of a database. I have tried it and it works BUT the user has to include all of the HTML tags otherwise the text which is pulled out (displayed on the webpage) from the database loose the pre-formated form. All the paragraphs are gone... and everything is just in one line. I'm just wondering if there is another way to preserve a pre-formated text (for example from Ms Word) that the user put into the form and the insert into the database without including the HTML tags. thanks. regards, Dani -- 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] Newbie question...
This may be a bit off topic but I am trying to install the pdflib package for Linux so I can make pdfs through php and I was wondering if anyone might know the command to download a file via CRT from an http source. I apologize to the OT but I cant seem to get much of anything to work for me. Thanks! Ben -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Array HELL!!!!
El vie, 22-02-2002 a las 04:54, jas escribió: I don't know what it is but I am having a hell of a time trying to get some results of a query setup into an array or variable (too much of a newbie to know which) that can be passed to a confirmation page before deleting the record from a table. I have given up working on this but for those of you that want to finish it here is the code and the table structure... Recomendation 1: Use JavaScript instead of create a confirmation page... (for speed reasons!) Eg: html head script language=JavaScript function confirmDelete(form){ if (confirm(Do you really want to delete this record?)){ form.action = form.action + ?delete=1; form.submit(); } } /script /head body form name=myForm action=myScript.php method=post input type=button name=delete value=delete onClick=confirmDelete(myForm) /form /body /html [Table Structure] id int(30) DEFAULT '0' NOT NULL auto_increment, car_type varchar(30), car_model varchar(30), car_year varchar(15), car_price varchar(15), car_vin varchar(25), dlr_num varchar(25), PRIMARY KEY (id) [Page 1 - Queries DB table for records] ?php require '../path/to/db.php'; $result = @mysql_query(SELECT * FROM cur_inv,$dbh) or die(Could not execute query, please try again later); echo table border=\0\ class=\table-body\ width=\100%\form name=\rem_inv\ method=\post\ action=\rem_conf.php3\ trtd align=\center\ colspan=\3\font size=\4\BCurrent Inventory/B/fonthr color=\33\/td/tr; $count = -1; while ($myrow = mysql_fetch_array($result)) { $id = $row[id]; $car_type = $row[car_type]; $car_model = $row[car_model]; $car_year = $row[car_year]; $car_price = $row[car_price]; $car_vin = $row[car_vin]; $count ++; echo trtd width=\30%\BType Of Car: /B/tdtd; printf(mysql_result($result,$count,car_type)); echo /tdtdinput type=\checkbox\ name=\id[]\ value=\.$myrow[id].\remove/td/tr\n; echo trtd width=\30%\BModel Of Car: /B/tdtd; printf(mysql_result($result,$count,car_model)); echo /td/tr\n; echo trtd width=\30%\BYear Of Car: /B/tdtd; printf(mysql_result($result,$count,car_year)); echo /td/tr\n; echo trtd width=\30%\BPrice Of Car: /B/tdtd$; printf(mysql_result($result,$count,car_price)); echo /td/tr\n; echo trtd width=\30%\BVIN Of Car: /B/tdtd; printf(mysql_result($result,$count,car_vin)); echo /td/trtrtd colspan=\3\hr color=\33\/td/tr\n; } echo trtdinput type=\submit\ name=\delete\ value=\delete\/td/tr/form/table; ? [Page 2 - Takes records and confirms which ones to be deleted] ?php print( table border=\0\ class=\table-body\ width=\100%\ form name=\rem_inv\ method=\post\ action=\done2.php3\ INPUT TYPE=\hidden\ NAME=\id\ VALUE=\$id\ INPUT TYPE=\hidden\ NAME=\car_type\ VALUE=\$car_type\ INPUT TYPE=\hidden\ NAME=\car_model\ VALUE=\$car_model\ INPUT TYPE=\hidden\ NAME=\car_year\ VALUE=\$car_year\ INPUT TYPE=\hidden\ NAME=\car_price\ VALUE=\$car_price\ INPUT TYPE=\hidden\ NAME=\car_vin\ VALUE=\$car_vin\ tr td align=\center\ colspan=\3\font size=\4\BConfirm Record Deletion/B/fonthr color=\33\/td /tr tr td width=\30%\BType Of Car: /B/td td$car_type/td /tr tr td width=\30%\BModel Of Car: /B/td td$car_model/td /tr tr td width=\30%\BYear Of Car: /B/td td$car_year/td /tr tr td width=\30%\BPrice Of Car: /B/td td$car_price/td /tr tr td width=\30%\BVIN Of Car: /B/td td$car_vin/td /tr tr td colspan=\3\hr color=\33\/td /tr tr tdinput type=\submit\ name=\delete\ value=\delete\/td /tr /form /table); ? [Page 3 - Connects to DB and deletes selected records] ?php require '../path/to/db.php'; $table_name = cur_inv; $sql = DELETE FROM $table_name WHERE id = '$id'; echo($sql); $result = mysql_query($sql,$dbh) or die(mysql_error()); print(body bgcolor=\ff9900\p class=\done\You have successfully removed your items from the database.); ? Recomendation 2: There is no need to use print(html tags) to draw the web page, you can do it in this way: html head ... /head body form ... table border=1 ? $result = mysql_query(SELECT ,$db); while ($myrow = mysql_fetch_array($result)){ ? tr tdbType of car/b/td td?php print $myrow[car_type] ?/td /tr ? } // End of while ? /table /form body /html If anyone has the time to finish it or give me some pointers on what the hell I am doing wrong please let me know, I would be very glad to hear your opinion and the correct way to accomplish this. (And, yes I went through just about every tutorial I could find on how to delete records, which by the way did nothing for putting the results of a select statement into an array or variable for futher processing.) Have a good weekend everyone!!! Pissed and frustrated... Jas input type=text name=carType value=? print $myrow[car_type] ? something like that? -=(O)=- Passing parameters to a PHP scripts: Do it
[PHP] Re: JaneBUILDER
it seems interesting. but look real carefully at the PHP snippet gif on the features page (under the find Icon) g Richard Baskett [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Does anyone have any experience with JaneBUILDER? http://www.seejanecode.com It looks quite interesting and I was wondering what other people thought of it? Rick I will permit no man to narrow and degrade my soul by making me hate him. - Booker T. Washington -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: JaneBUILDER
Oh that's too funny.. Their code is screwed up *grin* plus the code it exports.. Don¹t care much for the tabbing, but that could probably be fixed, but.. Oh man that is funny. Thanks! :) Rick If I accept you as you are, I will make you worse; however, if I treat you as though you are what you are capable of becoming, I help you become that. - Johann Wolfgang von Goethe From: l0t3k [EMAIL PROTECTED] Reply-To: l0t3k [EMAIL PROTECTED] Date: Fri, 22 Feb 2002 18:18:36 -0500 To: [EMAIL PROTECTED] Subject: [PHP] Re: JaneBUILDER it seems interesting. but look real carefully at the PHP snippet gif on the features page (under the find Icon) g Richard Baskett [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Does anyone have any experience with JaneBUILDER? http://www.seejanecode.com It looks quite interesting and I was wondering what other people thought of it? Rick I will permit no man to narrow and degrade my soul by making me hate him. - Booker T. Washington -- 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: Newbie question...
Try wget if it's installed. If not, lynx, a shell-based web browser, is installed on quite a few machines. J Ben Turner wrote: This may be a bit off topic but I am trying to install the pdflib package for Linux so I can make pdfs through php and I was wondering if anyone might know the command to download a file via CRT from an http source. I apologize to the OT but I cant seem to get much of anything to work for me. Thanks! Ben -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Displaying image from MySql DB
Hi Guys, I have some images stored in my MySql database that I'd like to display on the bottom of my HTML page. However, whenever I attempt to display the images using the follow code: $getPhoto = mysql_fetch_object($result); $Type = $getPhoto-type; Header(Content-type: $Type); $Body = $getPhoto-body; echo $Body; flush(); I get an error that states: Cannot add header information - headers already sent by Now I understand why I'm getting the error. What I'd like to know is how to get around it? Basically what I want is the image in the DB to be displayed like any regular image would be on an HTML page, i.e. img src=imageGoesHere height=x width=x border=x. However, I still need to pass the HTML headers. O From Now 'Till Then, \-Reginald Alex Mullin /\ 212-894-1690 ** This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the postmaster at [EMAIL PROTECTED] www.sothebys.com ** -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP-4.1.1 and freetype 2
Yea...I thought of that too, I searched the the entire file system for *libgd*, removed everything and then tried to ./configure php, to make sure it failed, it did, then I reinstalled gd and reran the configure, it worked just as before, gdImageStringFTEX=no and same error in the config.log. I am confused I even stepped back and did the same this with the freetype library, and made sure gd failed with it removed. This always ends up being some small little problem, that is going to drive me nuts for weeks Thanks Again, if you can think of anything else, I would appreciate it. Ernie Rasmus Lerdorf [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Perhaps you have another libgd on your system that the -lgd in that test program is picking up? On Fri, 22 Feb 2002, Ernie Dipko wrote: Thanks Rasmus... You have pointed me in the right directionupon further inspection of my config.status I see that gdImageStringFTEX=no, and looking in the config.log I found... configure:21579: checking for gdImageStringFTEx in -lgd configure:21598: gcc -o onftest -g -O2 -D_POSIX_PTHREAD_SEMANTICS -R/usr/ucblib -L/usr/ucblib -R/u sr/local/lib/gcc-lib/sparc-sun-solaris2.8/2.95.2 -L/usr/local/lib/gcc-lib/sp arc-sun-solaris2.8/2.95.2 -R/usr/local/lib -L/usr/local/lib onftest.c -lgd -lgd -lfreetype -lX11 -lXpm -lpng -lz -ljpeg -lz -lcrypt -lr esolv -lresolv -lresolv -lm -ldl -lsocket -lsocket -lgcc -lcrypt 15 /var/tmp/cczf3W7n.o: In function `main': /export/home/APACHE_SOURCE/php-4.1.1/configure:21594: undefined reference to `gdImageStringFTEx' collect2: ld returned 1 exit status configure: failed program was: #line 21587 configure #include confdefs.h /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char gdImageStringFTEx(); int main() { gdImageStringFTEx() ; return 0; } So I think I have to step back to the gd install and see what happenedbut honestly, I don't know what to try..in the gd makefile I have: CFLAGS=-g -DHAVE_LIBPNG -DHAVELIBJPG -DHAVE_LIBFREETYPE LIBS=-lgd -lpng -lz -ljpeg -lfreetype -lm INCLUDEDIRS=-I. -I/usr/local/include -I/usr/local/include/freetype2 -I/usr/i nclude/X11 -I/usr/X11R6/include/X11 LIBDIRS=-L/usr/local/lib -L/usr/lib/X11 -L/usr/X11R6/lib -L/usr/lib Did I miss something...Is my INCLUDEDIRS correct for the freetype 2.. (freetype-config --cflags returns -I/usr/local/include -I/usr/local/include/freetype2).. I appreciate all your help.. Ernie Rasmus Lerdorf [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Are you trying to draw TTF fonts on a truecolor image? If so, GD-2.0.1 has a bug which turns of anti-aliasing of the fonts in that case. GD-2.0.2 will have the fix. For now, try it with a non-truecolor image and I bet the font will look just fine. You can also ask Wes Furlong nicely for the patch which fixes this bug in GD 2. In order for ImageFTText() to work you have to make sure that HAVE_LIBGD20, HAVE_LIBFREETYPE and HAVE_GD_STRINGFTEX are all defined in your php_config.h In order to get that use configure flags like these: --with-gd=/home/rasmus/gd-2.0.1 --with-jpeg-dir=/usr --with-freetype-dir=/usr --enable-gd-native-ttf --enable-gd-imgstrttf --with-png-dir=/usr Also, never put lib in a configure flag. If Freetype is somewhere under /usr/local, then use --with-freetype-dir=/usr/local Don't put /usr/local/lib or the header files will not be found since they are likely not somewhere under /usr/local/lib -Rasmus On Thu, 21 Feb 2002, Ernie Dipko wrote: Can't figure out where I am going wrong... I cant seem to use the imagefttext function in PHP..it returns a warning saying No FreeType 2 support in this PHP build. The configure, make, and make install of all programs complete without error and ImageTTFText() works (but the fonts do not look all that good), I just cant seam to use ImageFTText(). I am using: Solaris 8 Gd-2.0.1 Freetype-2.0.8 Php-4.1.1 Apache_1.3.22 Here is my php configure command.(from config.nice) #! /bin/sh # # Created by configure './configure' \ '--with-xml' \ '--with-mysql=/usr/local/mysql' \ '--with-apache=../apache_1.3.22' \ '--enable-track-vars' \ '--enable-sockets' \ '--enable-bcmath' \ '--with-gd' \ '--enable-gd-native-ttf' \ '--with-ttf=no' \ '--with-freetype-dir=/usr/local/lib' \ '--with-jpeg-dir=/usr/local/lib' \ '--with-png-dir=/usr/local/lib' \
[PHP] Re: Displaying image from MySql DB
Reginald Mullin [EMAIL PROTECTED] wrote: Now I understand why I'm getting the error. What I'd like to know is how to get around it? Basically what I want is the image in the DB to be displayed like any regular image would be on an HTML page, i.e. img src=imageGoesHere height=x width=x border=x. However, I still need to pass the HTML headers. you need to create a page that justs returns the image (as your example code did), and use that as the target of the 'src' attribute. you can't send the binary image at the same time as you send the html. so the script that sent the html page would look something like: $res = mysql_query($query) while ($obj = mysql_fetch_object($res)) { echo 'img src=get-image.php?id=', $obj-id, ' /'; } and get-image.php would look something like: $res = mysql_query(SELECT type,image FROM table WHERE id=$id); $obj = mysql_fetch_object($res); header(Content-type: .$obj-type); echo $obj-image; jim -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP-4.1.1 and freetype 2
Do I need Wes's patch for gdImageStringFTEX to work??? I was mistaken, I thought the patch only fixed the anti-aliasing problem? Rasmus Lerdorf [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Perhaps you have another libgd on your system that the -lgd in that test program is picking up? On Fri, 22 Feb 2002, Ernie Dipko wrote: Thanks Rasmus... You have pointed me in the right directionupon further inspection of my config.status I see that gdImageStringFTEX=no, and looking in the config.log I found... configure:21579: checking for gdImageStringFTEx in -lgd configure:21598: gcc -o onftest -g -O2 -D_POSIX_PTHREAD_SEMANTICS -R/usr/ucblib -L/usr/ucblib -R/u sr/local/lib/gcc-lib/sparc-sun-solaris2.8/2.95.2 -L/usr/local/lib/gcc-lib/sp arc-sun-solaris2.8/2.95.2 -R/usr/local/lib -L/usr/local/lib onftest.c -lgd -lgd -lfreetype -lX11 -lXpm -lpng -lz -ljpeg -lz -lcrypt -lr esolv -lresolv -lresolv -lm -ldl -lsocket -lsocket -lgcc -lcrypt 15 /var/tmp/cczf3W7n.o: In function `main': /export/home/APACHE_SOURCE/php-4.1.1/configure:21594: undefined reference to `gdImageStringFTEx' collect2: ld returned 1 exit status configure: failed program was: #line 21587 configure #include confdefs.h /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char gdImageStringFTEx(); int main() { gdImageStringFTEx() ; return 0; } So I think I have to step back to the gd install and see what happenedbut honestly, I don't know what to try..in the gd makefile I have: CFLAGS=-g -DHAVE_LIBPNG -DHAVELIBJPG -DHAVE_LIBFREETYPE LIBS=-lgd -lpng -lz -ljpeg -lfreetype -lm INCLUDEDIRS=-I. -I/usr/local/include -I/usr/local/include/freetype2 -I/usr/i nclude/X11 -I/usr/X11R6/include/X11 LIBDIRS=-L/usr/local/lib -L/usr/lib/X11 -L/usr/X11R6/lib -L/usr/lib Did I miss something...Is my INCLUDEDIRS correct for the freetype 2.. (freetype-config --cflags returns -I/usr/local/include -I/usr/local/include/freetype2).. I appreciate all your help.. Ernie Rasmus Lerdorf [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Are you trying to draw TTF fonts on a truecolor image? If so, GD-2.0.1 has a bug which turns of anti-aliasing of the fonts in that case. GD-2.0.2 will have the fix. For now, try it with a non-truecolor image and I bet the font will look just fine. You can also ask Wes Furlong nicely for the patch which fixes this bug in GD 2. In order for ImageFTText() to work you have to make sure that HAVE_LIBGD20, HAVE_LIBFREETYPE and HAVE_GD_STRINGFTEX are all defined in your php_config.h In order to get that use configure flags like these: --with-gd=/home/rasmus/gd-2.0.1 --with-jpeg-dir=/usr --with-freetype-dir=/usr --enable-gd-native-ttf --enable-gd-imgstrttf --with-png-dir=/usr Also, never put lib in a configure flag. If Freetype is somewhere under /usr/local, then use --with-freetype-dir=/usr/local Don't put /usr/local/lib or the header files will not be found since they are likely not somewhere under /usr/local/lib -Rasmus On Thu, 21 Feb 2002, Ernie Dipko wrote: Can't figure out where I am going wrong... I cant seem to use the imagefttext function in PHP..it returns a warning saying No FreeType 2 support in this PHP build. The configure, make, and make install of all programs complete without error and ImageTTFText() works (but the fonts do not look all that good), I just cant seam to use ImageFTText(). I am using: Solaris 8 Gd-2.0.1 Freetype-2.0.8 Php-4.1.1 Apache_1.3.22 Here is my php configure command.(from config.nice) #! /bin/sh # # Created by configure './configure' \ '--with-xml' \ '--with-mysql=/usr/local/mysql' \ '--with-apache=../apache_1.3.22' \ '--enable-track-vars' \ '--enable-sockets' \ '--enable-bcmath' \ '--with-gd' \ '--enable-gd-native-ttf' \ '--with-ttf=no' \ '--with-freetype-dir=/usr/local/lib' \ '--with-jpeg-dir=/usr/local/lib' \ '--with-png-dir=/usr/local/lib' \ '--with-zlib-dir=/usr/local/lib' \ '--with-xpm-dir=/usr/local/lib' \ $@ I have looked at many news posts, search engines, web pages, etc. and have seen a lot of problems mentioning the freetype is not compiled into gd...but that is not the problem I am having I did do some of the suggestions from these sources, just to try them, but the problem remains. I Have tried changing --with-freetype-dir=/usr/local/lib to /usr/local/, Also tried
Re: [PHP] PHP-4.1.1 and freetype 2
It does only fix the anti-aliasing problem. ImageFtText() works fine. On Fri, 22 Feb 2002, Ernie Dipko wrote: Do I need Wes's patch for gdImageStringFTEX to work??? I was mistaken, I thought the patch only fixed the anti-aliasing problem? Rasmus Lerdorf [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Perhaps you have another libgd on your system that the -lgd in that test program is picking up? On Fri, 22 Feb 2002, Ernie Dipko wrote: Thanks Rasmus... You have pointed me in the right directionupon further inspection of my config.status I see that gdImageStringFTEX=no, and looking in the config.log I found... configure:21579: checking for gdImageStringFTEx in -lgd configure:21598: gcc -o onftest -g -O2 -D_POSIX_PTHREAD_SEMANTICS -R/usr/ucblib -L/usr/ucblib -R/u sr/local/lib/gcc-lib/sparc-sun-solaris2.8/2.95.2 -L/usr/local/lib/gcc-lib/sp arc-sun-solaris2.8/2.95.2 -R/usr/local/lib -L/usr/local/lib onftest.c -lgd -lgd -lfreetype -lX11 -lXpm -lpng -lz -ljpeg -lz -lcrypt -lr esolv -lresolv -lresolv -lm -ldl -lsocket -lsocket -lgcc -lcrypt 15 /var/tmp/cczf3W7n.o: In function `main': /export/home/APACHE_SOURCE/php-4.1.1/configure:21594: undefined reference to `gdImageStringFTEx' collect2: ld returned 1 exit status configure: failed program was: #line 21587 configure #include confdefs.h /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char gdImageStringFTEx(); int main() { gdImageStringFTEx() ; return 0; } So I think I have to step back to the gd install and see what happenedbut honestly, I don't know what to try..in the gd makefile I have: CFLAGS=-g -DHAVE_LIBPNG -DHAVELIBJPG -DHAVE_LIBFREETYPE LIBS=-lgd -lpng -lz -ljpeg -lfreetype -lm INCLUDEDIRS=-I. -I/usr/local/include -I/usr/local/include/freetype2 -I/usr/i nclude/X11 -I/usr/X11R6/include/X11 LIBDIRS=-L/usr/local/lib -L/usr/lib/X11 -L/usr/X11R6/lib -L/usr/lib Did I miss something...Is my INCLUDEDIRS correct for the freetype 2.. (freetype-config --cflags returns -I/usr/local/include -I/usr/local/include/freetype2).. I appreciate all your help.. Ernie Rasmus Lerdorf [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Are you trying to draw TTF fonts on a truecolor image? If so, GD-2.0.1 has a bug which turns of anti-aliasing of the fonts in that case. GD-2.0.2 will have the fix. For now, try it with a non-truecolor image and I bet the font will look just fine. You can also ask Wes Furlong nicely for the patch which fixes this bug in GD 2. In order for ImageFTText() to work you have to make sure that HAVE_LIBGD20, HAVE_LIBFREETYPE and HAVE_GD_STRINGFTEX are all defined in your php_config.h In order to get that use configure flags like these: --with-gd=/home/rasmus/gd-2.0.1 --with-jpeg-dir=/usr --with-freetype-dir=/usr --enable-gd-native-ttf --enable-gd-imgstrttf --with-png-dir=/usr Also, never put lib in a configure flag. If Freetype is somewhere under /usr/local, then use --with-freetype-dir=/usr/local Don't put /usr/local/lib or the header files will not be found since they are likely not somewhere under /usr/local/lib -Rasmus On Thu, 21 Feb 2002, Ernie Dipko wrote: Can't figure out where I am going wrong... I cant seem to use the imagefttext function in PHP..it returns a warning saying No FreeType 2 support in this PHP build. The configure, make, and make install of all programs complete without error and ImageTTFText() works (but the fonts do not look all that good), I just cant seam to use ImageFTText(). I am using: Solaris 8 Gd-2.0.1 Freetype-2.0.8 Php-4.1.1 Apache_1.3.22 Here is my php configure command.(from config.nice) #! /bin/sh # # Created by configure './configure' \ '--with-xml' \ '--with-mysql=/usr/local/mysql' \ '--with-apache=../apache_1.3.22' \ '--enable-track-vars' \ '--enable-sockets' \ '--enable-bcmath' \ '--with-gd' \ '--enable-gd-native-ttf' \ '--with-ttf=no' \ '--with-freetype-dir=/usr/local/lib' \ '--with-jpeg-dir=/usr/local/lib' \ '--with-png-dir=/usr/local/lib' \ '--with-zlib-dir=/usr/local/lib' \ '--with-xpm-dir=/usr/local/lib' \ $@ I have looked at many news posts, search engines, web pages, etc. and have seen a lot of problems mentioning the
Re: [PHP] bbcode
Why not download a forum, such as phpbb (www.phpbb.com) and check out their code? =) Jeff At 03:41 PM 2/22/2002 -0500, Leif K-Brooks wrote: I'm planning to make a forum built into my site. I know all of the forums have bbcode, and I doubt they all programmed it themselves. Is there somewhere I can get the code for bbcode? -- 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] Paypal Integration
Hi, Anybody here in this list have successfully integrated paypal to their websites. Like sending item info to the paypal site and getting response code and based on that do some action stuff. I have also searched through archives http://interchange.redhat.com/ some one this list mentioned about this. But of no luck. I went to paypal site but not of good help. Regards, karthikeyan.
[PHP] sometimes browser just recieves half the page
Im programming a page where I have a java-tree-menu that gets generated from a db. The code works perfectly but sometimes when a browser reads the page I just get half of the page. I have noticed this behaivour on many different browsers such as mozilla, netscape, galeon, explorer and even wget sometimes. The page is here so you can try it yourself (Its a frameset page actually, the page with the problem is to the left): http://www.rskhq.2y.net/~nacka/ The actual php page that has the problem is: http://www.rskhq.2y.net/~nacka/vr_navbar.php I suspect it is some problem with the configuration of apache or php but I dont know where to start looking. Versions: PHP 4.1.1 (See http://www.rskhq.2y.net/~nacka/phpinfo.php) Apache/1.3.22 (Unix) Please CC me since Im not a member of this maillinglist. -- * John Ericson [EMAIL PROTECTED] * ICQ: 7325429 JID: [EMAIL PROTECTED] * web: http://john.pp.se -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] PHP-cvs + Apache 2.0.32 + glibc 2.2.5 + gcc3 = problem?
Ok..found something interesting. PHP + Apache 2.0.32 does not run on glibc 2.2.5. (fyi 2.2.5 was compiled with 3.0.3 and my kernel, and binutils, and openssl) I tarred up an installation of Apache 2.0.32 I made from a different machine running 2.2.4, compiled from 2.96, as well as the php module I installed there too. I found that both modules I have(one compiled using gcc3 and one with gcc2), do not let httpd start. I'm not sure where to go from here to find out which half it is, but I'm going to do the following: 1. not use ssl(which I did on my test setup as well as the glibc 2.2.5 system) 2. minimal configuration and installs of both php and apache2. e.g. ./configure --prefix=/web/2.0 --enable-so (for apache2) then ./configure --with-apxs2=/web/2.0/bin/apxs (for php4-cvs) If that works, then something in the middle is mucking things up, and I'll try to see what I can do there. -- Austin Gonyou Systems Architect, CCNA Coremetrics, Inc. Phone: 512-698-7250 email: [EMAIL PROTECTED] It is the part of a good shepherd to shear his flock, not to skin it. Latin Proverb -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Date Question: finding 1st Monday of sept.
Hello, I'm trying to find out how to calculate some dates, and the part I'm having problems with is finding the date of the first Monday in September. I'm looking into the strtotime() function which works some great magic with dates, but I can't figure out how to use the day of the week syntax start from a date other than today. You can use releative dates with units of days: strtotime(2002-09-01 +2 weeks); But I can't seem to get it to work with the weekdays, I'd assume it would be something like this. strtotime(2002-09-01 first monday) Is there a syntax that I'm missing or is there a way of fooling the function to thinking it is September 1st so when I ask for next Monday it will give me the correct date? -- Jeff Bearer, RHCE Webmaster PittsburghLIVE.com 2002 EPpy Award, Best Online U.S. Newspaper -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Date Question: finding 1st Monday of sept.
Nevermind, I figured it out, didn't see that you could pass a timestamp to strtotime. Thanks. On Fri, 2002-02-22 at 14:22, Jeff Bearer wrote: Hello, I'm trying to find out how to calculate some dates, and the part I'm having problems with is finding the date of the first Monday in September. I'm looking into the strtotime() function which works some great magic with dates, but I can't figure out how to use the day of the week syntax start from a date other than today. You can use releative dates with units of days: strtotime(2002-09-01 +2 weeks); But I can't seem to get it to work with the weekdays, I'd assume it would be something like this. strtotime(2002-09-01 first monday) Is there a syntax that I'm missing or is there a way of fooling the function to thinking it is September 1st so when I ask for next Monday it will give me the correct date? -- Jeff Bearer, RHCE Webmaster PittsburghLIVE.com 2002 EPpy Award, Best Online U.S. Newspaper -- Jeff Bearer, RHCE Webmaster PittsburghLIVE.com 2002 EPpy Award, Best Online U.S. Newspaper -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP-4.1.1 and freetype 2
I am sorry, and hate to keep bugging, but I am confused. If in order to have ImageFTText() work I need HAVE_GD_STRINGFTEX in the php_config.h. and gdImageStringFTEx is not part of the patch, where is gdImageStringFTEx... I just searched all the gd header files (grep -i StringFTEX gd*.h) then I re-downloaded gd-2.0.1, unpacked it, and did a search in the tree for that definition. (grep -i StringFTEX *)...Basically there is no definition of the function that the php configure script is looking for in the entire gd source? I am not a very good programmer, but I am pretty sure that the gdImageStringFTEx() function should be somewhere in the gd source tree. I also found a news thread between you and Wez, that I think says the patch is needed??? From: Wez Furlong ([EMAIL PROTECTED]) Subject: Re: [PHP-DEV] Where/what is gdImageStringFTEx() ? Newsgroups: php.dev It's part of my patch, due to be included in GD 2.0.2. Date: 2001-11-21 00:10:56 PST Before masses of people ask me for the patch, please hassle boutell.com to release 2.0.2 first; they've had it for a very long time now! If you really really need it, drop me a mail. --Wez. On 17/11/01, Rasmus Lerdorf [EMAIL PROTECTED] wrote: I see a check for this function in ext/gd/config.m4, but I see no sign of it in any version of GD I can find. Someone clue me in please. -Rasmus Thanks Ernie Rasmus Lerdorf [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... It does only fix the anti-aliasing problem. ImageFtText() works fine. On Fri, 22 Feb 2002, Ernie Dipko wrote: Do I need Wes's patch for gdImageStringFTEX to work??? I was mistaken, I thought the patch only fixed the anti-aliasing problem? Rasmus Lerdorf [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Perhaps you have another libgd on your system that the -lgd in that test program is picking up? On Fri, 22 Feb 2002, Ernie Dipko wrote: Thanks Rasmus... You have pointed me in the right directionupon further inspection of my config.status I see that gdImageStringFTEX=no, and looking in the config.log I found... configure:21579: checking for gdImageStringFTEx in -lgd configure:21598: gcc -o onftest -g -O2 -D_POSIX_PTHREAD_SEMANTICS -R/usr/ucblib -L/usr/ucblib -R/u sr/local/lib/gcc-lib/sparc-sun-solaris2.8/2.95.2 -L/usr/local/lib/gcc-lib/sp arc-sun-solaris2.8/2.95.2 -R/usr/local/lib -L/usr/local/lib onftest.c -lgd -lgd -lfreetype -lX11 -lXpm -lpng -lz -ljpeg -lz -lcrypt -lr esolv -lresolv -lresolv -lm -ldl -lsocket -lsocket -lgcc -lcrypt 15 /var/tmp/cczf3W7n.o: In function `main': /export/home/APACHE_SOURCE/php-4.1.1/configure:21594: undefined reference to `gdImageStringFTEx' collect2: ld returned 1 exit status configure: failed program was: #line 21587 configure #include confdefs.h /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char gdImageStringFTEx(); int main() { gdImageStringFTEx() ; return 0; } So I think I have to step back to the gd install and see what happenedbut honestly, I don't know what to try..in the gd makefile I have: CFLAGS=-g -DHAVE_LIBPNG -DHAVELIBJPG -DHAVE_LIBFREETYPE LIBS=-lgd -lpng -lz -ljpeg -lfreetype -lm INCLUDEDIRS=-I. -I/usr/local/include -I/usr/local/include/freetype2 -I/usr/i nclude/X11 -I/usr/X11R6/include/X11 LIBDIRS=-L/usr/local/lib -L/usr/lib/X11 -L/usr/X11R6/lib -L/usr/lib Did I miss something...Is my INCLUDEDIRS correct for the freetype 2.. (freetype-config --cflags returns -I/usr/local/include -I/usr/local/include/freetype2).. I appreciate all your help.. Ernie Rasmus Lerdorf [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Are you trying to draw TTF fonts on a truecolor image? If so, GD-2.0.1 has a bug which turns of anti-aliasing of the fonts in that case. GD-2.0.2 will have the fix. For now, try it with a non-truecolor image and I bet the font will look just fine. You can also ask Wes Furlong nicely for the patch which fixes this bug in GD 2. In order for ImageFTText() to work you have to make sure that HAVE_LIBGD20, HAVE_LIBFREETYPE and HAVE_GD_STRINGFTEX are all defined in your php_config.h In order to get that use configure flags like these: --with-gd=/home/rasmus/gd-2.0.1 --with-jpeg-dir=/usr --with-freetype-dir=/usr
[PHP] how to build an array
I guess it's because I didn't really follow Niklas' post, so I'll ask the first part of yesterday's question again, if someone can help me think my way through it. I've been looking at http://www.php.net/manual/en/ref.array.php but don't really get HOW to build an array from my MySQL data. I'm exploding data from $mydata-KW explode(;, $mydata-KW); (It's a bunch of author names separated by ; in a bibliographic database.) I want to compile everything in One Single array, called $authors and output it to the screen. Later, I'll aphabetise and sort the output ... Where/How do I start in building a new array? .= doesn't work: $authors .= explode(;, $mydata-KW); How do I construct the array? Will I be able to alpabetise it? -snip-- $myconnection = mysql_connect($server,$user,$pass); mysql_select_db($db,$myconnection); $news = mysql_query(select KW from $table); while ($mydata = mysql_fetch_object($news)) { $authors .= explode(;, $mydata-KW); } foreach ($authors as $author) { echo $authorbr\n; } John -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: how to build an array
Jtjohnston [EMAIL PROTECTED] wrote: Where/How do I start in building a new array? .= doesn't work: $authors .= explode(;, $mydata-KW); '.=' doesn't work because that does a string append. you just want: $authors = explode(;, $mydata-KW); then you can sort the array using sort(). http://php.net/sort jim -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] login determines content on page
On Fri, 22 Feb 2002 21:38:16 -0500, you wrote: I'd to know how difficult it is to achieve the following: Create login page, when the submit button is clicked, the user info is checked against a database as to whether is login info is valid. if it is valid, a page is displayed that lists all of the classes that the user has registered for, meaning each user will see a different list of classes. At first, I thought this was a homework question, but that seems unlikely. Ok, one way to do this is to have a form submit to itself. Briefly : ? if (isset($submit_happening)) { if ($username == david $password=xyzzy) { echo(Successfully logged in); } else { echo(Not logged in); } } else { ? form method=post action=?=$PHP_SELF? input type=hidden name=submit_happening value=1 input type=text name=username input type=password name=password /form ? } ? Untested. If you want to store a user's logon status permanently, look at sessions. http://www.php.net/manual/en/ref.session.php djo -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: sometimes browser just recieves half the page
John Ericson wrote: Im programming a page where I have a java-tree-menu that gets generated from a db. The code works perfectly but sometimes when a browser reads the page I just get half of the page. I have noticed this behaivour on many different browsers such as mozilla, netscape, galeon, explorer and even wget sometimes. The page is here so you can try it yourself (Its a frameset page actually, the page with the problem is to the left): http://www.rskhq.2y.net/~nacka/ The actual php page that has the problem is: http://www.rskhq.2y.net/~nacka/vr_navbar.php I suspect it is some problem with the configuration of apache or php but I dont know where to start looking. Versions: PHP 4.1.1 (See http://www.rskhq.2y.net/~nacka/phpinfo.php) Apache/1.3.22 (Unix) Please CC me since Im not a member of this maillinglist. The javascript showing up in the left frame is not showing the same as your link to it. The page showing up in the frame is broken. The javascript tags are closed before the script script language=JavaScript/script Gary -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: how to build an array
Also, for adding items onto an array use array_push() Steven J. Walker Walker Effects www.walkereffects.com [EMAIL PROTECTED] On Friday, February 22, 2002, at 07:41 PM, Jim Winstead wrote: Jtjohnston [EMAIL PROTECTED] wrote: Where/How do I start in building a new array? .= doesn't work: $authors .= explode(;, $mydata-KW); '.=' doesn't work because that does a string append. you just want: $authors = explode(;, $mydata-KW); then you can sort the array using sort(). http://php.net/sort jim -- 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] Not Quite: how to build an array
OK. I use: while ($mydata = mysql_fetch_object($news)) { $authors = explode(;, $mydata-AS); } Then why Invalid argument supplied for foreach() Am I indeed building an array as I go through my database? foreach($authors as $author) { #echo sort($author).br\n; echo $authorbr\n; } http://www.php.net/manual/en/control-structures.foreach.php foreach ($arr as $value) { echo Value: $valuebr\n; } I have the right syntax? Did I build the array? Newbie, but have to learn it somehow :) snip- $myconnection = mysql_connect($server,$user,$pass); mysql_select_db($db,$myconnection); $news = mysql_query(select AS from $table); while ($mydata = mysql_fetch_object($news)) { $authors = explode(;, $mydata-AS); } foreach($authors as $author) { echo $authorbr\n; } -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: how to build an array
Yeah but, this doesn't work either? I'm trying :) $news = mysql_query(select AS from $table); while ($mydata = mysql_fetch_object($news)) { # $authors = explode(;, $mydata-AS); array_push ($authors, explode(;, $mydata-AS)); } foreach($authors as $author) { echo $authorbr\n; } -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] login determines content on page
What's the difference between if (isset($submit_happening)) and if $submit_happening) John [EMAIL PROTECTED] wrote: On Fri, 22 Feb 2002 21:38:16 -0500, you wrote: I'd to know how difficult it is to achieve the following: Create login page, when the submit button is clicked, the user info is checked against a database as to whether is login info is valid. if it is valid, a page is displayed that lists all of the classes that the user has registered for, meaning each user will see a different list of classes. At first, I thought this was a homework question, but that seems unlikely. Ok, one way to do this is to have a form submit to itself. Briefly : ? if (isset($submit_happening)) { if ($username == david $password=xyzzy) { echo(Successfully logged in); } else { echo(Not logged in); } } else { ? form method=post action=?=$PHP_SELF? input type=hidden name=submit_happening value=1 input type=text name=username input type=password name=password /form ? } ? Untested. If you want to store a user's logon status permanently, look at sessions. http://www.php.net/manual/en/ref.session.php djo -- John Taylor-Johnston - ' ' ' 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] login determines content on page
Well, if $submit_happening is set to 0, 0 or false then if($submit_happening) will evaluate to false while if(isset($submit_happening)) will evaluate to true As the documentation (please read http://www.php.net/isset) isset() returns true if the variable exists and false if it doesn't. -Rasmus On Sat, 23 Feb 2002, jtjohnston wrote: What's the difference between if (isset($submit_happening)) and if $submit_happening) John [EMAIL PROTECTED] wrote: On Fri, 22 Feb 2002 21:38:16 -0500, you wrote: I'd to know how difficult it is to achieve the following: Create login page, when the submit button is clicked, the user info is checked against a database as to whether is login info is valid. if it is valid, a page is displayed that lists all of the classes that the user has registered for, meaning each user will see a different list of classes. At first, I thought this was a homework question, but that seems unlikely. Ok, one way to do this is to have a form submit to itself. Briefly : ? if (isset($submit_happening)) { if ($username == david $password=xyzzy) { echo(Successfully logged in); } else { echo(Not logged in); } } else { ? form method=post action=?=$PHP_SELF? input type=hidden name=submit_happening value=1 input type=text name=username input type=password name=password /form ? } ? Untested. If you want to store a user's logon status permanently, look at sessions. http://www.php.net/manual/en/ref.session.php djo -- John Taylor-Johnston - ' ' ' 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 General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php