[PHP] [Newbie Guide] For the benefit of new members
=== This message is for the benefit of new subscribers and those new to PHP. Please feel free to add more points and send to the list. === 1. If you have any queries/problems about PHP try http://www.php.net/manual/en first. You can download a copy and use it offline also. Please also try http://www.php.net/manual/faq.php to get answers to frequently answered questions about PHP (added by Christophe Chisogne). 2. Try http://www.google.com next. Searching for "php YOUR QUERY" may fetch you relevant results within the first 10 results, if you are lucky. 3. There is a searchable archive of the mailing list discussion at http://phparch.com/mailinglists. Many of the common topics are discussed repeatedly, and you may get answer to your query from the earlier discussions. For example: One of the repeatedly discussed question in the list is "Best PHP editor". Everyone has his/her favourite editor. You can get all the opinions by going through the list archives. If you want a chosen list try this link : http://phpeditors.linuxbackup.co.uk/ (contributed by Christophe Chisogne). 4. Just put the following code into a file with a .php extension and access it through your webserver: This will display tons of info if php is enabled, or, it will ask you to download a file if php is NOT enabled. (contributed by Teren) 5. If you are stuck with a script and do not understand what is wrong, instead of posting the whole script, try doing some research yourself. One useful trick is to print the variable/sql query using print or echo command and check whether you get what you expected. After diagnosing the problem, send the details of your efforts (following steps 1, 2 & 3) and ask for help. 6. PHP is a server side scripting language. Whatever processing PHP does takes place BEFORE the output reaches the client. Therefore, it is not possible to access the users' computer related information (OS, screen size etc) using PHP. You need to go for JavaScript and ask the question in a JavaScript list. (You can access information SENT by the user's browser while requesting pages from your server. You can get the details about browser, OS etc as reported by this request. - contributed by Wouter van Vliet) 7. Provide a clear descriptive subject line. Avoid general subjects like "Help!!", "A Question" etc. Especially avoid blank subjects. 8. When you want to start a new topic, open a new mail composer and enter the mailing list address [EMAIL PROTECTED] instead of replying to an existing thread and replacing the subject and body with your message. 9. It's always a good idea to post back to the list once you've solved your problem. People usually add [SOLVED] to the subject line of their email when posting solutions. By posting your solution you're helping the next person with the same question. [contribued by Chris W Parker] 10. Ask smart questions http://catb.org/~esr/faqs/smart-questions.html [contributed by Jay Blanchard) Hope you have a good time programming with PHP. Best regards, -- Integrated Management Tools for leather industry -- http://www.leatherlink.net Ma Siva Kumar, BSG LeatherLink (P) Ltd, Chennai - 600106 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] printing support
Hello, I was wondering where the printing support has gone in php5? Is it still possible? Is is better to use mysql or sqlite with the new (and improved) php5? Thanks in advance, Best regards, Danny Schalken. Atrion Information Technology. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] CLI question
On 17 December 2003 21:33, Jay Blanchard wrote: > [snip] > I'm using the CLI version 4.3.4 on Windows XP Pro. The script I'm > writing has only a couple of functions, a couple of "if" conditionals > and a "while" loop. At the very top of the script I have an echo > statement with a message I want printed to the console window. The > problem is that it's not echoed until all of the functions and other > stuff is executed. Why is this the case? Anything I can do to get the > echo statement to run first thing? > [/snip] > > Use output buffering and flush the echo statement > http://us2.php.net/manual/en/function.flush.php Shouldn't that be *don't* use output buffering and...? The flush() function has nothing to do with output buffering, and if output buffering is on you will need ob_flush() as well. Another (and probably better) solution is to create a php-cli.ini file, which will be picked up only by your CLI version, and put output_buffering = Off implicit_flush = On in it. (Implicit flushing is usually expensive and inappropriate when generating Web pages, but usually exactly what you want when running from the command line.) Cheers! Mike - Mike Ford, Electronic Information Services Adviser, Learning Support Services, Learning & Information Services, JG125, James Graham Building, Leeds Metropolitan University, Beckett Park, LEEDS, LS6 3QS, United Kingdom Email: [EMAIL PROTECTED] Tel: +44 113 283 2600 extn 4730 Fax: +44 113 283 3211 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Update issue - more then likely simple problem
On Thu, Dec 18, 2003 at 01:39:57PM +1100, Eric Holmstrom wrote: > > What im trying to do is read the information from a field in a table called > PARTNO. Then add RU to the front of whatever is in the PARTNO field. > > So far i have this. > > //connect details rarara > //query > $query= "SELECT PARTNO FROM russell2 "; Didn't you say the table was called "PARTNO", not "russell2"? > // make a query to get old stuff from DB col > $oldstuff = mysql_query($query, $conn) or die(mysql_error()); > while ($new = mysql_fetch_array($oldstuff)){ > $final = $new['PARTNO']; > //new infomation i want to add infront of PARTNO data > $newstuff = 'RU'; > //Combining the two resluts together > $results = $newstuff.$final; > // just use this to check it was going through properly > print_r($results); > } > > The problem i have to get it to update. If i add this (see below) inside the > while statement it continually loops, and outside it doesnt work. > > $update = "UPDATE rocket SET PARTNO = '$results''"; > mysql_query($update); > > I know the answer is simple but i seem to be stuck on it. I don't think you can just update a row that you just fetched within the same query. If you do this in PHP, you should split the update into a separate loop. Of course, it would be faster and more efficient to have MySQL do it for you: UPDATE rocket SET PARTNO = CONCAT('RU',PARTNO) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] E-Mail validation Checking for 'free' e-mail address
Hello all Over at http://www.DNSstuff.com, they have a great tool to check whether an e-mail address is from a free (web-based) e-mail provider. I need to be able to perform this check from PHP code. However, the Terms and Conditions of http://www.DNSstuff.com prohibit me from writing a scraping script to access their database of free e-mail domains over the WWW interface. Would anyone know where to get a list of free e-mail domains (like hotmail.com, mail.com etc)? Or how one could (automatically) generate ones own? Or has someone already written a function to perform this check? TIA Paul ___ Do You Yahoo!? Get your free @yahoo.com.hk address at http://mail.english.yahoo.com.hk -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] fopen does not open URL-files
I have 2 questions: 1) why gethostbyname() does not resolve my host name into IP? 2) why fopen() (and file()) does not open an external (URL) file via http? Please, see my example below: -- http://www.management.kiev.ua/try-test/fopen-test-http.php - -- http://www.management.kiev.ua/MO/main.php";, "r"); echo fread($h,200); ?> - browser (interpreted) result --- www.management.kiev.ua Warning: fopen() [function.fopen]: php_network_getaddresses: getaddrinfo failed: No address associated with hostname in /home/manageme/public_html/try-test/fopen-test-http.php on line 4 Warning: fopen(http://www.management.kiev.ua/MO/main.php) [function.fopen]: failed to create stream: Permission denied in /home/manageme/public_html/try-test/fopen-test-http.php on line 4 Warning: fread(): supplied argument is not a valid stream resource in /home/manageme/public_html/try-test/fopen-test-http.php on line 5 or as plain text -- www.management.kiev.ua Warning: fopen() [function.fopen]: php_network_getaddresses: getaddrinfo failed: No address associated with hostname in /home/manageme/public_html/try-test/fopen-test-http.php on line 4 Warning: fopen(http://www.management.kiev.ua/MO/main.php) [function.fopen]: failed to create stream: Permission denied in /home/manageme/public_html/try-test/fopen-test-http.php on line 4 Warning: fread(): supplied argument is not a valid stream resource in /home/manageme/public_html/try-test/fopen-test-http.php on line 5 Thanks a lot for help in advance, Taras V. Panchenko. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP LDAP query - need to add Exchange fields
Ben Crothers wrote: At the moment it works fine and extracts fields like first- and surname, title, department, etc. I need to add the 'office' field, and added it at the end of this filter line: --- $filter = "(|(sn=$search[$i]*)(givenname=$search[$i]*)(title=$search[$i]*)(department= $search[$i]*)(office=$search[$i]*))"; ...but so far it's not working. I *know* there's data in the 'office' field -- any ideas as to what I'm missing? Not all of the fields in Exchange are exposed through LDAP (this is from experience, I have no reference to back this up but would appreciate it if someone else has any info on the LDAP implementation in Excahnge 5.5+). I would guess from your question that 'office' is one of the fields that is not. -- Stuart -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: php/mysql data display
"Jlake" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > I have a small database that I want to display data from. in such a way that > it shows shows in a table with the table header being the department > category and the table cells being the categories for each department. I > have no problem connecting to the database) I imagine that I will need > nested loops, but I haven't seen a tutorial showing quite what I am looking > for. If anyone can point me in the right direction that would be great. Maybe this example would be of some help: http://www.templatetamer.org/index.php?MySqlRowList rush -- http://www.templatetamer.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] php special permissions
Hi, I am building a web interface to the vacation autoresponder program on linux. I let users login, edit their message and enable the autoresponder. The last step (enabling) is where the fun begins because php is run as apache on my box, and each users' .vacation.msg and .forward are not owned by apache. So you say, ok lets make apache run as group 'vacation' and also change the ownership on .vacation.msg and .forward. Well this makes sendmail cry out because it doesn't like having group-writable .forward files. How would you guys suggest i did this? I can post code if required. -- Mat Harris Network/Systems Administrator Genestate pgp0.pgp Description: PGP signature
[PHP] Re: php special permissions
Have u looked at "sudo" and "sudoers" http://www.courtesan.com/sudo/ http://www.courtesan.com/sudo/man/sudoers.html regards pete Mat Harris wrote: Hi, I am building a web interface to the vacation autoresponder program on linux. I let users login, edit their message and enable the autoresponder. The last step (enabling) is where the fun begins because php is run as apache on my box, and each users' .vacation.msg and .forward are not owned by apache. So you say, ok lets make apache run as group 'vacation' and also change the ownership on .vacation.msg and .forward. Well this makes sendmail cry out because it doesn't like having group-writable .forward files. How would you guys suggest i did this? I can post code if required. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: php special permissions
yes i've looked at sudo but for some reason, when I use sudo in a php script, the messages file shows the sudo command failing, I believe it was because sudo only works on a std term. If this is not the case, I would be delighted. On Thu, Dec 18, 2003 at 12:31:23 +, pete M wrote: > Have u looked at "sudo" and "sudoers" > > http://www.courtesan.com/sudo/ > http://www.courtesan.com/sudo/man/sudoers.html > > regards > pete > > > > Mat Harris wrote: > > Hi, > > I am building a web interface to the vacation autoresponder program on linux. > > > > I let users login, edit their message and enable the autoresponder. > > > > The last step (enabling) is where the fun begins because php is run as apache on > > my box, and each users' .vacation.msg and .forward are not owned by apache. > > > > So you say, ok lets make apache run as group 'vacation' and also change the > > ownership > > on .vacation.msg and .forward. > > > > Well this makes sendmail cry out because it doesn't like having group-writable > > .forward > > files. > > > > > > How would you guys suggest i did this? > > > > I can post code if required. > > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php -- Mat Harris Network/Systems Administrator Genestate pgp0.pgp Description: PGP signature
Re: [PHP] php special permissions
On Thu, Dec 18, 2003 at 12:24:21PM +, Mat Harris wrote: : : I am building a web interface to the vacation autoresponder program : on linux. : : I let users login, edit their message and enable the autoresponder. : : The last step (enabling) is where the fun begins because php is run : as apache on my box, and each users' .vacation.msg and .forward are : not owned by apache. : : So you say, ok lets make apache run as group 'vacation' and also : change the ownership on .vacation.msg and .forward. : : Well this makes sendmail cry out because it doesn't like having : group-writable .forward files. DontBlameSendmail http://www.sendmail.org/tips/DontBlameSendmail.html -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] php special permissions
Thanks for the reply but I have already tried the DontBlameSendmail options. Either the flags are ignored or I am using the wrong combination (there are several flags I believe). If there is a good sequence for those options then I would love to know. thanks On Thu, Dec 18, 2003 at 06:42:37 -0600, Eugene Lee wrote: > On Thu, Dec 18, 2003 at 12:24:21PM +, Mat Harris wrote: > : > : I am building a web interface to the vacation autoresponder program > : on linux. > : > : I let users login, edit their message and enable the autoresponder. > : > : The last step (enabling) is where the fun begins because php is run > : as apache on my box, and each users' .vacation.msg and .forward are > : not owned by apache. > : > : So you say, ok lets make apache run as group 'vacation' and also > : change the ownership on .vacation.msg and .forward. > : > : Well this makes sendmail cry out because it doesn't like having > : group-writable .forward files. > > DontBlameSendmail > > http://www.sendmail.org/tips/DontBlameSendmail.html > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php -- Mat Harris Network/Systems Administrator Genestate pgp0.pgp Description: PGP signature
Re: [PHP] php special permissions
Another solution would be to place each change to the files in a MySQL table, and then have a cron that is run every X minutes read this table, and makes the actual changes I'm not sure if this idea is suitable in your situation due to the time lag between the client asking for the change, and the change happening. In some situations this is acceptable. Andrew - Original Message - From: "Mat Harris" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Thursday, December 18, 2003 12:24 PM Subject: [PHP] php special permissions Hi, I am building a web interface to the vacation autoresponder program on linux. I let users login, edit their message and enable the autoresponder. The last step (enabling) is where the fun begins because php is run as apache on my box, and each users' .vacation.msg and .forward are not owned by apache. So you say, ok lets make apache run as group 'vacation' and also change the ownership on .vacation.msg and .forward. Well this makes sendmail cry out because it doesn't like having group-writable .forward files. How would you guys suggest i did this? I can post code if required. -- Mat Harris Network/Systems Administrator Genestate -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Links of Tables from other DB
Hi, From your post i the the proper use of databases hasn't 'sunk in' yet. I propose that you head off to one of the sites such as phpbuilder.com or devshed.com where you will find lots of articles on dbs as well as how to use them with php. all the best KidLat Ngayon wrote: Greetings Guyz. I would just like to ask for a help regarding on "Links of Tables from other DB". I'm just only a newbie in PHP Programming. What I have right now is a query result from my table, and what I wanted to do is on my one of the table I had is to have a link or button that will open another page that will get the data from the other table. It would be highly appreciated if anyone could give me a sample script or link for a tutorial. Many Thanks in advance. Regards, ERWIN __ Do you Yahoo!? New Yahoo! Photos - easier uploading and sharing. http://photos.yahoo.com/ -- Raditha Dissanayake. http://www.radinks.com/sftp/ | http://www.raditha.com/megaupload Lean and mean Secure FTP applet with | Mega Upload - PHP file uploader Graphical User Inteface. Just 150 KB | with progress bar. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: php special permissions
Mat -- [BTW, my gnupg could not find your public key.] ...and then Mat Harris said... % % yes i've looked at sudo but for some reason, when I use sudo in a php % script, the messages file shows the sudo command failing, I believe it % was because sudo only works on a std term. Nope; it works anywhere. It's much more likely that you need to create the proper sudoers file entry. No, I'm not going to tell you how to do it because you should DEFINITELY understand the security ramifications of what you're proposing before you just drop something into place :-) % % If this is not the case, I would be delighted. Here's hoping I've made your day :-) HTH & HAND & Happy Holidays :-D -- David T-G * There is too much animal courage in (play) [EMAIL PROTECTED] * society and not sufficient moral courage. (work) [EMAIL PROTECTED] -- Mary Baker Eddy, "Science and Health" http://justpickone.org/davidtg/ Shpx gur Pbzzhavpngvbaf Qrprapl Npg! pgp0.pgp Description: PGP signature
Re: [PHP] Re: php special permissions
On Thu, Dec 18, 2003 at 08:30:32 -0500, David T-G wrote: > Mat -- > > [BTW, my gnupg could not find your public key.] hmm, i'll look into it. > ...and then Mat Harris said... > % > % yes i've looked at sudo but for some reason, when I use sudo in a php > % script, the messages file shows the sudo command failing, I believe it > % was because sudo only works on a std term. > > Nope; it works anywhere. It's much more likely that you need to create > the proper sudoers file entry. No, I'm not going to tell you how to do > it because you should DEFINITELY understand the security ramifications of > what you're proposing before you just drop something into place :-) > Don't worry, I do have experience with the sudo command/config, I will investigate when I have a minute. > > % > % If this is not the case, I would be delighted. > > Here's hoping I've made your day :-) > me too :) > > HTH & HAND & Happy Holidays > and you, cheers > :-D > -- > David T-G * There is too much animal courage in > (play) [EMAIL PROTECTED] * society and not sufficient moral courage. > (work) [EMAIL PROTECTED] -- Mary Baker Eddy, "Science and Health" > http://justpickone.org/davidtg/ Shpx gur Pbzzhavpngvbaf Qrprapl Npg! > -- Mat Harris Network/Systems Administrator Genestate pgp0.pgp Description: PGP signature
[PHP] includes...
bit of a random thought I need answering really... when referencing external files, what's the difference between: ../ / ./ I know that ../ means back one directory and jsut a / means look from the root directory, but what is: ./ ??? Cheers all.. * 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. ***
Re: [PHP] includes...
That means "the current directory" Cheers, Marco -- php|architect - The Magazine for PHP Professionals Try us free at http://www.phparch.com! Complete searchable PHP mailing list archives at http://www.phparch.com/mailinglists [EMAIL PROTECTED] wrote: bit of a random thought I need answering really... when referencing external files, what's the difference between: ../ / ./ I know that ../ means back one directory and jsut a / means look from the root directory, but what is: ./ ??? Cheers all.. * 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] includes...
[EMAIL PROTECTED] wrote: bit of a random thought I need answering really... when referencing external files, what's the difference between: ../ / ./ I know that ../ means back one directory and jsut a / means look from the root directory, but what is: ./ ??? ./ means the current directory. Best Bao Cheers all.. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] includes...
Oh... So it's the same as not having any /'s just the file name? Marco Tabini <[EMAIL PROTECTED]> 18/12/2003 14:01 To [EMAIL PROTECTED] cc [EMAIL PROTECTED] Subject Re: [PHP] includes... That means "the current directory" Cheers, Marco -- php|architect - The Magazine for PHP Professionals Try us free at http://www.phparch.com! Complete searchable PHP mailing list archives at http://www.phparch.com/mailinglists [EMAIL PROTECTED] wrote: > bit of a random thought I need answering really... > when referencing external files, what's the difference between: > > ../ > / > ./ > > I know that ../ means back one directory and jsut a / means look from the > root directory, but what is: > ./ > > ??? > > Cheers all.. > > * > 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. ***
Re: [PHP] includes...
[EMAIL PROTECTED] wrote: Oh... So it's the same as not having any /'s just the file name? Not quite. For example, when you have more than one executables with the same name, when you use ./executable_name, it will call the the one in your current directory, otherwise it will use the one in your path. Best Bao Marco Tabini <[EMAIL PROTECTED]> 18/12/2003 14:01 To [EMAIL PROTECTED] cc [EMAIL PROTECTED] Subject Re: [PHP] includes... That means "the current directory" Cheers, Marco -- php|architect - The Magazine for PHP Professionals Try us free at http://www.phparch.com! Complete searchable PHP mailing list archives at http://www.phparch.com/mailinglists [EMAIL PROTECTED] wrote: bit of a random thought I need answering really... when referencing external files, what's the difference between: ../ / ./ I know that ../ means back one directory and jsut a / means look from the root directory, but what is: ./ ??? Cheers all.. * 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 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] php special permissions
On Thu, Dec 18, 2003 at 12:52:14PM +, Mat Harris wrote: : On Thu, Dec 18, 2003 at 06:42:37 -0600, Eugene Lee wrote: : > On Thu, Dec 18, 2003 at 12:24:21PM +, Mat Harris wrote: : > : : > : I am building a web interface to the vacation autoresponder program : > : on linux. : > : : > : I let users login, edit their message and enable the autoresponder. : > : : > : The last step (enabling) is where the fun begins because php is run : > : as apache on my box, and each users' .vacation.msg and .forward are : > : not owned by apache. : > : : > : So you say, ok lets make apache run as group 'vacation' and also : > : change the ownership on .vacation.msg and .forward. : > : : > : Well this makes sendmail cry out because it doesn't like having : > : group-writable .forward files. : > : > DontBlameSendmail : > : > http://www.sendmail.org/tips/DontBlameSendmail.html : : Thanks for the reply but I have already tried the DontBlameSendmail options. : : Either the flags are ignored or I am using the wrong combination : (there are several flags I believe). If there is a good sequence for : those options then I would love to know. There are several more options listed in the URL. Two of them: GroupWritableForwardFile GroupWritableForwardFileSafe might look like they could address your specific issues. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Countries, cities, states database
Hi, I searching for a database, with the 'complete' world Countries, cities, states Just like http://www.datingplace.com/servlet/NewRegistration I need for an academic study. Thanks, Augusto __ Conheça a nova central de informações anti-spam do Yahoo! Mail: http://www.yahoo.com.br/antispam -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] CLI question
Ford, Mike [LSS] wrote: Shouldn't that be *don't* use output buffering and...? The flush() function has nothing to do with output buffering, and if output buffering is on you will need ob_flush() as well. Another (and probably better) solution is to create a php-cli.ini file, which will be picked up only by your CLI version, and put output_buffering = Off implicit_flush = On in it. (Implicit flushing is usually expensive and inappropriate when generating Web pages, but usually exactly what you want when running from the command line.) Cheers! Mike Thanks Jay and Mike.. Mike.. how does the CLI version of PHP know to use the new ini file? Rod -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
php-general Digest 18 Dec 2003 14:48:34 -0000 Issue 2480
php-general Digest 18 Dec 2003 14:48:34 - Issue 2480 Topics (messages 172922 through 172951): Update issue - more then likely simple problem 172922 by: Eric Holmstrom 172930 by: Eugene Lee get output in .html file 172923 by: martin 172926 by: Shawn McKenzie Links of Table to other DB 172924 by: KidLat Ngayon PHP IDE opinions 172925 by: Shawn McKenzie [Newbie Guide] For the benefit of new members 172927 by: Ma Siva Kumar printing support 172928 by: Danny Schalken Re: CLI question 172929 by: Ford, Mike [LSS] 172951 by: Rodney Green E-Mail validation Checking for 'free' e-mail address 172931 by: Jason Paul fopen does not open URL-files 172932 by: Taras Panchenko Re: PHP LDAP query - need to add Exchange fields 172933 by: Stuart Re: php/mysql data display 172934 by: rush php special permissions 172935 by: Mat Harris 172936 by: pete M 172937 by: Mat Harris 172938 by: Eugene Lee 172939 by: Mat Harris 172940 by: Andrew Brampton 172942 by: David T-G 172943 by: Mat Harris 172949 by: Eugene Lee Re: Links of Tables from other DB 172941 by: Raditha Dissanayake includes... 172944 by: Tristan.Pretty.risk.sungard.com 172945 by: Marco Tabini 172946 by: BAO RuiXian 172947 by: Tristan.Pretty.risk.sungard.com 172948 by: BAO RuiXian Countries, cities, states database 172950 by: Augusto Cesar Castoldi Administrivia: To subscribe to the digest, e-mail: [EMAIL PROTECTED] To unsubscribe from the digest, e-mail: [EMAIL PROTECTED] To post to the list, e-mail: [EMAIL PROTECTED] -- --- Begin Message --- Hi there, What im trying to do is read the information from a field in a table called PARTNO. Then add RU to the front of whatever is in the PARTNO field. So far i have this. //connect details rarara //query $query= "SELECT PARTNO FROM russell2 "; // make a query to get old stuff from DB col $oldstuff = mysql_query($query, $conn) or die(mysql_error()); while ($new = mysql_fetch_array($oldstuff)){ $final = $new['PARTNO']; //new infomation i want to add infront of PARTNO data $newstuff = 'RU'; //Combining the two resluts together $results = $newstuff.$final; // just use this to check it was going through properly print_r($results); } The problem i have to get it to update. If i add this (see below) inside the while statement it continually loops, and outside it doesnt work. $update = "UPDATE rocket SET PARTNO = '$results''"; mysql_query($update); I know the answer is simple but i seem to be stuck on it. Thankyou Eric Holmstrom --- End Message --- --- Begin Message --- On Thu, Dec 18, 2003 at 01:39:57PM +1100, Eric Holmstrom wrote: > > What im trying to do is read the information from a field in a table called > PARTNO. Then add RU to the front of whatever is in the PARTNO field. > > So far i have this. > > //connect details rarara > //query > $query= "SELECT PARTNO FROM russell2 "; Didn't you say the table was called "PARTNO", not "russell2"? > // make a query to get old stuff from DB col > $oldstuff = mysql_query($query, $conn) or die(mysql_error()); > while ($new = mysql_fetch_array($oldstuff)){ > $final = $new['PARTNO']; > //new infomation i want to add infront of PARTNO data > $newstuff = 'RU'; > //Combining the two resluts together > $results = $newstuff.$final; > // just use this to check it was going through properly > print_r($results); > } > > The problem i have to get it to update. If i add this (see below) inside the > while statement it continually loops, and outside it doesnt work. > > $update = "UPDATE rocket SET PARTNO = '$results''"; > mysql_query($update); > > I know the answer is simple but i seem to be stuck on it. I don't think you can just update a row that you just fetched within the same query. If you do this in PHP, you should split the update into a separate loop. Of course, it would be faster and more efficient to have MySQL do it for you: UPDATE rocket SET PARTNO = CONCAT('RU',PARTNO) --- End Message --- --- Begin Message --- Does somebody know how to get the output of an .php file into an .html file (server side). This in order to cache generated pages for futur visitors. thanks Martin --- End Message --- --- Begin Message --- Buffer output and then write it to a file. I do it all the time. ob_start(); //output some stuff here $content = ob_get_contents(); ob_end_flush(); if ($handle = fopen("yourfile.html", "w")) { fwrite($handle, $content); fclose($handle); } -Shawn "Martin" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Does somebody know how to get the output of an .php file into an .html file > (server side). This in order to cache generated pages for fut
[PHP] Security Question
Hello, I'm trying to develop a secure web based application and my only tools are php, mysql, and a SSL connection. Does anyone know of any good references for this kind of development? What I really need to do is to make sure that given users only gain access to the parts of the application they are given rights to. I'm not sure if I need to pass their user information along from page to page or if I should set a cookie or whatever else would be appropriate. I also want people to be bounced back to the login page if they enter a direct URL to part of the application without logging in first, and I also want people to be able to log out. Thanks, Thomas Andersen -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Security Question
Does your php.ini have Globals set to off? Was your php installation compiled with session support? If your answer to both of those questions is yes (you can check your server config with a page containing this string ) Then use session to register a variable such as the example below... Then say on your authentication module you do something like this function authentication() { if (!empty($_POST['username'])) && (!empty($_POST['password'])) { // some code to check if username and password variables match database entries or file containing credentials // if a match is found do the rest of the code session_start(); $_SESSION['auth'] = base64_encode(1); //encoded var to deter session hijacking } else { header("location: login.html"); } ?> Hope this helps a bit... more info on stuff like this is available at google.com. =) Jas Thomas Andersen wrote: Hello, I'm trying to develop a secure web based application and my only tools are php, mysql, and a SSL connection. Does anyone know of any good references for this kind of development? What I really need to do is to make sure that given users only gain access to the parts of the application they are given rights to. I'm not sure if I need to pass their user information along from page to page or if I should set a cookie or whatever else would be appropriate. I also want people to be bounced back to the login page if they enter a direct URL to part of the application without logging in first, and I also want people to be able to log out. Thanks, Thomas Andersen -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Countries, cities, states database
--- Augusto Cesar Castoldi <[EMAIL PROTECTED]> wrote: > I searching for a database, with the 'complete' world > Countries, cities, states I like GeoIP: http://www.maxmind.com/ Hope that helps. Chris = Chris Shiflett - http://shiflett.org/ PHP Security Handbook Coming mid-2004 HTTP Developer's Handbook http://httphandbook.org/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Security Question
On Thu, 18 Dec 2003 10:43:14 -0500, you wrote: >I'm trying to develop a secure web based application and my only tools are >php, mysql, and a SSL connection. > >Does anyone know of any good references for this kind of development? > >What I really need to do is to make sure that given users only gain access >to the parts of the application they are given rights to. I'm not sure if I >need to pass their user information along from page to page or if I should >set a cookie or whatever else would be appropriate. Read up about sessions. Essentially, a session is a random token which is sent to the client (normally as a cookie), and is associated with a collection of data server-side. You can safely store sensitive data (userids, privilege levels, etc) in the session because they never leave the server. http://www.php.net/manual/en/ref.session.php >I also want people to >be bounced back to the login page if they enter a direct URL to part of the >application without logging in first, and I also want people to be able to >log out. include() a file at the top of every page that checks for the existence of a valid session. If no session is present, use header("Location:") to bounce the user back to the login page and exit(). -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Post New Email to Website?
Hello. I'm a new PHP user and unfamiliar with the terminology, so if I sound like I don't know what I'm talking about, I don't. :) I do a website for a club I belong to and would like to post the Subjects of new emails to our Announcements email list on the website. Instead of manually adding the subjects to the website, I thought there might be a way to automate it. If anyone could point me to a script that can check an email list for new messages and then include part of that message into a website, I would really appreciate it. Jean Peterson -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] CLI question
On 18 December 2003 14:48, Rodney Green wrote: > Ford, Mike [LSS] wrote: > > > Shouldn't that be *don't* use output buffering and...? The > flush() function has nothing to do with output buffering, and > if output buffering is on you will need ob_flush() as well. > > > > Another (and probably better) solution is to create a > php-cli.ini file, which will be picked up only by your CLI > version, and put > > > > output_buffering = Off > > implicit_flush = On > > > > in it. (Implicit flushing is usually expensive and > inappropriate when generating Web pages, but usually exactly > what you want when running from the command line.) > > > > Cheers! > > > > Mike > > > Thanks Jay and Mike.. > > Mike.. how does the CLI version of PHP know to use the new ini file? Because it's there! (And it's called php-cli.ini.) Cheers! Mike - Mike Ford, Electronic Information Services Adviser, Learning Support Services, Learning & Information Services, JG125, James Graham Building, Leeds Metropolitan University, Beckett Park, LEEDS, LS6 3QS, United Kingdom Email: [EMAIL PROTECTED] Tel: +44 113 283 2600 extn 4730 Fax: +44 113 283 3211 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Post New Email to Website?
Exact mechanism of how this is done depends on what your mail server is.. You can usually pipe an incoming mail message to an executable programs (this is anyway done by the MTA) in your case the executable can simply be a php script that makes use of a suitable mime decoder (you will find several in hotscripts,sourceforge,php classes etc) which decodes the mail messages and inserts the subject line into a database or any other storage mechanism. [EMAIL PROTECTED] wrote: Hello. I'm a new PHP user and unfamiliar with the terminology, so if I sound like I don't know what I'm talking about, I don't. :) I do a website for a club I belong to and would like to post the Subjects of new emails to our Announcements email list on the website. Instead of manually adding the subjects to the website, I thought there might be a way to automate it. If anyone could point me to a script that can check an email list for new messages and then include part of that message into a website, I would really appreciate it. Jean Peterson -- Raditha Dissanayake. http://www.radinks.com/sftp/ | http://www.raditha.com/megaupload Lean and mean Secure FTP applet with | Mega Upload - PHP file uploader Graphical User Inteface. Just 150 KB | with progress bar. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] PHP Template Function
Hello, I have just been assigned to a project to convert a large static site to PHP. I have used PHP for small jobs in the past, but most of my work has been with Perl. One feature I've used and liked very much was provided by a package called Embperl. In particular, Embperl::Object, which allows you to build object-oriented (OO) websites using HTML components which implement inheritance via subdirectories. http://perl.apache.org/embperl/pod/doc/EmbperlObject.-page-2-.htm Basically, a directory was defined within the webserver to have a PerlHandler, Embperl::Object. When any page in or under that directory is called, Embperl::Object would look for template files in the current directory and go upward in the tree until they are found and prepend/append them. There was no code or includes required within the pages themselves. I want to do something similar with this new PHP implementation. I have reviewed some template tutorials and looked at some of the Pear modules, but none seem to work like this. Can anyone give me some idea of if this is possible and how I might begin? Any information would be greatly appreciated. Thanks, Cameron -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Help with php output to file
Hi I have develop an online catalog in php/mysql. Now the client needs the web site on a cd. Of course without php or mysql... What is the fastes and easiest way to convert the only 2-3 dynamic php pages into static html files? Of course I could copy the html code generated by the php pages for each product and save it as different product1.html product2.html ... but that will take ages ... 2000 products in 2 languages. Is there a way to redirect the output of php pages to a file instead of to the screen? So I could create a simple php script that loop for each product & languages to generate all the pages. -- Kind regards, Paul. Gondwana [EMAIL PROTECTED] http://www.gondwanastudio.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Help with php output to file
Anytime I need to do something similar to this I prefer to use "lynx -source [[URL]] > [[output_file]]" HTH! --Sam Paul Godard wrote: > Hi > > I have develop an online catalog in php/mysql. Now the client needs > the web site on a cd. Of course without php or mysql... > > What is the fastes and easiest way to convert the only 2-3 dynamic > php pages into static html files? > > Of course I could copy the html code generated by the php pages for > each product and save it as different product1.html product2.html ... > but that will take ages ... 2000 products in 2 languages. > > Is there a way to redirect the output of php pages to a file instead > of to the screen? So I could create a simple php script that loop > for each product & languages to generate all the pages. > -- > > Kind regards, Paul. > > Gondwana > [EMAIL PROTECTED] > http://www.gondwanastudio.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Help with php output to file
Paul Godard wrote: Hi I have develop an online catalog in php/mysql. Now the client needs the web site on a cd. Of course without php or mysql... What is the fastes and easiest way to convert the only 2-3 dynamic php pages into static html files? Of course I could copy the html code generated by the php pages for each product and save it as different product1.html product2.html ... but that will take ages ... 2000 products in 2 languages. Is there a way to redirect the output of php pages to a file instead of to the screen? So I could create a simple php script that loop for each product & languages to generate all the pages. Well, you could always use web site mirroring software to pull it all. Such as "wget -m". It would pull the dynamically generated HTML and store it all in files and change the links accordingly. Or you could use something else such as WinHTTrack. -- paperCrane -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: fopen does not open URL-files
"Taras Panchenko" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > I have 2 questions: > 1) why gethostbyname() does not resolve my host name into IP? > 2) why fopen() (and file()) does not open an external (URL) file via http? > Please, see my example below: > -- > http://www.management.kiev.ua/try-test/fopen-test-http.php - > -- > echo gethostbyname("www.management.kiev.ua"); > > $h=fopen("http://www.management.kiev.ua/MO/main.php";, "r"); > echo fread($h,200); > ?> > - browser (interpreted) result --- > www.management.kiev.ua > Warning: fopen() [ href='http://www.php.net/function.fopen'>function.fopen]: > php_network_getaddresses: getaddrinfo failed: No address associated with > hostname in /home/manageme/public_html/try-test/fopen-test-http.php > on line 4 > > Warning: fopen(http://www.management.kiev.ua/MO/main.php) [ href='http://www.php.net/function.fopen'>function.fopen]: failed to > create stream: Permission denied in > /home/manageme/public_html/try-test/fopen-test-http.php on line > 4 > > Warning: fread(): supplied argument is not a valid stream resource > in /home/manageme/public_html/try-test/fopen-test-http.php on line > 5 > or as plain text -- > www.management.kiev.ua > Warning: fopen() [function.fopen]: php_network_getaddresses: getaddrinfo > failed: No address associated with hostname in > /home/manageme/public_html/try-test/fopen-test-http.php on line 4 > > Warning: fopen(http://www.management.kiev.ua/MO/main.php) [function.fopen]: > failed to create stream: Permission denied in > /home/manageme/public_html/try-test/fopen-test-http.php on line 4 > > Warning: fread(): supplied argument is not a valid stream resource in > /home/manageme/public_html/try-test/fopen-test-http.php on line 5 > > > Thanks a lot for help in advance, > Taras V. Panchenko. Try this rather(maybe it works): http://www.management.kiev.ua/MO/main.php/";, "r"); echo fread($fp,200); ?> -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Manage link.
Hello, Is there any way to manage links in an array and transform them. For example, I have this text in the database: --- Software & Support Media, produc-ers of the International PHP Conference, are pleased to announce a new monthly version of their print publication. For more information, you can go here: http://www.google.com Thanks. --- And transform this text to: --- Software & Support Media, producers of the International PHP Conference, are pleased to announce a new monthly version of their print publication. For more information, you can go here: http://www.google.com\";>url Thanks. -- Thanks, Vincent. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Manage link.
On Thursday 18 December 2003 01:37 pm, Vincent M. wrote: > Hello, > > Is there any way to manage links in an array and transform them. > For example, I have this text in the database: php.net/preg_replace > > --- > Software & Support Media, produc-ers of the International PHP > Conference, are pleased to announce a new monthly version of their print > publication. For more information, you can go here: http://www.google.com > Thanks. > --- > > And transform this text to: > --- > Software & Support Media, producers of the International PHP Conference, > are pleased to announce a new monthly version of their print > publication. For more information, you can go here: href=\"http://www.google.com\";>url > Thanks. > -- > > > Thanks, > Vincent. -- Evan Nemerson [EMAIL PROTECTED] http://coeusgroup.com/en -- "Perl - the only language that looks the same before and after RSA encryption." -Keith Bostic -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] MySQL newsgroup
Can anyone point my to a MySQL specific SQL newsgroup. having some problem corectly extracting data. Thanks, J -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Links of Tables from other DB
This is the tutorial i used http://hotwired.lycos.com/webmonkey/programming/php/tutorials/tutorial4.html KidLat Ngayon wrote: Greetings Guyz. I would just like to ask for a help regarding on "Links of Tables from other DB". I'm just only a newbie in PHP Programming. What I have right now is a query result from my table, and what I wanted to do is on my one of the table I had is to have a link or button that will open another page that will get the data from the other table. It would be highly appreciated if anyone could give me a sample script or link for a tutorial. Many Thanks in advance. Regards, ERWIN __ Do you Yahoo!? New Yahoo! Photos - easier uploading and sharing. http://photos.yahoo.com/ -- +-+-++ | Blake Schroeder | Owner/Developer |lhwd.net| +--(http://www.lhwd.net)+--/3174026352\--+ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] File upload problem
This works for me My Form ?> Send this file: savefile.php // In PHP earlier then 4.1.0, $HTTP_POST_FILES should be used instead of // $_FILES. In PHP earlier then 4.0.3, use copy() and is_uploaded_file() // instead of move_uploaded_file $uploaddir = '/fullDirectoryPath'; $uploadfile = $uploaddir. $_FILES['filename']['name']; print ""; if (move_uploaded_file($_FILES['filename']['tmp_name'], $uploadfile)) { print "File is valid, and was successfully uploaded. "; print "Here's some more debugging info:\n"; print_r($_FILES); } else { print "Possible file upload attack! Here's some debugging info:\n"; print_r($_FILES); } print ""; ?> Dino Costantini wrote: i'm trying to write a page which allows user to upload file. theese are my sources but they didn't work, anyone could help me? -form.html upload.php--- /* VARIABILI DA SETTARE / // Directory dove salvare i files Uploadati ( chmod 777, percorso assoluto) $upload_dir = $_SERVER["DOCUMENT_ROOT"] . "/esempi"; // Eventuale nuovo nome da dare al file uploadato $new_name = "ciao.dino"; // Se $new_name è vuota, il nome sarà lo stesso del file uploadato $file_name = ($new_name) ? $new_name : $_FILES["upfile"]["name"]; if(trim($_FILES["upfile"]["name"]) == "") { die("Non hai indicato il file da uploadare !"); } if(@is_uploaded_file($_FILES["upfile"]["tmp_name"])) { @move_uploaded_file($_FILES["upfile"]["tmp_name"], "$upload_dir/$file_name") or die("Impossibile spostare il file, controlla l'esistenza o i permessi della directory dove fare l'upload."); } else { die("Problemi nell'upload del file " . $_FILES["upfile"]["name"]); } echo "L'upload del file " . $_FILES["upfile"]["name"] . " è avvenuto correttamente"; ?> --- upload.php doesn't upload anything and doesn't output any error message. i don't think it's an apache problem, because this is the only page that doesn't work. -- +-+-++ | Blake Schroeder | Owner/Developer |lhwd.net| +--(http://www.lhwd.net)+--/3174026352\--+ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] MySQL newsgroup
The URL below lists all of the MySQL mailing lists. Just choose the one that is most specific to your issue: http://lists.mysql.com/ HTH! --Sam JLake wrote: > Can anyone point my to a MySQL specific SQL newsgroup. having some > problem corectly extracting data. > > Thanks, > > J -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] MySQL newsgroup
Thanks "Sam Masiello" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] The URL below lists all of the MySQL mailing lists. Just choose the one that is most specific to your issue: http://lists.mysql.com/ HTH! --Sam JLake wrote: > Can anyone point my to a MySQL specific SQL newsgroup. having some > problem corectly extracting data. > > Thanks, > > J -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Help with php output to file
what about output buffering and saving the output to a file instead of flushing to the screen, that would work easy :) Luke -- Luke "Paul Godard" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Hi > > I have develop an online catalog in php/mysql. Now the client needs > the web site on a cd. Of course without php or mysql... > > What is the fastes and easiest way to convert the only 2-3 dynamic > php pages into static html files? > > Of course I could copy the html code generated by the php pages for > each product and save it as different product1.html product2.html ... > but that will take ages ... 2000 products in 2 languages. > > Is there a way to redirect the output of php pages to a file instead > of to the screen? So I could create a simple php script that loop > for each product & languages to generate all the pages. > -- > > Kind regards, Paul. > > Gondwana > [EMAIL PROTECTED] > http://www.gondwanastudio.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] PHP 4.3.4 configure
I'm trying to configure/compile PHP4.3.4 on Solaris 2.8. Seem that 'configure' just hangs now. The 'new' build systems is broken. I can build older version with no problem. Seem something that was not broken was 'fixed'. (Not a good idea.) So, the old command of: 'configure --prefix=(what ever) --with-mysql --with-apxs=(what ever) not just starts and hang after get to: checking host system type... sparc-sun-solaris2.8' and stays there (for ever unless you kill it manual - break or control d). No idea what the problem could be as it never does anything more. (Machine runs: everythings that will compile version php-4.0.1pl2, Apache_1.3.29 and MYSQL-4.0.16 so this version should work (ya right)). Bernard -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Script timeout Problem
hi, i need to update a mysql table with a dbf file, the dbf file contains more then 16 records. i knew that the script will not be able to update 16 records in 1 go so i am refreshing the page after speacific no of records. but still the same problem. the script timeout.i tried changing the timeout limit to 300 secs but to noavail. i am pasting the code here.plz take a look may by you can tell me what i am doing wrong $nLoopBreak) { $nLoopTill=$nLoopStart + $nLoopBreak; $nFinal=FALSE; } else { $nLoopTill=$nLoopBreak; $nFinal=TRUE; } for ($nCount=$nLoopStart;$nCount<=$nLoopTill;$nCount++) { $arrData=dbase_get_record($DBPointer,$nCount); $GRP=CheckString($arrData[0]); $CAT=CheckString($arrData[1]); $SUB=CheckString($arrData[2]); $VEND_CODE=CheckString($arrData[3]); $MANU_PART=CheckString($arrData[4]); $PART_NUM=CheckString($arrData[5]); $DESCR=CheckString($arrData[6]); $COST=CheckString($arrData[7]); $RETAIL=CheckString($arrData[8]); $QTY=CheckString($arrData[9]); $LIST_PRICE=CheckString($arrData[10]); $EFF_DATE=CheckString($arrData[11]); $TECH_FAX=CheckString($arrData[12]); $STATUS=CheckString($arrData[13]); $UPC=CheckString($arrData[14]); $strQuery="SELECT * FROM products WHERE grp='".$GRP."' AND cat='".$CAT."' AND sub='".$SUB."' AND vend_code='".$VEND_CODE."' AND manu_part='".$MANU_PART."' AND part_num='".$PART_NUM."'"; $nConn->doQuery($strQuery); if ($nConn->cntResult()==0) $strQuery="INSERT INTO products(products.grp,products.cat,products.sub,products.vend_code,products.manu_part,products.part_num,products.desc,products.cost,products.retail,products.qty,products.list_price,products.eff_date,products.tech_fax,products.status,products.upc) VALUES('".$GRP."','".$CAT."','".$SUB."','".$VEND_CODE."','".$MANU_PART."','".$PART_NUM."','".$DESCR."','".$COST."','".$RETAIL."','".$QTY."','".$LIST_PRICE."','".$EFF_DATE."','".$TECH_FAX."','".$STATUS."','".$UPC."')"; else $strQuery="UPDATE products SET products.part_num='$PART_NUM',products.desc='$DESCR',COST='$COST',retail='$RETAIL',qty='$QTY',list_price='$LIST_PRICE',eff_date='$EFF_DATE',tech_fax='$TECH_FAX',status='$STATUS',upc='$UPC' WHERE grp='".$GRP."' AND cat='".$CAT."' AND sub='".$SUB."' AND vend_code='".$VEND_CODE."' AND manu_part='".$MANU_PART."' AND part_num='".$PART_NUM."'"; //echo "nCOunt - > $nCount -".$strQuery; $nConn->doQuery($strQuery); } $nCount++; $nLoopStart=$nCount; if ($nFinal==FALSE) { //1500 records updated so refresh the page ?> Haseeb
Re: [PHP] MySQL newsgroup
Yahoo has a very active group for PHP/MySQL. http://groups.yahoo.com/group/php_mysql/ Jim - Original Message - From: "Sam Masiello" <[EMAIL PROTECTED]> To: "JLake" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]> Sent: Thursday, December 18, 2003 1:56 PM Subject: RE: [PHP] MySQL newsgroup The URL below lists all of the MySQL mailing lists. Just choose the one that is most specific to your issue: http://lists.mysql.com/ HTH! --Sam JLake wrote: > Can anyone point my to a MySQL specific SQL newsgroup. having some > problem corectly extracting data. > > Thanks, > > 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: Script timeout Problem
Have you tried setting a limit on your MySQL insert and update statements to limit the amount trying to be processed? Haseeb Iqbal wrote: hi, i need to update a mysql table with a dbf file, the dbf file contains more then 16 records. i knew that the script will not be able to update 16 records in 1 go so i am refreshing the page after speacific no of records. but still the same problem. the script timeout.i tried changing the timeout limit to 300 secs but to noavail. i am pasting the code here.plz take a look may by you can tell me what i am doing wrong define("_MySqlEnable",TRUE); set_time_limit(0); require_once(strPath."paths.php"); $strDBName=strPath."uploads/".Date("d-m-Y")."-products.dbf"; $DBPointer=dbase_open($strDBName,0) or die("Cannot open file for reading"); $nNoOfRecs=dbase_numrecords($DBPointer); $nLoopBreak=1500; $nConn=GetCon(); if (empty($nLoopStart)) { $nLoopStart=1; } if ($nNoOfRecs > $nLoopBreak) { $nLoopTill=$nLoopStart + $nLoopBreak; $nFinal=FALSE; } else { $nLoopTill=$nLoopBreak; $nFinal=TRUE; } for ($nCount=$nLoopStart;$nCount<=$nLoopTill;$nCount++) { $arrData=dbase_get_record($DBPointer,$nCount); $GRP=CheckString($arrData[0]); $CAT=CheckString($arrData[1]); $SUB=CheckString($arrData[2]); $VEND_CODE=CheckString($arrData[3]); $MANU_PART=CheckString($arrData[4]); $PART_NUM=CheckString($arrData[5]); $DESCR=CheckString($arrData[6]); $COST=CheckString($arrData[7]); $RETAIL=CheckString($arrData[8]); $QTY=CheckString($arrData[9]); $LIST_PRICE=CheckString($arrData[10]); $EFF_DATE=CheckString($arrData[11]); $TECH_FAX=CheckString($arrData[12]); $STATUS=CheckString($arrData[13]); $UPC=CheckString($arrData[14]); $strQuery="SELECT * FROM products WHERE grp='".$GRP."' AND cat='".$CAT."' AND sub='".$SUB."' AND vend_code='".$VEND_CODE."' AND manu_part='".$MANU_PART."' AND part_num='".$PART_NUM."'"; $nConn->doQuery($strQuery); if ($nConn->cntResult()==0) $strQuery="INSERT INTO products(products.grp,products.cat,products.sub,products.vend_code,products.manu_part,products.part_num,products.desc,products.cost,products.retail,products.qty,products.list_price,products.eff_date,products.tech_fax,products.status,products.upc) VALUES('".$GRP."','".$CAT."','".$SUB."','".$VEND_CODE."','".$MANU_PART."','".$PART_NUM."','".$DESCR."','".$COST."','".$RETAIL."','".$QTY."','".$LIST_PRICE."','".$EFF_DATE."','".$TECH_FAX."','".$STATUS."','".$UPC."')"; $strQuery="INSERT INTO products(products.grp,products.cat,products.sub,products.vend_code,products.manu_part,products.part_num,products.desc,products.cost,products.retail,products.qty,products.list_price,products.eff_date,products.tech_fax,products.status,products.upc) VALUES('".$GRP."','".$CAT."','".$SUB."','".$VEND_CODE."','".$MANU_PART."','".$PART_NUM."','".$DESCR."','".$COST."','".$RETAIL."','".$QTY."','".$LIST_PRICE."','".$EFF_DATE."','".$TECH_FAX."','".$STATUS."','".$UPC."' LIMIT 200)"; else $strQuery="UPDATE products SET products.part_num='$PART_NUM',products.desc='$DESCR',COST='$COST',retail='$RETAIL',qty='$QTY',list_price='$LIST_PRICE',eff_date='$EFF_DATE',tech_fax='$TECH_FAX',status='$STATUS',upc='$UPC' WHERE grp='".$GRP."' AND cat='".$CAT."' AND sub='".$SUB."' AND vend_code='".$VEND_CODE."' AND manu_part='".$MANU_PART."' AND part_num='".$PART_NUM."'"; $strQuery="UPDATE products SET products.part_num='$PART_NUM',products.desc='$DESCR',COST='$COST',retail='$RETAIL',qty='$QTY',list_price='$LIST_PRICE',eff_date='$EFF_DATE',tech_fax='$TECH_FAX',status='$STATUS',upc='$UPC' WHERE grp='".$GRP."' AND cat='".$CAT."' AND sub='".$SUB."' AND vend_code='".$VEND_CODE."' AND manu_part='".$MANU_PART."' AND part_num='".$PART_NUM."'LIMIT 200"; //echo "nCOunt - > $nCount -".$strQuery; $nConn->doQuery($strQuery); } $nCount++; $nLoopStart=$nCount; if ($nFinal==FALSE) { //1500 records updated so refresh the page ?> } else { // all records updated so redirst to calling page. ?> } ?> Haseeb That might help out with the timeouts too. Jas -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] picking up a form name
Hi, If I have more than one form on a page, how can I get the name of the form that was sent on the recieving page without using javascript? tia, Craig TOP DRAW INC. p 780.429.9993 f 780.426.1199 [EMAIL PROTECTED] www.topdraw.com 10210 - 111 Street, Edmonton, Alberta T5K 1K9 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] picking up a form name
Craig -- ...and then php said... % % Hi, Hi! % % If I have more than one form on a page, how can I get the % name of the form that was sent on the recieving page % without using javascript? 1) What's a form name? 2) Whatever it is, I suppose you could embed it in a hidden field. 3) Name your submit buttons differently and work it out from that. 4) Just look at $_POST and see the values you have. % % tia, % Craig HTH & HAND :-D -- David T-G * There is too much animal courage in (play) [EMAIL PROTECTED] * society and not sufficient moral courage. (work) [EMAIL PROTECTED] -- Mary Baker Eddy, "Science and Health" http://justpickone.org/davidtg/ Shpx gur Pbzzhavpngvbaf Qrprapl Npg! pgp0.pgp Description: PGP signature
[PHP] Re: picking up a form name
Do you mean a variable being passed to the next page from within a form ex. or If you are talking about the input name for a text box use this snippit... is(empty($_POST['variable_001']) { // Do negative result code } elseif(!empty($_POST['variable_001']) { // Do positive result code ... Or if it the name of the "actual form" you want try setting a hidden field with the same name as the form. ex. HTH Jas Php wrote: Hi, If I have more than one form on a page, how can I get the name of the form that was sent on the recieving page without using javascript? tia, Craig TOP DRAW INC. p 780.429.9993 f 780.426.1199 [EMAIL PROTECTED] www.topdraw.com 10210 - 111 Street, Edmonton, Alberta T5K 1K9 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Script timeout Problem
Let me know if that solves your problem if you would be so kind... I am sure it will but I just want to make sure. Jas Jas wrote: Have you tried setting a limit on your MySQL insert and update statements to limit the amount trying to be processed? Haseeb Iqbal wrote: hi, i need to update a mysql table with a dbf file, the dbf file contains more then 16 records. i knew that the script will not be able to update 16 records in 1 go so i am refreshing the page after speacific no of records. but still the same problem. the script timeout.i tried changing the timeout limit to 300 secs but to noavail. i am pasting the code here.plz take a look may by you can tell me what i am doing wrong define("_MySqlEnable",TRUE); set_time_limit(0); require_once(strPath."paths.php"); $strDBName=strPath."uploads/".Date("d-m-Y")."-products.dbf"; $DBPointer=dbase_open($strDBName,0) or die("Cannot open file for reading"); $nNoOfRecs=dbase_numrecords($DBPointer); $nLoopBreak=1500; $nConn=GetCon(); if (empty($nLoopStart)) { $nLoopStart=1; } if ($nNoOfRecs > $nLoopBreak) { $nLoopTill=$nLoopStart + $nLoopBreak; $nFinal=FALSE; } else { $nLoopTill=$nLoopBreak; $nFinal=TRUE; } for ($nCount=$nLoopStart;$nCount<=$nLoopTill;$nCount++) { $arrData=dbase_get_record($DBPointer,$nCount); $GRP=CheckString($arrData[0]); $CAT=CheckString($arrData[1]); $SUB=CheckString($arrData[2]); $VEND_CODE=CheckString($arrData[3]); $MANU_PART=CheckString($arrData[4]); $PART_NUM=CheckString($arrData[5]); $DESCR=CheckString($arrData[6]); $COST=CheckString($arrData[7]); $RETAIL=CheckString($arrData[8]); $QTY=CheckString($arrData[9]); $LIST_PRICE=CheckString($arrData[10]); $EFF_DATE=CheckString($arrData[11]); $TECH_FAX=CheckString($arrData[12]); $STATUS=CheckString($arrData[13]); $UPC=CheckString($arrData[14]); $strQuery="SELECT * FROM products WHERE grp='".$GRP."' AND cat='".$CAT."' AND sub='".$SUB."' AND vend_code='".$VEND_CODE."' AND manu_part='".$MANU_PART."' AND part_num='".$PART_NUM."'"; $nConn->doQuery($strQuery); if ($nConn->cntResult()==0) $strQuery="INSERT INTO products(products.grp,products.cat,products.sub,products.vend_code,products.manu_part,products.part_num,products.desc,products.cost,products.retail,products.qty,products.list_price,products.eff_date,products.tech_fax,products.status,products.upc) VALUES('".$GRP."','".$CAT."','".$SUB."','".$VEND_CODE."','".$MANU_PART."','".$PART_NUM."','".$DESCR."','".$COST."','".$RETAIL."','".$QTY."','".$LIST_PRICE."','".$EFF_DATE."','".$TECH_FAX."','".$STATUS."','".$UPC."')"; $strQuery="INSERT INTO products(products.grp,products.cat,products.sub,products.vend_code,products.manu_part,products.part_num,products.desc,products.cost,products.retail,products.qty,products.list_price,products.eff_date,products.tech_fax,products.status,products.upc) VALUES('".$GRP."','".$CAT."','".$SUB."','".$VEND_CODE."','".$MANU_PART."','".$PART_NUM."','".$DESCR."','".$COST."','".$RETAIL."','".$QTY."','".$LIST_PRICE."','".$EFF_DATE."','".$TECH_FAX."','".$STATUS."','".$UPC."' LIMIT 200)"; else $strQuery="UPDATE products SET products.part_num='$PART_NUM',products.desc='$DESCR',COST='$COST',retail='$RETAIL',qty='$QTY',list_price='$LIST_PRICE',eff_date='$EFF_DATE',tech_fax='$TECH_FAX',status='$STATUS',upc='$UPC' WHERE grp='".$GRP."' AND cat='".$CAT."' AND sub='".$SUB."' AND vend_code='".$VEND_CODE."' AND manu_part='".$MANU_PART."' AND part_num='".$PART_NUM."'"; $strQuery="UPDATE products SET products.part_num='$PART_NUM',products.desc='$DESCR',COST='$COST',retail='$RETAIL',qty='$QTY',list_price='$LIST_PRICE',eff_date='$EFF_DATE',tech_fax='$TECH_FAX',status='$STATUS',upc='$UPC' WHERE grp='".$GRP."' AND cat='".$CAT."' AND sub='".$SUB."' AND vend_code='".$VEND_CODE."' AND manu_part='".$MANU_PART."' AND part_num='".$PART_NUM."'LIMIT 200"; //echo "nCOunt - > $nCount -".$strQuery; $nConn->doQuery($strQuery); } $nCount++; $nLoopStart=$nCount; if ($nFinal==FALSE) { //1500 records updated so refresh the page ?> } else { // all records updated so redirst to calling page. ?> } ?> Haseeb That might help out with the timeouts too. Jas -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] picking up a form name
Give your forms unique names. -- form page -- -- whatever.php -- if ($_POST["form1"] == "Submit") { do something;} elseif ($_POST["form2"] == "Submit") { do something else;} elseif ($_POST["form3"] == "Submit") { do something creative;} else { die("no form submitted"); Jim - Original Message - From: "php" <[EMAIL PROTECTED]> To: "Php" <[EMAIL PROTECTED]> Sent: Thursday, December 18, 2003 4:19 PM Subject: [PHP] picking up a form name | Hi, | | If I have more than one form on a page, how can I get the | name of the form that was sent on the recieving page | without using javascript? | | tia, | Craig | | | TOP DRAW INC. | | p 780.429.9993 | f 780.426.1199 | [EMAIL PROTECTED] | www.topdraw.com | | 10210 - 111 Street, | Edmonton, Alberta | T5K 1K9 | | | -- | 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] Update issue - more then likely simple problem
Thankyou i did not know that command existed! so simple cheers "Eugene Lee" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > On Thu, Dec 18, 2003 at 01:39:57PM +1100, Eric Holmstrom wrote: > > > > What im trying to do is read the information from a field in a table called > > PARTNO. Then add RU to the front of whatever is in the PARTNO field. > > > > So far i have this. > > > > //connect details rarara > > //query > > $query= "SELECT PARTNO FROM russell2 "; > > Didn't you say the table was called "PARTNO", not "russell2"? > > > // make a query to get old stuff from DB col > > $oldstuff = mysql_query($query, $conn) or die(mysql_error()); > > while ($new = mysql_fetch_array($oldstuff)){ > > $final = $new['PARTNO']; > > //new infomation i want to add infront of PARTNO data > > $newstuff = 'RU'; > > //Combining the two resluts together > > $results = $newstuff.$final; > > // just use this to check it was going through properly > > print_r($results); > > } > > > > The problem i have to get it to update. If i add this (see below) inside the > > while statement it continually loops, and outside it doesnt work. > > > > $update = "UPDATE rocket SET PARTNO = '$results''"; > > mysql_query($update); > > > > I know the answer is simple but i seem to be stuck on it. > > I don't think you can just update a row that you just fetched within the > same query. If you do this in PHP, you should split the update into a > separate loop. Of course, it would be faster and more efficient to have > MySQL do it for you: > > UPDATE rocket SET PARTNO = CONCAT('RU',PARTNO) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Manage link.
This one is perfect: $text = preg_replace( "/(?\s]+)/i", "URL", $text ); :D Evan Nemerson wrote: On Thursday 18 December 2003 01:37 pm, Vincent M. wrote: Hello, Is there any way to manage links in an array and transform them. For example, I have this text in the database: php.net/preg_replace --- Software & Support Media, produc-ers of the International PHP Conference, are pleased to announce a new monthly version of their print publication. For more information, you can go here: http://www.google.com Thanks. --- And transform this text to: --- Software & Support Media, producers of the International PHP Conference, are pleased to announce a new monthly version of their print publication. For more information, you can go here: http://www.google.com\";>url Thanks. -- Thanks, Vincent. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Comparison between Postnuke and PHPnuke
On Wed, 17 Dec 2003 23:15:19 +0800, Yc Nyon <[EMAIL PROTECTED]> wrote: I am comparing between this two php-based CMS? My focus is really 1. the availability of modules/add-ons. Not too sure, but seems PHPnuke has more add-ons than Postnuke. 2. ease of maintaining a group of contributors/writers Nyon try this http://www.phpdbform.com/ hth -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] copy function
Is there a way to copy a file from 1 server to a different one? I have this code in a win 2k server, and i try to copy the file to a win NT server: if (is_file($file_att)) if (copy($file_att,'\servername\folder\'.$file_name)) echo "succesful"; else echo "failure"; It gives me this warning: Warning: Unable to create '\servername\folder\image.jpg': Invalid argument in D:\Intranet\sitio\Documentos\copyf.php on line 161 failure I need this to work on any computer of the network. What kind of permission do I need so any computer can use this script? Thanks for the help. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: copy function
Try this: if (copy($file_att,'servername\\folder\\'.$file_name)) and make sure you have write access on the winNT server did that work? Luke om "Omar" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Is there a way to copy a file from 1 server to a different one? > I have this code in a win 2k server, and i try to copy the file to a win NT > server: > > if (is_file($file_att)) > if (copy($file_att,'\servername\folder\'.$file_name)) > echo "succesful"; > else > echo "failure"; > > It gives me this warning: > > Warning: Unable to create '\servername\folder\image.jpg': Invalid argument > in D:\Intranet\sitio\Documentos\copyf.php on line 161 > failure > > I need this to work on any computer of the network. What kind of permission > do I need so any computer can use this script? > > Thanks for the help. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Script timeout Problem
how can i do that? btw the script runs on a local machine but updates the records on a webserver i mean live server. this is also a factor for the timeout. the script was running smoothly for 24000 recods before but now it suddenly timeout after 800records. i dont know what is heppening Haseeb - Original Message - From: "Jas" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Friday, December 19, 2003 3:16 AM Subject: [PHP] Re: Script timeout Problem > Have you tried setting a limit on your MySQL insert and update > statements to limit the amount trying to be processed? > > Haseeb Iqbal wrote: > > hi, > > i need to update a mysql table with a dbf file, the dbf file contains more then 16 records. i knew that the script will not be able to update 16 records in 1 go so i am refreshing the page after speacific no of records. but still the same problem. the script timeout.i tried changing the timeout limit to 300 secs but to noavail. i am pasting the code here.plz take a look may by you can tell me what i am doing wrong > > > > > > > define("strPath","./"); > > > > define("_MySqlEnable",TRUE); > > > > set_time_limit(0); > > > > require_once(strPath."paths.php"); > > > > $strDBName=strPath."uploads/".Date("d-m-Y")."-products.dbf"; > > > > $DBPointer=dbase_open($strDBName,0) or die("Cannot open file for reading"); > > > > $nNoOfRecs=dbase_numrecords($DBPointer); > > > > $nLoopBreak=1500; > > > > $nConn=GetCon(); > > > > if (empty($nLoopStart)) { $nLoopStart=1; } > > > > if ($nNoOfRecs > $nLoopBreak) > > { > >$nLoopTill=$nLoopStart + $nLoopBreak; > >$nFinal=FALSE; > > } > > else > > { > >$nLoopTill=$nLoopBreak; > >$nFinal=TRUE; > > } > > > > for ($nCount=$nLoopStart;$nCount<=$nLoopTill;$nCount++) > > { > >$arrData=dbase_get_record($DBPointer,$nCount); > > > >$GRP=CheckString($arrData[0]); > >$CAT=CheckString($arrData[1]); > >$SUB=CheckString($arrData[2]); > >$VEND_CODE=CheckString($arrData[3]); > >$MANU_PART=CheckString($arrData[4]); > >$PART_NUM=CheckString($arrData[5]); > >$DESCR=CheckString($arrData[6]); > >$COST=CheckString($arrData[7]); > >$RETAIL=CheckString($arrData[8]); > >$QTY=CheckString($arrData[9]); > >$LIST_PRICE=CheckString($arrData[10]); > >$EFF_DATE=CheckString($arrData[11]); > >$TECH_FAX=CheckString($arrData[12]); > >$STATUS=CheckString($arrData[13]); > >$UPC=CheckString($arrData[14]); > > > >$strQuery="SELECT * FROM products WHERE grp='".$GRP."' AND cat='".$CAT."' AND sub='".$SUB."' AND vend_code='".$VEND_CODE."' AND manu_part='".$MANU_PART."' AND part_num='".$PART_NUM."'"; > >$nConn->doQuery($strQuery); > > > >if ($nConn->cntResult()==0) > > $strQuery="INSERT INTO products(products.grp,products.cat,products.sub,products.vend_code,products. manu_part,products.part_num,products.desc,products.cost,products.retail,prod ucts.qty,products.list_price,products.eff_date,products.tech_fax,products.st atus,products.upc) VALUES('".$GRP."','".$CAT."','".$SUB."','".$VEND_CODE."','".$MANU_PART."','" $PART_NUM."','".$DESCR."','".$COST."','".$RETAIL."','".$QTY."','".$LIST_PRI CE."','".$EFF_DATE."','".$TECH_FAX."','".$STATUS."','".$UPC."')"; > $strQuery="INSERT INTO > products(products.grp,products.cat,products.sub,products.vend_code,products. manu_part,products.part_num,products.desc,products.cost,products.retail,prod ucts.qty,products.list_price,products.eff_date,products.tech_fax,products.st atus,products.upc) > VALUES('".$GRP."','".$CAT."','".$SUB."','".$VEND_CODE."','".$MANU_PART."','" $PART_NUM."','".$DESCR."','".$COST."','".$RETAIL."','".$QTY."','".$LIST_PRI CE."','".$EFF_DATE."','".$TECH_FAX."','".$STATUS."','".$UPC."' > LIMIT 200)"; > >else > > $strQuery="UPDATE products SET products.part_num='$PART_NUM',products.desc='$DESCR',COST='$COST',retail='$R ETAIL',qty='$QTY',list_price='$LIST_PRICE',eff_date='$EFF_DATE',tech_fax='$T ECH_FAX',status='$STATUS',upc='$UPC' WHERE grp='".$GRP."' AND cat='".$CAT."' AND sub='".$SUB."' AND vend_code='".$VEND_CODE."' AND manu_part='".$MANU_PART."' AND part_num='".$PART_NUM."'"; > $strQuery="UPDATE products SET > products.part_num='$PART_NUM',products.desc='$DESCR',COST='$COST',retail='$R ETAIL',qty='$QTY',list_price='$LIST_PRICE',eff_date='$EFF_DATE',tech_fax='$T ECH_FAX',status='$STATUS',upc='$UPC' > WHERE grp='".$GRP."' AND cat='".$CAT."' AND sub='".$SUB."' AND > vend_code='".$VEND_CODE."' AND manu_part='".$MANU_PART."' AND > part_num='".$PART_NUM."'LIMIT 200"; > > > >//echo "nCOunt - > $nCount -".$strQuery; > >$nConn->doQuery($strQuery); > > } > > $nCount++; > > $nLoopStart=$nCount; > > if ($nFinal==FALSE) > > { > > //1500 records updated so refresh the page > > ?> > > > > > } > > else > > { > > // all records updated so redirst to calling page. > > ?> > > > > > } > > ?> > > > > Haseeb > > That might help out with the timeouts too. > Jas > > -- > PHP General Mailing List (http://www.ph
[PHP] Best way to store data.
Hi, is the best way to store data in a mysql database in the text it was submitted, or in HTML format ... changing all the \r's and things to --- Philip J. Newman Master Developer PhilipNZ.com [NZ] Ltd. [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Best way to store data.
Which ever way is better for you. That is, what ever is easier when it comes to retrieving and displaying it again. Both items will be treated as text, so mysql won't care. Thomas "Philip J. Newman" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Hi, is the best way to store data in a mysql database in the text it was submitted, or in HTML > format ... changing all the \r's and things to > > > --- > Philip J. Newman > Master Developer > PhilipNZ.com [NZ] Ltd. > [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Changing languages
Hi all, I have an issue here. I'm making a english/spanish site and want the browser to remember their preference with a cookie. The first time a visitor comes into the site, they will be taken to the english part (www.site.com/eng/) and when someone clicks over the "Spanish" link, I want the cookie that was setled to be erased and a new one to be placed instead. The thing is that is being done in two separate files because the problem with headers (one for deleting the cookie and the other to place the new one). The script I have (pretty mesy) doesn't erase the cookie OR places the same one over again instead of placing the new one. Here's what I've got so far: THE MAIN INDEX PAGE: http://localhost/icaam10/".$relative_url); } elseif(!isset($_COOKIE['Languange']) AND !isset($lan)) { $value = "eng"; setcookie ("Language", $value, time()+31536000); header("Location: http://localhost/icaam10/eng";); } elseif(!isset($_COOKIE['Languange']) AND isset($lan)) { $value = $lan; setcookie ("Language", $value, time()+31536000); header("Location: http://localhost/icaam10/".$value); } ?> THE "LANSELECT.PHP" PAGE: http://localhost/icaam10/index.php?lan=esp";); } elseif ($_COOKIE['Language'] == "esp") { $value = $_COOKIE['Language']; setcookie ("Language", $value, time()-31536000); header("Location: http://localhost/icaam10/index.php?lan=eng";); } ?> ___ Cesar L. Aracena Commercial Manager / Developer ICAAM Web Solutions 2K GROUP Neuquen, Argentina Tel: +54.299.4774532 Cel: +54.299.6356688 E-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] $_POST[]
Should $_POST[formReviewBy] have quotes or dose it not matter? --- Philip J. Newman Master Developer PhilipNZ.com [NZ] Ltd. [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] $_POST[]
It should have quotes, unless you have defined formReviewBy as a constant PHP's nice enough to interpret it as a string if using it as a constant fails, but you should still quote it anyway. Martin > > > Should $_POST[formReviewBy] have quotes or dose it not matter? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Best way to store data.
On Friday, December 19, 2003, at 12:19 PM, Philip J. Newman wrote: Hi, is the best way to store data in a mysql database in the text it was submitted, or in HTML format ... changing all the \r's and things to There's definitely no best way... Theory 1: Store it in the format you'll most commonly use it in, eg HTML for mostly HTML work, or raw text for mostly raw-text work (eg email, text files, etc). Make sure you can transform it back though! Theory 2: Always keep the original input, and do basic conversions to HTML on the way out. nl2br() isn't going to add much overhead at all to standard text on anything but the largest, most busy websites. If you change your mind on HOW you wish to transform the text at a later date, it's much easier to change it in the output script, rather than the input script AND all existing blocks of text. Theory 3: For more complex transformations (I have a library which performs heaps of transformations for paragraphs, headings, line breaks, ol and ul lists, and heaps more), it makes sense to me that you'd store the transformed version (to save on repetitive, processor-intensive tasks), and perhaps the original as well (to save converting back when needed in plain text). Cheers, Justin French -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Best way to store data.
Philip J. Newman wrote: Hi, is the best way to store data in a mysql database in the text it was submitted, or in HTML format ... changing all the \r's and things to Depends what you're going to be doing with it. If you know it's only going to go back out to web pages, then it'd make sense to do conversions only once instead of each time it's viewed. If this text can be put into text emails, then you don't want it converted. I prefer to run htmlentities() before saving it in the database, but not nl2br(). htmlentities() helps when you place the data back into form input elements. -- ---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
Re: [PHP] Best way to store data.
Quoting Justin French <[EMAIL PROTECTED]>: > Theory 3: > For more complex transformations (I have a library which performs heaps > of transformations for paragraphs, headings, line breaks, ol and ul > lists, and heaps more), ... and where can we find that library ? -- --- Sign Up for free Email at http://ureg.home.net.my/ --- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Countries, cities, states database
Hi Chris, Chris Shiflett wrote: > I like GeoIP: > > http://www.maxmind.com/ I'm in the search for something similar. Took a look at that site and it seems they want cash for everything. Is there any free resources available. It's of course possible to find the info on www.ansi.org and other international standard organisations. Would be nice though if there is any site with more ready to use data. /Thomas -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Post New Email to Website?
Hello, On 12/18/2003 03:10 PM, [EMAIL PROTECTED] wrote: I do a website for a club I belong to and would like to post the Subjects of new emails to our Announcements email list on the website. Instead of manually adding the subjects to the website, I thought there might be a way to automate it. If anyone could point me to a script that can check an email list for new messages and then include part of that message into a website, I would really appreciate it. If you subscribe an address to that mailing list that is associated to a mailbox that is accessible via POP3, you can check that mailbox regularly to extract the mailing list messages. In that case you may want to try this POP3 client class: http://www.phpclasses.org/pop3class -- Regards, Manuel Lemos Free ready to use OOP components written in PHP http://www.phpclasses.org/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] $_POST[]
On Friday, December 19, 2003, at 01:35 PM, Philip J. Newman wrote: Should $_POST[formReviewBy] have quotes or dose it not matter? Well, since you've obviously tested it and it works, then the simple answer is probably "it doesn't matter", however, all examples in the manual using string-keys that I can see (http://www.php.net/manual/en/language.types.array.php) use quote around the key. You will DEFINITELY need them when the string key has a space or possibly other not-allowed characters, so my advice (which I follow myself) is to always include quotes around a string key. $_POST['formReviewBy']=='Cade Lloyd') { echo 'selected'; } No need for double quotes unless PHP needs to evaluate $vars or escaped chars (like \n or \t) either. Justin French -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: PHP Template Function
Hi Cameron, Seems like http://xaoza.net/software/phpmesh/ could be of some interest to you. I'm checking it out myself as we speak, so I cannot confirm whether it gives you template inheritance via subdirectories. It does provide a means to do away with standard includes anywhere on your site... HTH & good luck with the project, dirk ps: I welcome any insights you might gather on implementing template inheritance without the need for includes (by any means), as I will be facing a similar conversion project in the opening weeks of 2004. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] $_POST[]
That practice $_POST[formReviewBy] should be discouraged. That kind of practice is nearly as bad as magic numbers. You *should* always put variables referenced by $_POST["formReviewBy"] in quotes unless specifically designed. Why?? If you run into a page with a mysterious error (usually missing data), one strategy is to turn on all the debug output using error_reporting(E_ALL) to see if there are any clues about why your code isn't working. I tried this on a typical page, and here's what I got: Notice: Use of undefined constant category_id - assumed 'category_id' in /usr/home/devweb/madi/mods/autoresponder/src/index.php on line 24 and in this index.php on line 24: 24: $arr_list[category_id] = $db_cat_id; I apologize if I am ranting, but I've spent time attempting to debug other programmer's code when they're guilty of this. -Original Message- From: Justin French [mailto:[EMAIL PROTECTED] Sent: Thursday, December 18, 2003 8:57 PM To: [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Subject: Re: [PHP] $_POST[] On Friday, December 19, 2003, at 01:35 PM, Philip J. Newman wrote: > > > Should $_POST[formReviewBy] have quotes or dose it not matter? Well, since you've obviously tested it and it works, then the simple answer is probably "it doesn't matter", however, all examples in the manual using string-keys that I can see (http://www.php.net/manual/en/language.types.array.php) use quote around the key. You will DEFINITELY need them when the string key has a space or possibly other not-allowed characters, so my advice (which I follow myself) is to always include quotes around a string key. $_POST['formReviewBy']=='Cade Lloyd') { echo 'selected'; } No need for double quotes unless PHP needs to evaluate $vars or escaped chars (like \n or \t) either. Justin French -- 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 Guide] For the benefit of new members
=== This message is for the benefit of new subscribers and those new to PHP. Please feel free to add more points and send to the list. === 1. If you have any queries/problems about PHP try http://www.php.net/manual/en first. You can download a copy and use it offline also. Please also try http://www.php.net/manual/faq.php to get answers to frequently answered questions about PHP (added by Christophe Chisogne). 2. Try http://www.google.com next. Searching for "php YOUR QUERY" may fetch you relevant results within the first 10 results, if you are lucky. 3. There is a searchable archive of the mailing list discussion at http://phparch.com/mailinglists. Many of the common topics are discussed repeatedly, and you may get answer to your query from the earlier discussions. For example: One of the repeatedly discussed question in the list is "Best PHP editor". Everyone has his/her favourite editor. You can get all the opinions by going through the list archives. If you want a chosen list try this link : http://phpeditors.linuxbackup.co.uk/ (contributed by Christophe Chisogne). 4. Not sure if PHP is working or you want find out what extensions are available to you? Just put the following code into a file with a .php extension and access it through your webserver: If PHP is installed you will see a page with a lot of information on it. If PHP is not installed (or not working correctly) your browser will try to download the file. (contributed by Teren and reworded by Chris W Parker) 5. If you are stuck with a script and do not understand what is wrong, instead of posting the whole script, try doing some research yourself. One useful trick is to print the variable/sql query using print or echo command and check whether you get what you expected. After diagnosing the problem, send the details of your efforts (following steps 1, 2 & 3) and ask for help. 6. PHP is a server side scripting language. Whatever processing PHP does takes place BEFORE the output reaches the client. Therefore, it is not possible to access the users' computer related information (OS, screen size etc) using PHP. You need to go for JavaScript and ask the question in a JavaScript list. On the other hand you can access the information that is SENT by the user's browser when a client requests a page from your server. You can find details about browser, OS etc as reported by this request. - contributed by Wouter van Vliet and reworded by Chris W Parker. 7. Provide a clear descriptive subject line. Avoid general subjects like "Help!!", "A Question" etc. Especially avoid blank subjects. 8. When you want to start a new topic, open a new mail composer and enter the mailing list address [EMAIL PROTECTED] instead of replying to an existing thread and replacing the subject and body with your message. 9. It's always a good idea to post back to the list once you've solved your problem. People usually add [SOLVED] to the subject line of their email when posting solutions. By posting your solution you're helping the next person with the same question. [contribued by Chris W Parker] 10. Ask smart questions http://catb.org/~esr/faqs/smart-questions.html [contributed by Jay Blanchard) Hope you have a good time programming with PHP. Best regards, -- Integrated Management Tools for leather industry -- http://www.leatherlink.net Ma Siva Kumar, BSG LeatherLink (P) Ltd, Chennai - 600106 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php