RE: [PHP] a question, need an answer
I could be wrong here, but from my experiences with sessions is that your first session_start() is assigning the value of 'arma2' to the $_SESSION['eventid'] variable, whereas the second one you are making the 'arama2' variable a global session variable, so as to whatever it's value is on the page can be called from subsequent pages like post would do with a form script after a user hits submit. I'm still learning PHP, so I could be way off, but that's how it's been working for me. *Shrugs* Good Luck -Original Message- From: nabil [mailto:[EMAIL PROTECTED] Sent: Sunday, June 22, 2003 1:42 AM To: [EMAIL PROTECTED] Subject: [PHP] a question, need an answer what is the diffirent between : // session_start (); $_SESSION['eventid'] = 'arma2'; /// and / session_start (); session_register('arama2'); /// Regards Nabil -- ""open source world, open mind for all"" -- 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] a question, need an answer
PS, from the http://www.php.net/manual/en/function.session-register.php page, you might want to read that because your second session call won't work with register globals is disabled but $_SESSION array will. :) -Original Message- From: PHP4 Emailer [mailto:[EMAIL PROTECTED] Sent: Sunday, June 22, 2003 3:46 AM To: nabil; [EMAIL PROTECTED] Subject: RE: [PHP] a question, need an answer I could be wrong here, but from my experiences with sessions is that your first session_start() is assigning the value of 'arma2' to the $_SESSION['eventid'] variable, whereas the second one you are making the 'arama2' variable a global session variable, so as to whatever it's value is on the page can be called from subsequent pages like post would do with a form script after a user hits submit. I'm still learning PHP, so I could be way off, but that's how it's been working for me. *Shrugs* Good Luck -Original Message- From: nabil [mailto:[EMAIL PROTECTED] Sent: Sunday, June 22, 2003 1:42 AM To: [EMAIL PROTECTED] Subject: [PHP] a question, need an answer what is the diffirent between : // session_start (); $_SESSION['eventid'] = 'arma2'; /// and / session_start (); session_register('arama2'); /// Regards Nabil -- ""open source world, open mind for all"" -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] a question, need an answer
what is the diffirent between : // session_start (); $_SESSION['eventid'] = 'arma2'; /// and / session_start (); session_register('arama2'); /// Regards Nabil Both accomplish the same thing, except how you are using it might not be what you expect. $_SESSION['eventid'] = 'arma2'; will assign the string "arma2" to $_SESSION['eventid'] (obviously). session_register('arama2'); will make the variable $arma2 a session variable. I believe you want session_register('eventid') The session_register way of doing things makes it act a lot like register_globals is on. It seems like we're trying to move away from this style of coding, so I'd suggest you use the first method with the $_SESSION variable. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] TIP parsing form row data into variables
Hi all, This might be well known, so apologies if I'm going over old ground - I've not seen this explained this way. Last year I did a site using the variable variables method to parse row data. Now that I've moved to globals=off, I couldn't get that to work so I tried a few other options settling for the following: ('howmany' is the number of form rows on the previous page) $howmany = $_REQUEST['howmany']; for ($index = 1; $index < $howmany; $index++){ $e_id = 'e_id'.$index; $e_id = $_REQUEST[$e_id]; Then do something with it. Hope this helps someone. George in Oxford -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] TIP parsing form row data into variables
Nothing appears blatently wrong in the code you provided, but it's 4am here, so I might be off. This comes to my mind: 1. $_REQUEST was available from PHP 4.1.0 and later, are you using somthing before that? 2. I assume you're doing somthing with $e_id within your loop, or else you're just resetting the contents of it. 3. You might want to try print_r($_REQUEST) to see if it contains what you think it contains. George Pitcher wrote: Hi all, This might be well known, so apologies if I'm going over old ground - I've not seen this explained this way. Last year I did a site using the variable variables method to parse row data. Now that I've moved to globals=off, I couldn't get that to work so I tried a few other options settling for the following: ('howmany' is the number of form rows on the previous page) $howmany = $_REQUEST['howmany']; for ($index = 1; $index < $howmany; $index++){ $e_id = 'e_id'.$index; $e_id = $_REQUEST[$e_id]; Then do something with it. Hope this helps someone. George in Oxford -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] strong authentication for a lamp-system
Hello, I am thinking of setting up strong authentication for a lamp-system based on smart-cards: First authenticate the user with a two-way authentication with apache (openssl). I hope I can put the client certificat on a smartcard. Then read the client certificate within php from an apache environment variable. Has someone already set up such a system and used it successfully in praxis? Best regards, Daniel -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] a question, need an answer
I think you mean: $_SESSION['eventid'] = 'arma2'; vs $eventid = 'arma2'; session_register('eventid'); I'd advise the first, unless you need to ensure backwards compatibility with PHP < 4.1 Justin on 22/06/03 4:41 PM, nabil ([EMAIL PROTECTED]) wrote: > what is the diffirent between : > // > session_start (); > $_SESSION['eventid'] = 'arma2'; > /// > and > / > session_start (); > session_register('arama2'); > /// > > Regards > Nabil > > -- > ""open source world, open mind for all"" > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] TIP parsing form row data into variables
Justin, I'm using 4.3. V4.1 was my first ever exposure to PHP. The example I provided used a field I knew had to be popluated (because of where it came from, but for others I do some isset() validation. The scenario I'm working with is university reading lists. A university has several reading lists for which they want to purchase online materials. When they run a course more than once (material is generally licensed on a course-by-course basis, lasting for 1 year), I want to be able to generate a fresh list, based on the old one but modifiable. Its working quite nicely, but I need to get it finished before Tuesday, including re-writing the code (and databases) to MS Access, rather than my development version using MySQL. Cheers George > -Original Message- > From: justin gruenberg [mailto:[EMAIL PROTECTED] > Sent: 22 June 2003 10:14 am > To: George Pitcher; PHP-General > Subject: Re: [PHP] TIP parsing form row data into variables > > > Nothing appears blatently wrong in the code you provided, but it's 4am > here, so I might be off. > > This comes to my mind: > 1. $_REQUEST was available from PHP 4.1.0 and later, are you using > somthing before that? > 2. I assume you're doing somthing with $e_id within your loop, or else > you're just resetting the contents of it. > 3. You might want to try print_r($_REQUEST) to see if it contains what > you think it contains. > > George Pitcher wrote: > > >Hi all, > > > >This might be well known, so apologies if I'm going over old > ground - I've > >not seen this explained this way. > > > >Last year I did a site using the variable variables method to parse row > >data. > > > >Now that I've moved to globals=off, I couldn't get that to work > so I tried a > >few other options settling for the following: > > > >('howmany' is the number of form rows on the previous page) > > > >$howmany = $_REQUEST['howmany']; > >for ($index = 1; $index < $howmany; $index++){ > > $e_id = 'e_id'.$index; > > $e_id = $_REQUEST[$e_id]; > > > >Then do something with it. > > > >Hope this helps someone. > > > >George in Oxford > > > > > > > > > > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Query mysql highest id number
I want to make a query in a mysql database with as result the row with the highest id number. How can I do that? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Query mysql highest id number
Try this SELECT * FROM table ORDER BY id DESC LIMIT 1 Milan - Original Message - From: "Chris Schoeman" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Sunday, June 22, 2003 12:05 PM Subject: [PHP] Query mysql highest id number > I want to make a query in a mysql database with as result > the row with the highest id number. How can I do that? > > > > -- > 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] Fw: Front Page equivalent
- Original Message - From: "Gabor Hojtsy" <[EMAIL PROTECTED]> To: "Graham Webb" <[EMAIL PROTECTED]> Cc: <[EMAIL PROTECTED]> Sent: Sunday, June 22, 2003 11:59 AM Subject: Re: Front Page equivalent Please ask support questions at [EMAIL PROTECTED] Goba Graham Webb írta: > I am looking for software that will allow me to write PHP in WYSIWYG. something like front page. Although I can code directly I have become so lazy that I use packages such as this a Dreamweaver and then alter the coding afterwards. > > Please advise. > > Regards, > > Graham Webb. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
php-general Digest 22 Jun 2003 11:06:13 -0000 Issue 2132
php-general Digest 22 Jun 2003 11:06:13 - Issue 2132 Topics (messages 152413 through 152442): Now what's wrong with this? 152413 by: Kyle Babich 152414 by: Brad Pauly PHP on Microsoft Windows 2003 Server 152415 by: Ben Johnston 152416 by: John W. Holmes Re: search-and-highlight issue ("byt tes") 152417 by: 457945.gmx.ch Re: Convert KB to MB? 152418 by: Sævar Öfjörð from a textfile/textarea to a mysql INSERT 152419 by: Øystein Håland 152422 by: John W. Holmes "Lel Bruce Peto" updating more energy news... 152420 by: info.lelpeto.com Small problem with date and location information? 152421 by: Philip J. Newman 152426 by: Don Read Re: correct session format? 152423 by: Jay Fitzgerald 152429 by: nabil return all non-tag characters 152424 by: Matt Palermo 152425 by: Mike Migurski 152430 by: Robert Cummings Re: Problem while retrieving data from cookie with unserialize 152427 by: Tom Rogers Re: Header, Directory, and SESSIONs 152428 by: nabil a question, need an answer 152431 by: nabil 152432 by: PHP4 Emailer 152433 by: PHP4 Emailer 152434 by: justin gruenberg 152438 by: Justin French TIP parsing form row data into variables 152435 by: George Pitcher 152436 by: justin gruenberg 152439 by: George Pitcher strong authentication for a lamp-system 152437 by: Daniel Struck Query mysql highest id number 152440 by: Chris Schoeman 152441 by: Milan Reznicek Re: Front Page equivalent 152442 by: Graham Webb 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] -- --- Begin Message --- The following code obtains lists of files from two different directories and reverse numerically sorts them. Then bellow it takes one file and dumps the contents into an array, which works fine. The problem is where it takes the entire content of the matching file from the second directory and tries to put it into $entry. It returns a parse error on line 67, which is the line I marked. What should I do to fix this? Thanks a lot to you guys by the way for help with all of my problems. I'm a 16 year-old trying to create a weblog system using PHP (a new language to me) over summer vacation for fun. -- Kyle --- End Message --- --- Begin Message --- On Sat, 2003-06-21 at 16:59, Kyle Babich wrote: > $entry = fread($entryGet, filesize("postEntries/{$entriesIndex}"); //67, line /w > parse error Missing a ')' Brad --- End Message --- --- Begin Message --- How do i get PHP to work on my Microsoft Windows Server 2003? --- End Message --- --- Begin Message --- Ben Johnston wrote: How do i get PHP to work on my Microsoft Windows Server 2003? Read the installation instructions: http://www.php.net/ -- ---John Holmes... Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/ PHP|Architect: A magazine for PHP Professionals – www.phparch.com --- End Message --- --- Begin Message --- > And what about highlighting the whole word which contains the searched term. yes - like i said - this would be a solution: >> - or: displays entries that contain "bytes" and highlights "bytes" do you have any idea how to manage it? best wishes philipp www.ipdraw.org am 21.06.2003 12:57 Uhr schrieb Milan Reznicek unter [EMAIL PROTECTED]: > And what about highlighting the whole word which contains the searched term. > > > - Original Message - > From: <[EMAIL PROTECTED]> > To: <[EMAIL PROTECTED]> > Sent: Saturday, June 21, 2003 12:31 PM > Subject: [PHP] search-and-highlight issue ("byt tes") > > >> hello! >> >> i have a problem with a search-and-highlight script (see code below): >> >> a search for "byt tes" matches entries that contain "bytes" but only >> highlights "byt"*. >> >> *) because after the first search term ("byt") is found the line is > modified >> into bytes and therefore the secound search >> term ("tes") can't be highlighted anymore. >> >> >> 1. general question >> >> i'm not quite sure if a search like this should match entries that contain > a >> combination of both terms ("bytes"). >> of course, the word "bytes" contains both search terms - but on the other >> hand, a search for "byt tes" indicates that i'm looking for TWO terms (and >> also for TWO "t"s). >> >> >> 2. how to do it anyway? >> >> do you have an idea how to accomplish that this kind of search >> - either: does NOT display entries that match "bytes" >> - or: displays entries that contain "bytes" and highlights "bytes" >> >> (because both solutions seem to be somehow logical it may depend on the >> easiness of creation and/or the speed of processing.) >> >> >> thanks
RE: [PHP] Fw: Front Page equivalent
Graham, PHP editors is a frequent topic on this list. I would suggest that you have a look at the archives and see if the answer is there. BTW, I only use Dreamweaver and don't have any problems. George > -Original Message- > From: Graham Webb [mailto:[EMAIL PROTECTED] > Sent: 22 June 2003 12:06 pm > To: [EMAIL PROTECTED] > Subject: [PHP] Fw: Front Page equivalent > > > > - Original Message - > From: "Gabor Hojtsy" <[EMAIL PROTECTED]> > To: "Graham Webb" <[EMAIL PROTECTED]> > Cc: <[EMAIL PROTECTED]> > Sent: Sunday, June 22, 2003 11:59 AM > Subject: Re: Front Page equivalent > > > Please ask support questions at [EMAIL PROTECTED] > > Goba > > Graham Webb írta: > > I am looking for software that will allow me to write PHP in WYSIWYG. > something like front page. Although I can code directly I have become so > lazy that I use packages such as this a Dreamweaver and then alter the > coding afterwards. > > > > Please advise. > > > > Regards, > > > > Graham Webb. > > > -- > 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] from a textfile/textarea to a mysql INSERT
"John W. Holmes" <[EMAIL PROTECTED]> skrev i meddelandet news:[EMAIL PROTECTED] > Øystein Håland wrote: > >>From Excel you can save a table as a tab separated txt-file. I want to take > > this and execute INSERT queries (by uploading the file or by copying the > > content into a textarea). Anyone who has a script to do this? My platform is > > Windows, but the script will be used on a Linux web server. > > Use the LOAD DATA INFILE command to load the entire file at once. Thanks (and I'm working on it right now). But what about the textarea way? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Is there a way to get rid of \' and \" ?
On Sunday 22 June 2003 06:00, Dan Anderson wrote: > I have a form which feeds into an e-mail. When I use the mail function > all 's turn into \'s and all "s turn into \"s. Are you sure it's the mail() function that's doing it? I doubt it. > I tried > set_magic_quotes_runtime(0) and it didn't do anything, In php.ini: magic_quotes_gpc = Off -- 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 -- /* */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] variable shortened in hidden fields?
Hello friends. I am passing a variable of two word like "communications software" from one form to the other. The variable passes as communications%20software . This is okay for some purpose, but not for the hidden text field that I want. The hidden text field gets the value "communications" only instead of "communications software". Is there a way to solve this? Thanks Denis --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.491 / Virus Database: 290 - Release Date: 6/18/2003 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Secur32.dll and php_imap.dll
Win NT4.0 Apache 2.0.45 I've searched the archives and google, but haven't been able to quite find a solution to this problem. I just upgraded from php4.3.1 (pre-release version) to php4.3.2. I am now getting the following two errors, which I'm sure I've gotten and fixed in the past, but can't figure out now... ERROR 1 (An Apache error) The dynamic link library Secur32.dll could not be found in the specified path I click OK, and get the following php error: Unknown() Unable to load dynamic library 'c:\winnt\system32\php_imap.dll' The specified module could not be found. Secur32.dll is not on my system, and hasn't been in the past. php_imap.dll was copied to c\winnt\system32 php extension dir is c:\winnt\system32 (tried it with c:\php\extensions as well). My apologies - I can't imagine this is a new problem, and I'm sure many others have found and solved it. I just can't seem to find it logged anywhere. Mark = Mark Weinstock [EMAIL PROTECTED] *** You can't demand something as a "right" unless you are willing to fight to death to defend everyone else's right to the same thing. *** __ Do you Yahoo!? SBC Yahoo! DSL - Now only $29.95 per month! http://sbc.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] variable shortened in hidden fields?
At 15:23 22-6-2003, you wrote: Hello friends. I am passing a variable of two word like "communications software" from one form to the other. The variable passes as communications%20software . This is okay for some purpose, but not for the hidden text field that I want. The hidden text field gets the value "communications" only instead of "communications software". Is there a way to solve this? putting quotes in the tag! compare: echo ''; to echo ''; -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Query mysql highest id number
you can you the Mysql MAX function, I believe Select Max(ID) from Table; Also, you may want to look at PHP's mysql_insert_id(), (if you are trying to find the id number after an insert (if that's what you want)). "Chris Schoeman" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > I want to make a query in a mysql database with as result > the row with the highest id number. How can I do that? > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] am i doing this right?
This is the code I have that is on step 4 of an event registration system i am working on... [code page=step4.php] ini_set("display_errors", "1"); ini_set ('error_reporting', E_ALL); session_start (); $ip = $_SERVER['REMOTE_ADDR']; $fullhost = gethostbyaddr($ip); $host = preg_replace("/^[^.]+./", "*.", $fullhost); $_SESSION['host'] = $fullhost; $_SESSION['ip'] = $ip; $_SESSION['eventid'] = $_SESSION['eventid']; $_SESSION['age'] = $_SESSION['age']; $_SESSION['terms'] = $_SESSION['terms']; $_SESSION['team'] = $_REQUEST['team']; for($i = 0; $i <= 239; $i++): $seat = array('A1', 'A2', 'A3', 'A4', 'A5', 'A6', 'A7', 'A8', 'A9', 'A10', 'A11', 'A12', 'A13', 'A14', 'A15', 'A16', 'A17', 'A18', 'A19', 'A20', 'B21', 'B22', 'B23', 'B24', 'B25', 'B26', 'B27', 'B28', 'B29', 'B30', 'B31', 'B32', 'B33', 'B34', 'B35', 'B36', 'B37', 'B38', 'B39', 'B40', 'C41', 'C42', 'C43', 'C44', 'C45', 'C46', 'C47', 'C48', 'C49', 'C50', 'C51', 'C52', 'C53', 'C54', 'C55', 'C56', 'C57', 'C58', 'C59', 'C60', 'D61', 'D62', 'D63', 'D64', 'D65', 'D66', 'D67', 'D68', 'D69', 'D70', 'D71', 'D72', 'D73', 'D74', 'D75', 'D76', 'D77', 'D78', 'D79', 'D80', 'D81', 'D82', 'D83', 'D84', 'D85', 'D86', 'D87', 'D88', 'D89', 'D90', 'E91', 'E92', 'E93', 'E94', 'E95', 'E96', 'E97', 'E98', 'E99', 'E100', 'E101', 'E102', 'E103', 'E104', 'E105', 'E106', 'E107', 'E108', 'E109', 'E110', 'F111', 'F112', 'F113', 'F114', 'F115', 'F116', 'F117', 'F118', 'F119', 'F120', 'G121', 'G122', 'G123', 'G124', 'G125', 'G126', 'G127', 'G128', 'G129', 'G130', 'H131', 'H132', 'H133', 'H134', 'H135', 'H136', 'H137', 'H138', 'H139', 'H140', 'H141', 'H142', 'H143', 'H144', 'H145', 'H146', 'H147', 'H148', 'H149', 'H150', 'I151', 'I152', 'I153', 'I154', 'I155', 'I156', 'I157', 'I158', 'I159', 'I160', 'I161', 'I162', 'I163', 'I164', 'I165', 'I166', 'I167', 'I168', 'I169', 'I170', 'I171', 'I172', 'I173', 'I174', 'I175', 'I176', 'I177', 'I178', 'I179', 'I180', 'J181', 'J182', 'J183', 'J184', 'J185', 'J186', 'J187', 'J188', 'J189', 'J190', 'J191', 'J192', 'J193', 'J194', 'J195', 'J196', 'J197', 'J198', 'J199', 'J200', 'K201', 'K202', 'K203', 'K204', 'K205', 'K206', 'K207', 'K208', 'K209', 'K210', 'K211', 'K212', 'K213', 'K214', 'K215', 'K216', 'K217', 'K218', 'K219', 'K220', 'L221', 'L222', 'L223', 'L224', 'L225', 'L226', 'L227', 'L228', 'L229', 'L230', 'L231', 'L232', 'L233', 'L234', 'L235', 'L236', 'L237', 'L238', 'L239', 'L240'); echo "$seat[$i]"; endfor; [/end code] Now - all of that works perfect and it displays seperate lines with links to each $seat in the browsereven when I click on the link and goto step 5, it "seems" as though it is working correctly... [code page=step5.php] session_start (); $_SESSION['seat'] = $_REQUEST['seat']; echo "$_SESSION[seat]"; [/end code] My question is - is my session working correctly? am I doing what I need to be doing in order to keep the seats secure so that noone can just type the seat number in the location bar and get to register their seat? The reson I ask this is because the only way I know to test sessions is to close out my browser completely, reopen it and try going to the page I am testing...HOWEVER, when I do that in this situation, I am still allowed to change the actual seat number in my location barthis is what I do NOT want... I have read and read and read online and every place I have looked says the same stuff that the way I have it above should be secure, but apparently it is not... TIA, Jay -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Variable from hidden fields shortens.
I have a form called feedback which has a hidden field as follows : "; ?> I send this hidden field as a variable in form2 which sends an email with the following code : http://www.mydomain.com/findbymember.php?SubCategoryName=".$SubCategoryNa me; $Message="$SenderName had searched for '$SubCategoryName'. His/her details are as follows : "."\n"."Telephone number : ".$SenderTelNumber."\n"; $Message=$Message."Mobile number : ".$SenderMobNumber."\n"."Email address : ".$SenderEmailAddress."\n"; $Message=$Message."Address : ".$SenderAddress; // Send email to member company mail($mailTo, $mailSubject, $Message,$link); ?> When my variable in form 1 is "Large Format Print", the mail that arrives is as follows : Please follow this linkhttp://www.findusnow.com/findbymember.php?SubCategoryName=Large Format Print Jack had searched for 'Large Format Print'. His/her details are as follows : Telephone number : 454588445 Email address : 989855564 Address : some address1, some home, some street, some city As you can see the link does not show the full variable at the end and shows only the word "large" instead of "large Format Print" can any of you help? Thanks denis --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.491 / Virus Database: 290 - Release Date: 6/18/2003 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Variable from hidden fields shortens.
For example: $a = 'a b c'; print $a;// a b c print urlencode($a); // a+b+c So, you want to urlencode your url (the query string). Regards, Philip On Sun, 22 Jun 2003, Denis L. Menezes wrote: > I have a form called feedback which has a hidden field as follows : > Print" value=\"$SubCategoryName\">"; > ?> > > I send this hidden field as a variable in form2 which sends an email with > the following code : > // Build up email header fields > $mailFrom = $SenderName; > $mailTo = "[EMAIL PROTECTED]"; > $mailSubject = "Message form mydomain.com"; > $link="Please follow this link > "."http://www.mydomain.com/findbymember.php?SubCategoryName=".$SubCategoryNa > me; > > $Message="$SenderName had searched for '$SubCategoryName'. His/her details > are as follows : "."\n"."Telephone number : ".$SenderTelNumber."\n"; > $Message=$Message."Mobile number : ".$SenderMobNumber."\n"."Email address : > ".$SenderEmailAddress."\n"; > $Message=$Message."Address : ".$SenderAddress; > > // Send email to member company > mail($mailTo, $mailSubject, $Message,$link); > ?> > > When my variable in form 1 is "Large Format Print", the mail that arrives is > as follows : > Please follow this > linkhttp://www.findusnow.com/findbymember.php?SubCategoryName=Large Format > Print > > Jack had searched for 'Large Format Print'. His/her details are as follows : > Telephone number : 454588445 > Email address : 989855564 > Address : some address1, some home, some street, some city > > As you can see the link does not show the full variable at the end and shows > only the word "large" instead of "large Format Print" > > can any of you help? > > Thanks > denis > > > > > > > --- > Outgoing mail is certified Virus Free. > Checked by AVG anti-virus system (http://www.grisoft.com). > Version: 6.0.491 / Virus Database: 290 - Release Date: 6/18/2003 > > > > -- > 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] Is there a way to get rid of \' and \" ?
On Sun, 22 Jun 2003, Jason Wong wrote: > On Sunday 22 June 2003 06:00, Dan Anderson wrote: > > I have a form which feeds into an e-mail. When I use the mail function > > all 's turn into \'s and all "s turn into \"s. > > Are you sure it's the mail() function that's doing it? I doubt it. > > > I tried > > set_magic_quotes_runtime(0) and it didn't do anything, > > In php.ini: > > magic_quotes_gpc = Off Btw, magic_quotes_gpc and magic_quotes_runtime are totally different beasts. You cannot set magic_quotes_gpc at runtime but may use php.ini as Jason suggests or .htaccess Before you set it off, be sure you know how it will affect your SQL queries though. Regards, Philip -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] simple flash php form, help please
Hi again guys :) I am having problems with this little email user script for my website. I have set this script here to run with flash outputing the information. When i run the script in the browser i grt this error "Warning: Failed to Receive in C:\apache\htdocs\innovat\forum\mailuser.php on line 18" I aint any php expert just some simple stuff i know. You can copy the code and test it just change the email information. cheers for any help guys. ",$ToSubject, $Message, "From: ".$username." <".$email.">");// line 18 print "retval=1&$ToEmail&ToSubject&$Message&$username&$email";// This just returns output to show all variables have been passed ok. ?> -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] How to run script ?
Hi, If i try to run php script out side DOCUMENT_ROOT i.e using an alias. the server reply with "No input file specified." I have Xitami and win 98. My Q how do i tell php where to find the script. Hope some one can help! Regards. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] execute a command
How to execute a command capturing the stanndard error, in addition to standard output? example: echo system('/bin/rm ...'); I need to know when this command fails, and when it fails, i need to know why. Any hints? _Mattia_ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Mod_L33T ANYONE! (Virtual Hosts ) alternative READ if you USE Virtual Hosts
hey everyone do any of you people use mod_l33t? I do it rocks you can have about 1000 sites on your comp with their own domain & your ram won't even go down 1mb. its easy to setup & its very cool email me or post if you want of info -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Security conundrum ....
This does have to do with PHP, but bear with me. We're using a Flash movie, which calls various PHP scripts to authenticate users & retrieve news articles, to display a daily business digest. As Flash's printing capabilities are pathetic, we use JavaScript to popup a chromeless window in which runs print_news.php. (This is a small window, with selection, resizing, etc. all disabled, and which calls the print dialog on load; all that is really visible is its "Close" button.) It won't be too long before some bright spark realizes that our site could be visited and the URL for print_news.php fed in; that person would then have free access - not good. What I planned to do is add authentication to print_news.php, by passing the user's ckval (obtained when first authenticated by user_logon.php) back to the browser in a session var. That does not work, as Flash apparently gobbles the cookie. The apparent alternative is to call an intermediate script from Flash, passing the ckval, and having that script set the session and then redirect to print_news.php, using the header( Location: ... ). The problem is that opens in the same window, and I need a new one. I obviously can't pass ckval in the URL, and I don't have any way, that I know of, to fake a POST. Suggestions or nudges in the right direction will be appreciated. Regards - Miles Thompson -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] changing PHP include location without .htaccess
Hi, I have a site running on a shared server (and as such, I have no access to the php.ini file) that I'd like to be able to change the default include path. I've done this before using the .htaccess file and the following command: php_value include_path ".:/path/to/web/" However, on this particular server that command produces an error 500 on all PHP files with the above command in the .htaccess file. Is there another way that I can change the default include path? The server is running FreeBSD 4.4 and PHP 4.3.2RC4 Thanks -Tim -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] changing PHP include location without .htaccess
On Monday 23 June 2003 05:10, Tim Thorburn wrote: > I have a site running on a shared server (and as such, I have no access to > the php.ini file) that I'd like to be able to change the default include > path. I've done this before using the .htaccess file and the following > command: > > php_value include_path ".:/path/to/web/" > > However, on this particular server that command produces an error 500 on > all PHP files with the above command in the .htaccess file. Is there > another way that I can change the default include path? ini_set() -- 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 -- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] execute a command
On 22-Jun-2003 Mattia wrote: > How to execute a command capturing the stanndard error, in addition to > standard output? example: > > echo system('/bin/rm ...'); > > I need to know when this command fails, and when it fails, i need to > know why. Any hints? > > _Mattia_ > $cmd='/bin/rm foo'; exec("$cmd 2>&1", $output); -- or -- exec($cmd, $output, $errno); echo posix_strerror($errno); -- or -- proc_open(...) and read from pipe[2] Regards, -- Don Read [EMAIL PROTECTED] -- It's always darkest before the dawn. So if you are going to steal the neighbor's newspaper, that's the time to do it. (53kr33t w0rdz: sql table query) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
php-general Digest 22 Jun 2003 23:07:36 -0000 Issue 2133
php-general Digest 22 Jun 2003 23:07:36 - Issue 2133 Topics (messages 152443 through 152461): Re: Front Page equivalent 152443 by: George Pitcher Re: from a textfile/textarea to a mysql INSERT 152444 by: Øystein Håland Re: Is there a way to get rid of \' and \" ? 152445 by: Jason Wong 152453 by: Philip Olson variable shortened in hidden fields? 152446 by: Denis L. Menezes 152448 by: Chris Hayes Secur32.dll and php_imap.dll 152447 by: Mark Re: Query mysql highest id number 152449 by: Bobby Patel am i doing this right? 152450 by: Jay Fitzgerald Variable from hidden fields shortens. 152451 by: Denis L. Menezes 152452 by: Philip Olson simple flash php form, help please 152454 by: Paul Ferrie How to run script ? 152455 by: Xprogsoft execute a command 152456 by: Mattia 152461 by: Don Read Mod_L33T ANYONE! (Virtual Hosts ) alternative READ if you USE Virtual Hosts 152457 by: Mark Clarkstone Security conundrum 152458 by: Miles Thompson changing PHP include location without .htaccess 152459 by: Tim Thorburn 152460 by: Jason Wong 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] -- --- Begin Message --- Graham, PHP editors is a frequent topic on this list. I would suggest that you have a look at the archives and see if the answer is there. BTW, I only use Dreamweaver and don't have any problems. George > -Original Message- > From: Graham Webb [mailto:[EMAIL PROTECTED] > Sent: 22 June 2003 12:06 pm > To: [EMAIL PROTECTED] > Subject: [PHP] Fw: Front Page equivalent > > > > - Original Message - > From: "Gabor Hojtsy" <[EMAIL PROTECTED]> > To: "Graham Webb" <[EMAIL PROTECTED]> > Cc: <[EMAIL PROTECTED]> > Sent: Sunday, June 22, 2003 11:59 AM > Subject: Re: Front Page equivalent > > > Please ask support questions at [EMAIL PROTECTED] > > Goba > > Graham Webb írta: > > I am looking for software that will allow me to write PHP in WYSIWYG. > something like front page. Although I can code directly I have become so > lazy that I use packages such as this a Dreamweaver and then alter the > coding afterwards. > > > > Please advise. > > > > Regards, > > > > Graham Webb. > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > --- End Message --- --- Begin Message --- "John W. Holmes" <[EMAIL PROTECTED]> skrev i meddelandet news:[EMAIL PROTECTED] > Øystein Håland wrote: > >>From Excel you can save a table as a tab separated txt-file. I want to take > > this and execute INSERT queries (by uploading the file or by copying the > > content into a textarea). Anyone who has a script to do this? My platform is > > Windows, but the script will be used on a Linux web server. > > Use the LOAD DATA INFILE command to load the entire file at once. Thanks (and I'm working on it right now). But what about the textarea way? --- End Message --- --- Begin Message --- On Sunday 22 June 2003 06:00, Dan Anderson wrote: > I have a form which feeds into an e-mail. When I use the mail function > all 's turn into \'s and all "s turn into \"s. Are you sure it's the mail() function that's doing it? I doubt it. > I tried > set_magic_quotes_runtime(0) and it didn't do anything, In php.ini: magic_quotes_gpc = Off -- 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 -- /* */ --- End Message --- --- Begin Message --- On Sun, 22 Jun 2003, Jason Wong wrote: > On Sunday 22 June 2003 06:00, Dan Anderson wrote: > > I have a form which feeds into an e-mail. When I use the mail function > > all 's turn into \'s and all "s turn into \"s. > > Are you sure it's the mail() function that's doing it? I doubt it. > > > I tried > > set_magic_quotes_runtime(0) and it didn't do anything, > > In php.ini: > > magic_quotes_gpc = Off Btw, magic_quotes_gpc and magic_quotes_runtime are totally different beasts. You cannot set magic_quotes_gpc at runtime but may use php.ini as Jason suggests or .htaccess Before you set it off, be sure you know how it will affect your SQL queries though. Regards, Philip --- End Message --- --- Begin Message --- Hello friends. I am passing a variable of two word like "communications software" from one form to the other. The variable passes as communications%20software . This is okay for some purpose, but not for the hidden text field that I want. The hidden text field get
[PHP] limit on displaying a LONGTEXT filed from MySQL database
Hi, How can I start searching for the first space in a string while starting at say the 150th character? I'm trying to display the first 150 characters of an article that is stored in a LONGTEXT filed of a MYSQL database, and should the 150th character be inside a word, I would want to finish displaying that word. For example supose the 150th character is the v in the word "privileges" I would want to finish displaying the word and end with "privileges" rather then ending with"priv" thanks -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] limit on displaying a LONGTEXT filed from MySQL database
Artoo wrote: > For example supose the 150th character is the v in the word "privileges" I > would want to finish displaying the word and end with "privileges" rather > then ending with"priv" How about using the SUBSTRING_INDEX function with delimiter set to ' ' (space). You could select for example - 25 words - with it, I think. -- Seks, seksić, seksolatki... news:pl.soc.seks.moderowana http://hyperreal.info / ALinkA / bOrk! * WiNoNa ) ( http://szatanowskie-ladacznice.0-700.pl foReVeR( * ) Poznaj jej zwiewne kształty... http://www.opera.com 007 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] How do I get the exit code of an external program?
I wish to use Ping to test if some IP addresses are up... Now I could run the command and parse to find various string components like this: [EMAIL PROTECTED] bin]# ping -n -c 3 -w 2 -q 192.168.1.60 PING 192.168.1.60 (192.168.1.60) from 192.168.1.1 : 56(84) bytes of data. --- 192.168.1.60 ping statistics --- 2 packets transmitted, 0 received, 100% loss, time 1012ms [EMAIL PROTECTED] bin]# ping -n -c 3 -w 2 -q 192.168.1.4 PING 192.168.1.4 (192.168.1.4) from 192.168.1.1 : 56(84) bytes of data. --- 192.168.1.4 ping statistics --- 2 packets transmitted, 2 received, 0% loss, time 999ms rtt min/avg/max/mdev = 0.322/0.340/0.358/0.018 ms but it would be much more efficient if I could just use the built in exit codes that 'ping' provides as per 'man ping': "If ping does not receive any reply packets at all it will exit with code 1. If a packet count and deadline are both specified, and fewer than count packets are received by the time the deadline has arrived, it will also exit with code 1. On other error it exits with code 2. Otherwise it exits with code 0. This makes it possible to use the exit code to see if a host is alive or not." So it seems to me there needs to be another PHP function like exec(), shell(), etc. that is the equivillent of the php exit() function but for external programs. One that simply returns the integer exit code of an executed shell program... http://daevid.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Mod_L33T ANYONE! (Virtual Hosts ) alternative READ if youUSE Virtual Hosts
Mark Clarkstone wrote: hey everyone do any of you people use mod_l33t? I do it rocks you can have about 1000 sites on your comp with their own domain & your ram won't even go down 1mb. its easy to setup & its very cool email me or post if you want of info 1) This has absolutley nothing to do with PHP. 2) I've never heard od mod_ll33t. 3) I wouldn't use anything with that name if you payed me. -- 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
Re: [PHP] How do I get the exit code of an external program?
On 23-Jun-2003 Daevid Vincent wrote: > I wish to use Ping to test if some IP addresses are up... Now I could run > the command and parse to find various string components like this: > > > So it seems to me there needs to be another PHP function like exec(), > shell(), etc. that is the equivillent of the php exit() function but for > external programs. One that simply returns the integer exit code of an > executed shell program... > > exec(), system(), & popen()/pclose() will return exit code. The manual is your friend. Regards, -- Don Read [EMAIL PROTECTED] -- It's always darkest before the dawn. So if you are going to steal the neighbor's newspaper, that's the time to do it. (53kr33t w0rdz: sql table query) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
FW: [PHP] How do I get the exit code of an external program?
-Original Message- From: Daevid Vincent [mailto:[EMAIL PROTECTED] Sent: Sunday, June 22, 2003 8:05 PM To: 'Don Read' Subject: RE: [PHP] How do I get the exit code of an external program? > -Original Message- > From: Don Read [mailto:[EMAIL PROTECTED] > Sent: Sunday, June 22, 2003 7:58 PM > To: Daevid Vincent > Cc: PHP Lists > Subject: Re: [PHP] How do I get the exit code of an external program? > > > > On 23-Jun-2003 Daevid Vincent wrote: > > I wish to use Ping to test if some IP addresses are up... > Now I could run > > the command and parse to find various string components like this: > > > > > > > > So it seems to me there needs to be another PHP function > like exec(), > > shell(), etc. that is the equivillent of the php exit() > function but for > > external programs. One that simply returns the integer exit > code of an > > executed shell program... > > > > > > exec(), system(), & popen()/pclose() will return exit code. > > The manual is your friend. http://us3.php.net/manual/en/function.exec.php string exec ( string command [, array output [, int return_var]]) exec() executes the given command, however it does not output anything. It simply returns the last line from the result of the command. However, you are correct in that there is the optional parameter that I've never used before. Thanks for pointing that out... http://us3.php.net/manual/en/function.system.php string system ( string command [, int return_var]) system() is just like the C version of the function in that it executes the given command and outputs the result. If a variable is provided as the second argument, then the return status code of the executed command will be written to this variable. The problem is that system want's to dump the output to the screen!!! I need a command that will allow me to execute/system the command "silently" and then *I* can do something based upon the exit code... function active_nMap() { $test = exec("/usr/bin/nmap -sP ".$this->IP); if ( strstr($test,"1 host up") ) $this->active = true; else $this->active = false; return $this->active; } function active_ping() { $test = `ping -n -c 1 -w 1 -q $this->IP`; if ( strstr($test,"100% loss") ) $this->active = false; else $this->active = true; return $this->active; } function active_ping_exit() { //http://us3.php.net/manual/en/function.system.php $test = system("ping -n -c 1 -w 1 -q $this->IP", $code); if ( $code == 0 ) $this->active = true; else $this->active = false; return $this->active; } -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Secur32.dll and php_imap.dll
Well, I'm not sure if I did a smart thing, but it appears that secur32.dll and security.dll are the same file, just differnt versions. It seems that the file is secur32.dll on all Windows versions except WinNT (I could be wrong). I simply copied and renamed security.dll to secur32.dll. So far so good. I just hope I didn't start a ticking timebomb. Mark --- Mark <[EMAIL PROTECTED]> wrote: > Win NT4.0 > Apache 2.0.45 > > I've searched the archives and google, but haven't been able to > quite > find a solution to this problem. I just upgraded from php4.3.1 > (pre-release version) to php4.3.2. I am now getting the following > two > errors, which I'm sure I've gotten and fixed in the past, but can't > figure out now... > > ERROR 1 (An Apache error) > > The dynamic link library Secur32.dll could not be found in the > specified path > > I click OK, and get the following php error: > > Unknown() Unable to load dynamic library > 'c:\winnt\system32\php_imap.dll' The specified module could not be > found. > > Secur32.dll is not on my system, and hasn't been in the past. > php_imap.dll was copied to c\winnt\system32 > > php extension dir is c:\winnt\system32 (tried it with > c:\php\extensions as well). > > My apologies - I can't imagine this is a new problem, and I'm sure > many others have found and solved it. I just can't seem to find it > logged anywhere. > > Mark > > = > Mark Weinstock > [EMAIL PROTECTED] > *** > You can't demand something as a "right" unless you are willing to > fight to death to defend everyone else's right to the same thing. > *** > > __ > Do you Yahoo!? > SBC Yahoo! DSL - Now only $29.95 per month! > http://sbc.yahoo.com > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > = Mark Weinstock [EMAIL PROTECTED] *** You can't demand something as a "right" unless you are willing to fight to death to defend everyone else's right to the same thing. *** __ Do you Yahoo!? SBC Yahoo! DSL - Now only $29.95 per month! http://sbc.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Security conundrum ....
Ok, I'm trying to get a grip on what happens here: 1. i visit your site, see a flash movie, which enables me to log-in 2. after i log in, I see a link called "news" 3. I click on it, which pops open a HTML window through javascript, with a URL like example.com/print_news.php [At this point, the news page should only be available to authenticated users, but it isn't -- right?] The answer appears to be sessions. When you log in, you should be able to pass a session ID back to the flash movie, along with the user's ckval (whatever that is), and add a session variable like 'logged_in' to the session. When the flash movie uses javascript to pop open the news window, you should be able to pass the session id as a GET variable in the URL, eg: example.com/print_news.php?PHPSESSID=x print_news.php needs to have this at the top: ... Your news ... ... Sorry, you must be logged in baby! ... You don't NEED cookies to have session work... it can be done with URLs. Justin on 23/06/03 5:18 AM, Miles Thompson ([EMAIL PROTECTED]) wrote: > This does have to do with PHP, but bear with me. > > We're using a Flash movie, which calls various PHP scripts to authenticate > users & retrieve news articles, to display a daily business digest. As > Flash's printing capabilities are pathetic, we use JavaScript to popup a > chromeless window in which runs print_news.php. (This is a small window, > with selection, resizing, etc. all disabled, and which calls the print > dialog on load; all that is really visible is its "Close" button.) > > It won't be too long before some bright spark realizes that our site could > be visited and the URL for print_news.php fed in; that person would then > have free access - not good. > > What I planned to do is add authentication to print_news.php, by passing > the user's ckval (obtained when first authenticated by user_logon.php) > back to the browser in a session var. That does not work, as Flash > apparently gobbles the cookie. > > The apparent alternative is to call an intermediate script from Flash, > passing the ckval, and having that script set the session and then redirect > to print_news.php, using the header( Location: ... ). The problem is that > opens in the same window, and I need a new one. > > I obviously can't pass ckval in the URL, and I don't have any way, that I > know of, to fake a POST. > > Suggestions or nudges in the right direction will be appreciated. > > Regards - Miles Thompson > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: FW: [PHP] How do I get the exit code of an external program?
On Sun, 2003-06-22 at 20:19, Daevid Vincent wrote: [snip] > http://us3.php.net/manual/en/function.exec.php > string exec ( string command [, array output [, int return_var]]) > exec() executes the given command, however it does not output anything. It > simply returns the last line from the result of the command. > > However, you are correct in that there is the optional parameter that I've > never used before. Thanks for pointing that out... > > http://us3.php.net/manual/en/function.system.php > string system ( string command [, int return_var]) > system() is just like the C version of the function in that it executes the > given command and outputs the result. If a variable is provided as the > second argument, then the return status code of the executed command will be > written to this variable. > > The problem is that system want's to dump the output to the screen!!! I need > a command that will allow me to execute/system the command "silently" and > then *I* can do something based upon the exit code... No offense, but why not just use exec() and its third argument, as suggested and as you yourself noted? It does, in fact, do what you are asking for. You are quite correct that system() is not the function you want. Just wondering. :) Torben > function active_nMap() > { > $test = exec("/usr/bin/nmap -sP ".$this->IP); > if ( strstr($test,"1 host up") ) > $this->active = true; > else > $this->active = false; > > return $this->active; > } > > function active_ping() > { > $test = `ping -n -c 1 -w 1 -q $this->IP`; > if ( strstr($test,"100% loss") ) > $this->active = false; > else > $this->active = true; > > return $this->active; > } > > > function active_ping_exit() > { > //http://us3.php.net/manual/en/function.system.php > $test = system("ping -n -c 1 -w 1 -q $this->IP", $code); > if ( $code == 0 ) > $this->active = true; > else > $this->active = false; > > return $this->active; > } > > -- Torben Wilson <[EMAIL PROTECTED]>+1.604.709.0506 http://www.thebuttlesschaps.com http://www.inflatableeye.com http://www.hybrid17.com http://www.themainonmain.com - Boycott Starbucks! http://www.haidabuckscafe.com - -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Mod_L33T ANYONE! (Virtual Hosts ) alternative READ if youUSE Virtual Hosts
Leif K-Brooks wrote: Mark Clarkstone wrote: hey everyone do any of you people use mod_l33t? I do it rocks you can have about 1000 sites on your comp with their own domain & your ram won't even go down 1mb. its easy to setup & its very cool email me or post if you want of info 1) This has absolutley nothing to do with PHP. 2) I've never heard od mod_ll33t. 3) I wouldn't use anything with that name if you payed me. Not to mention the fact that : 1) Why would I run 1000 sites on one box? 2) The tool may not take extra memory or processor tics, but what happens when 10 people are surfing each of the 1000 sites? 3) Why use a third party module for something Apache already has built in? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] limit on displaying a LONGTEXT filed from MySQL database
Here one way you can do it (untested): Justin on 23/06/03 10:41 AM, Artoo ([EMAIL PROTECTED]) wrote: > Hi, > > How can I start searching for the first space in a string while starting at > say the 150th character? I'm trying to display the first 150 characters of > an article that is stored in a LONGTEXT filed of a MYSQL database, and > should the 150th character be inside a word, I would want to finish > displaying that word. > > For example supose the 150th character is the v in the word "privileges" I > would want to finish displaying the word and end with "privileges" rather > then ending with"priv" > > thanks > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Getting at $_POST values using a loop
Hi all, This one is causing me a few headaches. How should I be doing this? On my previous page I've created a series of fields using a loop so that a field is created like this: echo "$fieldname:"; On my next page then I've got to try to read these values. I could do this as $_POST['Field0'], $_POST['Field1'] etc but a loop is what is required. I've tried getting at the value by: $a=$_POST['Field$n']; and $nb='$'."_POST['Field".$n."']"; $a=$$nb; And neither works. How should I be doing it? Thanks in advance for all help. regards, Dave --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.491 / Virus Database: 290 - Release Date: 18/06/2003 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Getting at $_POST values using a loop
echo "$fieldname:"; for ($i=0, $n=sizeof($_POST['FieldName']); $i<$n; $i++){ // do whatever you need to do with each field echo $_POST['FieldName'][$i]; } -Original Message- From: Dave Alger [mailto:[EMAIL PROTECTED] Sent: Sunday, June 22, 2003 9:12 PM To: [EMAIL PROTECTED] Subject: [PHP] Getting at $_POST values using a loop Hi all, This one is causing me a few headaches. How should I be doing this? On my previous page I've created a series of fields using a loop so that a field is created like this: echo "$fieldname:"; On my next page then I've got to try to read these values. I could do this as $_POST['Field0'], $_POST['Field1'] etc but a loop is what is required. I've tried getting at the value by: $a=$_POST['Field$n']; and $nb='$'."_POST['Field".$n."']"; $a=$$nb; And neither works. How should I be doing it? Thanks in advance for all help. regards, Dave --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.491 / Virus Database: 290 - Release Date: 18/06/2003 -- 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] OOT Payflow Urgent
I've never done this using CURL however I have done this using socket connections. If you haven't already you may want to look into this, I'm sure payflow will allow you to post data using socket connection. Take a look at: http://us4.php.net/fsockopen In the User Contributed Notes look for a post by info at agriya dot com 02-Feb-2003 12:38 there you will see a script that shows you how to do it. -Original Message- From: Haseeb Iqbal [mailto:[EMAIL PROTECTED] Sent: Thursday, June 19, 2003 1:11 PM To: [EMAIL PROTECTED] Subject: [PHP] OOT Payflow Urgent hi all, i am using curl to post data to the payflow link server. now here are the questions that i want to ask. here is the server stats Linux+ php + mysql + curl + ssl 1) now i want to know if curl is safe to use? i know about the payflow sdk but i also know that i can execute the sdk by exec call and if anyone is loged on the computer at the time of the transection he/she can view all the data passed to the sdk by simply one command.(i.e. ps.). as also don't want to show the user any page from verisign. but when i send the data i get back html output. i want some kind of error codes.how can i achieve this. know there must some way around this problem. i want to collect all the information on my page send the data to the payflow link without leaving my site the get back the result from the transection and show the result to the user. thanx in advance Haseeb -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] SQL injection
Hi, Is there any way, doc, article, example, idea, suggestion to how to prevent sql injection on php sites... Thanks -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Passing objects into methods or functions
Im trying to pass an object into functions and class methods, and for some reason, Im unable to access the object's methods. When I var_dump() the object, its a valid object with the function or class method. When I check via get_class_methods, all the methods are there, from within the function or class method. I tried passing by reference, and the regular "copied" way. I end up with the error -> Fatal error: Call to undefined function: display_thumbnails() in .. I can access the object's variables, but not it's methods Maybe because Im tired, but if anyone experienced this before, I'd greatly appreciate any feed back on this. Thanks class class { var $_tpl; var $gal_tpl = array(); function gallery_class(&$tpl) { if (is_object( $tpl )) { $this->_tpl = $tpl; } } } ?> -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php