RE: [PHP] Pulling unique data from database
Here's some skeleton code showing one way (untested, no error checking shown): $query = 'SELECT Language FROM whatever'; $result = mysql_query($query); $languages = array(); while ($row=mysql_fetch_object($result)) $languages = array_merge($languages, explode('||', $row-Language)); $languages = array_unique($languages); -- Jonathan Rosenberg President Founder, Tabby's Place http://www.tabbysplace.org/ -Original Message- From: Richard Kurth [mailto:[EMAIL PROTECTED] Sent: Sunday, February 01, 2004 9:27 PM To: [EMAIL PROTECTED] Subject: [PHP] Pulling unique data from database I am pulling data from a database that list the Language a person speaks. It is in a format like this. English||Spanish English English||Portuguese||Finnish English||Japanese||German English English German each time it looks at a new record it list all the languages that that person speaks with a double pipe in between each language. What I need to do is find all the unique languages so I can generate a list of languages that do not have any repeats in it. so the list above would be English,Portuguese,Finnish,Japanese,German,Spanish in any order How would I go about this. I can not change the format of the database and there are over 200 people listed in the database. -- 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] User/Pwd Management Package?
Friends, I'm interesting in finding a PHP package that implements functions for managing user names passwords controlling access to specific parts of a site. Of course, free is best. But cheap is good. And, even not-so-cheap is fine, as long as it provides good functionality. Any pointers appreciated. -- Jonathan Rosenberg President Founder, Tabby's Place http://www.tabbysplace.org/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Recommend payment processors?
I've been using Authorize.Net for about 6 months now am happy with them. I use their AIM interface, which allows ,e complete control over the look feel of the payment process. There is no problem doing everything in PHP, as long as you have the CURL extensions they are built with SSL support. -- JR -Original Message- From: Chad Day [mailto:[EMAIL PROTECTED]] Sent: Friday, January 03, 2003 11:15 AM To: php general Subject: [PHP] Recommend payment processors? Just wondering what people are using/recommend out there.. I'm going to be getting a merchant account and let people purchase services through my website on a secure server, all in PHP. What concerns me is this archived post I came across: http://marc.theaimsgroup.com/?l=php-generalm=102165623600464w=2 Reading that, it sounds like it's not possible to use Payment Pro, or possibly other systems, with PHP .. is this correct? Some of the other posts in the archive sounded like people were using it, so I'm not really sure what is possible at this point. Thanks, Chad -- 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] Shopping Cart Credit Card Verification
The solution you choose for credit card verification depends on a number of things: - how much control you want over look feel - whether you are rolling your own shopping cart I happen to use Authorize.Net, which allows you to control the entire process maintain the look feel you desire: http://www.authorize.net/ But there are lots of other solutions. If you want to email me with more details of what you are looking for, I'd be glad to try to help. -- JR -Original Message- From: Josiah Peters [mailto:[EMAIL PROTECTED]] Sent: Tuesday, December 31, 2002 01:55 AM To: [EMAIL PROTECTED] Subject: [PHP] Shopping Cart Credit Card Verification I sure hope this is the correct mailing list. I have been struggling with this problem for quite some time. Does anyone know a way to verify credit card information in real time with your bank over the internet in say a shopping cart? Joey Peters _ STOP MORE SPAM with the new MSN 8 and get 3 months FREE*. http://join.msn.com/?page=features/junkmailxAPID=42PS=47575PI=7324; DI=7474SU= http://www.hotmail.msn.com/cgi-bin/getmsgHL=1216hotmailtaglines_stopmorespam_3m f -- 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] Re: amp; in Query String
In an earlier message, Derick Rethans [mailto:[EMAIL PROTECTED]] said ... Yes it is. Actually, you should specify the URL with the amp; yourself, like this: a HREF=show_pic.php?pic=blahamp;caption=Some+Text otherwise it is not valid HTML. I understand that using '' is technically not correct HTML. But I don't see how changing the '' - 'amp;' solves my problem. But just to be sure I tried it. Sure enough, this caused the error to occur. I'm missing something here. If you use 'amp;' to separate arguments on the query string, how do they get separated out for access via $_GET? -- -- JR -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Re: amp; in Query String
Not, this answer makes sense. I couldn't see how using 'amp;' in the query string would work. I'm gonna take the advice augment my error message to include browser name other info. I've been wondering if a web crawler might be causing this. I'll let you know what turns up (of course, the problem will stop occurring once I add this info :-). -- JR -Original Message- From: Erwin [mailto:[EMAIL PROTECTED]] Sent: Tuesday, November 26, 2002 10:54 AM To: [EMAIL PROTECTED] Subject: [PHP] Re: amp; in Query String Derick Rethans wrote: Jonathan Rosenberg wrote: I have a page with thumbnail pictures that can be clicked on to see a larger picture. Each picture is hyperlinked as follows a HREF=show_pic.php?pic=blahcaption=Some+Text I access the 'pic' 'caption' attributes with $_GET['pic'], etc. Pretty standard stuff. I have PHP set up so that error messages get mailed to a specified mail account. Every so often I get the following error message: Undefined index: caption In file /home//show_pic.php, line 64 page: /show_pic.php?pic=gb3.jpgamp;caption=Some+Text The problem is obviously (I think) that the $_GET['caption'] is failing. True, if you receive amp;caption in your URL, then the variable won't be called $_GET['caption'], but $_GET['amp;caption'], which (I think) is invalid because of the ;. What I can't figure out is why the '' got turned into 'amp;'. Is a browser doing this? Yes it is. No, it isn't. I sure hope there is no browser which turns in amp; in URL's. That would be very, very bad indeed! Actually, you should specify the URL with the amp; yourself, like this: a HREF=show_pic.php?pic=blahamp;caption=Some+Text Of course not...this is a HREF tag, which can use instead of amp;. amp; is for displaying purposes only, not for URL's. Following the tip from Marek, adjust your errormessage mailing thingy...add all the $_GET variables to it (print_r($_GET)). Some other notices maybe usefull to... Erwin -- 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] Re: amp; in Query String
I tried it it fails. The browser sends the query string with the amp; the $_GET access fails. I am using IE 6. I can't imagine that it would be buggy in this regard. -- JR -Original Message- From: @ Edwin [mailto:[EMAIL PROTECTED]] Sent: Tuesday, November 26, 2002 11:17 AM To: Jonathan Rosenberg (Tabby's Place) Cc: [EMAIL PROTECTED] Subject: Re: [PHP] Re: amp; in Query String Hello, Jonathan Rosenberg (Tabby's Place) [EMAIL PROTECTED] wrote: [snip] I'm missing something here. If you use 'amp;' to separate arguments on the query string, how do they get separated out for access via $_GET? [/snip] Don't worry about it, just try it :) Anyway, the link that has amp; would be translated to . (The browser should take care of this since it's the proper way to do it anyway...) - E -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Re: amp; in Query String
Ok ... I take back what I said about amp; not working in a query string. It works just fine. But, none of this explains why I am sometimes receiving a request with amp; in the query string, especially I am using '' in the A link. The only way I think I can find out is by augmenting the error message I received, as described earlier. I'll report back when/if I learn anything from doing this. -- JR -Original Message- From: Ernest E Vogelsinger [mailto:[EMAIL PROTECTED]] Sent: Tuesday, November 26, 2002 12:15 PM To: Erwin Cc: [EMAIL PROTECTED] Subject: Re: [PHP] Re: amp; in Query String At 16:54 26.11.2002, Erwin spoke out and said: [snip] Actually, you should specify the URL with the amp; yourself, like this: a HREF=show_pic.php?pic=blahamp;caption=Some+Text Of course not...this is a HREF tag, which can use instead of amp;. amp; is for displaying purposes only, not for URL's. Nope. As I just learnt from this list it _is_ valid to specify a query string using amp; as delimiter - it will be resolved by the browser the same way as it is when it gets displayed. Actually this is the only way to create W3C-compliant query strings. Just check with the W3C HTML Validator: http://validator.w3.org/ -- O Ernest E. Vogelsinger (\) ICQ #13394035 ^ http://www.vogelsinger.at/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] amp; in Query String
I have a page with thumbnail pictures that can be clicked on to see a larger picture. Each picture is hyperlinked as follows a HREF=show_pic.php?pic=blahcaption=Some+Text I access the 'pic' 'caption' attributes with $_GET['pic'], etc. Pretty standard stuff. I have PHP set up so that error messages get mailed to a specified mail account. Every so often I get the following error message: Undefined index: caption In file /home//show_pic.php, line 64 page: /show_pic.php?pic=gb3.jpgamp;caption=Some+Text The problem is obviously (I think) that the $_GET['caption'] is failing. What I can't figure out is why the '' got turned into 'amp;'. Is a browser doing this? -- Jonathan Rosenberg Tabby (RB), Lynx (RB), Licorice, Tigger, Jet, Belle http://www.tabbysplace.org/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] No Reply From cURL
I suspect your problem is that CURL is not built with SSL support. To test this, replace the https:/.../ with a reference to a non-SSL URL (http://.../). If you get a return that, you need to build CURL with SSL support. -- JR -Original Message- From: Steve Keller [mailto:[EMAIL PROTECTED]] Sent: Thursday, November 21, 2002 14:04 PM To: [EMAIL PROTECTED] Subject: [PHP] No Reply From cURL I apologize for being a pest about this, I'm just not getting it. I'm attempting to open a connection to NetLedger to post an XML file. I'm attempting this basic code, which is pretty much what I find everywhere: $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, https://partners.netledger.com/SmbXml;); curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_RETURNTRANSFER,1); curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1); curl_setopt($ch, CURLOPT_VERBOSE, 1); curl_setopt($ch, CURLOPT_POSTFIELDS,$postData); $result = curl_exec ($ch); curl_close($ch); echo $result; And I'm getting no result back so I can't even see what error I'm getting. I'm using PHP 4.2.3, with OpenSSL/0.9.5a and compiled as follows: './configure' '--with-apxs=/usr/local/www/bin/apxs' '--with-mysql=/usr/local/' '--with-gd=/usr/local/' '--with-freetype' '--with-imap' '--with-curl' Also, how do I include a file in the postData? Can someone point me to a good page about HTTP where I can read about doing that? -- S. Keller UI Engineer The Health TV Channel, Inc. (a non - profit organization) 3820 Lake Otis Pkwy. Anchorage, AK 99508 907.770.6200 ext.220 907.336.6205 (fax) Email: [EMAIL PROTECTED] Web: www.healthtvchannel.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
RE: [PHP] Re: Cleaning up MSWord HTML
Microsoft provides a program that will do just that. I believe that it gets loaded into Word you run it from there. If this will suffice, take a look for it on Microsoft's site. If you can't find it, let me know. I once downloaded it can probably dig up a URL for you. -- JR On Thu, 21 Nov 2002, Chris Boget wrote: I've done some searches on Google, PHPClasses.org, etc for something like what I'm trying to accomplish but have had little luch. And since I don't want to reinvent the wheel I thought I'd ask here. Has anyone come across a piece of code that cleans up the HTML created by MSWord when you Save As.. html? I need to remove all the extra crap added in such as the styles, etc. If you can point me in the right direction with regards to where to get started or where there might be such code, I'd be ever so appreciative! Chris -- JR -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] mail and from line overriding
You need to change the first statement to $from = From: [EMAIL PROTECTED]; -- JR -Original Message- From: Frank Wang [mailto:[EMAIL PROTECTED]] Sent: Friday, November 15, 2002 10:15 AM To: [EMAIL PROTECTED] Subject: [PHP] mail and from line overriding Hi, I have something like following: $from = [EMAIL PROTECTED]; $email = [EMAIL PROTECTED]; $msg = abcde; mail($email, $subj, $msg, $from); the message sent always has the 'from' line taken from php.ini, not $from, is there a way to override this ? Thanks. Frank -- 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] Why $ on variable names?
In an earlier message, Jason Wong [mailto:php-general;gremlins.com.hk] said ... Yup. So you can have: print I'm a $variable; instead of the messy javascript way: alert(I'm a . $variable); But the language could still support variable evaluation within strings without requiring the '$' to always appear in front of a variable name. So, a '$' within a string would mean treat the following identifier as a variable to be evaluated. I believe that this introduces no inconsistencies removes the ugly $s that litter PHP programs. -- JR -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Why $ on variable names?
In an earlier message, Marco Tabini [mailto:marcot;inicode.com] saidf ... If I can venture a comment, what you think clutters the code others may find a quick and easy way to identify a variable in it. I guess this could be true. But I don't understand why someone would need an easy way to identify variables? Why not an easy way to identify function names? Or constants? In any case, I don't recall anyone complaining that they had trouble identifying variables in C, C++, Modula, Pascal, Java, etc. Marco -- JR -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Why $ on variable names?
In an earlier message, Larry Rosenman [mailto:ler;lerctr.org] said ... How about: That's the way the language designers did it, and there's LOTS of PRODUCTION code out there that uses it. Because that's the way it is? Well, that's good enough for me. I'll never question anything else again I trust you won't, either. See also the precedence of PERL. Huh? What does the precedence of PERL mean? LER -- JR -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Why $ on variable names?
In an earlier message, Ernest E Vogelsinger [mailto:ernest;vogelsinger.at] said ... Think of how an interpreter works. It parses the sourcecode in realtime, not as a compiler. People must _wait_, every time, until it is finished, not only once like a compiler. Thus designers of interpreted languages like something that can easily be distinguished, so you don't need to lookup a lot of hash tables to identify a symbol, or to resolve amiguities. Lots of other popular interpreted languages managed to get by without the need for something unique to identify a variable name: LISP, TCL, JavaScript, Visual Basic. During parsing an interpreter or compiler will know when it might see a variable (or constant, which can be stored in the same hash table). Look at the syntax for any language. There's really no need for extraneous symbol table lookups. That's why the '$' preceds a variable name. Simply said, when the parser sees a '$', it knows which symbol table to look it up. If a token doesn't have a '$', it can be found in the table of keywords of the language's state machine. But, that's not true. If the token doesn't have a '$' it could be a function or constant name, as well as a keyword. -- O Ernest E. Vogelsinger -- JR -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Creating SSL Connection to Accept Credit Cards
I thought that using fopen to create an SSL connection was not yet supported in PHP. I would suggest the CURL functions for this. -- JR -Original Message- From: Adam Voigt [mailto:adam;cryptocomm.com] Sent: Tuesday, November 05, 2002 12:33 PM To: [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Subject: Re: [PHP] Creating SSL Connection to Accept Credit Cards Like: $f = fopen(https://whatever.com,r;) ? On Tue, 2002-11-05 at 12:31, [EMAIL PROTECTED] wrote: My credit card processor requires that I create an SSL connection in order to generate a transaction key. How would I go about writing a script to do so. Please point me in the right direction. The tech support says that it can only be done in ASP, but I find that hard to believe. -- 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: Re: [PHP] Creating SSL Connection to Accept Credit Cards
Do you have telnet access to the server? If so, you could download the standalone CURL program invoke it via the exec() function call. -- JR -Original Message- From: Ben C. [mailto:benc;cox.net] Sent: Tuesday, November 05, 2002 13:19 PM To: Jaime Bozza; 'Adam Voigt' Cc: [EMAIL PROTECTED] Subject: RE: Re: [PHP] Creating SSL Connection to Accept Credit Cards Is there anything else that I can do. I am running PHP 4.1.2 so the fopen() doesn't work and I donot have support for CURL. Any other suggestions? From: Jaime Bozza [EMAIL PROTECTED] Date: 2002/11/05 Tue PM 01:09:37 EST To: 'Ben C.' [EMAIL PROTECTED], 'Adam Voigt' [EMAIL PROTECTED] CC: [EMAIL PROTECTED] Subject: RE: Re: [PHP] Creating SSL Connection to Accept Credit Cards Except that https:// doesn't work with fopen until PHP 4.3.0. Suggestions are only good if they work with a current version of PHP. :) (No, I don't consider 4.3.0 current until it's at *least* released) Regardless, until then, CURL support is probably the way to go. Assuming you have curl support, it's fairly straightforward: --- $ch = curl_init(https://somesite.com;); curl_setopt($ch, CURLOPT_HEADER, 0); curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_POSTFIELDS, $authorization_data); $result = curl_exec($ch); $errorstr = curl_error($ch); curl_close($ch); --- $result contains the data received and $errorstr contains the error message (if any) if it was unsuccessful. Translating $result depends on how they return the data. With the above example, you'll need to have $authorization_data in POST format, which really is nothing more than the GET format string. (Secure transaction APIs typically don't allow GET) var=somevaluevar2=somevalue2var3=anothervalue -Original Message- From: Ben C. [mailto:benc;cox.net] Sent: Tuesday, November 05, 2002 11:55 AM To: Adam Voigt Cc: [EMAIL PROTECTED] Subject: Re: Re: [PHP] Creating SSL Connection to Accept Credit Cards I am not sure if that is what they want. I will try it and get back. Good suggestion. From: Adam Voigt [EMAIL PROTECTED] Date: 2002/11/05 Tue PM 12:33:00 EST To: [EMAIL PROTECTED] CC: [EMAIL PROTECTED] Subject: Re: [PHP] Creating SSL Connection to Accept Credit Cards Like: $f = fopen(https://whatever.com,r;) -- 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] Multiple Form Submit Buttons
I have been digging through the documentation for a while, but I can't find the answer to this ... If I have a form with multiple submit buttons, how can I tell in PHP which button was clicked? -- JR -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] unexpected T_STRING error
That line is syntactically invalid. Did you meant it to say echo lt;META NAME=$keywords CONTENT= $keywords gt;; -- JR -Original Message- From: Gary [mailto:[EMAIL PROTECTED]] Sent: Saturday, September 28, 2002 11:15 AM To: [EMAIL PROTECTED] Subject: [PHP] unexpected T_STRING error Hi All, Can someone explain to me why I am getting an error for the following? $keywords = $_POST[keywords]; if ($keywords) { echolt;META NAME=keywords CONTENT= $keywords gt;; } TIA Gary -- 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] GD Fonts
I've just started using the GD library in PHP to do some graphic manipulation/creation. I find myself quite confused about how to work with fonts. I believe that I have both FreeType TrueType enabled, since my phpinfo() says '--with-freetype-dir=/usr' '--with-gd' '--enable-gd-native-ttf' '--with-ttf' under GD it says FreeType Supportenabled FreeType Linkagewith freetype What I'm unclear on is how/where I can find fonts to use. Should I expect to find them already installed on the server somewhere? Or does one typically have to download install them as needed? Or am I just misunderstanding how fonts work? -- JR -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Using cURL
Can you telnet/SSH to the machine install CURL in your home directory? You shouldn't have to be root to do this. Or, are you trying to get CURL loaded into PHP? -- JR -Original Message- From: Henry [mailto:[EMAIL PROTECTED]] Sent: Friday, August 30, 2002 2:21 AM To: [EMAIL PROTECTED] Subject: [PHP] Using cURL Dear All, I'm using a shared server hosted by an ISP. I cannot get PHP recompiled with --with-curl. I've read the information about cURL but it appears that I need to be root in order to install it? I cannot do this. Does this mean that I cannot use cURL or CURL at all? If it doesn't what do I need to do so I can start using it? Henry -- 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] CURLing to authorize.net
I bet that your copy of CURL was built without SSL support, despite the fact that PHP has SSL compiled in. To test this, see if you have the curl shell command installed try curl https://secure.authorize.net/gateway/transact.dll It will probably say something like curl built without SSL support If this is what you get, let me know we'll take it from there. -Original Message- From: Mike Mannakee [mailto:[EMAIL PROTECTED]] Sent: Wednesday, August 14, 2002 20:44 PM To: [EMAIL PROTECTED] Subject: [PHP] CURLing to authorize.net The server I'm on has php compiled with curl and with ssl, so that's not an issue. I cannot seem to connect to authorize.net, however, using https://. If I use http://, it works fine. Below is the code I'm using. I know someone out there has tackled this problem before and I'm hoping you can tell me where my code is off, or share what you do to make it work. Any help will be appreciated. $ch = curl_init (https://secure.authorize.net/gateway/transact.dll;); # Initialize the session curl_setopt($ch, CURLOPT_HEADER, 1); # Make the headers part of the output curl_setopt($ch, CURLOPT_FILE, $return_data); # $return_data is a file pointer curl_setopt($ch, CURLOPT_STDERR, $error);# $error is a file pointer $post_fields = x_Login=mylogonx_ADC_URL=Falsex_ADC_Delim_Data=Truex_Amount=$g rand_total x_Card_Num=$cc_numx_Exp_Date=$month/$year; curl_setopt ($ch, CURLOPT_POSTFIELDS, $post_fields); $result = curl_exec ($ch); curl_close ($ch); It's not that I'm getting goofy data back - I just get nothing at all back. Nada. No connection, in other words. Do I need to specify the path to my SSL Cert with CURLOPT_SSLCERT? Mike -- 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] Re: POST fields through CURL
Are you sure that the HTTP header should be on there? I don't believe that is correct. It is the use of CURLOPT_POSTFIELDS with the curl_setopt function that indicates that a POST is being made. I just checked the code I used for credit card clearing it does NOT include the HTTP headers. Just the POST data. -Original Message- From: Bogdan Stancescu [mailto:[EMAIL PROTECTED]] Sent: Sunday, August 11, 2002 22:36 PM To: [EMAIL PROTECTED] Subject: [PHP] Re: POST fields through CURL Yes, the strings are formatted exactly like GET strings, but you'll have to build the whole HTTP header in front of them in order to get a valid HTTP request. So then, your code should look something like $myvar1=rawurlencode($myvar1); $myvar2=rawurlencode($myvar2); $parsed=myvar1=$myvar1myvar2=$myvar2; $len=strlen($parsed) $request=POST $request_path HTTP/1.0\r\n. Content-Type: application/x-www-form-urlencoded\r\n. User-Agent: My PHP application v1.0\r\n. Host: $host\r\n. Content-Length: $len\r\n. Connection: Keep-Alive\r\n. \r\n. // This separates the header from the content $parsed; After that, you send $request. Bogdan Mike Mannakee wrote: Hi all, I'm setting up a curl operation with post fields, and I'm hoping someone can tell me how the post fields are formatted. I'm looking to pass a string to curl_setopt( $ch, CURLOPT_POSTFIELDS, $string), but the specifications don't tell one HOW to format the string. Is it just like a GET string or what? Anyone know? Thanks, Mike -- 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] CURL SSL
I am on a server that has CURL OpenSSL enabled. I assumed that this meant that I could do https: requests via CURL. But for some reason, my attempts to do this are not working. If I do a CURL http: request, everything works fine (i.e., I get the web page, as expected). But if I use an https: request, no value is returned. Do I need to do something else to make https: requests work in CURL? Here's the code in question: $ch = curl_init(https://secure.authorize.net/gateway/transact.dll;); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); $result = curl_exec($ch); In this case, $result is the null string (if you try that URL in your browser, you will that some text is returned). If I replace the curl_init with $ch = curl_init(http://www.cnet.com;); I get the expected string in $result. Any thoughts? -- JR -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Password in script
Yes, but if you're on a shared server, other users of the user will likely be able to read your PHP files get the password. -Original Message- From: Tyler Longren [mailto:[EMAIL PROTECTED]] Sent: Thursday, July 18, 2002 23:10 PM To: Sailom Cc: [EMAIL PROTECTED] Subject: Re: [PHP] Password in script It's fine. There's no other way to do it really. Somebody would have to be able to see the source to the php file before they could see the password for mysql. They won't get it just by viewing the webpage that's already been parsed by php. -- Tyler Longren Captain Jack Communications [EMAIL PROTECTED] www.captainjack.com On Fri, 19 Jul 2002 10:03:02 +0700 Sailom [EMAIL PROTECTED] wrote: I am new to PHP and MySQL and never have experience in this area. I am writing a PHP script that connects to MySQL server. I have to put a password of MySQL into the PHP script. I think it may not be secured. What do you think? How can I make it more secure? 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
[PHP] Help with Configure Options
I am thinking of moving PHP-based web site to a new server. In doing my due diligence, I see that the new server has some different PHP configure options. I was able to make sense of most of them by looking through the PHP web site. But I'm still stumped by some of them. I'm hoping people here can tell me what they mean: --enable-libgcc: I found the 1-line explanation on www.php.net, but I'm unclear as to the implications of this option. Can anyone explain? --enable-pic: likewise. What does this mean? --enable-inline-optimization: ?? --with-regex=system: the online docs say this is deprecated. Could this cause me trouble? --with-flex: ? --with-png: I know what PNG is, but I don't know hat this option does. --with-layout=GNU: I see the explanation in the docs, but I don't know if this has any implications for me as a PHP programmer. Thanks for any help you can provide. -- JR -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Help needed with hexdec();
I spent many frustrating days debugging a similar problem. I don't understand exactly what is going on, but it seems that the problems revolve around PHP's treatment of an integer as signed or unsigned. Through experimentation I determined that the way you specify an integer constant (decimal or hex) with the sign bit on will affect how PHP treats that integer. Try the following: determine the signed decimal equivalents of the two hex integers in your code replace the hex representations with the decimal equivalents. So, if I'm remembering correctly (please check my math), the line if ($a hexdec()) would become if ($a -1) See if this makes a difference. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: Saturday, July 06, 2002 5:54 PM To: [EMAIL PROTECTED] Subject: [PHP] Help needed with hexdec(); Hi Guys, I have a problem wich I hope has been solved by someone :-) Here's the deal, I have to convert a perl script to PHP trying to do so I get negative values from hexdec(), If I use (int)hexdec() the numbers aren't negative anymore, but they do not add up to what they should. Here's the perl line: $a = FF ($a, $b, $c, $d, $temparr[8], $S11, hex(698098d8)); this is PHP: $a = FF ($a, $b, $c, $d, $temparr[8], $S11, hexdec(698098d8)); FF is a function: function FF($a,$b,$c,$d,$x,$s,$ac) { $a += F($b,$c,$d) + $x + $ac; if ($a hexdec()) { $a = substr($a,strlen($a)-9,9) ; } $a = RL($a,$s); $a += $b; return $a; } F is also a function: function F($x, $y, $z) { return ((($x) ($y)) | ((~$x) ($z))); } Could anybody tell me what I am missing here? e-mail: mailto:[EMAIL PROTECTED] [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] HTTPS vs. HTTP ?
-Original Message- From: Alberto Serra [mailto:[EMAIL PROTECTED]] Sent: Friday, July 05, 2002 8:54 PM Cc: [EMAIL PROTECTED] Subject: Re: [PHP] HTTPS vs. HTTP ? Besides, using an HTTPS server implies (correct me if I am wrong) consuming an IP number, . . . Ok ... you're wrong. HTTPS just uses a different port, same IP address. ÐÏËÁ áÌØÂÅÒÔÏ ëÉÅ× -- JR -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Keeping Secrets in PHP Files
-Original Message- From: Peter J. Schoenster [mailto:[EMAIL PROTECTED]] Sent: Saturday, June 29, 2002 1:27 AM To: [EMAIL PROTECTED] Subject: RE: [PHP] Keeping Secrets in PHP Files Yeah, you are assuming an environment that does not necessarily have to be. Why must one Apache server serve all users? Simply because that's the easiest way to do right out of the box? You have 2 scenarios as I see it: 1. Your own box -- no troubles other than the obvious 2. Virtual Server - One Apache for all users ... seems insecure 3. Virtual Server - One Apache for EACH user ... seems quite secure and experience confirms. Not to be picky but you said there werwe 2 scenarios :-) In any case, your #3 above works as long as each server runs in its own unique group, which is shares with the customer. Peter -- JR -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Keeping Secrets in PHP Files
The recent thread on security has prompted me to think about security in a shared server environment. I want to see if my understanding is correct ... Let's say I am in a shared server environment the provider does NOT have safe_mode turned on. In that case, it seems to me that it is insecure to keep secrets (e.g., DB passwords) in a PHP file that is executed by the server. I say this because any other users of that shared host can read the PHP file obtain the secret. There does not seem to be any way around this (once again, I am assuming safe_mode is NOT turned on). Am I correct? -- JR -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Keeping Secrets in PHP Files
Thanks for the reply. But changing the ground read permission of the PHP files wouldn't help, either, would it? Because the other users who have web sites can just create a PHP file that reads my PHP files from one of their pages (which would be running in group websecret). Seems like this just opens up the same hole. Yes? -Original Message- From: Erik Price [mailto:[EMAIL PROTECTED]] Sent: Friday, June 28, 2002 9:43 AM To: Jonathan Rosenberg Cc: php-list Subject: Re: [PHP] Keeping Secrets in PHP Files On Friday, June 28, 2002, at 09:30 AM, Jonathan Rosenberg wrote: Let's say I am in a shared server environment the provider does NOT have safe_mode turned on. In that case, it seems to me that it is insecure to keep secrets (e.g., DB passwords) in a PHP file that is executed by the server. I say this because any other users of that shared host can read the PHP file obtain the secret. There does not seem to be any way around this (once again, I am assuming safe_mode is NOT turned on). Think about it in terms of the permissions on the file. The people who can read this file are explicitly defined in your permissions. The catch-22 is that the web server is usually not run as root, so it doens't automatically get to see your files -- you need to give it permission to read them just as you would any other user. In a shared system, if you give others permission to read the file, the web server user can now read the file, but so can everyone else. However, if there were some way for you to change the group association of the file to, say, the websecret group, and then you could close off the read permissons of others on that file. As long as the web server is a member of websecret, and you grant read permissions to the group for that file, then the web server can read it. The trick is that in order to change the file's group association to websecret, you probably need to be either root or a member of websecret, unless the system admins have provided some kind of script that does this on your behalf. Which means that anyone else who has this ability can read the file too (since they are a member of websecret). It's tough. Shared hosting security is a difficult issue. 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] Help with forms data please
How about if you just return the user to the same page? Will that work? -Original Message- From: Bret L Conard [mailto:[EMAIL PROTECTED]] Sent: Wednesday, June 12, 2002 7:33 AM To: [EMAIL PROTECTED] Subject: [PHP] Help with forms data please I need to send the data from a form without taking the surfer to that page. ie: form on ' formPage.php ' with form name='foo' method='post' action='../newUser.php' but leave the user on ' formPage.php' Any way to do that? Thanks -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] include_once(blah); vs $blah=blah; include($blah);
Out of curiosity, try ?php global $root; $blah=include\blah.php; include_once $blah; ? see if it behaves differently (i.e., no parens around the include file name). -Original Message- From: Henry [mailto:[EMAIL PROTECTED]] Sent: Tuesday, June 11, 2002 8:15 AM To: [EMAIL PROTECTED] Subject: [PHP] include_once(blah); vs $blah=blah; include($blah); My web hosting company is running php 4.0.4pl1 Why should it be that these are different ?php global $root; include_once(include\blah.php); ? and ?php global $root; $blah=include\blah.php; include_once($blah); ? When I say different I mean; 1) global variable are not avaiable in the second version 2) functions defined in the included file are not accessable in the including file. 3) in both examples the file is included, its just the scope that seem shot Any answers? Henry -- 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] comparing strings does not work
strcmp returns 0 if the two strings are equal. In any case, why not just do if ($city == $city_new) $error = true; -Original Message- From: andy [mailto:[EMAIL PROTECTED]] Sent: Tuesday, June 11, 2002 9:10 AM To: [EMAIL PROTECTED] Subject: [PHP] comparing strings does not work Hi there, I would like to compare 2 strings. I do always get a 0 return (not equal) but they are difinatelly equal, I double checked it. They are just in two different vars. Here is how I did it: if (strcmp($city, $city_new) != 0) $error = true; Does anybody see the error? Or am I going the wrong way? Andy -- 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] include_once(blah); vs $blah=blah; include($blah);
Hmmm ... does the line number in the error message point to something in the includeD file? I.e., might you have some error in the file you are including? -Original Message- From: Henry [mailto:[EMAIL PROTECTED]] Sent: Tuesday, June 11, 2002 9:11 AM To: [EMAIL PROTECTED] Subject: Re: [PHP] include_once(blah); vs $blah=blah; include($blah); I did as you suggest with an interesting result: include_once blah.php; worked var $blah=blah.php; include_once $blah; gave the following error: Parse error: parse error in including file on line line number Where the including file is the file that was doing the include! Previously include_once($blah) just messed up the scoping and global vars! Henry Jonathan Rosenberg [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Out of curiosity, try ?php global $root; $blah=include\blah.php; include_once $blah; ? see if it behaves differently (i.e., no parens around the include file name). -Original Message- From: Henry [mailto:[EMAIL PROTECTED]] Sent: Tuesday, June 11, 2002 8:15 AM To: [EMAIL PROTECTED] Subject: [PHP] include_once(blah); vs $blah=blah; include($blah); My web hosting company is running php 4.0.4pl1 Why should it be that these are different ?php global $root; include_once(include\blah.php); ? and ?php global $root; $blah=include\blah.php; include_once($blah); ? When I say different I mean; 1) global variable are not avaiable in the second version 2) functions defined in the included file are not accessable in the including file. 3) in both examples the file is included, its just the scope that seem shot Any answers? Henry -- 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] include_once(blah); vs $blah=blah; include($blah);
The examples in the online manual indicate that it is ok to use the value of a variable for the file name: http://www.php.net/manual/en/function.include.php it also shows examples without the parentheses. Looks like (yet another) PHP bug to me. Maybe someone more knowledgeable can comment. -Original Message- From: Henry [mailto:[EMAIL PROTECTED]] Sent: Tuesday, June 11, 2002 9:45 AM To: [EMAIL PROTECTED] Subject: Re: [PHP] include_once(blah); vs $blah=blah; include($blah); No, the line number is just of the line in the includING file of the include_once statement. It's very odd, is this a known limitation of PHP i..e. includes cannot have variable or functional file names. i.e. It's ok to do include_once(include/reallyimportantstuff.php); But it's not ok to do any of the following: 1) $filename=include/reallyimportantstuff.php; include_once($filename); 2) include_once(include./reallyimportantstuff.php); 3) $root=include; include_once($root./reallyimportantstuff.php); ? Henry Jonathan Rosenberg [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Hmmm ... does the line number in the error message point to something in the includeD file? I.e., might you have some error in the file you are including? -Original Message- From: Henry [mailto:[EMAIL PROTECTED]] Sent: Tuesday, June 11, 2002 9:11 AM To: [EMAIL PROTECTED] Subject: Re: [PHP] include_once(blah); vs $blah=blah; include($blah); I did as you suggest with an interesting result: include_once blah.php; worked var $blah=blah.php; include_once $blah; gave the following error: Parse error: parse error in including file on line line number Where the including file is the file that was doing the include! Previously include_once($blah) just messed up the scoping and global vars! Henry Jonathan Rosenberg [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Out of curiosity, try ?php global $root; $blah=include\blah.php; include_once $blah; ? see if it behaves differently (i.e., no parens around the include file name). -Original Message- From: Henry [mailto:[EMAIL PROTECTED]] Sent: Tuesday, June 11, 2002 8:15 AM To: [EMAIL PROTECTED] Subject: [PHP] include_once(blah); vs $blah=blah; include($blah); My web hosting company is running php 4.0.4pl1 Why should it be that these are different ?php global $root; include_once(include\blah.php); ? and ?php global $root; $blah=include\blah.php; include_once($blah); ? When I say different I mean; 1) global variable are not avaiable in the second version 2) functions defined in the included file are not accessable in the including file. 3) in both examples the file is included, its just the scope that seem shot Any answers? Henry -- 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] PHP Hex Numbers
I would think that if $a were a number that echo $a; and printf('%d', $a); would produce the same output. Is this correct? Either I'm missing something, or PHP gets very confused when dealing with some numbers. For example, the following program ? $result = 0x9E3779B9; echo $result printf('%d', $result); ? produces 2654435769 -1640531527 I get the same kind of unexpected results when doing arithmetic on such numbers. Is this tickling some kind of known bug in PHP? or am I misunderstanding something? -- JR -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Re: PHP Hex Numbers
-Original Message- From: Jason Teagle [mailto:[EMAIL PROTECTED]] Sent: Monday, June 03, 2002 9:27 AM To: [EMAIL PROTECTED] Subject: [PHP] Re: PHP Hex Numbers When doing arithmetic in code, you should always be prepared to handle signed and unsigned. Thanks for the reply. I figured something like this was going on. But, how does one become prepared to handle signed unsigned integers? Is PHP consistent regarding signed/unsigned when it does arithmetic on integers? -- _ _ o oJason Teagle [EMAIL PROTECTED] v -- JR -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Encryption without Mcrypt?
I need to do some encryption/decryption of data in PHP. I don't need anything heavy duty. Just some scheme that obscures strings in a non-trivial manner. I am on a shared hosting site which doesn't have the mcrypt suite installed with PHP ( they won't install it). Does anyone know of any functions written in PHP that could serve this purpose? -- JR -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Baffled, line producing error
What is the exact error message are you seeing? -Original Message- From: Craig Vincent [mailto:[EMAIL PROTECTED]] Sent: Saturday, June 01, 2002 11:29 PM To: [EMAIL PROTECTED] Subject: [PHP] Baffled, line producing error I was happily coding when I came across a mysterious error. I've traced it to this line if ($player_password != $player_password_verify) { $errmsg .= 'Password don't match. Please try againBR'; $error = 1; } commented out the script runs fine, if this line is active an error is produced. My eyes are going bug eyed trying to find what the problem is and I'm hoping a second pair of eyes may point out my error. I've provided the entire script in case by chance the error is actually stemming from elsewhere in the script and I'm missing that as well. The error message from the compiler states the error is stemming from line 15 (which is the line I posted above). Any suggestions? ?php require('config.inc.php'); authenticate(); if ($action == 'add') { // The connection/query commands will need to be modified once the db abstraction layer is ready mysql_connect($mysql_host, $mysql_user, $mysql_pass); mysql_select_db($mysql_database); $errmsg = ''; if (mysql_num_rows(mysql_query(SELECT player_id FROM eq_guildmembers WHERE player_name = '$player_name')) 0) { $errmsg .= 'Player name already existsBR'; $error = 1; } if (!$player_password) { $errmsg .= 'You must specify a password for this userBR'; $error = 1; } # For some weird reason the line below produces an error...I can't find anything wrong if ($player_password != $player_password_verify) { $errmsg .= 'Password don't match. Please try againBR'; $error = 1; } if (!$error) { mysql_query(INSERT INTO eq_guildmembers (player_name, date_joined, player_email_address, player_icq, priv_admin, player_password) VALUES ('$player_name',NOW(), '$player_email_address','$player_icq','$priv_admin','$p layer_password')); else { echo 'Submission successful...A HREF=admin_roster.phpclick here to return to the roster/A'; exit; } } } ? -- 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] Standalone PHP Binaries?
Can someone point me at a site that has pre-compiled binaries for a standalone PHP interpreter? In particular, I'm looking to use one on Solaris. TIA. -- JR -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Running Setuid Programs fro PHP?
From my testing, it seems that PHP (or is it Apache) ignores the setuid bit when executing an external program (e.g., via passthru). is this correct? if so, is there some way to override this, so that the program will run setuid? -- JR -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Running Setuid Programs fro PHP?
Oops ... never mind. I answered my own question. I had made a typo that was causing the problem. External programs ARE run as setuid from PHP/Apache. -Original Message- From: Jonathan Rosenberg [mailto:[EMAIL PROTECTED]] Sent: Friday, May 31, 2002 4:27 PM To: [EMAIL PROTECTED] Subject: [PHP] Running Setuid Programs fro PHP? From my testing, it seems that PHP (or is it Apache) ignores the setuid bit when executing an external program (e.g., via passthru). is this correct? if so, is there some way to override this, so that the program will run setuid? -- JR -- 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] writing to files
Looks like you're using fopen() incorrectly. Try: fopen($file_name,r+); How about just fopen($file_name, r+); instead. No need for the surrounding s. -- JR -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] fdup Pipes?
It's been a long time since I've programmed on Unix, but there was a common technique used in C programs for invoking a program allowing the invoker to read write to its standard input/output. I believe it used a combination of pipes the fdup function. Is it possible to emulate this same behavior in PHP? -- JR -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] fdup Pipes?
I have no idea what you are talking about. My message was NOT a reply to a previous post. -Original Message- From: Jason Wong [mailto:[EMAIL PROTECTED]] Sent: Thursday, May 30, 2002 10:38 AM To: [EMAIL PROTECTED] Subject: Re: [PHP] fdup Pipes? On Thursday 30 May 2002 21:44, Jonathan Rosenberg wrote: It's been a long time since I've programmed on Unix, but there was a common technique used in C programs for invoking a program allowing the invoker to read write to its standard input/output. I believe it used a combination of pipes the fdup function. Is it possible to emulate this same behavior in PHP? Do us a favour and start a new post rather than replying to an existing one. thanks -- Jason Wong - Gremlins Associates - www.gremlins.com.hk Open Source Software Systems Integrators * Web Design Hosting * Internet Intranet Applications Development * /* A jury consists of twelve persons chosen to decide who has the better lawyer. -- Robert Frost */ -- 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] fdup Pipes?
Yes, I realized this after I sent my reply. And, please try hard to forgive those of us who do not use the real software approved by you the other gods. We beg your forgiveness, oh lord. -Original Message- From: Rasmus Lerdorf [mailto:[EMAIL PROTECTED]] Sent: Thursday, May 30, 2002 10:45 AM To: Jonathan Rosenberg Cc: [EMAIL PROTECTED] Subject: RE: [PHP] fdup Pipes? Yes it was. In your message you had this header: In-Reply-To: [EMAIL PROTECTED] Which means you hit 'Reply' in your crappy Outlook program, deleted the Subject line and posted your message that way. Please don't do that. Those of us with real email clients see your new message inside a thread on a completely different topic. -Rasmus On Thu, 30 May 2002, Jonathan Rosenberg wrote: I have no idea what you are talking about. My message was NOT a reply to a previous post. -- 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] fdup Pipes? (New Thread)
It's been a long time since I've programmed on Unix, but there was a common technique used in C programs for invoking a program allowing the invoker to read write via standard input/output. I believe it used a combination of pipes the fdup function. Is it possible to emulate this behavior in PHP? -- JR -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Using Named Pipes
I'm trying to use a named pipe in PHP, but I have a feeling I'm misunderstanding something. I'm hoping someone might have some insight. Here's the basic outline of what I'm doing posix_mkfifo($argfile, 0600) $argp = fopen($argfile, w+); $command = program $argfile; $fp = popen($command, r); fputs($argp, 'data = ' . $post); $response = fgetcsv($fp, 1000); The named pipe is being created ok. But my page hangs while trying to read the response in the last line. Everything works fine if I replace the named pipe with a standard file. So it really seems that it is the use of the named pipe that is wedging me. Any thoughts? -- JR -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] newbie: redirecting a POSTed form
I think the CURL library (http://www.php.net/manual/en/ref.curl.php) is your best bet for doing this, since you must need SSL (you mentioned credit card authorization). If the CURL library isn't compiled with your version of PHP, you could use the CURL executable invoke it with exec. -Original Message- From: PeterV [mailto:[EMAIL PROTECTED]] Sent: Tuesday, May 28, 2002 9:55 PM To: [EMAIL PROTECTED] Subject: [PHP] newbie: redirecting a POSTed form Hi, I have to redirect a POSTed form, ie. a form gets posted to my PHP page, and I then do some database stuff and then redirect it to another site. I know of header(http://othersite.com;); to redirect a simple URL request, but how can I redirect a post with a bunch of form fields in it? I don't think I am allowed to use GET for this (it's a credit card authorization provider). Thanks for any tips, I'm a bit baffled by this.. Peter -- 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] comment followed by ? fails to parse
-Original Message- From: Thalis A. Kalfigopoulos [mailto:[EMAIL PROTECTED]] Sent: Wednesday, May 29, 2002 10:27 AM To: [EMAIL PROTECTED] Subject: Re: [PHP] comment followed by ? fails to parse On Wed, 29 May 2002, Jason Wong wrote: Yes this hightlights another shortcoming of PHP in that it cannot have nested multi-line comments. This is not a shortcoming. This is an issue of the scanner of the compiler. It is not possible to remember the nesting level of the comments because of the nature of regular expressions: they lack memory. You need to brush up on your parsing theory. If the PHP parser can balance parentheses, it can balance comments, also. cheers, thalis -- JR -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] newbie: redirecting a POSTed form
I'm not aware of any simpler method. Are you unable to install a stand-alone executable on the server you are using? -Original Message- From: PeterV [mailto:[EMAIL PROTECTED]] Sent: Wednesday, May 29, 2002 11:28 AM To: Jonathan Rosenberg; [EMAIL PROTECTED] Subject: RE: [PHP] newbie: redirecting a POSTed form I think the CURL library (http://www.php.net/manual/en/ref.curl.php) is your best bet for doing this, since you must need SSL (you mentioned credit card authorization). Is there not a simpler way of doing this?? I thought there would be... I can't install extra software on the server. help? Peter -- 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] comment followed by ? fails to parse
-Original Message- From: Thalis A. Kalfigopoulos [mailto:[EMAIL PROTECTED]] Sent: Wednesday, May 29, 2002 1:40 PM To: Jonathan Rosenberg Cc: [EMAIL PROTECTED] Subject: RE: [PHP] comment followed by ? fails to parse On Wed, 29 May 2002, Jonathan Rosenberg wrote: You need to brush up on your parsing theory. If the PHP parser can balance parentheses, it can balance comments, also. From what I remember from my compilers theory, regexpr is one thing, but grammar is another. The parsing phase uses a grammar which is more powerful (every regexpr has equivalent grammar but not the other way around). But the comments are usually detected and dropped thereof in the scanning phase (prior to parsing). If I remember correctly, scanning typically uses a finite state machine (equivalent to regular expressions), while parsing using a pushdown automaton (or equivalent). You are also correct that many (most?) compilers throw out comments during scanning. Of course you could keep comments around and do the balanced parenthesis matching in the parsing phase. Some languages support nested comments do just this. Any fallacies in my memory recollection? Nope. I think you're correct I retract my previous criticism. cheers, thalis -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] POST Format
This is not entirely a PHP question I should know the answer, but ... I'm trying to figure out how to correct the proper format for simulating the data sent in a POST. I believe the basic syntax is name1=value1name2=value2 ... Is this correct? If so, how are the value's encoded? Is each value surrounded by ? Do I need to urlencode() each value (without the surrounding )? Any help appreciated. -- JR -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] comment followed by ? fails to parse
I would think that the first occurrence of ? would/should terminate the PHP code. This makes sense because the surrounding text is HTML the HTML parser does not understand PHP comments. Yes? -Original Message- From: Johnson, Kirk [mailto:[EMAIL PROTECTED]] Sent: Tuesday, May 28, 2002 4:08 PM To: [EMAIL PROTECTED] Subject: RE: [PHP] comment followed by ? fails to parse I have wondered for some time if this is a bug or just an interesting design choice ;) I agree with you, I was surprised when I first encountered this. But it is what it is, so code accordingly. Kirk -Original Message- From: Thalis A. Kalfigopoulos [mailto:[EMAIL PROTECTED]] Sent: Tuesday, May 28, 2002 1:21 PM To: [EMAIL PROTECTED] Subject: [PHP] comment followed by ? fails to parse If I write a comment line with // and I include in it ? then it fails to parse the rest of the page because (i'm guessing) the parser gets confused and goes off PHP mode. Is this normal? Shouldn't I be able to write literally ANYTHING on a comment line? Sample Code: ? //bla bla ? $var=1; ? Output: $var=1; ? cheers, thalis -- 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] comment followed by ? fails to parse
BTW: if my last message was correct, this means that an occurrence of ? embedded in a string literal will also cause problems. -Original Message- From: Johnson, Kirk [mailto:[EMAIL PROTECTED]] Sent: Tuesday, May 28, 2002 4:08 PM To: [EMAIL PROTECTED] Subject: RE: [PHP] comment followed by ? fails to parse I have wondered for some time if this is a bug or just an interesting design choice ;) I agree with you, I was surprised when I first encountered this. But it is what it is, so code accordingly. Kirk -Original Message- From: Thalis A. Kalfigopoulos [mailto:[EMAIL PROTECTED]] Sent: Tuesday, May 28, 2002 1:21 PM To: [EMAIL PROTECTED] Subject: [PHP] comment followed by ? fails to parse If I write a comment line with // and I include in it ? then it fails to parse the rest of the page because (i'm guessing) the parser gets confused and goes off PHP mode. Is this normal? Shouldn't I be able to write literally ANYTHING on a comment line? Sample Code: ? //bla bla ? $var=1; ? Output: $var=1; ? cheers, thalis -- 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] comment followed by ? fails to parse
The parser needs to emulate the behavior of the HTML parser, which will match the first ? with the opening ? string. Make sense? -Original Message- From: Leotta, Natalie (NCI/IMS) [mailto:[EMAIL PROTECTED]] Sent: Tuesday, May 28, 2002 4:41 PM To: 'Jonathan Rosenberg'; Johnson, Kirk; [EMAIL PROTECTED] Subject: RE: [PHP] comment followed by ? fails to parse But why wouldn't the parser skip right over a // line? it shouldn't even see anything in it. -Original Message- From: Jonathan Rosenberg [mailto:[EMAIL PROTECTED]] Sent: Tuesday, May 28, 2002 4:46 PM To: Johnson, Kirk; [EMAIL PROTECTED] Subject: RE: [PHP] comment followed by ? fails to parse BTW: if my last message was correct, this means that an occurrence of ? embedded in a string literal will also cause problems. -Original Message- From: Johnson, Kirk [mailto:[EMAIL PROTECTED]] Sent: Tuesday, May 28, 2002 4:08 PM To: [EMAIL PROTECTED] Subject: RE: [PHP] comment followed by ? fails to parse I have wondered for some time if this is a bug or just an interesting design choice ;) I agree with you, I was surprised when I first encountered this. But it is what it is, so code accordingly. Kirk -Original Message- From: Thalis A. Kalfigopoulos [mailto:[EMAIL PROTECTED]] Sent: Tuesday, May 28, 2002 1:21 PM To: [EMAIL PROTECTED] Subject: [PHP] comment followed by ? fails to parse If I write a comment line with // and I include in it ? then it fails to parse the rest of the page because (i'm guessing) the parser gets confused and goes off PHP mode. Is this normal? Shouldn't I be able to write literally ANYTHING on a comment line? Sample Code: ? //bla bla ? $var=1; ? Output: $var=1; ? cheers, thalis -- 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] comment followed by ? fails to parse
This seems to me to be inconsistent/buggy behavior on the part of the PHP parser. To be consistent, I would think that it would want to act like an HTML parser (browser), which will recognize the first ?, regardless of where it occurs. The idea being that if the PHP code is passed through a server that doesn't execute PHP, the code will not appear display. -Original Message- From: Ed Gorski [mailto:[EMAIL PROTECTED]] Sent: Tuesday, May 28, 2002 4:53 PM To: Kevin Stone; Jonathan Rosenberg; Johnson Kirk; [EMAIL PROTECTED] Subject: Re: [PHP] comment followed by ? fails to parse No, if you use /* ? */ as a comment the parser will skip right over it.if you want to use sample code in your script just use: /* ? code here ? */ that'll work fine ed At 02:48 PM 5/28/2002 -0600, Kevin Stone wrote: I've run into this before as well. Pain in the ass when you want to put example code in your header. It's gotta be a deisgn flaw. // literal.. legal $tmp = '?'; // reg ex.. legal ereg('?', $tmp); // Comment.. illegal. Why? Makes no sense. /*?*/ -Kevin - Original Message - From: Jonathan Rosenberg [EMAIL PROTECTED] To: Johnson, Kirk [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Tuesday, May 28, 2002 2:46 PM Subject: RE: [PHP] comment followed by ? fails to parse BTW: if my last message was correct, this means that an occurrence of ? embedded in a string literal will also cause problems. -Original Message- From: Johnson, Kirk [mailto:[EMAIL PROTECTED]] Sent: Tuesday, May 28, 2002 4:08 PM To: [EMAIL PROTECTED] Subject: RE: [PHP] comment followed by ? fails to parse I have wondered for some time if this is a bug or just an interesting design choice ;) I agree with you, I was surprised when I first encountered this. But it is what it is, so code accordingly. Kirk -Original Message- From: Thalis A. Kalfigopoulos [mailto:[EMAIL PROTECTED]] Sent: Tuesday, May 28, 2002 1:21 PM To: [EMAIL PROTECTED] Subject: [PHP] comment followed by ? fails to parse If I write a comment line with // and I include in it ? then it fails to parse the rest of the page because (i'm guessing) the parser gets confused and goes off PHP mode. Is this normal? Shouldn't I be able to write literally ANYTHING on a comment line? Sample Code: ? //bla bla ? $var=1; ? Output: $var=1; ? cheers, thalis -- 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
RE: [PHP] Function Switch($pid) - NEED HELP
-Original Message- From: Vincent Kruger [mailto:[EMAIL PROTECTED]] Sent: Saturday, May 25, 2002 8:41 AM To: [EMAIL PROTECTED] Subject: [PHP] Function Switch($pid) - NEED HELP I have a script that switches. switch($pid) { case 1: break; case 2: break; } Now I'm doing a check in case 1 and if everything goes well, I want to switch directly to case 2 while the script is runny. How would I do that ??? I'm not sure I'm understanding your question properly. But does this do what you want? switch ($pid) { case 1: if (!test you want) then break; // If test is true, execution falls // through to next case case 2: ... break; } -- JR -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] and Operators
Are the and operators identical in semantics to those operators in C? In particular, do they handle sign extension in the same manner? -- JR -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] How can I access the value in a variable whos name is in a string
I'm a PHP amateur, but a quick perusal of Eval in the manual says In PHP 4, eval() returns FALSE unless return() is called in the evaluated code, in which case the value passed to return() is returned. In PHP 3, eval() does not return a value. -Original Message- From: Henry [mailto:[EMAIL PROTECTED]] Sent: Saturday, May 18, 2002 10:30 AM To: [EMAIL PROTECTED] Subject: [PHP] How can I access the value in a variable whos name is in a string Dear All, $variablename=variable; eval(\$.$variablename.=13;); echo $variable; This works fine!! It echoes 13; But this doesn't - echo eval(\$variablename\); Why?? Henry -- 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] Logging Errors to a File
I am using an Apache webserver w/ PHP provided by a hosting company I can't seem to get PHP errors logged to a file. From reading the docs, my understanding is that I need to set error_log to the name of a file set log_errors to on in the php.ini file (.htaccess, in my case). Is this correct? I tried setting these two parameters in my .htaccess file. When I do a phpinfo(), I see that error_log has been set, but the log_errors is still off. It remains off no matter what I do. I'm wondering whether the hosting company may not allow this value to be overridden. Does this make sense? Any other thoughts? -- JR -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Logging Errors to a File
I am using an Apache webserver w/ PHP provided by a hosting company I can't seem to get PHP errors logged to a file. From reading the docs, my understanding is that I need to set error_log to the name of a file set log_errors to on in the php.ini file (.htaccess, in my case). Is this correct? I tried setting these two parameters in my .htaccess file. When I do a phpinfo() I see that error_log has been set, but the error_log value doesn't seem to change. It remains off no matter what I do. I'm wondering whether the hosting company may not allow this value to be overridden. Does this make sense? Any other thoughts? -- JR -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] fgetcsv With a String?
Is there any way that I can use fgetcsv, but have it get its input from a string, instead of using a file pointer? From the online docs, there doesn't seem to be a way, but I thought I'd check with the list. -- JR -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Making a Client-side HTTPS Request
I would like to be able to make a client side HTTPS request from one of my pages. From searching around, I see that I can do everything I want using the CURL library. But the ISP I am using does not have the CURL library installed. I'll ask them if they'll install this library. But, assuming they don't, do I have any other options for doing what I want? -- JR -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Re: Making a Client-side HTTPS Request
I'm quite new to PHP (though I have lots of programming experience, web otherwise). Where can I learn more about what installed and available from the command line means? -Original Message- From: Austin Marshall [mailto:[EMAIL PROTECTED]] Sent: Monday, May 06, 2002 1:19 PM To: Jonathan Rosenberg Cc: [EMAIL PROTECTED] Subject: [PHP] Re: Making a Client-side HTTPS Request Jonathan Rosenberg wrote: I would like to be able to make a client side HTTPS request from one of my pages. From searching around, I see that I can do everything I want using the CURL library. But the ISP I am using does not have the CURL library installed. I'll ask them if they'll install this library. But, assuming they don't, do I have any other options for doing what I want? -- JR Even if they don't have it compiled into PHP, they might have curl installed and available from the command line. -- 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] Re: Making a Client-side HTTPS Request
AHhh ... got it. If my ISP won't install CURL they don't have the application, can I download binaries to my directory execute it from there using PHP? or, does the executable have to run with special permissions? -Original Message- From: Austin Marshall [mailto:[EMAIL PROTECTED]] Sent: Monday, May 06, 2002 1:35 PM To: Jonathan Rosenberg Cc: [EMAIL PROTECTED] Subject: Re: [PHP] Re: Making a Client-side HTTPS Request What i meant was the actual curl application is installed on the server. Accessible from the command line at, for example, /usr/local/bin/curl With PHP you can execute commands via the command line via system(), exec() or via the backtick (for example $output=`/usr/local/bin/curl request`;) operator. You also might be able to load the extension via dl() and compile it on your own, but i wouldn't recommend that. First try the command line option, then ask your ISP to install then extension. Jonathan Rosenberg wrote: I'm quite new to PHP (though I have lots of programming experience, web otherwise). Where can I learn more about what installed and available from the command line means? -Original Message- From: Austin Marshall [mailto:[EMAIL PROTECTED]] Sent: Monday, May 06, 2002 1:19 PM To: Jonathan Rosenberg Cc: [EMAIL PROTECTED] Subject: [PHP] Re: Making a Client-side HTTPS Request Jonathan Rosenberg wrote: I would like to be able to make a client side HTTPS request from one of my pages. From searching around, I see that I can do everything I want using the CURL library. But the ISP I am using does not have the CURL library installed. I'll ask them if they'll install this library. But, assuming they don't, do I have any other options for doing what I want? -- JR Even if they don't have it compiled into PHP, they might have curl installed and available from the command line. -- 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] file_exists
Does fopen() actually work for https connections? I thought this implementation was not yet released. -Original Message- From: Austin Marshall [mailto:[EMAIL PROTECTED]] Sent: Monday, May 06, 2002 9:40 PM To: Craig Westerman Cc: php-general-list Subject: Re: [PHP] file_exists Craig Westerman wrote: I found my problem. Try fopen() if it fails it will return false, otherwise it will return an integer file pointer. You get use it to fetch files via http://, https://, ftp://, and more. From manual: file_exists() will not work on remote files; the file to be examined must be accessible via the server's filesystem. File is on another server. Is there a way to check if file exists on another server? Craig [EMAIL PROTECTED] -Original Message- From: Craig Westerman [mailto:[EMAIL PROTECTED]] Sent: Monday, May 06, 2002 7:58 PM To: php-general-list Subject: [PHP] file_exists What am I doing wrong? I get parse error between first echo statement and else. Thanks Craig [EMAIL PROTECTED] ?php $fn = image.gif; if (!file_exists($fn)) { echo img src=noimageexists.gif; else echo img src=$fn; } ? -- 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