[PHP] Form refresh problem
Hi Guys I'm having a bit of a problem with form submission. I'm creating an opinion poll, and the user's vote is submitted as a form back to the originating page. I'm using !isset to see if the form has been submitted and if so, updating the database and showing the current results My problem is that a user, having voted once, can keel clicking refresh in their browser and the form data keeps getting sent, incrementing the poll results each time Is there a way to kill form data once it;s been posted, or is there a better way of doing what I am trying to accomplish? Many thanks Lucas Young -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Fwd: Help - removal of trailing zeros from double integer field
Dear friends, I am accessing MySQL database using apache and php. I have to display a double integer field without trailing zeros. The number of digits after the decimal point varies. I have tried searching the archive and did not get any previous questions. Kindly help me in this regard. Thanking you. Sincerely, Raveendra Reddy B National Law School Bangalore India E-mail: [EMAIL PROTECTED] - End forwarded message - -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Question about session_register()
My question is, when the user first visit, a session created, and I register the variable. On the second, or following hits, to use the session variable, I also need "session_start", but should I still need to call session_register() for each hit? No, once you register it, it's there unless you 'unregister' it. By Day:|By Night: Don't miss the Zend Web Store's| There's not enough room here... Grand Opening on January 23, 2001! | Start here: http://www.zend.com| http://l-i-e.com/artists.htm -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Session problem?
function add_toCart($id,$array) { session_register("OBJECT"); $c = new Configurator; $c-readConfig($id); $OBJECT = serialize($c); header("Location: Cart.php"); echo "Redirecting..." } Unfortunately, the session file (in /tmp) is always empty after this function executes. I'm using PHP 4.0.4 with --enable-trans-sid. I don't think you can do a Location and a Cookie in the same page, and the Sessions are done with Cookies, so... Don't do that. Sorry. By Day:|By Night: Don't miss the Zend Web Store's| There's not enough room here... Grand Opening on January 23, 2001! | Start here: http://www.zend.com| http://l-i-e.com/artists.htm -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Using a variable in a variable or as the second part of an array?
I need to simulate this effect: $array[$i] or \$something . $i, and have it return $checkbox1 $checkbox2 etc. on up in a while loop. Just doing it doesn't seem to work, but does anyone know of any work arounds? Or just the keyword I should be looking for to search the manual? You could be using "variable variables" to do that, but for checkboxes, it's way more better to use arrays: INPUT TYPE=CHECKBOX NAME=checkbox[1] VALUE=42 INPUT TYPE=CHECKBOX NAME=checkbox[2] VALUE='Life, the Universe, and Everything' Now your processing page can just iterate through $checkbox: while (list($key, $value) = each($checkbox)){ echo "$key -- $value was checkedBR\n"; } Only thing to watch out for -- If nothing is checked, $checkbox won't be an array, and each() will give an error message. So add this above that: if (!isset($checkbox)){ $checkbox = array(); } This checkbox/array stuff is in the FAQ, so read that http://php.net/FAQ.php and the "variable variables" is in the online manual also. I have a form being generated from a database. For every entry in the database, there'll be a checkbox in the form. Basically, I need a way of accessing the values of that checkbox (any or all of the checkboxes can be checked, too). The names of the checkbox would increment up like checkbox1 checkbox2 etc. Since I have no clue how many people are in the database, that increment needs to be some sort of variable, so I can read the value from that checkbox (whether or not it's checked) when the form is submitted. Did that make any sense? Sorry I was so vague. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Image problem
Can anyone tell me how to display both jpg and gif images. Basically, what i've got is: img src="$filedir/$CUserName".jpg Now, I know I probably need slashes in there and I played around with it but no luck. Where do I put them? TIP: Use "View Source" in your browser to see what the IMG tag looks like. I suspect you've forgotten that you're not in PHP mode, and are just sending a very oddly-named image tag, literally: "$filedir/$CUserName" Since the quotes are going there, I guess HTML is going to ignore the .jpg part, or treat it as an unkown attribute. I'm guessing you want: img src="?php echo $filedir, '/', $CUserName, '.jpg';?" -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] PHP Parse MySQL Field???
I have a BLOB field in a MySQL database that I want to parse into my page using PHP. For instance, in this field might be the following: ? echo "test"; ? So when I access this field in PHP I want it to display "test". Is this possible? Yeah. That's called "eval" (short for 'evaluate') Basically you can make PHP execute arbitrary chunks of more PHP code. NOTE: Letting web-surfers insert PHP code into your database to be evaluated later is really high on the Bad Idea list... Actually, doing this on a web-site where you're not pretty sure the database itself is pretty secure from not only surfers but also other potentially malicious co-users on the same box... It's just too easy for them to be able to put mean code in your database... http://php.net/eval I *think* it goes like this: ?php $php = 'echo "Hi";'; eval($php); ? Never used it myself... By Day:|By Night: Don't miss the Zend Web Store's| There's not enough room here... Grand Opening on January 23, 2001! | Start here: http://www.zend.com| http://l-i-e.com/artists.htm -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Help, can't seem to get this write
function downloadfile($url, $imageDir) { if(!$file = fopen($url , "r")) { echo ("couldn't open $url\n"); } else { #fpassthru($file); if($file2 = fopen("/www/sinead/images/Full/Sinead200.jpg", "w")) { $content=fread($file, filesize("$file")); fwrite($file2, $content, filesize("$file")); Having quotes on the $file arguments to filesize() is not right... Hey, doesn't filesize() take the *path* to a file, not a file pointer? Yeah, it does: http://php.net/filesize So, like, you're asking for the filesize of a file named '1' or whatever the file pointer id number is. Actually, I don't think you can get a filesize() of a URL anyway... You're going to just have to get like a million bytes or whatever you think convenient, and loop until you got it all. echo ("$file2 created"); } } } ? By Day:|By Night: Don't miss the Zend Web Store's| There's not enough room here... Grand Opening on January 23, 2001! | Start here: http://www.zend.com| http://l-i-e.com/artists.htm -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] ibase_num_fields() -a workaround ?
ibase_num_fields() isn't functional in php 4 - anyone have any ideas to work around this ? I'm checking the number of results for a query to check if a user/password is correct -I suppose I could just do a fetch_row() on the result and test if thats empty or not - but I'll only do that as a last resort select count(*) from users where userid = '$userid' and password = password('$password') might be a good choice. Actually, I usually like to check userid first, and then password -- I prefer to inform the user if their username is wrong or just the password. Lord knows I've got enough usernames/passwords on all these darn sites that I sure appreciate it when somebody tells *me* I ain't even remembering the username right, much less the password. By Day:|By Night: Don't miss the Zend Web Store's| There's not enough room here... Grand Opening on January 23, 2001! | Start here: http://www.zend.com| http://l-i-e.com/artists.htm -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Form refresh problem
My problem is that a user, having voted once, can keel clicking refresh in their browser and the form data keeps getting sent, incrementing the poll results each time Is there a way to kill form data once it;s been posted, or is there a better way of doing what I am trying to accomplish? The easiest way to stop most multiple votes is to send them a Cookie when you get their vote. If they have that Cookie, they can't vote again. That won't stop a semi-serious cheater -- He'll just not accept the Cookie or delete it after he gets it or... If you need better than this minimal "honesty" factor, it gets tricky... And *NOTHING* online (via HTTP, anyway) can be anywhere close to a reliable voting method. Even Florida had it better. :-) By Day:|By Night: Don't miss the Zend Web Store's| There's not enough room here... Grand Opening on January 23, 2001! | Start here: http://www.zend.com| http://l-i-e.com/artists.htm -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP-CVS] cvs: php4 /ext/pgsql pgsql.c
sas Sat Jan 20 02:10:50 2001 EDT Modified files: /php4/ext/pgsql pgsql.c Log: Revert last completely broken patch. Index: php4/ext/pgsql/pgsql.c diff -u php4/ext/pgsql/pgsql.c:1.83 php4/ext/pgsql/pgsql.c:1.84 --- php4/ext/pgsql/pgsql.c:1.83 Thu Jan 18 14:17:05 2001 +++ php4/ext/pgsql/pgsql.c Sat Jan 20 02:10:50 2001 @@ -17,7 +17,7 @@ +--+ */ -/* $Id: pgsql.c,v 1.83 2001/01/18 22:17:05 derick Exp $ */ +/* $Id: pgsql.c,v 1.84 2001/01/20 10:10:50 sas Exp $ */ #include stdlib.h @@ -75,8 +75,6 @@ PHP_FE(pg_loreadall,NULL) PHP_FE(pg_loimport, NULL) PHP_FE(pg_loexport, NULL) - PHP_FE(pg_lolseek, NULL) - PHP_FE(pg_lotell, NULL) PHP_FE(pg_put_line, NULL) PHP_FE(pg_end_copy, NULL) #if HAVE_PQCLIENTENCODING @@ -1735,59 +1733,6 @@ } else { RETURN_FALSE; } -} -/* }}} */ - -/* {{{ proto int pg_lolseek(int objoid, int offset, int whence) - Seek into a postgres large object*/ -PHP_FUNCTION(pg_lolseek) { - val **pgsql_lofp, **seek_offset, **seek_whence; - gLofp *pgsql; - - switch(ZEND_NUM_ARGS()) { - case 3: - if (zend_get_parameters_ex(3, pgsql_lofp, seek_offset, seek_whence)==FAILURE) { - RETURN_FALSE; - } - convert_to_long_ex(seek_offset); - convert_to_long_ex(seek_whence); - break; - default: - WRONG_PARAM_COUNT; - break; - } - - ZEND_FETCH_RESOURCE(pgsql, pgLofp *, pgsql_lofp, -1, "PostgreSQL large object", le_lofp); - if (lo_lseek((PGconn *)pgsql-conn, pgsql-lofd, Z_STRVAL_PP(seek_offset), Z_STRVAL_PP(seek_whence))) { - RETURN_TRUE; - } else { - RETURN_FALSE; - } -} -/* }}} */ - -/* {{{ proto int pg_tell(int objoid) -return current offset into large object */ -PHP_FUNCTION(pg_lotell) { - long int offset; - zval **pgsql_lofp; - pgLofp *pgsql; - - switch(ZEND_NUM_ARGS()) { - case 1: - if (zend_get_parameters_ex(1, pgsql_lofp)==FAILURE) { - RETURN_FALSE; - } - break; - default: - WRONG_PARAM_COUNT; - break; - } - - END_FETCH_RESOURCE(pgsql, pgLofp *, pgsql_lofp, -1, "PostgreSQL large object", le_lofp); - - ffset = lo_tell((PGconn *)pgsql-conn, pgsql-lofd); - ETURN_LONG (offset); } /* }}} */ -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP-CVS] cvs: php4 /ext/pgsql pgsql.c php_pgsql.h
+PHP_FUNCTION(pg_lolseek) { + val **pgsql_lofp, **seek_offset, **seek_whence; ^^^ + gLofp *pgsql; ^ + long int offset; .. + ffset = lo_tell((PGconn *)pgsql-conn, pgsql-lofd); ^ + ETURN_LONG (offset); ^ Derick, this patch is completely broken. I'll revert it for now, so that the extension is going to compile again. - Sascha -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP-CVS] cvs: php4 /ext/pgsql pgsql.c php_pgsql.h
On Sat, 20 Jan 2001, Sascha Schumann wrote: +PHP_FUNCTION(pg_lolseek) { + val **pgsql_lofp, **seek_offset, **seek_whence; ^^^ + gLofp *pgsql; ^ + long int offset; .. + ffset = lo_tell((PGconn *)pgsql-conn, pgsql-lofd); ^ + ETURN_LONG (offset); ^ Derick, this patch is completely broken. I'll revert it for now, so that the extension is going to compile again. Strange, I compiled it at home, and it gave me no troubles, must be a wrong regexp to replace spaces by tabs then. I'll look into it later. Derick -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Profanity Filter
In article 94adfp$5le$[EMAIL PROTECTED], Stephan Ahonen [EMAIL PROTECTED] wrote: I'd make it an array: $filter = array(moron, idiot, pratt); foreach($filter as $badword) { if (strstr($name, $badword)) { do this if it contains one of the bad words } else { do this if it doesn't } } But wouldn't this approach have its drawbacks, too? For example, I live in Kiel, Germany, about 20km from a town called Wankendorf. Presumably I wouldnt be able to say this. Nik -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Spell checker?
In article [EMAIL PROTECTED], Brandon Orther [EMAIL PROTECTED] wrote: Check here, I have never messed with it just ran into it the other day. I hope it helps. http://www.php.net/manual/en/ref.pspell.php Sort of. Thanks go to Kristi as well for spotting this, PHP has so many bult in functions already! The only problem is that the site host doesn't have this functionality installed, and as its a free host, I won't bother asking them. What I will probably have to do is make my own function/class using a great big list of words. Does anyone know where I could find a text list of every word in the English language ;-) Thanks, Nik -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Re: PHP Parse MySQ: Field???
Richard, THANK YOU!!! I agree -- this method provides many security vulnerabilities and I appreciate the warning. The database is definitely secure -- from web-surfers and others. Also, I intend to parse the information going into the database myself -- using a simple parse engine I will create -- before making it accessible to PHP later. :) I have designed a class-oriented language based on PHP, and these are the functions I want available to my clients. I will filter out all other commands that could be considered malicious. They will only have access to the functions and variables used in the class language I wrote when I am done. What do you think? Thankz again! Rob List: php-general Subject: Re: [PHP] PHP Parse MySQL Field??? From: "Richard Lynch" [EMAIL PROTECTED] Date: 2001-01-20 9:27:12 [Download message RAW] I have a BLOB field in a MySQL database that I want to parse into my page using PHP. For instance, in this field might be the following: ? echo "test"; ? So when I access this field in PHP I want it to display "test". Is this possible? Yeah. That's called "eval" (short for 'evaluate') Basically you can make PHP execute arbitrary chunks of more PHP code. NOTE: Letting web-surfers insert PHP code into your database to be evaluated later is really high on the Bad Idea list... Actually, doing this on a web-site where you're not pretty sure the database itself is pretty secure from not only surfers but also other potentially malicious co-users on the same box... It's just too easy for them to be able to put mean code in your database... http://php.net/eval I *think* it goes like this: ?php $php = 'echo "Hi";'; eval($php); ? Never used it myself...
[PHP] getting from PHP the vars that are in the memory during the execution of the script...
Hey! Is it possible to get the names of the variables allocated in the memory? thank you, Rom
Re: [PHP] Running java under php4 (PHP4 ext/java)
WAHO! It works! Thanks Alex!! Fraser On Fri, 19 Jan 2001, Alex Akilov wrote: Fraser, Yes, you must set your LD_LIBRARY_PATH prior to running ldd. In a terminal, export LD_LIBRARY_PATH=/home/local/java/jdk1.2.2/jre/lib/i386:/home/local/java/jdk1.2.2/jre/lib/i386/classic:/home/local/java/jdk1.2.2/jre/lib/i386/native_threads and rerun ldd libjava.so. If everything works, leave LD_LIBRARY_PATH alone and in your php.ini reset your java.library.path to the following: java.library.path=/usr/local/lib/php/extensions/no-debug-non-zts-20001214 Run php path to php src/ext/java/jver.php from the command line to verify that things are working (that is, provided your php and php.ini are visible from whatever directory you're running). If everything works, you can try combining LD_LIBRARY_PATH and your java.library.path into a single specification (i.e. java.library.path=/usr/local/lib/php/extensions/no-debug-non-zts-20001214:/home/local/java/jdk1.2.2/jre/lib/i386:/home/local/java/jdk1.2.2/jre/lib/i386/classic:/home/local/java/jdk1.2.2/jre/lib/i386/native_threads) and you should be good to go. If the latter doesn't work, then your php.ini is not being found or java.library.path is not being interpreted correctly. An alternative is to set LD_LIBRARY_PATH in your (root?) profile to include all the directories above (or better yet, add them to /etc/ld.so.conf) and restart your system. Alex -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Pre-loading HTML form w/ mySQL data
There you go: ?php // DB connection $dbconnection = mysql_connect ("IP ADDRESS OR HOST+DOMAIN NAME","USERNAME - DEFULT is root","") or die ("Couldn't connect to Database."); // Select DB $database = mysql_select_db ("NAME OF THE DATABASE", $dbconnection) or die ("Couldn't select Database."); // Query $query = "SELECT * FROM TABLE WHERE COND = TRUE; // execute query $query_result = mysql_query ($query,$dbconnection) or die ("Couldn't execute query in Database."); // fetching values with while while ($row = mysql_fetch_array ($query_result)) { $VAR1= $row["COLUMN1"]; $VAR2 = $row["COLUMN2"]; or a FOR tht will fetch all the values (if is more than one) in $VAR1 and $VAR2 } echo" FORM ACTION = \"\" INPUT TYPE = text NAME=name VALUE=$VAR1 INPUT TYPE=text NAME=telephone VALUE=$VAR2 /FORM ? - Original Message - From: Anthony Rodriguez [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Saturday, January 20, 2001 8:06 AM Subject: [PHP] Pre-loading HTML form w/ mySQL data I've a mySQL db with user information (e.g.: name, address, phone, etc.). I'd like to pre-load an HTML form with the existing user information in order to enable the users to update some of the information. Are there any PHP sample scripts that I may look at to do this? Thank you! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Macromedia UltraDev 4 MySQL connection
Hi. I'm tearing my hair out trying to get UltraDev to talk to MySQL and I know there are some Dreamweaver and MySQL users here. I think I need some help installing a JDBC driver for this product. Any help or sympathy is greatly appreciated. Thanks, Murph
Re: [PHP] Profanity Filter
Hi, I`m trying to use the code below for my profanity checker but it keeps returning a parse error on the second line 'while ((list etc' Can anyone see anything wrong?? TIA Ade $done=false; while ((list($key, $val)=each($words)) and $done===false) { $done=strpos(strtolower($name), $val); }; if ($done!==false) { // Oops! Bad name. } else { // Okay, valid name. }; -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Please: XTemplate help?
Hi Debreceni, I need to use a template parser, and XTemplate looks like it will do what I need, but I'm not sure how. I can use mysql_fetch_array to produce an array of field_name:value. If I use {field} names in the html template, can I use XTemplate to take the array and parse? This is what I have so far - please look at the ASSIGN step ? $id=1; //parameter for sql select, determines which row is selected $user="user"; $pass="pass"; $database="database"; $sql="select * from table where id = $id"; //returns ONE row (id is a PK) $link_id = mysql_connect($database); //identify connection handle if (!$link_id) { die(sql_error()); } //test for connection handle else { mysql_select_db($database, $link_id) } //select database $result = mysql_query($sql, $user, $pass); //return row to php $page_array = mysql_fetch_array($result); //this creates array of field name:data, //eg $page_array[firstfield] has value of 'firstfield' for $id require "xtpl.p"; //include XTemplate engine require "html.xtpl"; //html layout file with field names e.g. {firstfield} $xtpl-assign($page_array); //HELP! How is this step done? //I already have an array that assigns field //names to data elements, how can I skip this? //I don't want to assign each element since then //I would need one .p page for each .xtpl page $xtpl-parse("main");//replace {field} with matching result row element $xtpl-out("main");` //send final html page to browser ? Does this make sense? Thanks in advance for any help! Regards, Jaxon -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Spell checker?
Plain Text Dictionary: http://www.mso.anu.edu.au/~ralph/OPTED/ Word list: http://www.antionline.com/archives/text/word-lists/ I just found these by searching through Google you may find better. Kristi - Original Message - From: "Nik Gare" [EMAIL PROTECTED] To: "PHP User Group" [EMAIL PROTECTED] Sent: Saturday, January 20, 2001 8:10 AM Subject: Re: [PHP] Spell checker? In article [EMAIL PROTECTED], Brandon Orther [EMAIL PROTECTED] wrote: Check here, I have never messed with it just ran into it the other day. I hope it helps. http://www.php.net/manual/en/ref.pspell.php Sort of. Thanks go to Kristi as well for spotting this, PHP has so many bult in functions already! The only problem is that the site host doesn't have this functionality installed, and as its a free host, I won't bother asking them. What I will probably have to do is make my own function/class using a great big list of words. Does anyone know where I could find a text list of every word in the English language ;-) Thanks, Nik -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Help w/ regular expressions for banned words
In article [EMAIL PROTECTED], [EMAIL PROTECTED] (Team JUMP) wrote: $num=count($bannedwords); for($i=0;$i$num-1;$i++) { $string = eregi_replace("\b$bannedwords[$i]\b","[censored]",$string); } For whatever reason, no word in $bannedwords will match in the string. I've tested it with simple expressions like "\btest\b" and it will not match the word "test". Have you tried it with either "[:space:]$bannedwords[$i][:space:] or "\$bannedwords[$i]\" yet? Also, I think using a foreach($bannedwords as $current_word) would be a better choice here; more compact, and loops all the way to the end of the array even when the numerical index does not follow the expected sequence. (BTW, if you want to stick with the for() and you know the index numbers will always be sequentially zero to whatever, then your test should be just $i$num. Otherwise, you're skipping the final loop.) -- CC -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] HELP!. INstalling PHP4 on a Cobalt RAQ 2!
Can you install flex and bison? On Sat, 20 Jan 2001, Trunkz Santai wrote: Hi Im trying to isntall PHP4 on my Raq 2 but Im not having much luck. I was wondering if someone here could assist me. I uploaded apache and configured it and it worked fine. Its running in /usr/local/apache-x.x.x I uploaded the php zipped binary by ftp to /home/sites/home then mv php-4.0.4.tar.gz /usr/local then I unpacked it gunzip php-4.0.4.tar.gz then tar vxf php-4.0.4.tar It unpacked fine. I changed firectories cd php-4.0.4 I did the configure thing ./configure --with-mysql --with-apache=../apache_1.3.14 --enable-track-vars I pressed enter and it said loading config.cache and a long list of things came up. Then it ended and this was what I got. checking for working makeinfo... found checking whether to enable maintainer-specific portions of Makefiles... no checking host system type... mipsel-unknown-linux-gnu checking for gawk... gawk checking for bison... bison -y checking bison version... 1.25 (ok) checking for gcc... gcc checking whether the C compiler (gcc ) works... yes checking whether the C compiler (gcc ) is a cross-compiler... no checking whether we are using GNU C... yes checking whether gcc accepts -g... yes checking how to run the C preprocessor... gcc -E checking for AIX... no checking for gcc option to accept ANSI C... none needed checking for ranlib... ranlib checking whether gcc and cc understand -c and -o together... yes checking whether ln -s works... yes checking for flex... no checking for lex... no ./configure: flex: command not found checking for flex... lex checking for yywrap in -ll... no checking lex output file root... ./configure: lex: command not found configure: error: cannot find output from lex; giving up [root php-4.0.4]# If anyone can help me i would greatly appreciate it. Thanks. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Help w/ regular expressions for banned words
try this; I am working on the last word... ereg replace is not finding the REGEX "\.$" - anyone has a clue? ? $bannedwords = array ("dadada", "dedede", "dididi"); $string = "Dadada in this world dadaDA is not permitedadada because this very deDede peoplededede that appears in our DIDIDi world dedede."; $num=count($bannedwords); /* echo $num."BRBR"; echo $string."BRBR"; for($i=0;$i$num;$i++) { $string = eregi_replace("{$bannedwords[$i]}","[censored]",$string); } */ echo $string."BRBR"; // take out the damn ; . : chars on the end of the string and save for later /* elseif (ereg("\;$",$string)) { ereg_replace("\;$","",$string); $semmicolon = TRUE; } elseif (ereg("\:$",$string)) { ereg_replace("\:$","",$string); $colon = TRUE; } else { $dot = TRUE; $semmicolon = TRUE; $colon = TRUE; } */ $hasdot = ereg("\.$",$string); if ($hasdot) { ereg_replace("\.$","test",$string); $dot = TRUE; } // the middle words reset($bannedwords); foreach ($bannedwords as $word) { $string = eregi_replace(" {$word} "," [censored] ",$string); } echo $string."BRBR"; // test the start word and exchange reset($bannedwords); foreach ($bannedwords as $word) { $string = eregi_replace("^{$word}","[censored] ",$string); } echo $string."BRBR"; // test the end word and exchange reset($bannedwords); foreach ($bannedwords as $word) { $string = eregi_replace("{$word}$","[censored]",$string); } echo $string."BRBR"; echo $dot."BR"; echo $hasdot; ? - Original Message - From: Team JUMP [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Saturday, January 20, 2001 12:35 PM Subject: Re: [PHP] Help w/ regular expressions for banned words Thanks for your help. Unfortunately, [:space:]$bannedwords[$i][:space:] would not work, since I need to also check for the first and last word. In a last-case scenario I could write special code for the first and last word, but that may get ugly with bug-checking... but I've already tried "\s+$bannedwords[$i]\s+" to no avail. I believe [:space:] is just a substitute for \s+, right? Yeah, I've tried \$bannedwords[$i]\ too, unfortunately. Like I said before, eregi_replace("a","[censored]",$string) makes a match, but eregi_replace("\a\","[censored]",$string) or eregi_replace("\ba\b","[censored]",$string) does not. Most odd. Thanks for your help, though. Anyone else have suggestions? --Neal on 1/20/01 12:20 PM, CC Zona at [EMAIL PROTECTED] wrote: In article [EMAIL PROTECTED], [EMAIL PROTECTED] (Team JUMP) wrote: $num=count($bannedwords); for($i=0;$i$num-1;$i++) { $string = eregi_replace("\b$bannedwords[$i]\b","[censored]",$string); } For whatever reason, no word in $bannedwords will match in the string. I've tested it with simple expressions like "\btest\b" and it will not match the word "test". Have you tried it with either "[:space:]$bannedwords[$i][:space:] or "\$bannedwords[$i]\" yet? Also, I think using a foreach($bannedwords as $current_word) would be a better choice here; more compact, and loops all the way to the end of the array even when the numerical index does not follow the expected sequence. (BTW, if you want to stick with the for() and you know the index numbers will always be sequentially zero to whatever, then your test should be just $i$num. Otherwise, you're skipping the final loop.) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Re: Fwd: Help - removal of trailing zeros from double integer field
This might help. $no_trailing_zeroes = preg_replace("/0+$/","",$trailing_zeroes); Dear friends, I am accessing MySQL database using apache and php. I have to display a double integer field without trailing zeros. The number of digits after the decimal point varies. I have tried searching the archive and did not get any previous questions. Kindly help me in this regard. Thanking you. Sincerely, Raveendra Reddy B National Law School Bangalore India E-mail: [EMAIL PROTECTED] - End forwarded message - -- http://www.artwells.com/ That which indicates nothing introduces everything. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Re: PHP site on CD-ROM
Just create it online in such a way that you can spider your whole site and burn it to CD. Granted you will lose the searchability of the DB, but the contents would all be there, and could easily be indexed so that you could still find what you are looking for. Create one page that has a link to all of the DB ID's, titles, descriptions, etc. Worse case scenario you could still use CTRL-F to find-in-page the text you are looking for. Granted this is clumsy compared to what you had in mind, but that is a long trip. You would be better off to use Delphi, VB, or something similar to write a binary app and copy the contents of the MySQL DB to something appropriate for your programming language and application. $0.02. Brian I wonder if it's possible to adapt the CGI version of PHP as a Netscape plugin, or to associate the extension of php files to some kind of php wrapper. This would require distributing a browser with the CD for this specific CD, but it could work. For a Unix-only kludge, I found this page, http://home.netscape.com/newsref/std/x-remote.html It seems to me, by playing with with the application associations, one could get php to write to a temporary file, and then use netscape's -remote openFile to read it. I imagine, though, that if this works, it would be rather unstable. MySQL would be a whole 'nother can of worms. Just playing with ideas. [EMAIL PROTECTED] http://www.artwells.com/ That which indicates nothing introduces everything. On Fri, 19 Jan 2001, Philip Apostol wrote: Can I run a PHP/Apache/MySQL services on a CD-ROM. We have PHP scripts that handle queries on a large database. We would like to distribute it on a CD-ROM so they could access the database offline. Is it possible? Or are there any similar solutions for this? Im thinking of a text-file database and access it via javascript but have no much time to study on this. If php can be run on the cd-rom, that would be a better solution. But any solution you posted here will be highly appreciated. Thanks in advance. Philip -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP-CVS] cvs: php4 /pear/Cache Function_Cache.php
sbergmann Sat Jan 20 09:40:06 2001 EDT Modified files: /php4/pear/CacheFunction_Cache.php Log: Fixed two small glitches. Note: The Shared Memory version of Function_Cache does not work correctly at the moment, but I'm on it. Index: php4/pear/Cache/Function_Cache.php diff -u php4/pear/Cache/Function_Cache.php:1.2 php4/pear/Cache/Function_Cache.php:1.3 --- php4/pear/Cache/Function_Cache.php:1.2 Tue Jan 9 17:01:53 2001 +++ php4/pear/Cache/Function_Cache.php Sat Jan 20 09:40:05 2001 @@ -3,7 +3,7 @@ // +--+ // | PHP version 4.0 | // +--+ -// | Copyright (c) 1997-2001 The PHP Group| +// | Copyright (c) 1997, 1998, 1999, 2000 The PHP Group | // +--+ // | This source file is subject to version 2.02 of the PHP license, | // | that is bundled with this package in the file LICENSE, and is| @@ -16,7 +16,7 @@ // | Authors: Sebastian Bergmann [EMAIL PROTECTED] | // +--+ // -// $Id: Function_Cache.php,v 1.2 2001/01/10 01:01:53 ssb Exp $ +// $Id: Function_Cache.php,v 1.3 2001/01/20 17:40:05 sbergmann Exp $ // /** @@ -58,7 +58,7 @@ * * @author Sebastian Bergmann [EMAIL PROTECTED] * @module Function_Cache -* @version $Revision: 1.2 $ +* @version $Revision: 1.3 $ * @access public */ @@ -192,7 +192,7 @@ function cache_set_lifetime( $func_name, $lifetime ) { // check $lifetime argument - if( is_number( $lifetime ) ) + if( is_integer( $lifetime ) ) { // store $lifetime $GLOBALS[ "_cache" ][ "lifetime" ][ $func_name ] = $lifetime; @@ -262,7 +262,7 @@ $shm = shm_attach( CACHE_SHM_KEY, CACHE_SHM_SIZE ); // read cache contents - $cache = shm_get_var( $shm, CACHE_SHM_VAR ); + $cache = @shm_get_var( $shm, CACHE_SHM_VAR ); // release shared memory sem_release( $sem ); -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP-CVS] cvs: php4 /pear/Cache Function_Cache.php
sbergmann Sat Jan 20 09:41:55 2001 EDT Modified files: /php4/pear/CacheFunction_Cache.php Log: Next time without the 'Oops!'. Index: php4/pear/Cache/Function_Cache.php diff -u php4/pear/Cache/Function_Cache.php:1.3 php4/pear/Cache/Function_Cache.php:1.4 --- php4/pear/Cache/Function_Cache.php:1.3 Sat Jan 20 09:40:05 2001 +++ php4/pear/Cache/Function_Cache.php Sat Jan 20 09:41:55 2001 @@ -3,7 +3,7 @@ // +--+ // | PHP version 4.0 | // +--+ -// | Copyright (c) 1997, 1998, 1999, 2000 The PHP Group | +// | Copyright (c) 1997-2001 The PHP Group| // +--+ // | This source file is subject to version 2.02 of the PHP license, | // | that is bundled with this package in the file LICENSE, and is| @@ -16,7 +16,7 @@ // | Authors: Sebastian Bergmann [EMAIL PROTECTED] | // +--+ // -// $Id: Function_Cache.php,v 1.3 2001/01/20 17:40:05 sbergmann Exp $ +// $Id: Function_Cache.php,v 1.4 2001/01/20 17:41:55 sbergmann Exp $ // /** @@ -58,7 +58,7 @@ * * @author Sebastian Bergmann [EMAIL PROTECTED] * @module Function_Cache -* @version $Revision: 1.3 $ +* @version $Revision: 1.4 $ * @access public */ -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] What's wrong with this link?
I realize my slashes are most likely in the wrong spot and i'm new to this PHP stuff so a little help would be appreciated. I get a parse error print "a href=/"showpictures.php?id=PID/"Click Here/a"; Thanks, Mike -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] cookies - not working with Nutscrape
The complete snippet is ? if (isset($ecb)) { if ($ecb = 5) { $val = 1; } else { $val = $ecb; $val++; } } else { $val = 1; } $expires = mktime(12, 00, 00, 12, 31, 2005); setcookie("ecb",$val,$expires,"/",".domain.com",0); ? I've gotten around it for the moment by using a browser detection routine and delivering different methods based on that but that's kind of a dirty hack. -Original Message- From: Richard Lynch [mailto:[EMAIL PROTECTED]] Sent: Friday, January 19, 2001 7:53 PM To: [EMAIL PROTECTED] Subject: Re: [PHP] cookies - not working with Nutscrape What's the rest of your SetCookie look like? By Day:|By Night: Don't miss the Zend Web Store's| There's not enough room here... Grand Opening on January 23, 2001! | Start here: http://www.zend.com| http://l-i-e.com/artists.htm - Original Message - From: Brian V Bonini [EMAIL PROTECTED] To: Richard Lynch [EMAIL PROTECTED]; "Brian V Bonini" [EMAIL PROTECTED] Sent: Friday, January 19, 2001 4:15 PM Subject: RE: [PHP] cookies - not working with Nutscrape That broke em both... -Original Message- From: Richard Lynch [mailto:[EMAIL PROTECTED]] Sent: Friday, January 19, 2001 4:04 PM To: "Brian V Bonini" Subject: Re: [PHP] cookies - not working with Nutscrape Why would this work in IE but not NN (4.08)? If I remove "/" ".mydomain.com" it works with NN but not IE. Vice versa if I leave it in. Keep just the "/", not the domain. They both suck. By Day:|By Night: Don't miss the Zend Web Store's| There's not enough room here... Grand Opening on January 23, 2001! | Start here: http://www.zend.com| http://l-i-e.com/artists.htm -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Flash + PHP
www.thickbook.com is a good start. Last I looked it covered Flash 4, and Flash 5 is quite a bit different. Basically you have PHP print the variables in HTML and Have Flash parse that. Flash can't directly parse PHP variables. It's not difficult once you figure it out. Mike From: "Abe Asghar" [EMAIL PROTECTED] Reply-To: "Abe Asghar" [EMAIL PROTECTED] Date: Fri, 19 Jan 2001 14:41:27 - To: "PHP General List" [EMAIL PROTECTED] Subject: [PHP] Flash + PHP Hey Guys, Anybody have any good links for Flash with PHP simple stuff. Any tutorials or general links that maybe useful. Thanks, Abe -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] What's wrong with this link?
Mike, Read and print this out : http://www.zend.com/zend/tut/using-strings.php It will increase your happiness. Philip On Sat, 20 Jan 2001, Mike Yuen wrote: I realize my slashes are most likely in the wrong spot and i'm new to this PHP stuff so a little help would be appreciated. I get a parse error print "a href=/"showpictures.php?id=PID/"Click Here/a"; Thanks, Mike -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Verifying against a file
Hi, I have used the following code to open a file $fd=fopen("words.txt", "r"); $words = fread($fd, 100); I then convert a string which is passed in a form to this script $FirstName=strtolower("$FirstName"); And now I check to see if the lowercase version of $FirstName contains any of the words from the $words if ($FirstName=="$words") { echo "Bad"; } But it doesn`t seem to want to work, anyone give me a pointer as to where I am going wrong with this?? Ade -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Installing Php/Apache/Win98
I have PHP working like a champ on my WIN 2K computer with IIS. Now I would like to have it on my notebook, so I loaded Apache and have following the instructions from Shanx; however, I get the message that Apache cannot load php4apache.dll. It shows the correct path. What is the best source for help? Todd -- Todd Cary Ariste Software [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Spell checker?
Nik Gare [EMAIL PROTECTED] wrote Does anyone know where I could find a text list of every word in the English language ;-) You could try (also) getting hold of ispell a search on www.google.com/linux or sunsite should get it. You'll need something capable of uncompressing tar archives to peek at it. -- ** Marx: "Why do Anarchists only drink herbal tea?" Proudhon: "Because all proper tea is theft." ** -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Compiling PHP with --with-apxs
Hello, I am trying to compile PHP with the option "--with-apxs" to be able to use both PHP 3 and PHP 4 on the same server.Unfortunately, if I try to use configure with that option ./configure --with-mysql=../mysql --with-ldap=/usr --with-apache=../apache --enable-track-var --with-imap=../imap-4.7 --enable-versioning --with-apxs=/usr/local/apache/bin/apxs I keep getting this error... checking for Apache module support via DSO through APXS... apxs:Error: Sorry, no DSO support for Apache available apxs:Error: under your platform. Make sure the Apache apxs:Error: module mod_so is compiled into your server apxs:Error: binary `/usr/local/apache/bin/httpd'. I did a "httpd -l" and it showed mod_so in the httpd . It gave me this warning at the end WARNING: Your /usr/local/apache/bin/apxs script is most likely broken. Please go read http://www.php.net/FAQ.php3#6.11 and make the changes described there and try again. Tried the changes it gave, had no success with them. Thanks for any help! Sincerely, Jero -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] simple math
11 % 3 On Sat, 20 Jan 2001 [EMAIL PROTECTED] wrote: Lets say I have 11 / 3 answer is 2.667 what if I want to get the remainder of it so 11 / 3 would be 2 is there a built in function for this in PHP? kinda like MOD in Visual Basic? - Thanks -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] MailBomb Problem...
Edit your php.ini file and edit your sendmail_path directive. The default is "sendmail -t -i". Add the correct -o switch (don't remember it offhand) to have sendmail just queue the email instead of trying to deliver right away. Then set up sendmail to deliver the queue at regular intervals. -Rasmus On Sun, 21 Jan 2001, ewiz wrote: I am facing a problem where some users on the server are using php mail() function to mail a list of users in taken from mysql db(around 5000 users, but not spam), but this is getting the system crashed due to excessvie loads and if I limit the delivery load on exim than even geninue mail is getting holded up. so is there anyway to limit the number of emails or delay the mails from the nobody user( which is the apach+php user which mails) or make PHP use a remote server than the local sendmail ? any help would be apperciated. TIA ewiz -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Unique Session Question
Hello, I plan to use session variables to identify if a user is logged in... I know there is an option to set the life of the session but I am looking for a way to end the session five minutes after they have did there last "transaction" with my site... I don't want people that are actively using my site to be logged out after 5 minutes just the folks that are sitting idle... Any ideas, Thanks Randy -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] a text formating cpu question
Christian Reiniger wrote: On Thursday 18 January 2001 23:05, Noel Akins wrote: Question 2: Is there a way for php to detect the cpu speed of a users computer? If you're on a Linux machine you can read /proc/cpuinfo and pick out the speed entry. Linux on the sun sparc64 architexture doesn't always have the cpu speed in /proc/cpuinfo. -- -=-=-=-=-=-=-=-=-=-=-=-=- Michael A. Peters Abriasoft Senior Developer -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP-CVS] cvs: php4 /pear/HTTP Compress.php
chagenbuSat Jan 20 12:50:00 2001 EDT Modified files: /php4/pear/HTTP Compress.php Log: whitespace Index: php4/pear/HTTP/Compress.php diff -u php4/pear/HTTP/Compress.php:1.1 php4/pear/HTTP/Compress.php:1.2 --- php4/pear/HTTP/Compress.php:1.1 Fri Jan 12 07:24:21 2001 +++ php4/pear/HTTP/Compress.php Sat Jan 20 12:49:59 2001 @@ -1,82 +1,82 @@ -?php -/** - * HTTP_Compress:: provides a wrapper around php's output buffering - * mechanisms and also does compression, generates headers - ETag, - * Content-Length, etc. - which may be beneficial to bandwidth - * usage and performance. - * - * @author Mark Nottingham [EMAIL PROTECTED] - * @author Chuck Hagenbuch [EMAIL PROTECTED] - * @version $Revision: 1.1 $ - */ -class HTTP_Compress { - -/** - * Start the output buffer, and make sure that implicit flush is - * off so that data is always buffered. - */ -function start() -{ -ob_start(); -ob_implicit_flush(0); -} - -/** - * Output the contents of the output buffer, compressed if - * desired, along with any relevant headers. - * - * @param boolean $compress (optional) Use gzip compression, if the browser supports it. - * @param boolean $use_etag Generate an ETag, and don't send the body if the browser has the same object cached. - * @param boolean $send_body Send the body of the request? Might be false for HEAD requests. - */ -function output($compress = true, $use_etag = true, $send_body = true) -{ -$min_gz_size = 1024; -$page = ob_get_contents(); -$length = strlen($page); -ob_end_clean(); - -if ($compress extension_loaded('zlib') (strlen($page) $min_gz_size) isset($GLOBALS['HTTP_SERVER_VARS']['HTTP_ACCEPT_ENCODING'])) { -$ae = explode(',', str_replace(' ', '', $GLOBALS['HTTP_SERVER_VARS']['HTTP_ACCEPT_ENCODING'])); -$enc = false; -if (in_array('gzip', $ae)) { -$enc = 'gzip'; -} else if (in_array('x-gzip', $ae)) { -$enc = 'x-gzip'; -} - -if ($enc) { -$page = gzencode($page); -$length = strlen($page); -header('Content-Encoding: ' . $enc); -header('Vary: Accept-Encoding'); -} else { -$compress = false; -} -} else { -$compress = false; -} - -if ($use_etag) { -$etag = '"' . md5($page) . '"'; -header('ETag: ' . $etag); -if (isset($GLOBALS['HTTP_SERVER_VARS']['HTTP_IF_NONE_MATCH'])) { -$inm = explode(',', $GLOBALS['HTTP_SERVER_VARS']['HTTP_IF_NONE_MATCH']); -foreach ($inm as $i) { -if (trim($i) == $etag) { -header('HTTP/1.0 304 Not Modified'); -$send_body = false; -break; -} -} -} -} - -if ($send_body) { -header('Content-Length: ' . $length); -echo $page; -} -} - -} -? +?php +/** + * HTTP_Compress:: provides a wrapper around php's output buffering + * mechanisms and also does compression, generates headers - ETag, + * Content-Length, etc. - which may be beneficial to bandwidth + * usage and performance. + * + * @author Mark Nottingham [EMAIL PROTECTED] + * @author Chuck Hagenbuch [EMAIL PROTECTED] + * @version $Revision: 1.2 $ + */ +class HTTP_Compress { + +/** + * Start the output buffer, and make sure that implicit flush is + * off so that data is always buffered. + */ +function start() +{ +ob_start(); +ob_implicit_flush(0); +} + +/** + * Output the contents of the output buffer, compressed if + * desired, along with any relevant headers. + * + * @param boolean $compress (optional) Use gzip compression, if the browser +supports it. + * @param boolean $use_etag Generate an ETag, and don't send the body if the +browser has the same object cached. + * @param boolean $send_body Send the body of the request? Might be false for +HEAD requests. + */ +function output($compress = true, $use_etag = true, $send_body = true) +{ +$min_gz_size = 1024; +$page = ob_get_contents(); +$length = strlen($page); +ob_end_clean(); + +if ($compress extension_loaded('zlib') (strlen($page) $min_gz_size) + isset($GLOBALS['HTTP_SERVER_VARS']['HTTP_ACCEPT_ENCODING'])) { +$ae = explode(',', str_replace(' ', '', +$GLOBALS['HTTP_SERVER_VARS']['HTTP_ACCEPT_ENCODING'])); +$enc = false; +if (in_array('gzip', $ae)) { +$enc = 'gzip'; +} else if (in_array('x-gzip', $ae)) { +$enc = 'x-gzip'; +} +
Re: [PHP] Mysql Array Question
while($row = mysql_fetch_array($id,MYSQL_ASSOC)) { foreach($row as $index=$value) { $z[$index][] = $value; } } For a table with 3 rows and fields abc and def in each row this would produce an array like this: $z[abc][0] $z[def][0] $z[abc][1] $z[def][1] $z[abc][2] $z[def][2] -Rasmus On Sat, 20 Jan 2001, Jeff Lacy wrote: Hello Everyone, I am trying to make a page that will interact with mysql. I need to be able to access the result of my mysql_query by using a for loop. I made a little function that will sortof do this, but it returns a numeric array. Of course, I want an associative array (becauses things get screwy with a null). Does anyone know how to make something like what I want? Thanks a bunch :-) This is my current function: function returnArray ($id) { $z = array (array()); for ($i = 0; $row = mysql_fetch_array ($id); $i++) { for ($a = 0; $a sizeof ($row); $a++) { $z[$i][$a] = $row[$a]; } } return $z; } -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] date
I am wondering if it would be more efficient to store the integer value that the php function time() returns when a transaction is inserted into the database and then when querying the database to get certain transactions just use basic math functions to get the certain transactions. For example in I wanted to get all the transactions from the last 31 days lets say there was 980026719 seconds since 1970 and the number of seconds from the last 31 days is 2678400 select from table where time_of_trans (980026719-2678400) I know that the syntax isn't correct, I am just curious if this would be the most efficient way to do this? thanks Randy -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] XOR data encryption
I am trying to store some credit card numbers in a database, along with the rest of the data (dangerous, I know). Unforunately, I am using a provider that doesn't have the mcrypt functions compiled into PHP, so I guess I am stuck using the swiss-cheese like XOR method of encryption. My client is too cheap to put a separate server to store the credit card numbers, so I am stuck using symmetrical encryption. NEvertheless, I want to implement XOR, but I can't find an example on the net that shows how to do it in PHP. I know the philosophy behind it, but hwo do you do it? Do you convert the letters in the passphrase and the credit card number into 0 1 binary and then XOR that? What commands are there iN PHP that converts from alphanumeric to binary? If someone could post an example, that would be great. - Steve
[PHP] opinion polling code
Hi I'm looking for some free opinion polling code using PHP and MySQL. I've checked a number of scripts and they haven't been up to scratch - I'm just after a simple poll that allows a user to vote once (selecting yes or no) and then for the remainder of their session they can only view the poll results (i.e. not vote again). Tricks like hitting refresh to resubmit the vote shouldnt work, and the results need to be shown as a bar graph - if anyone knows of a good script, please let me know. I'm trying Sympoll but it's not working properly and the guy's site is down (www.ralusp.net) thanks in advance Lucas Young -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Cookies...
Currently my cookie expires in 1 hour, How can I make it expire in 1 day? setcookie("MemberLogin",$value,time()+3600); /* expire in 1 hour */ setcookie("MemberLogin",$value,time()+3600,"/",".combatfs.com",1); WreckRman2 Combat Flight Center http://www.combatfs.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Cookies...
Currently my cookie expires in 1 hour, How can I make it expire in 1 day? setcookie("MemberLogin",$value,time()+3600); /* expire in 1 hour */ setcookie("MemberLogin",$value,time()+3600,"/",".combatfs.com",1); 24*3600 -Rasmus -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] MySQL Access Denied
Hi, I am trying to conect to a MySQL db and no matter what code I use I am always getting denied, I know the password is correct as I have tested it elsewhere. Just wondering if this could be caused by the fact that the password has a + and a . in it. Would that get me denied, and how can I get around it other than changing the PW ?? TIA Ade -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] XOR data encryption
I have some Delphi code that uses the XOR, if that would help. Todd -- Todd Cary Ariste Software [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] cookies - not working with Nutscrape
Actually, it's excepting the time/date. It's the path/domain that is creating a problem. For some reason your original suggestion of leaving the domain out is working today. setcookie("ecb",$val,$expires,"/"); I could not get this to work for the life of me yesterday. Either I was overworked/tired or the Gremlins were out in force. ... ;-) Thank for your persistence. -Brian -Original Message- From: Richard Lynch [mailto:[EMAIL PROTECTED]] Sent: Saturday, January 20, 2001 4:20 PM To: [EMAIL PROTECTED] Subject: Re: [PHP] cookies - not working with Nutscrape $expires = mktime(12, 00, 00, 12, 31, 2005); I think Netscape follows the spec and there's some sort of maximal reliable time limit of two years or somesuch -- and anything else is assumed to be badly-formatted time... Try using something a little more reasonable like a year. By Day:|By Night: Don't miss the Zend Web Store's| There's not enough room here... Grand Opening on January 23, 2001! | Start here: http://www.zend.com| http://l-i-e.com/artists.htm -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] Installing Php/Apache/Win98
I had the same problem, i ended up placing the php4apache.dll in the apache/modules directory where the rest of the modules for apache are stored. Then change the entry in httpd.conf to: LoadModule php4_module modules/php4apache.dll everything worked then :) good luck Morkai I have PHP working like a champ on my WIN 2K computer with IIS. Now I would like to have it on my notebook, so I loaded Apache and have following the instructions from Shanx; however, I get the message that Apache cannot load php4apache.dll. It shows the correct path. What is the best source for help? Todd -- Todd Cary Ariste Software [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] get last directory of a full path? (parent directory)
whats the easiest way to go from "/dir1/dir2/dir3/hello.php" to "dir3/" ? dirname will cut off hello.php but i want to cut dir1 and dir2 as well Thanks! - Noah -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Please: XTemplate help?
Cool, so just iterate through the array and sort it into the template assignment - quite nice! Thanks for the pointers Kristi! Regards, Jaxon On 1/20/01 3:37 PM, "Kristi Russell" [EMAIL PROTECTED] wrote: while ( $rowData = mysql_fetch_array($result)) { list($fieldName, $fieldValue) = each($rowData); $template-assign("$fieldName", $fieldValue); } - Original Message - From: "Jaxon" [EMAIL PROTECTED] To: "Kristi Russell" [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Sent: Saturday, January 20, 2001 2:03 PM Subject: Re: [PHP] Please: XTemplate help? Kristi, That makes more sense, thanks, but one problem - I don't want to have to do: $template-assign("FIELD2", $row[fieldname2]); If I've already called mysql_fetch_array, then I have an array like this: field1:field1_data field2:field2_data field3:field3 data Is there any way to use the array itself as the assignment, or tell XTemplate to do so? That way I can use one file to generate pages from different templates. Regards, Jaxon On 1/20/01 12:26 PM, "Kristi Russell" [EMAIL PROTECTED] wrote: require "xtpl.p"; //include XTemplate engine //don't need this - wrong. require "html.xtpl"; //html layout file with field names e.g. {firstfield} You need to create a new instance of the Xtemplate class so: //assign the new instance to a variable name you'll use - I called it $template //and I specified which "html layout file" to use. $template = new Xtemplate("html.tpl"); // I name them tpl not xtpl *shrug* while($row = mysql_fetch_array($result)) { $template-assign("FIELD1", $row[fieldname]); //FIELD1 being the name you're going to use in the layout file by {FIELD1} //$row being the name of the array you fetched, field name being the fieldname in the database $template-assign("FIELD2", $row[fieldname2]); $template-parse("main");//replace {field} with matching result row element $template-out("main");` //send final html page to browser } Kristi -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP-CVS] cvs: php4 /ext/sablot sablot.c
sterlingSat Jan 20 15:42:03 2001 EDT Modified files: /php4/ext/sablotsablot.c Log: Fix the scheme handler support and make it compile on win32 systems. Index: php4/ext/sablot/sablot.c diff -u php4/ext/sablot/sablot.c:1.32 php4/ext/sablot/sablot.c:1.33 --- php4/ext/sablot/sablot.c:1.32 Fri Jan 19 03:44:12 2001 +++ php4/ext/sablot/sablot.cSat Jan 20 15:42:03 2001 @@ -1506,76 +1506,81 @@ /* {{{ Sablotron Scheme Handler functions */ -static int _php_sablot_sh_getAll(void *userData, SablotHandle p, const char *scheme, const char *rest, char **buffer, int *byteCount) { - php_sablot *handle = (php_sablot *)userData; +static int _php_sablot_sh_getAll(void *userData, SablotHandle p, const char *scheme, +const char *rest, char **buffer, int *byteCount) +{ + php_sablot *handle = (php_sablot *) userData; + ELS_FETCH(); if (handle-getAllHandler) { - zval *retval; - zval *args[4]; - char *mybuff; - int i; -int argc; - -argc=4; - args[0] = _php_sablot_resource_zval(handle-index); - args[1] = _php_sablot_string_zval(scheme); - args[2] = _php_sablot_string_zval(rest); - args[3] = _php_sablot_string_zval(""); + zval *retval, +*argv[4]; + int idx, + argc = 4; MAKE_STD_ZVAL(retval); - if (call_user_function(EG(function_table), NULL, handle-getAllHandler, retval, argc, args) == FAILURE) { - php_error(E_WARNING, "Sorry, couldn't call %s handler", "scheme getAll"); - } - - zval_dtor(retval); - efree(retval); - -/** - * do not destroy xml data. - */ - *buffer=Z_STRVAL_P(args[3]); - *byteCount=Z_STRLEN_P(args[3]); -/** - * destroy zvals - */ - for (i=0; i3; i++) { - zval_del_ref((args[i])); - } + argv[0] = _php_sablot_resource_zval(handle-index); + argv[1] = _php_sablot_string_zval(scheme); + argv[2] = _php_sablot_string_zval(rest); + argv[3] = _php_sablot_string_zval(""); + + if (call_user_function(EG(function_table), + NULL, + handle-getAllHandler, + retval, + argc, + argv) == FAILURE) { + php_error(E_WARNING, "Sorry couldn't call function, %s, with +handler of type %s", + handle-getAllHandler-value.str.val, "Scheme +GetALL"); + } + + zval_dtor(retval); + efree(retval); + + *buffer= Z_STRVAL_P(argv[3]); + *byteCount = Z_STRLEN_P(argv[3]); + + for (idx = 1; idx 3; idx++) { + zval_del_ref((argv[idx])); + } } -}; -static int _php_sablot_sh_freeMemory(void *userData, SablotHandle p, char *buffer) { -/** - * here we should destroy the buffer containing the xml data - * buffer to zval and zval-del_ref - * we should destroy the zval not the pointer. - */ -}; + + return(0); +} + +static int _php_sablot_sh_freeMemory(void *userData, SablotHandle p, char *buffer) +{ + /** Not implemented **/ +} -static int _php_sablot_sh_open(void *userData, SablotHandle p, const char *scheme, const char *rest, int *handle) { +static int _php_sablot_sh_open(void *userData, SablotHandle p, const char *scheme, +const char *rest, int *handle) +{ /** * Not implemented */ -}; +} -static int _php_sablot_sh_get(void *userData, SablotHandle p, int handle, char *buffer, int *byteCount) { +static int _php_sablot_sh_get(void *userData, SablotHandle p, int handle, char +*buffer, int *byteCount) +{ /** * Not implemented */ -}; +} -static int _php_sablot_sh_put(void *userData, SablotHandle p, int handle, const char *buffer, int *byteCount) { +static int _php_sablot_sh_put(void *userData, SablotHandle p, int handle, const char +*buffer, int *byteCount) +{ /** * Not implemented */ -}; +} -static int _php_sablot_sh_close(void *userData, SablotHandle p, int handle) { +static int _php_sablot_sh_close(void *userData, SablotHandle p, int handle) +{ /** * Not implemented */ -}; +} /* }}} */ -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] What's wrong with this link?
Mike, Looks like your slashes are backwards use "\" instead of "/" to escape characters. You will notice that "/" is used in UNIX directories and HTML tags. Here is the corrected code: print "a href=\"showpictures.php?id=$PID\"Click Here/a"; I assume "PID" is a variable. If so, it should be noted as "$PID". A really good book for learning PHP is "Beginning PHP4" by Wrox ISBN# 1-861003-73-0 - Scott I realize my slashes are most likely in the wrong spot and i'm new to this PHP stuff so a little help would be appreciated. I get a parse error print "a href=/"showpictures.php?id=PID/"Click Here/a"; Thanks, Mike -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- -- Scott A. Gerhardt P.Geo. Gerhardt Information Technologies [EMAIL PROTECTED] -- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] get last directory of a full path? (parent directory)
$i = 1; foreach ($dirs as $value) { if ($i == ($numberofelements-1)) $lastdir = $value; if ($i == $numberofelements) $file = $value; $i++; } I don't think the foreach is necessary - Why can't you just say: $lastdir = $dirs[$numberofelements-1]; $file = $dirs[$numberofelements]; That way you're not traversing the entire array, you're just getting what you need, more efficient. Now if only you could work with files the same way you can with arrays... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Profanity Filter
hey, does anyone have a big compiled list? like a profanity library? maybe even a multi-lingual one! hey, it would be fun to make :) _alex -- Alex Black, Head Monkey [EMAIL PROTECTED] The Turing Studio, Inc. http://www.turingstudio.com vox+510.666.0074 fax+510.666.0093 Saul Zaentz Film Center 2600 Tenth St Suite 433 Berkeley, CA 94710-2522 From: [EMAIL PROTECTED] ("Sterling Hughes") Organization: Pentap Technologies Newsgroups: php.general Date: 19 Jan 2001 12:09:56 -0800 Subject: Re: [PHP] Profanity Filter On Fri, 19 Jan 2001, Ignacio Vazquez-Abrams wrote: On Fri, 19 Jan 2001, Sterling Hughes wrote: I'm saying use the same method, but use an array and avoid the strpos() function: $words = preg_split("//", $data); foreach ($words as $word) { if (in_array($prof, $words)) { echo "BAD WORD"; echo "BAD WORD"; echo "I'M TELLING"; } } -Sterling That method suffers from the dictionary problem that Egan brought up. Hey, wait a second... Does that code even make sense? I must be missing something... -- well if you have a concussion... :) Its a whip up of what I was talking about, I didn't mean it as real code :)... Switch $words to $word and then swith the argument order to in_array and yes, it makes sense... ?php $profanities = array("fuck", "shit"); $words = preg_split("/\s+/", $data); foreach ($words as $word) { if (in_array($word, $profanities)) { echo "you did a naughty thing"; break; } } ? Would be the somewhat sane version... _Sterling -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] is it possible to communicate javascript and php?
no without submitting information to the server with get or post. for example, if a bit of javascript you have comes up with some value, the only way you can get it to the server is to put it in a get and send the user to that url: http://www.mysite.com/index.php?your_js_var=your_value etc. _alex -- Alex Black, Head Monkey [EMAIL PROTECTED] The Turing Studio, Inc. http://www.turingstudio.com vox+510.666.0074 fax+510.666.0093 Saul Zaentz Film Center 2600 Tenth St Suite 433 Berkeley, CA 94710-2522 From: [EMAIL PROTECTED] (Evelio Martinez) Newsgroups: php.general Date: 19 Jan 2001 09:01:33 -0800 Subject: [PHP] is it possible to communicate javascript and php? I would like to know if it possible to pass in any way some values from javascript functions to php variables ? Any FAQ? Thanks -- Evelio Martnez Testanet. Dept. desarrollo software. Av. Reino de Valencia, 15 - 5 46005 Valencia (Spain) Tel: +34 96 395 90 00 Fax: +34 96 316 23 19 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] RE: Ethics question...
is there any benchmarks or proof that I should host a high traffic site on a FREEBSD/APACHE instead of a redhat Linux/Apache server? I have _heard_ that linux is great under medium load, but does not deal as well with super-high loads as well as freeBSD. that has not stopped me from using linux in all of my commercial installations, with not a problem once :) I think the answer is to say: we'll use apache, on (insert your fav. *nix here) - in a cluster of webservers that can be easily expanded as the need arises. I personally dislike sun: expensive, hyper-proprietary (almost worse then MS, because its their hardware as well), and really_really_rude What's great about both FreeBSD and Linux: commodity hardware! cheap! easy to get! cheap! It's easier to build in redundancy than it is to engineer 100% uptime. _alex -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] is it possible to communicate javascript and php?
On Sat, Jan 20, 2001 at 05:20:53PM -0800, Alex Black wrote : no without submitting information to the server with get or post. for example, if a bit of javascript you have comes up with some value, the only way you can get it to the server is to put it in a get and send the user to that url: http://www.mysite.com/index.php?your_js_var=your_value With 'post' methods its also possible this way (works NS and IE): script language="JavaScript"!-- function do_something( form) { form.jsvar.value = form.bla.selcetedIndex; form.submit(); return true; } //--/script form name="mainform", action="?echo$PHP_SELF?" methos="post" input type="hidden" name="jsvar" value="" selcet name="bla" option foo option bar /select input type="button" onclick="do_something( document.mainform)" value="click" /form You know have set the phpvar $jsvar from within javascript. m. -- Markus Fischer, http://josefine.ben.tuwien.ac.at/~mfischer/ EMail: [EMAIL PROTECTED] PGP Public Key: http://josefine.ben.tuwien.ac.at/~mfischer/C2272BD0.asc PGP Fingerprint: D3B0 DD4F E12B F911 3CE1 C2B5 D674 B445 C227 2BD0 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Profanity Filter
Just go to one of those raunchy porn sites and pull the words out of thier meta tags or "hidden" word list (i.e. white text on white background) buried in the HTML. ;-) hey, does anyone have a big compiled list? like a profanity library? maybe even a multi-lingual one! hey, it would be fun to make :) _alex -- Alex Black, Head Monkey [EMAIL PROTECTED] The Turing Studio, Inc. http://www.turingstudio.com vox+510.666.0074 fax+510.666.0093 Saul Zaentz Film Center 2600 Tenth St Suite 433 Berkeley, CA 94710-2522 From: [EMAIL PROTECTED] ("Sterling Hughes") Organization: Pentap Technologies Newsgroups: php.general Date: 19 Jan 2001 12:09:56 -0800 Subject: Re: [PHP] Profanity Filter On Fri, 19 Jan 2001, Ignacio Vazquez-Abrams wrote: On Fri, 19 Jan 2001, Sterling Hughes wrote: I'm saying use the same method, but use an array and avoid the strpos() function: $words = preg_split("//", $data); foreach ($words as $word) { if (in_array($prof, $words)) { echo "BAD WORD"; echo "BAD WORD"; echo "I'M TELLING"; } } -Sterling That method suffers from the dictionary problem that Egan brought up. Hey, wait a second... Does that code even make sense? I must be missing something... -- well if you have a concussion... :) Its a whip up of what I was talking about, I didn't mean it as real code :)... Switch $words to $word and then swith the argument order to in_array and yes, it makes sense... ?php $profanities = array("fuck", "shit"); $words = preg_split("/\s+/", $data); foreach ($words as $word) { if (in_array($word, $profanities)) { echo "you did a naughty thing"; break; } } ? Would be the somewhat sane version... _Sterling -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- -- Scott A. Gerhardt P.Geo. Gerhardt Information Technologies [EMAIL PROTECTED] -- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] CF vs PHP for Creating PDF's
Hi- I'm new to this list. I'll start out with hopefully a good question. I have a project coming up where I need to take some form input insert it into a premade template and create a custom pdf for a user. The pdf will then be e-mailed to the user or a link to download it e-mailed to them. My question is, which would be better for doing this? I see Cold Fusion has some tags for creating pdf's but it looks like PHP has more capabilities along these lines. Also, I see Adobe (http://cpdf1.adobe.com/) has its own pdf service that might somehow be able to be taken advantage of. If anyone has some expertise and knowledge to share along these lines I would be grateful. Thanks for any help, --- | D A R K P O R T A L G A M E STony K. Bounds, Web Wizard | | http://www.darkportalgames.com [EMAIL PROTECTED] | |_| | You provide the paper. We provide the adventure. | --- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Sending a mail in HTML format
Hello, I want to send a mail in HTML format with the mail() function. I have tried to send html stuff in the message parameter, but when I read it in my hotmail account, I just see the html code and not what the html is supposed to show. I suppose that it is necessary to send some additional headers to specify that the mail is in html format. Thanks for your help. Pascal Get free email and a permanent address at http://www.netaddress.com/?N=1 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Sending a mail in HTML format
On Sat, Jan 20, 2001 at 06:46:39PM -0700, Pascal Clerin wrote : I want to send a mail in HTML format with the mail() function. I have tried to send html stuff in the message parameter, but when I read it in my hotmail account, I just see the html code and not what the html is supposed to show. I suppose that it is necessary to send some additional headers to specify that the mail is in html format. Thanks for your help. How about sending yourself a HTML email and examing the headers ? I did that way, worked. To shorten this cycle for you, some hints: Content-Type: text/html; charset="us-ascii" (for example) To include test and html, use the following: Content-Type: multipart/alternative; boundary="=_NextPart_000_062D_01C079C0.9DFF9B70" Then, in the body This is a multi-part message in MIME format. --=_NextPart_000_062D_01C079C0.9DFF9B70 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit ene mene u --=_NextPart_000_062D_01C079C0.9DFF9B70 Content-Type: text/html; charset="us-ascii" Content-Transfer-Encoding: quoted-printable htmlbodyh1 ene mene mu /h1/body/html m. -- Markus Fischer, http://josefine.ben.tuwien.ac.at/~mfischer/ EMail: [EMAIL PROTECTED] PGP Public Key: http://josefine.ben.tuwien.ac.at/~mfischer/C2272BD0.asc PGP Fingerprint: D3B0 DD4F E12B F911 3CE1 C2B5 D674 B445 C227 2BD0 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] mysql table dump problem
Hi list, I have scoured the archives with no good game plans. Here is what I am trying to accomplish: dump a table to a file on my server: $sql = "SELECT * INTO OUTFILE '/tmp/test.txt' FIELDS TERMINATED BY '\t' LINES TERMINATED BY '\n' FROM table_name"; take the file and email it to someone: using a mime-mail class from http://phpclasses.upperdesign.com The above works perfectly. I am able to create the file and email it to a designated address. Problem is that once I have created the dump file, it will not allow me to overwrite it and it gives me an error. Error = rm: cannot unlink `test.txt': Operation not permitted. It is owned by mysql:mysql. So it looks like it must be deleted by root or I need to change the ownership of the file so it can be deleted. So... What is the best way to remove the file before re-dumping it to the /tmp directory? I'm not sure if it is possible to switch to root...but I know that is probably a very bad idea. How can I change the ownership of the file so it can be deleted from PHP code? TIA, Scott P.S. Please cc: me on any responses as I am no longer a member of the list. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Getting part of a string
Hi, I have a form which users enter their email address, once submitted I need a way to chop it up and put it in lowercase. So that if a user submits [EMAIL PROTECTED] I want PHP to throw out Website4S and then make the rest lowercase so I would get @aol.com I know how to get the string to lowercase by using $Email1=strtolower($Email); My problem is how to get $Email and chop off anything up to the @ and because people may enter different email providors I have no idea how to get around it. Anyone have a suggestion I would really appreciate it. Ade -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Profanity Filter
What you could do is have a bad word and a reallybadword list. Wank could be a bad word and if it didn't appear along (ie. whitespace on either side, or in plural) then it is ok. In really bad word, say F*ck, then it couldn't appear at all...( ie. f*ckville would be invalid). It would mean a second loop...but not much more processing... Just my 2 cents. Fraser On Sat, 20 Jan 2001, Nik Gare wrote: In article 94adfp$5le$[EMAIL PROTECTED], Stephan Ahonen [EMAIL PROTECTED] wrote: I'd make it an array: $filter = array(moron, idiot, pratt); foreach($filter as $badword) { if (strstr($name, $badword)) { do this if it contains one of the bad words } else { do this if it doesn't } } But wouldn't this approach have its drawbacks, too? For example, I live in Kiel, Germany, about 20km from a town called Wankendorf. Presumably I wouldnÄt be able to say this. Nik -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] XOR data encryption
Feel free (as in public domain) to use this function: http://www.nirvani.net/software/misc/xor_string-1.0.0.inc.asc Jeremy Jeremy Brand :: Sr. Software Engineer :: 408-245-9058 :: [EMAIL PROTECTED] http://www.JeremyBrand.com/Jeremy/Brand/Jeremy_Brand.html for more - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - "LINUX is obsolete" -- Andy Tanenbaum, January 29th, 1992 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - http://www.JEEP-FOR-SALE.com/ -- I need a buyer Get your own Free, Private email at http://www.smackdown.com/ On Sat, 20 Jan 2001, Steve Quezadas wrote: Date: Sat, 20 Jan 2001 13:41:20 -0800 From: Steve Quezadas [EMAIL PROTECTED] To: [EMAIL PROTECTED] Subject: [PHP] XOR data encryption I am trying to store some credit card numbers in a database, along with the rest of the data (dangerous, I know). Unforunately, I am using a provider that doesn't have the mcrypt functions compiled into PHP, so I guess I am stuck using the swiss-cheese like XOR method of encryption. My client is too cheap to put a separate server to store the credit card numbers, so I am stuck using symmetrical encryption. NEvertheless, I want to implement XOR, but I can't find an example on the net that shows how to do it in PHP. I know the philosophy behind it, but hwo do you do it? Do you convert the letters in the passphrase and the credit card number into 0 1 binary and then XOR that? What commands are there iN PHP that converts from alphanumeric to binary? If someone could post an example, that would be great. - Steve -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] my cookies arent working!
Hi all I think most of the problems I am having with PHP and sample code not working seems to be because cookies arent being generated I'm using php.ini in it's default config Windows 2000 Pro IIS PHP 4.0.4pl1 PHP seems to be working fine otherwise... I did the installshield install then unzipped the zip package over the top to get the extra modules... How can I check that cookies are working and et up? I am seeing cookies in c:\documents and settings\login\cookies on both the web machine and my workstation for normal www sites but not for any of my php sites... thanks in advance Luacs -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] mysql table dump problem
On Sat, Jan 20, 2001 at 05:57:25PM -0800, PHP List wrote : dump a table to a file on my server: $sql = "SELECT * INTO OUTFILE '/tmp/test.txt' FIELDS TERMINATED BY '\t' LINES TERMINATED BY '\n' FROM table_name"; Problem is that once I have created the dump file, it will not allow me to overwrite it and it gives me an error. Error = rm: cannot unlink `test.txt': Operation not permitted. It is owned by mysql:mysql. So it looks like it must be deleted by root or I need to change the ownership of the file so it can be deleted. So... As i first shot, if you need it quickly to work, add a random number to the text file. Sorry, no more ideas, just a dirty hack. m. -- Markus Fischer, http://josefine.ben.tuwien.ac.at/~mfischer/ EMail: [EMAIL PROTECTED] PGP Public Key: http://josefine.ben.tuwien.ac.at/~mfischer/C2272BD0.asc PGP Fingerprint: D3B0 DD4F E12B F911 3CE1 C2B5 D674 B445 C227 2BD0 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Getting part of a string
On Sat, Jan 20, 2001 at 09:10:45PM -0500, [EMAIL PROTECTED] wrote : I have a form which users enter their email address, once submitted I need a way to chop it up and put it in lowercase. So that if a user submits [EMAIL PROTECTED] I want PHP to throw out Website4S and then make the rest lowercase so I would get @aol.com I know how to get the string to lowercase by using $Email1=strtolower($Email); My problem is how to get $Email and chop off anything up to the @ and because people may enter different email providors I have no idea how to get around it. Anyone have a suggestion I would really appreciate it. The key to your secret is called regular expression. ? $email = "[EMAIL PROTECTED]"; if( eregi( "^([^@]+)@([^@]+)$", $email, $match)) { $email_user = $match[1]; $email_domain = strtolower( $match[2]); echo "$email_user at $email_domain"; } else echo "bad email"; ? Note, this does not validate if the email is correct; if you need this, take a look at php.net, some of the manual comments talk about email validaten ( whereupon methinks Tom Christiansen email verifier [written in perl] is still the best validator). hope this helps m. -- Markus Fischer, http://josefine.ben.tuwien.ac.at/~mfischer/ EMail: [EMAIL PROTECTED] PGP Public Key: http://josefine.ben.tuwien.ac.at/~mfischer/C2272BD0.asc PGP Fingerprint: D3B0 DD4F E12B F911 3CE1 C2B5 D674 B445 C227 2BD0 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] my cookies arent working!
On Sun, Jan 21, 2001 at 04:24:09PM +1300, Lucas Young wrote : I think most of the problems I am having with PHP and sample code not working seems to be because cookies arent being generated I'm using php.ini in it's default config Windows 2000 Pro IIS PHP 4.0.4pl1 PHP seems to be working fine otherwise... I did the installshield install then unzipped the zip package over the top to get the extra modules... How can I check that cookies are working and et up? I am seeing cookies in c:\documents and settings\login\cookies on both the web machine and my workstation for normal www sites but not for any of my php sites... How have you done cookie activation ? One easy way is to use session_start(); as it tries to set a cookie and fallsback to urlmodifieng if not possible. m. -- Markus Fischer, http://josefine.ben.tuwien.ac.at/~mfischer/ EMail: [EMAIL PROTECTED] PGP Public Key: http://josefine.ben.tuwien.ac.at/~mfischer/C2272BD0.asc PGP Fingerprint: D3B0 DD4F E12B F911 3CE1 C2B5 D674 B445 C227 2BD0 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Getting part of a string
In a message dated 21/01/2001 03:43:19 GMT Standard Time, [EMAIL PROTECTED] writes: if( eregi( "^([^@]+)@([^@]+)$", $email, $match)) { $email_user = $match[1]; $email_domain = strtolower( $match[2]); echo "$email_user at $email_domain"; } else echo "bad email"; Thank you m. that works perfect! Ade -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP-CVS] cvs: php4 /ext/bz2 config.m4
sniper Sat Jan 20 20:00:32 2001 EDT Modified files: /php4/ext/bz2 config.m4 Log: Remove double 'yes' output. Index: php4/ext/bz2/config.m4 diff -u php4/ext/bz2/config.m4:1.2 php4/ext/bz2/config.m4:1.3 --- php4/ext/bz2/config.m4:1.2 Fri Jan 19 21:09:01 2001 +++ php4/ext/bz2/config.m4 Sat Jan 20 20:00:32 2001 @@ -1,4 +1,4 @@ -dnl $Id: config.m4,v 1.2 2001/01/20 05:09:01 sniper Exp $ +dnl $Id: config.m4,v 1.3 2001/01/21 04:00:32 sniper Exp $ dnl config.m4 for extension BZip2 PHP_ARG_WITH(bz2, for BZip2 support, @@ -26,9 +26,7 @@ PHP_SUBST(BZ2_SHARED_LIBADD) AC_ADD_LIBRARY_WITH_PATH(bz2, $BZIP_DIR/lib, BZ2_SHARED_LIBADD) - AC_CHECK_LIB(bz2, BZ2_bzerror, [AC_MSG_RESULT(yes)],[AC_MSG_ERROR(bz2 module requires libbz2 = 1.0.0)],) - - AC_DEFINE(HAVE_BZ2,1,[ ]) + AC_CHECK_LIB(bz2, BZ2_bzerror, [AC_DEFINE(HAVE_BZ2,1,[ ])], [AC_MSG_ERROR(bz2 +module requires libbz2 = 1.0.0)],) PHP_EXTENSION(bz2, $ext_shared) fi -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Compiling PHP with --with-apxs
Hello Jero, (J == "Jero") [EMAIL PROTECTED] writes: J checking for Apache module support via DSO through APXS... apxs:Error: J Sorry, no DSO support for Apache available J apxs:Error: under your platform. Make sure the Apache J apxs:Error: module mod_so is compiled into your server J apxs:Error: binary `/usr/local/apache/bin/httpd'. The only time I've ever gotten this error is when there were either two installations of Apache on the system, or leftovers from a previous installation (Ie. BSDi (the worst) and RedHat). Run updatedb if you're on Linux, then do a locate for apxs. If you find more than one, you need to find out which one belongs to the currently running httpd. If all else fails you can backup your web files, cgi-bin, configuration files, etc. and remove everything that is Apache on the system. Then do a complete, fresh install of Apache and try building PHP as a DSO again. But, I would probably make sure it's not getting confused by the multiple apxs scripts first. -Brian -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] my cookies arent working!
I'm actually using code from the web - sympoll from www.ralusp.net and authlib, both give me errors and neither seems to be writing cookies... I note in PHP the session save path is /tmp, where should this folder live? -Original Message- From: Markus Fischer [mailto:[EMAIL PROTECTED]] Sent: Sunday, 21 January 2001 4:44 p.m. To: Php-General Subject: Re: [PHP] my cookies arent working! On Sun, Jan 21, 2001 at 04:24:09PM +1300, Lucas Young wrote : I think most of the problems I am having with PHP and sample code not working seems to be because cookies arent being generated I'm using php.ini in it's default config Windows 2000 Pro IIS PHP 4.0.4pl1 PHP seems to be working fine otherwise... I did the installshield install then unzipped the zip package over the top to get the extra modules... How can I check that cookies are working and et up? I am seeing cookies in c:\documents and settings\login\cookies on both the web machine and my workstation for normal www sites but not for any of my php sites... How have you done cookie activation ? One easy way is to use session_start(); as it tries to set a cookie and fallsback to urlmodifieng if not possible. m. -- Markus Fischer, http://josefine.ben.tuwien.ac.at/~mfischer/ EMail: [EMAIL PROTECTED] PGP Public Key: http://josefine.ben.tuwien.ac.at/~mfischer/C2272BD0.asc PGP Fingerprint: D3B0 DD4F E12B F911 3CE1 C2B5 D674 B445 C227 2BD0 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] charactor problem
im trying to build an array from an entry in a file and im having some trouble with it. in a file i have a line similar to: 1234 hello 123456 12345678 I grab this line and try to make it an array like this: $var1 = trim($thelinefromfile); $var2 = split(" ", $thelinefromfile); $count = count($var2); $count comes out to equal 1 so, it doesnt actually see each space as the seperator therefore it sees it as one field.. Ive also tried split("\ ", $thelinefromfile); but, that doesnt work either... ive tried ereg_replace($space, $commathenspace, $thelinefromfile); that also does not seem to work Please help... Thanks in advance Rick -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] XOR data encryption
Steve, If you're using MySQL, it has some built-in encryption functions that would be slightly better than trying to implement XOR encryption in PHP. The best solution would be to use PGP or GPG (GNU Privacy Guard) to encrypt the credit card numbers before you put them in the database. Regards, Sean Cazzell -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
php-general Digest 21 Jan 2001 05:40:35 -0000 Issue 467
php-general Digest 21 Jan 2001 05:40:35 - Issue 467 Topics (messages 35815 through 35880): Re: HELP!. INstalling PHP4 on a Cobalt RAQ 2! 35815 by: Rasmus Lerdorf Re: Help w/ regular expressions for banned words 35816 by: Team JUMP 35818 by: Romulo Roberto Pereira 35831 by: Team JUMP Re: Profanity Filter 35817 by: Website4S.aol.com 35860 by: Alex Black 35864 by: scott.gerhardt-it.com 35870 by: Fraser MacKenzie Re: Help - removal of trailing zeros from double integer field 35819 by: Art Wells Re: PHP site on CD-ROM 35820 by: Brian T. Allen Re: Image Widths/Heights on Upload 35821 by: Dan Lowe What's wrong with this link? 35822 by: Mike Yuen 35824 by: Romulo Roberto Pereira 35828 by: Angus Mann 35830 by: Philip Olson 35857 by: scott.gerhardt-it.com Re: cookies - not working with Nutscrape 35823 by: Brian V Bonini 35825 by: Brian V Bonini 35853 by: Brian V Bonini Re: Please: XTemplate help? 35826 by: Jaxon 35843 by: Kristi Russell 35856 by: Jaxon JSDK 2.0 PHP 35827 by: Ashley M. Kirchner Re: Flash + PHP 35829 by: Mike Tuller Verifying against a file 35832 by: Website4S.aol.com Installing Php/Apache/Win98 35833 by: Todd Cary 35854 by: Morkai Kurst Re: Spell checker? 35834 by: John Hinsley Compiling PHP with "--with-apxs" 35835 by: Jero 35877 by: Brian Clark simple math 35836 by: PeterOblivion.aol.com 35837 by: Rasmus Lerdorf MailBomb Problem... 35838 by: ewiz 35839 by: Rasmus Lerdorf Unique Session Question 35840 by: Randy Johnson 35842 by: Alain Fontaine Re: a text formating cpu question 35841 by: Michael A. Peters Mysql Array Question 35844 by: Jeff Lacy 35845 by: Rasmus Lerdorf date 35846 by: Randy Johnson XOR data encryption 35847 by: Steve Quezadas 35852 by: Todd Cary 35871 by: jeremy brand 35880 by: Sean Cazzell opinion polling code 35848 by: Lucas Young Cookies... 35849 by: WreckRman2 35850 by: Rasmus Lerdorf MySQL Access Denied 35851 by: Website4S.aol.com get last directory of a full path? (parent directory) 35855 by: Noah Spitzer-Williams 35858 by: Romulo Roberto Pereira 35859 by: Stephan Ahonen Re: is it possible to communicate javascript and php? 35861 by: Alex Black 35863 by: Markus Fischer Re: Ethics question... 35862 by: Alex Black CF vs PHP for Creating PDF's 35865 by: DPG Account Sending a mail in HTML format 35866 by: Pascal Clerin 35867 by: Markus Fischer mysql table dump problem 35868 by: PHP List 35873 by: Markus Fischer Getting part of a string 35869 by: Website4S.aol.com 35874 by: Markus Fischer 35876 by: Website4S.aol.com my cookies arent working! 35872 by: Lucas Young 35875 by: Markus Fischer 35878 by: Lucas Young " " charactor problem 35879 by: Rick Ridgeway 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] -- Can you install flex and bison? On Sat, 20 Jan 2001, Trunkz Santai wrote: Hi Im trying to isntall PHP4 on my Raq 2 but Im not having much luck. I was wondering if someone here could assist me. I uploaded apache and configured it and it worked fine. Its running in /usr/local/apache-x.x.x I uploaded the php zipped binary by ftp to /home/sites/home then mv php-4.0.4.tar.gz /usr/local then I unpacked it gunzip php-4.0.4.tar.gz then tar vxf php-4.0.4.tar It unpacked fine. I changed firectories cd php-4.0.4 I did the configure thing ./configure --with-mysql --with-apache=../apache_1.3.14 --enable-track-vars I pressed enter and it said loading config.cache and a long list of things came up. Then it ended and this was what I got. checking for working makeinfo... found checking whether to enable maintainer-specific portions of Makefiles... no checking host system type... mipsel-unknown-linux-gnu checking for gawk... gawk checking for bison... bison -y checking bison version... 1.25 (ok) checking for gcc... gcc checking whether the C compiler (gcc ) works... yes checking whether the C compiler (gcc ) is a cross-compiler... no checking whether we are using GNU C... yes checking whether gcc accepts -g... yes checking how to run the C preprocessor... gcc -E checking for AIX... no checking for gcc option to accept ANSI C... none needed checking for ranlib... ranlib checking whether gcc and cc understand -c and -o together... yes checking whether ln -s works... yes
Re: [PHP] charactor problem
I grab this line and try to make it an array like this: print "line: $thelinefromfile\n"; //Check the line $var1 = trim($thelinefromfile); $var2 = split(" ", $thelinefromfile); $count = count($var2); Are you sure $thelinefromfile is actually being set correctly? Regards, Sean -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] HELP: problem listing directory contents
Greetings All! Recently I've been hit by a strange problem while coding a file indexing system. I have a source directory of the following format: /files/0-9 /files/0-9/0-90 /files/0-9/0-91 /files/a /files/a/a0 /files/a/a1 /files/b ... /file/z ok you got the picture I hope. nothing difficult. now when i try to exec my script, it hangs somewhere at path /files/a/a2 halting right before it should switch to b0... I'm including kinda long script below hoping some kind soul could examine it and throw the errors i've made into my face. I HOPE THIS IS NOT A BUG IN PHP. ? function dir_list($dirname) { $handle=opendir($dirname); while (($file = readdir($handle))!==false) { if($file=='.'||$file=='..') continue; $result_array[]=$dirname.$file; } closedir($handle); return $result_array; }; $HTMLDir="/WWW/htdocs/listss/"; $FileDir="/WWW/files/"; echo "BFONT FACE=verdana,arial,helvetica SIZE=-2\n"; #Reset and Start the Timer. $updated=0; $added=0; $removed=0; $total=0; $starttime = doubleval(ereg_replace('^0\.([0-9]*) ([0-9]*)$','\\2.\\1',microtime())); #Get Contents of main directory. $D1=dir_list($FileDir); #Cycle Through each subdir of $FileDir. $S1=sizeof($D1); for ($i1=0; $i1$S1; $i1++) { #Check whether the current item is not a directory, report and die if it is a file. if (!is_dir($D1[$i1])) die("FONT COLOR=#66ERROR 01:/FONT $D1[$i1] is a file, should be moved to a subdirectory.BR\n"); #CD into the current subdir. $SubDir="$D1[$i1]/"; chdir($SubDir); #Get contents of the current subdir. $D2=dir_list($SubDir); #Keep the name of current subdir in $CL $CL=substr($D1[$i1],strrpos($D1[$i1],'/')+1); #Print the header for the current directory. echo "BRFONT SIZE=+1"; if ($CL!="nm") echo strtoupper($CL); else echo "Numbers amp; Symbols"; echo"/FONTBRHR NOSHADE SIZE=0 ALIGN=LEFT WIDTH=500\n"; $S2=sizeof($D2); for ($i2=0; $i2$S2; $i2++) { #CD into the current subsubdir. $SubSubDir="$D2[$i2]/"; echo "Entering $SubSubDirBR\n"; chdir($SubSubDir); #Generate current HTML filename. $CFL=substr($D2[$i2],strrpos($D2[$i2],'/')+1); if (ereg("nm",$CFL)) $CFL=ereg_replace("nm","0-9",$CFL); if (ereg("0-90",$CFL)) $CFL=ereg_replace("0-90","0-9",$CFL); if ($CFL[1]=='0') $CFL=ereg_replace("0","",$CFL); $CF="$HTMLDir$CFL.html"; #Open current HTML file. echo "nbsp;nbsp;Writing to File $CFBR\n"; $fp=fopen($CF,'w'); #Get contents of the current subdir. $D3=dir_list($SubSubDir); $S3=sizeof($D3); for ($j=0; $j$S3; $j++) { echo "$D3[$j]BR\n"; }; #Close current HTML file. echo "nbsp;nbsp;Closing File $CFBR\n"; fclose($fp); #Return one level back,subletter listing. echo "Returning to $SubDirBRBR\n"; #chdir($SubDir); }; #Return one level back, letter listing. #chdir($FileDir); }; #Get the finish time and printout the stats. $endtime = doubleval(ereg_replace('^0\.([0-9]*) ([0-9]*)$','\\2.\\1',microtime())); echo "BRBRBRFONT SIZE=+1STATISTICS/FONTBRHR NOSHADE ALIGN=LEFT SIZE=0 WIDTH=500\n"; echo "Time Spent: FONT COLOR=#66"; echo $endtime - $starttime; echo "/FONT secBR\n"; echo "BRBRBRBR"; ? Thanks in advance -- Vahan Yerkanian Email: [EMAIL PROTECTED] Leading Web Developer / Designer Phone: (374) 158-2723 Web Development DepartmentFax: (374) 128-5082 ARMINCO Global Telecommunications http://www.arminco.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]