Re: [PHP] How to convert a website to a txtfile....?
At 06.04.2002 17:51, you wrote: Hi! I have this website with a webshop that customers can order some products. And when the products are listed up in the cart on the screen, would I like to get the output into a new txtfile and save it on the server. Then it is possible to get it faxed, and that is the goal. Anyone who has done this before? Assuming you have a Linux box running, I did the following, writing the data you got from cart to a .txt file using fopen(), fputs() then translate this with a2ps (takes time to get the commandline, so I post it here) a2ps -q -r --footer=nothing -B --borders=1 --font-size=10.0 --tabsize=3 (cutted here, space between -- parameters) --left-title=Your Title -oout1.ps YourInput.txt Then use Ghostscript to make a faxfile (as above) gs -q -dBATCH -sDEVICE=faxg3 -sOUTPUTFILE=send -sPAPERSIZE=a4 -dNOPAUSE out1.ps then sendfax (package mgetty+sendfax) to send this file I used sendfax, as it is easy to configure, and the commandline is not so big ;-) the commands to a2ps, gs and sendfax are transmitted via exec() HTH Oliver -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
php-general Digest 7 Apr 2002 09:08:29 -0000 Issue 1272
php-general Digest 7 Apr 2002 09:08:29 - Issue 1272 Topics (messages 91889 through 91914): Re: regular expressions: HUGE speed differences 91889 by: Chris Adams Re: how to sort by value in associative array 91890 by: Chris Adams 91894 by: Peter J. Schoenster The PHP Filter did not receive suitable input data 91891 by: bvr Re: redirector 91892 by: Bob 91893 by: Bob Re: Executing functions within ereg_replace() output 91895 by: CC Zona Re: nl2br returns BR /? normality or a bug? 91896 by: Maxim Maletsky What's wrong with php?? 91897 by: Gerard Samuel 91907 by: Tyler Longren Phone number validation 91898 by: Gary 91899 by: Jason Cribbins 91900 by: Justin French 91901 by: Richard Baskett Can I fopen() files in .htaccess protected directories? 91902 by: Dalton Hunter Re: PHP on Apache 2.0 -- Does it work? 91903 by: Tyler Longren /usr/bin/php Question 91904 by: Chris Kay 91905 by: Rasmus Lerdorf 91906 by: Jason Wong Re: Newbie and includes 91908 by: G-no / |{iller 91909 by: Rasmus Lerdorf move_uploaded_file returning true but not working 91910 by: Leif K-Brooks counter for HIGH traffic site 91911 by: Craig Westerman Re: How to convert a website to a txtfile? 91912 by: Sebastian A. 91914 by: heinisch.creaction.de Multiple Selection Menu Dilemma 91913 by: Phillip S. Baker Administrivia: To subscribe to the digest, e-mail: [EMAIL PROTECTED] To unsubscribe from the digest, e-mail: [EMAIL PROTECTED] To post to the list, e-mail: [EMAIL PROTECTED] -- ---BeginMessage--- On Sat, 06 Apr 2002 15:01:24 +0300, Ando [EMAIL PROTECTED] wrote: (eregi((frame[^]*src[[:blank:]]*=|href[[:blank:]]*=|http-equiv=['\]refresh['\] You might want to try using preg_match instead. The PCRE engine should be significantly faster. You might also find the ability to pass an array of expressions would simplify your code significantly. Chris ---End Message--- ---BeginMessage--- On Sat, 6 Apr 2002 10:36:18 -0600, Peter J. Schoenster [EMAIL PROTECTED] wrote: $ArrayOfNewsLinks = array( http://dailynews.yahoo.com/fc/World/Brazil/; = array( title = 'Yahoo Brazil News', category = 'news', language = 'English', ), ... function cmp ($a, $b) { if ($a[2] == $b[2]) return 0; //return strcmp ( $a[2], $b[2]); // thought this would work return ($a[1]$b[1])?1:-1; } uksort ($ArrayOfNewsLinks, cmp); Try changing those subscripts to keys: if ($a[language] == $b[language]) etc. You should have a ton of PHP warnings generated from the code above, as numeric elements won't exist. As a side note, an interesting addition would be using the title as a second sort key: if ($a[language] == $b[language]) { return strnatcasecmp($a[title], $b[title]); } ---End Message--- ---BeginMessage--- On 6 Apr 2002, at 14:38, Chris Adams wrote: On Sat, 6 Apr 2002 10:36:18 -0600, Peter J. Schoenster [EMAIL PROTECTED] wrote: $ArrayOfNewsLinks = array( http://dailynews.yahoo.com/fc/World/Brazil/; = array( title = 'Yahoo Brazil News', category = 'news', language = 'English', ), ... function cmp ($a, $b) { if ($a[2] == $b[2]) return 0; //return strcmp ( $a[2], $b[2]); // thought this would work return ($a[1]$b[1])?1:-1; } uksort ($ArrayOfNewsLinks, cmp); Try changing those subscripts to keys: if ($a[language] == $b[language]) etc. You should have a ton of PHP warnings generated from the code above, as numeric elements won't exist. Not running with warnings on that server (bad thing I know). I tried the above. uksort ($ArrayOfNewsLinks, SortByValue); function SortByValue ($a, $b) { if ($a[language] == $b[language]) return 0; return ($a[language] $b[language]) ? 1 : -1; } or this function SortByValue ($a, $b) { return strcmp ( $a[language], $b[language]); } Doesn't work. Peter http://www.readbrazil.com/ Answering Your Questions About Brazil ---End Message--- ---BeginMessage--- Hello! I'm expirimenting with apache 2 and PHP, I've got things running but there's one problem left: When I request a directory, and the index is a PHP script, the following error is reported to the client: 'The PHP Filter did not receive suitable input data' Apache also reports this error to his error_log: 'Directory index forbidden by rule: name of the PHP script!' And when I enable the 'Indexes' option, Apache logs: 'Not a directory: Can't open directory for index: name of the PHP script!' I'm using my Apache 1.3 configuration but with Filters instead of AddType , I hope this is simply a configuration issue. versions used: Apache 2.0.35 PHP 4.3.0-cvs (03 Apr 2002 23:53 GMT+1)
Re: [PHP] Can I fopen() files in .htaccess protected directories?
On Sat, 6 Apr 2002, Dalton Hunter wrote: Hi, does fopen() support the opening and reading of remote files in directories protected with .htaccess files like ... fopen(http://user:[EMAIL PROTECTED]/directory/file.php,r;); If not, is there an alternative way to do this? Thanks! If you're only going to be reading it from inside your PHP program, why not just put the target resource at a secret URL rather than behind .htaccess password protection? That's pretty much equivalent to a password. miguel -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Executing functions within ereg_replace() output
Thanks! That preg_replace_callback helps alot. -Adam Cc Zona [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... In article [EMAIL PROTECTED], [EMAIL PROTECTED] (Adam Wan) wrote: $content = 'string string 12463409834234 string string'; $content = ereg_replace( [0-9]{14} , substr(\\1,0,5) , $content ); // this is the output i want, but the above doesnt seem to be the right way to generate it. string string 12363 string string any ideas? For future reference: http://www.php.net/preg-replace-callback For this instance: $content = ereg_replace( ([0-9]{5})[0-9]{9} , \\1, $content); -- CC -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: counter for HIGH traffic site
Craig Westerman [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... I'm needing counter for site that receives 60 to 80 hits a minute. Many I have tried cause excessive server load and need to be deactivated or they lose data and return to zero without warning. All tried so far have been written in Perl. Anyone here know of a PHP counter that would handle HIGH traffic with little added server load? Would using MySQL to store count be of any benifit? Thanks Craig [EMAIL PROTECTED] Make a mysql table that looks like this tablename: mysqlcount columns: id and count Then add a single entry with id set to 1 and count set to 0, or whatever your count was before. Then use this code in your page. $str = 'http://www.yourdomain.com/where/this/is/located'.$PHP_SELF; if ( $str != $HTTP_REFERER ) { mysql_query(UPDATE mysqlcount SET count=count+1 WHERE id=1); } $count_query = @mysql_query(SELECT count FROM mysqlcount WHERE id=1); echo substr(@mysql_result($count_query,0), 0, -3).','.substr(@mysql_result($count_query,0), -3); that should be pretty fast. -Adam -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Strange warning message GD2 php 4.1.2
Perhaps someone can kindly help me with the following problem. The following snippet runs perfectly when I use php_gd.dll but generates a garbled warning message when I switch the extension to php_gd2.dll Warning: Ép in c:\program files\apache group\apache\htdocs\test.php on line 10 (line 10 being the imageTTFText call) $image = imagecreate(500, 500); define( 'BEIGE', imagecolorallocate($image, 245, 245, 220) ); # Automaticaly 1st is Background color define( 'BLACK', imagecolorallocate($image, 0, 0, 0) ); imageTTFText($image, 32, 0, 100, 100, BLACK, 'c:/WINNT/Fonts/times.ttf', 'HELLO'); header('Content-type: image/png'); imagepng($image); Cheers, Mark -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] /usr/bin/php Question
So I should compile without axps to make the binary then recompile --with-axps to compile the apache module again.? Cause I want both apache module and command line. Or will it work as a apache module without axps? --- Chris Kay, Eleet Internet Services [EMAIL PROTECTED] --- -Original Message- From: Jason Wong [mailto:[EMAIL PROTECTED]] Sent: Sunday, 7 April 2002 3:32 PM To: [EMAIL PROTECTED] Subject: Re: [PHP] /usr/bin/php Question On Sunday 07 April 2002 13:18, Chris Kay wrote: Hi I have compiled php -with-apxs option and I read in the archives it don't create a /usr/bin/php. But I wish to run 2 scripts I have made by command line, I have the 2 scripts outside the web server Root. Is there a way to compile a php binary to use for my scripts? Yes. Or does someone have any idea's what's the best way to go about this would be... From the manual The default is to build PHP as a CGI program. By using the --with-apxs option you're telling it to build an Apache module and not a standalone binary. So just: ./configure; make; then copy the resulting php executable somewhere. -- Jason Wong - Gremlins Associates - www.gremlins.com.hk Open Source Software Systems Integrators * Web Design Hosting * Internet Intranet Applications Development * /* Show business is just like high school, except you get paid. - Martin Mull */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] New User of PHp/Mysql..
Ive been using Mysql/PHP for a short while - I sent this messaghe to a big PHP group (not enough users though) about a week ago - No reply... Can anyone help.. PS - Slingshot.co.nz doesnt have PHP - its just a text file.. - Save to your own SQL server test, Or just review the code - No viruses or anything.. Thanks. G. [EMAIL PROTECTED] - http://homepages.slingshot.co.nz/~gordon52/4.txt Ive been learning MySql for about 1 week now - joined a MySql group - but some questions I ask are more PHP related not directly involving MySQL.. anyway, for my big test script, Ive got the above URL Just 'view source' to view the PHP scripting language... when running, it searches your databases brings up a list of active databases. When selected, it brings up a list of tables within the database.. (those two functions are ok..) Now - in the script, - near the top, it says :- if ($action =='tables'){ (start of problem area..) Now - when you select the table, it displays all the names of each column, within the table. (that part works..) it has :- $tot=$i; - $tot now holds the number of columns in that table - For my example on my PC, it held the number '17' which is correct. it now has 2 'loops'... a) for ($count = 1; $row = mysql_fetch_row ($query_result_handle); ++$count) b) for ($counta = 1; $tot; ++$counta) Loop a, loops through the 4 rows of the database. Loop B, displays all (17) of the colmns for each row... Now - Problems 1) When my script runs, it is VERY fast - Doing things normally. - EXCEPT - when it comes to the 2 loops.. - it goes Very slow - I realise its got to do 2 sets of loops - but its going at a much slower rate than if i did the same loops, on another programming language. 2) It only displays the 1st row of my data.. - For the example database i tested, I knew it had 4 rows. problem questions :- a) Is my looping correct - Or can anyone find a loop-hole / problem in my programming. (Im not telling you if the pun was intentional or not.) PS - Ive now realised something, changed my line from :- for ($counta = 1; $tot; ++$counta) to for ($counta = 1; $row = mysql_fetch_row ($query_result_handle); ++$counta) - now my script is really fast - However it doesnt show much of the 1st line of data :-( PS, the uploaded one (URL above) - doesnt show the change - as yet.. Can anyone advise what im doing wrong ? G. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Phone number validation
Richard Baskett [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... What I do is strip all non-numeric numbers out and just store the number as a string of numbers.. Then do validation on those numbers.. Make sure the right amount of numbers are there, valid country, city codes etc. Probably an easier approach :) Just as a curiosity - (I dont need / Want it now - Maybe later) Where / what site, can we get a list of the valid country/city codes ? G. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Newbies Question
Hi everybody, I'm a french newbie in PHP and I'm trying to resolve this : ?php $rf = fopen(album.dat, r); $row = 1; while ($data = fgetcsv ($rf, 1000, ;)) { $num = count ($data); print $num; //print p $num champs dans la ligne $row: br; //$row++; for ($c=0; $c$num; $c++) { //print $data[$c] . br; $image = $data[$c]; $img = GetImageSize($image\n);this is Line 13 print $image; print $img; } } fclose($rf); each time I run it I get a : Parse error: parse error in essai2.php on line 13 All I want is to get the image name and size to put in in a table TYA for your help -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] /usr/bin/php error
Would any one know why when I run command line php I get the following? [root@*** ]# /usr/bin/php /data/web/root/***/getdata.php X-Powered-By: PHP/4.1.2 Content-type: text/html br bFatal error/b: Call to undefined function: ftp_connect() in b/data/web/root/***/getdata.php/b on line b16/bbr --- Chris Kay, Eleet Internet Services [EMAIL PROTECTED] --- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] WebMail server question
Good morning, Someone last month told me that there is free web based email server platform which relies on PHP technology. This mail server is the result of a project. I can not remember the name of the mail server. It is something like NMP, MNP, or NMD ???.. He also told me that because Apache web server supports PHP, so the email server has to be on Apache, or any other web server which supports PHP. Anyone knows this? Thank you. -- Patrick Ni Phone: (604) 719 - 2781 Email: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] WebMail server question
Not sure which one you are referring to but I been told SquirrelMail is really good http://sourceforge.net/projects/squirrelmail/ --- Chris Kay, Eleet Internet Services [EMAIL PROTECTED] --- -Original Message- From: Patrick Ni [mailto:[EMAIL PROTECTED]] Sent: Sunday, 7 April 2002 11:46 PM To: [EMAIL PROTECTED] Subject: [PHP] WebMail server question Good morning, Someone last month told me that there is free web based email server platform which relies on PHP technology. This mail server is the result of a project. I can not remember the name of the mail server. It is something like NMP, MNP, or NMD ???.. He also told me that because Apache web server supports PHP, so the email server has to be on Apache, or any other web server which supports PHP. Anyone knows this? Thank you. -- Patrick Ni Phone: (604) 719 - 2781 Email: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] WebMail server question
You are probably thinking about IMP (http://www.horde.org) This message is actually being sent from an IMP 3.0 installation and our company is very pleased with the product. -- Michael Geier CDM Sports, Inc. - Systems Administrator email: [EMAIL PROTECTED] Quoting Chris Kay [EMAIL PROTECTED]: Not sure which one you are referring to but I been told SquirrelMail is really good http://sourceforge.net/projects/squirrelmail/ --- Chris Kay, Eleet Internet Services [EMAIL PROTECTED] --- -Original Message- From: Patrick Ni [mailto:[EMAIL PROTECTED]] Sent: Sunday, 7 April 2002 11:46 PM To: [EMAIL PROTECTED] Subject: [PHP] WebMail server question Good morning, Someone last month told me that there is free web based email server platform which relies on PHP technology. This mail server is the result of a project. I can not remember the name of the mail server. It is something like NMP, MNP, or NMD ???.. He also told me that because Apache web server supports PHP, so the email server has to be on Apache, or any other web server which supports PHP. Anyone knows this? Thank you. -- Patrick Ni Phone: (604) 719 - 2781 Email: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php - This mail sent through CDM Sports Webmail. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] /usr/bin/php error
Did you compile in ftp support? It's not there unless you do. http://www.php.net/manual/en/ref.ftp.php - Original Message - From: Chris Kay [EMAIL PROTECTED] Would any one know why when I run command line php I get the following? [root@*** ]# /usr/bin/php /data/web/root/***/getdata.php X-Powered-By: PHP/4.1.2 Content-type: text/html br bFatal error/b: Call to undefined function: ftp_connect() in b/data/web/root/***/getdata.php/b on line b16/bbr -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] WebMail server question
Thank you Michael. It is IMP and horde that I was after. I only remembered that M or N is part of the name. Also Thanks to Chris. Patrick Michael Geier [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... You are probably thinking about IMP (http://www.horde.org) This message is actually being sent from an IMP 3.0 installation and our company is very pleased with the product. -- Michael Geier CDM Sports, Inc. - Systems Administrator email: [EMAIL PROTECTED] Quoting Chris Kay [EMAIL PROTECTED]: Not sure which one you are referring to but I been told SquirrelMail is really good http://sourceforge.net/projects/squirrelmail/ --- Chris Kay, Eleet Internet Services [EMAIL PROTECTED] --- -Original Message- From: Patrick Ni [mailto:[EMAIL PROTECTED]] Sent: Sunday, 7 April 2002 11:46 PM To: [EMAIL PROTECTED] Subject: [PHP] WebMail server question Good morning, Someone last month told me that there is free web based email server platform which relies on PHP technology. This mail server is the result of a project. I can not remember the name of the mail server. It is something like NMP, MNP, or NMD ???.. He also told me that because Apache web server supports PHP, so the email server has to be on Apache, or any other web server which supports PHP. Anyone knows this? Thank you. -- Patrick Ni Phone: (604) 719 - 2781 Email: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php - This mail sent through CDM Sports Webmail. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Newbies Question
Remove the double-double quotes and the newline around $image: $img = GetImageSize($image\n);this is Line 13 It should look like: $img = GetImageSize($image); There is no need to double quote a variable when passing as a parm. You would want to double quote a variable when it's in a string like: $var = The image name is $imagebr\n; -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Hidding an image
Hi, I got a page where I have to images (IMG), which is also a link. Is it possible to hide an image so the user can't see it? Regards, Morten -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Hidding an image
If you dont want user to see the image. dont put the image to the page! Or what you want is just something different? -- - martina. Morten Nielsen [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Hi, I got a page where I have to images (IMG), which is also a link. Is it possible to hide an image so the user can't see it? Regards, Morten -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP on Apache 2.0 -- Does it work?
Thanks for the info. Apache 1.3.24 isn't a bad release to be stuck with. :) I just wanted to be a little bit on the bleeding edge. Regards, Steve Tyler Longren [EMAIL PROTECTED] wrote in message 004001c1ddf3$13d82b90$0101a8c0@nightengale">news:004001c1ddf3$13d82b90$0101a8c0@nightengale... Well, php 4.1.2 for windows probably wasn't compiled to work with apache 2. Apache 2 has changed too much for the php developers to keep on top of it. If you were using unix/linux, you could compile php to work with apache 2, but since you're using Windows, you're stuck with using Apache 1.3.24 until the php group releases a new version for Apache 2. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: 1024X760 or 800x600
My reccomendation is to design it for optimization on 800*600..as that to me is the lowest common denominator.it will still look good in 1024*760 therefore covering both resolutions nicely Ron Allen wrote: Is there a way with PHP to determine screen resolution size??? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] hosting
didn't get an replies about web-x.net and i sent them and email and they never replied - doesn't portray a good image so i've looked for another hosting company and have come up with burst.net...anybody got any reviews? Thanks, = Heidi Belal www.code-corner.com ICQ# 32127109 A bus stops at a bus station. A train stops at a train station. On my desk I have a work station... __ Do You Yahoo!? Yahoo! Tax Center - online filing with TurboTax http://taxes.yahoo.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] PHP .PDF .ZIP ???
I need to automatically create a .PDF file from a *dynamically created* text file, then .ZIP that file up. Then *ultimately* have that file attached to an email and automatically sent. Can PHP do .PDF files? .ZIP Files? The caveat on the .PDF file is; it also needs to be locked (or password protected) like an EBOOK, where the end user will not be able to copy and paste out the contents -- I'm considering them not being able to print it also-- just the ability to view it on the screen. Can PHP help with all this? If so; if anyone has some sample code, that would be *very* helpful. Thanks. Jason -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] /usr/bin/php Question
On Sunday 07 April 2002 19:37, Chris Kay wrote: So I should compile without axps to make the binary then recompile --with-axps to compile the apache module again.? Cause I want both apache module and command line. If you want both, then yes, you need to compile twice. Once using --with-apxs, then again omitting --with-apxs. Or will it work as a apache module without axps? There are two types of Apache modules, the preferred being apxs, so just stick with it -- unless you have special reasons not to. -- Jason Wong - Gremlins Associates - www.gremlins.com.hk Open Source Software Systems Integrators * Web Design Hosting * Internet Intranet Applications Development * /* It is better to have loved and lost than just to have lost. */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Form ID name
Hi, I got a table where I have some images and links (IMG A). They all have an ID name. Is it possible to access them from a function through a variable? If my link looks like: A ID=link1 href=#/A then in my function I would like something like: func1( ) { $link=link1; $link.href=www.x.com; } Is this somehow possible? Regards, Morten -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP .PDF .ZIP ???
Yes, PHP can do pdf and can READ zip files. I am not sure if PHP can make the pdf unprintable, or locked. You can find info on the pdf functions here: http://www.php.net/manual/en/ref.pdf.php and info on the zip functions here: http://www.php.net/manual/en/ref.zip.php Since those are read-only functions, you could use exec() or system() to zip your files. Tyler Longren Captain Jack Communications [EMAIL PROTECTED] www.captainjack.com - Original Message - From: Jason Caldwell [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Sunday, April 07, 2002 12:57 PM Subject: [PHP] PHP .PDF .ZIP ??? I need to automatically create a .PDF file from a *dynamically created* text file, then .ZIP that file up. Then *ultimately* have that file attached to an email and automatically sent. Can PHP do .PDF files? .ZIP Files? The caveat on the .PDF file is; it also needs to be locked (or password protected) like an EBOOK, where the end user will not be able to copy and paste out the contents -- I'm considering them not being able to print it also-- just the ability to view it on the screen. Can PHP help with all this? If so; if anyone has some sample code, that would be *very* helpful. Thanks. Jason -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Form ID name
If you are using a function as an easy way to add links to your page, i'd recommend that you define a function that echoes a hfref=your function parameter in that manner. /Mattias Morten Nielsen [EMAIL PROTECTED] skrev i meddelandet [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Hi, I got a table where I have some images and links (IMG A). They all have an ID name. Is it possible to access them from a function through a variable? If my link looks like: A ID=link1 href=#/A then in my function I would like something like: func1( ) { $link=link1; $link.href=www.x.com; } Is this somehow possible? Regards, Morten -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] import_request_variables() is undefined!?
When i just migrated to linux instead of win2k the function import_request_variables() is not defined anymore. I used 4.1.2 in win2k and 4.0.6 now under linux. I was wondering if it had to do with the versions or someting. Seems odd. Very tankful for any help that might get me to solve the problem /Mattias Green -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Phone number validation
http://www.the-acr.com/codes/cntrycd.htm Rick A good head and good heart are always a formidable combination. But when you add to that a literate tongue or pen, then you have something very special - Nelson Mandela From: Gordon Stewart [EMAIL PROTECTED] Date: Mon, 8 Apr 2002 00:50:09 +1200 To: [EMAIL PROTECTED] Subject: Re: [PHP] Phone number validation Richard Baskett [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... What I do is strip all non-numeric numbers out and just store the number as a string of numbers.. Then do validation on those numbers.. Make sure the right amount of numbers are there, valid country, city codes etc. Probably an easier approach :) Just as a curiosity - (I dont need / Want it now - Maybe later) Where / what site, can we get a list of the valid country/city codes ? G. -- 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] Phone number validation
On Mon, 8 Apr 2002, Gordon Stewart wrote: Just as a curiosity - (I dont need / Want it now - Maybe later) Where / what site, can we get a list of the valid country/city codes ? Someone else has already provided you with a site. I'd just add that validating international numbers against any sort of list is bound to lead to extreme annoyance. Even telephone companies have trouble keeping track of changes. miguel -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] PHP from HTML
HI, Is this possible? SERVER1 with PHP some file with name xTest.php xTest.php: ? echo(Hi from SERVER1); ? SERVER2 without PHP some file with name file1.html file1.html: html body Server1 is saying : ? /body /html How can I make HTML file (on SERVER2) say 'Server1 is saying : Hi from SERVER1'? TIA Matja¾ Prtenjak -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] PHP from HTML
HI, Is this possible? SERVER1 with PHP some file with name xTest.php xTest.php: ? echo(Hi from SERVER1); ? SERVER2 without PHP some file with name file1.html file1.html: html body Server1 is saying : ? /body /html How can I make HTML file (on SERVER2) say 'Server1 is saying : Hi from SERVER1'? TIA Matja¾ Prtenjak -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Phone number validation
I would agree with that. When I wrote that you COULD do that.. I didn¹t mean that I do that :) If you wanted to get down and dirty and verify everything about that phone number you could.. Was what I was trying to get at. But when you had all the non-numeric characters in a phone number it makes it hard to do any type of verification since everyone seems to write their phone numbers different. Thus the reason for my advice on stripping all non-numeric characters from the phone number before checking to make sure it's a valid number or throwing it into your database in the format you want. Verifying country, city, etc codes would just be a royal pain in the @$$ and I wouldn¹t recommend it to anyone, there really is no reason to do it, but you COULD do it if you really wanted :) Cheers! Rick Every person you meet - and everything you do in life - is an opportunity to learn something. - Tom Clancy From: Miguel Cruz [EMAIL PROTECTED] Date: Sun, 7 Apr 2002 14:08:42 -0500 (CDT) To: Gordon Stewart [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Subject: Re: [PHP] Phone number validation On Mon, 8 Apr 2002, Gordon Stewart wrote: Just as a curiosity - (I dont need / Want it now - Maybe later) Where / what site, can we get a list of the valid country/city codes ? Someone else has already provided you with a site. I'd just add that validating international numbers against any sort of list is bound to lead to extreme annoyance. Even telephone companies have trouble keeping track of changes. miguel -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Sites for contracts?
Does anyone here know of any good sites where there are companies looking for contract employees listed on them? Other then main stream sites like Monster, Dice and so on? Thanx -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Phone number validation
Miguel Cruz wrote: On Mon, 8 Apr 2002, Gordon Stewart wrote: Just as a curiosity - (I dont need / Want it now - Maybe later) Where / what site, can we get a list of the valid country/city codes ? Someone else has already provided you with a site. I'd just add that validating international numbers against any sort of list is bound to lead to extreme annoyance. Even telephone companies have trouble keeping track of changes. miguel I have to agree with that. I have given up on validating a phone number. When I sat down and thought about it there are too many problems. These problems range from country codes, city codes , and area codes all changing daily to business phones. Your looking at #*. + ( )- and probably many more I haven't thought of. Looks like I will only check if something is there. Gary -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] /usr/bin/php Question
Thanks Jason this worked.. --- Chris Kay, Eleet Internet Services [EMAIL PROTECTED] --- -Original Message- From: Jason Wong [mailto:[EMAIL PROTECTED]] Sent: Monday, 8 April 2002 4:01 AM To: [EMAIL PROTECTED] Subject: Re: [PHP] /usr/bin/php Question On Sunday 07 April 2002 19:37, Chris Kay wrote: So I should compile without axps to make the binary then recompile --with-axps to compile the apache module again.? Cause I want both apache module and command line. If you want both, then yes, you need to compile twice. Once using --with-apxs, then again omitting --with-apxs. Or will it work as a apache module without axps? There are two types of Apache modules, the preferred being apxs, so just stick with it -- unless you have special reasons not to. -- Jason Wong - Gremlins Associates - www.gremlins.com.hk Open Source Software Systems Integrators * Web Design Hosting * Internet Intranet Applications Development * /* It is better to have loved and lost than just to have lost. */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Test for one bit set?
How can I test if a number only has on bit set? So testing different numbers will return TRUE or FALSE: testing 0001 would return TRUE. testing 0011 would return FALSE. TIA Charlie -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Sites for contracts?
www.scriptlance.com - Original Message - From: Steve [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Sunday, April 07, 2002 1:28 PM Subject: [PHP] Sites for contracts? Does anyone here know of any good sites where there are companies looking for contract employees listed on them? Other then main stream sites like Monster, Dice and so on? Thanx -- 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] Test for one bit set?
On Sun, 7 Apr 2002, Charlie Killian wrote: How can I test if a number only has on bit set? So testing different numbers will return TRUE or FALSE: testing 0001 would return TRUE. testing 0011 would return FALSE. Think back to math class when you were 14! function isOneBitSet($n) { $x = log($n)/log(2); return ($x == intval($x)); } Cheesy alternative: function isOneBitSet($n) { return (1 == substr_count(base_convert($n, 10, 2), '1')); } miguel -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: PHP from HTML
1. Instead of ? you could use server side includes (this would work on SERVER2 side) below would work on client side: 2. Some Javascript file, which could be downloaded from SERVER1, like SCRIPT SRC=...SERVER1... 3. Use IFRAME Maybe there are some other possibilities... Your problem is just the same as the case with counters, banners and so on... Sorry if I misunderstood You. Matja+ Prtenjak [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... HI, Is this possible? SERVER1 with PHP some file with name xTest.php xTest.php: ? echo(Hi from SERVER1); ? SERVER2 without PHP some file with name file1.html file1.html: html body Server1 is saying : ? /body /html How can I make HTML file (on SERVER2) say 'Server1 is saying : Hi from SERVER1'? TIA Matja¾ Prtenjak -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
php-general Digest 7 Apr 2002 21:37:54 -0000 Issue 1273
php-general Digest 7 Apr 2002 21:37:54 - Issue 1273 Topics (messages 91915 through 91953): Re: Can I fopen() files in .htaccess protected directories? 91915 by: Miguel Cruz Re: Executing functions within ereg_replace() output 91916 by: Adam Wan Re: counter for HIGH traffic site 91917 by: Adam Wan Strange warning message GD2 php 4.1.2 91918 by: Mark W. Humphries Re: /usr/bin/php Question 91919 by: Chris Kay 91937 by: Jason Wong 91949 by: Chris Kay New User of PHp/Mysql.. 91920 by: Gordon Stewart Re: Phone number validation 91921 by: Gordon Stewart 91942 by: Richard Baskett 91943 by: Miguel Cruz 91946 by: Richard Baskett 91948 by: Gary Newbies Question 91922 by: news.php.net 91929 by: Matt /usr/bin/php error 91923 by: Chris Kay 91927 by: Matt WebMail server question 91924 by: Patrick Ni 91925 by: Chris Kay 91926 by: Michael Geier 91928 by: Patrick Ni Hidding an image 91930 by: Morten Nielsen 91931 by: martinahingis Re: PHP on Apache 2.0 -- Does it work? 91932 by: Steve Magruder, D2 Director hosting 91933 by: Heidi Belal 91934 by: Adam Alkins Re: 1024X760 or 800x600 91935 by: Steve PHP .PDF .ZIP ??? 91936 by: Jason Caldwell 91939 by: Tyler Longren Form ID name 91938 by: Morten Nielsen 91940 by: M Green import_request_variables() is undefined!? 91941 by: M Green PHP from HTML 91944 by: Matja¾ Prtenjak 91945 by: Matja¾ Prtenjak 91953 by: Markas Sites for contracts? 91947 by: Steve 91951 by: Bob Test for one bit set? 91950 by: Charlie Killian 91952 by: Miguel Cruz Administrivia: To subscribe to the digest, e-mail: [EMAIL PROTECTED] To unsubscribe from the digest, e-mail: [EMAIL PROTECTED] To post to the list, e-mail: [EMAIL PROTECTED] -- ---BeginMessage--- On Sat, 6 Apr 2002, Dalton Hunter wrote: Hi, does fopen() support the opening and reading of remote files in directories protected with .htaccess files like ... fopen(http://user:[EMAIL PROTECTED]/directory/file.php,r;); If not, is there an alternative way to do this? Thanks! If you're only going to be reading it from inside your PHP program, why not just put the target resource at a secret URL rather than behind .htaccess password protection? That's pretty much equivalent to a password. miguel ---End Message--- ---BeginMessage--- Thanks! That preg_replace_callback helps alot. -Adam Cc Zona [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... In article [EMAIL PROTECTED], [EMAIL PROTECTED] (Adam Wan) wrote: $content = 'string string 12463409834234 string string'; $content = ereg_replace( [0-9]{14} , substr(\\1,0,5) , $content ); // this is the output i want, but the above doesnt seem to be the right way to generate it. string string 12363 string string any ideas? For future reference: http://www.php.net/preg-replace-callback For this instance: $content = ereg_replace( ([0-9]{5})[0-9]{9} , \\1, $content); -- CC ---End Message--- ---BeginMessage--- Craig Westerman [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... I'm needing counter for site that receives 60 to 80 hits a minute. Many I have tried cause excessive server load and need to be deactivated or they lose data and return to zero without warning. All tried so far have been written in Perl. Anyone here know of a PHP counter that would handle HIGH traffic with little added server load? Would using MySQL to store count be of any benifit? Thanks Craig [EMAIL PROTECTED] Make a mysql table that looks like this tablename: mysqlcount columns: id and count Then add a single entry with id set to 1 and count set to 0, or whatever your count was before. Then use this code in your page. $str = 'http://www.yourdomain.com/where/this/is/located'.$PHP_SELF; if ( $str != $HTTP_REFERER ) { mysql_query(UPDATE mysqlcount SET count=count+1 WHERE id=1); } $count_query = @mysql_query(SELECT count FROM mysqlcount WHERE id=1); echo substr(@mysql_result($count_query,0), 0, -3).','.substr(@mysql_result($count_query,0), -3); that should be pretty fast. -Adam ---End Message--- ---BeginMessage--- Perhaps someone can kindly help me with the following problem. The following snippet runs perfectly when I use php_gd.dll but generates a garbled warning message when I switch the extension to php_gd2.dll Warning: @Ép in c:\program files\apache group\apache\htdocs\test.php on line 10 (line 10 being the imageTTFText call) $image = imagecreate(500, 500); define( 'BEIGE', imagecolorallocate($image, 245, 245, 220) ); # Automaticaly 1st is
Re: [PHP] Test for one bit set?
This shows all integers from 1 to 10 that have the 2 least significant bits set: ?php for ($i = 1; $i = 10; $i++) { if ($i 3) { echo($i . \n); } } ? bvr. Charlie Killian wrote: How can I test if a number only has on bit set? So testing different numbers will return TRUE or FALSE: testing 0001 would return TRUE. testing 0011 would return FALSE. TIA Charlie -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Test for one bit set?
On Sun, 2002-04-07 at 13:38, Charlie Killian wrote: How can I test if a number only has on bit set? So testing different numbers will return TRUE or FALSE: testing 0001 would return TRUE. testing 0011 would return FALSE. TIA Charlie AND them bitwise: ?php error_reporting(E_ALL); $bit = 16; $foo = bindec('0001'); $bar = bindec('0011'); echo $foo; $bar\n; if ($foo $bit) { echo Bit 5 is set.\n; } else { echo Bit 5 is not set.\n; } if ($bar $bit) { echo Bit 5 is set.\n; } else { echo Bit 5 is not set.\n; } ? Torben -- Torben Wilson [EMAIL PROTECTED] http://www.thebuttlesschaps.com http://www.hybrid17.com http://www.inflatableeye.com +1.604.709.0506 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Test for one bit set?
Thanks to all those that replied. Especially Torben. (What have you been up to?) Miguel's solution works great. Check out the example below: ?php function isOneBitSet($n) { $x = log($n)/log(2); return ($x == intval($x)); } for ($i = 0; $i 32769; ++$i) { if(isOneBitSet($i)) { print($i, ); } } ? Prints out: 1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 2048, 4096, 8192, 16384, 32768, Just what I wanted. Thanks again, Charlie How can I test if a number only has on bit set? So testing different numbers will return TRUE or FALSE: testing 0001 would return TRUE. testing 0011 would return FALSE. Think back to math class when you were 14! function isOneBitSet($n) { $x = log($n)/log(2); return ($x == intval($x)); } Cheesy alternative: function isOneBitSet($n) { return (1 == substr_count(base_convert($n, 10, 2), '1')); } miguel -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Disabling bars on Browser
I was just wondering if there was any way to turn off the bars at the top of the browser window with PHP. If not does anyone know a way that I could make it so that I could pass information from a form to window that I pop open with javascript. I would either need some way to make the window look just like a window that was popped up with this: SCRIPT LANGUAGE=javascript window.open('https://secure.authorize.net/gateway/transact.dll', 'joe', config='toolbar=0,menubar=0,directories=0,location=0') /SCRIPT or some way I could pass the info from a form to that opened page. Thanks, Dave -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Disabling bars on Browser
Do you have something against using a class for interaction with the Authorize.net URL you are trying to open? It is possible to pass vars to the page I'm sure but a class would work better in most cases and automate the process for the customer. Later, Bob David Johansen [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... I was just wondering if there was any way to turn off the bars at the top of the browser window with PHP. If not does anyone know a way that I could make it so that I could pass information from a form to window that I pop open with javascript. I would either need some way to make the window look just like a window that was popped up with this: SCRIPT LANGUAGE=javascript window.open('https://secure.authorize.net/gateway/transact.dll', 'joe', config='toolbar=0,menubar=0,directories=0,location=0') /SCRIPT or some way I could pass the info from a form to that opened page. Thanks, Dave -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: how to sort by value in associative array
On Sat, 6 Apr 2002 18:21:10 -0600, Peter J. Schoenster [EMAIL PROTECTED] wrote: I tried the above. uksort ($ArrayOfNewsLinks, SortByValue); function SortByValue ($a, $b) { if ($a[language] == $b[language]) return 0; return ($a[language] $b[language]) ? 1 : -1; } or this function SortByValue ($a, $b) { return strcmp ( $a[language], $b[language]); } Doesn't work. I should have caught this earlier. Try uasort() - uksort() sorts on the array *key*, not the value. ? $ArrayOfNewsLinks = array( http://dailynews.yahoo.com/fc/World/Brazil/; = array( 'title' = 'Yahoo Brazil News', 'category' = 'news', 'language' = 'English', ), http://news.bbc.co.uk/hi/english/world/americas/default.stm; = array( 'title' = 'BBC News', 'category' = 'news', 'language' = 'English', ), http://news.yahoo.com/; = array( 'title' = 'Yahoo News', 'category' = 'news', 'language' = 'English', ), http://chinese.news.yahoo.com/; = array( 'title' = 'Yahoo News', 'category' = 'news', 'language' = 'Chinese', ) ); function news_sort($a, $b) { // Two key sort: first by language, then by title $i = strcmp($a['language'], $b['language']); if ($i != 0) { return $i; } else { return strcmp($a['title'], $b['title']); } } header(Content-Type: text/plain); print_r($ArrayOfNewsLinks); uasort($ArrayOfNewsLinks, news_sort); print_r($ArrayOfNewsLinks); ? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Disabling bars on Browser
I would love to use a class. Where can I find one? I've posted on here several times asking for examples or base code that work with Authorize.net but no one ever responds. If you could point me to some that'd be great. Thanks, Dave [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Do you have something against using a class for interaction with the Authorize.net URL you are trying to open? It is possible to pass vars to the page I'm sure but a class would work better in most cases and automate the process for the customer. Later, Bob David Johansen [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... I was just wondering if there was any way to turn off the bars at the top of the browser window with PHP. If not does anyone know a way that I could make it so that I could pass information from a form to window that I pop open with javascript. I would either need some way to make the window look just like a window that was popped up with this: SCRIPT LANGUAGE=javascript window.open('https://secure.authorize.net/gateway/transact.dll', 'joe', config='toolbar=0,menubar=0,directories=0,location=0') /SCRIPT or some way I could pass the info from a form to that opened page. Thanks, Dave -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Test for whole number.
Is there a one line test for whole numbers? I want to condense this function down to one line: function isOneBitSet($n) { $x = log($n)/log(2); return ($x == intval($x)); } TIA, Charlie -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Disabling bars on Browser
There are actually a couple at least listed here.. I don't know which are best but the one that my shopping cart uses is one of these one.. I believe it's this one: http://zend.com/codex.php?id=619single=1 Yeah, after I looked at it, it is that one.. Adam Olsen is my programmer.. Duh.. I forgot he posted the class file he did on Zend.com.. Anyway, hope you can find something to work.. Later, Bob Weaver David Johansen [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... I would love to use a class. Where can I find one? I've posted on here several times asking for examples or base code that work with Authorize.net but no one ever responds. If you could point me to some that'd be great. Thanks, Dave [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Do you have something against using a class for interaction with the Authorize.net URL you are trying to open? It is possible to pass vars to the page I'm sure but a class would work better in most cases and automate the process for the customer. Later, Bob David Johansen [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... I was just wondering if there was any way to turn off the bars at the top of the browser window with PHP. If not does anyone know a way that I could make it so that I could pass information from a form to window that I pop open with javascript. I would either need some way to make the window look just like a window that was popped up with this: SCRIPT LANGUAGE=javascript window.open('https://secure.authorize.net/gateway/transact.dll', 'joe', config='toolbar=0,menubar=0,directories=0,location=0') /SCRIPT or some way I could pass the info from a form to that opened page. Thanks, Dave -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Test for whole number.
That post was incomprehensible. Here it is revised: I'd like to condense the function below into one line. function isOneBitSet($n) { $x = log($n)/log(2); return ($x == intval($x)); } AND I don't want to do this: return (log($n)/log(2) == intval(log($n)/log(2))); So, is there a way to check if a number is whole only using the number once? Something like is_whole_number(log($n)/log(2)); Charlie Is there a one line test for whole numbers? I want to condense this function down to one line: function isOneBitSet($n) { $x = log($n)/log(2); return ($x == intval($x)); } TIA, Charlie -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Function that escapes special caracters from regular expressions
Is there one? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Function that escapes special caracters from regular expressions
I don't now of one. Charlie Is there one? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Function that escapes special caracters from regular expressions
http://www.php.net/manual/en/function.preg-quote.php Found this in the manual in about 3 secs. Try to check the manual first before posting. ;-) Matt Friedman Web Applications Developer www.SpryNewMedia.com -Original Message- From: Leif K-Brooks [mailto:[EMAIL PROTECTED]] Sent: Sunday April 7, 2002 7:16 PM To: [EMAIL PROTECTED] Subject: [PHP] Function that escapes special caracters from regular expressions Is there one? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Emulating a browser, parse cookies with PHP
Hi, I'm trying to make a PHP script that would go in a website and log in. The website uses cookie to authenticate with its services. I made HTTP GET requests using fsockopen and parsed the results back into a variable. However I cannot find the cookie info(Set-cookie) in the returned content. Is there special commands I have to send with the GET request in order for the server to send back cookies? Or am I just doing this all wrong? Any help will be appreciated! thanks!! -David Zhao
[PHP] Re: Function that escapes special caracters from regular expressions
In article [EMAIL PROTECTED], [EMAIL PROTECTED] (Charlie Killian) wrote: Is there one? I don't now of one. That's because PHP doesn't have one, it has two: http://php.net/preg-quote and http://php.net/quotemeta. (Read the docs carefully; these functions escape slightly different character sets...) -- CC -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
FW: [PHP] - REPOST - Flock manual clarification please ;-)
From the manual: snip Note: Because flock() requires a file pointer, you may have to use a special lock file to protect access to a file that you intend to truncate by opening it in write mode (with a w or w+ argument to fopen()). /snip The manual indicates that you may need to use a special lock file if you intend to open a file with w or w+. I wrote some code to examine this. (2 files) Each file locks a file after opening using w to do so. Then, the file is locked using LOCK_EX. Subsequently executed, each file appears to respect the lock applied by the other file. (Each file waits for the lock to be released by the other) - So, I don't see this manual entry applying in this case. In regards to the snip above, under what circumstances might you have to create a separate lock file? Is this an OS issue? Is it an issue when concurrency is high? The manual says you may have to; I am looking for some clarification as to when exactly you may have to follow the snip advice. Thanks as always, Matt Friedman Web Applications Developer www.SpryNewMedia.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Test for whole number.
Hi Not sure if this is the best way to do it: function isOneBitSet($n) { return !ereg(\.,strval(log($n)/log(2))); } Tom At 09:16 AM 8/04/2002, Charlie Killian wrote: That post was incomprehensible. Here it is revised: I'd like to condense the function below into one line. function isOneBitSet($n) { $x = log($n)/log(2); return ($x == intval($x)); } AND I don't want to do this: return (log($n)/log(2) == intval(log($n)/log(2))); So, is there a way to check if a number is whole only using the number once? Something like is_whole_number(log($n)/log(2)); Charlie Is there a one line test for whole numbers? I want to condense this function down to one line: function isOneBitSet($n) { $x = log($n)/log(2); return ($x == intval($x)); } TIA, Charlie -- 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: Test for whole number.
On Mon, 8 Apr 2002, Tom Rogers wrote: At 09:16 AM 8/04/2002, Charlie Killian wrote: I'd like to condense the function below into one line. function isOneBitSet($n) { $x = log($n)/log(2); return ($x == intval($x)); } AND I don't want to do this: return (log($n)/log(2) == intval(log($n)/log(2))); Not sure if this is the best way to do it: function isOneBitSet($n) { return !ereg(\.,strval(log($n)/log(2))); } Beware; using a regular expression for this is slower than creating an intermediate variable. miguel -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: FW: [PHP] - REPOST - Flock manual clarification please ;-)
Matt Friedman [EMAIL PROTECTED] wrote: In regards to the snip above, under what circumstances might you have to create a separate lock file? Is this an OS issue? Is it an issue when concurrency is high? The manual says you may have to; I am looking for some clarification as to when exactly you may have to follow the snip advice. when you do an fopen(file,w), it truncates the file -- before you can call flock(). so if one process locks the file, and starts writing data, a second one could just come along and blow away all or part of the data even though the first still has it locked. by the time the second process calls flock() and notices that the first has it locked, it has already truncated the file. jim -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Disabling bars on Browser
This is the wrong group/list for this post. The disabling of bars, or any sort of browser feature/appearance is NOT PHP. PHP is a server side langauge. Commonly, you would use JavaScript for such stuff, so I recommend you check out the millions of JavaScript sites and newsgroups on the web. on 08/04/02 8:29 AM, David Johansen ([EMAIL PROTECTED]) wrote: I was just wondering if there was any way to turn off the bars at the top of the browser window with PHP. If not does anyone know a way that I could make it so that I could pass information from a form to window that I pop open with javascript. I would either need some way to make the window look just like a window that was popped up with this: SCRIPT LANGUAGE=javascript window.open('https://secure.authorize.net/gateway/transact.dll', 'joe', config='toolbar=0,menubar=0,directories=0,location=0') /SCRIPT or some way I could pass the info from a form to that opened page. Thanks, Dave -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] xml-rpc for windows?
does anyone know where i could find an XML-RPC-EPI dll? thx, dietrich -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Workaround for no cron?
I have to wait for my host to compile php as binary for cron to work with php, and a lot of things on my site depend on cron. Does anyone have some sort of code that I could put at the top of all my pages so when they get visited, it checks to see if a script has been executed yet this time petiod, and if not yet, it does? Or any type of workaround for not having cron? Thanks! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Disabling bars on Browser
on 4/7/02 9:31 PM, Justin French at [EMAIL PROTECTED] wrote: This is the wrong group/list for this post. The disabling of bars, or any sort of browser feature/appearance is NOT PHP. PHP is a server side langauge. Commonly, you would use JavaScript for such stuff, so I recommend you check out the millions of JavaScript sites and newsgroups on the web. It looks like you didn't even read the message. He knew how to do it with javascript, but he needed to pass information to it, and he wanted to know that! And, even if he was wrong, you don't need to be so harsh! We aren't born knowing binary!
Re: [PHP] xml-rpc for windows?
Hi, I think the file you're looking for is located somewhere in the zip file for Windows. At least I've heard it was in php 4.1.0. Good luck, Tyler Longren Captain Jack Communications [EMAIL PROTECTED] www.captainjack.com - Original Message - From: dietrich [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Sunday, April 07, 2002 11:29 PM Subject: [PHP] xml-rpc for windows? does anyone know where i could find an XML-RPC-EPI dll? thx, dietrich -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] asking about .exe file
Can php execute .exe file under dos and view result on the browser ? Rizal -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] asking about .exe file
yes - look at system(), exec() and backtick in the manual (the last one goes under a different name, I believe) -Original Message- From: wong [mailto:[EMAIL PROTECTED]] Sent: Monday, April 08, 2002 11:58 AM To: [EMAIL PROTECTED] Subject: [PHP] asking about .exe file Can php execute .exe file under dos and view result on the browser ? Rizal -- 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] Disabling bars on Browser
Wow, you really feel like your better than everyone here don't you.. You rarely even give an answer that isn't blatent criticism of what someone posted or their ability to find information. You really need to stop. Bob Justin French [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... This is the wrong group/list for this post. The disabling of bars, or any sort of browser feature/appearance is NOT PHP. PHP is a server side langauge. Commonly, you would use JavaScript for such stuff, so I recommend you check out the millions of JavaScript sites and newsgroups on the web. on 08/04/02 8:29 AM, David Johansen ([EMAIL PROTECTED]) wrote: I was just wondering if there was any way to turn off the bars at the top of the browser window with PHP. If not does anyone know a way that I could make it so that I could pass information from a form to window that I pop open with javascript. I would either need some way to make the window look just like a window that was popped up with this: SCRIPT LANGUAGE=javascript window.open('https://secure.authorize.net/gateway/transact.dll', 'joe', config='toolbar=0,menubar=0,directories=0,location=0') /SCRIPT or some way I could pass the info from a form to that opened page. Thanks, Dave -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] xml-rpc for windows?
nope. that was the first place i looked. thanks though! Tyler Longren [EMAIL PROTECTED] wrote in message 002601c1dea0$c403edd0$0101a8c0@nightengale">news:002601c1dea0$c403edd0$0101a8c0@nightengale... Hi, I think the file you're looking for is located somewhere in the zip file for Windows. At least I've heard it was in php 4.1.0. Good luck, Tyler Longren Captain Jack Communications [EMAIL PROTECTED] www.captainjack.com - Original Message - From: dietrich [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Sunday, April 07, 2002 11:29 PM Subject: [PHP] xml-rpc for windows? does anyone know where i could find an XML-RPC-EPI dll? thx, dietrich -- 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: FW: [PHP] - REPOST - Flock manual clarification please ;-)
Ok, that makes sense to me now. I see how you could lose some data. Do you have any opinions on what a good algorithm might be for getting locks without the potential for overwriting data? I suppose I could create a second lock file which I would open using r - then, wait for a lock on the lock file and then go on with any processing on the actual data file. After the processing is done release the lock on the lock file. Perhaps there are better ways to do this. What do you think? Matt Friedman Web Applications Developer www.SpryNewMedia.com -Original Message- From: Jim Winstead [mailto:[EMAIL PROTECTED]] Sent: Sunday April 7, 2002 8:27 PM To: [EMAIL PROTECTED] Subject: Re: FW: [PHP] - REPOST - Flock manual clarification please ;-) Matt Friedman [EMAIL PROTECTED] wrote: In regards to the snip above, under what circumstances might you have to create a separate lock file? Is this an OS issue? Is it an issue when concurrency is high? The manual says you may have to; I am looking for some clarification as to when exactly you may have to follow the snip advice. when you do an fopen(file,w), it truncates the file -- before you can call flock(). so if one process locks the file, and starts writing data, a second one could just come along and blow away all or part of the data even though the first still has it locked. by the time the second process calls flock() and notices that the first has it locked, it has already truncated the file. jim -- 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] Disabling bars on Browser
Bob, I don't think I'm better than anyone on this list at all. We all here to learn, and help when we can. In fact, I also made the mistake of asking the wrong questions in here when I first joined. It was pointed out to me that I was off topic, and I learnt from my mistakes. I don't know if you're a member of any other lists, but most lists do not tolerate any off topic posts, and they usually respond with a flame -- the Perl groups being an excellent example. The reason why? High volume lists like this need to be kept on topic, in order to remain a valued resource, and to keep the valued contributors on the list. If the list becomes cluttered, or if the experts have to wade through too much bullshit, they become frustrated and leave. The fact is that this list has been highly tolerant of off topic posts, but the traffic in the group is becoming a lot higher, and MANY contributors have welcomed the concept of guidelines and trimming the list down to on-topic posts, wherever possible. I'm sorry if you don't feel the same way. I don't believe I was rude, and I did advise them what topics it did relate to. Perhaps the problem is that I didn't use enough :)'s or list thousands of links to JavaScript newsgroups?? Gee, sorry. As far as this goes: You rarely even give an answer that isn't blatent criticism of what someone posted or their ability to find information. a) I've only ever made THREE posts about OT posts, compared to the 100's of (hopefully) helpful on-topic posts, some of which took quite a lot of time to prepare. b) I was recently congratulated in public and private by many users for finally speaking up a little. I've only received one complaint so far, and that would be you. Justin French Creative Director http://Indent.com.au on 08/04/02 12:09 PM, [EMAIL PROTECTED] ([EMAIL PROTECTED]) wrote: Wow, you really feel like your better than everyone here don't you.. You rarely even give an answer that isn't blatent criticism of what someone posted or their ability to find information. You really need to stop. Bob -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Disabling bars on Browser
Hi, Yeah, it looks like I appeared a little harsher than I intended, and I'll try not to do that again, but the subject line, and the message reek of JavaScript: I was just wondering if there was any way to turn off the bars at the top of the browser window with PHP. If not does anyone know a way that I could make it so that I could pass information from a form to window that I pop open with javascript. I didn't read the whole thread, and it looks like it went off in a tangent from there. It was not my intention to flame this guy, just point him in the right direction. Luckily, he's found what he's after, and all is well. Justin French on 08/04/02 11:40 AM, Leif K-Brooks ([EMAIL PROTECTED]) wrote: It looks like you didn't even read the message. He knew how to do it with javascript, but he needed to pass information to it, and he wanted to know that! And, even if he was wrong, you don't need to be so harsh! We aren't born knowing binary! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Phone number validation
I'd just add that validating international numbers against any sort of list is bound to lead to extreme annoyance. Even telephone companies have trouble keeping track of changes. Not to mention people who will just put in valid-format-but-false numbers when they are required No stranger on the Internet is trustworthy enough to give my real phone number. TjL -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Workaround for no cron?
Leif K-Brooks [EMAIL PROTECTED] wrote: I have to wait for my host to compile php as binary for cron to work with php, and a lot of things on my site depend on cron. It's not my favorite solution from a security standpoint, but you could call the PHP scripts from cron using wget or lynx. wget even supports HTTP authentication and I *think* lynx does as well so you can password protect the scripts using .htaccess. And I'm assuming you have cron access since if you don't, having your host install PHP as a CGI won't cure that. g Does anyone have some sort of code that I could put at the top of all my pages so when they get visited, it checks to see if a script has been executed yet this time petiod, and if not yet, it does? Better to teach a man to fish...? Either create a db entry or text file entry with the timestamp of the last run of the scheduled script and have your calling scripts check the timestamp to see if it's time to run. Or any type of workaround for not having cron? Thanks! You just need access to a machine (can even be a Windows desktop) which can launch a URL at a specified time or you just need someone who can do the same via a cron job on one of their boxes. Hope that helps. -- Steve Werby President, Befriend Internet Services LLC http://www.befriend.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: PHP from HTML
HI! Your problem is just the same as the case with counters, banners and so Exatctly! I need this, but with counters and banners I can return GIF file so form HTML I can say IMG SRC=server1..., but I need to send (get) som text not picture. 1. Instead of ? you could use server side includes (this would work on SERVER2 side) I can't use include statement because server 2 dos not have PHP! 2. Some Javascript file, which could be downloaded from SERVER1, like SCRIPT SRC=...SERVER1... I have tried that but it dosn't work??? Any ideas?? 3. Use IFRAME This is something new! I will tired it with this. It seems like frames (frames arnt my prifered choise; hm). Thanks! MATJAZ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Disabling bars on Browser
On Monday 08 April 2002 07:00, David Johansen wrote: I would love to use a class. Where can I find one? I've posted on here several times asking for examples or base code that work with Authorize.net but no one ever responds. If you could point me to some that'd be great. 1) Ever tried google? I just did, searched for php class authorize.net and it came up with more than one promising result. Rather than posting and waiting for someone to do your homework you could have done it yourself. 2) ...but no one ever responds, aside from the fact that it is untrue (there were responses to your posts, don't know whether they were useful to you), people usually respond when they have something positive to contribute. You ask a question Does anyone know where I can get a class to work with Authorize.net?, you don't want all list members replying No I don't. -- Jason Wong - Gremlins Associates - www.gremlins.com.hk Open Source Software Systems Integrators * Web Design Hosting * Internet Intranet Applications Development * /* Tallulah Bankhead barged down the Nile last night as Cleopatra and sank. -- John Mason Brown, drama critic */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: PHP from HTML
On Sun, 7 Apr 2002 20:03:42 +0200, Matja¾ Prtenjak [EMAIL PROTECTED] wrote: SERVER1 with PHP some file with name xTest.php xTest.php: ? echo(Hi from SERVER1); ? SERVER2 without PHP some file with name file1.html file1.html: html body Server1 is saying : ? /body /html How can I make HTML file (on SERVER2) say 'Server1 is saying : Hi from SERVER1'? One possibility is an IFRAME. Unfortunately, IFRAME may not be compatible with all of the browsers you need to support and may cause undesirable scrolling effects, so I'd test carefully. One more compatible workaround would be to have your PHP return JavaScript: script lang=javascript1.1 document.write(Hello from Server1); /script In the HTML page on server2: script src=http://server1/xTest.php;/script Chris -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] mod_php4
Will be any changes to mod_php4 since the release of apache 2.0.35? I wanted to compile it (freebsd ports) with a apache 2.0.33 and I had problems while compiling. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php