Re: [PHP] Setting up group mailer
My mail out script font size=5Email out/font ?php include../../config.php; $sql = SELECT * FROM hyperlinks ORDER BY `id` ASC; $sql_result = mysql_query($sql, $connection) or die (Could not get Query); while ($row = mysql_fetch_array($sql_result)) { $id = $row[id]; $small_text = $row[small_text]; $url_to = $row[url_to]; $image_url = $row[image_url]; $email = $row[webmaster]; if ($email == [EMAIL PROTECTED]) { $email = [EMAIL PROTECTED]; } echo Send Email to $small_text, $email ... sent=ok; $msg = Hello, $email \n\n; $msg .= This is a simple reminder that you have $url_to listed\n; $msg .= with Philip's Domain. http://www.philipsdomain.com/\n;; $msg .= Thanks.\n; $mailheaders = From: Philip's Domain :: Hyperlinks.\n; $mailheaders .= Reply-To: [EMAIL PROTECTED]\n\n; mail($email, Philip J. Newman, $msg, $mailheaders); } ? - Original Message - From: Niklas Lampén [EMAIL PROTECTED] To: Php-General [EMAIL PROTECTED] Sent: Thursday, February 14, 2002 8:47 PM Subject: RE: [PHP] Setting up group mailer Firstly: Keep track very carefully to whom you've allready sent the message, it might allways crash. Second: Add some Sleep()'s so it won't kill your mailserver. Third: Don't spam. :) Niklas -Original Message- From: phantom [mailto:[EMAIL PROTECTED]] Sent: 14. helmikuuta 2002 9:11 To: [EMAIL PROTECTED] Subject: [PHP] Setting up group mailer I am planning a script that will send mail to all my clients (potentially up to 1, even more clients)... I figured I can loop a mailer script for every client (I don't want to have more than one email address per message in the recipient field). Any special advise or pages I could view for help or is looping a mailer script acceptable? I know I had one in ASP once upon a time and the script was so slow that it would mail about 100 messages in a minute and the script would time out quickly before I was done. Thanks. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] ODBC_EXECUTE has a DANGEROUS 'feature'!!!
OK, I checked into this further, and I must apologize: you are correct. I suspect that most of us didn't remember that this feature even existed... You don't have to apologize. And indeed... I don't get the idea that many people know about this. Besides you and maybe one or two others I haven't heard from anyone else who knows this. And, well... before last week I didn't know it either ;) Anyway, I have now documented this, along with several of its existing restrictions. It should show up in the online manual within the next few days. Thx! And I've fixed my scripts. So everyone happy I guess. FWIW, this feature currently (in all versions up to 4.1.1) suffers from the following problems: o File reading is not subject to open_basedir. o File reading is not subject to safe_mode. o The last character of the filename parameter is replaced with \0 after the call to odbc_execute(). o This kinda makes it impossible to use a string which begins and ends with single quotes as a parameter replacement. These are also in the documentation which I added to odbc_execute(). I've submitted patches for the first three problems to the dev team; I guess we'll see whether someone gets around to committing them in time for 4.2.0. I personally would like to see a cleaner way to do this though. Seems like a good idea... your patches, I mean. I hadn't looked into it that much, so I didn't know 'bout those prob's. Except ofcourse that I could indeed simply access any directory on the server (as long as it's readable for the webserver ofcourse). -- * RzE: -- -- Renze Munnik -- DataLink BV -- -- E: [EMAIL PROTECTED] -- W: +31 23 5326162 -- F: +31 23 5322144 -- M: +31 6 21811143 -- -- Stationsplein 82 -- 2011 LM HAARLEM -- Netherlands -- -- http://www.datalink.nl -- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] searching key words from a database field
I'm trying to make a search engine for my database of links. I have been using the following. SELECT * FROM `hyperlinks` WHERE 1 AND `keywords` LIKE '%$getme%' ORDER BY `id` ASC LIMIT 0, 30 if $getme = big trees then it would only search for key words that are there same big trees not for big and trees can anyone help? Philip J. Newman Philip's Domain - Internet Project. http://www.philipsdomain.com/ [EMAIL PROTECTED] Phone: +64 25 6144012
Re: [PHP] searching key words from a database field
On Thursday 14 February 2002 16:38, Philip J. Newman wrote: I'm trying to make a search engine for my database of links. I have been using the following. SELECT * FROM `hyperlinks` WHERE 1 AND `keywords` LIKE '%$getme%' ORDER BY `id` ASC LIMIT 0, 30 if $getme = big trees then it would only search for key words that are there same big trees not for big and trees Split up your keywords. Loop through each one to construct something like: SELECT * FROM `hyperlinks` WHERE 1 AND `keywords` LIKE '%big%' AND `keywords` LIKE '%trees%' ORDER BY `id` ASC LIMIT 0, 30 This will only match when ALL the specified keywords are present. To match on any one of the keywords construct something like: SELECT * FROM `hyperlinks` WHERE `keywords` LIKE '%big%' OR `keywords` LIKE '%trees%' ORDER BY `id` ASC LIMIT 0, 30 -- Jason Wong - Gremlins Associates - www.gremlins.com.hk /* Keep a diary and one day it'll keep you. -- Mae West */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] mmap problem
hi everybody, i have several strange messages in my error_log. [Thu Feb 14 08:37:45 2002] [info] [client 62.109.66.85] (104)Die Verbindung wurde vom Kommunikationspartner zurückgesetzt: client stopped connection before send mmap completed [Thu Feb 14 08:38:47 2002] [info] [client 62.109.66.85] (104)Die Verbindung wurde vom Kommunikationspartner zurückgesetzt: client stopped connection before send mmap completed [Thu Feb 14 08:38:47 2002] [info] [client 62.109.66.85] (104)Die Verbindung wurde vom Kommunikationspartner zurückgesetzt: client stopped connection before send mmap completed [Thu Feb 14 08:38:47 2002] [info] [client 62.109.66.85] (104)Die Verbindung wurde vom Kommunikationspartner zurückgesetzt: client stopped connection before send mmap completed [Thu Feb 14 08:50:02 2002] [info] [client 200.52.162.1] send mmap timed out [Thu Feb 14 09:10:51 2002] [info] [client 212.34.74.75] (32)Datenübergabe unterbrochen (broken pipe): client stopped connection before send body completed [Thu Feb 14 09:14:30 2002] [info] [client 144.254.64.164] (104)Die Verbindung wurde vom Kommunikationspartner zurückgesetzt: client stopped connection before send body completed sorry for the german, it is a german RedHat7.1 distribution using PHP Version 4.1.1 in Apache/1.3.20 compiled like this: './configure' '--with-pgsql=/prog/pgsql' '--enable-discard-path' '--enable-force-cgi-redirect' '--enable-trans-sid' '--prefix=/prog/php' '--with-config-file-path=/prog/php/lib' '--with-mysql=/prog/mysql' '--with-imap=/usr/lib' '--with-kerberos' '--with-imap-ssl' '--with-apxs=/prog/apache/bin/apxs' since (probably) after i installed PHP 4.1.1 (before was PHP 4.0.6) i get the above listed messages and the server slows down after about 3/4 of an hour. so as a fast relieve i am restarting the server now (through a cronjob) every half hour. this is no good at all, but i did not no what to do else. do you have any idea about what is happening? thanks for any help, mark please reply to [EMAIL PROTECTED] -- _ Mark Rosa YourCell.Net dipl. arch. eth, nds caad occupy your cell on the net [email][EMAIL PROTECTED] [www] www.yourcell.net [mobile] +49.179.5481800 [fax] +49.89.2443.56408 [www] www.yourcell.net/rosa [pgp id] 0x1F3A4A6C _ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] HAPPY VALENTINES DAY
Tv Karthick Kumar [EMAIL PROTECTED] schrieb im Newsbeitrag 004d01c1b52e$b3939040$[EMAIL PROTECTED]">news:004d01c1b52e$b3939040$[EMAIL PROTECTED]... Oh, ok when did PHP started celeberating valentine's day ?!?!?!?!?!?!! Karthick not boys only working on php future ;-) regards Pet(e)r -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Setting up group mailer
In article [EMAIL PROTECTED], [EMAIL PROTECTED] says... I am planning a script that will send mail to all my clients (potentially up to 1, even more clients)... I figured I can loop a mailer script for every client (I don't want to have more than one email address per message in the recipient field). Any special advise or pages I could view for help or is looping a mailer script acceptable? I know I had one in ASP once upon a time and the script was so slow that it would mail about 100 messages in a minute and the script would time out quickly before I was done. Thanks. This topic seems to come up quite regularly; if you have a look back over the archives I think you will find that the general opinion is that you should use a dedicated package for mass mailing. qmail/ezmlm is one such package which can use a mysql database if required. -- David Robley Temporary Kiwi! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Decode Encoded text in phpMyAdmin
Hello, How can I decode encoded text/numbers in my phpMyAdmin? I looked at BASE64, but thats not it. Any help is great. Thanks Example: 8e73b27568cb3be29e2da74d42eab6dd -- - Dave Visit http://www.geocities.com/earthtohorny for info on Computers and Upgrading. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Templates
Hi every1, I've been playing around with template.inc out of PHPLib. Now there's just one question dwelling in my head.. is it possible somehow to get the server to parse any html-file that is requested. example: user requests file index.html, index.html is parsed thru a standard template to generate the nicely formatted page... index.html only holds the content of the site and is pure html (maybe with a tag or two to mark the content and the title or so, but no or very very little PHP code in it.) I hope this is more or less understandable... ;oP I'd appreciate any help on that even if you say that it will never work.. thanks Stefan -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] MySQL Admin Tool
Ello all! Whazzup? Ok, I'm over it. Now... Does anyone know how to set up MySQL, or phpMyAdmin to restrict users to a single database? For instance, the user JoeBlow... Joe has a database called JB, I want him to have full access to it and nothing else. How would I go about doing this? I'd also like him to have access to it via PHP, so he can write his own PHP script that'll let him manipulate his database. I just need to lock him out of averything else. And also... How do I go about securing PHP functions. For example, at the moment Joe can upload a PHP script that deletes /etc/named.conf. NOT GOOD! Is there some options you can parse to PHP at compile tim that will deactivate these features, or maybe some other way I can give users full access to all of the PHP functions, but they're restricted to their home dir. Thanks for your help! - Liam -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Templates
Hey mate, There's several template engines out there, Take a look around here: http://www.hotscripts.com/PHP/Scripts_and_Programs/Content_Management/ Hope that helps ya! - Lum - Original Message - From: Truniger, Stefan Martin [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, February 14, 2002 7:46 PM Subject: [PHP] Templates Hi every1, I've been playing around with template.inc out of PHPLib. Now there's just one question dwelling in my head.. is it possible somehow to get the server to parse any html-file that is requested. example: user requests file index.html, index.html is parsed thru a standard template to generate the nicely formatted page... index.html only holds the content of the site and is pure html (maybe with a tag or two to mark the content and the title or so, but no or very very little PHP code in it.) I hope this is more or less understandable... ;oP I'd appreciate any help on that even if you say that it will never work.. thanks Stefan -- 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] links manager
Hi Anybody know of any good scripts for creating a directory for links which includes a search function similar to Yahoo and other search engines. Thanks in advance Mohamed
Re: [PHP] MySQL Admin Tool
Ok, I'm over it. Now... Does anyone know how to set up MySQL, or phpMyAdmin to restrict users to a single database? For instance, the user JoeBlow... Joe has a database called JB, I want him to have full access to it and nothing else. How would I go about doing this? I'd also like him to have access to it via PHP, so he can write his own PHP script that'll let him manipulate his database. I just need to lock him out of averything else. This is a MySQL question, and it looks like you haven't even read the install notes. And also... How do I go about securing PHP functions. For example, at the moment Joe can upload a PHP script that deletes /etc/named.conf. NOT GOOD! Is there some options you can parse to PHP at compile tim that will deactivate these features, or maybe some other way I can give users full access to all of the PHP functions, but they're restricted to their home dir. You can set the open_basedir option in php.ini (look that up), you may be able to set this in a smart way through apache config somehow to get it to reflect the requested website's directory. Also you could try and 'chroot' Apache to make sure it never touches system files. Do some research! bvr. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] MySQL Admin Tool
Liam MacKenzie wrote: And also... How do I go about securing PHP functions. For example, at the moment Joe can upload a PHP script that deletes /etc/named.conf. NOT GOOD! Surely this is a general security issue? If an ordinary user is allowed to delete /etc/named.conf (whether by PHP, Perl or a command line rm /etc/named.conf) then the permissions are not right (only root normally having write permission). Joe may be able to run a script that _tries_ to delete /etc/named.conf but the permissions should not allow it. Or am I missing something? Regards Chris -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Decode Encoded text in phpMyAdmin
porting base64 encode/decode module on Perl to php. http://www.cpan.org David [EMAIL PROTECTED] wrote: Hello, How can I decode encoded text/numbers in my phpMyAdmin? I looked at BASE64, but thats not it. Any help is great. Thanks Example: 8e73b27568cb3be29e2da74d42eab6dd -- - Dave Visit http://www.geocities.com/earthtohorny for info on Computers and Upgrading. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php - Do You Yahoo!? Send FREE Valentine eCards with Yahoo! Greetings!
Re: [PHP] MySQL Admin Tool
No, you're right.. Permissions for that file could probably be tighter, but it's better not to rely on file system permissions only. bvr. And also... How do I go about securing PHP functions. For example, at the moment Joe can upload a PHP script that deletes /etc/named.conf. NOT GOOD! Surely this is a general security issue? If an ordinary user is allowed to delete /etc/named.conf (whether by PHP, Perl or a command line rm /etc/named.conf) then the permissions are not right (only root normally having write permission). Joe may be able to run a script that _tries_ to delete /etc/named.conf but the permissions should not allow it. Or am I missing something? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] MySQL Admin Tool
Perhaps a better way of wording my question would have been to say this: At the moment, I can make seperate users, the do not have permission to create tables in other databases, but the can still browse them and view the information. Any the example I used for the named.conf was a bad one. They cannot delete this, but they can view it's contents. How can I restrict all PHP functions to the one directory? So if a user makes a file like this: ? include (../../../../../../../../../etc/eXtremail/eXtremail.conf); ? Instead of printing the conf file the SMTP password in it, it'll return an error. I've read the docs, but to no avail. Thanks, Liam -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Authentication with sessions - Recommendation and suggestions?
Harry Yu [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Hi All, I'm trying to setup an authentication process and sessions to protect some of my pages for valid users only. The following are what I had in mind: [...] Well, looks fine to me, except that I would use some more sophisticated session-id (like: http://www.domain.com/pathto/file.html?ID=12345678) to show off a bit ;-) Regards, -- Christian Blichmann _ don't hesitate - email me with your thoughts: e-mail: [EMAIL PROTECTED] - please remove the .nospam from address. _ do you want to know more? web:http://www.blichmann.de -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
php-general Digest 14 Feb 2002 11:52:24 -0000 Issue 1171
php-general Digest 14 Feb 2002 11:52:24 - Issue 1171 Topics (messages 84676 through 84722): Re: ODBC_EXECUTE has a DANGEROUS 'feature'!!! 84676 by: Lars Torben Wilson 84706 by: * RzE: Re: PHP GD - Nevermind! Thanks! 84677 by: David Robley Re: Troubles With Mail Function 84678 by: David Robley 84682 by: Dr. Shim 84683 by: Martin Towell 84692 by: Gary 84695 by: David Robley 84697 by: Dr. Shim Re: php dies every 2 days 84679 by: David Robley Off the topic 84680 by: Dani compiling modues 84681 by: Andreas Gietl Browse and Upload file 84684 by: Reuben D Budiardja 84685 by: Lars Torben Wilson 84687 by: Reuben D Budiardja 84689 by: Lars Torben Wilson 84691 by: Reuben D Budiardja 84693 by: Lars Torben Wilson 84694 by: Reuben D Budiardja 84701 by: Lars Torben Wilson Authentication with sessions - Recommendation and suggestions? 84686 by: Harry Yu 84722 by: Christian Blichmann Webhosts 84688 by: Ben Clumeck 84699 by: R'twick Niceorgaw 84700 by: Michael Romagnoli Is this possible? 84690 by: Leif K-Brooks 84696 by: Rick Emery HAPPY VALENTINES DAY 84698 by: Balaji Ankem 84704 by: TV Karthick Kumar 84710 by: Petr Koval Setting up group mailer 84702 by: phantom 84703 by: Niklas Lampén 84705 by: Philip J. Newman 84711 by: David Robley searching key words from a database field 84707 by: Philip J. Newman 84708 by: Jason Wong mmap problem 84709 by: Mark Rosa Decode Encoded text in phpMyAdmin 84712 by: David 84719 by: Toni Kustiana Templates 84713 by: Truniger, Stefan Martin 84715 by: Liam MacKenzie MySQL Admin Tool 84714 by: Liam MacKenzie 84717 by: bvr 84718 by: Chris Hewitt 84720 by: bvr 84721 by: Liam MacKenzie links manager 84716 by: Administration.myclassguide Administrivia: To subscribe to the digest, e-mail: [EMAIL PROTECTED] To unsubscribe from the digest, e-mail: [EMAIL PROTECTED] To post to the list, e-mail: [EMAIL PROTECTED] -- ---BeginMessage--- On Mon, 2002-02-11 at 00:21, * RzE: wrote: I understand you try to 'protect' your own product, but you have to stay a bit realistic about some things. Ofcourse I check the input. But you know... there's absolutely nothing wrong with allowing quotes to be stored in the database. It's just that awful 'feature' that makes it rather dangerous to do. If that feature/bug was documented _anywhere_ it would still not be good, but at least someone would know that PHP does this. But no... it's not documented, not anywhere! You can't check user input on stuff you don't know it can harm anything. Like I said... quotes are very normal to be allowed in the database. It would be a good thing if you guys do something of: 1. Good rid of the bug(/feature) right a way or 2. Document it clearly. Eg. in the documentation of odbc_execute(). OK, I checked into this further, and I must apologize: you are correct. I suspect that most of us didn't remember that this feature even existed... Anyway, I have now documented this, along with several of its existing restrictions. It should show up in the online manual within the next few days. FWIW, this feature currently (in all versions up to 4.1.1) suffers from the following problems: o File reading is not subject to open_basedir. o File reading is not subject to safe_mode. o The last character of the filename parameter is replaced with \0 after the call to odbc_execute(). o This kinda makes it impossible to use a string which begins and ends with single quotes as a parameter replacement. These are also in the documentation which I added to odbc_execute(). I've submitted patches for the first three problems to the dev team; I guess we'll see whether someone gets around to committing them in time for 4.2.0. I personally would like to see a cleaner way to do this though. Torben -- * RzE: -- Torben Wilson [EMAIL PROTECTED] http://www.thebuttlesschaps.com http://www.hybrid17.com http://www.inflatableeye.com +1.604.709.0506 ---End Message--- ---BeginMessage--- OK, I checked into this further, and I must apologize: you are correct. I suspect that most of us didn't remember that this feature even existed... You don't have to apologize. And indeed... I don't get the idea that many people know about this. Besides you and maybe one or two others I haven't heard from anyone else who knows this. And, well... before last week I didn't know it either ;) Anyway, I have now documented this, along with several of its existing restrictions. It should show up in the online manual within the next few days.
[PHP] last char in string?
hello php guys, how can i delete the last char in a string? thanx -- --- magic garden GmbH - Agentur für Informationsarchitektur Hermannstr. 15 - 70178 Stuttgart (Am Feuersee) www.magic-garden.de ¦ [EMAIL PROTECTED] Tel. (07 11) 619 57-42 ¦ Fax (07 11) 615 01 38 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] last char in string?
http://php.net/substr $rest = substr(abcdef, 0, -1); // returns abcde -Rasmus On Thu, 14 Feb 2002, marcbey wrote: hello php guys, how can i delete the last char in a string? thanx -- --- magic garden GmbH - Agentur für Informationsarchitektur Hermannstr. 15 - 70178 Stuttgart (Am Feuersee) www.magic-garden.de ¦ [EMAIL PROTECTED] Tel. (07 11) 619 57-42 ¦ Fax (07 11) 615 01 38 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Newbie question about links
On Wednesday 13 February 2002 03:13, Chris Schoeman wrote: I want to make links on my website which doesn't show the original url of that page. How Can I do that? Have your links of the form: htpp://www.mydomain.com/linkto.php?id=123 Then in linkto.php you need to redirect (using header()) to the appropriate URL. Something like: ? $LINKS = array(123 = www.doo.com, 124 = www.dah.com/doodah.html); if ($LINKS[$id]) { $link = $LINKS[$id]; header(Location: http://$link;); } else { echo Invalid link!; } ? -- Jason Wong - Gremlins Associates - www.gremlins.com.hk /* It occurred to me lately that nothing has occurred to me lately. */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] MySQL Admin Tool
Liam MacKenzie wrote: permission to create tables in other databases, but the can still browse them and view the information. I do not know MySQL but I'd be very surprised if this was not a database creation/configuration issue. In postgres, unless given permission, I cannot even connect to someone else's database. Any the example I used for the named.conf was a bad one. They cannot delete this, but they can view it's contents. How can I restrict all PHP functions to the one directory? So if a user makes a file like this: ? include (../../../../../../../../../etc/eXtremail/eXtremail.conf); ? Instead of printing the conf file the SMTP password in it, it'll return an error. I think this is a real general security issue, not limited to PHP. Some sites do not have write access to anything in cgi-bin but have some scripts which may be read and used. Now with perl and php, executing ordinary commands becomes easier. I have an account on a webhosting (GNU Linux) computer, only ftp and web access and to my area only (no shell). Apache has a document root for me and I cannot go above it. The ftp access has a ftproot for me and I cannot go above it. Last night I ftp'ed a little perl (it does not have php) script into my directory, chmod to 755 and executed it (by its url). It did a cat /etc/httpd/conf/httpd.conf filename. I then ftp'ed it back to me. I can only read/modify files for which my username/group has permissions but its enough to give me all the login names if I wanted them. Used as cgi-bin type scripts perl, php (and anything else) has no concept of a document root, so root is the real root. A compiled C program uploaded can do the same. I feel an execution parser is needed so that only certain types of programs may be executed and the concept of a execution root to users directories. Read/execute access to some things outside are necessary though. What do others on the list think? This issue must have come up before somewhere so is there an accepted solution and am I missing something? Regards Chris -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] last char in string?
$s = substr($s,0,strlen($s)-1); Valentin Petruchek (aki Zliy Pes) *** Cut the beginning *** http://zliypes.com.ua mailto:[EMAIL PROTECTED] - Original Message - From: marcbey [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, February 14, 2002 1:48 PM Subject: [PHP] last char in string? hello php guys, how can i delete the last char in a string? thanx -- --- magic garden GmbH - Agentur für Informationsarchitektur Hermannstr. 15 - 70178 Stuttgart (Am Feuersee) www.magic-garden.de ¦ [EMAIL PROTECTED] Tel. (07 11) 619 57-42 ¦ Fax (07 11) 615 01 38 -- 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] testing
test msg pls ignore -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
FW: [PHP] Newbie question about links
That won't work. If you relocate using header(Location: ...) then it DOES show the original URL in the browser's address field. There are other ways of relocating which don't do this. For instance: (1) include(real-path); (2) readfile(real-path); Jill -Original Message- From: Jason Wong [SMTP:[EMAIL PROTECTED]] Sent: Thursday, February 14, 2002 12:04 To: [EMAIL PROTECTED] Subject: Re: [PHP] Newbie question about links On Wednesday 13 February 2002 03:13, Chris Schoeman wrote: I want to make links on my website which doesn't show the original url of that page. How Can I do that? Have your links of the form: htpp://www.mydomain.com/linkto.php?id=123 Then in linkto.php you need to redirect (using header()) to the appropriate URL. Something like: ? $LINKS = array(123 = www.doo.com, 124 = www.dah.com/doodah.html); if ($LINKS[$id]) { $link = $LINKS[$id]; header(Location: http://$link;); } else { echo Invalid link!; } ? -- Jason Wong - Gremlins Associates - www.gremlins.com.hk /* It occurred to me lately that nothing has occurred to me lately. */ -- 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] Using winpopup to notify users
I'm wondering if anyone has a class to do a the equivalent of a net send through PHP? Thanks, -Garth Northern.CA ===-- http://www.northern.ca Canada's Search Engine -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: FW: [PHP] Newbie question about links
On Thursday 14 February 2002 20:43, [EMAIL PROTECTED] wrote: That won't work. If you relocate using header(Location: ...) then it DOES show the original URL in the browser's address field. There are other ways of relocating which don't do this. For instance: (1) include(real-path); (2) readfile(real-path); My understanding of the question was that the poster did not want the URLs visible on the page *containing* the links. We'll just have to wait for the original poster to clarify the problem. -- Jason Wong - Gremlins Associates - www.gremlins.com.hk /* If all the world's economists were laid end to end, we wouldn't reach a conclusion. -- William Baumol */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] class and session identyfier
hi I've got session identyfier in $session_id. In all sites it can be see very well. But in one site I use class in this form: class name { function1(); function2(); etc. } and inside it the $session_id is unknown(outside class is OK). What should I do inside class that my session idetyfier will be known?? thx sasza -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Browse and Upload file
Aha Yes, it works fine now. Again, thanks a lot. Rdb On Thursday 14 February 2002 12:18 am, you wrote: On Wed, 2002-02-13 at 19:18, Reuben D Budiardja wrote: Yes, I have. I follow the example exactly from http://www.php.net/manual/en/features.file-upload.php. Well, that's the problem then. The example in the manual is buggy. :) uploadPic2.php: ? print_r($HTTP_POST_FILES); move_uploaded_file($HTTP_POST_FILES['userfile'], /home/web/final); The above line should read: move_uploaded_file($HTTP_POST_FILES['userfile']['tmp_name'], /home/web/final/some_file_name.jpg); Hope this clears it up for you. Torben -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] links manager
Look here: http://www.zend.com/apps.php?CID=38 -Original Message- From: Administration@myclassguide [mailto:[EMAIL PROTECTED]] Sent: Thursday, February 14, 2002 5:22 AM To: [EMAIL PROTECTED] Subject: [PHP] links manager Hi Anybody know of any good scripts for creating a directory for links which includes a search function similar to Yahoo and other search engines. Thanks in advance Mohamed -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] array variable name
How can I get the name of array variable into str? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Using winpopup to notify users
Dnia czwartek 14 luty 2002 13:55, Garth Dahlstrom napisa: I'm wondering if anyone has a class to do a the equivalent of a net send through PHP? If U got samba instaled on Your serwer U can always do exec(smbclient -M $message); Thanks, -Garth Northern.CA ===-- http://www.northern.ca Canada's Search Engine -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] What are you using for please wait?
I would just like to see how people are handling long running PHP scripts. I have been using a page in the middle that says please wait and then using a META tag that forwards the user on to the intended page. This has been working well up until now. I now have a page that is posting an array on to the next page. The array can have as many 1500 elements pulled from a database. It works fine when I post directly to destination page. The problem is that the query can take up to 2 minutes and the I am not giving the user any indication as to what is going on. I can't figure out how to pass the array on to the destination page with a forward page in the middle. I have used hidden values for this in the past but 1500 hiddens seems schlocky. I am now looking into a possilbe other method for letting the users know it will be a minute with the middle forward page. I have found a few javascript loading functions but have not been able to implement them successfully. Please E-mail directly if you are using a more elegant solution. Thanx in advance, PHP is better then Elvis BEH
[PHP] Uploading Files via Forms
I have a CD with several of our company's product images on it. They consists of very large original TIF and EPS images directly from our graphics department. An image's size ranges anywhere from a a few hundred kilobytes to 40 megabytes. I have set up a form to upload the images. They are later converted via system calls with ImageMagick into JPG format. It almost always works with smaller size images (~6-8MB or less). But when uploading anything really large, it fails every time. The files are not even getting to the server. I've edited the php.ini with the following: post_max_size = 50M upload_max_filesize = 50M Is there something else I'm missing? -- Aaron Gould [EMAIL PROTECTED] Web Developer -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] browser reload button
Hi list, I've made a log to my site, that counts the hits per page. My problem is, there is some way to detect when the user presses the reload button?? I need this, or other suggestion, in order to prevent the log to input data for the reload, that isn't a real visit. My script is just a insert into a table, and I put it in the beggining of my page with require(); Thank's in advance Rodrigo Peres -- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: [imp] CRAM-MD5 problem with Horde2/IMP3 and PHP4.1.1 ..
And here is imap-2000c+PHP4.1.1+ ... Feb 14 11:12:09 earth imapd[46002]: accepted connection Feb 14 11:12:09 earth imapd[46002]: login: earth.hub.org[64.49.215.11] scrappy CRAM-MD5 User logged in Feb 14 11:12:10 earth imapd[46002]: accepted connection Feb 14 11:12:10 earth imapd[46002]: badlogin: earth.hub.org[64.49.215.11] CRAM-MD5 authentication failure [incorrect digest response] Feb 14 11:12:13 earth imapd[46002]: badlogin: earth.hub.org[64.49.215.11] CRAM-MD5 authentication failure [incorrect digest response] So, whomever is saying that its an imap-2001a issue and that downgrading to imap-2000c *has* to have done something else at the same time, cause I can't find any difference between 2001a and 2000c ... My question is ... why is it doing the double login? It logs in fine, then it tries to connect a second time, which fails ... Mark, would there be any reason in c-client that would cause this? On Thu, 14 Feb 2002, Marc G. Fournier wrote: On Thu, 14 Feb 2002, Jan Schneider wrote: Zitat von Marc G. Fournier [EMAIL PROTECTED]: On Thu, 7 Feb 2002, Jan Schneider wrote: Can anyone provide any insight or thoughts as to what it is that I'm not seeing? That I might have setup wrong? My PHP config is viewable at: http://www.hub.org/phpinfo.php, and I am running iwth cclient-2001a compiled in ... Both imap-2001a and CRAM-MD5 authentication on Cyrus have some issues that were already discussed on the list. Check the archives for details. As a start I'd try to downgrade the c-client. Can you recommend how far back to downgrade ... I tried upgrading to the newest 2002 dev snapshot, but that is broken too :( Same errors ... Most complaints came on imap-2001a c-client compiled into php. So I think there is any issue as you already found out yourself (see your other messages) Some people reported that downgrading to imap-2000c fixes things and everything worked like a charm again. Okay, this is as far back as imap-4.7c+PHP4.1.1: Feb 14 10:49:36 earth imapd[81403]: accepted connection Feb 14 10:49:36 earth imapd[81403]: login: earth.hub.org[64.49.215.11] scrappy CRAM-MD5 User logged in Feb 14 10:49:37 earth imapd[81403]: accepted connection Feb 14 10:49:37 earth imapd[81403]: badlogin: earth.hub.org[64.49.215.11] CRAM-MD5 authentication failure [incorrect digest response] Feb 14 10:49:39 earth lmtpd[42261]: accepted connection Feb 14 10:49:39 earth lmtpd[42261]: lmtp connection preauth'd as postman Feb 14 10:49:40 earth imapd[81403]: badlogin: earth.hub.org[64.49.215.11] CRAM-MD5 authentication failure [incorrect digest response] I've even tried PHP4.1.0 ... same errors ... Is anyone actually successfully using IMP3+PHP4.1.1+Cyrus-IMAP *without* getting these errors? If so, what versions are you running, of everything? Right now, I'm at: imap-4.7c Cyrus 2.0.16 SASL 1.5.27 PHP4.1.1 I'm going to try imap-2000c next, but am not expecting that to fair any better :( -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Uploading Files via Forms
I remember doing this a while ago. So, please excuse me if I am way off. As far as I recall, the upload form could specify maximum file size. Check if putting a larger value there helps. --- Aaron Gould [EMAIL PROTECTED] wrote: I have a CD with several of our company's product images on it. They consists of very large original TIF and EPS images directly from our graphics department. An image's size ranges anywhere from a a few hundred kilobytes to 40 megabytes. I have set up a form to upload the images. They are later converted via system calls with ImageMagick into JPG format. It almost always works with smaller size images (~6-8MB or less). But when uploading anything really large, it fails every time. The files are not even getting to the server. I've edited the php.ini with the following: post_max_size = 50M upload_max_filesize = 50M Is there something else I'm missing? -- Aaron Gould [EMAIL PROTECTED] Web Developer -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php = Anas Mughal [EMAIL PROTECTED] [EMAIL PROTECTED] Tel: 973-249-6665 __ Do You Yahoo!? Send FREE Valentine eCards with Yahoo! Greetings! http://greetings.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] how a function 'return' statement works
Hm... I tried quite a few variations on this. I can't seem to get any displayable value out of this function. function get_current_page_name() { $current_page_name = explode(/, $_SERVER['PHP_SELF']); $current_page_name = $current_page_name[-1]; return $current_page_name ; } $errorcode = get_current_page_name(); echo $errorcode; Nothing. The only thing that works is $errorcode = basename($_SERVER['PHP_SELF']), but that's not the point -- I still don't understand why the function above doesn't return anything. In this case, I'm positive that I've specified the last element of the array. (Haven't I?) Erik On Wednesday, February 13, 2002, at 05:03 PM, Darren Gamble wrote: I think what you're trying to do is return one particular element out of the array. If that's the case, just use something like: return $current_page_name[-1] to return the last element in the array. Erik Price Web Developer Temp Media Lab, H.H. Brown [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Uploading Files via Forms
Ahhh, ok! I feel like such an idiot. Right at the top of my script there's a spot with the value of maximum upload size. It was set to 10MB, so I changed it to 50MB and it works. I can't believe that slipped by me. :) Thanks very much! -- Aaron Gould [EMAIL PROTECTED] Web Developer - Original Message - From: Anas Mughal [EMAIL PROTECTED] To: Aaron Gould [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Thursday, February 14, 2002 10:22 AM Subject: Re: [PHP] Uploading Files via Forms I remember doing this a while ago. So, please excuse me if I am way off. As far as I recall, the upload form could specify maximum file size. Check if putting a larger value there helps. --- Aaron Gould [EMAIL PROTECTED] wrote: I have a CD with several of our company's product images on it. They consists of very large original TIF and EPS images directly from our graphics department. An image's size ranges anywhere from a a few hundred kilobytes to 40 megabytes. I have set up a form to upload the images. They are later converted via system calls with ImageMagick into JPG format. It almost always works with smaller size images (~6-8MB or less). But when uploading anything really large, it fails every time. The files are not even getting to the server. I've edited the php.ini with the following: post_max_size = 50M upload_max_filesize = 50M Is there something else I'm missing? -- Aaron Gould [EMAIL PROTECTED] Web Developer -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php = Anas Mughal [EMAIL PROTECTED] [EMAIL PROTECTED] Tel: 973-249-6665 __ Do You Yahoo!? Send FREE Valentine eCards with Yahoo! Greetings! http://greetings.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] trouble with headers
On Wednesday, February 13, 2002, at 05:18 PM, Rick Emery wrote: Next time you go to the PHP Manual (dated 19-09-2001) for answers, go to the title page and count down 5 names... dopeSlap target=self / Erik Price Web Developer Temp Media Lab, H.H. Brown [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] how a function 'return' statement works
Do you not have to make $_SERVER a global variable in the function ? Alastair Lightwood Consultancy Ltd Hm... I tried quite a few variations on this. I can't seem to get any displayable value out of this function. function get_current_page_name() { $current_page_name = explode(/, $_SERVER['PHP_SELF']); $current_page_name = $current_page_name[-1]; return $current_page_name ; } $errorcode = get_current_page_name(); echo $errorcode; Nothing. The only thing that works is $errorcode = basename($_SERVER['PHP_SELF']), but that's not the point -- I still don't understand why the function above doesn't return anything. In this case, I'm positive that I've specified the last element of the array. (Haven't I?) Erik On Wednesday, February 13, 2002, at 05:03 PM, Darren Gamble wrote: I think what you're trying to do is return one particular element out of the array. If that's the case, just use something like: return $current_page_name[-1] to return the last element in the array. Erik Price Web Developer Temp Media Lab, H.H. Brown [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Novice: Problems getting data from forms to PHP scripts.
Hi, I've just started to learn php. I can't seem to get any data from an HTML form to a php script. I've had a look at the manual and the various on-line documentation and I think I'm doing things right but perhaps someone can advice on the following :- File: form.php htmlheadtitleFORM/title/head body form method=post action=test.php Name: input type=text date=dateidbr input type=submit /form /body/html File: test.php htmlheadtitlePHP Test/title/head body ?php echo Hello World!BR; foreach ($HTTP_POST_VARS as $var = $value) { echo $var = $valuebr\n; } foreach ($HTTP_GET_VARS as $var = $value) { echo $var = $valuebr\n; } var_dump($HTTP_POST_VARS); echo $dateidBR; echo Hello World!; ? /body/html ** Output:- Hello World! array(0) { } Warning: Undefined variable: dateid in d:\Data\Web\test.php on line 19 Hello World! *** Now I expect the warning for undefined dateid variable as this won't work with register_globals enviornment variable set to off. But according to the documentation the HTTP_POST_VARS should work. By the way, I've tried using the GET method as well. I'm running php 4.1.1, Apache 1.3.23 on NT4 SP6 using IE5.5 and Opera 6.0 Thinking it was my setup (which took a while to get working) I uploaded the scripts to my ISP web server and got the same results! (Linux, Apache 1.3.14, php 4.0.3pl1) Any ideas as to what's happening ? Also I'd like to display some times that are also hyperlinks such that when clicked upon they call a php function passing in the time as data/parameter. Can someone give me hints on the best way to do this. Do these functions have to exist in a separate file, or can they reside in the same file as the form/hyperlink data and just reference the function name. Many thanks for your help. Sean.
Re: [PHP] how a function 'return' statement works
$_SERVER (as well as all the $_* functions) in PHP 4.1 are automatically global. -- Aaron Gould [EMAIL PROTECTED] Web Developer - Original Message - From: Alastair Battrick [EMAIL PROTECTED] To: Erik Price [EMAIL PROTECTED]; Darren Gamble [EMAIL PROTECTED] Cc: PHP [EMAIL PROTECTED] Sent: Thursday, February 14, 2002 10:46 AM Subject: RE: [PHP] how a function 'return' statement works Do you not have to make $_SERVER a global variable in the function ? Alastair Lightwood Consultancy Ltd Hm... I tried quite a few variations on this. I can't seem to get any displayable value out of this function. function get_current_page_name() { $current_page_name = explode(/, $_SERVER['PHP_SELF']); $current_page_name = $current_page_name[-1]; return $current_page_name ; } $errorcode = get_current_page_name(); echo $errorcode; Nothing. The only thing that works is $errorcode = basename($_SERVER['PHP_SELF']), but that's not the point -- I still don't understand why the function above doesn't return anything. In this case, I'm positive that I've specified the last element of the array. (Haven't I?) Erik On Wednesday, February 13, 2002, at 05:03 PM, Darren Gamble wrote: I think what you're trying to do is return one particular element out of the array. If that's the case, just use something like: return $current_page_name[-1] to return the last element in the array. Erik Price Web Developer Temp Media Lab, H.H. Brown [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Is this possible?
It's possible, but it might be easier to set up virtual hosts or something. If you're using apache, you can set this up in httpd.conf, using something like NameVirtualHost * VirtualHost * ServerName www.domain1.com Redirect permenent / http://www.domain.com/domain1 /VirtualHost VirtualHost * ServerName www.domain2.com Redirect permenent / http://www.domain.com/domain2 /VirtualHost Or you can use mod_rewrite and set up rules to act similarly. Of course, if you're not using Apache, go with the PHP solution someone else provided. Might be a bit easier to use the virtual hosts, though, 'cause then you don't have to worry about a bunch of PHP code and just let the web server itself handle everything. J Leif K-Brooks wrote: I would like to have multiple domains and have them forwarded to different folders, so I'd only need one hosting account. Example: www.domain1.com goes to www.domain.com/domain1 www.domain2.com goes to www.domain.com/domain2 I would like to do this in php. Of course, to do this, I'd need to get the url the user is requesting into the script. If this possible? Thanks in advance, Leif K-Brooks. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Decode Encoded text in phpMyAdmin
Hello, How can I decode encoded text/numbers in my phpMyAdmin? I looked at BASE64, but thats not it. Any help is great. Thanks Example: 8e73b27568cb3be29e2da74d42eab6dd i dont wanna spoil your day, but your looking at a md5 hash... md5 is a one way encoding scheme, no way back... md5 is used to make a sum of a load of data and compared by a second sum to see if the data matches (like passwords or file integrety) if you want 7bit encoding try base64_encoding and _decoding hope you can have a good night sleep :) mvgr, Joffrey van Wageningen -- .-[ Joffrey van Wageningen | WoLFjuh | [EMAIL PROTECTED] ]-- | Networking Event 2000 - www.ne2000.nl - IRCnet:#ne2000, Undernet:#clue | PGP:1024D/C6BA5863 - 3B93 52D3 CB91 9CB7 C50D FA79 865F 628A C6BA 5863 | * We demand guaranteed rigidly defined areas of doubt and uncertainty. | -- Douglas Adams -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Novice: Problems getting data from forms toPHPscripts.
Thanks Jeff and sincere apologies for such a simple typoI had copied the html from some on-line example but had tweaked name to dateit's been a while since I've done HTML and I was concentrating on the php side of things. Thanks Sean. Jeff Sheltren [EMAIL PROTECTED] 14/02/02 15:58:01 Hi, for starters, I think you need to change your html... it should read something like this: Name: input type=text name=dateidbr Jeff At 03:50 PM 2/14/2002 +, Sean Connelly wrote: Hi, I've just started to learn php. I can't seem to get any data from an HTML form to a php script. I've had a look at the manual and the various on-line documentation and I think I'm doing things right but perhaps someone can advice on the following :- File: form.php htmlheadtitleFORM/title/head body form method=post action=test.php Name: input type=text date=dateidbr input type=submit /form /body/html File: test.php ?php echo Hello World! ; foreach ($HTTP_POST_VARS as $var = $value) { echo $var = $value \n; } foreach ($HTTP_GET_VARS as $var = $value) { echo $var = $value \n; } var_dump($HTTP_POST_VARS); echo $dateid ; echo Hello World!; ? ** Output:- Hello World! array(0) { } Warning: Undefined variable: dateid in d:\Data\Web\test.php on line 19 Hello World! *** Now I expect the warning for undefined dateid variable as this won't work with register_globals enviornment variable set to off. But according to the documentation the HTTP_POST_VARS should work. By the way, I've tried using the GET method as well. I'm running php 4.1.1, Apache 1.3.23 on NT4 SP6 using IE5.5 and Opera 6.0 Thinking it was my setup (which took a while to get working) I uploaded the scripts to my ISP web server and got the same results! (Linux, Apache 1.3.14, php 4.0.3pl1) Any ideas as to what's happening ? Also I'd like to display some times that are also hyperlinks such that when clicked upon they call a php function passing in the time as data/parameter. Can someone give me hints on the best way to do this. Do these functions have to exist in a separate file, or can they reside in the same file as the form/hyperlink data and just reference the function name. Many thanks for your help. Sean.
Re: [PHP] Troubles With Mail Function
Yes it is. Gary helped me find it. :) Martin Towell [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... I think the SMTP would be same as you use for your email client (outlook, eudora, other?) -Original Message- From: Dr. Shim [mailto:[EMAIL PROTECTED]] Sent: Thursday, February 14, 2002 11:33 AM To: [EMAIL PROTECTED] Subject: Re: [PHP] Troubles With Mail Function Alright, I will show you my entire mail code here. BTW: I cannot mail using mail() function [mail function] ; For Win32 only. SMTP = mindspring.com ; For Win32 only. sendmail_from = [EMAIL PROTECTED] ; For Unix only. You may supply arguments as well (default: 'sendmail -t -i'). ;sendmail_path = I'm using Windows XP at the moment to develop. I'm not quite sure what I'd put under SMTP...is there any tutorials online that would show me how to configure this right? -- 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] Novice: Problems getting data from forms to PHP scripts.
Hi, for starters, I think you need to change your html... it should read something like this: Name: input type=text name=dateidbr Jeff At 03:50 PM 2/14/2002 +, Sean Connelly wrote: Hi, I've just started to learn php. I can't seem to get any data from an HTML form to a php script. I've had a look at the manual and the various on-line documentation and I think I'm doing things right but perhaps someone can advice on the following :- File: form.php htmlheadtitleFORM/title/head body form method=post action=test.php Name: input type=text date=dateidbr input type=submit /form /body/html File: test.php ?php echo Hello World! ; foreach ($HTTP_POST_VARS as $var = $value) { echo $var = $value \n; } foreach ($HTTP_GET_VARS as $var = $value) { echo $var = $value \n; } var_dump($HTTP_POST_VARS); echo $dateid ; echo Hello World!; ? ** Output:- Hello World! array(0) { } Warning: Undefined variable: dateid in d:\Data\Web\test.php on line 19 Hello World! *** Now I expect the warning for undefined dateid variable as this won't work with register_globals enviornment variable set to off. But according to the documentation the HTTP_POST_VARS should work. By the way, I've tried using the GET method as well. I'm running php 4.1.1, Apache 1.3.23 on NT4 SP6 using IE5.5 and Opera 6.0 Thinking it was my setup (which took a while to get working) I uploaded the scripts to my ISP web server and got the same results! (Linux, Apache 1.3.14, php 4.0.3pl1) Any ideas as to what's happening ? Also I'd like to display some times that are also hyperlinks such that when clicked upon they call a php function passing in the time as data/parameter. Can someone give me hints on the best way to do this. Do these functions have to exist in a separate file, or can they reside in the same file as the form/hyperlink data and just reference the function name. Many thanks for your help. Sean. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Sorting an array of arrays....
What I am trying to do is sort a array of arrays but I want to sort by one of the pieces of data stored in the arrays inside the array. For example; $data[blue] = array(name, age, time, 3); $data[green] = array(name, age, time, 7); $data[red] = array(name, age, time, 6); $data[yellow] = array(name, age, time, 2); $data[white] = array(name, age, time, 1); $data[black] = array(name, age, time, 9); I want to be able to sort this array of arrays by the very last element, the numbers. Mike Fifield Charles Schwab Co, Inc. WARNING: All e-mail sent to or from this address will be received by the Charles Schwab corporate e-mail system and is subject to archival and review by someone other than the recipient. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] any ideas : Unexpected character
I have put together this script with the help of some of you kind members here. It seems to do what I set out for it to do, but when it finished the upload it comes up with the following error: Unexpected character try for yourself: http://www.alt-design.net/php/new%20admin/add.php I would be very grateful for any ideas. Cheers Will -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Is this possible?
I forgot to mention, you must have access to the A and/or CNAME records for your DNS in order to point the domains to the single IP adress. Yes, you can do this. In the script below, I read the sub-directory from a MYSQL database. This is overkill for just a few domains, but great for a hundred. The MYSQL table structure is: subdomain char(20) domain char(20) directory char(20) I'm going to change this on my host to: domain varchar(50) directory char(20) The domain field will contain the entire domain and sub-domain structure, which will then easily accomodate sub-domains and sub-sub-domains, etc. This is index.html file: ?php $conn = mysql_connect(localhost,username,password); mysql_select_db(mydatabase,$conn) or die(Error: .mysql_error()); list($subd,$domain,$tld) = explode(.,$HTTP_SERVER_VARS['HTTP_HOST']); if( $tld == ) { $tld = $domain; $domain = $subd; $subd = www; } $query = SELECT directory FROM subdomains WHERE subdomain =\$subd\ domain=\$domain\; $results = mysql_query($query) or die(Error: .mysql_error().BR$queryBR); if( mysql_num_rows($results)1 ) { print Error: Cannot find sub-domain .$HTTP_SERVER_VARS['HTTP_HOST'].BR; exit; } else { $row = mysql_fetch_array($results); $loc = http://www.mydomain.com/.$row['directory']; header( location: $loc); } exit; ? -Original Message- From: Leif K-Brooks To: [EMAIL PROTECTED] Sent: 2/13/02 8:37 PM Subject: [PHP] Is this possible? I would like to have multiple domains and have them forwarded to different folders, so I'd only need one hosting account. Example: www.domain1.com goes to www.domain.com/domain1 www.domain2.com goes to www.domain.com/domain2 I would like to do this in php. Of course, to do this, I'd need to get the url the user is requesting into the script. If this possible? Thanks in advance, Leif K-Brooks. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Sorting an array of arrays....
Good day, uasort() should do what you need. http://www.php.net/manual/en/function.uasort.php There's an example for the usort function that does something similar to what you want, in fact. Darren Gamble Planner, Regional Services Shaw Cablesystems GP 630 - 3rd Avenue SW Calgary, Alberta, Canada T2P 4L4 (403) 781-4948 -Original Message- From: Fifield, Mike [mailto:[EMAIL PROTECTED]] Sent: Thursday, February 14, 2002 9:26 AM To: [EMAIL PROTECTED] Subject: [PHP] Sorting an array of arrays What I am trying to do is sort a array of arrays but I want to sort by one of the pieces of data stored in the arrays inside the array. For example; $data[blue] = array(name, age, time, 3); $data[green] = array(name, age, time, 7); $data[red] = array(name, age, time, 6); $data[yellow] = array(name, age, time, 2); $data[white] = array(name, age, time, 1); $data[black] = array(name, age, time, 9); I want to be able to sort this array of arrays by the very last element, the numbers. Mike Fifield Charles Schwab Co, Inc. WARNING: All e-mail sent to or from this address will be received by the Charles Schwab corporate e-mail system and is subject to archival and review by someone other than the recipient. -- 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] Webhosts
I use http://www.nomonthlyfees.com 500 megs disk space, 5 gig/month bandwidth PHP 4, MYSQL, SSL, SSH, shopping carts, PGP, PGMail, etc $200 first year, includes domain registration $70 each year thereafter, includes domain registration I take my 500 megs and split among 5 domains -Original Message- From: Ben Clumeck [mailto:[EMAIL PROTECTED]] Sent: Wednesday, February 13, 2002 8:29 PM To: [EMAIL PROTECTED] Subject: [PHP] Webhosts I have found 2 webhosts that provide PHP and MySQL: www.aletiahosting.com www.rackspace.net Does anybody have experience with either one (good or bad)? Or does anyone use a good low price host? Thanks, Ben -- 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] Webhosts
I'm beginning to suspect a certain bias GRIN because you always make the same recommendation... -Original Message- From: Michael Romagnoli [mailto:[EMAIL PROTECTED]] Sent: Wednesday, February 13, 2002 10:46 PM To: R'twick Niceorgaw; [EMAIL PROTECTED] Subject: RE: [PHP] Webhosts I would also, once again, toot the horn in favor of: www.spyproductions.com -Mike The unbiased, broken record. At 11:41 PM 2/13/02 -0500, R'twick Niceorgaw wrote: I have been with aletiahosting for few months and been quite happy with them. if you compare the price/features aletiahosting is a good one. their support is good though been detoriated some how... some members do complain about tickets not been resolved quickly but I never had such an experience .. all my problems were handled within 48 hrs which i consider is good enough thinking of their low price. also i haven't found any other host who is so much feature rich with respect to PHP. -Original Message- From: Ben Clumeck [mailto:[EMAIL PROTECTED]] Sent: Wednesday, February 13, 2002 9:29 PM To: [EMAIL PROTECTED] Subject: [PHP] Webhosts I have found 2 webhosts that provide PHP and MySQL: www.aletiahosting.com www.rackspace.net Does anybody have experience with either one (good or bad)? Or does anyone use a good low price host? Thanks, Ben -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] any ideas : Unexpected character
Hi I got this error : Warning: Unexpected character in input: ' in /home/altdesign/public_html/php/new admin/do_addauthor.php on line 14 Can you post the section around Line 14 from do_addauthor.php so we can take a look at it ? Regards Girish -- www.girishnath.co.uk - Original Message - From: Will Hives [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, February 14, 2002 4:34 PM Subject: [PHP] any ideas : Unexpected character I have put together this script with the help of some of you kind members here. It seems to do what I set out for it to do, but when it finished the upload it comes up with the following error: Unexpected character try for yourself: http://www.alt-design.net/php/new%20admin/add.php I would be very grateful for any ideas. Cheers Will -- 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: browser reload button
Hello, there! I've got a solution for your problem: visit.PHP! I have written this small script when I was inspired by PHPHits. You may try it out if you have access to a MySQL database and created the necessary tables. Notice: This is alpha stuff, so you may want to use some other production-level counter-script. Anyway, should be worth a look. Get it from here (see README-file): http://www.blichmann.de/downloads/visitphp01.zip Send any bugs, comments, suggestions and feature requests to [EMAIL PROTECTED] P.S.: At the moment you can freely use and distribute this code, as long as proper credit is given. Regards, -- Christian Blichmann _ don't hesitate - email me with your thoughts: e-mail: [EMAIL PROTECTED] - please remove the .nospam from address. _ do you want to know more? web:http://www.blichmann.de -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] how a function 'return' statement works
Erik, function get_current_page_name() { $current_page_name = explode(/, $_SERVER['PHP_SELF']); $current_page_name = $current_page_name[-1]; return $current_page_name ; } $errorcode = get_current_page_name(); echo $errorcode; The only thing that works is $errorcode = basename($_SERVER['PHP_SELF']), but that's not the point -- I still don't understand why the function above doesn't return anything. In this case, I'm positive that I've specified the last element of the array. (Haven't I?) Some extra debug echo statements will (dis)prove this... =dn -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Store array into mysql?
Hi! I have an array called $myarray and now I want to store it in a mysql table. I tried to just, insert into mytable values('$id', '$myarray') but just got Array when I run while ($row = mysql_fetch_array ($result)) $myarray= $row[myarray]; echo $myarray -- Do I need to first make a string commaseparated or like and than insert that string? Thanks in advance. Regards, Jan Grafström -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] any ideas : Unexpected character
== image/jpg || $type == image/gif || $type == image/pjpeg || $type == image/jpeg){ // is this a valid image? $time_tmp = time(); $time_tmp = substr($time_tmp, -4); $filename = $time_tmp._.$name; // just in case someone uploads matched filenames. $savepath = /home/*/***/php/.$filename; // change the path here. make sure the directory it is going to can be written to by the web user. $moved = move_uploaded_file($file, $savepath); // place the file on the server's filesystem $path = $filename; } else { // wrong file type $path = Sorry, but the file type of this file is not recognised. Please check and try again.p; } } else { // upload failed. $path =Sorry, but the upload failed. Please try again in a short while.p; } return $path; } // uploaded file info-zone - prepare variables to be passed to the upload function $name = $HTTP_POST_FILES['picture']['name']; // orginal name $type = $HTTP_POST_FILES['picture']['type']; // get MIME type of file $path = fileUpload($name,$type,$picture); // yer actual upload function call // I'd recommend you check the value of $path here - if it contains a text string starting with Sorry then something has failed. // and off to the database it goes. $sql = INSERT INTO $table_name (id, name, email, picture_name) VALUES ('$id', '$name', '$email', '$path') ; $result = mysql_query($sql, $connection) or die (couldn't execute query); in article 005301c1b576$31479df0$0a0a@AERIS, Girish Nath at [EMAIL PROTECTED] wrote on 2/14/2002 4:39 PM: Hi I got this error : Warning: Unexpected character in input: ' in /home/altdesign/public_html/php/new admin/do_addauthor.php on line 14 Can you post the section around Line 14 from do_addauthor.php so we can take a look at it ? Regards Girish -- www.girishnath.co.uk - Original Message - From: Will Hives [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, February 14, 2002 4:34 PM Subject: [PHP] any ideas : Unexpected character I have put together this script with the help of some of you kind members here. It seems to do what I set out for it to do, but when it finished the upload it comes up with the following error: Unexpected character try for yourself: http://www.alt-design.net/php/new%20admin/add.php I would be very grateful for any ideas. Cheers Will -- 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] center text on image
I was wondering if it's possible to centre text precisely on an image.I'm thinking I need to get the width of of the string in pixels?,take this away from imagesx(image) and devide by 2 to get x value. so has anyone achieved this?
RE: [PHP] Troubles With Mail Function
I have a similar situation and would like to know your solution. I would like to send mail from my RH Linux box using the sendmail -t -i command through my isp mailer (mail.attbi.com). Could you post, or send me directly, the PHP code that you developed for this? thanks rick -Original Message- From: Dr. Shim [mailto:[EMAIL PROTECTED]] Sent: Wednesday, February 13, 2002 10:14 PM To: [EMAIL PROTECTED] Subject: Re: [PHP] Troubles With Mail Function Well I tried what Gary suggested. I did smtp.mindspring.com and it worked beutifully. I feel stupid that the problem was so simple. But, alas, I'm learing. Thanks all you. Robley, that is some very informative information, this digging. dig -t mx alienmelon.com in console right? David Robley [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... In article [EMAIL PROTECTED], [EMAIL PROTECTED] says... Alright, I will show you my entire mail code here. BTW: I cannot mail using mail() function [mail function] ; For Win32 only. SMTP = mindspring.com ; For Win32 only. sendmail_from = [EMAIL PROTECTED] ; For Unix only. You may supply arguments as well (default: 'sendmail -t -i'). ;sendmail_path = I'm using Windows XP at the moment to develop. I'm not quite sure what I'd put under SMTP...is there any tutorials online that would show me how to configure this right? In addition to my previous message - OK, I've gone and put the necessary software on the linux side of this thing and asked the appropriate questions - if I do a 'dig' on alienmelon i find: ; DiG 9.1.2 -t mx alienmelon.com ;; global options: printcmd ;; Got answer: ;; -HEADER- opcode: QUERY, status: NOERROR, id: 43766 ;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 2, ADDITIONAL: 3 ;; QUESTION SECTION: ;alienmelon.com. IN MX ;; ANSWER SECTION: alienmelon.com. 28739 IN MX 10 mail.alienmelon.com. ;; AUTHORITY SECTION: alienmelon.com. 163967 IN NS NS.HOST4U.NET. alienmelon.com. 163967 IN NS NS2.HOST4U.NET. ;; ADDITIONAL SECTION: mail.alienmelon.com. 28739 IN A 64.33.108.112 NS.HOST4U.NET. 170095 IN A 209.150.128.30 NS2.HOST4U.NET. 3201 IN A 209.150.129.3 ;; Query time: 154 msec ;; SERVER: 203.96.152.4#53(203.96.152.4) ;; WHEN: Thu Feb 14 16:07:51 2002 ;; MSG SIZE rcvd: 146 which implies that alienemelon uses mail.alienmelon.com to handle its mail. So a ping to that to see if it exists gives us C:\WINDOWSping mail.alienmelon.com Pinging mail.alienmelon.com [64.33.108.112] with 32 bytes of data: Reply from 64.33.108.112: bytes=32 time=329ms TTL=239 Reply from 64.33.108.112: bytes=32 time=325ms TTL=239 Reply from 64.33.108.112: bytes=32 time=315ms TTL=239 Reply from 64.33.108.112: bytes=32 time=315ms TTL=239 Ping statistics for 64.33.108.112: Packets: Sent = 4, Received = 4, Lost = 0 (0% loss), Approximate round trip times in milli-seconds: Minimum = 315ms, Maximum = 329ms, Average = 321ms C:\WINDOWS so it seems to exist. I suggest you try mail.alienmelon.com as the SMTP entry in your config and see what happens. -- David Robley Temporary Kiwi! -- 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] how a function 'return' statement works
How about: return $current_page_name[count($current_page_name)-1]; -Original Message- From: Erik Price [mailto:[EMAIL PROTECTED]] Can anyone give my puny mind an explanation as to why the following function only returns the value Array ? # === # get_current_page_name() # --- # Returns the current document # Arguments # --- # no arguments # === function get_current_page_name() { $current_page_name = explode(/, $_SERVER['PHP_SELF']); $current_page_name = array_slice($current_page_name, -1); return $current_page_name; } -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] session problem
Hi list, I've made this script in order to solve the problem with reload button that I've posted. My idea is to register in a session the id, them check if it exists, if so don't insert again. But even if I quit the browser the session persists. Why?? ps: this is an include in the main page where I use session_start(); if(!$visita) { $visita = array(); } if(!in_array($celebID,$visita)) { $sql_log = INSERT INTO log_hits (logID,log_date,log_ip,log_referrer,log_celeb,log_url) VALUES('',now(),'$REMOTE_ADDR','$HTTP_REFERER','$celebID','$REQUEST_URI'); $query_log = new Query($conexao); $query_log-executa($sql_log); array_push($visita,$celebID); session_register('visita'); } Thank's Rodrigo -- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Books on PHP
I am new to PHP and was wondering if anyone can point me the right direction with PHP urls and books In the past few months I have received nearly all of the PHP books that have been written (I wanted to evaluate possible books for some classes) and I think all of the entry-level/beginner/learn the language kind of books. PHP and MySQL Web Development is a great book, and provides a good resource for both PHP and MySQL in one text. However, I think its sections on actually learning PHP are a bit on the short side, assuming more knowledge and self-motivation than a lot of people (ok, beginning students) might have. I highly recommend it, but I would add to it the PHP Bible (which you already have) and, if that isn't enough, the PHP books from Wrox. PHP4: A Beginner's Guide is actually pretty good and might have been (had I received it in time) the best choice for a class text, since it is structured and written that way. You really can't go wrong with any of those books, a good project to keep yourself interested, and a local copy of the documentation. c -- Chris Lott http://www.chrislott.org/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] session problem
What do you mean : session persist? Whe you close the browser the file(the most common case) is not deleted till the session expires. So if the expire time is 30 min it will stay in the /tmp for minimum 30 mins(the session garbage collector is not started on every request). The cookie which is the session_id(PHPSESSID) is set to be valid till the browser is closed. After browser closing it is no valid for the browser. Best regards, Andre Hristov P.S. Back from the exams hell...Ready for helping again. - Original Message - From: Rodrigo Peres [EMAIL PROTECTED] To: PHP [EMAIL PROTECTED] Sent: Thursday, February 14, 2002 7:25 PM Subject: [PHP] session problem Hi list, I've made this script in order to solve the problem with reload button that I've posted. My idea is to register in a session the id, them check if it exists, if so don't insert again. But even if I quit the browser the session persists. Why?? ps: this is an include in the main page where I use session_start(); if(!$visita) { $visita = array(); } if(!in_array($celebID,$visita)) { $sql_log = INSERT INTO log_hits (logID,log_date,log_ip,log_referrer,log_celeb,log_url) VALUES('',now(),'$REMOTE_ADDR','$HTTP_REFERER','$celebID','$REQUEST_URI'); $query_log = new Query($conexao); $query_log-executa($sql_log); array_push($visita,$celebID); session_register('visita'); } Thank's Rodrigo -- -- 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] Store array into mysql?
Hi Jan I have an array called $myarray and now I want to store it in a mysql table. I tried to just, insert into mytable values('$id', '$myarray') but just got Array when I run while ($row = mysql_fetch_array ($result)) $myarray= $row[myarray]; echo $myarray -- Do I need to first make a string commaseparated or like and than insert that string? It depends... but don't worry, this is a fairly common assumption, so we can quickly sort it out for you. First some questions: Do you want to fit the elements of the array into successive columns across a single row of the MySQL table, or do you want each of the array elements to be stored into separate rows in the table? Are we talking about a one dimensional array, two, or more? What is the MySQL table schema? Please advise, =dn PS are you aware that there is another PHP discussion list [PHP-DB]? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Store array into mysql?
Hi, if you want to save an array and the structure is not known when you make the database schema definition, you have to serialize(), put the string in the DB, and when you restore it from the DB do unserialize(). Best regards, Andrey Hristov Back from the exams hellReady to help again. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] VERY novice question!
Thanks for reading this! This is a really novice question but I cant find any info about this in the online manual. I would be grateful if someone could email me the PHP equivalent of the (AND) and ||(OR) operators which are used in C. I'am trying to write if statements like if((($m[0]==-)($count2))||($count++0)) { } I be grateful for any replies!! Thanks, Bren _ Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] VERY novice question!
Just go with your instincts, you got 'em ;) , AND for and ||, OR for or. The symbols are at one precendece level higher than the words, I believe. Kirk -Original Message- From: brendan conroy [mailto:[EMAIL PROTECTED]] Sent: Thursday, February 14, 2002 10:47 AM To: [EMAIL PROTECTED] Subject: [PHP] VERY novice question! Thanks for reading this! This is a really novice question but I cant find any info about this in the online manual. I would be grateful if someone could email me the PHP equivalent of the (AND) and ||(OR) operators which are used in C. I'am trying to write if statements like if((($m[0]==-)($count2))||($count++0)) { } I be grateful for any replies!! Thanks, Bren -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] VERY novice question!
They are and ||, also there are AND and OR case insesitive. But you have to know taht and and have different place in the precedence table. The same is for || and or. But This is very rare case to rely on the precedence. if((($m[0]==-)($count2))||($count++0)) this seems ok but $count++0 is not OK. What you want to do? Best regards, Andrey Hristov Back from the exams hell - Original Message - From: brendan conroy [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, February 14, 2002 7:46 PM Subject: [PHP] VERY novice question! Thanks for reading this! This is a really novice question but I cant find any info about this in the online manual. I would be grateful if someone could email me the PHP equivalent of the (AND) and ||(OR) operators which are used in C. I'am trying to write if statements like if((($m[0]==-)($count2))||($count++0)) { } I be grateful for any replies!! Thanks, Bren _ Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Php is serversided????
Two ways this is possible: 1. The user has selected an item and hit the submit button, thereby sending everything to the server and it is working there. 2. The user comes in from a different link, different server, or has a cookie on their machine. - Original Message - From: Morten Nielsen [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, February 13, 2002 12:56 PM Subject: [PHP] Php is serversided Hi, I don't understand... Everybody says PHP is server based, so everything is calculated before the user sees it in his browser. But if that is the case how is it then possible to use if-statements. Wouldn't that mean that the if-statement has been executed before the user makes a selection? Please explain it to me, Morten -- 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: [PHP-DEV] Newbie help w/ dynamic variables
you can create variables dinamically like that $counter=0; foreach ($some_arr as $key=$value){ $(your_dyn_var.$counter}=some html code; $counter++; } So if you have 5 iterations you will have in the namespace new 5 variables : from $your_dyn_var0 to $your_dyn_var4 When you want to show them in the parsed html do: $counter=0; while(isset(${your_dyn_var.$counter++})) echo ${your_dyn_var.($counter-1);} or for ($tmp_count=0;$tmp_count$counter;$counter++){ echo ${your_dyn_var.$counter};} Best regards Andrey Hristov - Original Message - From: Honey House Designs To: [EMAIL PROTECTED] Sent: Thursday, February 14, 2002 7:56 PM Subject: [PHP-DEV] Newbie help w/ dynamic variables I would like to dynamically create variables in my WHILE loop that then can actually have php parsed html code stored inside them and then have the value of that variable run when after php is run and as the html is evaluated at page loading... Any suggestions? And be gentle... I am a newbie! Tx, tb -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Books on PHP
For learning PHP, I liked PHP Essentials by Julie Meloni. -Mike -Original Message- From: Chris Lott [mailto:[EMAIL PROTECTED]] Sent: Thursday, February 14, 2002 12:28 PM To: [EMAIL PROTECTED] Subject: RE: [PHP] Books on PHP I am new to PHP and was wondering if anyone can point me the right direction with PHP urls and books In the past few months I have received nearly all of the PHP books that have been written (I wanted to evaluate possible books for some classes) and I think all of the entry-level/beginner/learn the language kind of books. PHP and MySQL Web Development is a great book, and provides a good resource for both PHP and MySQL in one text. However, I think its sections on actually learning PHP are a bit on the short side, assuming more knowledge and self-motivation than a lot of people (ok, beginning students) might have. I highly recommend it, but I would add to it the PHP Bible (which you already have) and, if that isn't enough, the PHP books from Wrox. PHP4: A Beginner's Guide is actually pretty good and might have been (had I received it in time) the best choice for a class text, since it is structured and written that way. You really can't go wrong with any of those books, a good project to keep yourself interested, and a local copy of the documentation. c -- Chris Lott http://www.chrislott.org/ -- 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] character replace function
I need a function that will erase a particular character in a string. Any ideas?!? THANKS
Re: [PHP] character replace function
Try: $outputstring = str_replace($character_to_erase, '', $inputstring); -- Aaron Gould [EMAIL PROTECTED] Web Developer - Original Message - From: Phil Schwarzmann [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, February 14, 2002 1:38 PM Subject: [PHP] character replace function I need a function that will erase a particular character in a string. Any ideas?!? THANKS -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: center text on image
If you're using GD2, try looking at ImageTTFBox() and ImageFTBox(). They'll give you the coordinates for a bounding box around the text. Use them in relation to the image to center it properly. J Adrian Murphy wrote: I was wondering if it's possible to centre text precisely on an image.I'm thinking I need to get the width of of the string in pixels?,take this away from imagesx(image) and devide by 2 to get x value. so has anyone achieved this? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] test php4win and apache
I have downloaded and installed php4win(4.1.1) from www.php4win.com The URL http://localhost tells me that the Apache Web Server was installed successfully. What steps do I take from here to display a php 'Hello World' script in the browser? Do I need to modify httpd.conf? __ Do You Yahoo!? Send FREE Valentine eCards with Yahoo! Greetings! http://greetings.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Sessions
Hi, I try to use sessions to keep track if a user is logged in. I keep getting the following error: Warning: Cannot send session cache limiter - headers already sent (output started at f:\inetpub\wwwroot\2\admin\authuser.php:30) in f:\inetpub\wwwroot\2\auth.php on line 28 I use the session_start() and then session_register(session). What does the error message mean? Thanks, Morten -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] character replace function
you want to remove a char at position $x. so $the_string = substr($the_string,0,$x).substr($the_string,$x+1,strlen($the_string)-1-$x); you can do some juggling in the second substr() with negative values for the parameters but they will not be more fast than this. Best regards, Andrey Hristov - Original Message - From: Phil Schwarzmann [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, February 14, 2002 8:38 PM Subject: [PHP] character replace function I need a function that will erase a particular character in a string. Any ideas?!? THANKS -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Sessions
It means you've already sent some HTML. Sessions stuff must be sent first -Original Message- From: Morten Nielsen [mailto:[EMAIL PROTECTED]] Sent: Thursday, February 14, 2002 12:56 PM To: [EMAIL PROTECTED] Subject: [PHP] Sessions Hi, I try to use sessions to keep track if a user is logged in. I keep getting the following error: Warning: Cannot send session cache limiter - headers already sent (output started at f:\inetpub\wwwroot\2\admin\authuser.php:30) in f:\inetpub\wwwroot\2\auth.php on line 28 I use the session_start() and then session_register(session). What does the error message mean? Thanks, Morten -- 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] character replace function
Erase by what criteria? Position? Value? specifics!! -Original Message- From: Phil Schwarzmann [mailto:[EMAIL PROTECTED]] Sent: Thursday, February 14, 2002 12:38 PM To: [EMAIL PROTECTED] Subject: [PHP] character replace function I need a function that will erase a particular character in a string. Any ideas?!? THANKS -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] character replace function
You can also use the strtr() function: $new_data = strtr($data, ', `);// replaces ' with ` Also keep in mind that you can use the chr($number) to return special ascii characters. Steven J. Walker Walker Effects www.walkereffects.com [EMAIL PROTECTED] On Thursday, February 14, 2002, at 10:48 AM, Aaron Gould wrote: Try: $outputstring = str_replace($character_to_erase, '', $inputstring); -- Aaron Gould [EMAIL PROTECTED] Web Developer - Original Message - From: Phil Schwarzmann [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, February 14, 2002 1:38 PM Subject: [PHP] character replace function I need a function that will erase a particular character in a string. Any ideas?!? THANKS -- 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] browser reload button
about the only way I could think of doing something like this, is to create a unique value for each link on a page and take on to the end of each link for each page. then do a select to find out if that unique value has been entered already. if you use an MD5 hashing method and combine that with a unique sessions value, you can pretty much be certain that you wouldn't get two of the same anytime in the near future. Jim Lucas - Original Message - From: Rodrigo Peres [EMAIL PROTECTED] To: PHP [EMAIL PROTECTED] Sent: Thursday, February 14, 2002 7:03 AM Subject: [PHP] browser reload button Hi list, I've made a log to my site, that counts the hits per page. My problem is, there is some way to detect when the user presses the reload button?? I need this, or other suggestion, in order to prevent the log to input data for the reload, that isn't a real visit. My script is just a insert into a table, and I put it in the beggining of my page with require(); Thank's in advance Rodrigo Peres -- -- 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] Sessions
This means that you do some output before calling session_start() or session_register(); check for echo()s or blanks before ? . Also there have not to be any html before ? when using sessions. Best regards, Andrey Hristov - Original Message - From: Morten Nielsen [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, February 14, 2002 8:56 PM Subject: [PHP] Sessions Hi, I try to use sessions to keep track if a user is logged in. I keep getting the following error: Warning: Cannot send session cache limiter - headers already sent (output started at f:\inetpub\wwwroot\2\admin\authuser.php:30) in f:\inetpub\wwwroot\2\auth.php on line 28 I use the session_start() and then session_register(session). What does the error message mean? Thanks, Morten -- 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] Advanced books
I am looking for advanced books on PHP. I have read many tuts and a couple of books, but I am looking for a big heavy detailed book on php and everything about coding php. any suggestions are welcomed. -Jackson -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Authentication with sessions - Recommendation and suggestions?
On Wednesday, February 13, 2002, at 08:51 PM, Harry Yu wrote: Can anyone give me any suggestions or recommendations? Is there any security concerns? Also, the session files are in a directory that is not world readable. I just set up my own first authentication system, and it works very similar to yours. I think you should turn register_globals off if you really want security. PHP 4.1.0 has some neat shortcuts to make your life easier if you do this. Erik Erik Price Web Developer Temp Media Lab, H.H. Brown [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Sorting an array of arrays....
Does anyone have an example of code that does this, I have been trying to decipher the instructions on the use of uasort but it does not make a hole lot of sense. They are using static keys and sorting by one of the array elements of each of there static keys. It does not seem like one should have to do it this way. I need it to go through each key and sort the keys based on a value in the array held in that key. Thanks Mike -Original Message- From: Darren Gamble [mailto:[EMAIL PROTECTED]] Sent: Thursday, February 14, 2002 9:35 AM To: 'Fifield, Mike'; [EMAIL PROTECTED] Subject: RE: [PHP] Sorting an array of arrays Good day, uasort() should do what you need. http://www.php.net/manual/en/function.uasort.php There's an example for the usort function that does something similar to what you want, in fact. Darren Gamble Planner, Regional Services Shaw Cablesystems GP 630 - 3rd Avenue SW Calgary, Alberta, Canada T2P 4L4 (403) 781-4948 -Original Message- From: Fifield, Mike [mailto:[EMAIL PROTECTED]] Sent: Thursday, February 14, 2002 9:26 AM To: [EMAIL PROTECTED] Subject: [PHP] Sorting an array of arrays What I am trying to do is sort a array of arrays but I want to sort by one of the pieces of data stored in the arrays inside the array. For example; $data[blue] = array(name, age, time, 3); $data[green] = array(name, age, time, 7); $data[red] = array(name, age, time, 6); $data[yellow] = array(name, age, time, 2); $data[white] = array(name, age, time, 1); $data[black] = array(name, age, time, 9); I want to be able to sort this array of arrays by the very last element, the numbers. Mike Fifield Charles Schwab Co, Inc. WARNING: All e-mail sent to or from this address will be received by the Charles Schwab corporate e-mail system and is subject to archival and review by someone other than the recipient. -- 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] Sessions
Speaking of sessions, I was wondering if something like this is even possible: Users log on, each has their own unique session.. Is it possible to do some sort of instant messaging deal with this? Like, on the main page is displays everyone that's logged on, then you maybe choose their name from a form, type in a message, then a pop-up box appears with the message to the user? I only know how to use sessions for authentication, something like this I'd have no idea where to start. If it is possible, could someone point me in the right direction? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Sessions
Maybe you can put a small iframe in the HTML which will refresh on some basis (3secs for example), and in the HTML of this html you do the popup - window() or alert(). what you choose. the message which is sent(from the peer1 to server) is stored in db (or file) but have to stored somewhere till it is sent to the end user. Best regards, Andrey Hristov - Original Message - From: James Taylor [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, February 14, 2002 9:02 PM Subject: [PHP] Sessions Speaking of sessions, I was wondering if something like this is even possible: Users log on, each has their own unique session.. Is it possible to do some sort of instant messaging deal with this? Like, on the main page is displays everyone that's logged on, then you maybe choose their name from a form, type in a message, then a pop-up box appears with the message to the user? I only know how to use sessions for authentication, something like this I'd have no idea where to start. If it is possible, could someone point me in the right direction? -- 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] good practice
Can someone recommend a better method for doing something like the following? All of my programs are written like this, but it's really poor form considering I'm not predeclaring my variables, etc. Only thing I can really think of is to assign a value in the form a number like 1 or something, then do a if $value == 1 {do something} but that seems kinda hokey. Here's an example of something I'd do: HTMLBODY ? if ($submitdata) { dosomething; exit; } echo form name=\form\ action=\$PHP_SELF?\\n; echo input type=\text\ name=\data\\n; echo input type=\submit\ name=\submitdata\ value=\ Submit \\n; echo /form\n/body\n/html; ? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Sessions
The thing about this is, what variables would I use regarding all active sessions, and the data that is stored in each session? Say there are three people logged on, each with the variable $name stored in their session which is their username - How do I get a list of all the names from the sessions along with their session ID's? On Thursday 14 February 2002 11:06 am, you wrote: Maybe you can put a small iframe in the HTML which will refresh on some basis (3secs for example), and in the HTML of this html you do the popup - window() or alert(). what you choose. the message which is sent(from the peer1 to server) is stored in db (or file) but have to stored somewhere till it is sent to the end user. Best regards, Andrey Hristov - Original Message - From: James Taylor [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, February 14, 2002 9:02 PM Subject: [PHP] Sessions Speaking of sessions, I was wondering if something like this is even possible: Users log on, each has their own unique session.. Is it possible to do some sort of instant messaging deal with this? Like, on the main page is displays everyone that's logged on, then you maybe choose their name from a form, type in a message, then a pop-up box appears with the message to the user? I only know how to use sessions for authentication, something like this I'd have no idea where to start. If it is possible, could someone point me in the right direction? -- 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] really weird problem
hi folks, can someone shed some light here? i've got a file called index.php with the following contents: ?php echo debug output: index.php loadedbr; if (is_null($page_name)) $page_name=about; echo debug: page name = $page_namebr; $nav_array = array (about = About, reservations = Reservations, directions = Directions, contact = Contact ); $nav=lnav.inc.php; $footer=foot.inc.php; $pic = $page_name . jpg; $text= $page_name . .txt; ? when i call the page, i get no visible output - this is the resulting page source: !DOCTYPE HTML PUBLIC -//W3C//DTD HTML 4.0 Transitional//EN HTMLHEAD META http-equiv=Content-Type content=text/html; charset=windows-1252/HEAD BODY/BODY/HTML so where the heck are the html tags coming from??? the other weird thing is that a file with just ?php phpinfo(); ? works fine! any ideas? cheers, jaxon -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] good practice
I don't understand what you are trying to do... If you need to verify whether the page has already been submitted to itself, you can test any of the form variables using isset(). For example: ? if(isset($name)) { $LoadedBefore = 1; } if(!$LoadedBefore) { echo form name='form1' action='$PHP_SELF'; echo input type='text' name='name'; echo input type='submit' name='submitdata' value='submit'; } ? You can also pass the data back into the form: echo input type='text' name='$name'; // using $name variable as value Steven J. Walker Walker Effects www.walkereffects.com [EMAIL PROTECTED] On Thursday, February 14, 2002, at 11:09 AM, James Taylor wrote: Can someone recommend a better method for doing something like the following? All of my programs are written like this, but it's really poor form considering I'm not predeclaring my variables, etc. Only thing I can really think of is to assign a value in the form a number like 1 or something, then do a if $value == 1 {do something} but that seems kinda hokey. Here's an example of something I'd do: HTMLBODY ? if ($submitdata) { dosomething; exit; } echo form name=\form\ action=\$PHP_SELF?\\n; echo input type=\text\ name=\data\\n; echo input type=\submit\ name=\submitdata\ value=\ Submit \\n; echo /form\n/body\n/html; ? -- 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] Sessions
On Thursday, February 14, 2002, at 11:06 AM, Andrey Hristov wrote: Maybe you can put a small iframe in the HTML which will refresh on some basis (3secs for example), and in the HTML of this html you do the popup - window() or alert(). what you choose. the message which is sent(from the peer1 to server) is stored in db (or file) but have to stored somewhere till it is sent to the end user. Best regards, Andrey Hristov - Original Message - From: James Taylor [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, February 14, 2002 9:02 PM Subject: [PHP] Sessions Speaking of sessions, I was wondering if something like this is even possible: Users log on, each has their own unique session.. Is it possible to do some sort of instant messaging deal with this? Like, on the main page is displays everyone that's logged on, then you maybe choose their name from a form, type in a message, then a pop-up box appears with the message to the user? I only know how to use sessions for authentication, something like this I'd have no idea where to start. If it is possible, could someone point me in the right direction? -- 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 Steven J. Walker Walker Effects www.walkereffects.com [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Exams
Best regards, Andrey Hristov Back from the exams hell =what were you sitting Andrey? =dn -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: good practice
Well, for instance. I don't like forms that submit to the same page where it is located. Separating them helps to maintain the code (usually). I don't like html inside ?php so 99% of the times I escape with ?. Btw, you should start with ?php and not ?. Your input is missing the /, newer versions of HTML (or XHTML) recommend to finish tags that explicitily don't have a finishing term, with /. So it's: input type=text name=data / And if $submitdata is expected to come from a form, check it: if ($_SERVER['HTTP_REFERER'] == 'somepage.php') { if (isset($_POST['submitdata'])) { dosomething; } } I also don't like to exit(); programs, but I don't know your whole situation, so your mileage may vary And sometimes use a } else { on expected values with some nasty error messages (just in case someone is trying to 'crack' your app). -- Julio Nobrega. Um dia eu chego lá: http://sourceforge.net/projects/toca Ajudei? Salvei? Que tal um presentinho? http://www.submarino.com.br/wishlistclient.asp?wlid=664176742884 James Taylor [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Can someone recommend a better method for doing something like the following? All of my programs are written like this, but it's really poor form considering I'm not predeclaring my variables, etc. Only thing I can really think of is to assign a value in the form a number like 1 or something, then do a if $value == 1 {do something} but that seems kinda hokey. Here's an example of something I'd do: HTMLBODY ? if ($submitdata) { dosomething; exit; } echo form name=\form\ action=\$PHP_SELF?\\n; echo input type=\text\ name=\data\\n; echo input type=\submit\ name=\submitdata\ value=\ Submit \\n; echo /form\n/body\n/html; ? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Advanced books
Aside from learning by doing, there's an old adage that nothing teaches code like code. What about the articles at Zend? Download TWIG or PHPNuke or PostNuke and examine the code. The problem with everything, is that yours differs from mine. Example, I work mostly with straight-ahead data processing, and my everything revolves around SQL and processing arrays. Others work with image libraries, someone else might want to generate PDF's from returned data sets. If I was going to expand my everything I'd probably investigate OO classes more comprehensively, but I have a gut feel that's not necessary and procedure libraries are nore than adequate. Or consider how patterns could be worked up in PHP. I've not addressed the Book question yet -- probably something from WROX, If SAMS has a PHP Unleashed , or HDG a PHP Bible those should be quite comprehensive. Cheers - Miles Thompson Now, back to VB -- sigh!! At 12:24 PM 2/14/2002 -0500, Jackson Miller wrote: I am looking for advanced books on PHP. I have read many tuts and a couple of books, but I am looking for a big heavy detailed book on php and everything about coding php. any suggestions are welcomed. -Jackson -- 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] Store array into mysql?
$ser_array = serialize($myarray); then store $ser_array to a table as BLOB, TEXT, or even VARCHAR to use its contents, read it from the table and use unserialize() -Original Message- From: Jan Grafström [mailto:[EMAIL PROTECTED]] Sent: Thursday, February 14, 2002 10:35 AM To: [EMAIL PROTECTED] Subject: [PHP] Store array into mysql? Hi! I have an array called $myarray and now I want to store it in a mysql table. I tried to just, insert into mytable values('$id', '$myarray') but just got Array when I run while ($row = mysql_fetch_array ($result)) $myarray= $row[myarray]; echo $myarray -- Do I need to first make a string commaseparated or like and than insert that string? Thanks in advance. Regards, Jan Grafström -- 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] how a function 'return' statement works
On Thu, 2002-02-14 at 07:32, Erik Price wrote: Hm... I tried quite a few variations on this. I can't seem to get any displayable value out of this function. function get_current_page_name() { $current_page_name = explode(/, $_SERVER['PHP_SELF']); $current_page_name = $current_page_name[-1]; return $current_page_name ; } $errorcode = get_current_page_name(); echo $errorcode; Nothing. The only thing that works is $errorcode = basename($_SERVER['PHP_SELF']), but that's not the point -- I still don't understand why the function above doesn't return anything. In this case, I'm positive that I've specified the last element of the array. (Haven't I?) Hi Erik. :) No, you've asked for the element of $current_page_name which has the key -1. To get the last element, probably the easiest thing to do is: return $current_page_name[count($current_page_name) - 1]; However, a somewhat less expensive way to do it: $path = $_SERVER['PHP_SELF']; return substr($path, strrpos($path, '/') + 1); (No array overhead.) Cheers (man, it's sunny in Vancouver! Weird...), Torben Erik On Wednesday, February 13, 2002, at 05:03 PM, Darren Gamble wrote: I think what you're trying to do is return one particular element out of the array. If that's the case, just use something like: return $current_page_name[-1] to return the last element in the array. I do not know where this came from, but it just ain't so. -- Torben Wilson [EMAIL PROTECTED] http://www.thebuttlesschaps.com http://www.hybrid17.com http://www.inflatableeye.com +1.604.709.0506 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php