[PHP] PHP vs Algorithm
Hi All, I want to make algorithm representation of my code for my homework, but I have no idea to convert PHP code to algorithm. Can anyone help me? Code: --- begin code --- function doAdd($command, $options, $params) { $kategori = new Silaris_Kategori($params); $res = $kategori-saveKategori(); if (Silaris::isError($res)) return $res; if (!empty($kategori-errors)) { $messages = array(); foreach ($kategori-errors as $field = $msg) { $messages[$field] = '['. ucfirst($msg) . ']'; } $dlgdata = $this-_getDialogData($kategori, $messages); if (Silaris::isError($dlgdata)) return $dlgdata; $this-ui-outputData($dlgdata, 'kat-showadd'); return false; } return true; } --- end code Algorithm: ?? Thanks for your response. Regards, Firman
[PHP] Take post values
Hello, I use a simple form and I cannot take the values when I do submit. I use post method. How I take te post values ? Thanks Tassos t -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] e - comerce website
You have a major challenge. First, I notice you don't seem to speak English natively. I don't know how well you comprehend English (this varies from person to person) but you might see if there's a PHP manual in your native language. It might help. Second, you don't seem to know all that much and one week is not very long to learn PHP and whip out an ecommerce product. Third, you gotta gotta gotta ask questions! We can answer questions, but we can't do it for you. Sorry, but you can't come crying to us. You can, however, ask how to do a _specific_ task. What exactly are you having trouble with regarding sessions? We _can_ and _do_ help people when they ask something in specific. If you want a tutorial on building a simple ecommerce site, Google for one. I bet you'll find several good ones. Good luck! -Galen On Mar 15, 2004, at 6:07 PM, [EMAIL PROTECTED] wrote: Hai.. I have a homework from my scholl. We must make a simple website of e - comerce use php. I just still confuse to use the session in this work. And I must make a different page for a administrator that have a full access and a just user. But I still don't know how to make it. There is an order and a checkout if we want to leave the website. Please help me, I just have time 1 week to finish it. Warm regards: [EMAIL PROTECTED] -- 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] Take post values
On Wednesday 17 March 2004 09:07, Tassos T wrote: Hello, I use a simple form and I cannot take the values when I do submit. I use post method. How I take te post values ? Thanks Tassos t http://www.php.net/manual/el/language.variables.predefined.php http://www.php.net/manual/el/reserved.variables.php#reserved.variables.post -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Take post values
How I take te post values ? $_POST['field_name'] php.net is your friend... http://ch2.php.net/manual/en/language.variables.predefined.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Conditional Include
Hello When I want to include a php file only conditionally, I use include instead of require. At the moment I am trying to solve the following problem. I haven't found anything in the news archive, perhaps I searched with the wrong phrase... code snippet- ?php $includefiles=1; if(...) { ... //some nested if statements. ... //in some cases $includefiles is set to 0 } if($includefiles==1) { include('incfile.php'); } ? end code- In this code, the include file is always parsed, even if $includefiles is set to 0. Even the files which are 'required()' inside incfile.php are parsed (observed with the program Filemon, which registers file access). I tried various ways to nest the if statements, but none helped. Any suggestions to have incfile.php parsed only if needed? I am using PHP Version 4.3.4 as Module, Apache/2.0.48, on Windows 2000. Thanks a lot for any suggestions! Andreas -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Informix and PHP
Hi, Everybody is so amazed by the ease and power of MySQL that some nice products do not get the needed attention from tutorial writers. Why are'nt we using the more powerful MaxDB instead of MySQL? I can't find no really useful tutorials on MaxDB and Informix in connection with PHP. Now i have to connect to Informix with PHP and retrieve some data. I have found out that I have to install unixODBC and Informix CSDK. The problem is: i dont know how to do that. Google returns no reasonable results on that. I can't find anything in the BIG site of IBM neither. Anyone has some 10-20 line story on installing Informix client and unixODBC? Please. -- Best regards, Pietuka -- Your free mail Inbox.lv --- This message contains no viruses. Guaranteed by Kaspersky Anti-Virus. http://www.antivirus.lv
[PHP] PHP 4.3.4, aspell-0.50.3-16 creating and using specialised dictionary
Hello, I want to use spell checking and suggestions in PHP but with only one dictionary, one I've created. The dictionary I've created is called 'en_GB-modules.rws'. I wanted to call it 'li_GB-modules.rws'. 'li' meaning library. I didn't get anywhere with it in PHP but in one iteration I coulddo something like: echo frink|aspell --lang=li_GB-modules -a -b and get a result. I created my dictionary like this: aspell --lang=en create master en_GB-modules.rws modules.words I can now use my dictionary but only if it is part of 'en.multi' and use: $this-pspell = pspell_new(en); this includes the other 'en' dictionaries on the system which of course I don't want to remove. What am I doing wrong? Thanks for any help, Owen. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: E-mail account security warning.
I guess this is a hoax or spam. Serban [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Dear user of e-mail server Php.net, Your e-mail account will be disabled because of improper using in next three days, if you are still wishing to use it, please, resign your account information. For further details see the attach. In order to read the attach you have to use the following password: 85324. The Management, The Php.net team http://www.php.net -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Cron Jobs and php as apache module
Hello all, Ok, I run php as an apache module but need to have some php scripts called from a cron. Since you can't have php installed as a cgi apache module I don't know how to do this. Any help would be appreciated. TIA Daryl Meese -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Cron Jobs and php as apache module
On Wednesday 17 March 2004 11:03, Daryl Meese wrote: Hello all, Ok, I run php as an apache module but need to have some php scripts called from a cron. Since you can't have php installed as a cgi apache module I don't know how to do this. Any help would be appreciated. TIA Daryl Meese PHP CLI executable. Builds whenever I do a manual install. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Cron Jobs and php as apache module
[EMAIL PROTECTED] (Daryl Meese) wrote in news:[EMAIL PROTECTED]: Hello all, Ok, I run php as an apache module but need to have some php scripts called from a cron. Since you can't have php installed as a cgi apache module I don't know how to do this. Any help would be appreciated. TIA Daryl Meese Depending on the version of php you have, you may find you have a cli version of php installed - possibly /usr/local/bin/php. Alternatively, it _is_ possible to have both module and cgi. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Cron Jobs and php as apache module
Daryl Meese wrote on woensdag 17 maart 2004 12:04: Hello all, Ok, I run php as an apache module but need to have some php scripts called from a cron. Since you can't have php installed as a cgi apache module I don't know how to do this. Any help would be appreciated. TIA Daryl Meese With php installed as an apache module you can still run php-scripts from commandline. It should work. If i create the following file: test.php ? #!/usr/local/bin/php mail([EMAIL PROTECTED], Sample, testing cronjob); ? And create a new cronjob: crontab 30 * * * * php /path to/test.php This will make cron run the script. Just tested it and it works. Thijs -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Cron Jobs and php as apache module
On Wed, 2004-03-17 at 06:03, Daryl Meese wrote: Hello all, Ok, I run php as an apache module but need to have some php scripts called from a cron. Since you can't have php installed as a cgi apache module I don't know how to do this. Possibly you can't have PHP configured in Apache as a module and a CGI but you can sure have the CGI binary on your server. And as others have said you can also use the CLI version which is the CGI version streamlined for shell purposes. Cheers, Rob. -- .. | InterJinn Application Framework - http://www.interjinn.com | :: | An application and templating framework for PHP. Boasting | | a powerful, scalable system for accessing system services | | such as forms, properties, sessions, and caches. InterJinn | | also provides an extremely flexible architecture for | | creating re-usable components quickly and easily. | `' -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Cron Jobs and php as apache module
Thijs Lensselink wrote on woensdag 17 maart 2004 12:17: Daryl Meese wrote on woensdag 17 maart 2004 12:04: Hello all, Ok, I run php as an apache module but need to have some php scripts called from a cron. Since you can't have php installed as a cgi apache module I don't know how to do this. Any help would be appreciated. TIA Daryl Meese With php installed as an apache module you can still run php-scripts from commandline. It should work. If i create the following file: test.php ? #!/usr/local/bin/php mail([EMAIL PROTECTED], Sample, testing cronjob); And create a new cronjob: crontab 30 * * * * php /path to/test.php This will make cron run the script. Just tested it and it works. Thijs Hello daryl, Seems like i have made a little error. It look slike the OpenBSD ports php package install the cli version next to the .so version. So running both the .so and the cli version is no problem. Just use the cli version for the cronjobs. Thijs -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] How to make sure a redirect works
Henry Grech-Cini wrote: 1) Do not redirect if the page is visited as the result of a POST Why is that? I do it all the time and it seems to work fine. I have read through all the emails for this thread and didn't find anything mentioned. Am I doing something wrong? Benjamin -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] How to make sure a redirect works
Benjamin wrote: Henry Grech-Cini wrote: 1) Do not redirect if the page is visited as the result of a POST Why is that? I do it all the time and it seems to work fine. I have read through all the emails for this thread and didn't find anything mentioned. Am I doing something wrong? No, you're doing it right. If you don't do a redirect and someone tried to come _back_ to a page that was POSTed to, they'll have to refresh it to see it again (rePOST the data). This is why the middle-man technique is so popular. You POST to a PHP page that handles processing and then redirects to a page to show the user. This way there's no need to refresh when/if the user comes back to it. Keep in mind I'm jumping into the middle of this thead as I just resubscribed. :) -- ---John Holmes... Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/ php|architect: The Magazine for PHP Professionals www.phparch.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] str_replace problem
Probleema sekojosha: Shiim koda rindinjaam buutu jaanolasa IP adrese no temp.txt faila, tad ieksh log.txt faila jaasameklee identiska IP adrese (taada pati kaa temp.txt failaa) un jaaizdzçð taa no log.txt faila. Itkaa jau vienkaarshi, BET tas skripts nedarbojas :( The problem is that str_replace isn't working preperly: The whole idea of the script (below) is that it reads the IP address from the temp.txt file, then looks for identical IP address in log.txt file and deletes this IP address from the log.txt file. P.S. temp.txt file has only one IP address, but log.txt file has many different IP addresses. $connect_temp_ip = fopen('temp.txt','r'); $temp_ip = fread($connect_temp_ip,filesize('temp.txt')); fclose($connect_temp_ip); $connect_log = fopen('log.txt','a+'); $empty = fread($connect_log,filesize('log.txt')); $empty = str_replace($temp_ip,,$empty); fwrite($connect_log, $empty); fclose($connect_log); Thank you very much, Lab. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] reading a pdf file into an array
Hi All Was hoping some one might be able to point me down the right road I would like to be able to read the context of a pdf file into an array then search that array for a word is this possible with php. e.g can I read a pdf file into an array ? Thank you Ben
[PHP] Fmod with PHP 4.2.0 ?
Bonjour ... My ISP's PHP is 4.2.0, and the fmod function was not available before 4.2.0 My question : is there a replacement to fmod, or what can i do to do a fmod without it ? Thanks in advance, -Quentin -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Informix and PHP
Go to http://www.unixodbc.org The 'Manuals' page has a variety of information including setting up unixodbc and using the Informix driver. Tom Pietuka Krustiòð [EMAIL PROTECTED] 03/17/04 03:36AM Hi, Everybody is so amazed by the ease and power of MySQL that some nice products do not get the needed attention from tutorial writers. Why are'nt we using the more powerful MaxDB instead of MySQL? I can't find no really useful tutorials on MaxDB and Informix in connection with PHP. Now i have to connect to Informix with PHP and retrieve some data. I have found out that I have to install unixODBC and Informix CSDK. The problem is: i dont know how to do that. Google returns no reasonable results on that. I can't find anything in the BIG site of IBM neither. Anyone has some 10-20 line story on installing Informix client and unixODBC? Please. -- Best regards, Pietuka -- Your free mail Inbox.lv --- This message contains no viruses. Guaranteed by Kaspersky Anti-Virus. http://www.antivirus.lv -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Fmod with PHP 4.2.0 ?
From: BEOI 7308 [EMAIL PROTECTED] My ISP's PHP is 4.2.0, and the fmod function was not available before 4.2.0 My question : is there a replacement to fmod, or what can i do to do a fmod without it ? Read second comment here: http://us2.php.net/fmod ---John Holmes... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Fmod with PHP 4.2.0 ?
On Wednesday 17 March 2004 22:05, BEOI 7308 wrote: My ISP's PHP is 4.2.0, and the fmod function was not available before 4.2.0 My question : is there a replacement to fmod, or what can i do to do a fmod without it ? Write your own function: If r = fmod(x, y) x = i * y + r Then $i = floor($x/$y); // you may have to use ceil depending on how you // want to deal with negative values $r = $x - ($i * $y); I'll let you work out how to deal with negative values for x, y. -- Jason Wong - Gremlins Associates - www.gremlins.biz Open Source Software Systems Integrators * Web Design Hosting * Internet Intranet Applications Development * -- Search the list archives before you post http://marc.theaimsgroup.com/?l=php-general -- /* The very remembrance of my former misfortune proves a new one to me. -- Miguel de Cervantes */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Informix and PHP
We have a Informix on Windows server and I am trying to reach that from my RedHat 9. I have read that information on unixODBC site about unixODBC+Informix, but when I try ./isql -v database i get nothing more but: [ISQL]ERROR: Could not SQLConnect We have set up UnixODBC and Informix CSDK We have /etc/services OK We have $INFORMIXDIR/etc/sqlhosts OK We have set $ODBCINI, $PATH, $INFORMIXDIR as instructed We have those odbc.ini and odbcinst.ini OK BUT!! We receive nothing more than that poor [ISQL]ERROR: Could not SQLConnect :( -- Best regards, Pietuka Quoting James 'Chip' Kaufman [EMAIL PROTECTED]: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On Wednesday 17 March 2004 03:36, Pietuka Krustiòð wrote: Hi, Now i have to connect to Informix with PHP and retrieve some data. I have found out that I have to install unixODBC and Informix CSDK. The problem is: i dont know how to do that. Google returns no reasonable results on that. I can't find anything in the BIG site of IBM neither. Anyone has some 10-20 line story on installing Informix client and unixODBC? Please. I am not using MaxDB, but am using Informix on a Red Hat 8.0 server. I can connect to Informix from other Linux boxes using Informix CSDK. What platform are you running Informix on? What platforms are connecting? What OS are you running. Etc. I found that building PHP from source was easier than trying to add the Informix extension to an already installed PHP. - -- James 'Chip' Kaufman [EMAIL PROTECTED] 952-346-3532 PGP key: 697D43DE -BEGIN PGP SIGNATURE- Version: GnuPG v1.2.1 (GNU/Linux) iD8DBQFAWF9drlGDUWl9Q94RAl3lAKCOaXCB+yzSzV54eo6Imixn7qeLOQCfTq47 zGeuCR1Pfk2UU1UToA1s7i0= =UA2s -END PGP SIGNATURE- -- Your free mail Inbox.lv --- This message contains no viruses. Guaranteed by Kaspersky Anti-Virus. http://www.antivirus.lv
[PHP] mail() to own domain not working
Hi all Im having a problem with sending mails using the mail function to my own domain. Mails to any other domain works perfectly. Also our mail server sitting on a different machine. Any ideas how to fix this?
[PHP] Advanced PHP Programming by George Schlossnagle
Hey guys. I just recieved Advanced PHP Programming by George Schlossnagle (that's a mouth full) from an online shop. I had very high expectations of the book, since everybody starts to cheer once this book gets mentioned. I instantly started to read and I'm very happy with the quality and level of the book. Of course I haven't read the complete book yet, but from what I've read so far this was money well spent. Regards, Filip de Waard -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] mail() to own domain not working
Ooo, I had this recently when we moved to beamhost.co.uk I'll mail them and ask them what they did to fix it... I'll be back... Gerard L Petersen [EMAIL PROTECTED] 17/03/2004 14:59 To Php-General [EMAIL PROTECTED] cc Subject [PHP] mail() to own domain not working Hi all Im having a problem with sending mails using the mail function to my own domain. Mails to any other domain works perfectly. Also our mail server sitting on a different machine. Any ideas how to fix this? * The information contained in this e-mail message is intended only for the personal and confidential use of the recipient(s) named above. If the reader of this message is not the intended recipient or an agent responsible for delivering it to the intended recipient, you are hereby notified that you have received this document in error and that any review, dissemination, distribution, or copying of this message is strictly prohibited. If you have received this communication in error, please notify us immediately by e-mail, and delete the original message. *** -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] mail() to own domain not working
Well, they replied: Do you mean the email is not working at the moment or you\'re asking for the solution we did last time? We modified your code and changed @ to \\@ within the mail header. Any use? [EMAIL PROTECTED] 17/03/2004 15:21 To Gerard L Petersen [EMAIL PROTECTED] cc Php-General [EMAIL PROTECTED] Subject Re: [PHP] mail() to own domain not working Ooo, I had this recently when we moved to beamhost.co.uk I'll mail them and ask them what they did to fix it... I'll be back... Gerard L Petersen [EMAIL PROTECTED] 17/03/2004 14:59 To Php-General [EMAIL PROTECTED] cc Subject [PHP] mail() to own domain not working Hi all Im having a problem with sending mails using the mail function to my own domain. Mails to any other domain works perfectly. Also our mail server sitting on a different machine. Any ideas how to fix this? * The information contained in this e-mail message is intended only for the personal and confidential use of the recipient(s) named above. If the reader of this message is not the intended recipient or an agent responsible for delivering it to the intended recipient, you are hereby notified that you have received this document in error and that any review, dissemination, distribution, or copying of this message is strictly prohibited. If you have received this communication in error, please notify us immediately by e-mail, and delete the original message. *** -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php * The information contained in this e-mail message is intended only for the personal and confidential use of the recipient(s) named above. If the reader of this message is not the intended recipient or an agent responsible for delivering it to the intended recipient, you are hereby notified that you have received this document in error and that any review, dissemination, distribution, or copying of this message is strictly prohibited. If you have received this communication in error, please notify us immediately by e-mail, and delete the original message. *** -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] mail() to own domain not working
Sorry, had an extra \ == Do you mean the email is not working at the moment or you're asking for the solution we did last time? We modified your code and changed @ to \@ within the mail header. Tristan Pretty/Infinity 17/03/2004 15:37 To [EMAIL PROTECTED] cc Gerard L Petersen [EMAIL PROTECTED], Php-General [EMAIL PROTECTED] Subject Re: [PHP] mail() to own domain not working Well, they replied: Do you mean the email is not working at the moment or you\'re asking for the solution we did last time? We modified your code and changed @ to \\@ within the mail header. Any use? [EMAIL PROTECTED] 17/03/2004 15:21 To Gerard L Petersen [EMAIL PROTECTED] cc Php-General [EMAIL PROTECTED] Subject Re: [PHP] mail() to own domain not working Ooo, I had this recently when we moved to beamhost.co.uk I'll mail them and ask them what they did to fix it... I'll be back... Gerard L Petersen [EMAIL PROTECTED] 17/03/2004 14:59 To Php-General [EMAIL PROTECTED] cc Subject [PHP] mail() to own domain not working Hi all Im having a problem with sending mails using the mail function to my own domain. Mails to any other domain works perfectly. Also our mail server sitting on a different machine. Any ideas how to fix this? * The information contained in this e-mail message is intended only for the personal and confidential use of the recipient(s) named above. If the reader of this message is not the intended recipient or an agent responsible for delivering it to the intended recipient, you are hereby notified that you have received this document in error and that any review, dissemination, distribution, or copying of this message is strictly prohibited. If you have received this communication in error, please notify us immediately by e-mail, and delete the original message. *** -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php * The information contained in this e-mail message is intended only for the personal and confidential use of the recipient(s) named above. If the reader of this message is not the intended recipient or an agent responsible for delivering it to the intended recipient, you are hereby notified that you have received this document in error and that any review, dissemination, distribution, or copying of this message is strictly prohibited. If you have received this communication in error, please notify us immediately by e-mail, and delete the original message. *** -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] str_replace problem
On Wednesday 17 March 2004 20:16, Labunski wrote: The problem is that str_replace isn't working preperly: So *how* does it not work properly? -- Jason Wong - Gremlins Associates - www.gremlins.biz Open Source Software Systems Integrators * Web Design Hosting * Internet Intranet Applications Development * -- Search the list archives before you post http://marc.theaimsgroup.com/?l=php-general -- /* If you ever want to get anywhere in politics, my boy, you're going to have to get a toehold in the public eye. */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Conditional Include
On Wednesday 17 March 2004 17:33, Andreas Brunschweiler wrote: In this code, the include file is always parsed, even if $includefiles is set to 0. Even the files which are 'required()' inside incfile.php are parsed (observed with the program Filemon, which registers file access). I tried various ways to nest the if statements, but none helped. Any suggestions to have incfile.php parsed only if needed? I am using PHP Version 4.3.4 as Module, Apache/2.0.48, on Windows 2000. If you do this ... ?php $includefiles=0; if($includefiles==1) { include('incfile.php'); } ? ... does 'incfile.php' get included? If yes, you've probably found a bug in PHP. If no then you've got a bug in your code. -- Jason Wong - Gremlins Associates - www.gremlins.biz Open Source Software Systems Integrators * Web Design Hosting * Internet Intranet Applications Development * -- Search the list archives before you post http://marc.theaimsgroup.com/?l=php-general -- /* Dentist, n.: A Prestidigitator who, putting metal in one's mouth, pulls coins out of one's pockets. -- Ambrose Bierce, The Devil's Dictionary */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Reading a image resource
On Tuesday 16 March 2004 23:55, Ewout de Boer wrote: Is there a function to get the raw image data from a image resource ? (resource created by imagecreatefrom) I want to read and manipulate an image from a file and store it in a database without the use of a temp. file One thing you can try is to use the output buffer functions to grab the output of imagejpeg(), imagepng() or whatever. I've never done it before so let us know if it works (although there's no reason why it shouldn't). -- Jason Wong - Gremlins Associates - www.gremlins.biz Open Source Software Systems Integrators * Web Design Hosting * Internet Intranet Applications Development * -- Search the list archives before you post http://marc.theaimsgroup.com/?l=php-general -- /* Is truth not truth for all? -- Natira, For the World is Hollow and I have Touched the Sky, stardate 5476.4. */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] array $_POST problem
On Tuesday 16 March 2004 12:16, thou spake: You're the Joey Kelly who runs the LUG in NoLA, yes? Yes, that's me. Have you been to one of our meetings lately? We redid our website recently: http://www.nolug.org Thanks for saying hi :-) snip Upon post, you need to get materials as such: $materials = $_POST['materials']; That looks interesting (using the , etc.) I'll have to look into that. What the problem ended up being was bad syntax. I was using $materials[quantity][1] = $_POST[$materials][quantity][1]; instead of $materials[quantity][1] = $_POST[materials][quantity][1]; ...using a variable instead of a string to reference the array. snip Personally, I'd rename your form elements to: $materials[$item][quantity] $materials[$item][price] $materials[$item][description] Chris Excellent idea. In truth, I just picked up this project again after 1.5 years, so I expect to find other newbie mistakes in it. FYI, the project (WebInvoicer) is listed on my projects page, and I expect to release a new version of it (I'm refactoring it completely, and it will have the MySQL backend, etc.) in a few weeks. I'll probably post it on freshmeat, as well. Thanks to all who offered their suggestions :-) -- Joey Kelly Minister of the Gospel | Linux Consultant http://joeykelly.net I may have invented it, but Bill made it famous. --- David Bradley, the IBM employee that invented CTRL-ALT-DEL -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] mail() to own domain not working
Gerard L Petersen wrote: Hi all Im having a problem with sending mails using the mail function to my own domain. Mails to any other domain works perfectly. Also our mail server sitting on a different machine. Any ideas how to fix this? If you are getting any php related error messages please post those error messages to the list. If you are not getting any PHP errors please look at your mail server log file for details on what's happening. It could be purely a server configuration issue in which case you will have to post the message to a mailing list/newsgroup related your mail server. -- Raditha Dissanayake. --- http://www.radinks.com/upload/ Drag and Drop Upload thousands of files and folders in a single transfer. (HTTP or FTP) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Simple: Whats wrong with this?
I have a form variable I want to increment by a value of 1 each time the page loads. Here's what I have so far: if(!isset($correct)) { $correct = 0; } else { $correct = $correct++; } Seems like it should work? Thanks! Shane -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Simple: Whats wrong with this?
No. $correct++; Is all you need for the second condition, it automatically sets itself back. On Wed, 2004-03-17 at 11:52, Shane McBride wrote: I have a form variable I want to increment by a value of 1 each time the page loads. Here's what I have so far: if(!isset($correct)) { $correct = 0; } else { $correct = $correct++; } Seems like it should work? Thanks! Shane -- Adam Voigt [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Simple: Whats wrong with this?
No. $correct++; Is all you need for the second condition, it automatically sets itself back. Does this always work? In my timesheet app, I have to do $counter = $counter + 1, because for some reason the $counter++; doesn't work. It just doesn't work, no incrementation of the variable. Is there something in php.ini that can prohibit this from working? Thanks, Jake -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] PDF Creating
I'm looking into this and getting all my ducks in a row before I get buried here, but I'm hoping you guys might have the answers since so far my search has been fruitless. I have the PDF librarys from FPDF and from Potential Tech, I have not decided which one to use yet. If you follow this and the PHP-DB list you'll see that I have been building an online quote system for the office for the last 6 months (on and off) and what I need to do now is create PDF files from the quotes that I can then send to a fax program to be faxed out to the customers. The information will be emailed as well, but I want to create PDF files for the fax software to use, and to save for use later (if needed). My question is how to I know how/where the pages will break, and how can I make the generation of the PDF files work automagically? The first page will always have a header set of information, and then the quote following it, all other pages will just have the quoted items. Thoughts? TIA!! Robert -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Simple: Whats wrong with this?
It doesn't seem to work either way for me. Shane -Original Message- From: Jake McHenry [mailto:[EMAIL PROTECTED] Sent: Wednesday, March 17, 2004 12:01 PM To: [EMAIL PROTECTED] Subject: Re: [PHP] Simple: Whats wrong with this? No. $correct++; Is all you need for the second condition, it automatically sets itself back. Does this always work? In my timesheet app, I have to do $counter = $counter + 1, because for some reason the $counter++; doesn't work. It just doesn't work, no incrementation of the variable. Is there something in php.ini that can prohibit this from working? Thanks, Jake -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Simple: Whats wrong with this?
Not that I'm aware of. In every incantation I've ever seen of the incrementing, $correct++; Is always, 100% equal to: $correct = ($correct + 1); But, maybe you ran into a case where it's not, you never know. On Wed, 2004-03-17 at 12:00, Jake McHenry wrote: No. $correct++; Is all you need for the second condition, it automatically sets itself back. Does this always work? In my timesheet app, I have to do $counter = $counter + 1, because for some reason the $counter++; doesn't work. It just doesn't work, no incrementation of the variable. Is there something in php.ini that can prohibit this from working? Thanks, Jake -- Adam Voigt [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Simple: Whats wrong with this?
This drove me nuts for a while and instead of doing $variable++ I started using ++$variable and never had the problem again. --Sam Jake McHenry wrote: No. $correct++; Is all you need for the second condition, it automatically sets itself back. Does this always work? In my timesheet app, I have to do $counter = $counter + 1, because for some reason the $counter++; doesn't work. It just + doesn't work, no incrementation of the variable. Is there something in php.ini that can prohibit this from working? Thanks, Jake -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PDF Creating
I don't know if this is still the case, but when I was using the PDF library to generate PDF's, the only way to know when to stop the current page and start the next, was by keeping track of what your pixel position on the page was, and if you were within such and such of the margin, you should call the close page, and open new page functions. On Wed, 2004-03-17 at 11:59, Robert Sossomon wrote: I'm looking into this and getting all my ducks in a row before I get buried here, but I'm hoping you guys might have the answers since so far my search has been fruitless. I have the PDF librarys from FPDF and from Potential Tech, I have not decided which one to use yet. If you follow this and the PHP-DB list you'll see that I have been building an online quote system for the office for the last 6 months (on and off) and what I need to do now is create PDF files from the quotes that I can then send to a fax program to be faxed out to the customers. The information will be emailed as well, but I want to create PDF files for the fax software to use, and to save for use later (if needed). My question is how to I know how/where the pages will break, and how can I make the generation of the PDF files work automagically? The first page will always have a header set of information, and then the quote following it, all other pages will just have the quoted items. Thoughts? TIA!! Robert -- Adam Voigt [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Simple: Whats wrong with this?
Well I accidentally deleted your original email, but I didn't see where you were getting the counter variable from. Where is the variable being stored? You do know that setting $counter++ for one visitor, doesn't translate the value of $counter to another, right? On Wed, 2004-03-17 at 12:05, Shane McBride wrote: It doesn't seem to work either way for me. Shane -Original Message- From: Jake McHenry [mailto:[EMAIL PROTECTED] Sent: Wednesday, March 17, 2004 12:01 PM To: [EMAIL PROTECTED] Subject: Re: [PHP] Simple: Whats wrong with this? No. $correct++; Is all you need for the second condition, it automatically sets itself back. Does this always work? In my timesheet app, I have to do $counter = $counter + 1, because for some reason the $counter++; doesn't work. It just doesn't work, no incrementation of the variable. Is there something in php.ini that can prohibit this from working? Thanks, Jake -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- Adam Voigt [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re[2]: [PHP] Simple: Whats wrong with this?
Hello Jake, Wednesday, March 17, 2004, 5:00:52 PM, you wrote: $correct++; JM Does this always work? In my timesheet app, I have to do $counter = $counter JM + 1, because for some reason the $counter++; doesn't work. It just doesn't JM work, no incrementation of the variable. Is there something in php.ini that JM can prohibit this from working? ++ is a _post_ increment. This means it'll returns $correct first and then increment it by one. There is a section in the PHP manual on this (search for Incrementing/Decrementing Operators. -- Best regards, Richard Davey http://www.phpcommunity.org/wiki/296.html -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Simple: Whats wrong with this?
Maybe you guys should take a read about pre- and post-increment :-) Sam Masiello wrote: This drove me nuts for a while and instead of doing $variable++ I started using ++$variable and never had the problem again. --Sam Jake McHenry wrote: No. $correct++; Is all you need for the second condition, it automatically sets itself back. Does this always work? In my timesheet app, I have to do $counter = $counter + 1, because for some reason the $counter++; doesn't work. It just + doesn't work, no incrementation of the variable. Is there something in php.ini that can prohibit this from working? Thanks, Jake -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Simple: Whats wrong with this?
Jake McHenry mailto:[EMAIL PROTECTED] on Wednesday, March 17, 2004 9:01 AM said: Does this always work? In my timesheet app, I have to do $counter = $counter + 1, because for some reason the $counter++; doesn't work. It just doesn't work, no incrementation of the variable. Is there something in php.ini that can prohibit this from working? $var++ is a post incrementer meaning the value is updated at the next command*. ++$var is a pre increment meaning the value is updated immediately. is it possible you are expecting the results of ++$var? try this and see what happens: ?php $var = 2; echo $var++ . br; echo ++$var . br; ? also, i don't know of anything in the php.ini that would turn this short hand off. seems unlikely that there is. chris. * i'm not exactly sure how the compiler determines when to post increment, but i think i'm correct. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re[2]: [PHP] Simple: Whats wrong with this?
Hello Sam, Wednesday, March 17, 2004, 5:04:21 PM, you wrote: SM This drove me nuts for a while and instead of doing $variable++ I SM started using ++$variable and never had the problem again. Yes, that's a pre-increment operator. Quite different to a post-increment. You need to use the right one depending if your variable exists already, etc. -- Best regards, Richard Davey http://www.phpcommunity.org/wiki/296.html -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Advanced PHP Programming by George Schlossnagle
Filip de Waard mailto:[EMAIL PROTECTED] on Wednesday, March 17, 2004 7:20 AM said: Hey guys. hi. I instantly started to read and I'm very happy with the quality and level of the book. Of course I haven't read the complete book yet, but from what I've read so far this was money well spent. where can we get more information and what online shop did you buy it from? chris. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] PDF Creating
[snip] My question is how to I know how/where the pages will break, and how can I make the generation of the PDF files work automagically? The first page will always have a header set of information, and then the quote following it, all other pages will just have the quoted items. [/snip] My experience has been that the FPDF class will automagicly go to the next page. You can also play with the function SetAutoPageBreak (see their online documentation for this function's details) for a bit more customization. What I usually end up doing for a customized page break is loop through the data setting a counter and then when the counter gets to the point where it needs to break use the AddPage function. Basicly it involves a lot of trial and error, but it should be able to accomplish what you need. HTH! Daniel -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Simple: Whats wrong with this?
I am just trying to get the variable to increment, than I will be working on a session. It's basically being used to keep track of correct/incorrect answers for an online quiz. Here's what I am trying: if(!isset($correct)) { $correct = 0; } else { $correct++ } Shane -Original Message- From: Adam Voigt [mailto:[EMAIL PROTECTED] Sent: Wednesday, March 17, 2004 12:06 PM To: Shane McBride Cc: PHP Subject: RE: [PHP] Simple: Whats wrong with this? Well I accidentally deleted your original email, but I didn't see where you were getting the counter variable from. Where is the variable being stored? You do know that setting $counter++ for one visitor, doesn't translate the value of $counter to another, right? On Wed, 2004-03-17 at 12:05, Shane McBride wrote: It doesn't seem to work either way for me. Shane -Original Message- From: Jake McHenry [mailto:[EMAIL PROTECTED] Sent: Wednesday, March 17, 2004 12:01 PM To: [EMAIL PROTECTED] Subject: Re: [PHP] Simple: Whats wrong with this? No. $correct++; Is all you need for the second condition, it automatically sets itself back. Does this always work? In my timesheet app, I have to do $counter = $counter + 1, because for some reason the $counter++; doesn't work. It just doesn't work, no incrementation of the variable. Is there something in php.ini that can prohibit this from working? Thanks, Jake -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- Adam Voigt [EMAIL PROTECTED] -- 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 vs Algorithm
Firman Wandayandi mailto:[EMAIL PROTECTED] on Wednesday, March 17, 2004 12:22 AM said: I want to make algorithm representation of my code for my homework, but I have no idea to convert PHP code to algorithm. Can anyone help me? i think your problem is that you are misunderstanding the definition of the word algorithm[1]. you can't convert your php code into an algorithm because it already is one. what you can do is represent this algorithm in another form, say pictures (flowchart) or a written language. so in this case.. what are your requirements for representing this algorithm? chris. [1] http://www.webopedia.com/TERM/A/algorithm.htm -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: Re[2]: [PHP] Simple: Whats wrong with this?
On Thursday 18 March 2004 01:07, Richard Davey wrote: ++ is a _post_ increment. This means it'll returns $correct first and then increment it by one. There is a section in the PHP manual on this (search for Incrementing/Decrementing Operators. Whether it's pre or post depends on whether it is placed before the variable in question or after. $doo++ !== ++$doo -- Jason Wong - Gremlins Associates - www.gremlins.biz Open Source Software Systems Integrators * Web Design Hosting * Internet Intranet Applications Development * -- Search the list archives before you post http://marc.theaimsgroup.com/?l=php-general -- /* Marxist Law of Distribution of Wealth: Shortages will be divided equally among the peasants. */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Help with adding an image to a table row
I have the following snippet of code that I cannot seem to find a way to add an image to a TR. The line in question is the first one under the else statement: print TR BGCOLOR=\#381499\; This line, I would like to show a image called backgrnd.png instead of a backgound color. Any help would be much appreciated Thanks Mark ? if ($page == printerFriendly): print TR style=\background-color: #FF;\; print TD style=\padding: 5px; padding-right: 0px; padding-bottom: 10px; padding-left: 5px; width: 70px;\; print a href=\index.php\IMG src=\images/logo.gif\ ALT=\Staff Database\ border=\0\/a; print /td; print TDDIV CLASS=\logo_large\ style=\color: ##FF;\BStaff Database/B/DIVDIV CLASS=\logo_small\ style=\color: #000;\Staff tracking made easier/div/TD; print /TR; else: print TR BGCOLOR=\#381499\; print TD style=\padding: 10px; width: 170px;\; print a href=\index.php\IMG src=\images/logo.gif\ border=\0\/a; print /td; print TDDIV CLASS=\logo_large\BStaff Database/B/DIVDIV CLASS=\logo_small\Staff tracking made easier/div/TD; print /TR; ? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PDF Creating
On Thursday 18 March 2004 00:59, Robert Sossomon wrote: I have the PDF librarys from FPDF and from Potential Tech, I have not decided which one to use yet. Have you tried pc4p? [snip] My question is how to I know how/where the pages will break, and how can I make the generation of the PDF files work automagically? The first page will always have a header set of information, and then the quote following it, all other pages will just have the quoted items. IIRC pc4p will allow you to do that, at the least it will handle the page breaks for you automatically. -- Jason Wong - Gremlins Associates - www.gremlins.biz Open Source Software Systems Integrators * Web Design Hosting * Internet Intranet Applications Development * -- Search the list archives before you post http://marc.theaimsgroup.com/?l=php-general -- /* Keep it short for pithy sake. */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Simple: Whats wrong with this?
Shane McBride mailto:[EMAIL PROTECTED] on Wednesday, March 17, 2004 9:16 AM said: I am just trying to get the variable to increment, than I will be working on a session. It's basically being used to keep track of correct/incorrect answers for an online quiz. and so now that you've corrected your code what are the results you are getting? are they not what you expect/want? chris. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: Re[2]: [PHP] Simple: Whats wrong with this?
On Wed, 2004-03-17 at 12:19, Jason Wong wrote: On Thursday 18 March 2004 01:07, Richard Davey wrote: ++ is a _post_ increment. This means it'll returns $correct first and then increment it by one. There is a section in the PHP manual on this (search for Incrementing/Decrementing Operators. Whether it's pre or post depends on whether it is placed before the variable in question or after. $doo++ !== ++$doo But ++$doo === $doo++ *heheh* Rob. -- .. | InterJinn Application Framework - http://www.interjinn.com | :: | An application and templating framework for PHP. Boasting | | a powerful, scalable system for accessing system services | | such as forms, properties, sessions, and caches. InterJinn | | also provides an extremely flexible architecture for | | creating re-usable components quickly and easily. | `' -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Help with adding an image to a table row
background= Mark wrote: I have the following snippet of code that I cannot seem to find a way to add an image to a TR. The line in question is the first one under the else statement: print TR BGCOLOR=\#381499\; This line, I would like to show a image called backgrnd.png instead of a backgound color. Any help would be much appreciated Thanks Mark ? if ($page == printerFriendly): print TR style=\background-color: #FF;\; print TD style=\padding: 5px; padding-right: 0px; padding-bottom: 10px; padding-left: 5px; width: 70px;\; print a href=\index.php\IMG src=\images/logo.gif\ ALT=\Staff Database\ border=\0\/a; print /td; print TDDIV CLASS=\logo_large\ style=\color: ##FF;\BStaff Database/B/DIVDIV CLASS=\logo_small\ style=\color: #000;\Staff tracking made easier/div/TD; print /TR; else: print TR BGCOLOR=\#381499\; print TD style=\padding: 10px; width: 170px;\; print a href=\index.php\IMG src=\images/logo.gif\ border=\0\/a; print /td; print TDDIV CLASS=\logo_large\BStaff Database/B/DIVDIV CLASS=\logo_small\Staff tracking made easier/div/TD; print /TR; ? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Help with adding an image to a table row
Mark mailto:[EMAIL PROTECTED] on Wednesday, March 17, 2004 9:24 AM said: Any help would be much appreciated as this is not a php related question and that this is a very basic question it would be most beneficial for you to join a list like thelist from http://evolt.org or webdesign-l (i forgot where it's from). i'll give you a hint: css is your friend. chris. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] header() vs. fsockopen for Location: http:www.d.com....
Hi! Let's say there are 3 webpages with webpage #1 for customer filling out the form and submit it to webpage #2 for processing and database insert/update then php header(Location: http://www.whatever.com;) to redirect the webapge to webpage #3. (or back to webpage #1). That way, the web-browser doesn't have a history of webpage #2, so the database is immune to browser's refresh/back/forward button (from database duplication). Now I have people telling me that it is not healthy to use the header(Location: blah blah) to force the web browser to redirect and that I should use the fsockopen instead. A fsockopen on webpage #2 on the Apache's side where PHP can open a port to send a request to apache to have it to send a webpage #3 to the web browser. That sound okay to me but I see one big problem. If fsockopen is used on webpage #2 to emulate a webpage #3 then the web browser only see webpage #2 and webpage #3 together as webpage #2. I see no idea workaround to it, in fact there is none. So, it look like I have to stick to header(Location: blah blah). So, what is your thought and opinion. If there is a workaround them I'm all ear!. FletchSOD -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Simple: Whats wrong with this?
No, the value still is not incrementing. -Original Message- From: Chris W. Parker [mailto:[EMAIL PROTECTED] Sent: Wednesday, March 17, 2004 12:25 PM To: Shane McBride; PHP; [EMAIL PROTECTED] Subject: RE: [PHP] Simple: Whats wrong with this? Shane McBride mailto:[EMAIL PROTECTED] on Wednesday, March 17, 2004 9:16 AM said: I am just trying to get the variable to increment, than I will be working on a session. It's basically being used to keep track of correct/incorrect answers for an online quiz. and so now that you've corrected your code what are the results you are getting? are they not what you expect/want? chris. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Simple: Whats wrong with this?
Shane McBride mailto:[EMAIL PROTECTED] on Wednesday, March 17, 2004 9:40 AM said: No, the value still is not incrementing. then you must be resetting it unknowingly or the else block in your if..else statement is not being executed like you are expecting it to be. one thing i do to debug this kind of thing is to add some echo statements to the different code blocks to see what's happening. for example: if($expression) { echo here i am!; blow_up_world(); } else { echo y hello thar!; eat_cheese(); } then when i execute the page i know what i am expecting and i can compare that to what i am *actually* getting. for example, if i am expecting to see here i am! but instead i see y hello thar! i can know that something is going wrong with my expression. hth, chris. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Help with adding an image to a table row
On Wed, 2004-03-17 at 12:23, Mark wrote: I have the following snippet of code that I cannot seem to find a way to add an image to a TR. The line in question is the first one under the else statement: print TR BGCOLOR=\#381499\; This line, I would like to show a image called backgrnd.png instead of a backgound color. This has nothing to do with PHP. Try applying a style property to this element instead. tr style=background-image: url(path/to/file/foo.bar); -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Advanced PHP Programming by George Schlossnagle
Hi Am Mi, 2004-03-17 um 18.12 schrieb Chris W. Parker: Filip de Waard mailto:[EMAIL PROTECTED] on Wednesday, March 17, 2004 7:20 AM said: Hey guys. hi. I instantly started to read and I'm very happy with the quality and level of the book. Of course I haven't read the complete book yet, but from what I've read so far this was money well spent. where can we get more information and what online shop did you buy it from? google, or in this case amazon, is your friend: http://www.amazon.com/exec/obidos/tg/detail/-/0672325616/qid=1079545591/sr=1-1/ref=sr_1_1/104-5140796-2114329?v=glances=books -- Regards Marco -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Simple: Whats wrong with this?
I didn't post it, I just added on to someone elses question. I do use counter++; in other scripts, but it's only in my timesheet app that it doesn't work. It's very odd, so I just made them all $counter = $counter + 1; I didn't have time to mess with it. Was just asking. $counter is initially set to 0, then after a mysql_query(), in the while loop for mysql_fetch_array I was trying $counter++; like I do in my other scripts. But in this case, it didn't work. I just wanted to see if anyone knew why. I'll try the pre increment. Maybe that'll work. It wasn't a big deal, as long as it worked. Jake - Original Message - From: Adam Voigt [EMAIL PROTECTED] To: Shane McBride [EMAIL PROTECTED] Cc: PHP [EMAIL PROTECTED] Sent: Wednesday, March 17, 2004 12:05 PM Subject: RE: [PHP] Simple: Whats wrong with this? Well I accidentally deleted your original email, but I didn't see where you were getting the counter variable from. Where is the variable being stored? You do know that setting $counter++ for one visitor, doesn't translate the value of $counter to another, right? Does this always work? In my timesheet app, I have to do $counter = $counter + 1, because for some reason the $counter++; doesn't work. It just doesn't work, no incrementation of the variable. Is there something in php.ini that can prohibit this from working? Thanks, Jake -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Advanced PHP Programming by George Schlossnagle
Am Mi, 2004-03-17 um 18.12 schrieb Chris W. Parker: Filip de Waard mailto:[EMAIL PROTECTED] on Wednesday, March 17, 2004 7:20 AM said: Hey guys. hi. I instantly started to read and I'm very happy with the quality and level of the book. Of course I haven't read the complete book yet, but from what I've read so far this was money well spent. where can we get more information and what online shop did you buy it from? http://phpclasses.tmoby.com/reviews/id/0672325616.html -- Regards Marco -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PDF Creating
We had a similar issue ourselves, we finally solved it using htmldoc to build the pdf from a custom html file. It allows you to explicitly say where you want to split the document, or to rely upon itself to break the stuff into pages. -- __ Vicente Antonio Sánchez Werner ( [EMAIL PROTECTED] ) Fijo: +34-923185650 Movil: +34-66865 Director Depto Informática, Desarrollo y Seguridad Informática Wap Comunicaciones S.L. C/Guadalajara nº9-11 37003 Salamanca (España) -- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Advanced PHP Programming by George Schlossnagle
Marco Schuler mailto:[EMAIL PROTECTED] on Wednesday, March 17, 2004 9:18 AM said: google, or in this case amazon, is your friend: yes i am well aware of google and amazon but i just wanted to get george some extra exposure by getting a link into an email. maybe to the publishers homepage or wherever. chris. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Regular expression checker
Hello all, For a while I tried in vain to find a decent regular expression tester. The closest I found was RegExpEditor, by the same people who produce PHPEdit, but I found it to be slow and didn't like its constant bitching about invalid delimiters or some such thing. Anyway, I ended up writing a little tester for Perl-compatible regular expressions and thought I'd share it with you. Maybe it'll come in handy to people who often need to use regular expressions in their projects. Just copy the code below the dotted line (which has Unix line breaks) and save it to a file. Cheers, Erik html head meta http-equiv=Content-Type content=text/html; charset=iso-8859-1 titleRegular Expression Tester/title ?php( isset($_POST['text']) isset($_POST['regexp']) ) { $error = false; if($_POST['mode'] == 'one') { if( @preg_match('/'.$_POST['regexp'].'/', $_POST['text'], $matches) === false ) { $error = true; } } else { if( @preg_match_all('/'.$_POST['regexp'].'/', $_POST['text'], $matches) === false ) { $error = true; } } } ? /head body style=font-family:Verdana, Arial, Helvetica, sans-serif; font-size:12px; form action=?php print $_SERVER['PHP_SELF']; ? method=post enctype=multipart/form-data table width=750 tr td width=135div align=rightRegular expression:/div/td td width=591 input name=regexp type=text size=87 ?php if( isset($_POST['regexp']) ) {print 'value='.$_POST['regexp'].'';} ? / /td /tr tr td width=135div align=rightText:/div/td td width=591 textarea name=text rows=6 cols=65 ?php if( isset($_POST['text']) ) {print $_POST['text'];} ? /textarea /td /tr tr td width=135div align=rightMode:/div/td td width=591 select name=mode option value=one ?php( isset($_POST['mode']) $_POST['mode'] == 'one' ) { print 'selected'; } ? First match/option option value=all ?php( isset($_POST['mode']) $_POST['mode'] == 'all' ) { print 'selected'; } ? All matches/option /select /td /tr tr td width=135nbsp;/td tdinput type=submit value=RUN TEST/ nbsp;nbsp;nbsp; input type=reset value=CLEAR FORM//td /tr /table /form p/ div style=background-color:#00; color:#FF; table width=750 border=10 bordercolor=#00 ?php($error) { exit('trtdspan style=color: lime; font-weight: bold;'. 'Invalid regular expression!/span/td/tr'); } ( isset($matches) !empty($matches[0]) ) { print 'trtd colspan=2 style=font-weight:bold;Full match(es):/td/tr'. 'trtd colspan=2nbsp;/td/tr'; if( !is_array($matches[0]) ) { print 'tr'. 'td width=25 style=font-weight: bold;1/td'.\n. 'td'.htmlentities($matches[0]).'/td'. 'tr/'; } else { foreach($matches[0] as $key = $val) { print 'td width=25 style=font-weight: bold;'.($key+1). '/td'.\n.'td'.htmlentities($val).'/td'.\n. '/tr'; } } } { print 'trtdspan style=color: lime; font-weight: bold;'. 'No matches found./span/td/tr'; } ( isset($matches[1]) !empty($matches[1]) ) { print 'tr width=100%td colspan=2nbsp;/td/tr'. 'tr width=100%td colspan=2hr//td/tr'. 'tr width=100%td colspan=2nbsp;/td/tr'. 'tr width=100%td colspan=2 style=font-weight:bold;'. 'Sub-pattern match(es):/td/tr'. 'tr width=100%td colspan=2nbsp;/td/tr'; for($i = 1; $i count($matches); $i++) { if( !is_array($matches[$i]) ) { print 'tr width=100%'. 'td width=25 style=font-weight: bold;'.$i.'/td'.\n. 'td'.htmlentities($matches[$i]).'/td'. '/tr'; } else { foreach($matches[$i] as $key = $val) { print 'tr width=100%'. 'td width=25 style=font-weight: bold;'.$i.'.'.($key+1). '/td'.\n.'td'.htmlentities($val).'/td'.\n. '/tr'; } } if( isset($matches[$i+1]) ) { print 'tr
RE: [PHP] Advanced PHP Programming by George Schlossnagle
Hi Am Mi, 2004-03-17 um 19.14 schrieb Chris W. Parker: Marco Schuler mailto:[EMAIL PROTECTED] on Wednesday, March 17, 2004 9:18 AM said: google, or in this case amazon, is your friend: yes i am well aware of google and amazon but i just wanted to get george some extra exposure by getting a link into an email. maybe to the publishers homepage or wherever. I hope that the second link I posted was something you were looking for. -- Regards Marco -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Regular expression checker
an excelent tool: The Regex Coach, its free and you can grab it from http://weitz.de/regex-coach/ and its available for windows and linux! luis. [EMAIL PROTECTED] escribió en el mensaje news:[EMAIL PROTECTED] Hello all, For a while I tried in vain to find a decent regular expression tester. The closest I found was RegExpEditor, by the same people who produce PHPEdit, but I found it to be slow and didn't like its constant bitching about invalid delimiters or some such thing. Anyway, I ended up writing a little tester for Perl-compatible regular expressions and thought I'd share it with you. Maybe it'll come in handy to people who often need to use regular expressions in their projects. Just copy the code below the dotted line (which has Unix line breaks) and save it to a file. Cheers, Erik html head meta http-equiv=Content-Type content=text/html; charset=iso-8859-1 titleRegular Expression Tester/title ?php( isset($_POST['text']) isset($_POST['regexp']) ) { $error = false; if($_POST['mode'] == 'one') { if( @preg_match('/'.$_POST['regexp'].'/', $_POST['text'], $matches) === false ) { $error = true; } } else { if( @preg_match_all('/'.$_POST['regexp'].'/', $_POST['text'], $matches) === false ) { $error = true; } } } ? /head body style=font-family:Verdana, Arial, Helvetica, sans-serif; font-size:12px; form action=?php print $_SERVER['PHP_SELF']; ? method=post enctype=multipart/form-data table width=750 tr td width=135div align=rightRegular expression:/div/td td width=591 input name=regexp type=text size=87 ?php if( isset($_POST['regexp']) ) {print 'value='.$_POST['regexp'].'';} ? / /td /tr tr td width=135div align=rightText:/div/td td width=591 textarea name=text rows=6 cols=65 ?php if( isset($_POST['text']) ) {print $_POST['text'];} ? /textarea /td /tr tr td width=135div align=rightMode:/div/td td width=591 select name=mode option value=one ?php( isset($_POST['mode']) $_POST['mode'] == 'one' ) { print 'selected'; } ? First match/option option value=all ?php( isset($_POST['mode']) $_POST['mode'] == 'all' ) { print 'selected'; } ? All matches/option /select /td /tr tr td width=135nbsp;/td tdinput type=submit value=RUN TEST/ nbsp;nbsp;nbsp; input type=reset value=CLEAR FORM//td /tr /table /form p/ div style=background-color:#00; color:#FF; table width=750 border=10 bordercolor=#00 ?php($error) { exit('trtdspan style=color: lime; font-weight: bold;'. 'Invalid regular expression!/span/td/tr'); } ( isset($matches) !empty($matches[0]) ) { print 'trtd colspan=2 style=font-weight:bold;Full match(es):/td/tr'. 'trtd colspan=2nbsp;/td/tr'; if( !is_array($matches[0]) ) { print 'tr'. 'td width=25 style=font-weight: bold;1/td'.\n. 'td'.htmlentities($matches[0]).'/td'. 'tr/'; } else { foreach($matches[0] as $key = $val) { print 'td width=25 style=font-weight: bold;'.($key+1). '/td'.\n.'td'.htmlentities($val).'/td'.\n. '/tr'; } } } { print 'trtdspan style=color: lime; font-weight: bold;'. 'No matches found./span/td/tr'; } ( isset($matches[1]) !empty($matches[1]) ) { print 'tr width=100%td colspan=2nbsp;/td/tr'. 'tr width=100%td colspan=2hr//td/tr'. 'tr width=100%td colspan=2nbsp;/td/tr'. 'tr width=100%td colspan=2 style=font-weight:bold;'. 'Sub-pattern match(es):/td/tr'. 'tr width=100%td colspan=2nbsp;/td/tr'; for($i = 1; $i count($matches); $i++) { if( !is_array($matches[$i]) ) { print 'tr width=100%'. 'td width=25 style=font-weight: bold;'.$i.'/td'.\n. 'td'.htmlentities($matches[$i]).'/td'. '/tr'; } else { foreach($matches[$i] as $key = $val) { print 'tr width=100%'. 'td width=25 style=font-weight: bold;'.$i.'.'.($key+1). '/td'.\n.'td'.htmlentities($val).'/td'.\n. '/tr'; } } if( isset($matches[$i+1]) ) { print 'tr width=100%td colspan=2nbsp;/td/tr'; } } } ? /table /div /body /html -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Regex help - PLease
Sorry I to should have added this this is what im going with so far preg_match(/\d100.*/); This will match a digit, followed by '100', followed by anything. Go with Rob's suggestion. - michal migurski- contact info and pgp key: sf/cahttp://mike.teczno.com/contact.html -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: [ERR] Re: [PHP] php crash and memory_limit
No, none at all. Not even any sugestions from anyone what to do. I am stuck. [EMAIL PROTECTED] wrote: Transmit Report: To: [EMAIL PROTECTED], 2004/03/18 03:17:48, 999, »ó´ë¹æ ¼ö½Å¼¹ö Á¢¼Ó½Ã°£ ÃÊ°ú Subject: Re: [PHP] php crash and memory_limit From: kringla [EMAIL PROTECTED] Date: Tue, 02 Mar 2004 00:47:24 +0100 To: [EMAIL PROTECTED] No solution? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] MySQL Connect Problem
Hey guys, I've been developing my site on a dev server with MySQL locally installed. I've now moved the site to the production webserver and setup my databases on the production dbserver, which are two different machines. I have begin updating my connection variables and now I find I can't connect to the database from within PHP. MySQL is installed on the webserver, but not running as a daemon. If I run the mysql client and use the -h option, I can connect to the database with no problems from the webserver. I've tried manually specifying the port, tried hostname and ip address, made sure safe_mode is off and I'm not having any luck. I've checked in the phpinfo function and confirmed MySQL support is compiled in: MySQL Support enabled Active Persistent Links 0 Active Links 0 Client API version 4.0.16 MYSQL_MODULE_TYPE external MYSQL_SOCKET /tmp/mysql.sock MYSQL_INCLUDE -I/usr/local/mysql/include MYSQL_LIBS -L/usr/local/mysql/lib -lmysqlclient Directive Local Value Master Value mysql.allow_persistent On On mysql.connect_timeout 60 60 mysql.default_host no value no value mysql.default_password no value no value mysql.default_port no value no value mysql.default_socket no value no value mysql.default_user no value no value mysql.max_links Unlimited Unlimited mysql.max_persistent Unlimited Unlimited mysql.trace_mode Off Off Can anyone give me ideas to get this working? I must admit, I'm stumped. Here's the mysql_error: Can't connect to MySQL server on '192.168.1.44' From the webserver error log: php4_execute reports: PHP Warning: mysql_connect(): Can't connect to MySQL server on '192.168.1.44' (2) Thanks, Cameron -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] MySQL Connect Problem
What happens when you try to use the mysql client on the web machine, to connect to the production database server? Does it work? If yes, what lines are you using to connect to your DB with PHP? On Wed, 2004-03-17 at 14:54, Cameron B. Prince wrote: Hey guys, I've been developing my site on a dev server with MySQL locally installed. I've now moved the site to the production webserver and setup my databases on the production dbserver, which are two different machines. I have begin updating my connection variables and now I find I can't connect to the database from within PHP. MySQL is installed on the webserver, but not running as a daemon. If I run the mysql client and use the -h option, I can connect to the database with no problems from the webserver. I've tried manually specifying the port, tried hostname and ip address, made sure safe_mode is off and I'm not having any luck. I've checked in the phpinfo function and confirmed MySQL support is compiled in: MySQL Support enabled Active Persistent Links 0 Active Links 0 Client API version 4.0.16 MYSQL_MODULE_TYPE external MYSQL_SOCKET /tmp/mysql.sock MYSQL_INCLUDE -I/usr/local/mysql/include MYSQL_LIBS -L/usr/local/mysql/lib -lmysqlclient Directive Local Value Master Value mysql.allow_persistent On On mysql.connect_timeout 60 60 mysql.default_host no value no value mysql.default_password no value no value mysql.default_port no value no value mysql.default_socket no value no value mysql.default_user no value no value mysql.max_links Unlimited Unlimited mysql.max_persistent Unlimited Unlimited mysql.trace_mode Off Off Can anyone give me ideas to get this working? I must admit, I'm stumped. Here's the mysql_error: Can't connect to MySQL server on '192.168.1.44' From the webserver error log: php4_execute reports: PHP Warning: mysql_connect(): Can't connect to MySQL server on '192.168.1.44' (2) Thanks, Cameron -- Adam Voigt [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] MySQL Connect Problem
Hi Adam, What happens when you try to use the mysql client on the web machine, to connect to the production database server? It works: bash-2.05# pwd /usr/local/mysql/bin bash-2.05# ./mysql -h 192.168.1.44 -u web -P 3306 -p Enter password: Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 41999 to server version: 3.23.54-log Type 'help;' or '\h' for help. Type '\c' to clear the buffer. mysql Does it work? If yes, what lines are you using to connect to your DB with PHP? $DBhost = 192.168.1.44:3306; $DBuser = web; $DBpwd = user; $DBreg = registration; $DBconf = config; $dbh = mysql_connect($DBhost, $DBuser, $DBpwd) or die(Could not connect : . mysql_error()); mysql_select_db($DBconf) or die(Could not select database); You notice anything wrong? Thanks, Cameron -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] MySQL Connect Problem
So what error prints out when you try and connect from PHP? On Wed, 2004-03-17 at 15:03, Cameron B. Prince wrote: Hi Adam, What happens when you try to use the mysql client on the web machine, to connect to the production database server? It works: bash-2.05# pwd /usr/local/mysql/bin bash-2.05# ./mysql -h 192.168.1.44 -u web -P 3306 -p Enter password: Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 41999 to server version: 3.23.54-log Type 'help;' or '\h' for help. Type '\c' to clear the buffer. mysql Does it work? If yes, what lines are you using to connect to your DB with PHP? $DBhost = 192.168.1.44:3306; $DBuser = web; $DBpwd = user; $DBreg = registration; $DBconf = config; $dbh = mysql_connect($DBhost, $DBuser, $DBpwd) or die(Could not connect : . mysql_error()); mysql_select_db($DBconf) or die(Could not select database); You notice anything wrong? Thanks, Cameron -- Adam Voigt [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] MySQL Connect Problem
So what error prints out when you try and connect from PHP? Could not connect : Can't connect to MySQL server on '192.168.1.44' (2) Not very helpful huh? Any ideas? Cameron -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] MySQL Connect Problem
Change your server address, to leave off the port number. Any different? On Wed, 2004-03-17 at 15:07, Cameron B. Prince wrote: So what error prints out when you try and connect from PHP? Could not connect : Can't connect to MySQL server on '192.168.1.44' (2) Not very helpful huh? Any ideas? Cameron -- Adam Voigt [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] MySQL Connect Problem
Change your server address, to leave off the port number. Any different? $DBhost = 192.168.1.44; $DBuser = web; $DBpwd = user; $DBreg = registration; $DBconf = config; # setup database handle and load configuration data $dbh = mysql_connect($DBhost, $DBuser, $DBpwd) or die(Could not connect : . mysql_error()); mysql_select_db($DBconf) or die(Could not select database); Could not connect : Can't connect to MySQL server on '192.168.1.44' (2) Same thing... What could be wrong here... Geez, this is starting to worry me. Thanks for your help, Cameron -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] MySQL Connect Problem
What does your MySQL error log say on your production database server? It should be in the var directory named something .err. On Wed, 2004-03-17 at 15:16, Cameron B. Prince wrote: Change your server address, to leave off the port number. Any different? $DBhost = 192.168.1.44; $DBuser = web; $DBpwd = user; $DBreg = registration; $DBconf = config; # setup database handle and load configuration data $dbh = mysql_connect($DBhost, $DBuser, $DBpwd) or die(Could not connect : . mysql_error()); mysql_select_db($DBconf) or die(Could not select database); Could not connect : Can't connect to MySQL server on '192.168.1.44' (2) Same thing... What could be wrong here... Geez, this is starting to worry me. Thanks for your help, Cameron -- Adam Voigt [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] MySQL Connect Problem - Client Lib / Server Version Skew
What does your MySQL error log say on your production database server? It should be in the var directory named something .err. These are SunFire 210 Solaris boxes. The MySQL is installed from binary. It doesn't write a log by default as best I can tell, but I did find something. The MySQL on the webserver is: mysql-standard-4.0.16-sun-solaris2.9-sparc The MySQL on the dbserver is: mysql-3.23.54a-sun-solaris2.8-sparc Do you think the version skew could cause this? Thanks, Cameron -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] MySQL Connect Problem - Client Lib / Server Version Skew
I would think the mysqlclient library would be backwards compatible, but it's possible I guess. I'm kind of out of ideas, as the can't connect error without something like a bad username or password message, seems to indicate a TCP/IP communication failure. On Wed, 2004-03-17 at 15:26, Cameron B. Prince wrote: What does your MySQL error log say on your production database server? It should be in the var directory named something .err. These are SunFire 210 Solaris boxes. The MySQL is installed from binary. It doesn't write a log by default as best I can tell, but I did find something. The MySQL on the webserver is: mysql-standard-4.0.16-sun-solaris2.9-sparc The MySQL on the dbserver is: mysql-3.23.54a-sun-solaris2.8-sparc Do you think the version skew could cause this? Thanks, Cameron -- Adam Voigt [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] js date picker
anyone knows a good javascript date picker, i need it to be compatible with all major browsers thx, luis. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Replace space from form field using preg_replace
I want to be able to replace a space that comes from a form field (such as in 123 My Street) with a + sign. Can anyone help me with this? Thanks -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Replace space from form field using preg_replace
http://www.php.net/str-replace On Wed, 2004-03-17 at 15:48, Vernon wrote: I want to be able to replace a space that comes from a form field (such as in 123 My Street) with a + sign. Can anyone help me with this? Thanks -- Adam Voigt [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Replace space from form field using preg_replace
str_replace( ,+,$var); -- red Vernon wrote: I want to be able to replace a space that comes from a form field (such as in 123 My Street) with a + sign. Can anyone help me with this? Thanks -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] MySQL Connect Problem - Client Lib / Server Version Skew
I would think the mysqlclient library would be backwards compatible, but it's possible I guess. I'm kind of out of ideas, as the can't connect error without something like a bad username or password message, seems to indicate a TCP/IP communication failure. Well, after thinking more about it, if there was a version skew problem, I would see the same results when I run it from the prompt, ie. ./mysql on the webserver. We know the network is open between the machines as the ./mysql test works and connects fine. I don't know much about the internals of PHP and it's ability to connect to remote hosts, but I think it's something to do with that. How can I check that? Thanks, Cameron -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Stupid question
I've been using PHP for about 6 months and I'm ok with it but I'm now starting to get into more advanced stuff and inheriting project that other people have coded. One of the major stumpers I have is any line of code that contains: $this- What does this do? I know it has something to do with classes but can't quite get my head around it. Thanks, Jeff -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: js date picker
This is a wee bit off topic, seeing as how this is a PHP mailing list. We'll be happy to help with PHP-related questions. As for JavaScript stuff, use Google to find a good resource. :-) Luis Mirabal wrote: anyone knows a good javascript date picker, i need it to be compatible with all major browsers thx, luis. -- Regards, Ben Ramsey http://benramsey.com http://www.phpcommunity.org/wiki/People/BenRamsey -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Stupid question
On Wed, 2004-03-17 at 15:55, Jeff McKeon wrote: I've been using PHP for about 6 months and I'm ok with it but I'm now starting to get into more advanced stuff and inheriting project that other people have coded. One of the major stumpers I have is any line of code that contains: $this- What does this do? I know it has something to do with classes but can't quite get my head around it. Thanks, Jeff It refers to the object upon which the class method was called. So outside of the class you might have: $foo = new FooClass(); $foo-doSomething(); then inside the class you might have the following: class FooClass { function doSomething() { $this-doSomethingElse(); } function doSomethingElse() { $foo = 1; return (++$foo === $foo++); // ;) } } Cheers, Rob. -- .. | InterJinn Application Framework - http://www.interjinn.com | :: | An application and templating framework for PHP. Boasting | | a powerful, scalable system for accessing system services | | such as forms, properties, sessions, and caches. InterJinn | | also provides an extremely flexible architecture for | | creating re-usable components quickly and easily. | `' -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Replace space from form field using preg_replace
If you're doing this to pass it through a URL, then use urlencode() http://www.php.net/urlencode Vernon wrote: I want to be able to replace a space that comes from a form field (such as in 123 My Street) with a + sign. Can anyone help me with this? Thanks -- Regards, Ben Ramsey http://benramsey.com http://www.phpcommunity.org/wiki/People/BenRamsey -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Stupid question
when you are working with classes and objects in php, and you are coding inside a class, you must use the $this variable to access the members of the class, for example: class test { //Class vars (something like properties) var $a; var $b; var $c; var $sum; //Class function (Constructor) function test() { $this-a = 'value for a'; $this-b = 'value for b'; $this-c = 'value for c'; $this-set(); } //Class function function set() { $sum = $this-a . $this-b . $this-c; } } //end class luis. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Stupid question
Jeff McKeon wrote: $this- What does this do? I know it has something to do with classes but can't quite get my head around it. You might want to check out this: http://ca.php.net/oop -- Aaron Gould Parts Canada - Web Developer -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Stupid question
Jeff McKeon wrote: I've been using PHP for about 6 months and I'm ok with it but I'm now starting to get into more advanced stuff and inheriting project that other people have coded. One of the major stumpers I have is any line of code that contains: $this- What does this do? I know it has something to do with classes but can't quite get my head around it. Thanks, Jeff I am not expert but I have a general idea of what it is and used for, for example you have a class named test. Inside that class you have a function named testfunc. If you were going to call that function you would use $this-testfunc(); *I think* I am sure you will get some more detailed explanations from the experts though :) I am new here so thought I would start to contribute. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: js date picker
i am using it from a php program... maybe i was not clear enough... but thanx, i found some at phpclasses.org Ben Ramsey [EMAIL PROTECTED] escribió en el mensaje news:[EMAIL PROTECTED] This is a wee bit off topic, seeing as how this is a PHP mailing list. We'll be happy to help with PHP-related questions. As for JavaScript stuff, use Google to find a good resource. :-) Luis Mirabal wrote: anyone knows a good javascript date picker, i need it to be compatible with all major browsers thx, luis. -- Regards, Ben Ramsey http://benramsey.com http://www.phpcommunity.org/wiki/People/BenRamsey -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Stupid question
If you were going to call that function you would use $this-testfunc(); You're on the right track. If you're going to call that function (or method) from within the class, then you use the $this. Also, you can use $this to access member variables from within the class. Outside of the class, you would need to access those methods or variables using the name of the object. Don't be afraid to contribute! It will even help you grow as a programmer to try to help others solve their coding problems. -- Regards, Ben Ramsey http://benramsey.com http://www.phpcommunity.org/wiki/People/BenRamsey -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Stupid question
Ewe... OOP Ok, I guess I'll have to learn OOP. Thanks for the info! Jeff -Original Message- From: Jordan S. Jones [mailto:[EMAIL PROTECTED] Sent: Wednesday, March 17, 2004 4:02 PM To: Jeff McKeon Subject: Re: [PHP] Stupid question That has to deal with Object Oriented programming, and instead of fumbling my way through trying to explain it, I will point you to the PHP documents that deal with this. Overview: http://www.php.net/manual/en/language.oop.php OO Functions/what not: http://www.php.net/manual/en/ref.classobj.php Jordan S. Jones Jeff McKeon wrote: I've been using PHP for about 6 months and I'm ok with it but I'm now starting to get into more advanced stuff and inheriting project that other people have coded. One of the major stumpers I have is any line of code that contains: $this- What does this do? I know it has something to do with classes but can't quite get my head around it. Thanks, Jeff -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: js date picker
If your question was about using dates in PHP, then by all means, ask it here. But I understood your question to be about dates with Javascript. Be specific with your question so people don't pass it off as being off topic. Luis Mirabal wrote: i am using it from a php program... maybe i was not clear enough... but thanx, i found some at phpclasses.org -- Regards, Ben Ramsey http://benramsey.com http://www.phpcommunity.org/wiki/People/BenRamsey -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Stupid question
With PHP 5 looming on the horizon (and even many already using it), it'd be a good idea to go ahead and learn OOP now. ;-) Jeff McKeon wrote: Ewe... OOP Ok, I guess I'll have to learn OOP. Thanks for the info! Jeff -- Regards, Ben Ramsey http://benramsey.com http://www.phpcommunity.org/wiki/People/BenRamsey -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Stupid question
On Wed, 2004-03-17 at 16:08, Jeff McKeon wrote: Ewe... OOP That should read: $this-ewww( 'OOP' ) :) -- .. | InterJinn Application Framework - http://www.interjinn.com | :: | An application and templating framework for PHP. Boasting | | a powerful, scalable system for accessing system services | | such as forms, properties, sessions, and caches. InterJinn | | also provides an extremely flexible architecture for | | creating re-usable components quickly and easily. | `' -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php