[PHP] PHP multipart form data
hello, i have php 4.2.2 compiled with --enable-ftp running (as a module in apache under red-hat 6.2) and I can not get file uploads through a web page to work!?!? The form variable $userfile (which is the file input name) is returning false; Any ideas how to troubleshoot this? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Credit Card suggestions
We use the mcrypt lib to encrypt data stored in our DB; works great for us. Check the online documentation for more info. - Mike D >Does anyone have any suggested method of scrambling a user's credit card >number before I stick it in a mysql database? I want to make sure it's >useless to anyone that might manage to lift the database. > >Mike > > > >-- >PHP General Mailing List (http://www.php.net/) >To unsubscribe, visit: http://www.php.net/unsub.php -- Mike Dunlop Webmaster Animation World Network [EMAIL PROTECTED] http://www.awn.com (323) 606-4238 office (323) 466-6619 fax 6525 Sunset Blvd. GS10 Los Angeles, CA 90028 USA -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Fwd: [PHP] Writing to a file that's not PHP_SELF
> $file = fopen("Counter.txt", "r+"); You need to open the file with write access and PHP must have write permission e.g. $file = fopen("Counter.txt", "w+"); Mike D... -- Mike Dunlop Webmaster Animation World Network [EMAIL PROTECTED] http://www.awn.com (323) 606-4238 office (323) 466-6619 fax 6525 Sunset Blvd. GS10 Los Angeles, CA 90028 USA
RE: [PHP] count link clicks
You need to use a javascript (client side language) if you want to accomplish this without reloading the page. Something like thike this but you would need to do some more R&D at a javascript form or something cuz I know PHP a lot better than javascript === The functions: var count; function addForm() { if(!count) { count=0; } writeForm(count); count++; } function writeForm(num) { var link = '<a href="javascript:void(0);" onMouseDown="addForm('+num+');">' } You're link: More stuff here... >Really? That sounds more complicated than I think I need it to be, can't >I use something like: > >'' > >and somehow (this is what I need to know) get $value to increase in >value as the user clicks on the link again and again... > >What I want to do in the final product is to display a text imput form >onece and if the user clicks on the link the form (same) will be >displayed again under the first one. > >- Vic > > >-Original Message- >From: Rasmus Lerdorf [mailto:[EMAIL PROTECTED]] >Sent: Tuesday, August 13, 2002 2:49 PM >To: [EMAIL PROTECTED] >Cc: [EMAIL PROTECTED] >Subject: Re: [PHP] count link clicks > >Write a link wrapper that you would use like this: > > > >Then in wrap.php: > > $link = substr($PATH_INFO,1); > ... increment counter in database for $link ... > header('Location: $link'); > ?> > >-Rasmus > >On Tue, 13 Aug 2002 [EMAIL PROTECTED] wrote: > >> How do I count how many times a user clicks on a certain link? (and >put >> it into and array or variable I guess). >> >> I want to be able to repeat a certain action on the same page as many >> times as the user clicks on the link($PHP_SELF). >> >> Thanks, >> >> - Vic >> >> >> >> __ >> Post your ad for free now! http://personals.yahoo.ca >> >> -- >> PHP General Mailing List (http://www.php.net/) >> To unsubscribe, visit: http://www.php.net/unsub.php >> > > >-- >PHP General Mailing List (http://www.php.net/) >To unsubscribe, visit: http://www.php.net/unsub.php > >__ >Post your ad for free now! http://personals.yahoo.ca > >-- >PHP General Mailing List (http://www.php.net/) >To unsubscribe, visit: http://www.php.net/unsub.php -- Mike Dunlop Webmaster Animation World Network [EMAIL PROTECTED] http://www.awn.com (323) 606-4238 office (323) 466-6619 fax 6525 Sunset Blvd. GS10 Los Angeles, CA 90028 USA -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Dynamic HTML Email
Hello, I am wondering how it would be possible to generate an html response email via a PHP script. I have tried and all that has happened is the html source code appears in the message body as plain text. I believe this is happening because the email needs an additional header stating the email needs to be parsed as html not plain text (or both). I am using the mail command. Can someone shed some light on the subject for me??? Thanks so much in advance! Mike Dunlop -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Explorer-like "drill down" interface
I would recommend using javascript for the expanding/contracting list stuff and I don't know of any vulnerablilities in MySQL Server... - Mike D >I have two questions: > >1. I would like to build a php page that contains a Windows >explorer-like drill down mechanism, where clicking the '+' beside an >item will expand the sub-items below (which can also have a '+' or >'-' on the left) and clicking the '-' will collapse the item. Is >there any existing code for that or hints how I can do it? > >2. I have allowed packets through my firewall destined for port >3306, the mysql server. So I can connect to the server from a remote >machine. Are there any known security vulnerabilities in the mySQL >server? > >Many thanks, > >Rich -- Mike Dunlop Webmaster Animation World Network [EMAIL PROTECTED] http://www.awn.com (323) 606-4238 office (323) 466-6619 fax 6525 Sunset Blvd. GS10 Los Angeles, CA 90028 USA -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Cronjob
Darren, Do you want to use a shell script or a php page to run your queries? - MD >Jason, > >I'm not using a web script any longer, I'm using >command-line (I determined that it is installed on the >server). > >I read about $argc and $argv, but when I call the >script passing two arguments, both $argc and $argv are >blank. Is this a php.ini setting I need to change or >somethign? > >--- Jason Young <[EMAIL PROTECTED]> wrote: >> Sorry to butt in :) >> >> Arguments to web scripts are done in the format: >> page.php?arg1=data1&arg2=data2 >> >> So you would use that full string as the lynx path. >> >> Hope this helps :) >> -Jason >> >> Daren Cotter wrote: >> > Thanks for the info Chris, it works! >> > >> > How do I pass arguments to the script? I'm >> assuming >> > it'd just be: >> > >> > test.php arg1 arg2 >> > >> > The stuff I've read says $argc should be the count >> of >> > the # of arguments, and $argv should be an array >> > holding them...but when I do a simple: >> > print "# of Arguments: $argc\n"; >> > It prints nothing, not even 0 >> > >> > >> > --- Chris Hewitt <[EMAIL PROTECTED]> >> wrote: >> > >> >>> >> >>>On Wed, 25 Sep 2002, Daren Cotter wrote: >> >>> >> >>> >> >>>>My problem, is that I absolutely NEED to run a >> PHP >> >>>>script using crontab. The script needs to send >> >>>>numerous queries to a database every hour. Is >> >>> >> >>there >> >> >> >>>>any way I can accomplish this, directly or >> >>> >> >>indirectly? >> >> >> >>Are you sure its not already there? Commonly in >> >>/usr/bin. Try a "which >> >>php" and see if it finds anything? >> >> >> >>HTH >> >>Chris >> >> >> > >> > >> > >> > __ >> > Do you Yahoo!? >> > New DSL Internet Access from SBC & Yahoo! >> > http://sbc.yahoo.com >> >> >> -- >> PHP General Mailing List (http://www.php.net/) >> To unsubscribe, visit: http://www.php.net/unsub.php >> > > >__ >Do you Yahoo!? >New DSL Internet Access from SBC & Yahoo! >http://sbc.yahoo.com > >-- >PHP General Mailing List (http://www.php.net/) >To unsubscribe, visit: http://www.php.net/unsub.php -- Mike Dunlop Webmaster Animation World Network [EMAIL PROTECTED] http://www.awn.com (323) 606-4238 office (323) 466-6619 fax 6525 Sunset Blvd. GS10 Los Angeles, CA 90028 USA -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Encrypt data...
http://php.net/mcrypt >How do I encrypt the data and decrypt it back using PHP? I do know that hte >random number can not be used becuase it will make it impossible to decrypt >it. > >Thanks! > > > >-- >PHP General Mailing List (http://www.php.net/) >To unsubscribe, visit: http://www.php.net/unsub.php -- Mike Dunlop Webmaster Animation World Network [EMAIL PROTECTED] http://www.awn.com (323) 606-4238 office (323) 466-6619 fax 6525 Sunset Blvd. GS10 Los Angeles, CA 90028 USA -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] How to test if a number is negative
I've look through all the numerican functions but can't readily see a way to test for a negative number e.g -7 Any ideas on how to do this? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] RE: negative numbers
Nevermind, I have been using if($number<0) { //negative number... but it wasn't working correctly due to a str_replace statement that removing zeros which was screwing it up ok later -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP 4.2.2 vs PHP 4.0.6
That's because in the newer versions of php the register globals directive is set to off by default...If you turn that directive on and then restart apache, you will be able address GET/POST vars normally (by their identical var name) - Mike D >Hi, > >I didn't realized that PHP had been going so fast that it was creating >problems for compatiblility. > >Here is my situation: PHP on my development server is 4.0.6 while >on the application server it is PHP 4.2.2. I bet you all know that there's >a huge basic differences between the two but I don't know them! >In PHP 4.2.2, variables passed by either GET or POST method can >not be accessed straitforwardly by their name, you have to fetch them >from $HTTP_POST_VARS or $HTTP_GET_VARS. To my understanding, >directly using submitted variables by their name is one of the basic great >PHP features, and I always use vars in this way. However, you can >imagine that, recently due to the PHP upgrading I got bunch of problems >when deploying. > >What I want to know are: >1. why PHP changed the way to access submitted vars; >2. any good suggestion to avoid this problem, such as that is it possible >to configure 4.2.2 to compatible downward. > >Thanks! > >Alex Shi > >BTW: my development server is RH Linux 7.1 so cannot upgrade PHP >to 4.2.2. > > > >-- >--- >TrafficBuilder Network: >http://www.bestadv.net/index.cfm?ref=7029 > > >-- >PHP General Mailing List (http://www.php.net/) >To unsubscribe, visit: http://www.php.net/unsub.php -- Mike Dunlop Webmaster Animation World Network [EMAIL PROTECTED] http://www.awn.com (323) 606-4238 office (323) 466-6619 fax 6525 Sunset Blvd. GS10 Los Angeles, CA 90028 USA -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Class Variable Scope Question
Hi Guys, I am wondering how to be able to call a class variable from within an outside function using the "::" syntax: See an example of the logic I am using below: class myClass { var $variable = 1; function showVar() { return $this->variable; } } $obj = new myClass; function extFunction() { return myClass::showVar(); } I am assuming this isn't working because by calling myClass::showVar () instead of $obj->showVar() "$this" would be undefined...does anyone know how to workaround this (e.g. direct access to a variable via "::" syntax like myClass::variable). Does PHP5 address this at all? Many thanks on this. Best, Mike D ....... Mike Dunlop Director of Technology Development [ e ] [EMAIL PROTECTED] [ p ] 323.644.7808
Re: [PHP] Class Variable Scope Question
the fact that you think that it might even be possible that doing myClass::showVar() would cause $this in showVar() to refer to $obj suggests that you don't understand [to some degree] either classes, objects and/or scope (or at least how its implemented/applied in php). No Jochem, I may have not been clear with the phrasing of my question. To simplify, my question was focusing on the scope of "$this". When calling a method via "::" syntax within an outside function, how does that affect the scope of $this (within the class). I appreciate you taking the time to respond to my question. - MD ....... Mike Dunlop Director of Technology Development [ e ] [EMAIL PROTECTED] [ p ] 323.644.7808 On Mar 15, 2006, at 1:17 PM, Jochem Maas wrote: Mike Dunlop wrote: Hi Guys, I am wondering how to be able to call a class variable from within an outside function using the "::" syntax: See an example of the logic I am using below: class myClass { var $variable = 1; // this works in php4. 1,"b"=>2,"c"=>3 ); if (empty($key)) { return $defvar; } else if (isset($vars[$key])) { return $vars[$key]; } }} function extFunction() { return myClass::showVar(); } echo extFunction(),"\n", myClass::showVar("a"),"\n", myClass::showVar("b"),"\n", myClass::showVar("c"),"\n"; ?> } $obj = new myClass; function extFunction() { return myClass::showVar(); } I am assuming this isn't working because by calling myClass::showVar () don't assume - run the code and find out :-) the fact that you think that it might even be possible that doing myClass::showVar() would cause $this in showVar() to refer to $obj suggests that you don't understand [to some degree] either classes, objects and/or scope (or at least how its implemented/applied in php). instead of $obj->showVar() "$this" would be undefined...does anyone know how to workaround this (e.g. direct access to a variable via "::" it's hard to define a workaround if we don't know what your trying to achieve and why('why' often speaks volumes :-). syntax like myClass::variable). Does PHP5 address this at all? yup. :-) please install php5 straight away :-P php -r ' class T { private static $U = "V"; static function W() { return self::$U; } } echo T::W(),"\n"; ' now start reading here, plenty of nice OO features that blow php4 out of the water in that context: http://php.net/php5 Many thanks on this. Best, Mike D ... Mike Dunlop Director of Technology Development [ e ] [EMAIL PROTECTED] [ p ] 323.644.7808 -- 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] Class Variable Scope Question
Nevermind - i found the documentation that answers my question - thanks for the help Jeremy and Jochas. - MD ... Mike Dunlop Director of Technology Development [ e ] [EMAIL PROTECTED] [ p ] 323.644.7808 On Mar 15, 2006, at 1:54 PM, Mike Dunlop wrote: the fact that you think that it might even be possible that doing myClass::showVar() would cause $this in showVar() to refer to $obj suggests that you don't understand [to some degree] either classes, objects and/or scope (or at least how its implemented/applied in php). No Jochem, I may have not been clear with the phrasing of my question. To simplify, my question was focusing on the scope of "$this". When calling a method via "::" syntax within an outside function, how does that affect the scope of $this (within the class). I appreciate you taking the time to respond to my question. - MD ....... Mike Dunlop Director of Technology Development [ e ] [EMAIL PROTECTED] [ p ] 323.644.7808 On Mar 15, 2006, at 1:17 PM, Jochem Maas wrote: Mike Dunlop wrote: Hi Guys, I am wondering how to be able to call a class variable from within an outside function using the "::" syntax: See an example of the logic I am using below: class myClass { var $variable = 1; // this works in php4. 1,"b"=>2,"c"=>3 ); if (empty($key)) { return $defvar; } else if (isset($vars[$key])) { return $vars[$key]; } }} function extFunction() { return myClass::showVar(); } echo extFunction(),"\n", myClass::showVar("a"),"\n", myClass::showVar("b"),"\n", myClass::showVar("c"),"\n"; ?> } $obj = new myClass; function extFunction() { return myClass::showVar(); } I am assuming this isn't working because by calling myClass::showVar () don't assume - run the code and find out :-) the fact that you think that it might even be possible that doing myClass::showVar() would cause $this in showVar() to refer to $obj suggests that you don't understand [to some degree] either classes, objects and/or scope (or at least how its implemented/applied in php). instead of $obj->showVar() "$this" would be undefined...does anyone know how to workaround this (e.g. direct access to a variable via "::" it's hard to define a workaround if we don't know what your trying to achieve and why('why' often speaks volumes :-). syntax like myClass::variable). Does PHP5 address this at all? yup. :-) please install php5 straight away :-P php -r ' class T { private static $U = "V"; static function W() { return self::$U; } } echo T::W(),"\n"; ' now start reading here, plenty of nice OO features that blow php4 out of the water in that context: http://php.net/php5 Many thanks on this. Best, Mike D ... Mike Dunlop Director of Technology Development [ e ] [EMAIL PROTECTED] [ p ] 323.644.7808 -- 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] file_get_contents / url wrappers
Hi gang, If i am trying to read the contents of url into a string and I am getting 403 errors yet the page will load perfectly through a normal browser, do u think the site is looking at the http request headers and determining it's not a browser and thus blocking access? If something like that was happening, does anyone know what headers i should put into a request to simulate a browser? error msg :: <...> failed to open stream: HTTP request failed! HTTP/ 1.1 403 Forbidden in <...> Any info is much appreciated. Thanks - MD ....... Mike Dunlop Director of Technology Development [ e ] [EMAIL PROTECTED] [ p ] 323.644.7808
[PHP] word matrix
i have an array of various words and am looking to create a result array of every possible combination of words from the orig array. I'm not sure how to accomplish this elegantly within a for loop. Anyone have any ideas? Thanks - Mike D
Re: [PHP] word matrix
Sure Chris. $words = array("word1","word2","word3"); I want this: $result = array( "word1", "word2", "word3", "word1 word2", "word1 word3", "word2 word1", "word2 word3", "word3 word1", "word3 word2", "word1,word2,word3" ); Thanks - MD On Mar 27, 2006, at 5:55 PM, Chris wrote: Mike Dunlop wrote: i have an array of various words and am looking to create a result array of every possible combination of words from the orig array. I'm not sure how to accomplish this elegantly within a for loop. Anyone have any ideas? Could you post a sample of what you have and what you want to end up with? It'll be easier for us to work out rather than guess at what you're trying to do. -- Postgresql & php tutorials http://www.designmagick.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] word matrix
no, just all the unique combinations. Thanks! ... Mike Dunlop Director of Technology Development [ e ] [EMAIL PROTECTED] [ p ] 323.644.7808 On Mar 28, 2006, at 11:42 AM, Shaunak Kashyap wrote: Would you also want the following combinations? "word1 word3 word2" "word2 word1 word3" "word2 word3 word1" "word3 word1 word2" "word3 word2 word1" Shaunak Kashyap Senior Web Developer WPT Enterprises, Inc. 5700 Wilshire Blvd., Suite 350 Los Angeles, CA 90036 Direct: 323.330.9870 Main: 323.330.9900 www.worldpokertour.com Confidentiality Notice: This e-mail transmission (and/or the attachments accompanying) it may contain confidential information belonging to the sender which is protected. The information is intended only for the use of the intended recipient. If you are not the intended recipient, you are hereby notified that any disclosure, copying, distribution or taking of any action in reliance on the contents of this information is prohibited. If you have received this transmission in error, please notify the sender by reply e-mail and destroy all copies of this transmission. -Original Message- From: Mike Dunlop [mailto:[EMAIL PROTECTED] Sent: Tuesday, March 28, 2006 11:36 AM To: Chris Cc: php-general@lists.php.net Subject: Re: [PHP] word matrix Sure Chris. $words = array("word1","word2","word3"); I want this: $result = array( "word1", "word2", "word3", "word1 word2", "word1 word3", "word2 word1", "word2 word3", "word3 word1", "word3 word2", "word1,word2,word3" ); Thanks - MD On Mar 27, 2006, at 5:55 PM, Chris wrote: Mike Dunlop wrote: i have an array of various words and am looking to create a result array of every possible combination of words from the orig array. I'm not sure how to accomplish this elegantly within a for loop. Anyone have any ideas? Could you post a sample of what you have and what you want to end up with? It'll be easier for us to work out rather than guess at what you're trying to do. -- Postgresql & php tutorials http://www.designmagick.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] word matrix
Thanks much for your time on this - I'm going to give this code a try - much appreciated :) Best, Mike D On Mar 28, 2006, at 12:53 PM, Shaunak Kashyap wrote: Here is my first cut at the problem. It is probably not the most optimal solution in terms of algorithmic complexity and it could also do without the use of global vars and such, but it should give you some ideas. [code] $arr = array('word1', 'word2', 'word3'); $lowerBound = 1; $upperBound = pow(2, count($arr)) - 1; for ($index = $lowerBound; $index <= $upperBound; ++$index) { $bitString = str_pad(decbin($index), count($arr), 0, STR_PAD_LEFT); echo showValues($bitString) . ""; } function showValues($bitString) { global $arr; $outputStringArray = array(); for ($pos = 0; $pos < strlen($bitString); ++$pos) { if ($bitString[$pos]) { $outputStringArray[] = $arr[$pos]; } } return implode(' ', $outputStringArray); } [/code] Shaunak Kashyap Senior Web Developer WPT Enterprises, Inc. 5700 Wilshire Blvd., Suite 350 Los Angeles, CA 90036 Direct: 323.330.9870 Main: 323.330.9900 www.worldpokertour.com Confidentiality Notice: This e-mail transmission (and/or the attachments accompanying) it may contain confidential information belonging to the sender which is protected. The information is intended only for the use of the intended recipient. If you are not the intended recipient, you are hereby notified that any disclosure, copying, distribution or taking of any action in reliance on the contents of this information is prohibited. If you have received this transmission in error, please notify the sender by reply e-mail and destroy all copies of this transmission. -Original Message- From: Mike Dunlop [mailto:[EMAIL PROTECTED] Sent: Tuesday, March 28, 2006 11:57 AM To: Shaunak Kashyap Cc: php-general@lists.php.net Subject: Re: [PHP] word matrix no, just all the unique combinations. Thanks! ....... Mike Dunlop Director of Technology Development [ e ] [EMAIL PROTECTED] [ p ] 323.644.7808 On Mar 28, 2006, at 11:42 AM, Shaunak Kashyap wrote: Would you also want the following combinations? "word1 word3 word2" "word2 word1 word3" "word2 word3 word1" "word3 word1 word2" "word3 word2 word1" Shaunak Kashyap Senior Web Developer WPT Enterprises, Inc. 5700 Wilshire Blvd., Suite 350 Los Angeles, CA 90036 Direct: 323.330.9870 Main: 323.330.9900 www.worldpokertour.com Confidentiality Notice: This e-mail transmission (and/or the attachments accompanying) it may contain confidential information belonging to the sender which is protected. The information is intended only for the use of the intended recipient. If you are not the intended recipient, you are hereby notified that any disclosure, copying, distribution or taking of any action in reliance on the contents of this information is prohibited. If you have received this transmission in error, please notify the sender by reply e-mail and destroy all copies of this transmission. -Original Message- From: Mike Dunlop [mailto:[EMAIL PROTECTED] Sent: Tuesday, March 28, 2006 11:36 AM To: Chris Cc: php-general@lists.php.net Subject: Re: [PHP] word matrix Sure Chris. $words = array("word1","word2","word3"); I want this: $result = array( "word1", "word2", "word3", "word1 word2", "word1 word3", "word2 word1", "word2 word3", "word3 word1", "word3 word2", "word1,word2,word3" ); Thanks - MD On Mar 27, 2006, at 5:55 PM, Chris wrote: Mike Dunlop wrote: i have an array of various words and am looking to create a result array of every possible combination of words from the orig array. I'm not sure how to accomplish this elegantly within a for loop. Anyone have any ideas? Could you post a sample of what you have and what you want to end up with? It'll be easier for us to work out rather than guess at what you're trying to do. -- Postgresql & php tutorials http://www.designmagick.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP 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] URL Referral Tracking with AIM
I know that referrer is an ENV variable carried by web browsers but I am wondering if any of you guru's have figured out a way to track any referrer al information from a link pasted into an instant messenger (AIM) window. Anyone have any ideas on this? Much Thanks, Mike D ... Mike Dunlop Director of Technology Development [ e ] [EMAIL PROTECTED] [ p ] 323.644.7808 1-800-Help-Now | http://www.redcross.org
Re: [PHP] Array - partical path to the array's path....
On Sep 27, 2005, at 10:22 AM, Scott Fletcher wrote: [code] $array = array(); $array['col1']['col2'] = "Test #1"; $array['col3']['col2'] = "Test #2"; $prefix = "['col3']['col2']"; echo $array.$prefix; //Spitted out result as "Test #2"... [/code] This is the simple code that I'm trying to make it work. Does anyone know how does these work with array? Some help here... Thanks... FletchSOD echo ${"array".$prefix}; -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] URL Referral Tracking with AIM
Thanks for the thoughts -- some good points! I will let you know if I come up with anything that works, please let me you know if you do the same :) Best, Mike D ... Mike Dunlop Director of Technology Development [ e ] [EMAIL PROTECTED] [ p ] 323.644.7808 1-800-Help-Now | http://www.redcross.org On Sep 27, 2005, at 11:10 AM, <[EMAIL PROTECTED]> [EMAIL PROTECTED]> wrote: Havn't done it myself, but why not try pasting a link in IM and have it go to a php script that does a var_dump (or print_r) of $_SERVER. Think that's where the referrer data is. It may not show any referrer information since it's coming from an IM, but who knows.. would be interesting to try out. Thanks for bringing this up, now I have something to play with later. hah Second though is that even though you might not get any referrer data, there may be some other data in the server variables that could be telling. Unfortunately, since this is going to spawn an instance of IE or Firefox or something to actually load the page, you'll most likely get the info from the browser with zero info regarding the app (AIM, Yahoo, etc) that it spawned from. Some IM's, like AIM, allow you to put in variables though, like %s I think it is for 'screenname' in AIM so if you hand out a URL like http://www.domain.com/script.php?aim=%s as long as the %s part is pasted each time, it MAY substitute that person's screen name. If it's sent to me and I see: http://www.domain.com/script.php? aim=tgryffyn then copy/paste that (with the tgryffyn instead of % s) then obviously other people using it will get logged as me, and not them. Just some quick thoughts off the top of my head. Let us know if you come up with anything good and I'll write later if I get a chance to play with this. -TG = = = Original message = = = I know that referrer is an ENV variable carried by web browsers but I am wondering if any of you guru's have figured out a way to track any referrer al information from a link pasted into an instant messenger (AIM) window. Anyone have any ideas on this? Much Thanks, Mike D ... Mike Dunlop Director of Technology Development [ e ] [EMAIL PROTECTED] [ p ] 323.644.7808 1-800-Help-Now | http://www.redcross.org ___ Sent by ePrompter, the premier email notification software. Free download at http://www.ePrompter.com.
Re: [PHP] Array - partical path to the array's path....
My bad - that doesn't work - that came off the top off my head. It sure did look sexy though, no ? - MD echo ${"array".$prefix}; really? did you test that? doesn't work when I do it (the second expression does - but doesn't answer the OPs question actually imho the answer is not eval() either, because its slow and a security headache): $array = array(); $array["col3"]["col2"] = "Test #2"; $prefix = "[\"col3\"][\"col2\"]"; echo ${"array".$prefix}, ${"array"}["col3"]["col2"]; - try something like this instead?: (code has been tested) function getVal($arr, $path) { $retval = null; if (!is_array($arr) || empty($arr) || !is_array($path) || empty($path)) { return null; } while (count($path)) { $key = array_shift($path); if (!isset($arr[ $key ])) { return null; } $retval = $arr[ $key ]; $arr=& $arr[ $key ]; } return $retval; } $ra = array(); $ra["col3"]["col2"] = "Test #2"; $path = array("col3","col2"); echo getVal($ra, $path);