[PHP] Re: .htpasswd and PayPal generated passwords
Hi David, When using the IPN feature that PayPal offers, you can optionally have them generate a username:password pair for you. That way it will be stored at paypal and the user can check their history to retrieve it anytime. Robert David Duong [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... btw - What do you mean by paypal generated passwords? I am interested in using PayPal as an alternative to my current credit card handler. Just a link is appreciated. - David Rob Packer [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... I use PayPal to generate a username and password and then write them to the .htpasswd file. If I were to switch to using a database (because .htaccess seems to always prompt twice!) how would I perform the comparison for the passwords? It would seem that everytime you generate an encrypted password it's different. So how would you compare them? Also, does anyone know what the encryption method used by PayPal is? Thanks for any help... Robert Packer -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] .htpasswd and PayPal generated passwords
I use PayPal to generate a username and password and then write them to the .htpasswd file. If I were to switch to using a database (because .htaccess seems to always prompt twice!) how would I perform the comparison for the passwords? It would seem that everytime you generate an encrypted password it's different. So how would you compare them? Also, does anyone know what the encryption method used by PayPal is? Thanks for any help... Robert Packer -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] check expiration date
anyone know of a script for getting the current date and then calculating when a provided expiration date would be? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Test links?
Well, the reason I didn't do that at first was that I could have done any of the methods that I've tried incorrectly, which is why I figured I'd ask what works and then focus on that method... but, I've tried to ping them, use fopen, and use fsocketopen... but nothing says that I've used any of them the way I should have :) I also tried to use the scripts that I found at hotscripts.com but I always seem to get inconsistent results and it must be accurate. Jason Wong [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... On Saturday 30 November 2002 06:53, Rob Packer wrote: First, I'd like to say that I'm not asking for anyone to write a script... how would I go about checking a MySQL database of links to see if any are down? I've had some varying results with all the methods I've tried, so would like to see if anyone has a proven method for doing this. Why don't you briefly summarise what methods you have tried? That way people won't reply with methods that you already know of. -- Jason Wong - Gremlins Associates - www.gremlins.biz Open Source Software Systems Integrators * Web Design Hosting * Internet Intranet Applications Development * /* Between grand theft and a legal fee, there only stands a law degree. */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Test links?
Okay, I'm confused... file, fopen, and fsockopen seem to say not found on alot valid URLs... does this look to be correct usage? $url = $row[0]; // just get the url from the db $fp = implode ('', file ($url)); if (!$fp) {echo font color=redbUnable to access file/b/font; } else { fclose($fp); echo The link is working!; } It seems I always get this warning... Warning: Supplied argument is not a valid File-Handle resource in /web/home/nrc.net/www/robert/links4.php on line 11 If someone can tell me what I'm doing wrong, I'd appreciate it. Thanks, Robert -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Test links?
Thanks for the help and suggestions everybody! I think some of my problems stemmed from the affiliate links being redirected and PHP saw that as dead(so to speak)... but I think I got it now. I made another column in the database to note a redirection for ones that the url fails but the $url[host] passes. Robert Packer Chris Hewitt [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Rob Packer wrote: Okay, I'm confused... file, fopen, and fsockopen seem to say not found on alot valid URLs... does this look to be correct usage? $url = $row[0]; // just get the url from the db $fp = implode ('', file ($url)); if (!$fp) {echo font color=redbUnable to access file/b/font; } else { fclose($fp); echo The link is working!; } It seems I always get this warning... Warning: Supplied argument is not a valid File-Handle resource in /web/home/nrc.net/www/robert/links4.php on line 11 I think you have assigned $fp to be the imploded string, not a file pointer. Thus fclose($fp) would generate an error. Given this, I'm not sure what if (!$fp) would mean. HTH Chris -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Test links?
First, I'd like to say that I'm not asking for anyone to write a script... how would I go about checking a MySQL database of links to see if any are down? I've had some varying results with all the methods I've tried, so would like to see if anyone has a proven method for doing this. Thanks, Robert -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Insert an array into MySQL
Hi, I've seen a few post for this same thing but I can't seem to get it working. What I'm doing is taking a form with check boxes and putting them into an array. Then I'm attempting to INSERT them into the db, one checkbox value per row. Okay, well I've tries 2 ways that I think should work and they only insert the first value. They both produce this error Duplicate entry '0' for key 1 (which I don't understand) Anyway here is the code I'm trying... (I'm not trying to use both blocks of code, just one or the other) // First code while(list($key,$value)=each($pagetype)){ //echo $value.br;//test $links=INSERT INTO $username_links (links) VALUES ('$value'); $insert=mysql_query($links,$connection); } // Second code attempt $number=count($pagetype); for($a=0;$a$number;$a++){ $links=INSERT INTO $username_links (links) VALUES ('$pagetype[$a]'); $insert=mysql_query($links) or die(mysql_error()); //echo $pagetype[$a];//test } Thanks in advance...Robert -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Insert an array into MySQL
John Holmes [EMAIL PROTECTED] wrote in message 001201c21ab5$0df073a0$b402a8c0@mango">news:001201c21ab5$0df073a0$b402a8c0@mango... Your second method should work, but it's dependent on what your form looks like and how your table was created. You obviously have a key set for this column and you're trying to insert the same value twice, which makes an error. Show us what your form looks like, not the whole thing, just for the checkboxes. Also, what does your CREATE TABLE look like for the table your trying to insert this data into? ---John Holmes... -Original Message- From: Rob Packer [mailto:[EMAIL PROTECTED]] Sent: Sunday, June 23, 2002 7:50 AM To: [EMAIL PROTECTED] Subject: [PHP] Insert an array into MySQL Hi, I've seen a few post for this same thing but I can't seem to get it working. What I'm doing is taking a form with check boxes and putting them into an array. Then I'm attempting to INSERT them into the db, one checkbox value per row. Okay, well I've tries 2 ways that I think should work and they only insert the first value. They both produce this error Duplicate entry '0' for key 1 (which I don't understand) Anyway here is the code I'm trying... (I'm not trying to use both blocks of code, just one or the other) // First code while(list($key,$value)=each($pagetype)){ //echo $value.br;//test $links=INSERT INTO $username_links (links) VALUES ('$value'); $insert=mysql_query($links,$connection); } // Second code attempt $number=count($pagetype); for($a=0;$a$number;$a++){ $links=INSERT INTO $username_links (links) VALUES ('$pagetype[$a]'); $insert=mysql_query($links) or die(mysql_error()); //echo $pagetype[$a];//test } Thanks in advance...Robert -- 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] Insert an array into MySQL
oops, sorry about the other post (I've got a baby that likes the keyboard)... Hi, This is the form, which I had doubts about, but it seemed to put things into the array correctly when I tested it by printing it out. I can't see how, it will print key=0 value=index.html key=1 value=about.html key=2 value=whats_new.html when I test it and then have a duplicate key. It's saying that I have 2 $pagetype[0] correct? Anyhow, here's the form... INPUT TYPE=hidden NAME=pagetype[] VALUE='index.html'Home Page br INPUT TYPE=checkbox NAME=pagetype[] VALUE='about.html'About Page br INPUT TYPE=checkbox NAME=pagetype[] VALUE='whats_new.html'What's New Pagebr INPUT TYPE=checkbox NAME=pagetype[] VALUE='contact.html'Contact Pagebr INPUT TYPE=checkbox NAME=pagetype[] VALUE='favorite_links.html'Favorite Links br The CREATE TABLE is this: I define the table name from user input. $query_links=CREATE TABLE $username_links (id INT(4) not null, links VARCHAR(20) not null, UNIQUE (id)); if(mysql_query($query_links,$connection)){ echo Links table created!br; }else{ echo no links table madeBR; } thanks, Rob John Holmes [EMAIL PROTECTED] wrote in message 001201c21ab5$0df073a0$b402a8c0@mango">news:001201c21ab5$0df073a0$b402a8c0@mango... Your second method should work, but it's dependent on what your form looks like and how your table was created. You obviously have a key set for this column and you're trying to insert the same value twice, which makes an error. Show us what your form looks like, not the whole thing, just for the checkboxes. Also, what does your CREATE TABLE look like for the table your trying to insert this data into? ---John Holmes... -Original Message- From: Rob Packer [mailto:[EMAIL PROTECTED]] Sent: Sunday, June 23, 2002 7:50 AM To: [EMAIL PROTECTED] Subject: [PHP] Insert an array into MySQL Hi, I've seen a few post for this same thing but I can't seem to get it working. What I'm doing is taking a form with check boxes and putting them into an array. Then I'm attempting to INSERT them into the db, one checkbox value per row. Okay, well I've tries 2 ways that I think should work and they only insert the first value. They both produce this error Duplicate entry '0' for key 1 (which I don't understand) Anyway here is the code I'm trying... (I'm not trying to use both blocks of code, just one or the other) // First code while(list($key,$value)=each($pagetype)){ //echo $value.br;//test $links=INSERT INTO $username_links (links) VALUES ('$value'); $insert=mysql_query($links,$connection); } // Second code attempt $number=count($pagetype); for($a=0;$a$number;$a++){ $links=INSERT INTO $username_links (links) VALUES ('$pagetype[$a]'); $insert=mysql_query($links) or die(mysql_error()); //echo $pagetype[$a];//test } Thanks in advance...Robert -- 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] Insert an array into MySQL
Nevermind, I got it. I had Unique for a field which made it mad. Rob Packer [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... oops, sorry about the other post (I've got a baby that likes the keyboard)... Hi, This is the form, which I had doubts about, but it seemed to put things into the array correctly when I tested it by printing it out. I can't see how, it will print key=0 value=index.html key=1 value=about.html key=2 value=whats_new.html when I test it and then have a duplicate key. It's saying that I have 2 $pagetype[0] correct? Anyhow, here's the form... INPUT TYPE=hidden NAME=pagetype[] VALUE='index.html'Home Page br INPUT TYPE=checkbox NAME=pagetype[] VALUE='about.html'About Page br INPUT TYPE=checkbox NAME=pagetype[] VALUE='whats_new.html'What's New Pagebr INPUT TYPE=checkbox NAME=pagetype[] VALUE='contact.html'Contact Pagebr INPUT TYPE=checkbox NAME=pagetype[] VALUE='favorite_links.html'Favorite Links br The CREATE TABLE is this: I define the table name from user input. $query_links=CREATE TABLE $username_links (id INT(4) not null, links VARCHAR(20) not null, UNIQUE (id)); if(mysql_query($query_links,$connection)){ echo Links table created!br; }else{ echo no links table madeBR; } thanks, Rob John Holmes [EMAIL PROTECTED] wrote in message 001201c21ab5$0df073a0$b402a8c0@mango">news:001201c21ab5$0df073a0$b402a8c0@mango... Your second method should work, but it's dependent on what your form looks like and how your table was created. You obviously have a key set for this column and you're trying to insert the same value twice, which makes an error. Show us what your form looks like, not the whole thing, just for the checkboxes. Also, what does your CREATE TABLE look like for the table your trying to insert this data into? ---John Holmes... -Original Message----- From: Rob Packer [mailto:[EMAIL PROTECTED]] Sent: Sunday, June 23, 2002 7:50 AM To: [EMAIL PROTECTED] Subject: [PHP] Insert an array into MySQL Hi, I've seen a few post for this same thing but I can't seem to get it working. What I'm doing is taking a form with check boxes and putting them into an array. Then I'm attempting to INSERT them into the db, one checkbox value per row. Okay, well I've tries 2 ways that I think should work and they only insert the first value. They both produce this error Duplicate entry '0' for key 1 (which I don't understand) Anyway here is the code I'm trying... (I'm not trying to use both blocks of code, just one or the other) // First code while(list($key,$value)=each($pagetype)){ //echo $value.br;//test $links=INSERT INTO $username_links (links) VALUES ('$value'); $insert=mysql_query($links,$connection); } // Second code attempt $number=count($pagetype); for($a=0;$a$number;$a++){ $links=INSERT INTO $username_links (links) VALUES ('$pagetype[$a]'); $insert=mysql_query($links) or die(mysql_error()); //echo $pagetype[$a];//test } Thanks in advance...Robert -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] not so
[0] would match the whole ip, I was hoping [1] and[2] would echo the next 2 found, but it doesn't Thanks -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] not so
oops, no coffee yet Jason Wong [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... On Saturday 08 June 2002 22:36, Rob Packer wrote: [0] would match the whole ip, I was hoping [1] and[2] would echo the next 2 found, but it doesn't 1) Could you not start a new thread each time? It makes it difficult for people to help because your responses and their repsonses are all over the place. And a subject which matches the discussion in hand would be appreciated. When people search through the archives and come across a thread named not so, what on earth are they supposed to make of that? 2) I asked you to show the format of your input file. Without knowing what it looks like there's not much anyone can do to help you. -- Jason Wong - Gremlins Associates - www.gremlins.com.hk Open Source Software Systems Integrators * Web Design Hosting * Internet Intranet Applications Development * /* Memory fault -- core...uh...um...core... Oh dammit, I forget! */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] make hitting enter in a text box = br
I have a simple script for a newsletter, with a text area box for someone to type in their newsletter. Is it possible to make it so when someone hits enter with the text box it will equal br? TIA Robert -- -- NRC ONLINE -- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] php in a layer trouble
Yep, you guys are right! Thanks for the help Robert Justin French [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... I don't believe there is such a problem, because DIV? echo foo; ?/DIV will get replaced with DIVfoo/DIV by the PHP parser. Thus by the time the content gets to the browser, it ISN'T PHP anymore -- it's HTML, or text. What you should do is view the source of your processed page, to ensure that your HTML around the problem area is valid, and correctly parsed. You may even want to run a HTML validator over it. Remember, once the page hits the browser, the code is the RESULT of the PHP code, not the php code itself, thus, PHP code that produces correctly formatted HTML should not break any page. PHP code that creates poorly formatted or invalid HTML will break a page, just as if you did it yourself with a text editor on a raw HTML page. Good luck. Justin French Creative Director http://Indent.com.au on 25/04/02 4:52 AM, Robert ([EMAIL PROTECTED]) wrote: Has anyone ever had trouble with Netscape not displaying a layer with you put any php code in it? Anyone know a source for reading more about it? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Can't get this code to work...
Dan, Really, thanks for the help. Yeah, as you know I'm not experienced near enough with PHP. Maybe you could provide me with an e-mail and prices for consultation(I suppose this is what 'Analysis Solutions' does?) Regards, Robert Packer Analysis Solutions [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... On Sat, Apr 06, 2002 at 12:32:33AM -0500, Analysis Solutions wrote: input type=checkbox name=checkbox['Name'] value=validate / And following up to my own following up... As I shut down the computer, I realized I made a boo boo. The single quotes shouldn't be there. So, make that: input type=checkbox name=checkbox[Name] value=validate / Later, --Dan -- PHP scripts that make your job easier http://www.analysisandsolutions.com/code/ SQL Solution | Layout Solution | Form Solution T H E A N A L Y S I S A N D S O L U T I O N S C O M P A N Y 4015 7 Ave, Brooklyn NY 11232v: 718-854-0335f: 718-854-0409 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] getting slash with single quotes in form mail
Hi, I have a contact form and when someone fills it out, all the single quotes (apostrophes) end up having a slash in front of them in the e-mail, like this: I\'m Can someone tell me how to stop this? Thanks you. Rob -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Can't get this code to work...
Sorry for the vague Subject, but I have this code that looks fine to me. There's some logical error, because I can't get to the second if statement, although when I echo \$.$cb[$i] I get $checkboxName. If I hard code $checkboxName it will work though. Anyone know why? TIA! $num_fields= 8 ;//the number of fields on the form! $cb=array(Name, Address, State, Zip, Phone, Email, Comments, Fax); for($i=0; $i$num_fields; $i++){ if (\$.$cb[$i] !=) { // CAN GET HERE if (\$checkbox.$cb[$i]==validate) {echocan NOT get here;// HINT, HINT $form_write_msg .= 'if (!$cb[$i]) {$error_msg.=Your . $cb[$i] . .\n;} if (\$.$cb[$i]){ $msg.=\$.$cb[$i].: \t . $cb[$i] . . \n;} ' ;}elseif(\$checkbox.$cb[$i]==no) {$form_write_msg.= 'if (\$.$cb[$i]){ $msg.=$cb[$i] .: \t .$cb[$i]. . \n;} ' ;} ;} -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] escape characters
In the following statement, can someone tell me what I would need to escape out if I were to put it all into a variable (I know the quotes, but that's all) : if (!$name){ $error_msg.=Your Name \n; } Thanks, Rob -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php