Re: [PHP] E-Commerce
on 2/12/04 20:43, Jimmy at [EMAIL PROTECTED] wrote: Hi all. Is PHP a suitable language for building an online shop? Where would I go to find out more info on this? Thanks in advance! The best ecommerce shop I have found that runs in PHP and MySQL would be eShox.. a very very very well done shop. At the core it WAS oscommerce, but it has been modified and rewritten so that it is way more then oscommerce ever was and ever will be :) Way more secure and just plain a great program. find it here: http://www.eshox.com Cheers! Rick -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Call to a member function on a non-object
Hi guys could the fatal error be caused because of something to do with cache? I am running the scripts on my pc and not a server ie:(localhost). thanx -Original Message- From: adwinwijaya [mailto:[EMAIL PROTECTED] Sent: Thursday, February 12, 2004 2:35 PM To: Angelo Zanetti Cc: [EMAIL PROTECTED] Subject: Re: [PHP] Call to a member function on a non-object Hello Angelo, Thursday, February 12, 2004, 11:33:39 PM, you wrote: AZ HI, AZ I used my scripts yesterday and suddenly today they dont work and I get this AZ error: Call to a member function on a non-object AZ it points to erroneous line that calls a function in 1 of my classes. The AZ class and this particular file have not been changed since i used them yest. AZ I also checked my DB and all is perfect. I read somewhere on the net that it AZ could have something to do with cache. But i couldnt find any helpful info. AZ perhaps someone has experienced this error before and what could cause it AZ and how do i fix it? AZ thanx in advance AZ Angelo -- may be you have to check whether you have already include the file -- or not .. sometimes, include_once (or require_once) could lead to -- this error .. so try to use include or require .. hope it work :) -- Best regards, adwinwijayamailto:[EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php Disclaimer This e-mail transmission contains confidential information, which is the property of the sender. The information in this e-mail or attachments thereto is intended for the attention and use only of the addressee. Should you have received this e-mail in error, please delete and destroy it and any attachments thereto immediately. Under no circumstances will the Cape Technikon or the sender of this e-mail be liable to any party for any direct, indirect, special or other consequential damages for any use of this e-mail. For the detailed e-mail disclaimer please refer to http://www.ctech.ac.za/polic or call +27 (0)21 460 3911 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Call to a member function on a non-object SOLVED
-Original Message- From: Angelo Zanetti [mailto:[EMAIL PROTECTED] Sent: Friday, February 13, 2004 10:23 AM To: adwinwijaya Cc: [EMAIL PROTECTED] Subject: RE: [PHP] Call to a member function on a non-object Hi guys could the fatal error be caused because of something to do with cache? I am running the scripts on my pc and not a server ie:(localhost). thanx -Original Message- From: adwinwijaya [mailto:[EMAIL PROTECTED] Sent: Thursday, February 12, 2004 2:35 PM To: Angelo Zanetti Cc: [EMAIL PROTECTED] Subject: Re: [PHP] Call to a member function on a non-object Hello Angelo, Thursday, February 12, 2004, 11:33:39 PM, you wrote: AZ HI, AZ I used my scripts yesterday and suddenly today they dont work and I get this AZ error: Call to a member function on a non-object AZ it points to erroneous line that calls a function in 1 of my classes. The AZ class and this particular file have not been changed since i used them yest. AZ I also checked my DB and all is perfect. I read somewhere on the net that it AZ could have something to do with cache. But i couldnt find any helpful info. AZ perhaps someone has experienced this error before and what could cause it AZ and how do i fix it? AZ thanx in advance AZ Angelo -- may be you have to check whether you have already include the file -- or not .. sometimes, include_once (or require_once) could lead to -- this error .. so try to use include or require .. hope it work :) -- Best regards, adwinwijayamailto:[EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php Disclaimer This e-mail transmission contains confidential information, which is the property of the sender. The information in this e-mail or attachments thereto is intended for the attention and use only of the addressee. Should you have received this e-mail in error, please delete and destroy it and any attachments thereto immediately. Under no circumstances will the Cape Technikon or the sender of this e-mail be liable to any party for any direct, indirect, special or other consequential damages for any use of this e-mail. For the detailed e-mail disclaimer please refer to http://www.ctech.ac.za/polic or call +27 (0)21 460 3911 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php Disclaimer This e-mail transmission contains confidential information, which is the property of the sender. The information in this e-mail or attachments thereto is intended for the attention and use only of the addressee. Should you have received this e-mail in error, please delete and destroy it and any attachments thereto immediately. Under no circumstances will the Cape Technikon or the sender of this e-mail be liable to any party for any direct, indirect, special or other consequential damages for any use of this e-mail. For the detailed e-mail disclaimer please refer to http://www.ctech.ac.za/polic or call +27 (0)21 460 3911 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] E-Commerce
On Friday 13 February 2004 15:45, Radwan Aladdin wrote: No offence intended but ... Do you mean by this I can open a company like PaySystems or 2CheckOut! ... if you're having to ask, then I doubt it. Building a payment gateway is no small undertaking. And frankly it requires far more knowledge than you possess right now! -- Jason Wong - Gremlins Associates - www.gremlins.biz Open Source Software Systems Integrators * Web Design Hosting * Internet Intranet Applications Development * -- Search the list archives before you post http://marc.theaimsgroup.com/?l=php-general -- /* You never have to change anything you got up in the middle of the night to write. -- Saul Bellow */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Mp3 with php?
Chris W. Parker schrieb: carlos castillo mailto:[EMAIL PROTECTED] on Thursday, February 12, 2004 3:53 PM said: does anyone know how to reproduce a mp3 file with php? What do you mean reproduce? Copy? Create from scratch? Represent visually? In any case.. I'd say PHP cannot do anything but create a copy of a file. It cannot read in data from a microphone or a cd player or the like (as far as I know). Chris. but php can call external progs (e.g. exec(); system()). so you can run lame or other progs and give the desired params like source- and target-file, sampling-rate, mode (mono, stereo), and so on. maybe that's what you want? hth SVEN -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Two easy questions I think..
Hi.. 1- In my mySQL DB there is a field named Whole.. there are many rows.. and every one has the value for the field Whole. What I want is to add all these values in all rows for the field Whole then show it on the screen.. I mean by add : 1 + 2 + 3 = 6... 2- I have another filed there also.. named UserNo I want every adding query to this field to include a value in the row for that field = the latest row's value + 1 For example : if there are three rows in the table.. Row1 : UserNo value = 1 Row2 : UserNo value = 2 Row3 : UserNo value = 3 I want PHP to get the last row's value for that field (In this example : 3) then add to it 1.. so it will be 4 and insert it to the new row.. Regards..
RE: [PHP] Two easy questions I think..
Sum() and auto_increment Why not read the mysql manual? -Original Message- From: Radwan Aladdin [mailto:[EMAIL PROTECTED] Sent: vrijdag 13 februari 2004 11:14 To: [EMAIL PROTECTED] Subject: [PHP] Two easy questions I think.. Hi.. 1- In my mySQL DB there is a field named Whole.. there are many rows.. and every one has the value for the field Whole. What I want is to add all these values in all rows for the field Whole then show it on the screen.. I mean by add : 1 + 2 + 3 = 6... 2- I have another filed there also.. named UserNo I want every adding query to this field to include a value in the row for that field = the latest row's value + 1 For example : if there are three rows in the table.. Row1 : UserNo value = 1 Row2 : UserNo value = 2 Row3 : UserNo value = 3 I want PHP to get the last row's value for that field (In this example : 3) then add to it 1.. so it will be 4 and insert it to the new row.. Regards.. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] mt_strand
Hi All I could do with some pointers in using mt_strand. I understand that because my server has PHP4.2.0 random number generators need to be seeded using mt_strand or mt_rand. I have the following code [created with the help of this list]: ?php $imgdir = /images/randomimages/; if ($handle = opendir($imgdir)) { while (false !==($file = readdir($handle))) { if ($file != . $file != ..) { $random[] = $file; } } closedir($handle); } $image = $random[mt_rand(0, count($random)-1)]; ? ?php include(/images/randomimages/$image); ? and have found the following in the PHP manual: ?php // seed with microseconds function make_seed() { list($usec, $sec) = explode(' ', microtime()); return (float) $sec + ((float) $usec * 10); } mt_srand(make_seed()); $randval = mt_rand(); ? However - I'm not 100% sure how to incorporate it into my code - I have tried a few things but each time I break the code. Any help will be appreciated. Thanks Ange *** Angela K Hilton Web E-Learning Officer ISD, UMIST Tel: 0161 306 3109 ***
RE: [PHP] mt_strand
Hamid ?php include(/images/randomimages/$image); ? works fine - all the code works OK - apart from the seed issue. A *** Angela K Hilton Web E-Learning Officer ISD, UMIST Tel: 0161 306 3109 *** -Original Message- From: Hamid Hossain [mailto:[EMAIL PROTECTED] Sent: 13 February 2004 10:45 To: [EMAIL PROTECTED] Subject: RE: [PHP] mt_strand Hi Angela, I don't understand why you are using the following line: ?php include(/images/randomimages/$image); ? You have to use somthing like: img src=/images/randomimages/?= $image ? The other part of your code looks fine to me. Regards, Hamid --- Check Amazon.com's Latest PHP books: http://www.amazon.com/exec/obidos/redirect?tag=zawraqclassif-20path=tg/ browse/-/295223 Start Accepting CreditCard at your site in minutes: http://www.2checkout.com/cgi-bin/aff.2c?affid=106720 Download Alexa Tool Bar to stop Pop-ups for FREE: http://download.alexa.com/?amzn_id=zawraqclassif-20 Download Ready-Made Templates for your site: http://www.aplustemplates.com/cgi/affiliates/c1.cgi/zawraq_ad --- Original Message Follows From: Angela K Hilton [EMAIL PROTECTED] To: PHP-General [EMAIL PROTECTED] Subject: [PHP] mt_strand Date: Fri, 13 Feb 2004 10:37:47 - Hi All I could do with some pointers in using mt_strand. I understand that because my server has PHP4.2.0 random number generators need to be seeded using mt_strand or mt_rand. I have the following code [created with the help of this list]: ?php $imgdir = /images/randomimages/; if ($handle = opendir($imgdir)) { while (false !==($file = readdir($handle))) { if ($file != . $file != ..) { $random[] = $file; } } closedir($handle); } $image = $random[mt_rand(0, count($random)-1)]; ? ?php include(/images/randomimages/$image); ? and have found the following in the PHP manual: ?php // seed with microseconds function make_seed() { list($usec, $sec) = explode(' ', microtime()); return (float) $sec + ((float) $usec * 10); } mt_srand(make_seed()); $randval = mt_rand(); ? However - I'm not 100% sure how to incorporate it into my code - I have tried a few things but each time I break the code. Any help will be appreciated. Thanks Ange *** Angela K Hilton Web E-Learning Officer ISD, UMIST Tel: 0161 306 3109 *** _ Protect your PC - get McAfee.com VirusScan Online http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] mt_strand
On Friday 13 February 2004 18:37, Angela K Hilton wrote: I could do with some pointers in using mt_strand. You do mean mt_srand() ? [snip] mt_srand(make_seed()); Just do the above *once*, somewhere near the top of your code (anywhere before you use mt_rand()). Then just use mt_rand() wherever you need it, like eg: $image = $random[mt_rand(0, count($random)-1)]; If you're just picking a random item from an array. the nice people who develop php have provided a function to do just that, array_rand(). RTFM before use. However - I'm not 100% sure how to incorporate it into my code - I have tried a few things but each time I break the code. It would help if you stated exactly what you did and how your code was broken. -- Jason Wong - Gremlins Associates - www.gremlins.biz Open Source Software Systems Integrators * Web Design Hosting * Internet Intranet Applications Development * -- Search the list archives before you post http://marc.theaimsgroup.com/?l=php-general -- /* I've run DOOM more in the last few days than I have the last few months. I just love debugging ;-) (Linus Torvalds) */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] ODBC with SQL Server
Hello, I have a connectoin ODBC with a SQL Server database. A table has a field of type 'nvarchar'. This field contains japanese characters. How can I read these japanese characteres? When I read (with: select name from data) only read '?' character. Thaks very much. Juan Torres. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] mt_strand
Hello Angela, Friday, February 13, 2004, 10:37:47 AM, you wrote: AKH However - I'm not 100% sure how to incorporate it into my code - I have AKH tried a few things but each time I break the code. Your make_seed() function isn't going to work in this instance because the important parts of it are outside of the function scope. ?php // seed with microseconds function make_seed() { list($usec, $sec) = explode(' ', microtime()); return (float) $sec + ((float) $usec * 10); } mt_srand(make_seed()); $randval = mt_rand(); ? If you look carefully you'll see that all the function itself does is return a unique value - the two commands that follow the function (mt_srand and $randval=) use that result, but they're not part of the function. So in essence just calling the function will never actually work. To get this to work in your code you would need to place the function and mt_srand line somewhere at the start of your script. Personally, it I think it'd be easier to do this which is a similar approach but with a small re-write: ?php function make_seed() { list($usec, $sec) = explode(' ', microtime()); $seed = $sec + ($usec * 10); mt_srand($seed); } // Call the rand seed function make_seed(); $imgdir = /images/randomimages/; if ($handle = opendir($imgdir)) { while (false !==($file = readdir($handle))) { if ($file != . $file != ..) { $random[] = $file; } } closedir($handle); } $image = $random[mt_rand(0, count($random)-1)]; include /images/randomimages/$image; ? The above is un-tested but should work fine, just reply to this email if it gives you a syntax error and I'll track it down. -- Best regards, Richardmailto:[EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re[2]: [PHP] E-Commerce
Hello John, Friday, February 13, 2004, 7:09:47 AM, you wrote: JN First off, it won't install or run if you have register_globals off. Wow, I had no idea - I've known about OScommerce for a while, but didn't realise it needed you to turn on register_globals - that is, quite frankly, shocking. But then again - you get what you pay for?! JN Second, the code looks like it was written by someone who originaly had JN no intention of releasing this code to the world. It's sloppy, JN unorganized, and poorly (if at all) commented. Compare the code from an JN application like phpMyAdmin to OSCommerce to see what I mean. This doesn't surprise me. It's a hard line to walk though isn't it - I mean on the one hand we can sit here and lambast the poor quality of the code - and on the other they're providing this for free and offering a solution to people who cannot afford a more expensive approach. It's sort of like PHPNuke - dear God, I've never seen code so badly written in my entire life, it's a wonder it all hung together. And yet look how popular it is. C'est la vie! -- Best regards, Richardmailto:[EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] syntax help
Hi all I have a problem that is probably just a lack of php syntax knowledge on my part and hopefully someone can help me out. I have an array and i want to query a database for each value in that array. I then want to store that result as a new variable called $array[value]total. see code below $array=array(Flyer,Email,Phone); $array_len=count($array); for($i=0;$i$array_len;$i++){ $query=select count(score) from test_table where source = '$array[$i]'; $result=mssql_query($query,$numero); $row=mssql_fetch_row($result); $array[$i].total=$row[0];-- problem here } so for the above code i would like to create three variable $flyertotal,$emailtotal $phonetotal and have the result of the count(score) query stored in them. Any help or pointing to documentation would be greatly appreciated! Cheers Bob Yahoo! Messenger - Communicate instantly...Ping your friends today! Download Messenger Now http://uk.messenger.yahoo.com/download/index.html -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] syntax help
Hello bob, Friday, February 13, 2004, 12:10:06 PM, you wrote: bp $array=array(Flyer,Email,Phone); bp $array_len=count($array); bp for($i=0;$i$array_len;$i++){ bp $query=select count(score) from test_table bp where source = '$array[$i]'; bp $result=mssql_query($query,$numero); bp $row=mssql_fetch_row($result); bp $array[$i].total=$row[0];-- problem here bp } $array[$i]['total'] = $row[0]; Alternatively, you can probably do this too: $query = SELECT COUNT(score) AS hits FROM ...; $result = mssql_query($query, $numero); $array[$i]['total'] = mssql_result($result, 0, hits); Same end result, but saves on processing a bit. This assumes MSSql has the same functions available as MySQL does (the mssql_result part) -- Best regards, Richardmailto:[EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Referring to Parent Folders
I don't know if this is a PHP config problem, or an Apache 1.3/PHP 4 problem, or what. When I include a script, say 2 folders up in the structure, I'm having to move up to it instead of skipping to root and moving down to it. Allow me to clarify, let's say my tree structure looks like so [brackets indicate folder]: [doc root] -[php] -- script.php -- [some folder] --- [another folder] current.php Let's then say that I want to include 'script.php' inside 'current.php'. As it is now, I'm having to use include('../../script.php'). This is obviously a nuisance, especially if I want to move things around. Now, I remember in the past (different server config), using include('/php/script.php') would work perfectly fine, but it does NOT work now, and I'd love for it to work. Using /folder/file.ext works in regular HTML so I can only assume it is not a problem with Apache. So my question is, is this simply a PHP config problem? PHP 4.3.4 Apache 1.3.something Thanks! Vinny -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Browser Detection another page
Hello Joel, Before you read my comments below, let me say that I'm not trying to prove you *wrong* or even express disagreement with the points you made; I'm just interested in your reasons. On 12 Feb 2004 at 20:11, joel boonstra wrote: Hopefully you're aware that $HTTP_USER_AGENT is an unreliable variable, in that it is sent by the client, and can contain virtually anything. Sure, but why would a user want to fake their browser signature? The worst that could happen is that the offending user would be redirected to a page that wouldn't look good in her/his browser. Or am I missing something here? I saw a response letting you know how to do this, but I would recommend not sending people to different pages based on which browser/OS they're using. Why not? Isn't that what most of the big web sites do? It should be possible to use CSS/(X)HTML to present your content in a way that is accessible to whichever browser accesses your site. IMHO, browser-sniffing to serve different content is a bad idea. What about obsolete browsers that don't handle CSS too well (or not at all)? We developers would love to have all our visitors use the most recent browsers, preferably ones with a good implementation of the JavaScript DOM and XSLT transformations, but that's unfortunately not what happens in the real world. Could you throw in another 2 cents? :o) Erik -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Referring to Parent Folders
Hello Vinny, Tuesday, February 10, 2004, 6:18:09 AM, you wrote: V [doc root] V -[php] V -- script.php V -- [some folder] V --- [another folder] V current.php V So my question is, is this simply a PHP config problem? Nope. Nothing to do with Apache either. The problem is that you're assuming the include function knows what your doc root is. But think about it - how can it? It's looking for files on a FILESYSTEM level, not a URL level. Assume the following is the actual directory structure on your server: /usr-- Top Level /usr/home /usr/home/vinny /usr/home/vinny/public_html -- Where your web files live Say you want current.php to include script.php as in your example. You have two choices: include ../../script.php; Which as you pointed out isn't ideal if you ever need to move around. Alternatively: include /usr/home/vinny/public_html/php/script.php; Which will never fail as long as you never move script.php Why not set-up a variable in a common include file (something like $basedir = /usr/home/vinny/public_html/php) and then you can just do this: include $basedir/script.php; Or whatever you need to do. The other solution would be to place your local (home) directory into the search path for include in the php.ini file. -- Best regards, Richardmailto:[EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re[2]: [PHP] Browser Detection another page
Hello, Friday, February 13, 2004, 12:29:07 PM, you wrote: mycb Sure, but why would a user want to fake their browser signature? They might do it without even knowing. Opera will identify itself as IE6 for example if you select that in the Preferences. Other browsers/packages can do it as standard. Although I can't give a specific example, I bet there are some firewalls out there that filter this information out too. I saw a response letting you know how to do this, but I would recommend not sending people to different pages based on which browser/OS they're using. mycb Why not? Isn't that what most of the big web sites do? Actually yes, lots of them do. So I agree with you here :) mycb What about obsolete browsers that don't handle CSS too well (or not at all)? We I think his point was that there are other ways to handle browser display issues besides 2 versions of a site and a user_agent test. -- Best regards, Richardmailto:[EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Mp3 with php?
Hello Carlos, On 12 Feb 2004 at 18:52, carlos castillo wrote: does anyone know how to reproduce a mp3 file with php? If my Spanish serves me right, what you want to do is play an MP3 file. Well, that's something that would happen on the user's computer and would depend on the presence of a sound card, loudspeakers, appropriate plug-in etc. PHP is a server-side scripting language and has nothing whatsoever to do with the user's computer. What PHP can do, of course, is handle the storage of MP3 files on the server and send HTML embed tags (for instance) to the user's browser. Hope this helps, Erik -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] E-Commerce II
Wow, thanks for the help guys. Appreciate it. Here's 2 other Q that popped into my head while researching... 1. I looked at Yahoo! and bCentral, they both charge monthly fees for using their E-Commerce Tools. Why? I thought it should be a one time thing? Or are they not providing code, just letting us use the code via Explorer and Frontpage? 2. If I were to look for a website hoster, any recommendations? Thanks! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] E-Commerce II
Wow, thanks for the help guys. Appreciate it. Here's 2 other Q that popped into my head while researching... 1. I looked at Yahoo! and bCentral, they both charge monthly fees for using their E-Commerce Tools. Why? I thought it should be a one time thing? Or are they not providing code, just letting us use the code via Explorer and Frontpage? I'm not sure about bCentral, but Yahoo bought out a company called Viaweb quite a few years ago (for about $48 million!!) and they provide a fully-hosted solution. This is great for non-technical users who just want to build their own store with a point and click interface. I would presume that because you are on the PHP list either you are looking to install one of the carts mentioned, build your own or customise someone elses offering because you have bespoke needs that one of the sites like Yahoo! Cannot meet 2. If I were to look for a website hoster, any recommendations? Hoho. You'll get as many recommendations as replies I'm sure. I'd suggest going to www.webhostingtalk.com and just hanging around to see what good and bad stuff is said about various hosts and make your mind up. Some things you need to think about though do you need a host or dedicated server and if it is just a host then you need to see what features they have and provide for PHP guys... Hope this helps a little Ade -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Mp3 with php?
There is one possiblitity, using ming extension. http://ming.sourceforge.net/ -- zerof Carlos Castillo [EMAIL PROTECTED] escreveu na mensagemdoes anyone know how to reproduce a mp3 file with php? -- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Browser Detection another page
[ straying OT, so apologies in advance. ] [ also, quite long. double apologies. ] On Fri, Feb 13, 2004 at 10:29:07AM -0200, [EMAIL PROTECTED] wrote: Hopefully you're aware that $HTTP_USER_AGENT is an unreliable variable, in that it is sent by the client, and can contain virtually anything. Sure, but why would a user want to fake their browser signature? The worst that could happen is that the offending user would be redirected to a page that wouldn't look good in her/his browser. Or am I missing something here? As speculated by Richard Davey: Although I can't give a specific example, I bet there are some firewalls out there that filter this information out too. I can give a specific example -- Norton Firewall, included with the Norton Internet Security package. An old script of ours (not one I wrote ;) was relying on HTTP_USER_AGENT to do some form interaction, and every so often I would get emails saying that users had received the error page. I couldn't find any connection, until one person happened to mention that they use Norton Firewall product. Sure enough, every person after that that had this problem also (when asked) mentioned that they used Norton Firewall. You can, of course, override Norton's settings. But nobody does that. I saw a response letting you know how to do this, but I would recommend not sending people to different pages based on which browser/OS they're using. Why not? Isn't that what most of the big web sites do? If most big web sites jumped off a bridge... okay, sorry, that was dumb. I don't have the numbers/stats/whatever to say whether or not most big websites do or don't do this. However... Are you a big website? Do you have the resources/manpower to maintain two separate versions of each page in your site? Three? Ten? How do you decide when to stop creating OS- or browser-specific versions of your websites? To bring PHP back into this, yes, PHP could lend a hand with some of this. However, you will clearly be doing more work. And what about those browsers with special needs that you *don't* anticipate? What happens to those folks? If your classes of browsers are: - IE/Windows (NT, 2k, 98, XP) - Windows CE - everything else Then where does a user using the JAWS screen reader get sent? My guess is they end up on everything else, which (again, my guess) is going to try to be a lowest-tech page that attemps to cater to everyone. Will that page be able to be read by JAWS? In 10 years, will the situation be getting better or worse? Will there be only two browsers to code for, or fifty? Do you want to keep trying to code to the idiosyncrasies of each popular new browser that comes out? It should be possible to use CSS/(X)HTML to present your content in a way that is accessible to whichever browser accesses your site. IMHO, browser-sniffing to serve different content is a bad idea. What about obsolete browsers that don't handle CSS too well (or not at all)? We developers would love to have all our visitors use the most recent browsers, preferably ones with a good implementation of the JavaScript DOM and XSLT transformations, but that's unfortunately not what happens in the real world. I agree, it'd be swell if all my users used the latest Mozilla. But you're right, of course -- they don't. And many won't ever upgrade until they get a new OS. So, what's a developer to do? What you first need to decide is what you consider browser compatibility. By that do you mean that your design needs to look exactly the same in every conceivable browser + OS combination? Or are you more concerned about your users being able to get information and navigate the site? Can you have both? No. It's not possible. Can you make the site look good for 90% of your users, and work well for 100%, all with only one site? Yes. I love this site: http://csszengarden.com/ The exact same HTML is used for each design. The only change is the CSS. Each design in the gallery must work for a majority of major browsers. Head over there, and check it out in IE6/Win, and Mozilla. Browse through a few designs. Then try it out in Netscape 4.x. Your cellphone. NCSA Mosaic. You can browse the site in all of them. The relatively small number of users who use old/incapable browsers: http://www.thecounter.com/stats/2004/January/browser.php can still use the site. Users with modern browsers get beautifully-designed sites, all with the same HTML. Now try using all of those browsers on some of the big websites that do browser sniffing. A real-world gallery: http://cssvault.com/ shows sites that are actually live on the web, using CSS to style their content. And there are indeed some big sites that have decided that a CSS design is viable: http://msn.espn.go.com/ http://news.com.com/ http://www.sprintpcs.com/ I'm not an expert (unfortunately) on the specifics of how to acheive this sort of a design. I'd
Re: [PHP] Referring to Parent Folders
Richard Davey wrote: Why not set-up a variable in a common include file (something like $basedir = /usr/home/vinny/public_html/php) and then you can just do this: include $basedir/script.php; Here's what I use: -- HOME: -- http://localhost/ C:/_Paul/web/public_html C:/_Paul/web/phplib /configuration /screen /utilities /action -- SCHOOL: -- http://hills.ccsf.edu/~pfurma02/ /students/pfurma02/public_html /students/pfurma02/phplib /configuration /screen /utilities /action -- Here's my HOME path definitions: -- ?php /* INDEX.PHP this is the only file sitting in public_html it tells us the paths for the server we are running on and nothing else then it includes a config file for the rest of the setup */ define ('LIBDIR', 'C:/_Paul/web/phplib'); define ('PUB_DIR', 'C:/_Paul/web/public_html'); define ('URL_DIR', 'http://localhost/'); define ('CONFIG_DIR', LIBDIR . '/configuration'); include (CONFIG_DIR . '/config.php'); ? -- This file works at home and at school: -- ?php /* CONFIG.PHP this is the first thing called from index.php it sets up the remaining global constants it checks the screen input to redirect before anything goes wrong then includes the main template */ define ('SCREEN_DIR', LIBDIR . '/screen'); define ('UTIL_DIR', LIBDIR . '/utilities'); define ('ACTION_DIR', LIBDIR . '/action'); $template = 'main.php'; # the template for the site $default_screen = 'home.php'; # the default screen # check which SCREEN to display if(isset($_REQUEST['SCREEN'])) { if(is_file(SCREEN_DIR . / . basename($_REQUEST['SCREEN']))) { $SCREEN = basename($_REQUEST['SCREEN']); } else { $SCREEN = $default_screen; } } else { $SCREEN = $default_screen; } if($SCREEN == 'main.php') { $SCREEN = 'home.php'; $_REQUEST['SCREEN'] = $SCREEN; } include (SCREEN_DIR . /$template); ? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: E-Commerce II
Jimmy wrote: ...they both charge monthly fees for using their E-Commerce Tools. Why? I thought it should be a one time thing? Or are they not providing code, just letting us use the code via Explorer and Frontpage? 2. If I were to look for a website hoster, any recommendations? Many open source programs give away the software but charge for customizing and support, which is perfectly fair. There will be issues in the future with new technology and security issues discovered that will need maintenance. I'd suggest getting a custom web site designed that uses a really solid secure professional proprietary payment system separately as a plug-in. You can pay to add shopping cart features as needed but the payment needs to be consistently flawless. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] New Line code question \r\n etc.
I've got a php application running on a Unix system and need some help with the new line code. The application reads and saves text in a file from a browser textarea. Also, the text file is occassionally opened and edited via ftp and a regular plain text editor. It appears the new line code is getting screwed up because of the different programs handling the text. [i.e. \r\n, \n, \r] I'd like to have my code clean up the newline code every pass and standardize it. What new line should I use, \n Unix, or what? Thanks. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] PHP and Kerberos5 Single Sign-on
I'm trying to figure out a solution to a problem that my manager has brought to my attention, and that is how to we provide single sign-on (SSO) for our Intranet applications without being forced to use IIS. We are using Active Directory services for LDAP and Kerberos authentication, but are unable to get any server other than one running IIS to be configured to automatically detect who the user is with their AD login. Here is my setup: * Windows 2000 Server with Active Directory (ad1.mynetwork.org) * Windows 2000 Server with IIS and PHP (iis1.mynetwork.org) * Red Hat Enterprise Linux 3 ES with Apache 2 and PHP (linux1.mynetwork.org) I can get the Linux server to talk to Active Directory through LDAP and Kerberos, but to achieve SSO the only way to get it to work on Apache is with mod_auth_gss_krb5 (though I can't seem to get it to build for Apache2), and I couldn't find anything that would do the same with PHP. Any ideas? -- Ricky Boone [EMAIL PROTECTED] Planetfurry.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] imagecreate undefined...?
I've got this fairly simply script: ?php // create a 100*30 image $im = imagecreate( 100, 100 ); // white background and blue text $bg = imagecolorallocate($im, 255, 255, 255); $textcolor = imagecolorallocate($im, 0, 0, 255); // write the string at the top left imagestring($im, 5, 0, 0, Hello world!, $textcolor); // output the image header(Content-type: image/jpg); imagejpeg($im); ? However, when I run it, I get an error: Fatal error: Call to undefined function: imagecreate() in [file name] on line 3 I am running under MacOSX 10.3.2 and PHP 4.3.2. Is there anything I should look for in the phpinfo()? Any suggestions on how to fix the problem? Thank you. -- == Eric Gorr = http://www.ericgorr.net = ICQ:9293199 === Therefore the considerations of the intelligent always include both benefit and harm. - Sun Tzu == Insults, like violence, are the last refuge of the incompetent... === -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] imagecreate undefined...?
Hello Eric, Friday, February 13, 2004, 4:00:02 PM, you wrote: E Fatal error: Call to undefined function: imagecreate() in [file name] on line 3 E I am running under MacOSX 10.3.2 and PHP 4.3.2. Sounds very much like you have PHP without the image library compiled into it. I don't know where to obtain that lib for the Mac, sorry - but I'm sure someone will. -- Best regards, Richardmailto:[EMAIL PROTECTED] http://www.phpcommunity.org/wiki/296.html -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] New Line code question \r\n etc.
Al wrote: [snip...] I'd like to have my code clean up the newline code every pass and standardize it. What new line should I use, \n Unix, or what? Yes, \n is the line separator for Unix. Best Bao Thanks. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Uploading, and excuting.
In the last week or 2, ive been reading a lot about servers been getting abused. Scripts uploaded to /tmp I've noticed someone trying to do this on my server so I checked all logs. Nothing found. Suexec didn't pick anything up so im guessing it could be from a php script. Im in the process now of installing phpsuexec but has anything else had this problem or know any docs I can read up on this issue? Thanx Chris Sandy NetCarrier Inc. 1.888.575.4754 ex 3227 [EMAIL PROTECTED] http://www.netcarrier.com
[PHP] mycrypt 3des (php vs .net)
Hi all, I am truly hoping that someone can help with this. I am making the ecommerce site for a product that I had nothing to do with the development of. =) The product is making a licence file using the .net 3des, but I am not able to get the same output using the mcrypt 3des. this is the .net original text and the cipher text: Golf Genie 5.0 ª:b#æa[EMAIL PROTECTED]#p0, 7 this is what i get ¿^U`ÎdÀ4`oãõwÑî% - from Golf Genie 5.0 ¿^U`ÎdÀ4!é$GIø - from Golf Genie 5.0\r\n I don't know too much about encyrption, and I have found the documentation of mcrypt to be the worst of any php module I have yet used, so i'm not sure of the consequenses of using cbc versus ecb are, etc. here is the code i am using. $key = \x6B\x00\x64\x00\x4E\x00\x44\x00\x38\x00\x37\x00\x5E\x00\x21\x00; $input = Golf Genie 5.0; $iv = \x2B\x00\x5F\x00\x65\x00\x6B\x00; $td = mcrypt_module_open ('tripledes', '', 'cbc', ''); mcrypt_generic_init ($td, $key, $iv); $encrypted_data = mcrypt_generic ($td, $input); mcrypt_module_close ($td); echo $encrypted_data; ps. I can't use mcrypt_generic_deinit - i get 'Fatal error: Call to undefined function: mcrypt_generic_deinit()... ' thanks in advance, Craig -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: mycrypt 3des (php vs .net)
I am not sure if it will help of if you have already tried this but try all of the cipher modes available for the tripledes cipher (eg. cfb, ecb, etc.). There may be a difference in the way .net and mcrypt produces the cipher text but if that were the case then it wouldn't be a true tripledes encryption for either the .net or mcrypt encryption libraries. Are you able to view the source of the .net code which originally produced the cipher text? If so then see what mode it is using with the tripledes cipher. And you are right about the documentation, it took me awhile to get it working and even longer to figure out how it worked. Good luck, Jas Craig wrote: Hi all, I am truly hoping that someone can help with this. I am making the ecommerce site for a product that I had nothing to do with the development of. =) The product is making a licence file using the .net 3des, but I am not able to get the same output using the mcrypt 3des. this is the .net original text and the cipher text: Golf Genie 5.0 :b#a[EMAIL PROTECTED]#p0, 7 this is what i get ^U`d4`ow% - from Golf Genie 5.0 ^U`d4!$GI - from Golf Genie 5.0\r\n I don't know too much about encyrption, and I have found the documentation of mcrypt to be the worst of any php module I have yet used, so i'm not sure of the consequenses of using cbc versus ecb are, etc. here is the code i am using. $key = \x6B\x00\x64\x00\x4E\x00\x44\x00\x38\x00\x37\x00\x5E\x00\x21\x00; $input = Golf Genie 5.0; $iv = \x2B\x00\x5F\x00\x65\x00\x6B\x00; $td = mcrypt_module_open ('tripledes', '', 'cbc', ''); mcrypt_generic_init ($td, $key, $iv); $encrypted_data = mcrypt_generic ($td, $input); mcrypt_module_close ($td); echo $encrypted_data; ps. I can't use mcrypt_generic_deinit - i get 'Fatal error: Call to undefined function: mcrypt_generic_deinit()... ' thanks in advance, Craig -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Re: mycrypt 3des (php vs .net)
I am not sure if it will help of if you have already tried this but try all of the cipher modes available for the tripledes cipher (eg. cfb, ecb, etc.). There may be a difference in the way .net and mcrypt produces the cipher text but if that were the case then it wouldn't be a true tripledes encryption for either the .net or mcrypt encryption libraries. Are you able to view the source of the .net code which originally produced the cipher text? If so then see what mode it is using with the tripledes cipher. And you are right about the documentation, it took me awhile to get it working and even longer to figure out how it worked. Good luck, Jas I did check out the .net documentation and it uses cbc, but maybe I'll try the other modes for kicks. -Craig Craig wrote: Hi all, I am truly hoping that someone can help with this. I am making the ecommerce site for a product that I had nothing to do with the development of. =) The product is making a licence file using the .net 3des, but I am not able to get the same output using the mcrypt 3des. this is the .net original text and the cipher text: Golf Genie 5.0 :b#a[EMAIL PROTECTED]#p0, 7 this is what i get ^U`d4`ow% - from Golf Genie 5.0 ^U`d4!$GI - from Golf Genie 5.0\r\n I don't know too much about encyrption, and I have found the documentation of mcrypt to be the worst of any php module I have yet used, so i'm not sure of the consequenses of using cbc versus ecb are, etc. here is the code i am using. $key = \x6B\x00\x64\x00\x4E\x00\x44\x00\x38\x00\x37\x00\x5E\x00\x21\x00; $input = Golf Genie 5.0; $iv = \x2B\x00\x5F\x00\x65\x00\x6B\x00; $td = mcrypt_module_open ('tripledes', '', 'cbc', ''); mcrypt_generic_init ($td, $key, $iv); $encrypted_data = mcrypt_generic ($td, $input); mcrypt_module_close ($td); echo $encrypted_data; ps. I can't use mcrypt_generic_deinit - i get 'Fatal error: Call to undefined function: mcrypt_generic_deinit()... ' thanks in advance, Craig -- 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: date() funtion language
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 ohhh thanks hehe Don Read wrote: On 12-Feb-2004 André Cerqueira wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 i had problems with locale i think its safer to make a dayname and monthname array, and use getdate(), than build the string yourself snip //the follow should, but doesnt seem to work //setlocale(LC_ALL, 'pt_BR'); //echo date('l, j de F de Y'); ? date() doesn't format according to locale but strftime() does: setlocale(LC_ALL, 'pt_BR.ISO8859-1'); echo strftime('%A, %B %e %Y'); // output 'Quinta Feira, Fevereiro 12 2004' -BEGIN PGP SIGNATURE- Version: GnuPG v1.2.4 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFALQ4vaxdA/5C8vH8RAullAKDRwh4XpJg/lbZymdgW2fI+C2XbHwCfT5E+ 6kGxyTlAnBjWvZGy1XT5YSY= =mYsa -END PGP SIGNATURE- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] $_POST getting lost, $GLOBALS['HTTP_RAW_POST_DATA'] is still set
Hi All, I originally posted this on 2004-02-09, to alt.comp.lang.php, alt.php, and comp.lang.php, with the followup-to header set to comp.lang.php. Nobody had any thoughts, so I thought I would post here, just in case. I want to turn off magic quotes. I realize in retrospect that using a .htaccess file to turn magic quotes would probably be better than this code, and I am going to switch to that solution, but I am still trying to figure out what is causing my current problem: I am using the following code to automatically strip out any slashes that were added automagically by gpc_magic_quotes: $_POST = array_stripslashes($_POST); // Takes the passed array, and strips and escaping slashes out of any strings in the array. // This is a recursive function capable of handling multidimensional arrays function array_stripslashes($data) { do{ $pair = each($data);// Get the next key-value pair from the array if($pair === false) break; $key = $pair[0];// This is just for readability $val = $pair[1]; if(is_array($val)) $val = Utility::array_stripslashes($val); elseif(is_string($val)) $val = stripslashes($val); $data[$key] = $val; }while(true); return $data; } Now, I test it several times and it appears to be working fine. But, I just got an error report from a user, with agent Mozilla/4.0 (compatible; MSIE 5.0; CS 2000 6.0; Windows 98; DigExt), and when they clicked on a submit button, all the POST data was lost. Interestingly enough, $GLOBALS['HTTP_RAW_POST_DATA'] was populated with all the form fields I would have expected to be in $_POST (although raw, of course, not parsed into variables). Is my code broken? Or is this a bug in PHP? Or what? Sincerely, -Josh -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: date() funtion language
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 hmz... i just tryed that... didnt work tryed other locale strings, didnt work... do i need something else to make it work? running php4.3.4rc3 on windows Don Read wrote: On 12-Feb-2004 André Cerqueira wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 i had problems with locale i think its safer to make a dayname and monthname array, and use getdate(), than build the string yourself snip //the follow should, but doesnt seem to work //setlocale(LC_ALL, 'pt_BR'); //echo date('l, j de F de Y'); ? date() doesn't format according to locale but strftime() does: setlocale(LC_ALL, 'pt_BR.ISO8859-1'); echo strftime('%A, %B %e %Y'); // output 'Quinta Feira, Fevereiro 12 2004' -BEGIN PGP SIGNATURE- Version: GnuPG v1.2.4 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFALQ73axdA/5C8vH8RAt+IAKCuAH1hlInsMdcwkNvFmJy119YC/ACg0uws uvW3FtqgRSXl5VkOcPVgTls= =3cMI -END PGP SIGNATURE- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] $_POST getting lost, $GLOBALS['HTTP_RAW_POST_DATA'] is still set
On Fri, 2004-02-13 at 11:38, Joshua Beall wrote: I want to turn off magic quotes. I realize in retrospect that using a .htaccess file to turn magic quotes would probably be better than this code, and I am going to switch to that solution, but I am still trying to figure out what is causing my current problem: Having a function to undo magic quotes can be very useful if you distribute your application. Here is what I use, just call disable_magic_quotes(). It should not do any damage if magic_quotes is already disabled. /* Undo damage caused by magic quotes */ function remove_magic_quotes($vars,$suffix = '') { eval(\$vars_val = \$GLOBALS['$vars']$suffix;); if (is_array($vars_val)) { foreach ($vars_val as $key = $val) { remove_magic_quotes($vars, $suffix . ['$key']); } } else if (!is_object($vars_val)) { $vars_val = stripslashes($vars_val); eval(\$GLOBALS['$vars']$suffix = \$vars_val;); } } // Defeat magic quotes function disable_magic_quotes() { if (get_magic_quotes_gpc()) { remove_magic_quotes('_GET'); remove_magic_quotes('_POST'); remove_magic_quotes('_COOKIE'); ini_set('magic_quotes_gpc',0); } set_magic_quotes_runtime(0); } -- Adam Bregenzer [EMAIL PROTECTED] http://adam.bregenzer.net/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: $_POST getting lost, $GLOBALS['HTTP_RAW_POST_DATA'] isstill set
Adam Bregenzer [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Having a function to undo magic quotes can be very useful if you distribute your application. Here is what I use, just call disable_magic_quotes(). It should not do any damage if magic_quotes is already disabled. snipped code Looks pretty good to me, and it is a little more robust than my solution since it checks for the existence of objects, and also sets the magic_quotes_gpc ini setting to 0 after escaping them. However, I am still interested in knowing if my code is broken in any way. It seems to work fine for me, but as per my original post, I did get this one odd behavior, with HTTP_RAW_POST_DATA being set, but _POST being an empty array. Any thoughts? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: $_POST getting lost, $GLOBALS['HTTP_RAW_POST_DATA'] isstill set
On Fri, 2004-02-13 at 12:14, Joshua Beall wrote: However, I am still interested in knowing if my code is broken in any way. It seems to work fine for me, but as per my original post, I did get this one odd behavior, with HTTP_RAW_POST_DATA being set, but _POST being an empty array. Any thoughts? Honestly, I didn't see anything glaringly wrong so I deftly skirted your problem by posting code that I find works. :) One part that may be an issue is you are using each() on $data then re-assigning the stripped code to $data, maybe that is exposing some bug/issue with php? Try making a new array by assigning the stripped output to $data2 and returning $data2, maybe that will solve it. -- Adam Bregenzer [EMAIL PROTECTED] http://adam.bregenzer.net/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Constant PHP_OS and Mac Server
I dont have a Mac handy to get the value of the constant PHP_OS. If anyone has access to a Mac, please reply to me with the output of var_dump( PHP_OS ); Thanks -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: mycrypt 3des (php vs .net)
Craig, If that doesn't work I am almost certain there might be a discrepency in how the .net mcrypt libraries actually employ the triple des cipher. On another note, I couldn't get the mcrypt_deinit function to work without error as well. One thing you could do is use the PHP unset() call to unlink your variables once data has been passed through your cipher. I would post your problem to the developers of the mcrypt app at mcrypt.sourceforge.net, I have talked with the guys over there and have always gotten help. I am sure they would want to know about this as well. HTH Jas Craig wrote: I am not sure if it will help of if you have already tried this but try all of the cipher modes available for the tripledes cipher (eg. cfb, ecb, etc.). There may be a difference in the way .net and mcrypt produces the cipher text but if that were the case then it wouldn't be a true tripledes encryption for either the .net or mcrypt encryption libraries. Are you able to view the source of the .net code which originally produced the cipher text? If so then see what mode it is using with the tripledes cipher. And you are right about the documentation, it took me awhile to get it working and even longer to figure out how it worked. Good luck, Jas I did check out the .net documentation and it uses cbc, but maybe I'll try the other modes for kicks. -Craig Craig wrote: Hi all, I am truly hoping that someone can help with this. I am making the ecommerce site for a product that I had nothing to do with the development of. =) The product is making a licence file using the .net 3des, but I am not able to get the same output using the mcrypt 3des. this is the .net original text and the cipher text: Golf Genie 5.0 :b#a[EMAIL PROTECTED]#p0, 7 this is what i get ^U`d4`ow% - from Golf Genie 5.0 ^U`d4!$GI - from Golf Genie 5.0\r\n I don't know too much about encyrption, and I have found the documentation of mcrypt to be the worst of any php module I have yet used, so i'm not sure of the consequenses of using cbc versus ecb are, etc. here is the code i am using. $key = \x6B\x00\x64\x00\x4E\x00\x44\x00\x38\x00\x37\x00\x5E\x00\x21\x00; $input = Golf Genie 5.0; $iv = \x2B\x00\x5F\x00\x65\x00\x6B\x00; $td = mcrypt_module_open ('tripledes', '', 'cbc', ''); mcrypt_generic_init ($td, $key, $iv); $encrypted_data = mcrypt_generic ($td, $input); mcrypt_module_close ($td); echo $encrypted_data; ps. I can't use mcrypt_generic_deinit - i get 'Fatal error: Call to undefined function: mcrypt_generic_deinit()... ' thanks in advance, Craig -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP and Kerberos5 Single Sign-on
On Fri, 2004-02-13 at 10:34, Ricky Boone wrote: I can get the Linux server to talk to Active Directory through LDAP and Kerberos, but to achieve SSO the only way to get it to work on Apache is with mod_auth_gss_krb5 (though I can't seem to get it to build for Apache2), and I couldn't find anything that would do the same with PHP. PHP supports ldap[1] which should allow you to talk to Active Directory, also there is mod_auth_kerb[2] for kerberos authentication. If you are against using an apache module for kerberos you can try using pam_auth[3] in PHP with a kerberos module for pam. I do not think PHP supports kerberos natively, though you could hack together an extension for it if you were motivated enough. :) [1] http://www.php.net/ldap [2] http://modauthkerb.sourceforge.net/ [3] http://www.math.ohio-state.edu/~ccunning/pam_auth/ -- Adam Bregenzer [EMAIL PROTECTED] http://adam.bregenzer.net/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Re: $_POST getting lost, $GLOBALS['HTTP_RAW_POST_DATA']isstill set
Adam Bregenzer [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Honestly, I didn't see anything glaringly wrong so I deftly skirted your problem by posting code that I find works. :) Hmm, I would probably have done the same :-) One part that may be an issue is you are using each() on $data then re-assigning the stripped code to $data, maybe that is exposing some bug/issue with php? Try making a new array by assigning the stripped output to $data2 and returning $data2, maybe that will solve it. Interesting idea. The only problem is testing it... since it seems to work fine for me except for this one error report I got, I am not sure what to do. Guess it is worth a shot to change it anyway. Could not hurt, right? And assuming garbage collection works ok in PHP, it should not be really be a memory hit, since both $data and $data2 should both be reclaimed when they go out of scope. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] preg guru question
Im trying to scan a file and lift the image name from the img tag ie img src=THISBIT.ext where there could be ' or I messed around but am 2 embarassed to post code cos it dont work ;-( thanks in advance pete -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: PHP License question
I spoke with the good folks over at the FSF, and figured out how to do this. The PHP License itself does not restrict the use code under it. The problem was with the GPL, which restricted the use of code under the GPL being paired with code under certain types of licenses (specifically licenses that are non-copyleft). The PHP license is non-copyleft, and, so, it is not GPL compatible. Thus, an exception must be made by the copyright owner of the GPL'd code. The wording for the exception is found at http://www.gnu.org/licenses/gpl-faq.html#GPLIncompatibleLibs . Specifically, in this case, I chose to use the following wording, and the folks at FSF told me this was fine: snip In addition, as a special exception, Ben Ramsey gives permission to link the code of this program with those files in the PEAR library that are licensed under the PHP License (or with modified versions of those files that use the same license as those files), and distribute linked combinations including the two. You must obey the GNU General Public License in all respects for all of the code used other than those files in the PEAR library that are licensed under the PHP License. If you modify this file, you may extend this exception to your version of the file, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. /snip Since certain PEAR packages are licensed under the modified BSD and LGPL licenses, then this exception does not need to be made for those packages; these licenses are already GPL compatible. Thus, I can release my application under the GPL and satisfy its requirements to include the PEAR packages licensed under the PHP license. I hope this helps someone else out there, as well. ;-) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] compile problem
Hi, trying to compile PHP 4.3.4. on RedHat Linux 7.3 and getting the following error: checking for CURL support... yes checking for CURL in default path... found in /usr checking for cURL 7.9.8 or greater... configure: error: cURL version 7.9.8 or later is required to compile php with cURL support I am compiling with the --with-curl option AND I have curl 7.10.4 installed. Any ideas? Thanks, Don -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] preg guru question
On Saturday 14 February 2004 02:25, pete M wrote: Im trying to scan a file and lift the image name from the img tag ie img src=THISBIT.ext where there could be ' or I messed around but am 2 embarassed to post code cos it dont work ;-( It's always better to post something no matter how bad you may think it is. It shows that you have at least tried to solve your own problem and are not merely trying to earn your keep by asking others to do your work for you. Here's something to get you started: $doo[1] = 'img src=dah.jpg'; $doo[2] = img src='doo.jpg'; foreach ($doo as $dah) { if (preg_match('/img src=[|\'](.*)\.(.*)[|\']/i', $dah, $matches)) { print_r($matches); } } You may want to refine it so that it will recognise less than perfectly formed img tags. -- Jason Wong - Gremlins Associates - www.gremlins.biz Open Source Software Systems Integrators * Web Design Hosting * Internet Intranet Applications Development * -- Search the list archives before you post http://marc.theaimsgroup.com/?l=php-general -- /* Knowledge, sir, should be free to all! -- Harry Mudd, I, Mudd, stardate 4513.3 */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: PHP License question
On Friday 13 February 2004 01:27 pm, Ben Ramsey wrote: snip In addition, as a special exception, Ben Ramsey gives permission to link the code of this program with those files in the PEAR library that are licensed under the PHP License (or with modified versions of those files that use the same license as those files), and distribute linked combinations including the two. You must obey the GNU General Public License in all respects for all of the code used other than those files in the PEAR library that are licensed under the PHP License. If you modify this file, you may extend this exception to your version of the file, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. /snip Since certain PEAR packages are licensed under the modified BSD and LGPL licenses, then this exception does not need to be made for those packages; these licenses are already GPL compatible. Thus, I can release my application under the GPL and satisfy its requirements to include the PEAR packages licensed under the PHP license. So to clarify. If I have a piece of code that utilises PEAR's Tar class (which uses a PHP License). In order for me to distribute my piece of code (under the GPL) along with the Tar class, I have to include this exception along with the normal GPL'ed notice in my code? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: PHP License question
Yup. I believe that's what you have to do in order to satisfy the restrictions in the GPL. Gerard Samuel wrote: So to clarify. If I have a piece of code that utilises PEAR's Tar class (which uses a PHP License). In order for me to distribute my piece of code (under the GPL) along with the Tar class, I have to include this exception along with the normal GPL'ed notice in my code? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] preg guru question
On Sat, Feb 14, 2004 at 03:05:40AM +0800, Jason Wong wrote: $doo[1] = 'img src=dah.jpg'; $doo[2] = img src='doo.jpg'; foreach ($doo as $dah) { if (preg_match('/img src=[|\'](.*)\.(.*)[|\']/i', $dah, $matches)) { print_r($matches); } } Note that characters within square brackets don't need to have the | to separate them; it's a character class, so it will match any character within the brackets: if (preg_match('/img src=[\'](.*)\.(.*)[\']/i', $dah, $matches)) { Also, it's probably good to put a non-greedy modifier after the *s to prevent .* from matching too much. Compare: ? $doo[1] = 'img src=dah.jpgimg src=blah.jpg'; $doo[2] = img src='doo.jpg'; foreach ($doo as $dah) { if (preg_match('/img src=[\'](.*)\.(.*)[\']/i', $dah, $matches)) { print_r($matches); } # adding ? after the * if (preg_match('/img src=[\'](.*?)\.(.*?)[\']/ig', $dah, $matches)) { print_r($matches); } } ? 'Course, it still doesn't match multiple images in one line. preg_match_all() could probably help out there. joel -- [ joel boonstra | gospelcom.net ] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Another preg question
I'm trying to clean up newline code received from a browser textarea. First, I'm normalizing the newline codes to Unix with: $text= preg_replace(/(\r\n|\r)/, \n, $text); //this seems to work OK Next, I want to remove excessive CR/LF, [i.e. more than 2] $text= preg_replace(/\n\n+/, \n\n, $text); // remove excess This doesn't seem to do anything. Thanks. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] preg guru question
On Fri, Feb 13, 2004 at 02:19:11PM -0500, joel boonstra wrote: snip if (preg_match('/img src=[\'](.*?)\.(.*?)[\']/ig', $dah, $matches)) { print_r($matches); } Doh! The '/ig' should just be '/i'. joel -- [ joel boonstra | gospelcom.net ] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Another preg question
snip Next, I want to remove excessive CR/LF, [i.e. more than 2] $text= preg_replace(/\n\n+/, \n\n, $text); // remove excess This doesn't seem to do anything. /snip not 100% sure this is right but give it a try $text = preg_replace(/\n\n+|\n\r[\n\r]+|\r\r+/, \n\n, $text); -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] imagecreate undefined...?
On Fri, 2004-02-13 at 11:00, Eric wrote: However, when I run it, I get an error: Fatal error: Call to undefined function: imagecreate() in [file name] on line 3 Sound like your version was complied without GD support. http://www.php.net/manual/en/ref.image.php -- BrianGnuPG - KeyID: 0x04A4F0DC | URL: www.gfx-design.com/keys Key Server: pgp.mit.edu == gpg --keyserver pgp.mit.edu --recv-keys 04A4F0DC GnuPG: http://gnupg.org http://www.biglumber.com/x/web?qs=0x2C35011004A4F0DC Linux Registered User #339825 at http://counter.li.org -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] imagecreate undefined...?
Have you tried dynamically loading the GD functions; http://us2.php.net/manual/en/function.dl.php if (!extension_loaded('php_gd')) { if (strtoupper(substr(PHP_OS, 0, 3) == 'WIN')) { dl('php_gd.dll'); } else { dl('gd.so'); } } not sure all the names above are correct and you can eliminate a lot of stuff for Win/Linux installations if you are not targeting both versions. Warren Vail -Original Message- From: Richard Davey [mailto:[EMAIL PROTECTED] Sent: Friday, February 13, 2004 8:07 AM To: Eric Cc: [EMAIL PROTECTED] Subject: Re: [PHP] imagecreate undefined...? Hello Eric, Friday, February 13, 2004, 4:00:02 PM, you wrote: E Fatal error: Call to undefined function: imagecreate() in [file name] on line 3 E I am running under MacOSX 10.3.2 and PHP 4.3.2. Sounds very much like you have PHP without the image library compiled into it. I don't know where to obtain that lib for the Mac, sorry - but I'm sure someone will. -- Best regards, Richardmailto:[EMAIL PROTECTED] http://www.phpcommunity.org/wiki/296.html -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Browser Detection another page
[EMAIL PROTECTED] wrote: Before you read my comments below, let me say that I'm not trying to prove you *wrong* or even express disagreement with the points you made; I'm just interested in your reasons. An interesting topic, but the OP was checking if the client was a PDA. Maybe it's just me, but I feel that serving a site that wasn't designed for viewing on PDAs to PDAs is generally a bad thing. -- Stuart -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Browser Detection another page
On Fri, Feb 13, 2004 at 08:01:00PM +, Stuart wrote: [EMAIL PROTECTED] wrote: Before you read my comments below, let me say that I'm not trying to prove you *wrong* or even express disagreement with the points you made; I'm just interested in your reasons. An interesting topic, but the OP was checking if the client was a PDA. Maybe it's just me, but I feel that serving a site that wasn't designed for viewing on PDAs to PDAs is generally a bad thing. True, PDAs can't generally handle the same size/number of graphics that a desktop browser can. But what about the Treo? The Sidekick? The Zaurus? Do those get browser-detected as well? Or will they still get the same designed-for-desktop site that all non-WinCE devices get? As an alternative, use the same (X)HTML, and design an alternate stylesheet for handhelds, using the CSS media type options: http://www.w3.org/TR/REC-CSS2/media.html#media-types Now you can maintain the same content, and just have two different stylesheets. 'Course, this is the ideal; it's probably the case that not all handheld browsers recognize media=handheld like they should. Perhaps the @import rule trick will work, as well. There is some discussion on alistapart: http://www.alistapart.com/articles/slashdot2/ about handheld emulators, and how XHTML/CSS-designed sites appear on them. However, this is way way OT now, and should probably be carried on offlist. Or, better yet, I bet css-discuss can provide tips for using CSS to support handheld browsers, without having to duplicate content or do browser sniffing. -- [ joel boonstra | gospelcom.net ] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] [Q]PHP not taking input values from forms
when i run that, it doesn't show return anything. I really don't understand what's going on with php. I know it's working fine, it's just not returning anything. Even scripts that I KNOW for a fact should be working (i.e. they work for everyone else), don't work for me. Any other ideas? I REALLY need to get this running, and it's upsetting because I don't get what's going on. TIA. From: Vail, Warren [EMAIL PROTECTED] To: 'Philip Olson' [EMAIL PROTECTED],Dan Aloma [EMAIL PROTECTED] CC: [EMAIL PROTECTED], [EMAIL PROTECTED] Subject: RE: [PHP] [Q]PHP not taking input values from forms Date: Thu, 12 Feb 2004 14:03:05 -0800 Suggestion, Stick the following line of code in a spot in the php code that gets control from the form submit and see what is actually being passed from the form; foreach($_POST as $k = $v) echo POST[.$k.] = [.$v.]br; see if this shows you what you are looking for. NOTE: if you are not using the form POST method, change all instances of POST to GET in the statement. good luck, Warren Vail -Original Message- From: Philip Olson [mailto:[EMAIL PROTECTED] Sent: Thursday, February 12, 2004 1:55 PM To: Dan Aloma Cc: [EMAIL PROTECTED]; [EMAIL PROTECTED] Subject: Re: [PHP] [Q]PHP not taking input values from forms that tag is working fine and shows me the info. For some reason php will take input values only from the URL, not from the html code. any ideas? A few questions: a) What's the exact version of PHP? b) Please post the smallest possible form that creates this problem. c) And how are you attempting to access these form values? If you're interested in some working examples and related information, have a look at the following manual page: http://www.php.net/variables.external Thanks for the suggestions, first of all. I tried that exact code from the code you included and I cut and pasted the Simple HTML Form, and below that I pasted the Accessing Data... php code. When I go to the page, all it does after I hit the submit button with data in the fields, is say no input file specified. But when I run it through the url giving the input names with values, it returns them. I tried getting it working with like ten people so far, and no one's been able to figure out... I am running PHP 4.3.4, btw. Be sure you rename the action part of the simple html form to whatever page you are using, instead of foo.php, as otherwise it will literally attempt to access foo.php I'm guessing this is what's happening by seeing no input file specified. Either fix that or on that same manual page is the example titled More complex form variables, this prints to itself as it demonstrates a use of the popular $_SERVER['PHP_SELF'] variable. Also, it's important you realize the difference between POST and GET, and how to access them, so you may want to read that manual page too. (hint: GET is through the URL's QUERY_STRING (the stuff after the ?) while POST is not). Regards, Philip -- 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 _ Keep up with high-tech trends here at Hook'd on Technology. http://special.msn.com/msnbc/hookedontech.armx -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] compile problem
The --with-curl directive can also take a directory (--with-curl=[DIR}). Try passing in the directory where cURL is installed to. (I am not sure where this is since you didn't mention whether cURL is installed on your system via RPM or if you did it from source). Good luck! --Sam Donpro wrote: Hi, trying to compile PHP 4.3.4. on RedHat Linux 7.3 and getting the following error: checking for CURL support... yes checking for CURL in default path... found in /usr checking for cURL 7.9.8 or greater... configure: error: cURL version 7.9.8 or later is required to compile php with cURL support I am compiling with the --with-curl option AND I have curl 7.10.4 installed. Any ideas? Thanks, Don -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] What PHP function can detect session being expired??
Hi! When I set the session.cache_expire to 60 minutes then on the webpage, how do I get PHP to tell me that session had expired via PHP function or something? Thanks, Scott F. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] PHP 4.3.4 ftp_rawlist null output
Hi... I search about this and found different answers but not a clear one. Somebody talk about a PHP bug, other that it's solved in 4.3.4. I installer PHP 4.3.4 (without ftp-support) and Apache 2.0.48 on Solaris 8, the /tmp dir permission are 777. Time after that I compilled ftp.so module and included it in php.ini. Then I wrote a script (ftp.php) that connects OK, chdir OK, but when it try a ftp_rawlist the answer is . I try the same script in RedHat linux PHP 4.3.4 compilled with the same parameters and worked OK (the only differece was that the module ftp.so was compilled and installed at the same time as the rest of the PHP was). BTW... what is the right way to add a module after the compilation is already done (I mean... doing a make install does not look good on a running production environment)? What could be the problem with the PHP on Solaris? In the FTP log I get this.. (the LIST command is never issued) 10.2.0.10 UNKNOWN nobody [13/Feb/2004:17:29:08 -0300] 10.2.0.10 USER [EMAIL PROTECTED] 331 - 10.2.0.10 UNKNOWN [EMAIL PROTECTED] [13/Feb/2004:17:29:08 -0300] 10.2.0.10 UPASS (hidden) 230 - 10.2.0.10 UNKNOWN [EMAIL PROTECTED] [13/Feb/2004:17:29:08 -0300] 10.2.0.10 QUIT 221 - but if I do the same on Linux it works ok: 10.2.0.11 LIST / 226 381 Any help will be welcome. -- Federico Petronio [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] HTML: Make a TR/TD resize to fill a space?
Hello, I'm working on a webpage at http://hedges.org/busolemiss/template/index.html I need for a table cell to fill in the remaining space between some rows above and a row below, no matter what the window size. I thought this was possible with a height=*, but it doesn't work. If you look at the link above, specifically what I want to do is have the tr cell between Ole Miss Home and the logo repeat until the logo touches the bottom... How can I do this? thanks, Hedges -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] [Q] Howto go directly to a URL?
I have written a very straightforward user login script. Once the user successfully logs in, I would like my PHP script to take him directly to the home page. I know this sounds simple, but the only solution I've found is a function called do_html_url() from Welling and Thompson's book (see http://www.cs.indiana.edu/classes/a348/fall2001/labs/php9/do_html_url.html). When this function is invoked the user is dispatched to an intermediate web page on which is presented a link that, when clicked, will take the user to the intended page. Can I avoid that intermediate step, somehow? When my script logs in the user, how to I write the code that dispatches directly to the home page? Thanks, Cheers, Michael -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] HTML: Make a TR/TD resize to fill a space?
Matt Hedges mailto:[EMAIL PROTECTED] on Friday, February 13, 2004 1:00 PM said: I need for a table cell to fill in the remaining space between some rows above and a row below, no matter what the window size. I thought this was possible with a height=*, but it doesn't work. you should sign up at the webdesign-l (http://www.webdesign-l.com/) mailing list. it's meant for this sort of question. chris. p.s. maybe height=100% will do it? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] [Q] Howto go directly to a URL?
Try..., if($login == successful){ $url = yourin.php; } else{ $url = tryagain.php: } header(Location: $url); alex -Original Message- From: Michael T. Peterson [mailto:[EMAIL PROTECTED] Sent: Friday, February 13, 2004 3:03 PM To: [EMAIL PROTECTED] Subject: [PHP] [Q] Howto go directly to a URL? I have written a very straightforward user login script. Once the user successfully logs in, I would like my PHP script to take him directly to the home page. I know this sounds simple, but the only solution I've found is a function called do_html_url() from Welling and Thompson's book (see http://www.cs.indiana.edu/classes/a348/fall2001/labs/php9/do_html_url.html ). When this function is invoked the user is dispatched to an intermediate web page on which is presented a link that, when clicked, will take the user to the intended page. Can I avoid that intermediate step, somehow? When my script logs in the user, how to I write the code that dispatches directly to the home page? Thanks, Cheers, Michael -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php ** The contents of this e-mail and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom it is addressed. The views stated herein do not necessarily represent the view of the company. If you are not the intended recipient of this e-mail you may not copy, forward, disclose, or otherwise use it or any part of it in any form whatsoever. If you have received this e-mail in error please e-mail the sender. **
RE: [PHP] [Q] Howto go directly to a URL?
Michael T. Peterson mailto:[EMAIL PROTECTED] on Friday, February 13, 2004 1:03 PM said: I have written a very straightforward user login script. Once the user successfully logs in, I would like my PHP script to take him directly to the home page. [snip] Can I avoid that intermediate step, somehow? When my script logs in the user, how to I write the code that dispatches directly to the home page? Yes it's called redirecting. You do it via the HTTP headers. header(Location: http://www.FullyQualifiedDomainName.com/page.php;); You'll undoubtedly come across some errors when you first try this. Let me give you a hint and say.. TRUST THE ERROR(S) REPORTED BY PHP. chris. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] [Q] Howto go directly to a URL?
snip Can I avoid that intermediate step, somehow? When my script logs in the user, how to I write the code that dispatches directly to the home page? /snip Have you tried a redirect? http://www.php.net/header ?php header(Location: http://www.example.com/;); /* Redirect browser */ /* Make sure that code below does not get executed when we redirect. */ exit; ? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] [Q] Howto go directly to a URL?
Alex Hogan mailto:[EMAIL PROTECTED] on Friday, February 13, 2004 1:10 PM said: if($login == successful){ $url = yourin.php; } else{ $url = tryagain.php: } header(Location: $url); don't forget the rest of the url and don't forget to exit like matt said... i suggest defining a constant somewhere and including it (a configuarion file perhaps): define(WEB_ROOT, http://myhappydomain.com/;); it can then be used like: header(Location: .WEB_ROOT.$url); exit; you can even take it one step further and make a function out of it. function redirect($url) { header(Location: .WEB_ROOT.$url); exit; } use it thusly: redirect($url); hth, chris. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: syntax help
If you want to actually want the variables $flyertotal, $emailtotal, and $phonetotal, use the line: ${$array[0].total} = $row[0]; But as you defined $array, that will actually create the variables $Flyertotal, $Emailtotal, and $Phonetotal (note the caps). On 2/13/2004 6:10 AM, Bob pilly wrote: $array[$i].total=$row[0];-- problem here so for the above code i would like to create three variable $flyertotal,$emailtotal $phonetotal -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Linking to files in a mysql db
Hello all, I'm sorry to be asking such a simple question but I'm kind of new at this. how can I link to a file that is referenced in a mysql database. Dave -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Hard links
Hey, I was just going through the ioncube manual (thinking of making something like that, but much cheaper so everyone can afford itmaybe $20?) and came accross this: 3.5.1 Copying with Hard Links [--use-hard-links] The Encoder will normally perform a file copy into the target for non-encoded files. This is fast but performance can be improved and disc space saved by using the --use-hard-links option to copy by using hard links. This feature is only available with Unix encoders and only if the source and target files are on the same filesystem. My (simple) question is: What is hard links? never really heard of it and googles no help either. Am I missing something? Thanks, -Ryan -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] preg guru question
On Fri, 2004-02-13 at 13:25, pete M wrote: Im trying to scan a file and lift the image name from the img tag ie img src=THISBIT.ext where there could be ' or I messed around but am 2 embarassed to post code cos it dont work ;-( Always post code, it can help us understand what you are looking to do. Are you looking for a regexp? '/img\s+src=([\'])([^\1]+)\1\s*\/?\s*/i' -- Adam Bregenzer [EMAIL PROTECTED] http://adam.bregenzer.net/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] [Q]PHP not taking input values from forms
I'd try to insert a simple echo statement, and figure out why it's not returning anything. try a file named phpinfo.php snip-- ?php phpinfo(); ? snip--- if your web server implementation is correct that should work. good luck, Warren Vail -Original Message- From: Dan Aloma [mailto:[EMAIL PROTECTED] Sent: Friday, February 13, 2004 12:38 PM To: Vail, Warren Cc: [EMAIL PROTECTED] Subject: RE: [PHP] [Q]PHP not taking input values from forms when i run that, it doesn't show return anything. I really don't understand what's going on with php. I know it's working fine, it's just not returning anything. Even scripts that I KNOW for a fact should be working (i.e. they work for everyone else), don't work for me. Any other ideas? I REALLY need to get this running, and it's upsetting because I don't get what's going on. TIA. From: Vail, Warren [EMAIL PROTECTED] To: 'Philip Olson' [EMAIL PROTECTED],Dan Aloma [EMAIL PROTECTED] CC: [EMAIL PROTECTED], [EMAIL PROTECTED] Subject: RE: [PHP] [Q]PHP not taking input values from forms Date: Thu, 12 Feb 2004 14:03:05 -0800 Suggestion, Stick the following line of code in a spot in the php code that gets control from the form submit and see what is actually being passed from the form; foreach($_POST as $k = $v) echo POST[.$k.] = [.$v.]br; see if this shows you what you are looking for. NOTE: if you are not using the form POST method, change all instances of POST to GET in the statement. good luck, Warren Vail -Original Message- From: Philip Olson [mailto:[EMAIL PROTECTED] Sent: Thursday, February 12, 2004 1:55 PM To: Dan Aloma Cc: [EMAIL PROTECTED]; [EMAIL PROTECTED] Subject: Re: [PHP] [Q]PHP not taking input values from forms that tag is working fine and shows me the info. For some reason php will take input values only from the URL, not from the html code. any ideas? A few questions: a) What's the exact version of PHP? b) Please post the smallest possible form that creates this problem. c) And how are you attempting to access these form values? If you're interested in some working examples and related information, have a look at the following manual page: http://www.php.net/variables.external Thanks for the suggestions, first of all. I tried that exact code from the code you included and I cut and pasted the Simple HTML Form, and below that I pasted the Accessing Data... php code. When I go to the page, all it does after I hit the submit button with data in the fields, is say no input file specified. But when I run it through the url giving the input names with values, it returns them. I tried getting it working with like ten people so far, and no one's been able to figure out... I am running PHP 4.3.4, btw. Be sure you rename the action part of the simple html form to whatever page you are using, instead of foo.php, as otherwise it will literally attempt to access foo.php I'm guessing this is what's happening by seeing no input file specified. Either fix that or on that same manual page is the example titled More complex form variables, this prints to itself as it demonstrates a use of the popular $_SERVER['PHP_SELF'] variable. Also, it's important you realize the difference between POST and GET, and how to access them, so you may want to read that manual page too. (hint: GET is through the URL's QUERY_STRING (the stuff after the ?) while POST is not). Regards, Philip -- 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 _ Keep up with high-tech trends here at Hook'd on Technology. http://special.msn.com/msnbc/hookedontech.armx -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Hard links
Ryan A wrote: [snip...] the source and target files are on the same filesystem. My (simple) question is: What is hard links? never really heard of it and googles no help either. Am I missing something? A link is called hard link when its system-file-identifier (SFID) is added to the current directory entry. The opposite is called soft link or symbolic link, when only the path name is added to the direcotry entry. Best Bao Thanks, -Ryan -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: HTML: Make a TR/TD resize to fill a space?
table tr td style=border:1px solid black; valign=top topbrtopbrtop /td td style=border:1px solid black; rowspan=2 textbrtextbrtextbrtextbrtextbrtextbrtextbr /td /tr tr td style=border:1px solid black; valign=bottom bot /td /tr /table Matt Hedges wrote: Hello, I'm working on a webpage at http://hedges.org/busolemiss/template/index.html I need for a table cell to fill in the remaining space between some rows above and a row below, no matter what the window size. I thought this was possible with a height=*, but it doesn't work. If you look at the link above, specifically what I want to do is have the tr cell between Ole Miss Home and the logo repeat until the logo touches the bottom... How can I do this? thanks, Hedges -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] logo
begin 666 php5.jpg M_]C_X `02D9)[EMAIL PROTECTED]@$`2 !([EMAIL PROTECTED]@[EMAIL PROTECTED],` M```!``$```$:[EMAIL PROTECTED];``4!:@$H``,!``,```$Q M``(4@$R``(4AH=I``0!G ```,@ [EMAIL PROTECTED]AO=]S:]P(#N, `R,# T.C R.C$S(#(R.C4Q M.C [EMAIL PROTECTED]@[EMAIL PROTECTED]@`P`$`0```4 ` [EMAIL PROTECTED],!``8```$:[EMAIL PROTECTED];``4!```!'@$H M``,!``(```(!``0!```!)@(``0!```-(P!( [EMAIL PROTECTED] `02D9)[EMAIL PROTECTED]@$`2 !(``#_[0`,061O8F5?0TT``O_N M``Y!9]B90!D@ '_VP$``P( @) P)0P1PH+$14/# P/[EMAIL PROTECTED] [EMAIL PROTECTED] P,# P,$0P,# P,# P,# P,# P,# P,# P,# P,# P,# P!#0L+#0X- M$ [EMAIL PROTECTED] [EMAIL PROTECTED],# P,$1$,# P,# P1# P,# P,# P,# P,# P, M# P,# P,# P,# P,#/_ `!$(`( `@ ,!(@`$0$#$0'_W0`$``C_Q $_```! M!0$!`0$!`0`#``$! 4!P@)@L!``$%`0$!`0$!``$` M`@,$!08' D*Q ``00!`P([EMAIL PROTECTED]'!@@%`PPS`0`$0,$(1(Q!4%181,B8$R M!A21H;%(R054L%B,[EMAIL PROTECTED]:BLH,F1)-49$7HW0V%])5 MXF7RLX3#TW7C\T8GE*2%M)7$U.3TI;7%U7U5F9VAI:FML;6YO8W1U=G=X7 MI[?'U^?W$0`[EMAIL PROTECTED]! 0#! 4!P!34!``([EMAIL PROTECTED](A,%,H1%*Q M0B/!4M'P,R1BX7*DD-3%6-S-/$E!A:BLH,')C7TD235*,79$55-G1EXO*S MA,/3=/S1I2DA;25Q-3D]*6UQ=7E]59F=H:6IK;UN;V)S='5V=WAYGM\?_ [EMAIL PROTECTED],`P$``A$#$0`_`/54DDDE*4I2E*4I2E*2 M2224_P#_T/54DDDE*4I))965]9^B8UXQ?M'VC*=,8V(Q^3;I^_3ALOLJ M_KV[)*=5)81]8.HQ^I='OM?SLBVC9_:WW6Y/_LJAGK'UD!^I8%/CNR[ MK#_X'T]C?^FG$CLIZ!)ZK_61NOH=/?YOW_`*7V-Z;_`)Q==K/5Z15 M=7^[%SN/^MYU'3O\`SZC[_W2JWHTEAO^MW3:[\^G*P6=[+:765MUC]) MD87VO'K_`.N6JY?U[I573G]29D-R5FT!V,?7+G6.;5354W']3U++K7LKK:F MD$;BO-3H)+D^H=8ZR5.R['ZZ\%S,?TOM=H#=N_P!2\OKH]OJ,]7TL?TZW MOV?:;4^)];7XY/VS(HZCBTM#\K*QJWU64,.YKC(PW.R/[EMAIL PROTECTED]/ MLWHK;[EMAIL PROTECTED]U?R_SO#[7S?UT\)K2225E#_`/_1]54I M9'4O^EE/Z=TRC[?U*L,==7N].FAMA]K\[+VVCNK_2U8U5=^9=_W']+],H] M:ZE?]H9TG!ZK)N9ZN1EM:UPQZ)V-LVVU^5EV-=1AL_\,95GZ/$]ZH'8V% MCMQ\5GI4L)+6277'?8]]EA=9;;8]V^VZUWJ6/4N+$9GP033#)P#F!_[;RG9 M[7D'[(S=CXC0W\S[-4_ULOC_PWY37_P`!2IC*IQZ6X^.UM-#!#:J@, ' M9M=8:QJH79;WF J;LS')UOK$::O;_K^/E81`XJTR=-^=X(3LURS:\_!ML% M516ZP\-F?ZN[;N0NL9+L7IF1P[7AH:QW$%Q#-W]ANYZEX8B9;B(L_1K MJG+D,HKA/J7U;.SK\S+ZCEQC8M;[EMAIL PROTECTED]:,GR`3CV MMMV_2VG43XM^DFX9X\L;`X;Z'=1!#H-R2#()!\1HJE.-B7?6GIN06,9?71EW MX- ]S1C8S*WV?3L:RK+O?MANR*.+7VL:XM+@/C)5_/Q67T7TY%'VS [EMAIL PROTECTED];?\`!JO\3YYN3SXL@,DX,==Y? MN?X?R+HI E!]^FY_7N8_3\6W%5(:Y[;[X/LW9-]5U#.N][?1_F]_LV6 M(O\`BTRJ,JOJF/\`L^G-3Z19Z;2/598+C4V[L?L;OV;:Z_P!';]!+J?3/ MJKU_J(S_`+8[I/5ZH]J[TVN-H8/5QLO?C9+?3:UKG%?;C6L_TRG;UOZO_ M`%P,C#Z)_,R[7FW*S6D9+FOL_GW+R#Z6/D9%3-UE#2[?;[EMAIL PROTECTED](D [EMAIL PROTECTED],GW@$?9]O)CECEQ\::?RTS;'[EMAIL PROTECTED]J-AM;C.NQJK M#$FK'NNQ,?Z/_ [EMAIL PROTECTED]'Z:6G!KI8,9S'-=7M'IV;V_P`YZC?? MZG^$5M;P! `)XB!O^]XL;[EMAIL PROTECTED](WY^5:YS^YKQWOZ?B# M^HVC]1O_'6J-UQ5AG(/2C(Z4[3['D7,`/[EMAIL PROTECTED]'RJE?QLIMS9! M6ORP@(1K@L-VENM%--EQ,DQSY_JB5YGT7OZW]8AC59-F+2S=8Z^N26,J' MM?6WS])8X,[EMAIL PROTECTED],AY,3`^(!]0M_MGM7GOU8ZQ;T3..::M^ M/QV/:3(;!++=+M?[V/KJJ_.RBN.$M(@7+__]%3'8MOZW] HZ)E4V8-U MSJLAI)[EMAIL PROTECTED]@8UMK;5ZF^-W\TQ;?UBZM?;]3\QYF_-J#KG'OM_5GN_ZZY^ M]9/47Y?UPZRSZ:PO8S5]SI;[EMAIL PROTECTED]:QZMKMGJ?I\BQ_^DNJQD7Z^W8]% MF)T?$G[/@U,K;N^D0UNC[_O6^IZC_\`A5!Q`#,8K'*H#^7^,GM;+ZK_5?[ M7T?(ZAU#)OQ\[=Z=.X--OHAVZZY[Q8ST:K/T=;/2_2VK_`#/IJM]1*K!] M:6U5O+JZZ[P\CAS0QP;I_*N])=1F,_8_U+HQ[3L=7CU-L:=/=:3FW5?UM]CZ M5C?XO:V48G5^J/T=56RECO)V_(L_Z/CIPQB.3!I*ADF47H7+^L%V1U;ZRG [EMAIL PROTECTED]\BMKC_`%FDM'ZW?57'Z;@LZA1FY5D-*[K+R/TFAVVTM M'OHV;/YE]N1[/\(N?QHY.+UD=6Q6S['8+6AC7-I;ZCA]!K]S*M_\M;?7 M^OGZPC'Z=TVAUU]IAM58[:2=VQDAKKK7[;[EMAIL PROTECTED]')*?\` M.2/H'][IUT=_PHV59F?5MM=_O+=92S=[O;%=[?I?NNNA]?#F:@QMX\O@ [EMAIL PROTECTED]6FZR-VQWYS::F4T;F^RSTO46+]8,IKB6A7]8\ MO$2T-;+KVW^*SJ!R?JZ_= /3KWU,B2?3LC*JF?W?7?3_UI=DN(_P`4^^G MH63GO$#/R7H@@S72XN[^3^GKR%VZRY;GS7O__3]54\-_C#^JV1E#]N M=+9OR*F;[EMAIL PROTECTED]:KJX^G?BR_]'MWWT/\`^ [EMAIL PROTECTED]@KW%/ M];/\6]/4KK.H]%S$SK#OOH#Z-SR?=9+9^RWN_/LKKRY_\[7_A5-BS'D@ MBWDOK%5G]P*\7IU8M()^;*ZP#+-LF^RK\SU/HK4^JO3;NC]JP;P9%C[+ MLJJ66-W.(JK8[:;:+/T%%5G_`%QOEMZMT/)-U7'?AV_FBR[EMAIL PROTECTED];L M[Z?^#L5_^L#FP'%6L\LGNR-DBJ_10;JGKS8\L%[EMAIL PROTECTED];`UFY M2KR,BL;:[7L',-0/P7/U=?K/)5EO6J#^%;$\=4*KLMU=5MEC'[VNU_.X$ [EMAIL PROTECTED]'#\K(=M#.!H#O^G]CMW,9O\`@GK%'[P0;.NT@H M3,)1()JP8WUU5JT_J1T+J?0F9UG4*ACWY'I,I+;//IM]1]_\P^S:UUGV?Z: MZ!^8VECFM+:VO^FVMK:P[^OZ36;_`.VNR/KT [2L?-ZZ]W+ML\?\`5'YR [EMAIL PROTECTED]@(CU59XB-4ZEWI]::UI:PK'Z3TCJ/UGZH,+#.QHAV3DD$MIK/^$='T MKGQ^K4_X6S_@:[+%I]#^H/UAZVYM^8T],P7:^KV;G7*0^ZOZ/\YEG_I M4W+U+HW1.F]#P6X/3JO2I!+WDG][W?3NNL=[[;7_\`J/\`FU5SP9Z! V M,'!QGX=.#AUBKQVNJL=FM\S[G._[Z:.DDJR7__4]54I2/(Q M\?*I?CY-3+Z+!MLJL:'L/W7L?+7+EH?XK_`*K90G%KMZ=9).[L.TD_O49 M'KT;?^+KK77))72GS/(_Q1]0K83A]7KM?^:[EMAIL PROTECTED]'SMIN?_YX6?9_BU^N-0]I MP[C_`,'\?\`GW'8O7$DX9)#JJGR!O\`B\^NKC!IH9YNR 1_T*G*UC_XJ_K+ M98!E9N'1637ZMSO\QS,1O\`TUZJDC[D^ZJ`PO\46Q^[J/[EMAIL PROTECTED]XX M_M._6+=O]2UBZGI'U5^KW17FWIN#71=#[EMAIL PROTECTED]]UMVW^VM9)-))W*E))
Re: [PHP] Another preg question
Didn't work. I'm beginning to think the problem is more involved. I am going to break out just the essentials of the code that is involved and debug just it. Thanks Matt Matijevich wrote: snip Next, I want to remove excessive CR/LF, [i.e. more than 2] $text= preg_replace(/\n\n+/, \n\n, $text); // remove excess This doesn't seem to do anything. /snip not 100% sure this is right but give it a try $text = preg_replace(/\n\n+|\n\r[\n\r]+|\r\r+/, \n\n, $text); -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: compile problem
Try specifying the file path where cURL reside on.. Like this -- --with-curl=/usr//*** for example. Scott F. Donpro [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Hi, trying to compile PHP 4.3.4. on RedHat Linux 7.3 and getting the following error: checking for CURL support... yes checking for CURL in default path... found in /usr checking for cURL 7.9.8 or greater... configure: error: cURL version 7.9.8 or later is required to compile php with cURL support I am compiling with the --with-curl option AND I have curl 7.10.4 installed. Any ideas? Thanks, Don -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] logo
rostik mailto:[EMAIL PROTECTED] on Friday, February 13, 2004 12:53 PM said: please don't send attachments to the list. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] cli input and screen question(s)
Hi all of you, does someone know how to observe the keyboard input e.g. in a while loop so that I can do other stuff between two keypresses!? And is it possible to make a cli script responsable for special keys like cursor, function (F1, F2...) or Control/Alt-[somekey], PageUp/Down, Enter, Esc,...? The other problem is: I would like to draw a screen like midnight commander does. Is there a way to get that work with PHP ? How is it possible to clear the screen and to check out row nums and column nums from within PHP? Thanks in advance, regards, Matthias -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: cli input and screen question(s)
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 http://br.php.net/manual/en/intro-whatcando.php PHP is probably not the very best language to write windowing applications, but if you know PHP very well, and would like to use some advanced PHP features in your client-side applications you can also use PHP-GTK to write such programs. You also have the ability to write cross-platform applications this way. PHP-GTK is an extension to PHP, not available in the main distribution. If you are interested in PHP-GTK, visit its own website (http://gtk.php.net/). http://gtk.php.net/docs.php try: PHP-GTK Reference - GdkEvent - GdkEventKey are you aware of what php is, and what it was built for? Matthias Nothhaft wrote: Hi all of you, does someone know how to observe the keyboard input e.g. in a while loop so that I can do other stuff between two keypresses!? And is it possible to make a cli script responsable for special keys like cursor, function (F1, F2...) or Control/Alt-[somekey], PageUp/Down, Enter, Esc,...? The other problem is: I would like to draw a screen like midnight commander does. Is there a way to get that work with PHP ? How is it possible to clear the screen and to check out row nums and column nums from within PHP? Thanks in advance, regards, Matthias -BEGIN PGP SIGNATURE- Version: GnuPG v1.2.4 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFALW+yaxdA/5C8vH8RAqcCAJ9t/AyIj8vTZcoeDl9x/JFssWIH1gCgyfDd 7ZdChwZAfEIsAmKNO4Y3n0w= =hJH8 -END PGP SIGNATURE- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] cli input and screen question(s)
Hello Matthias, Friday, February 13, 2004, 11:25:41 PM, you wrote: MN does someone know how to observe the keyboard input MN e.g. in a while loop so that I can do other stuff MN between two keypresses!? MN And is it possible to make a cli script responsable MN for special keys like cursor, function (F1, F2...) MN or Control/Alt-[somekey], PageUp/Down, Enter, Esc,...? Did I subscribe to the Visual Basic list by accident or something? Matthias - PHP is not designed for any of the tasks you list. While there is the GTK interface, it's far from perfect and quite honestly you'd be better off spending your time looking at a language created for application development. Personally I'd recommend PureBasic (www.purebasic.com) for it's ultra tiny footprint, speed and Windows/Unix/Amiga support. -- Best regards, Richard Davey http://www.phpcommunity.org/wiki/296.html -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: preg guru question
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 did you post the same message 7 times? try: ? $subject = 'img src=THIS12BIT.ext'; $pattern = '/img[\s]+?src=[\'](.+?)[\'].*?/i'; $matchFound = preg_match_all ($pattern, $subject, $matches, PREG_SET_ORDER); print_r($matches); //$matches[$i][1] is what really matters ? that pattern may not be the best regex to use, but i think it works for most cases Pete M wrote: Im trying to scan a file and lift the image name from the img tag ie img src=THISBIT.ext where there could be ' or I messed around but am 2 embarassed to post code cos it dont work ;-( thanks in advance pete -BEGIN PGP SIGNATURE- Version: GnuPG v1.2.4 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFALXUxaxdA/5C8vH8RAtlAAKDUHsfEXVlKDZJRAg0I22rtpJxmsQCgjmze xBmlxQW6SbHMaHV+A/dGydA= =uxyA -END PGP SIGNATURE- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] cli input and screen question(s)
Matthias Nothhaft mailto:[EMAIL PROTECTED] on Friday, February 13, 2004 3:26 PM said: The other problem is: I would like to draw a screen like midnight commander does. Is there a way to get that work with PHP ? midnight commander? never heard of it. but you might want to look into something called ncurses. that will allow you do draw (textually) to the screen and keep track of where the cursor is, i.e. row/col position. hth, chris. p.s. i've never used ncurses, nor do i think it's a stand alone language... i think you have to write it in conjuction with perl or python or something like that... GOOD LUCK! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] cli input and screen question(s)
On Fri, 2004-02-13 at 18:25, Matthias Nothhaft wrote: The other problem is: I would like to draw a screen like midnight commander does. Is there a way to get that work with PHP ? Ahh, sounds like a Slackware fan. :) You want to look at ncurses[1] in PHP. This lets you draw on a screen. It does require a decent terminal interface but that should not be a problem. Also readline[2] may help you with reading input. [1] http://www.php.net/ncurses [2] http://www.php.net/readline -- Adam Bregenzer [EMAIL PROTECTED] http://adam.bregenzer.net/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Fedora FC1 + PHP 4.3.4 + phpMyAdmin 2.5.6 rc1 - Problems Resolving Included Files
Radi Shourbaji mailto:[EMAIL PROTECTED] on Friday, February 13, 2004 4:05 PM said: Hello All! I'm struggling to get phpMyAdmin working correctly on a new installation of Fedora FC1. What exactly are you having problems with? I would appreciate it if someone could walk me through the settings needed to allow phpMyAdmin to work in this environment. I installed phpMyAdmin recently on RH9 (pretty much the same thing as fedora right?) and I only had to make one configuration change in a file in the root of the phpmyadmin directory for it to work. How did you unpack it? Here's a from-memory version of what I did. # wget http://phpmyadminpackage.tar.gz # mv phpmyadmin*.gz /var/www/html # cd /var/www/html # tar xvzf phpmyadmin*.tar.gz This unpacks the package into all the correct directories. I then made my one configuration change and I was done. VOILA! Chris. p.s. don't cross post. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Hard links
BAO RuiXian wrote: Ryan A wrote: [snip...] the source and target files are on the same filesystem. My (simple) question is: What is hard links? never really heard of it and googles no help either. Am I missing something? A link is called hard link when its system-file-identifier (SFID) is added to the current directory entry. The opposite is called soft link or symbolic link, when only the path name is added to the direcotry entry. You can think of hard links as of reference variables in php: $a = 5; $b = $a; $b would be a hard link to $a. In fact they are completely equal, they are both references to the same memory location, if you unset $a, $b is still valid. The same goes with filesystem hardlinks - you can remove the original file (in fact you only unlink it) and the other hardlink is still valid. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] What PHP function can detect session being expired??
Scott Fletcher wrote: Hi! When I set the session.cache_expire to 60 minutes then on the webpage, how do I get PHP to tell me that session had expired via PHP function or something? Thanks, Scott F. None, but you can take care of the cleanout yourself. Than you have complete control over the process. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] What PHP function can detect session being expired??
Hello Scott, Friday, February 13, 2004, 8:43:59 PM, you wrote: SF When I set the session.cache_expire to 60 minutes then on the webpage, SF how do I get PHP to tell me that session had expired via PHP function or SF something? Check for the existence of the session - if it's not there, it's expired! There's no way to catch the event I don't believe, especially as it happens client side in a sense. Maybe with PHP5? -- Best regards, Richard Davey http://www.phpcommunity.org/wiki/296.html -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Linking to files in a mysql db
Hello David, Friday, February 13, 2004, 9:25:30 PM, you wrote: DEN how can I link to a file that is referenced in a mysql database. Depends what you mean by referenced in MySQL. If you have a URL that links to a file in your SQL table, then just turn it into an href. If the file is stored locally then it depends how you need to open it.. perhaps fopen or a socket stream. More info needed. -- Best regards, Richard Davey http://www.phpcommunity.org/wiki/296.html -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: [Q] Howto go directly to a URL?
if your do_login script doesn't require any cookies or session information you can just redirect right after auth: ?php //do_login.php $url = http://www.somewebsite.com;; //do stuff if($loggedin == true){ header(Location: . $url); } else{ //possible postback with get var error i.e: header(Location: do_login.php?error=failedLogin) } ? Michael T. Peterson [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] I have written a very straightforward user login script. Once the user successfully logs in, I would like my PHP script to take him directly to the home page. I know this sounds simple, but the only solution I've found is a function called do_html_url() from Welling and Thompson's book (see http://www.cs.indiana.edu/classes/a348/fall2001/labs/php9/do_html_url.html). When this function is invoked the user is dispatched to an intermediate web page on which is presented a link that, when clicked, will take the user to the intended page. Can I avoid that intermediate step, somehow? When my script logs in the user, how to I write the code that dispatches directly to the home page? Thanks, Cheers, Michael -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: [Q] Howto go directly to a URL?
Thanks for the quick response, everyone, but I was hoping for something other than redirect()/header(). As I understand them, these services require the complete URL and I'm simply dispatching to another page within my web site (in fact, within the same directory) i.e., I'm looking to use a path-relative URL. Cheers, Michael member_login_page - member_home_page rather than member_login_page - intermediate_page - member_home_page. Michael T. Peterson [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] I have written a very straightforward user login script. Once the user successfully logs in, I would like my PHP script to take him directly to the home page. I know this sounds simple, but the only solution I've found is a function called do_html_url() from Welling and Thompson's book (see http://www.cs.indiana.edu/classes/a348/fall2001/labs/php9/do_html_url.html). When this function is invoked the user is dispatched to an intermediate web page on which is presented a link that, when clicked, will take the user to the intended page. Can I avoid that intermediate step, somehow? When my script logs in the user, how to I write the code that dispatches directly to the home page? Thanks, Cheers, Michael -- 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: [Q] Howto go directly to a URL?
Hello Michael, Saturday, February 14, 2004, 3:20:48 AM, you wrote: MTP Thanks for the quick response, everyone, but I was hoping for something MTP other than redirect()/header(). As I understand them, these services Why? it's a transparent operation and the site visitor will never even see it happen. MTP require the complete URL and I'm simply dispatching to another page within They don't *have* to have a complete URL. MTP my web site (in fact, within the same directory) i.e., I'm looking to use a MTP path-relative URL. Where this other page resides is irrelevant - the fact is you want to move from A to B. PHP doesn't care that B is in the same location as A. As far as I can see it you have two choices: Use the Header() option as suggested and pass control from one script to another, or include the final page and let that control the output. -- Best regards, Richard Davey http://www.phpcommunity.org/wiki/296.html -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: preg guru question
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 oops... sorry strange bug happened on my newsreader... 'joel boonstra' regex seems to be the better one hehe all others forgot that if u start with ', u must end with ' hehe (same thing with :p) i dont know why i used square brakets for \s... kinda stupid hehe André cerqueira wrote: did you post the same message 7 times? try: ? $subject = 'img src=THIS12BIT.ext'; $pattern = '/img[\s]+?src=[\'](.+?)[\'].*?/i'; $matchFound = preg_match_all ($pattern, $subject, $matches, PREG_SET_ORDER); print_r($matches); //$matches[$i][1] is what really matters ? that pattern may not be the best regex to use, but i think it works for most cases Pete M wrote: Im trying to scan a file and lift the image name from the img tag ie img src=THISBIT.ext where there could be ' or I messed around but am 2 embarassed to post code cos it dont work ;-( thanks in advance pete -BEGIN PGP SIGNATURE- Version: GnuPG v1.2.4 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFALbEmaxdA/5C8vH8RArxLAJwNJXHouP4meJXRo4c+8xye12H/4QCgk5gE YHIReAkKxtFwyD7dLWZIPWc= =2eBJ -END PGP SIGNATURE- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Apache+modssl+php problem??? possible IE bug?
On Saturday 14 February 2004 05:44, Scott Fletcher wrote: I mean, I sometime found a few POST data had incorrectly went over to the GET data. I don't know it's a PHP problem but more of a web browser problem. If something like that really is happening then it seems like a pretty serious bug. Do you have sample code and version numbers? -- Jason Wong - Gremlins Associates - www.gremlins.biz Open Source Software Systems Integrators * Web Design Hosting * Internet Intranet Applications Development * -- Search the list archives before you post http://marc.theaimsgroup.com/?l=php-general -- /* In a consumer society there are inevitably two kinds of slaves: the prisoners of addiction and the prisoners of envy. */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Session, loging users in.
Whats the best information to add to a session to say a user is logged in? I currently have $siteUserLogIn=true; anything else that I could add to beef up security? --- Philip J. Newman Master Developer PhilipNZ.com [NZ] Ltd. [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: preg guru question
On Sat, 2004-02-14 at 00:24, André Cerqueira wrote: strange bug happened on my newsreader... 'joel boonstra' regex seems to be the better one hehe all others forgot that if u start with ', u must end with ' hehe (same thing with :p) As far as I could tell the regexp I posted was the only one to use a subpattern to match the first quote type used and then re-apply that after matching the file name: '/img\s+src=([\'])([^\1]+)\1\s*\/?\s*/i' I am a bit of a regular expression fan and I would be interested in seeing another way to match without using subpatterns. What was Joel's regexp again? -- Adam Bregenzer [EMAIL PROTECTED] http://adam.bregenzer.net/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Session, loging users in.
On Sat, 2004-02-14 at 13:48, Philip J. Newman wrote: Whats the best information to add to a session to say a user is logged in? I currently have $siteUserLogIn=true; anything else that I could add to beef up security? For storing user status use whatever fits your application best. I save an instance of my user class in the session and use it to check if I have a logged in user. If it is set then that is the user, if not then the session is not logged in. To beef up security I use a combination of the session id (cookies only) and set an additional cookie that contains a random sequence. This acts like an initialization vector does in cryptography. It is always a random sequence and never contains any identifying information about the user. -- Adam Bregenzer [EMAIL PROTECTED] http://adam.bregenzer.net/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php