Re: [PHP] Can't Make Directories Now
On Monday, September 1, 2003, at 03:41 PM, Curt Zirzow wrote: print $buildingPath . 'br'; if (opendir($buildingPath) == false) if (!mkdir($buildingPath)) print 'false br'; A print(false $buildingPathbr) might yield as to why it isn't creating it. I already did that and like I said, it's always the correct path. Look at the very first line of the code above which was in the original path. Thanks for the tip on is_dir. Seth Willits --- President and Head Developer of Freak Software - http://www.freaksw.com QA Columnist for REALbasic Developer Magazine - http://www.rbdeveloper.com Webmaster for REALbasic Game Central - http://www.freaksw.com/rbgames Rather fail with honor than succeed by fraud. -- Sophocles --- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Can't Make Directories Now
print $buildingPath . 'br'; if (opendir($buildingPath) == false) if (!mkdir($buildingPath)) print 'false br'; A print(false $buildingPathbr) might yield as to why it isn't creating it. I already did that and like I said, it's always the correct path. Look at the very first line of the code above which was in the original path. Thanks for the tip on is_dir. Actually -- using is_dir made it work. I wonder why Seth Willits --- President and Head Developer of Freak Software - http://www.freaksw.com QA Columnist for REALbasic Developer Magazine - http://www.rbdeveloper.com Webmaster for REALbasic Game Central - http://www.freaksw.com/rbgames Read the book! Be patient! All success comes from acquiring knowledge and experience. -- Seth Willits --- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: session-problem
:-) cool thank you! is any $_-variable superglobal? $_REQUEST, $_POST, ...? cheers, jazper Curt Zirzow [EMAIL PROTECTED] schrieb im Newsbeitrag news:[EMAIL PROTECTED] * Thus wrote Juerg Zgraggen ([EMAIL PROTECTED]): Probably i got the problem... but i don't know how to solve it!!! i include one of my class. in the constructor of this class i did a global... global $_SESSION; as soon as i delete that line. my script works perfect... is this not allowed anymore... to access $_SESSION in a constructor?? $_SESSION is a superglobal meaning you don't need to and shouldn't (as you found out the hard way :) global it. You can access it anytime: class foo { function foo { $this-var = $_SESSION['var']; } } Curt -- I used to think I was indecisive, but now I'm not so sure. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] TIME
The battery on my server keeps on dieing, so the clock is not keeping time correctly. I was wondering is there any way to query some type of global time source in php? Thanks, Dale -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] randomly select a table, better way?
On Mon, 01 Sep 2003 22:49:55 +, Curt Zirzow wrote: Instead of looping through all the tables and building an array you can do something like: $n = mysql_num_rows($result); $seek = mt_rand(0, $n-1); mysql_data_seek($result, $seek); Curt So then the total code would be: ? $mysqlconnect = mysql_connect(localhost, mysqladmin, i.hate.microsoft); $result = mysql_list_tables(Bookmarks); $n = mysql_num_rows($result); $seek = mt_rand(0, $n-1); $random_table = mysql_data_seek($result, $seek); echo brbrThe randomly slected table wasb$random_table/bbrbr; ? If so, then this does not work for me. All I get is $random_table == 1. If not, then what am I missing. Thanks for your quick response, DB -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
php-general Digest 2 Sep 2003 00:18:06 -0000 Issue 2272
php-general Digest 2 Sep 2003 00:18:06 - Issue 2272 Topics (messages 161360 through 161403): gif support not in GD 2.01? 161360 by: Merlin 161369 by: Curt Zirzow Re: reinstalling php with imap 161361 by: Raditha Dissanayake 161362 by: Merlin 161363 by: Raditha Dissanayake backtick : maximum output size? 161364 by: Mark Walker 161370 by: Curt Zirzow session.cookie_domain 161365 by: Diana Castillo 161368 by: Tom Percival Re: cookie crumbles 161366 by: John W. Holmes php 5 - mysql replication 161367 by: Moritz Steiner 161371 by: Curt Zirzow Display one element at a time 161372 by: Mike Capps 161375 by: Seth Willits New User Script Failing Unexpectedly. 161373 by: Adam Bishop 161380 by: Curt Zirzow 161381 by: Chris Sherwood 161387 by: Adam Bishop Can't Connect Within Function?! 161374 by: Seth Willits 161376 by: Curt Zirzow 161377 by: Mike Morton 161378 by: Seth Willits 161383 by: Dan Anderson Write RegExp-Vars in a function 161379 by: Niels Uhlendorf 161382 by: Curt Zirzow Linux support and security services 161384 by: Desi can someone explain... 161385 by: jsWalter 161386 by: Catalin Trifu Re: Tracking Bandwidth usage 161388 by: Desi MySQL Left Join Question 161389 by: Van Andel, Robbert Can't Make Directories Now 161390 by: Seth Willits 161393 by: Curt Zirzow 161399 by: Seth Willits 161400 by: Seth Willits Re: parent classes 161391 by: Cristiano Duarte randomly select a table, better way? 161392 by: Daniel Bray 161395 by: Curt Zirzow 161403 by: Daniel Bray session-problem 161394 by: Juerg Zgraggen 161396 by: Juerg Zgraggen 161397 by: Curt Zirzow 161398 by: Curt Zirzow 161401 by: Juerg Zgraggen TIME 161402 by: Dale Hersh Administrivia: To subscribe to the digest, e-mail: [EMAIL PROTECTED] To unsubscribe from the digest, e-mail: [EMAIL PROTECTED] To post to the list, e-mail: [EMAIL PROTECTED] -- ---BeginMessage--- Hi there, I have included a imagecreatefromgif() into my code which runns pretty fine on my testsystem 4.3.3 Now I uploaded it to the live system where an older version is running and is build with GD2.0.1. This is causing an error. Is this function not included inside the gd version? Thanx, Merlin ---End Message--- ---BeginMessage--- * Thus wrote Merlin ([EMAIL PROTECTED]): Hi there, Hello merlin. I have included a imagecreatefromgif() into my code which runns pretty fine on my testsystem 4.3.3 Now I uploaded it to the live system where an older version is running and is build with GD2.0.1. This is causing an error. Is this function not included inside the gd version? hm.. I've got gd 2.015 with php 4.3.3rc1 and it works fine. Are you getting a function not defined error? Take a look at the phpinfo() output, particularly the GD section, mine says: GIF Read Support: enabled Curt -- I used to think I was indecisive, but now I'm not so sure. ---End Message--- ---BeginMessage--- There are two magical commands on linux called 'locate' and 'find' :-) if you have locate just type locate c-client or some filename associated with the imap lib. find is more complicated you could try something like find / -name 'c-client*' | more the above will search your whole hard disk so it could take some time. Merlin wrote: Hi there, I would like to upgrade to the latest php version. My old version was build with imap a year ago. Now I found, that the directory which contained the imap files: '--with-imap=/home/sw/horde/imap-2002.RC2' ' does not longer exist. So I guess I have to rebuild the c-client library? Is there a way around this? I am getting errors I cant solve while installing the c-client. The old c-client should be anywhere on the system, since php is running fine at the moment, right? Can anybody give me an advice how to solve this dilema? Thanx, Merlin -- http://www.raditha.com/php/progress.php A progress bar for PHP file uploads. ---End Message--- ---BeginMessage--- oh... thanx. There is a c-client.a on the system. Is it possible just to add '--with-lmap=/home/sw/c-client.a' and it will work? Merlin Raditha Dissanayake wrote: There are two magical commands on linux called 'locate' and 'find' :-) if you have locate just type locate c-client or some filename associated with the imap lib. find is more complicated you could try something like find / -name 'c-client*' | more the above will search your whole hard disk so it could take some time. Merlin wrote: Hi there, I would like to upgrade to the latest php version. My old version was build with imap a year ago. Now I
[PHP] multiple db query
is it possible to query on 2 databases but with same tablename and merge its output?
[PHP] Re: How Energy Storage can help us ?
Nice Hello from Flywheel Storage Sun Tracking Goodbay to Blackout forever [EMAIL PROTECTED] Responding to your Questions; We offer Safety Solution Rolling Blackout will always happened, since the SYSTEM - is design to protect itself in dangerous Over-Current Situations. Breakers basic duty is defense whole system, shut down, and isolate from Grid; Wave of over-current travel to next Sub-Station and stimulate the same results on another, then another, then another. And a VOLTAGE is growing rapidly. Growing Disconnection in Domino Effect; we did seen twice; Accident ~ 30 years ago (baby boom) - for purpose recently. To decrease all Over-Current situation in POWER LINE or reduce to Zero ALL EXCESS ENERGY USE Energy Storage 25 - 1000 MWh and no Sub - Station will ever have any risk again. Small units UPS 20 - 200 kWh protect Stories, mainframes, servers, computers and homes, hospitals, public private places; give back emergency energy for hours days and/or time for diesel/gas generator to work. But with Solar Palette Sun Tracking - you don't need anything else. Enjoy Safety Energy Supply for generations to come; Rest you can find on: www.sun-tracking.com www.flywheel-storage.com [EMAIL PROTECTED] Thanks, Have a nice Weekend ! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] multiple db query
Aris Santillan wrote: is it possible to query on 2 databases but with same tablename and merge its output? Probably. It depends upon your database, though. SELECT t1.column, t2.column FROM database1.table1 t1, database2.table2 t2 WHERE ... -- ---John Holmes... Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/ php|architect: The Magazine for PHP Professionals www.phparch.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] script archives
I'm trying to find a script archive I once used to go to. It was neck and neck with hotscripts.com in usable scripts. It was for PHP only scripts. I THOUGHT it was called phpscripts.com, but no such site exists. anyone give a short list of PHP script archive sites? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] script archives
--- Dennis Gearon [EMAIL PROTECTED] wrote: I'm trying to find a script archive I once used to go to. It was neck and neck with hotscripts.com in usable scripts. It was for PHP only scripts. I THOUGHT it was called phpscripts.com, but no such site exists. Perhaps you are thinking of David Sklar's PHP code exchange? http://px.sklar.com/ Hope that helps. Chris = Become a better Web developer with the HTTP Developer's Handbook http://httphandbook.org/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] script archives
Chris Shiflett wrote: --- Dennis Gearon [EMAIL PROTECTED] wrote: I'm trying to find a script archive I once used to go to. It was neck and neck with hotscripts.com in usable scripts. It was for PHP only scripts. I THOUGHT it was called phpscripts.com, but no such site exists. Perhaps you are thinking of David Sklar's PHP code exchange? http://px.sklar.com/ Hope that helps. Chris = Become a better Web developer with the HTTP Developer's Handbook http://httphandbook.org/ found it, didn't think to put a dash in it: http://www.php-scripts.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] script archives
Chris Shiflett wrote: --- Dennis Gearon [EMAIL PROTECTED] wrote: I'm trying to find a script archive I once used to go to. It was neck and neck with hotscripts.com in usable scripts. It was for PHP only scripts. I THOUGHT it was called phpscripts.com, but no such site exists. Perhaps you are thinking of David Sklar's PHP code exchange? http://px.sklar.com/ Hope that helps. Chris = Become a better Web developer with the HTTP Developer's Handbook http://httphandbook.org/ opps, guess not, it wasn't: http://www.php-scripts.com/ unles it's changed a lot and gone down hill as well. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: session-problem
* Thus wrote Juerg Zgraggen ([EMAIL PROTECTED]): :-) cool thank you! is any $_-variable superglobal? $_REQUEST, $_POST, ...? Correct. Curt -- I used to think I was indecisive, but now I'm not so sure. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] MySQL Left Join Question
I'm not clear whether you are saying you get the records where there is a match and no non-matching records, or simply no records at all! What happens if you take out the WHERE clause, do you get all the records from p being displayed with NULLs for c.projectid where no match exists? Nick On Monday 01 Sep 2003 11:00 pm, Van Andel, Robbert wrote: This may not be the best place to ask this question, but I'm running into a problem when I perform a left join sql statement in PHP. The sql statement is as follows: SELECT p.id pid,p.designID,p.project_name,p.node,p.received,p.lots,p.ugfootage,p.aerial f ootage,p.node,c.* FROM projects as p LEFT JOIN proSub as c on p.id=c.projectID WHERE p.id=$id I have verified that $id has a value. What I'm finding is that when there is no corresponding entry in proSub, the query returns nothing even though LEFT JOIN is supposed to return the contents of the left table even if the right table has no data. The left data does have data and I am asking for the correct value for p.id. I've run into some other scripts on my site where left join does not behave the way it's supposed to. Any thoughts?? Robbert van Andel -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] TIME
Not directly as far as I know. Try using chronyd or similar (google will point you in the right direction). This works well with one of my machines that has a wayward clock and chronyd is happy to work with networks not permanently connected to the internet. On Tuesday 02 Sep 2003 1:11 am, Dale Hersh wrote: The battery on my server keeps on dieing, so the clock is not keeping time correctly. I was wondering is there any way to query some type of global time source in php? Thanks, Dale -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] TIME
* Thus wrote Dale Hersh ([EMAIL PROTECTED]): The battery on my server keeps on dieing, so the clock is not keeping time correctly. I was wondering is there any way to query some type of global time source in php? Totally unrealated to php but search for: Network Time Protocol (NTP) That will keep your clocks in sync. Curt -- I used to think I was indecisive, but now I'm not so sure. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] accessing $GLOBALS values
I am looking at the 'tackle' library available at sourceforge. It's a 'Tiny ACL' (access control list). Seems pretty good, simple and to the point. AND, it is database neutral, using ADODB. I haven't figured out how it does referential integrity in the database yet, but I suspect it's using table locking. One thing I'm a little confused about is the usage of $GLOBALS array, in this manner: $GLOBALS[SOME_NAME]. I thought that it should be: $GLOBALS['SOME_NAME']. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Copy database from MySQL to MSAccess
Hi there, I'd like to have a template DB stored with MySQL from which I later can create clientDB's for use with MSAccess. I've read that I can connect to MSAccess with PHP through ODBC and that's fine but how do I transfer the tables and cusomized data? TIA /Kjell Hansen -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] web-mail problem
Hi all, I am trying to solve a problem related to mail( ). I am not sure whether it is from SMTP directly or html tags used for html form mail. I got the following message, and has anyone seen this before? * This email is being returned to you because the remote server would not or could not accept the message. The registeredsite servers are just reporting to you what happened and are not the source of the problem. The address which was undeliverable is in the section labeled: - The following addresses had permanent fatal errors -. The reason your mail is being returned to you is in the section labeled: - Transcript of Session Follows -. The line beginning with describes the specific reason your e-mail could not be delivered. The next line contains a second error message which is a general translation for other e-mail servers. *** Thank you in advance. David -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Copy database from MySQL to MSAccess
Hi Kjell I'm not sure whether you are transferring from within the webserver, or from the webserver to MS locally, but either way I'd set up the MS database locally. Just install the MySQL ODBC driver (I think its at the mysql.com website) and link all the MySQL tables to your MS Access database and just import the tables using the processes within Access itself. Afterwards you can transfer the Access database up to the server. If you are doing the database functions wholly within the server you might consider using the Pear DB database abstraction layer to make it simplier. (That's how I'd do it anyway). Cheers Leonie Kjell Hansen [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Hi there, I'd like to have a template DB stored with MySQL from which I later can create clientDB's for use with MSAccess. I've read that I can connect to MSAccess with PHP through ODBC and that's fine but how do I transfer the tables and cusomized data? TIA /Kjell Hansen -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] randomly select a table, better way?
On Tuesday 02 September 2003 08:17, Daniel Bray wrote: So then the total code would be: ? $mysqlconnect = mysql_connect(localhost, mysqladmin, i.hate.microsoft); $result = mysql_list_tables(Bookmarks); $n = mysql_num_rows($result); $seek = mt_rand(0, $n-1); $random_table = mysql_data_seek($result, $seek); echo brbrThe randomly slected table wasb$random_table/bbrbr; ? If so, then this does not work for me. All I get is $random_table == 1. If not, then what am I missing. You didn't RTFM - mysql_list_tables() mysql_tablename() mysql_fetch_array() and friends -- Jason Wong - Gremlins Associates - www.gremlins.biz Open Source Software Systems Integrators * Web Design Hosting * Internet Intranet Applications Development * -- Search the list archives before you post http://marc.theaimsgroup.com/?l=php-general -- /* Intuition, however illogical, is recognized as a command prerogative. -- Kirk, Obsession, stardate 3620.7 */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
AW: [PHP] php 5 - mysql replication
If php knows about replication, it can balance the select querys on the different servers... -Ursprüngliche Nachricht- Von: Curt Zirzow [mailto:[EMAIL PROTECTED] Gesendet: Montag, 1. September 2003 19:30 An: [EMAIL PROTECTED] Betreff: Re: [PHP] php 5 - mysql replication * Thus wrote Moritz Steiner ([EMAIL PROTECTED]): I've heard that php 5 is going to support mysql replication, has anyone more details about it, it is already working in the beta release? Can you enlighten me as to what special things php needs to do replication? Curt -- I used to think I was indecisive, but now I'm not so sure. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] web-mail problem
Hello, Your message does not contain enough information for us to help you. Guessing in the dark i can tell you that you are not using the correct encodings for your message. It's not really a good idea to use the mail() function for html mail, there are plenty of mail classes out there that can do a better job. You will find references to quite a few on this lists archives. all the best raditha. Lingua2001 wrote: Hi all, I am trying to solve a problem related to mail( ). I am not sure whether it is from SMTP directly or html tags used for html form mail. I got the following message, and has anyone seen this before? * This email is being returned to you because the remote server would not or could not accept the message. The registeredsite servers are just reporting to you what happened and are not the source of the problem. The address which was undeliverable is in the section labeled: - The following addresses had permanent fatal errors -. The reason your mail is being returned to you is in the section labeled: - Transcript of Session Follows -. The line beginning with describes the specific reason your e-mail could not be delivered. The next line contains a second error message which is a general translation for other e-mail servers. *** Thank you in advance. David -- Raditha Dissanayake http://www.radinks.com/sftp/?sg Lean and mean secure FTP applet in pure java. Complete with Graphical User Inteface Just 150 kb in size. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Lack of info
In article [EMAIL PROTECTED], [EMAIL PROTECTED] says... IM not ranting, IM pointing out that I have looked on the website and the FAQ is a joke and help from other sources is either buy something or as the case of IRC, no channel of that description was turned up in the search. SNIP dozens of lines of NOT_RANT Somewhere in there I think you may have asked a question but it was well hidden. Perhaps if you were to simply ask your question, someone might help you. Oh, and there is a #php on irc.freenode.net (at least) -- Quod subigo farinam $email =~ s/oz$/au/o; A: Because it messes up the order in which people normally read text. Q: Why is top-posting such a bad thing? A: Top-posting. Q: What is the most annoying thing on usenet? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Block HTML Control
I'd like to show a big chunk of HTML if a particular variable is true, and if its false I'd like to show a different big chunk of html. Right now the only way I know of doing this is: if ($var) { print ' lots of html '; } else { print ' lots of html '; } This works, but it destroys the syntax coloring of the html making it all one solid color. I'd love to know if there's a better way OTHER than include()ing different files. Seth Willits --- President and Head Developer of Freak Software - http://www.freaksw.com QA Columnist for REALbasic Developer Magazine - http://www.rbdeveloper.com Webmaster for REALbasic Game Central - http://www.freaksw.com/rbgames Knowledge is limited. Imagination encircles the world. -- Albert Einstein --- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Block HTML Control
On Tuesday 02 September 2003 15:00, Seth Willits wrote: I'd like to show a big chunk of HTML if a particular variable is true, and if its false I'd like to show a different big chunk of html. Right now the only way I know of doing this is: if ($var) { print ' lots of html '; } else { print ' lots of html '; } This works, but it destroys the syntax coloring of the html making it all one solid color. I'd love to know if there's a better way OTHER than include()ing different files. ?php if ($doo): ? htmlLots of/html ?php endif; ? -- Jason Wong - Gremlins Associates - www.gremlins.biz Open Source Software Systems Integrators * Web Design Hosting * Internet Intranet Applications Development * -- Search the list archives before you post http://marc.theaimsgroup.com/?l=php-general -- /* For every complex problem, there is a solution that is simple, neat, and wrong. -- H. L. Mencken */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Block HTML Control
On Tuesday, September 2, 2003, at 12:03 AM, Jason Wong wrote: ?php if ($doo): ? htmlLots of/html ?php endif; ? Awesome. Thanks for the quick reply. Seth Willits --- President and Head Developer of Freak Software - http://www.freaksw.com QA Columnist for REALbasic Developer Magazine - http://www.rbdeveloper.com Webmaster for REALbasic Game Central - http://www.freaksw.com/rbgames There are 10 types of people in this world - those that understand binary and those that don't. --- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Block HTML Control
you can try if( $var) require(1.html); else require(2.html); Seth Willits wrote: I'd like to show a big chunk of HTML if a particular variable is true, and if its false I'd like to show a different big chunk of html. Right now the only way I know of doing this is: if ($var) { print ' lots of html '; } else { print ' lots of html '; } This works, but it destroys the syntax coloring of the html making it all one solid color. I'd love to know if there's a better way OTHER than include()ing different files. Seth Willits --- President and Head Developer of Freak Software - http://www.freaksw.com QA Columnist for REALbasic Developer Magazine - http://www.rbdeveloper.com Webmaster for REALbasic Game Central - http://www.freaksw.com/rbgames Knowledge is limited. Imagination encircles the world. -- Albert Einstein --- -- Raditha Dissanayake http://www.radinks.com/sftp/?sg Lean and mean secure FTP applet in pure java. Complete with Graphical User Inteface Just 150 kb in size. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP Interview questions and how to pass parameters to .js files
I think this program will work under the condition that the fault one is heavier in weight, but the case is that it may be lighter OR heavier. Ok enough of php interview questions. I need to pass a value to a function in .js file which has been linked in a php file which in turn has been included in another php file. -- //main.php fetch DB values and store it in $param. includefirst.php --- --- //first.php script language='JavaScript' src='/myjs.js' /script --- --- myjs.js function fun(param) { ... process with param } --- How can I achieve this? -murugesan - Original Message - Binary search. I'd say I have too much time on my hands, but I don't. ?php $eggs = array(1,1,1,1,1,2,1,1,1,1,1,1); $eggs1_6 = array_slice($eggs, 0, 6); $eggs7_12 = array_slice($eggs, 6, 6); if (array_sum($eggs1_6) array_sum($eggs7_12))/// First time $half_eggs = $eggs1_6; else $half_eggs = $eggs7_12; $eggs1_3 = array_slice($half_eggs, 0, 3); $eggs4_6 = array_slice($half_eggs, 3, 3); if (array_sum($eggs1_3) array_sum($eggs4_6))///Second time $quarter_eggs = $eggs1_3; else $quarter_eggs = $eggs4_6; if ($quarter_eggs[0] == $quarter_eggs[1])///Third time $egg = $quarter_eggs[2]; else if ($quarter_eggs[0] $quarter_eggs[1]) $egg = $quarter_eggs[0]; else $egg = $quarter_eggs[1]; $index = array_search($egg, $eggs) + 1; print Heavy egg is egg number {$index}\n; ? murugesan wrote: In a group of 12 eggs only one is having weight less or more. Can we have a program to find the egg, provided we have to weigh only three times with a weighing machine with two pans,without using weights. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: accessing $GLOBALS values
Dennis Gearon [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] [snip] One thing I'm a little confused about is the usage of $GLOBALS array, in this manner: $GLOBALS[SOME_NAME]. I thought that it should be: $GLOBALS['SOME_NAME']. Hi, You should use quotes to tell PHP it's a string you're using as a key of $GLOBALS. However, when not using quotes PHP will first look for a constant with that name. If PHP can't find any, it will assume it's a string. So not using quotes might lead to problems when you use the name of a constant as a key. I hope this is clear, more info can be found at http://www.php.net/manual/en/language.types.array.php and scroll down to 'Array do's and don'ts' - 'Why is $foo[bar] wrong?' HTH, Ivo Fokkema -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Block HTML Control
On Tuesday, September 2, 2003, at 12:06 AM, Seth Willits wrote: ?php if ($doo): ? htmlLots of/html ?php endif; ? Awesome. Thanks for the quick reply. Hmm.. Actually, how does this work with php html? This is actually what I'm trying to do. I should have said this in the first place, sorry :) ?php if ($thisVar) { if ($myVar) { lots; of; php; } else { lots of html } } ? Seth Willits --- President and Head Developer of Freak Software - http://www.freaksw.com QA Columnist for REALbasic Developer Magazine - http://www.rbdeveloper.com Webmaster for REALbasic Game Central - http://www.freaksw.com/rbgames Read the book! Be patient! All success comes from acquiring knowledge and experience. -- Seth Willits --- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] web-mail problem
David, first, this is a meassage you are getting from your mail server, not from PHP. according to my knowladge this is due to email address routing problem which the mail server experience when it tries to relay the mail. if you can send me the complete bounce mail message you recieve i'll tell you exactly whats going on there. Viraj Lingua2001 wrote: Hi all, I am trying to solve a problem related to mail( ). I am not sure whether it is from SMTP directly or html tags used for html form mail. I got the following message, and has anyone seen this before? * This email is being returned to you because the remote server would not or could not accept the message. The registeredsite servers are just reporting to you what happened and are not the source of the problem. The address which was undeliverable is in the section labeled: - The following addresses had permanent fatal errors -. The reason your mail is being returned to you is in the section labeled: - Transcript of Session Follows -. The line beginning with describes the specific reason your e-mail could not be delivered. The next line contains a second error message which is a general translation for other e-mail servers. *** Thank you in advance. David -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Foring a file download *and* page reload
You can use either a meta tag or real header, the later is prefered. ?php header('Refresh: 0; url=download.zip'); ? html !-- your html page here -- /html The browser loads the page and immediatly goes to another page (download.zip). This page will prompt the Save As dialog. Jean-Christian IMbeault wrote: Marek Kilimajer wrote: But because explorer does not support multipart/mixed and it is still the major browser (thought not for long ;), do it this way. Output header('Refresh: 0; url=download.zip'); first and then load the html page with new data blocks. Sorry if the solution is obvious but I can't understand what you mean by using a refresh header. Where and when should I use the header? Can you give a short example? Thanks, Jean-Christian Imbeault -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Block HTML Control
Seth, try to mingle PHP and HTML.. that means escape the PHP and jump to HTML when you want the HTML.. like this... ?php if (!$var) { ?lots of html ?php ; } else { ? lots of html ?php ; } ? happy coding Viraj Seth Willits wrote: I'd like to show a big chunk of HTML if a particular variable is true, and if its false I'd like to show a different big chunk of html. Right now the only way I know of doing this is: if ($var) { print ' lots of html '; } else { print ' lots of html '; } This works, but it destroys the syntax coloring of the html making it all one solid color. I'd love to know if there's a better way OTHER than include()ing different files. Seth Willits --- President and Head Developer of Freak Software - http://www.freaksw.com QA Columnist for REALbasic Developer Magazine - http://www.rbdeveloper.com Webmaster for REALbasic Game Central - http://www.freaksw.com/rbgames Knowledge is limited. Imagination encircles the world. -- Albert Einstein --- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Block HTML Control
Seth, ?php if ($thisVar) { if ($myVar) { lots; of; php; } else { // End of PHP content ? lots of html ?php // End of HTML content } } ? rgd viraj Seth Willits wrote: On Tuesday, September 2, 2003, at 12:06 AM, Seth Willits wrote: ?php if ($doo): ? htmlLots of/html ?php endif; ? Awesome. Thanks for the quick reply. Hmm.. Actually, how does this work with php html? This is actually what I'm trying to do. I should have said this in the first place, sorry :) ?php if ($thisVar) { if ($myVar) { lots; of; php; } else { lots of html } } ? Seth Willits --- President and Head Developer of Freak Software - http://www.freaksw.com QA Columnist for REALbasic Developer Magazine - http://www.rbdeveloper.com Webmaster for REALbasic Game Central - http://www.freaksw.com/rbgames Read the book! Be patient! All success comes from acquiring knowledge and experience. -- Seth Willits --- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Copy database from MySQL to MSAccess
Hi Leonie My approach is to have the empty AccessDB on the server. Make a copy of it and insert all the tables into the copy and then have it downloaded from the server. So I'm actually never gonna use Access, it's just the database I'm using for storage of data. One way of doing this could be to store the table definitions as SQL-statements in another table, but I'm not very thrilled about that idea. TIA /Kjell Hansen -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] multiple db query
For MySQL Version 3.23.25 and above - yes, and it is (surprisingly) called MERGE. I'm not sure if tables can be merged across databases. More in the manual. Aris Santillan wrote: is it possible to query on 2 databases but with same tablename and merge its output? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] multiple db query
I tried this and it is working well. I use 2 DB namely db1 and db2 Mysqluse db1; Mysqlselect vv.visitorname,aa.visitorname from db1.visitordetails vv, db2.visitordetails aa; -Murugesan - Original Message - From: Marek Kilimajer [EMAIL PROTECTED] To: Aris Santillan [EMAIL PROTECTED] Cc: Php (E-mail) [EMAIL PROTECTED] Sent: Tuesday, September 02, 2003 4:29 PM Subject: Re: [PHP] multiple db query For MySQL Version 3.23.25 and above - yes, and it is (surprisingly) called MERGE. I'm not sure if tables can be merged across databases. More in the manual. Aris Santillan wrote: is it possible to query on 2 databases but with same tablename and merge its output? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] execute command line script from browser
[snip] Is there a way to execute a command line php script from a browser by, say clicking a button and then having the browser let go and let the script run independet of the browser? Hope I explained that correctly. [/snip] You could invoke the CLI using an exec() http://www.php.net/exec HTH! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
php-general Digest 2 Sep 2003 12:40:13 -0000 Issue 2273
php-general Digest 2 Sep 2003 12:40:13 - Issue 2273 Topics (messages 161404 through 161437): multiple db query 161404 by: Aris Santillan 161406 by: John W. Holmes 161435 by: Marek Kilimajer 161436 by: murugesan Re: How Energy Storage can help us ? 161405 by: Flywheel script archives 161407 by: Dennis Gearon 161408 by: Chris Shiflett 161409 by: Dennis Gearon 161410 by: Dennis Gearon Re: session-problem 161411 by: Curt Zirzow Re: MySQL Left Join Question 161412 by: Nicholas Robinson Re: TIME 161413 by: Nicholas Robinson 161414 by: Curt Zirzow accessing $GLOBALS values 161415 by: Dennis Gearon 161428 by: Ivo Fokkema Copy database from MySQL to MSAccess 161416 by: Kjell Hansen 161418 by: Leonie 161434 by: Kjell Hansen web-mail problem 161417 by: Lingua2001 161421 by: Raditha Dissanayake 161430 by: Viraj Kalinga Abayarathna Re: randomly select a table, better way? 161419 by: Jason Wong Re: php 5 - mysql replication 161420 by: Moritz Steiner Re: Lack of info 161422 by: David Robley Block HTML Control 161423 by: Seth Willits 161424 by: Jason Wong 161425 by: Seth Willits 161426 by: Raditha Dissanayake 161429 by: Seth Willits 161432 by: Viraj Kalinga Abayarathna 161433 by: Viraj Kalinga Abayarathna Re: PHP Interview questions and how to pass parameters to .js files 161427 by: murugesan Re: Foring a file download *and* page reload 161431 by: Marek Kilimajer Re: execute command line script from browser 161437 by: Jay Blanchard Administrivia: To subscribe to the digest, e-mail: [EMAIL PROTECTED] To unsubscribe from the digest, e-mail: [EMAIL PROTECTED] To post to the list, e-mail: [EMAIL PROTECTED] -- ---BeginMessage--- is it possible to query on 2 databases but with same tablename and merge its output? ---End Message--- ---BeginMessage--- Aris Santillan wrote: is it possible to query on 2 databases but with same tablename and merge its output? Probably. It depends upon your database, though. SELECT t1.column, t2.column FROM database1.table1 t1, database2.table2 t2 WHERE ... -- ---John Holmes... Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/ php|architect: The Magazine for PHP Professionals www.phparch.com ---End Message--- ---BeginMessage--- For MySQL Version 3.23.25 and above - yes, and it is (surprisingly) called MERGE. I'm not sure if tables can be merged across databases. More in the manual. Aris Santillan wrote: is it possible to query on 2 databases but with same tablename and merge its output? ---End Message--- ---BeginMessage--- I tried this and it is working well. I use 2 DB namely db1 and db2 Mysqluse db1; Mysqlselect vv.visitorname,aa.visitorname from db1.visitordetails vv, db2.visitordetails aa; -Murugesan - Original Message - From: Marek Kilimajer [EMAIL PROTECTED] To: Aris Santillan [EMAIL PROTECTED] Cc: Php (E-mail) [EMAIL PROTECTED] Sent: Tuesday, September 02, 2003 4:29 PM Subject: Re: [PHP] multiple db query For MySQL Version 3.23.25 and above - yes, and it is (surprisingly) called MERGE. I'm not sure if tables can be merged across databases. More in the manual. Aris Santillan wrote: is it possible to query on 2 databases but with same tablename and merge its output? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php ---End Message--- ---BeginMessage--- Nice Hello from Flywheel Storage Sun Tracking Goodbay to Blackout forever [EMAIL PROTECTED] Responding to your Questions; We offer Safety Solution Rolling Blackout will always happened, since the SYSTEM - is design to protect itself in dangerous Over-Current Situations. Breakers basic duty is defense whole system, shut down, and isolate from Grid; Wave of over-current travel to next Sub-Station and stimulate the same results on another, then another, then another. And a VOLTAGE is growing rapidly. Growing Disconnection in Domino Effect; we did seen twice; Accident ~ 30 years ago (baby boom) - for purpose recently. To decrease all Over-Current situation in POWER LINE or reduce to Zero ALL EXCESS ENERGY USE Energy Storage 25 - 1000 MWh and no Sub - Station will ever have any risk again. Small units UPS 20 - 200 kWh protect Stories, mainframes, servers, computers and homes, hospitals, public private places; give back emergency energy for hours days and/or time for diesel/gas generator to work. But with Solar Palette Sun Tracking - you don't need anything else. Enjoy Safety Energy Supply for generations to come; Rest you can find on: www.sun-tracking.com
[PHP] Re: can't include 'http...foo.php', but can include 'http...foo.txt'
[EMAIL PROTECTED] (paul13) wrote in message news:[EMAIL PROTECTED]... How do I use the physical location for a page on another machine? 'http://www.foo.com/usr/local/htdocs/includes/includes.php' with whatever is the acurate physical location following the .com? Paul I sure hope that URL is 404. When you include a valid external URL you're including what that URL outputs (should be obvious)? So pull up 'http://www.foo.com/includes.php' in your browser. View the source. That's what you're including. surely this is covered here: http://us3.php.net/manual/en/function.include.php ? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Backup Database
Hi, Is there a facility out there that I can use to automatically backup my database to my local machine every night using PHP and MySQL? Thanks for your help -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Website templating schemes
Search google for Smarty (I believe it's www.smarty.php) It's a great way of separating output from the logic using templates. Ronald Joel Konkle-Parker [EMAIL PROTECTED] schreef in bericht news:[EMAIL PROTECTED] I'm trying to make a PHP-backed website, and I'm trying to decide between two templating schemes: 1. define 2 php template files: header.php, footer.php. in index.php, require header.php, output content, require footer.php 2. define a php template file and a local page file. index.php defines body() and crequires template.php. template.php prints the header, calls body() to print the content, and and prints the footer. I'm currently using the second method, but I've only seen the first used elsewhere. Is there a reason that #1 is better than #2 (or is anything else even better than that?)? -- Joel Konkle-Parker Webmaster [Ballsome.com] Phone [662-518-1636] E-mail[EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Website templating schemes
Search google for Smarty (I believe it's www.smarty.php) It's a great way of separating output from the logic using templates. That'd be smarty.php.net ... didn't know .php was a tld :) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Backup Database
you can write a PHP script to backup the DB to a SQL file and run that script using crond at scheduled time or periodiacally as you define in cron regards viraj Shaun wrote: Hi, Is there a facility out there that I can use to automatically backup my database to my local machine every night using PHP and MySQL? Thanks for your help -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Open-source browser-based POS system?
Anyone know of an open source, browser-based Point of Sale system? -- John -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Restart Apache with PHP???
Hey guys gals... Is there a way to restart Apache with a PHP command? Joe Harman -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Backup Database
Hi Shaun, DevShed's last weekly newsletter had the following: Daily Scheduled Backup of MYSQL Databases - Looking for a free tool or utility to handle scheduled MySQL backups. http://forums.devshed.com/t74513/s.html Haven't tried any of the solutions yet, but will be soon! James -Original Message- From: Shaun [mailto:[EMAIL PROTECTED] Sent: 02 September 2003 15:18 To: [EMAIL PROTECTED] Subject: [PHP] Backup Database Hi, Is there a facility out there that I can use to automatically backup my database to my local machine every night using PHP and MySQL? Thanks for your help -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php This email is only intended for the person(s) to whom it is addressed and may contain confidential information. Unless stated to the contrary, any opinions or comments are personal to the writer and do not represent the official view of the company. If you have received this e-mail in error, please notify us immediately by reply e-mail and then delete this message from your system. Please do not copy it or use if for any purposes, or disclose its contents to any other person. We make every effort to keep our network free from viruses. You should independently check this e-mail and any attachments for viruses, as we can take no responsibility for any computer viruses that might be transferred by way of this e-mail. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Restart Apache with PHP???
hi, There isn't a specific PHP api for this. But you can execute shell commands through various mechanisms included exec, backticks etc etc. All of this is deadly dangerous of course because you need root privileges. Joe Harman wrote: Hey guys gals... Is there a way to restart Apache with a PHP command? Joe Harman -- http://www.raditha.com/php/progress.php A progress bar for PHP file uploads. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Open-source browser-based POS system?
a quick search on google revealed a few things http://www.google.ca/search?q=browser+based+POSie=UTF-8oe=UTF-8hl=enmeta= try that and see if any of those meet your requirements Chris - Original Message - From: John Almberg [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, September 02, 2003 9:01 AM Subject: [PHP] Open-source browser-based POS system? Anyone know of an open source, browser-based Point of Sale system? -- John -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Open-source browser-based POS system?
Hi Chris, Yes, I found a number of systems on Source Forge. I should have made my question more specific . . . Anyone have any experience with an open source, browser-based POS system, and can recommend one or two for a collectable/hobby store with a large (20,000+) inventory of different items? -- John Chris Sherwood wrote: a quick search on google revealed a few things http://www.google.ca/search?q=browser+based+POSie=UTF-8oe=UTF-8hl=enmeta= try that and see if any of those meet your requirements Chris - Original Message - From: John Almberg [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, September 02, 2003 9:01 AM Subject: [PHP] Open-source browser-based POS system? Anyone know of an open source, browser-based Point of Sale system? -- John -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- Identry, LLC Northport, NY 11768 Ph: 631.754.8440 Fx: 631.980.4262 Em: [EMAIL PROTECTED] Member: Long Island Web Developers Guild Visit us at: www.identry.com Take control of your Web site
Re: [PHP] Restart Apache with PHP???
Search the archives. Somebody wanted to restart their server using a web page, and a clever solution was pointed out. By creating a script that monitored for a particular file in temp and restarted the server if it existed it, and cronning it for every minute, they could do it safely and securely. -Dan On Tue, 2003-09-02 at 12:19, Joe Harman wrote: Hey guys gals... Is there a way to restart Apache with a PHP command? Joe Harman -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] password systems
Dennis Gearon mailto:[EMAIL PROTECTED] on Sunday, August 31, 2003 12:36 AM said: Anyone have any sources of noun/verb/adjective lists for password generation? Sorry I don't have a resource for you, but passwords shouldn't use dictionary words in the first place. Have you considered creating random passwords? Chris. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Copy database from MySQL to MSAccess
server. So I'm actually never gonna use Access, it's just the database I'm using for storage of data. Well ODBC implies that you are going to have a database program (i.e. Oracle, SQL Server, Access, whatever) to connect to. At least that's how I understand it to work. So if you don't have a copy of Access running you will need to figure out how to export it to Access format, or a way to export it easily (Excel lets you open up XML spreadsheets, which are pretty easy to create using PHP. ). -Dan -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Gripe^2 [was Gripe]
Curt Zirzow mailto:[EMAIL PROTECTED] on Friday, August 29, 2003 7:54 PM said: Why do people insist on using their work address so we are plagued with privacy notices and autorespond's letting us know that he will be gone one extra day over the weekend Well fortunately for me I don't have a signature nor do I have a disclaimer added on each email. But I can answer your question anyway. I use my work email address because I'm not supposed to access any other email addresses. I mean I can create all the aliases I want for my account but I can't use a personal email address during work time. So yeah, that's why. Chris. -- I used to be indecisive, but now I'm indecisive. Wait, something's wrong... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Re: Website templating schemes
Duncan Hill mailto:[EMAIL PROTECTED] on Tuesday, September 02, 2003 8:07 AM said: Search google for Smarty (I believe it's www.smarty.php) It's a great way of separating output from the logic using templates. That'd be smarty.php.net ... didn't know .php was a tld :) And how about this one? www.microsoft.asp -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Block HTML Control
On Tuesday, September 2, 2003, at 02:06 AM, Viraj Kalinga Abayarathna wrote: Seth, ?php if ($thisVar) { if ($myVar) { lots; of; php; } else { // End of PHP content ? lots of html ?php // End of HTML content } } ? Aaa ok. I was confused with the semi colon and colon used in the last example. This clears it all up. Thanks. Seth Willits --- President and Head Developer of Freak Software - http://www.freaksw.com QA Columnist for REALbasic Developer Magazine - http://www.rbdeveloper.com Webmaster for REALbasic Game Central - http://www.freaksw.com/rbgames Dreams are what reality is made of. -- Seth Willits --- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Block HTML Control
Seth Willits wrote: Aaa ok. I was confused with the semi colon and colon used in the last example. This clears it all up. Thanks. http://us3.php.net/manual/en/control-structures.alternative-syntax.php -- The above message is encrypted with double rot13 encoding. Any unauthorized attempt to decrypt it will be prosecuted to the full extent of the law. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Session var read by form C++ CGI prog ?
I need to use something like a session variable to make a variable available to an existing form-invoked C++ program which takes as input a file being uploaded. Is this even do-able ??If so, what am I missing here ??? The C++ prog used to use the REMOTE_USER env var set by the web server but we are no longer doing authentication via the webserver itself, so this one does not get set, and I need to set something myself. The C++ prog would had been grabbing this by getenv(REMOTE_USER). I was trying some php to set a session var 'UPATH' but the UPATH variable doesn't seem to be visible to MyCppProg.exe : --snip-- ?php $_SESSION['UPATH'] = 'foobar'; ? form enctype=multipart/form-data action=MyCppProg.exe method=post File to Upload: input name=file type=file input type=submit value=Send /form --snip-- I am new to php, have been digging around on the web, and not making a lot of headway quickly enough, so I'm asking. Thanks, JB -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Session var read by form C++ CGI prog ?
Hi, Had a similar problem when building upload progress bar. Initially i used cookies but that had a few minor hiccups. What you can do is to encode your variables into the query string. This is accessible as part of the env. variables. Since you are familiar with C++ you will get the hang of PHP very quickly. oh and btw the correct way to set a cookie is with session_register(), $_SESSION is used for retrieval. all the best John Bryan wrote: I need to use something like a session variable to make a variable available to an existing form-invoked C++ program which takes as input a file being uploaded. Is this even do-able ??If so, what am I missing here ??? The C++ prog used to use the REMOTE_USER env var set by the web server but we are no longer doing authentication via the webserver itself, so this one does not get set, and I need to set something myself. The C++ prog would had been grabbing this by getenv(REMOTE_USER). I was trying some php to set a session var 'UPATH' but the UPATH variable doesn't seem to be visible to MyCppProg.exe : --snip-- ?php $_SESSION['UPATH'] = 'foobar'; ? form enctype=multipart/form-data action=MyCppProg.exe method=post File to Upload: input name=file type=file input type=submit value=Send /form --snip-- I am new to php, have been digging around on the web, and not making a lot of headway quickly enough, so I'm asking. Thanks, JB -- http://www.raditha.com/php/progress.php A progress bar for PHP file uploads. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Session var read by form C++ CGI prog ?
Thanks, very much, Raditha. Do you mean to pass my variable as a cgi parameter ? If so, the problem is that this file that is being uploaded via the form to the program MyCppProg.exe gets sent as THE input to the prog, apparently as a cgi-type parameter through stdin (i.e. cin), so that when I try to pass the value as a cgi parameter, it gets inserted INTO the file that is being uploaded. Am I understanding correctly, or did I miss the point ? Thanks, JB On Tuesday, September 02, 2003, at 01:21PM, Raditha Dissanayake [EMAIL PROTECTED] wrote: Hi, Had a similar problem when building upload progress bar. Initially i used cookies but that had a few minor hiccups. What you can do is to encode your variables into the query string. This is accessible as part of the env. variables. Since you are familiar with C++ you will get the hang of PHP very quickly. oh and btw the correct way to set a cookie is with session_register(), $_SESSION is used for retrieval. John Bryan wrote: I need to use something like a session variable to make a variable available to an existing form-invoked C++ program which takes as input a file being uploaded. Is this even do-able ??If so, what am I missing here ??? The C++ prog used to use the REMOTE_USER env var set by the web server but we are no longer doing authentication via the webserver itself, so this one does not get set, and I need to set something myself. The C++ prog would had been grabbing this by getenv(REMOTE_USER). I was trying some php to set a session var 'UPATH' but the UPATH variable doesn't seem to be visible to MyCppProg.exe : --snip-- ?php $_SESSION['UPATH'] = 'foobar'; ? form enctype=multipart/form-data action=MyCppProg.exe method=post File to Upload: input name=file type=file input type=submit value=Send /form --snip-- -- John Bryan [EMAIL PROTECTED] http://homepage.mac.com/johnbryan http://homepage.mac.com/aijuan -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Session var read by form C++ CGI prog ?
On 02 September 2003 19:22, Raditha Dissanayake wrote: Hi, Had a similar problem when building upload progress bar. Initially i used cookies but that had a few minor hiccups. What you can do is to encode your variables into the query string. This is accessible as part of the env. variables. Since you are familiar with C++ you will get the hang of PHP very quickly. oh and btw the correct way to set a cookie is with session_register(), $_SESSION is used for retrieval. Er, nope. If you have a version of PHP with the $_SESSION array, then you use it for both setting *and* retrieving -- session_register() and friends should *not* be used in this case. (Indeed, there are circumstances where the combination of session_register() with $_SESSION gives broken behaviour.) Cheers! Mike - Mike Ford, Electronic Information Services Adviser, Learning Support Services, Learning Information Services, JG125, James Graham Building, Leeds Metropolitan University, Beckett Park, LEEDS, LS6 3QS, United Kingdom Email: [EMAIL PROTECTED] Tel: +44 113 283 2600 extn 4730 Fax: +44 113 283 3211 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Session var read by form C++ CGI prog ?
On Tuesday, September 02, 2003, at 01:32PM, Ford, Mike [LSS] [EMAIL PROTECTED] wrote: On 02 September 2003 19:22, Raditha Dissanayake wrote: Hi, Had a similar problem when building upload progress bar. Initially i used cookies but that had a few minor hiccups. What you can do is to encode your variables into the query string. This is accessible as part of the env. variables. Since you are familiar with C++ you will get the hang of PHP very quickly. oh and btw the correct way to set a cookie is with session_register(), $_SESSION is used for retrieval. Er, nope. If you have a version of PHP with the $_SESSION array, then you use it for both setting *and* retrieving -- session_register() and friends should *not* be used in this case. (Indeed, there are circumstances where the combination of session_register() with $_SESSION gives broken behaviour.) Right. I am running PHP 4.3.3. Win32 version to be specific, on Win2k server, with Apache 1.3.26. I installed PHP to try and do this trick. JB -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] read / unread system for my forum
Hi all i'm coding a little forum an now i want to make a read / unread system for the new posts and topics. Can anybody explain to me, how I can do that? mfg codemonkey -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Session var read by form C++ CGI prog ?
Oh well, and i thought i knew everything about php :-( Ford, Mike [LSS] wrote: On 02 September 2003 19:22, Raditha Dissanayake wrote: Hi, Had a similar problem when building upload progress bar. Initially i used cookies but that had a few minor hiccups. What you can do is to encode your variables into the query string. This is accessible as part of the env. variables. Since you are familiar with C++ you will get the hang of PHP very quickly. oh and btw the correct way to set a cookie is with session_register(), $_SESSION is used for retrieval. Er, nope. If you have a version of PHP with the $_SESSION array, then you use it for both setting *and* retrieving -- session_register() and friends should *not* be used in this case. (Indeed, there are circumstances where the combination of session_register() with $_SESSION gives broken behaviour.) Cheers! Mike - Mike Ford, Electronic Information Services Adviser, Learning Support Services, Learning Information Services, JG125, James Graham Building, Leeds Metropolitan University, Beckett Park, LEEDS, LS6 3QS, United Kingdom Email: [EMAIL PROTECTED] Tel: +44 113 283 2600 extn 4730 Fax: +44 113 283 3211 -- http://www.raditha.com/php/progress.php A progress bar for PHP file uploads. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Session var read by form C++ CGI prog ?
Hello, If you use input type='hidden' yes they will be part of the input stream. What i suggested was you have form method=post action=/cgi-bin/mycgi.exe?qid=123 then you can retrieve the query string variable from the env. (at least this works with perl cgi and i don't see why it shouldn't work with C++ as well). the only draw back is that you have to process the qstring yourself. best regards raditha John Bryan wrote: Thanks, very much, Raditha. Do you mean to pass my variable as a cgi parameter ? If so, the problem is that this file that is being uploaded via the form to the program MyCppProg.exe gets sent as THE input to the prog, apparently as a cgi-type parameter through stdin (i.e. cin), so that when I try to pass the value as a cgi parameter, it gets inserted INTO the file that is being uploaded. Am I understanding correctly, or did I miss the point ? Thanks, JB On Tuesday, September 02, 2003, at 01:21PM, Raditha Dissanayake [EMAIL PROTECTED] wrote: Hi, Had a similar problem when building upload progress bar. Initially i used cookies but that had a few minor hiccups. What you can do is to encode your variables into the query string. This is accessible as part of the env. variables. Since you are familiar with C++ you will get the hang of PHP very quickly. oh and btw the correct way to set a cookie is with session_register(), $_SESSION is used for retrieval. John Bryan wrote: I need to use something like a session variable to make a variable available to an existing form-invoked C++ program which takes as input a file being uploaded. Is this even do-able ??If so, what am I missing here ??? The C++ prog used to use the REMOTE_USER env var set by the web server but we are no longer doing authentication via the webserver itself, so this one does not get set, and I need to set something myself. The C++ prog would had been grabbing this by getenv(REMOTE_USER). I was trying some php to set a session var 'UPATH' but the UPATH variable doesn't seem to be visible to MyCppProg.exe : --snip-- ?php $_SESSION['UPATH'] = 'foobar'; ? form enctype=multipart/form-data action=MyCppProg.exe method=post File to Upload: input name=file type=file input type=submit value=Send /form --snip-- -- John Bryan [EMAIL PROTECTED] http://homepage.mac.com/johnbryan http://homepage.mac.com/aijuan -- http://www.raditha.com/php/progress.php A progress bar for PHP file uploads. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] password systems
Anyone have any sources of noun/verb/adjective lists for password generation? Google search for Aspell and Pspell. Here's a link to Aspell info, which has a link to dictionaries: http://aspell.net/ -- Lowell Allen -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Session var read by form C++ CGI prog ?
From: John Bryan [EMAIL PROTECTED] If so, the problem is that this file that is being uploaded via the form to the program MyCppProg.exe gets sent as THE input to the prog, apparently as a cgi-type parameter through stdin (i.e. cin), so that when I try to pass the value as a cgi parameter, it gets inserted INTO the file that is being uploaded. Does this file already exist or are you looking to create it? It sounds like you just need to fopen() the file, tack on your variable at the end of the file (in some format) and then let the C++ program load the file, right? ---John Holmes... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] read / unread system for my forum
i'm coding a little forum an now i want to make a read / unread system for the new posts and topics. Can anybody explain to me, how I can do that? I'm not sure what you mean, do you mean let each users mark messages as read or not read? Well, if you don't mind the space in a mySQL database you could create a read_bool BIT in the table and for each user reference it. Of course, if you don't expire forum entries or index the tables you will be looking at serious performance issues. -Dan -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] opening remote tar.gz files
is it possible with PHP to download and open a remote tar.gz file?? I read in the manual that it is, but it never seems to work for me. I tried opening the file with fopen fopen(zlib://http://www.site.com/update.tar.gz;, r); but it didnt work Then I tried using the zlib functions but they just returned garbage. I think it might have something to do with it not being able to handle .tar -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Backup Database
Do some googling. I keep seeing this on the listserv and there has to be a free/opensource one out there somewhere. -Dan -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] opening remote tar.gz files
[snip] is it possible with PHP to download and open a remote tar.gz file?? I read in the manual that it is, but it never seems to work for me. I tried opening the file with fopen fopen(zlib://http://www.site.com/update.tar.gz;, r); but it didnt work Then I tried using the zlib functions but they just returned garbage. I think it might have something to do with it not being able to handle .tar [/snip] See http://www.php.net/zlib and try $compFile = gzopen(foo.tar.gz), r); HTH! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Session var read by form C++ CGI prog ?
On Tuesday, September 02, 2003, at 02:04PM, Raditha Dissanayake [EMAIL PROTECTED] wrote: Hello, If you use input type='hidden' yes they will be part of the input stream. What i suggested was you have form method=post action=/cgi-bin/mycgi.exe?qid=123 then you can retrieve the query string variable from the env. (at least this works with perl cgi and i don't see why it shouldn't work with C++ as well). the only draw back is that you have to process the qstring yourself. Right. That is what I had tried before, using it as a hidden parameter. I will try passing as part of the explicit call to the prog as you describe. thanks, jb -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] opening remote tar.gz files
There are a number of possible solutions. If i remember correctly some compressed file types need the ability to handle them compiled into PHP. Try different things. Sometimes the easiest way to do things is to FTP into the remote server and ftp into your server to transfer it. -Dan -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Session var read by form C++ CGI prog ?
On Tuesday, September 02, 2003, at 01:55PM, CPT John W. Holmes [EMAIL PROTECTED] wrote: From: John Bryan [EMAIL PROTECTED] If so, the problem is that this file that is being uploaded via the form to the program MyCppProg.exe gets sent as THE input to the prog, apparently as a cgi-type parameter through stdin (i.e. cin), so that when I try to pass the value as a cgi parameter, it gets inserted INTO the file that is being uploaded. Does this file already exist or are you looking to create it? It sounds like you just need to fopen() the file, tack on your variable at the end of the file (in some format) and then let the C++ program load the file, right? ---John Holmes... The file would already exist on the client side. They are uploading the file to be processed by this program MyCppProg.exe, which is invoked as a form 'action'. This already works, but depends on the Apache variable REMOTE_USER being set when user logs in, but we moving to implement a different method for authentication that involves talking to two different Oracle databases, password rules, etc., so this REMOTE_USER variable no longer gets set since we are bypassing Apache's authentication here. So I need to set an 'environment' variable that remains visible to scripts and progs within the session space, that can then be grabbed by the MyCppProg.exe, for example with getenv(MyEnvVar). It used to use getenv(REMOTE_USER). I'm hoping to not have this variable have to be part of the file that gets uploaded. thanks, jb -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] evaluating dynamic variable
Hi, I'm having trouble evaluating a dynamic variable. I want to check if the variable $_POST[resolutions$i] is an empty string, as you'll see from the code. However, every way I've tried to check the variable so far (including empty() and eval()) always returns a null value, even when the variable should contain a value. I've probably been doing something wrong in my previous efforts. Can someone recommend a way to reliably evaluate this variable? for ($i=1; $i=$entries; $i++) { if($_POST[resolutions$i] !== ''){ do_something(); } } Thanks. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Including classes inside functions vs outside - scope/global[solved]
Hi Greg, I've been on a holiday and just got to ttry this last night. Worked like a charm. Thank You! Salut, verdon Hi Verdon, Be sure that $connobj is declared as a global variable in the mysql_connection.php file. You can do this in two ways: 1) instead of $connobj = blah, use $GLOBALS['connobj'] = blah 2) global $connobj; $connobj = blah Regards, Greg -- phpDocumentor http://www.phpdoc.org Verdon Vaillancourt wrote: Hi :) Somewhat newbie question... I'm trying to include some open source classes into a project I am working on. The classes build a set of relational select menus from the contents of two tables. I have not trouble using the classes in a simple test page, but am running into problems when I try to use them as part of a function. For instance... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Block HTML Control
You do realize that you don't need a semicolon right after ?php tags, correct? -Dan On Tue, 2003-09-02 at 04:59, Viraj Kalinga Abayarathna wrote: Seth, try to mingle PHP and HTML.. that means escape the PHP and jump to HTML when you want the HTML.. like this... ?php if (!$var) { ?lots of html ?php ; } else { ? lots of html ?php ; } ? happy coding Viraj Seth Willits wrote: I'd like to show a big chunk of HTML if a particular variable is true, and if its false I'd like to show a different big chunk of html. Right now the only way I know of doing this is: if ($var) { print ' lots of html '; } else { print ' lots of html '; } This works, but it destroys the syntax coloring of the html making it all one solid color. I'd love to know if there's a better way OTHER than include()ing different files. Seth Willits --- President and Head Developer of Freak Software - http://www.freaksw.com QA Columnist for REALbasic Developer Magazine - http://www.rbdeveloper.com Webmaster for REALbasic Game Central - http://www.freaksw.com/rbgames Knowledge is limited. Imagination encircles the world. -- Albert Einstein --- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Session var read by form C++ CGI prog ?
From: John Bryan [EMAIL PROTECTED] The file would already exist on the client side. They are uploading the file to be processed by this program MyCppProg.exe, which is invoked as a form 'action'. This already works, but depends on the Apache variable REMOTE_USER being set when user logs in, but we moving to implement a different method for authentication that involves talking to two different Oracle databases, password rules, etc., so this REMOTE_USER variable no longer gets set since we are bypassing Apache's authentication here. So I need to set an 'environment' variable that remains visible to scripts and progs within the session space, that can then be grabbed by the MyCppProg.exe, for example with getenv(MyEnvVar). It used to use getenv(REMOTE_USER). I'm hoping to not have this variable have to be part of the file that gets uploaded. Ah, I see now. If you're using a file upload box and submitting that form directly to your .exe, then there's probably not much you can do. In order to do this, I think you'll have to intercept the file. When the user submits the file, it goes to a PHP script that copies it somewhere. Then see if you can make an exec() call to the system and set the REMOTE_USER variable, somehow. I'm not sure on the syntax/possibility of that, it would depend upon your OS. Then make another exec() call to your C++ program and send it the path the the file that was already uploaded. Capture the output and show it to the user or do whatever you normally do. ---John Holmes... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] evaluating dynamic variable
[snip] I'm having trouble evaluating a dynamic variable. I want to check if the variable $_POST[resolutions$i] is an empty string, as you'll see from the code. However, every way I've tried to check the variable so far (including empty() and eval()) always returns a null value, even when the variable should contain a value. I've probably been doing something wrong in my previous efforts. Can someone recommend a way to reliably evaluate this variable? for ($i=1; $i=$entries; $i++) { if($_POST[resolutions$i] !== ''){ do_something(); } } [/snip] Well, I tried this /* ** submit form (res1.php) */ form action=res2.php method=POST input type=text name=resolution1 input type=text name=resolution2 input type=submit /form /* ** process (res2.php) */ ?php $entries = count($_POST); for ($i=1; $i=$entries; $i++) { if($_POST[resolutions$i] !== ''){ print($_POST[resolution$i]); } } ? And I had no problems. HTH! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] evaluating dynamic variable
this worked for me. ? $entries = 20; for ($i=1; $i=$entries; $i++) { if(isset($_POST[resolutions$i]) $_POST[resolutions$i] !== ''){ echo Hello $ibr /; } } ? html body form method=POST input type=hidden name=resolutions1 value=etefgtE / input type=hidden name=resolutions3 value=etefgtE / input type=hidden name=resolutions5 value=etefgtE / input type=hidden name=resolutions6 value=etefgtE / input type=hidden name=resolutions15 value=etefgtE / input type=hidden name=resolutions12 value= / input type=submit name=submit / /form /body /html -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] evaluating dynamic variable
Steve Goodman mailto:[EMAIL PROTECTED] on Tuesday, September 02, 2003 12:54 PM said: Can someone recommend a way to reliably evaluate this variable? 1. (not positive on this point so correct me if I'm wrong) you shouldn't compare with !==. Instead us !=. 2. What does the following do? for ($i=1; $i=$entries; $i++) { if(empty($_POST[resolutions.$i])) { echo empty!; } else { echo not empty! } } You might also like to try isset() along with empty(). hth, Chris. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] evaluating dynamic variable
Chris W. Parker on Tuesday, September 02, 2003 1:29 PM said: 1. (not positive on this point so correct me if I'm wrong) you shouldn't compare with !==. Instead us !=. Ok, turns out I'm wrong on that. I guess I should go look it up!! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Form variables lost when duplicate records are found !
Hello everyone, I am making use of a php form to add company details to a MySQL Database. Before I add the form variables I am checking to see if the SAME company name exists in the DB. If the same company exists, then a notification is provided. In between this , the variables that were entered on the form are LOST. Is there anyway I can store the variables so that if a duplicate record was found to be present, then the forms variables are stored and NOT LOST ?? Any suggestions would be greatly appreciated ! Thanks in advance --Pushpinder -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Form variables lost when duplicate records are found!
[snip] then the forms variables are stored and NOT LOST ?? [/snip] Have you looked into sessions? http://www.php.net/manual/en/ref.session.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] evaluating dynamic variable
When I run the code you've attached, with $i iterating up to 3, I get three 'empty!', even if $resolution1 should be 'not empty!'. It seems like the $i in $_POST[resolutions.$i] is not getting parsed into a value, and php is looking for a key resolutions$i. Whoops, I'm an idiot. Resolution singular, not plural. Thanks for the help everyone . -Original Message- From: Chris W. Parker [mailto:[EMAIL PROTECTED] Sent: Tuesday, September 02, 2003 3:29 PM To: Stephen Goodman; [EMAIL PROTECTED] Subject: RE: [PHP] evaluating dynamic variable Steve Goodman mailto:[EMAIL PROTECTED] on Tuesday, September 02, 2003 12:54 PM said: Can someone recommend a way to reliably evaluate this variable? 1. (not positive on this point so correct me if I'm wrong) you shouldn't compare with !==. Instead us !=. 2. What does the following do? for ($i=1; $i=$entries; $i++) { if(empty($_POST[resolutions.$i])) { echo empty!; } else { echo not empty! } } You might also like to try isset() along with empty(). hth, Chris. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] evaluating dynamic variable
From: Stephen Goodman [EMAIL PROTECTED] When I run the code you've attached, with $i iterating up to 3, I get three 'empty!', even if $resolution1 should be 'not empty!'. It seems like the $i in $_POST[resolutions.$i] is not getting parsed into a value, and php is looking for a key resolutions$i. Whoops, I'm an idiot. Resolution singular, not plural. Thanks for the help everyone Does that mean you solved it? Remember that PHP is case sensitive, too. $_POST['Resolution'] is not the same as $_POST['resolution']. If you're still having trouble, go back to some basic debugging. Do a print_r($_POST) so you actually know what $_POST contains, to begin with. ---John Holmes... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Form variables lost when duplicate records are found !
--- Pushpinder Singh Garcha [EMAIL PROTECTED] wrote: I am making use of a php form to add company details to a MySQL Database. Before I add the form variables I am checking to see if the SAME company name exists in the DB. If the same company exists, then a notification is provided. In between this , the variables that were entered on the form are LOST. Is there anyway I can store the variables so that if a duplicate record was found to be present, then the forms variables are stored and NOT LOST ?? Of course. However, I don't understand what you need help with. Is there anyway I can store the variables... There are many ways to store data with PHP. You can use the filesystem, a database, etc. Are you asking how to store data? Chris = Become a better Web developer with the HTTP Developer's Handbook http://httphandbook.org/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Form variables lost when duplicate records are found !
From: Pushpinder Singh Garcha [EMAIL PROTECTED] I am making use of a php form to add company details to a MySQL Database. Before I add the form variables I am checking to see if the SAME company name exists in the DB. If the same company exists, then a notification is provided. In between this , the variables that were entered on the form are LOST. Is there anyway I can store the variables so that if a duplicate record was found to be present, then the forms variables are stored and NOT LOST ?? Any suggestions would be greatly appreciated ! Thanks in advance How do you display the form again when there is a notification? Something as simple as: input type=text name=some_name value=? echo htmlentities($_POST['some_name']); ? will (safely) remember POSTed variables when you show the form again. ---John Holmes... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Form variables lost when duplicate records are found !
I am currently using sessions on my site // are you suggesting that I store all the possible 30 form variables in a temp session array. ?? and destroy it afterwards Thanks -Pushpinder On Tuesday, September 2, 2003, at 04:41 PM, Matt Matijevich wrote: [snip] then the forms variables are stored and NOT LOST ?? [/snip] Have you looked into sessions? http://www.php.net/manual/en/ref.session.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] opening remote tar.gz files
* Thus wrote Jay Blanchard ([EMAIL PROTECTED]): [snip] is it possible with PHP to download and open a remote tar.gz file?? I read in the manual that it is, but it never seems to work for me. I tried opening the file with fopen fopen(zlib://http://www.site.com/update.tar.gz;, r); but it didnt work Then I tried using the zlib functions but they just returned garbage. I think it might have something to do with it not being able to handle .tar [/snip] See http://www.php.net/zlib and try $compFile = gzopen(foo.tar.gz), r); The only problem with this is that he'll result with a tar file. Curt -- I used to think I was indecisive, but now I'm not so sure. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] opening remote tar.gz files
* Thus wrote John Ryan ([EMAIL PROTECTED]): is it possible with PHP to download and open a remote tar.gz file?? I read in the manual that it is, but it never seems to work for me. I tried opening the file with fopen fopen(zlib://http://www.site.com/update.tar.gz;, r); but it didnt work Then I tried using the zlib functions but they just returned garbage. I think it might have something to do with it not being able to handle .tar What are you trying to do with the file? A tar file can contain multiple files and have a directory structure. Curt -- I used to think I was indecisive, but now I'm not so sure. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] anyone using sqlite raise your hand
Are people on this list using the sqlite extension with php? I was unable to subscribe to pear-php or get an answer from its webmaster (or the developer of the extension) and would like some feedback on a problem I have. -- Regards, Andu Novac -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Fwd: Re: [PHP] Form variables lost when duplicate records arefound !
The approach of using $_GET variables would just make the URL very very long, like imagine having to pass close to 33 variables on the form. The other option wud be to use $_SESSION array to store the form variables. Does anyone have nay other suggestion.? Thanks in advance ! /pS On Tuesday, September 2, 2003, at 05:13 PM, Matt Matijevich wrote: [snip] when the user comes back to the add_new.php [/snip] I would use session vars in this case. You could also use get variables. Say the company name is in the database and you have to redirect back to add_new.php, in your header call you could say something like: header(Location: add_new.php?field1=$_POST[field1]field2=$_POST[field2]) but I would just use session vars. Pushpinder Singh Garcha [EMAIL PROTECTED] 09/02/03 04:03PM This is the way it works there is a table with company name as the primary key. 1. A logged in User enters details of the company he/she wants to ad to to the MySQL DB. This form is embedded in add_new.php which call add_new_result.php as a POST method. 2. if the company name exists in the DB the user is alerted and and asked to choose a different company name. Now my question is , when the user comes back to the add_new.php page he looses all the data that he had entered. I hope this makes it clear. Thanks again --pS On Tuesday, September 2, 2003, at 04:51 PM, Matt Matijevich wrote: -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Session var read by form C++ CGI prog ?
On Tuesday, September 02, 2003, at 02:04PM, Raditha Dissanayake [EMAIL PROTECTED] wrote: Hello, If you use input type='hidden' yes they will be part of the input stream. What i suggested was you have form method=post action=/cgi-bin/mycgi.exe?qid=123 then you can retrieve the query string variable from the env. (at least this works with perl cgi and i don't see why it shouldn't work with C++ as well). the only draw back is that you have to process the qstring yourself. Actually, upon further reading it seems I won't be able to do this. If I pass parameters in this fashion, the web server will make them available in QUERY_STRING, but I need to use the GET method. The form is using the POST method so that the file that is being uploaded and processed gets handed to the cgi program through stdin. So looks like I can't have it both ways, i.e. POST and GET, stdin and query string env var. Thanks, JB -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] how to include() N lines?
hello! i need to include() only a given amount of lines (the first 10 for example) instead of a whole file. does someone know how this has to be done? thanks a lot for your effort, best regards philipp -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Problem with IE parsing of PHP output
Hi, I have a class which write a menu, it works fine with Mozilla and Opera but with IE (6 on XP) got a extrange behaviour. Links works and submenus are open, but the second time the page is loaded I can not see the source and if I try to save the file IE says some files are missed. The environment: Apache 2 on Windows XP PHP, 4.3.2 as apache module on Localhost mod_rewrite send all the request for valid html/php files internally to index.php if no session include javascriptAutoForm_class.php (send a client side script, post the result and save post in session, saves too original page requested) include Menu_class.php include template.php (From the session pageRequested menu is built and correct content is loaded with an include) The HTML source i can check with opera and Mozilla is correct (all tags closed and quoted attributes) If some one can help or point me in the right direction (if needed can send the full script by mail) would be grand Thanks hecchan -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] how to include() N lines?
[EMAIL PROTECTED] mailto:[EMAIL PROTECTED] on Tuesday, September 02, 2003 3:04 PM said: i need to include() only a given amount of lines (the first 10 for example) instead of a whole file. does someone know how this has to be done? Yes. Remove those first ten lines (assuming they are removable) from the original file you had them in and then include them in the old file with include_once(). Then in the file you want to only include the ten lines just include the smaller file. Example: (I'm changing your 10 line requirement to 2 lines.) Original.php: Line 1 Line 2 Line 3 Line 4 Line 5 Take out Line 1 and Line 2 and put them in 2lines.php. 2Lines.php: Line 1 Line 2 Then Original.php becomes this: include_once 2Lines.php; Line 3 Line 4 Line 5 Then in your other file that you need the 2 lines you can do just this: NewFile.php: include_once 2Lines.php; HTH! Chris. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] how to include() N lines?
[snip] i need to include() only a given amount of lines (the first 10 for example) instead of a whole file. [/snip] I have never tried it, but I think you could open up the file you want to include, import n lines into a variable, then use the eval function to turn that variable into php code. Somebody correct me if I am wrong. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php