[PHP] COM
Hi everybody, When i run the following script in a dos box it works fine. If i run it in a browser window i receive a Dr Watson. Anybody has an idea ? My config is Apache 1.3.20 PHP 4.0.5 Windows NT4 SP5 French The script is inspired of the following url http://www.phpbuilder.net/columns/alain20001003.php3 ? $workbook = D:\CAC40.XLS; $sheet = Feuil1; #Instantiate the spreadsheet component. $ex = new COM(Excel.application) or Die (Did not connect); #Open the workbook that we want to use. $wkb = $ex-application-Workbooks-Open($workbook,3) or Die (Did not open); $sheets = $wkb-Worksheets($sheet);#Select the sheet $sheets-Calculate; $sheets-activate; #Activate it $cell = $sheets-Cells(2,2) ;#Select the cell (Row Column number) $cell-activate;#Activate the cell $oldcell=$cell-value; print Cac40 = {$cell-value} BR;#Print the value of the cell:1 $cell = $sheets-Cells(1,2) ;#Select the cell (Row Column number) $cell-activate;#Activate the cell $oldcell=$cell-value; print DowJones = {$cell-value} BR;#Print the value of the cell:1 #Close all workbooks without questioning $ex-application-ActiveWorkbook-Close(False); unset ($ex); ? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] New to list
try $total=((0.416 / $time) * 60) * 60); $output=number_format($total,2,'.',','); / / uses comma separators between thousands and a decimal point between the units and tenths. or $output=number_format(((0.416 / $time) * 60) * 60),2,'.',','); / / php is usually forgiving on combined operations. number_format() truncates the number so if you have 1.209 it will lop of the last number resulting in 1.20. if you want a rounded number use round(). both commands are in the online manual. hope this helps. Hugh - Original Message - From: Andrew [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, January 10, 2002 4:05 PM Subject: [PHP] New to list Hello to you all! I am new to this list and I have a question that maybe someone can help with In a script I am working on I have a math's equation : ((0.416 / $time) * 60) * 60) this out but a figure at goes to a about 10 decimal places I only want 2 decimal places and just can not figure out how to do this Any ideas would be great Thanks Andrew Web Harper Graphics www.webharpergraphics.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] php executing system commands..
Hi, can php execute system commands like df, and then print it to html ? thanks, louie -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Re: Redeclaring functions
Arve Bersvendsen wrote: As a small, personal, enjoy-myself-project I'd like to run a perpetual-running socket server. Problem is; I also want it to be self-modifying so I can insert, remove and change functions as the server is running. The problem is; under normal circumstances, PHP won't let the script redeclare functions. Is there any way to circumvent this. I dont know what a perpetual-running socket server is, but to have a main PHP script execute different functions with the same name I guess you could play with include/require directives or create classes with the same function-names you then pass to you main program (kind like poor-mans polymorphism :-) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Re: Specific References Incident
Ken Kinder wrote: The $this-children attribute should be an array of (references to) objects. I think somehow in the foreach ($this-children as $child) the objects are being copied, as $child-validate(); seems not to effect the original objects. Someone just said you can use $a = $b to make $a a reference to $b instead of a copy. Dunno if that solves you problem though, but it may be a step on the way. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] eregi and alfa numeric characters.
Hi all, I want a regular expression process such that, no characters except for the followings will not be allowed. 0-9 a-z A-Z ~ @ # $ % ( ) _ - + = [ ] { } ? I create a web site with membership. I have a problem. Some body uses a username GUEST and someother get's the same username (in fact not the same, but displays as a same username, because, second username is GUESTx where x replace with the code ALT+231 so I want to give a sequence of characters to the user, such that user cannot use except for this crahcters. I wrote all the characters above... best regards... IncrediMail - Email has finally evolved - Click Here
[PHP] Re: php executing system commands..
Louie Miranda wrote: Hi, can php execute system commands like df, and then print it to html ? `df`; shell (df); exec (df); etc -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] How to get a function backtrace?
Im not sure if function-backtrace is the correct word for what I need, so I'll explain: If I have for example ? a(); function a(){ b(); } function b(){ c(); } function c(){ $x = function_backtrace(); print_r($x); } ? then I want to get array( [0]= 'a', [1]= 'b', [2]= 'c' ) or something similar. So I want to know, what functions have been called. If you know perl, then adequate function was caller. I already searched php.net for it but had no luck for it - so if you please could point me to the right direction I was very happy. TIA Stefan Rusterholz
Re: [PHP] Q: Array
Thank you Michel You;ve understand correct the question. Thank you for the removing new keyword Everything you've said is exact but using following snippet $b = array('one' = 'bla', 'two' = 'blabla', 'three' = 'blablabla'); while(list($k, $v) = each($b)) { print $k - $v; } the result will be 0- bla one - bla 0 (the key) = 'bla' (the value) one (the key of the *same* element) = 'bla' (the *same* value) and so on ... Michael Sims [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... At 09:18 PM 1/10/2002 +0100, Ivo Stoykov wrote: How could I determine whether I have in the array's key integers *and* strings or integers only? I'm not sure exactly what you're asking but I'll give it a shot... i.e. $a = new array('one', 'two', 'three'); // this has only integers (am I wrong?) First of all, the new keyword assumes that you are instantiating an object. For example if you created an object with the name foo you would instantiate it like so: $a = new foo; So when creating arrays the new keyword is undesirable. To address your question, yes your example above (after removing the new keyword) will create an array named $a that has only integers for keys. It's functionally the same as this: $a = array(0 = 'one', 1 = 'two', 2 = 'three'); $b = new array('one' = 'bla', 'two' = 'blabla', 'three' = 'blablabla'); // integers strings The above example (again once corrected to remove the new keyword) will create an array named $b that has ONLY strings for keys. There are no keys that are integers because you didn't create any. You can test this by trying to echo the values out by key: echo $b['one']; //outputs bla echo $b[0]; //outputs nothing because this key does not have a value. This is perfectly legal: $b = array ('one' = 'bla', 'two' = 'blabla', 'three' = 'blablabla', 0 = 'blablablabla', 1 = 'blablablablabla'); In the above case you do have some keys that are strings and some that are integers but they are DIFFERENT keys, representing DIFFERENT values. Hope that answers your question... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: RE: [PHP] HTTP_X_FORWARDED_FOR?
On Thursday 10 January 2002 19:36, [EMAIL PROTECTED] stuffed this into my mailbox: Please note that not all proxies will fill in HTTP_X_FORWARDED_FOR. Some will obscure it others will not fill it in at all, either due to privacy or to conseal things. Okay, thanks. 'Cause I mean, the REMOTE_ADDR is still there. So you mean that the HTTP_X_FORWARDED_FOR isn't working while I'm working localhost? REMOTE_ADDR contains the IP of the computer that requested your page. If it was a proxy doing the request, you'll have the proxy's IP in this variable, and the IP of the computer that requested the page from the proxy will be in HTTP_X_FORWARDED_FOR. Thanks, never really knew that. This means the best way to grab an IP is with a a function like this: ?php function getIP () { if (getenv(HTTP_X_FORWARDED_FOR)) { $ip = getenv(HTTP_X_FORWARDED_FOR); } else { $ip = getenv(REMOTE_ADDR); } return $ip; } ? Yeah, that's what I do. ;) I'm unsure what happens with multiple proxies, and I'd be interested to know - do you get an array of HTTP_X_FORWARDED_FORs? Do you just get the first or the last? Have no idea... Cheers Jon Get your own free email account from http://www.popmail.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] SUMMARY: Seg fault when using SNMP on Redhat 7.x
I have been having problems with Segmentation faults when using SNMP with PHP. This used to work just fine on my Redhat 6.2 box. Appears that the problem is related to the way the standard Redhat 7.x ucd-snmp RPM is built. Rebuilding the RPM using the latest software obtained from http://sourceforge.net/projects/net-snmp/ fixes the problem. Or if you insist using the Redhat RPM, you will need to modify the SPEC file to remove disk entry from the --with-mib-modules=host agentx smux notification line, and then rebuild. Thanks also to Willem Brown. Maintainer IPPlan (https://sourceforge.net/projects/iptrack/) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] quick question
-Original Message- From: Erik Price [mailto:[EMAIL PROTECTED]] Sent: 10 January 2002 15:44 I thought that $_GET[] and $_POST[] could be used in place of regular variables... that is, $sql = SELECT * FROM tablename WHERE tablename.column=$_GET['criteria_integer']; but unfortunately, this isn't working. No, of course not -- I repeat: On Thursday, January 10, 2002, at 08:18 AM, Ford, Mike [LSS] wrote: But, if you insist on the quotes, it needs to be: case {$_POST['insert']} to ensure that the array index gets processed properly. Please note the {}, which you *MUST* include to get the array index processed properly. If you write: $_POST['insert'] PHP will try to interpret this as the variable called $_POST followed by the string ['insert'], which is clearly not what you want. including the {} forces it to use the value of $_POST['insert'], which *is* what you want. Incidentally, I've occasionally had problems including a variable name containing an underscore in a double-quoted string (e.g. $num_recs records retrieved), where PHP tries to insert the value of $num followed by the string _recs, so I always {} those as well, just to be on the safe side ({$num_recs} ... or ${num_recs} ... both work. 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, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] A variable with a variable
-Original Message- From: Yoed [mailto:[EMAIL PROTECTED]] Sent: 10 January 2002 23:01 I never really found the trick to this one yet, and wanted to see what you guys say is the best methods to call a variable that needs a variable. Say I have variables called $Var_1_Stat, $Var_2_Stat, and $Var_3_Stat and I have a variable called $Nums thats value is either 1, 2, or 3. How then would I go about calling $Var_Call=$Var_$Num_Stat ? Or $Var_Call=$Var_$Num_State hmm not hat wouldn't work? So what do you guys suggest? I suggest arrays -- is there a good reason why they won't do the job in this case? If it were at all possible, I'd reformulate the algorithm using these variables so they could be $Var_Stat[$Nums] ($Var_Stat[1], $Var_Stat[2], etc.). 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, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Re: Parsing SAR output with PHP.
Or checkout the sql import facilities offered by your choice of database to 'convert' the data from log to db-tbl, then set up your analysis in PHP+SQL separately. =dn - Original Message - From: Martin Wickman [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: 11 January 2002 09:08 Subject: [PHP] Re: Parsing SAR output with PHP. Austin Gonyou wrote: The real question I suppose is how could I parse this type of output into something I could use to make a graph. Example: 12:20:00 PM CPU %user %nice %system %idle 12:30:00 PM all 2.17 0.79 0.77 96.27 Problem is I'm not sure how to go about breaking up the rows to allow them to be inserted into the db. Thanks in advance for any ideas. I guess fields are separated with tabs? Then just use split, as in: list($time,$cpu,$ser,$nice,$ststem, $idle)= split (\t, $line); Then build your INSERT sql clause. Graph building is then a simple matter of passing the data as arrays to your php graph system. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] passing parameters from one page to another
Hello everybody I want from a Form page to pass a couple of values (fooa, foob, fooc) which are not form fields when submit button pressed to the submited page... thanks in advance for your help simos
[PHP] xml dom support
hi, I am running PHPtriad on a win2k machine... when I run phpinfo() it displays XMLACTIVE but I keep getting an error Fatal error: Call to undefined function: xmldoc() in C:\apache\htdocs\example.php on line 24 What needs to installed/configured ?? TIA, sandeep -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] passing parameters from one page to another
I want from a Form page to pass a couple of values (fooa, foob, fooc) which are not form fields when submit button pressed to the submited page... Use hidden fields: input type=hidden name=fooa value='value_of_fooa' input type=hidden name=foob value='value_of_foob' input type=hidden name=fooc value='value_of_fooc' Valentin Petruchek (aki Zliy Pes) http://zliypes.com.ua mailto:[EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Sizeof variable variable arrays
Hi there guys, Who's awake today then? :) What I'm trying to do is create variable variable arrays and then fill these arrays with values. The problem I have though is that the values don't appear to be getting stored - as following the assignment I have outputted a 'sizeof' command which always outputs 0. Here's a snippet of the code. Any ideas guys??? ... //store children page_IDs into array for each parent $str_array = menu_array_ . $current_parent_page_ID; $$str_array = array(); for ($child_cnt = 0; $child_cnt $number_children; $child_cnt++) { $db_help_structure-next_record(); //get page_ID value $page_ID = $db_help_structure-return_single_result('page_ID'); //$page_ID is now set echo storing in $str_array position $child_cnt: . $page_ID . br; $$str_array[$child_cnt] = $page_ID; echo size: . sizeof($$str_array) . br; } ... Email: [EMAIL PROTECTED] [EMAIL PROTECTED]
Re: [PHP] passing parameters from one page to another
Hi, If you want some parameters which will be pass in your site, you can use "session" . for example, you have parameters, fooa, foob, fooc, ... etc.. ? session_start(); $fooa = 1; $foob = "sait"; $fooc = "http://www.yonlendir.com/"; //you do, session_register("fooa"); session_register("foob"); session_register("fooc"); ? then you can use them everywhere in your site as "$fooa", "$foob", "$fooc". You can change it's value. you can unset with session_unregister("fooa"); Be carefull that, your paramater is $fooa, you should register it without $ session_register("fooa"); // No $ at the beginning of the paramater... And you should put session_start() at the top of the page, if you will use these parameters in that PHP file... Also, you can use COOKIES...! I dont prefer in general ... and do NOT session_register a password or a credit card number, for security reasons... good works... ---Original Message--- From: [EMAIL PROTECTED] Date: 11 Ocak 2002 Cuma 14:13:41 To: [EMAIL PROTECTED] Subject: [PHP] passing parameters from one page to another Hello everybodyI want from a Form page to pass a couple of values (fooa, foob, fooc)which are not form fieldswhen submit button pressed to the submited page...thanks in advance for your helpsimos IncrediMail - Email has finally evolved - Click Here
Re: [PHP] Sizeof variable variable arrays
On Friday 11 January 2002 20:02, Neil Freeman wrote: Hi there guys, Who's awake today then? :) Someone isn't :) Here's a snippet of the code. Any ideas guys??? ... //store children page_IDs into array for each parent $str_array = menu_array_ . $current_parent_page_ID; $$str_array = array(); for ($child_cnt = 0; $child_cnt $number_children; $child_cnt++) { $db_help_structure-next_record(); //get page_ID value $page_ID = $db_help_structure-return_single_result('page_ID'); //$page_ID is now set echo storing in $str_array position $child_cnt: . $page_ID . br; $$str_array[$child_cnt] = $page_ID; echo size: . sizeof($$str_array) . br; } You need to resolve the ambiguity in your code by placing braces around the variable part of the variable variable (!) ie: ${$str_array}[$child_cnt] = $page_ID; See manual for details. See the annotated online manual for more examples. hth -- Jason Wong - Gremlins Associates - www.gremlins.com.hk /* Go out and tell a lie that will make the whole family proud of you. -- Cadmus, to Pentheus, in The Bacchae by Euripides */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Sizeof variable variable arrays
That's done the trick. More coffee for me I think :) Cheers Jason. Jason Wong wrote: On Friday 11 January 2002 20:02, Neil Freeman wrote: Hi there guys, Who's awake today then? :) Someone isn't :) Here's a snippet of the code. Any ideas guys??? ... //store children page_IDs into array for each parent $str_array = menu_array_ . $current_parent_page_ID; $$str_array = array(); for ($child_cnt = 0; $child_cnt $number_children; $child_cnt++) { $db_help_structure-next_record(); //get page_ID value $page_ID = $db_help_structure-return_single_result('page_ID'); //$page_ID is now set echo storing in $str_array position $child_cnt: . $page_ID . br; $$str_array[$child_cnt] = $page_ID; echo size: . sizeof($$str_array) . br; } You need to resolve the ambiguity in your code by placing braces around the variable part of the variable variable (!) ie: ${$str_array}[$child_cnt] = $page_ID; See manual for details. See the annotated online manual for more examples. hth -- Jason Wong - Gremlins Associates - www.gremlins.com.hk /* Go out and tell a lie that will make the whole family proud of you. -- Cadmus, to Pentheus, in The Bacchae by Euripides */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] *** This message was virus checked with: SAVI 3.52 last updated 17th December 2001 *** -- Email: [EMAIL PROTECTED] [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] Sizeof variable variable arrays
-Original Message- From: Neil Freeman [mailto:[EMAIL PROTECTED]] Sent: 11 January 2002 12:03 Who's awake today then? :) What I'm trying to do is create variable variable arrays and then fill these arrays with values. The problem I have though is that the values don't appear to be getting stored - as following the assignment I have outputted a 'sizeof' command which always outputs 0. Once again, I can't help wondering why go all round the houses with $$ instead of using arrays -- in this case, 2-dimensional ones (arrays of arrays!): Here's a snippet of the code. Any ideas guys??? ... //store children page_IDs into array for each parent $str_array = menu_array_ . $current_parent_page_ID; $$str_array = array(); $str_array = array(); $str_array[$current_parent_page_ID] = array(); for ($child_cnt = 0; $child_cnt $number_children; $child_cnt++) { $db_help_structure-next_record(); //get page_ID value $page_ID = $db_help_structure-return_single_result('page_ID'); //$page_ID is now set echo storing in $str_array position $child_cnt: . $page_ID . br; $$str_array[$child_cnt] = $page_ID; $str_array[$current_parent_page_ID][$child_cnt] = $page_ID; echo size: . sizeof($$str_array) . br; } ... Mind you, I've done no comparison of the relevant efficiencies of the $$ method and the 2-dimensional array -- I just find the arrays easier to comprehend (and less prone to syntactical problems!!). 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, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Php and PDF files...
Hi, I want to change a PDF file into the HTML, DOC, TXT... All programs that I used is not enogh to create a good document... - HTML output is not clear enough like original PDF OR - Images inside the PDF document has been corrupted or bad (although original ones are very very good) does anybody have/know a utulity which best converts these documents? thanx... note that, I search and tried some documents... like pdf2html ... ---Original Message--- From: Neil Freeman Date: 11 Ocak 2002 Cuma 14:27:28 To: PHP General Subject: [PHP] Sizeof variable variable arrays Hi there guys,Who's awake today then? :) What I'm trying to do is create variablevariable arrays and then fill these arrays with values. The problem Ihave though is that the values don't appear to be getting stored - asfollowing the assignment I have outputted a 'sizeof' command whichalways outputs 0.Here's a snippet of the code. Any ideas guys???//store children page_IDs into array for each parent$str_array = "menu_array_" . $current_parent_page_ID;$$str_array = array();for ($child_cnt = 0; $child_cnt $number_children; $child_cnt++){$db_help_structure-next_record();//get page_ID value$page_ID = $db_help_structure-return_single_result('page_ID');//$page_ID is now setecho "storing in $str_array position $child_cnt:" . $page_ID ."br";$$str_array[$child_cnt] = $page_ID;echo "size:" . sizeof($$str_array) . "br";}Email: [EMAIL PROTECTED][EMAIL PROTECTED] IncrediMail - Email has finally evolved - Click Here
Re: [PHP] xml dom support
Sandeep Murphy wrote: hi, I am running PHPtriad on a win2k machine... when I run phpinfo() it displays XMLACTIVE this means that the standart, expat based xml support ist active but I keep getting an error Fatal error: Call to undefined function: xmldoc() in C:\apache\htdocs\example.php on line 24 What needs to installed/configured ?? you need DOM XML support, i only don't know how to do this with win2k... see http://www.php.net/manual/en/ref.xml.php and http://www.php.net/manual/en/ref.domxml.php for more information about these two... henning -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] session related
i can't use session, give me an error when use ie 6. Warning: Cannot send session cookie - headers already sent by (output started at /home/www.apollodisplays.com/public_html/mainpage.php:10) in /home/www.apollodisplays.com/public_html/mainpage.php on line 29 Warning: Cannot send session cache limiter - headers already sent (output started t /home/www.apollodisplays.com/public_html/mainpage.php:10) in /home/www.apollodisplays.com/public_html/mainpage.php on line 29 my code is very simple. see below session_start(); session_register(userright); $HTTP_SESSION_VARS[userright]=$right; anyone have any idea ? thankx _ Mark Chin mailto:[EMAIL PROTECTED] Apollo Display Technologies, LLC 85 Remington Blvd. Ronkonkoma, NY 11779 Ph. (631) 580-4360 EXT 19 Fax (631) 580-4370 http://www.apollodisplays.com
Re: [PHP] session related
Probably 1)You do echo before session_start() 2)You have white space before the opening ?php tag The problem is in that that the server had sent some output to the browser and after that you want to sent a header - the session cookie. No output must appear before all headers are sent. You can suppres echo's to be sent to the browser with ob_start() as the furst instructuion in the Php, and ob_end() after the last header is sent. Regards, Andrey Hristov - Original Message - From: Mark Chin, Apoll Displays [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, January 10, 2002 11:00 PM Subject: [PHP] session related i can't use session, give me an error when use ie 6. Warning: Cannot send session cookie - headers already sent by (output started at /home/www.apollodisplays.com/public_html/mainpage.php:10) in /home/www.apollodisplays.com/public_html/mainpage.php on line 29 Warning: Cannot send session cache limiter - headers already sent (output started t /home/www.apollodisplays.com/public_html/mainpage.php:10) in /home/www.apollodisplays.com/public_html/mainpage.php on line 29 my code is very simple. see below session_start(); session_register(userright); $HTTP_SESSION_VARS[userright]=$right; anyone have any idea ? thankx _ Mark Chin mailto:[EMAIL PROTECTED] Apollo Display Technologies, LLC 85 Remington Blvd. Ronkonkoma, NY 11779 Ph. (631) 580-4360 EXT 19 Fax (631) 580-4370 http://www.apollodisplays.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] php executing system commands..
on 1/11/02 1:35 AM, louie miranda at [EMAIL PROTECTED] wrote: Hi, can php execute system commands like df, and then print it to html ? http://www.php.net/manual/en/ref.exec.php -- mike cullerton -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] RTFM code snippet
hey folks, hope the new year is treating everyone well. i was RTFMing yesterday and ran across this piece of code while (false !== ($file = readdir($handle))) { which is similar to stuff i've done while ($file = readdir($dir)) { so, what am i not catching with my code, and what is really going on in the RTFM code with the false !== part? thanks y'all, mike -- mike cullerton -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] RTFM code snippet
I'm not sure if a resource casted to numeric to be 0 - var_dump() to say :(0) resource of type !==flase assures that it is FALSE, not 0. !== is like != but makes type checking. Frequently used with strpos(). See the memos there. There is also available === operator. It is like == but also makes type comparison. Regards, Andrey Hristov - Original Message - From: mike cullerton [EMAIL PROTECTED] To: php-general [EMAIL PROTECTED] Sent: Friday, January 11, 2002 5:01 PM Subject: [PHP] RTFM code snippet hey folks, hope the new year is treating everyone well. i was RTFMing yesterday and ran across this piece of code while (false !== ($file = readdir($handle))) { which is similar to stuff i've done while ($file = readdir($dir)) { so, what am i not catching with my code, and what is really going on in the RTFM code with the false !== part? thanks y'all, mike -- mike cullerton -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Re: [PHP-DEV] [PHP] Strange Java Extension Problem (fwd)
Also, the value I set in the ini file for java.library is changed from libjvm.so to libjava.so. Is this suppose to happen? I was guessing as to what library I should use here, but the error I am getting indicates that it can't start the jvm, so this has me worried to. Which library is the correct one? I had the same problem and in my php.ini java.library is set to libjvm.so, since it's already working now, I think that's the correct value... about the Unable to create Java Virtual Machine error, in my case I solved it by setting the LD_LIBRARY_PATH environment variable to the apropiate values. In your case I suppose that would be /usr/java1.2/jre/lib/sparc/ and /usr/java1.2/jre/lib/sparc/classic or /usr/java1.2/jre/lib/sparc/client depending on which JVM you have (java -version). If this is usefull at all, please let me know. Xavier -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] php executing system commands..
Try the backtick too. print pre . `ls -l` /pre; Matt Friedman Web Applications Developer www.SpryNewMedia.com Email: [EMAIL PROTECTED] -Original Message- From: mike cullerton [mailto:[EMAIL PROTECTED]] Sent: Friday January 11, 2002 8:46 AM To: [EMAIL PROTECTED] Subject: Re: [PHP] php executing system commands.. on 1/11/02 1:35 AM, louie miranda at [EMAIL PROTECTED] wrote: Hi, can php execute system commands like df, and then print it to html ? http://www.php.net/manual/en/ref.exec.php -- mike cullerton -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Compiled PHP
Are there any php compilers available for win32? Can they compile to byte code that the processor like C uses, instead of an interpreter? Charles Killmer IIS 5.0, Windows 2000 Server, PHP 4.1.0 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Compiled PHP
Several months ago there were notes on few websites about phpcompiler. AFAIK it is not so good but it is something. Last week a man on php-dev said that he starts working on new php compiler but with different approach - to connect in one thing - php4ts.dll, php.exe, and the source code untouched(no compiling on it). It is interesting if one can make compiler for php to Java bytecode. I saw that there is a such compiler for Ada. Regards, Andrey Hristov - Original Message - From: charlesk [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Friday, January 11, 2002 5:57 PM Subject: [PHP] Compiled PHP Are there any php compilers available for win32? Can they compile to byte code that the processor like C uses, instead of an interpreter? Charles Killmer IIS 5.0, Windows 2000 Server, PHP 4.1.0 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Re: Redeclaring functions
Martin Wickman wrote in [EMAIL PROTECTED]:">news:[EMAIL PROTECTED]: I dont know what a perpetual-running socket server is, but to have a main PHP script execute different functions with the same name I guess I'm thinking about a server that can keep it's connection up running, even if I decide to change the internal functionality of functions, or even adding functions on-the-fly. -- Arve URL:http://www.bersvendsen.com/ Newsere mot X-No-Archive URL:http://www.ibiblio.org/Dave/Dr-Fun/df9601/df960124.jpg -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Compiled PHP
Andrey Hristov wrote: Several months ago there were notes on few websites about phpcompiler. AFAIK it is not so good but it is something. Last week a man on php-dev said that he starts working on new php compiler but with different approach - to connect in one thing - php4ts.dll, php.exe, and the source code untouched(no compiling on it). It is interesting if one can make compiler for php to Java bytecode. I saw that there is a such compiler for Ada. But, as i understood the question, he ist looking for something that generates code which makes the php interpreter obsolete. I think something like this doesn't exist. There are several ways to generate bytecode, but this is still to be run with a special interpreter. There are several approaches, whereof some have the goal to make execution of code quicker and some others have the goal to give you possibility to distribute your software without giving away the code in readable form. I think there is an encoder from zend, too, to be found at www.zend.com my 2 cents henning -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Compiled PHP
I think that he uses bytecode wrongly. C is not generating a bytecode but asm instead, then translated to machine code. Bytecode is another thing. Java is bytecoded. IMO that the question is : Is there any tool which generates machine code as the C compiler does? AFAIK the encoder first optimizes somehow the code and then encode it to make a bruteforce attack harder to do. Regards, Andrey Hristov - Original Message - From: Henning Sprang [EMAIL PROTECTED] To: Andrey Hristov [EMAIL PROTECTED] Cc: [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Friday, January 11, 2002 6:31 PM Subject: Re: [PHP] Compiled PHP Andrey Hristov wrote: Several months ago there were notes on few websites about phpcompiler. AFAIK it is not so good but it is something. Last week a man on php-dev said that he starts working on new php compiler but with different approach - to connect in one thing - php4ts.dll, php.exe, and the source code untouched(no compiling on it). It is interesting if one can make compiler for php to Java bytecode. I saw that there is a such compiler for Ada. But, as i understood the question, he ist looking for something that generates code which makes the php interpreter obsolete. I think something like this doesn't exist. There are several ways to generate bytecode, but this is still to be run with a special interpreter. There are several approaches, whereof some have the goal to make execution of code quicker and some others have the goal to give you possibility to distribute your software without giving away the code in readable form. I think there is an encoder from zend, too, to be found at www.zend.com my 2 cents henning -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Can PHP access BIOS information?
It might be possible with php of you could write a function that access lm_sensor type info. Just a thought. On Fri, 2002-01-11 at 00:03, Jason Bell wrote: as far as I know, PHP can't do that itself, however. if you had a commandline utility that did the BIOS read for you, you should be able to have PHP exec() out to it - Original Message - From: Police Trainee [EMAIL PROTECTED] To: PHP [EMAIL PROTECTED] Sent: Thursday, January 10, 2002 9:04 PM Subject: [PHP] Can PHP access BIOS information? Hello. I was trying to determine if PHP has the ability to access BIOS information in a WIN environment. Specifically, I would like to have PHP access the cpu temperature as appears in the BIOS menu. I am running Apache 1.3.14. The board is a PC 100 Super 7 M598. Any help/thoughts/ideas greatly appreciated! Thank you! -mark __ Do You Yahoo!? Send FREE video emails in Yahoo! Mail! http://promo.yahoo.com/videomail/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- Austin Gonyou Systems Architect, CCNA Coremetrics, Inc. Phone: 512-698-7250 email: [EMAIL PROTECTED] It is the part of a good shepherd to shear his flock, not to skin it. Latin Proverb signature.asc Description: This is a digitally signed message part
[PHP] Using PHP to post the contents of an email to MySql database
Hi Guys, I recently read an email entitled Can a PHP program receive an e-mail and write it to a file??? in the PHP archives (see http://marc.theaimsgroup.com/?l=php-generalm=97986044121868w=2) and wanted to ask a follow up question. I'm a novice programmer, new to PHP, and unfamiliar with the ways in which to access the Standard Input for a PHP program. Can anyone provide me with some examples or online reference material as to how I can go about doing this. For example, is there a particular variable or function that I should call? Or, is there something that needs to be initialized? P.S. Thanks, in advance, for all of your help and assistance. O From Now 'Till Then, \-Reginald Alex Mullin /\ More Questions than Answers ** This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the postmaster at [EMAIL PROTECTED] www.sothebys.com ** -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] removing an array element
A quick question: what function is used to remove an array element from an array? Like array_pop(), except one by which I can refer to the element by its associative index rather than just the last element of the array. For more detail with what I'm doing, I have two versions of a select listbox -- one that includes an option with selected=yes (if the user is calling this page from submitting a form). The other version is for users who are NOT calling this page from submitting a form, i.e. for the first time. I would like, in the first version (if ($formfilled)), to REMOVE the element $temprow['div_name'] from the array $temprow so that it doesn't appear a second time (in the WHILE loop), since it has already been echoed above the WHILE loop. Is this even possible? $home_div_id = $myrow['home_div_id']; // (from another SQL query $div_name = $myrow['div_name']; // earlier in the script) $tempsql = SELECT divisions.div_name, divisions.div_id FROM divisions; $tempresult = mysql_query($tempsql, $db); $temprow = mysql_fetch_array($tempresult); if ($formfilled) { // if this page is called with // the form fields filled, grab // $home_div_id and make it // selected=yes echo select name=\home_div_id\\n; echo option value=\$home_div_id\ selected=\yes\$div_name/option\n; while ($temprow = mysql_fetch_array($tempresult)) { echo option value=\ . $temprow['div_id'] . \ . $temprow['div_name'] . /option\n; } echo /select\n; } else { // if this page is called with // blank form fields, same thing // except no selected attribute echo select name=\home_div_id\\n; while ($temprow = mysql_fetch_array($tempresult)) { echo option value=\ . $temprow['div_id'] . \ . $temprow['div_name'] . /option\n; } echo /select\n; } -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
php-general Digest 11 Jan 2002 17:21:42 -0000 Issue 1105
php-general Digest 11 Jan 2002 17:21:42 - Issue 1105 Topics (messages 80161 through 80213): Re: Can PHP access BIOS information? 80161 by: Jason Bell 80211 by: Austin Gonyou Re: Piping phpinfo(); 80162 by: Rasmus Lerdorf 80166 by: Vaccius ITsec 80167 by: Vaccius ITsec 80168 by: Kraa de Simon 80169 by: Rasmus Lerdorf Re: ereg 80163 by: Niklas Lampén 80171 by: Rasmus Lerdorf Re: ask about cookies 80164 by: gendeng New mailparse extensions 80165 by: Paul Authenticating via http 80170 by: Paul COM 80172 by: DrouetL.ldnegoce.com Re: New to list 80173 by: hugh danaher php executing system commands.. 80174 by: louie miranda 80179 by: Martin Wickman 80200 by: mike cullerton 80205 by: Matt Friedman Re: Redeclaring functions 80175 by: Martin Wickman 80208 by: Arve Bersvendsen Re: Parsing SAR output with PHP. 80176 by: Martin Wickman 80187 by: DL Neil Re: Specific References Incident 80177 by: Martin Wickman eregi and alfa numeric characters. 80178 by: Sait Karalar 80182 by: Jimmy How to get a function backtrace? 80180 by: Stefan Rusterholz Re: Q: Array 80181 by: Ivo Stoykov Re: HTTP_X_FORWARDED_FOR? 80183 by: TD - Sales International Holland B.V. SUMMARY: Seg fault when using SNMP on Redhat 7.x 80184 by: Richard Ellerbrock Re: quick question 80185 by: Ford, Mike [LSS] Re: A variable with a variable 80186 by: Ford, Mike [LSS] passing parameters from one page to another 80188 by: Simos Varelakis 80190 by: val petruchek 80192 by: Sait Karalar xml dom support 80189 by: Sandeep Murphy 80197 by: Henning Sprang Sizeof variable variable arrays 80191 by: Neil Freeman 80193 by: Jason Wong 80194 by: Neil Freeman 80195 by: Ford, Mike [LSS] Php and PDF files... 80196 by: Sait Karalar session related 80198 by: Mark Chin, Apoll Displays 80199 by: Andrey Hristov RTFM code snippet 80201 by: mike cullerton 80202 by: Andrey Hristov 80203 by: Andrey Hristov Re: [PHP-DEV] [PHP] Strange Java Extension Problem (fwd) 80204 by: Xavier Noguer Compiled PHP 80206 by: charlesk 80207 by: Andrey Hristov 80209 by: Henning Sprang 80210 by: Andrey Hristov Using PHP to post the contents of an email to MySql database 80212 by: Mullin, Reginald removing an array element 80213 by: Erik Price 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--- as far as I know, PHP can't do that itself, however. if you had a commandline utility that did the BIOS read for you, you should be able to have PHP exec() out to it - Original Message - From: Police Trainee [EMAIL PROTECTED] To: PHP [EMAIL PROTECTED] Sent: Thursday, January 10, 2002 9:04 PM Subject: [PHP] Can PHP access BIOS information? Hello. I was trying to determine if PHP has the ability to access BIOS information in a WIN environment. Specifically, I would like to have PHP access the cpu temperature as appears in the BIOS menu. I am running Apache 1.3.14. The board is a PC 100 Super 7 M598. Any help/thoughts/ideas greatly appreciated! Thank you! -mark __ Do You Yahoo!? Send FREE video emails in Yahoo! Mail! http://promo.yahoo.com/videomail/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] ---End Message--- ---BeginMessage--- It might be possible with php of you could write a function that access lm_sensor type info. Just a thought. On Fri, 2002-01-11 at 00:03, Jason Bell wrote: as far as I know, PHP can't do that itself, however. if you had a commandline utility that did the BIOS read for you, you should be able to have PHP exec() out to it - Original Message - From: Police Trainee [EMAIL PROTECTED] To: PHP [EMAIL PROTECTED] Sent: Thursday, January 10, 2002 9:04 PM Subject: [PHP] Can PHP access BIOS information? Hello. I was trying to determine if PHP has the ability to access BIOS information in a WIN environment. Specifically, I would like to have PHP access the cpu temperature as appears in the BIOS menu. I am running Apache 1.3.14. The board is a PC 100 Super 7 M598. Any help/thoughts/ideas greatly appreciated! Thank you! -mark
Re: [PHP] Using PHP to post the contents of an email to MySql database
on linux, you could simply open these 'files': /dev/stdin /dev/stdout for windows, and for portability, PHP provides the following dummy's, which can also simply be used by fopen() : php://stdin php://stdout bvr. On Fri, 11 Jan 2002 12:19:05 -0500, Mullin, Reginald wrote: Hi Guys, I recently read an email entitled Can a PHP program receive an e-mail and write it to a file??? in the PHP archives (see http://marc.theaimsgroup.com/?l=php-generalm=97986044121868w=2) and wanted to ask a follow up question. I'm a novice programmer, new to PHP, and unfamiliar with the ways in which to access the Standard Input for a PHP program. Can anyone provide me with some examples or online reference material as to how I can go about doing this. For example, is there a particular variable or function that I should call? Or, is there something that needs to be initialized? P.S. Thanks, in advance, for all of your help and assistance. O From Now 'Till Then, \-Reginald Alex Mullin /\ More Questions than Answers ** This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the postmaster at [EMAIL PROTECTED] www.sothebys.com ** -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Paging using arrays Question
Hi there, I have a db with only one table in it called CONSULTANT. I'm using sqlServer and would like to do record paging, say 5 at a time. I'm aware that sqlServer doesn't support the LIMIT statement so I've decided to do it using arrays. So I've written the appropriate query statement, managed to grab details for each consultant and dump that array into a new array called $consultantarray. Now, what I'd like to be able to do is this...return 5 records at a time. Have 2 links called next and previous that when clicked adjusts the $consultantarray accordingly. Can someone take a look at my code below and tell me where I have to go from here. So far the arrays are fine (meaning they are holding the appropriate values), just the display of the appropriate records from the array is my big problemo. :) I currently have a foreach loop being used, but am unsure if this is the correct route to take, in fact, I know this isn't right because it's displaying the records oddly. Thx for your help, Joe :) ?php #connect to db $connectionToDB = odbc_connect(cdxcet, joecqon, joecoqdsn); #create query statement $sqls = SELECT consultantid, firstname, lastname, city, stateprovince, country, category, yearsexp FROM CONSULTANT WHERE category ='$category' ORDER BY yearsexp DESC ; #execute the sql statement (query) on the connection made $resultset = odbc_do($connectionToDB, $sqls); print h4 align='left'font color='#663399' face='verdana'Consultant Search Results for: . $category . /font/h4; #print out results here #start the table -- loop through rows below print table width='740' cellpadding='5' cellspacing='0' border='0'; print trtd align='left' width='230'font color='#663399' face='verdana'bName/b/font/tdtd align='left' width='200'bfont color='#663399' face='verdana'City/font/b/tdtd align='left' width='200'bfont color='#663399' face='verdana'State/Province/font/b/tdtd align='left' width='200'bfont color='#663399' face='verdana'Country/font/b/tdtd align='left' width='200'bfont color='#663399' face='verdana'Category/font/b/tdtd align='left' width='200'bfont color='#663399' face='verdana'Years Exp/font/b/td/tr; print trtd height=10/tdtd/tdtd/td/tr; #initialize the consultant details array $consultantdetailsarray[] = array(); // fetch the data from the database while(odbc_fetch_row($resultset)){ $consultantdetailsarray[0] = odbc_result($resultset, 1); $consultantdetailsarray[1] = odbc_result($resultset, 2); $consultantdetailsarray[2] = odbc_result($resultset, 3); $consultantdetailsarray[3] = odbc_result($resultset, 4); $consultantdetailsarray[4] = odbc_result($resultset, 5); $consultantdetailsarray[5] = odbc_result($resultset, 6); $consultantdetailsarray[6] = odbc_result($resultset, 7); $consultantdetailsarray[7] = odbc_result($resultset, 8); #dump each consultant into the new array called $consultantarray $consultantarray[] = $consultantdetailsarray; } #forloop to iterate through array of consultants foreach ($consultantarray as $value){ $cid = $consultantdetailsarray[0]; $firstname = $consultantdetailsarray[1]; $lastname = $consultantdetailsarray[2]; $city = $consultantdetailsarray[3]; $stateprovince = $consultantdetailsarray[4]; $country = $consultantdetailsarray[5]; $category = $consultantdetailsarray[6]; $yearsexp = $consultantdetailsarray[7]; print trtd align=leftfont color='#663399' face='verdana' size=2a href='consultantdetails.php?cid= . $cid . ' . $firstname . . $lastname . /a/font/tdtd align=leftfont color='#663399' face='verdana' size=2 . $city . /font/tdtd align=leftfont color='#663399' face='verdana' size=2 . $stateprovince . /font/tdtd align=leftfont color='#663399' face='verdana' size=2 . $country . /font/tdtd align=leftfont color='#663399' face='verdana' size=2 . $category . /font/tdtd align=leftfont color='#663399' face='verdana' size=2 . $yearsexp . /font/td/tr; } print /tablebrbr; print The count of the consultant array elements is : . count($consultantdetailsarray) . BR; print The record count of returned consultants according to category selected is : . sizeof($consultantarray) . BR; // close the connection odbc_close($connectionToDB); ? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] removing an array element
what function is used to remove an array element from an array? Like array_pop(), except one by which I can refer to the element by its associative index rather than just the last element of the array. unset($array['index']); echo select name=\home_div_id\\n; echo option value=\$home_div_id\ selected=\yes\$div_name/option\n; while ($temprow = mysql_fetch_array($tempresult)) { echo option value=\ . $temprow['div_id'] . \ . $temprow['div_name'] . /option\n; } echo /select\n; Why not just add a simple check inside that while loop? if($temprow['div_id'] != $home_div_id) echo option value=\ . $temprow['div_id'] . \ . $temprow['div_name'] . /option\n; Seems more logical to me than to mess with the array itself. -Rasmus -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] IMPORTANT about asking QUESTIONS
It happens a lot here that people ask questions that could easily be found by browsing the manual or searching the PHP FAQ and website. Some people really should read the FAQ and manual (php.net) when they have a question and preferrably search an archive of this list (deja.com). It really won't hurt to at least check those first chapters of the manual, so you know what answers you can find there. Also, a searchengine (google.com) can answer almost any programming question. This would save the people on this list much time reading messages, answering (or referring to the FAQ, manual or previous posts) and will ultimately save yourself some time waiting for replies. bvr. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] removing an array element
Erik Price wrote: what function is used to remove an array element from an array? Like array_pop(), except one by which I can refer to the element by its associative index rather than just the last element of the array. For more detail with what I'm doing, I have two versions of a select listbox -- one that includes an option with selected=yes (if the user is calling this page from submitting a form). The other version is for users who are NOT calling this page from submitting a form, i.e. for the first time. I would like, in the first version (if ($formfilled)), to REMOVE the element $temprow['div_name'] from the array $temprow so that it doesn't appear a second time (in the WHILE loop), since it has already been echoed above the WHILE loop. Is this even possible? I would do it another way. say you have all the possible choices in an array that come out of a database, and ypou want, if the user already selected one, this one to be selected, right? Then i would set the selected atribute only if the value out of the database is the same as the one submitted by the form: like this (omitting the surrounding html): $query= select distinct * from sometable; $result=mysql_query($query); // the select field is named selectfield, echo form name=\myform\ action=\$PHP_SELF\ Method=\post\; echo select name=\selectfield\; // the variable $selectfield is, if set the value submitted by the form $selectfield = $_POST[selectfield]; while ($row=mysql_fetch_array($result)){ echo option; // assuming the second element of this array holds your // choices then if($selectfield == $row[1]){ echo selected; } echo . $row[1] . /option\n; } echo /select echo input type=\submit\\n; echo /form; i think this is a more straightforward solution for your problem... henning -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] IMPORTANT about asking QUESTIONS
On Saturday 12 January 2002 01:49, [EMAIL PROTECTED] wrote: It happens a lot here that people ask questions that could easily be found by browsing the manual or searching the PHP FAQ and website. Some people really should read the FAQ and manual (php.net) when they have a question and preferrably search an archive of this list (deja.com). It really won't hurt to at least check those first chapters of the manual, so you know what answers you can find there. Also, a searchengine (google.com) can answer almost any programming question. This would save the people on this list much time reading messages, answering (or referring to the FAQ, manual or previous posts) and will ultimately save yourself some time waiting for replies. May I add that using an appropriate and descriptive subject text would increase the chances of questions being read and answered. It also helps others who may be having similar problems to easily determine which posts they should be reading. Subjects like: Quick question Please help!!! etc usually find their way into my trashcan without being read :) my tuppence -- Jason Wong - Gremlins Associates - www.gremlins.com.hk /* Type louder, please. */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] quick question
$sql = SELECT * FROM tablename WHERE tablename.column=$_GET['criteria_integer']; but unfortunately, this isn't working. On a related note, outside of strings one should always surround keys with quotes, so: $arr = array('a' = 'apple', 'b' = 'banana'); print $arr['a']; // apple print $arr[a]; // apple BUT this is bad Without the quotes is bad because PHP first: a) looks for the constant named 'a' b) if constant 'a' is not found, an error of type E_NOTICE is thrown. So, let's do this: define('a','b'); print $arr['a']; // apple print $arr[a]; // banana (no error) Because constants are not looked for within strings, the following is appropriate: print an $arr[a]; // an apple As are: print an {$arr['a']}; // an apple print an . $arr['a']; // an apple Anyway, maybe that helps explain a few things :) Regards, Philip Olson -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Q: Array
Hi again Michael: Digging documentation I found out that this behaviour (string and int keys) is native for mysql_fetch_arrow() (found into the help: 'In addition to storing the data in the numeric indices of the result array, it also stores the data in associative indices, using the field names as keys. ') So the question is answered. Thank you for your help. Best regards Ivo Michael Sims [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... At 09:18 PM 1/10/2002 +0100, Ivo Stoykov wrote: How could I determine whether I have in the array's key integers *and* strings or integers only? I'm not sure exactly what you're asking but I'll give it a shot... i.e. $a = new array('one', 'two', 'three'); // this has only integers (am I wrong?) First of all, the new keyword assumes that you are instantiating an object. For example if you created an object with the name foo you would instantiate it like so: $a = new foo; So when creating arrays the new keyword is undesirable. To address your question, yes your example above (after removing the new keyword) will create an array named $a that has only integers for keys. It's functionally the same as this: $a = array(0 = 'one', 1 = 'two', 2 = 'three'); $b = new array('one' = 'bla', 'two' = 'blabla', 'three' = 'blablabla'); // integers strings The above example (again once corrected to remove the new keyword) will create an array named $b that has ONLY strings for keys. There are no keys that are integers because you didn't create any. You can test this by trying to echo the values out by key: echo $b['one']; //outputs bla echo $b[0]; //outputs nothing because this key does not have a value. This is perfectly legal: $b = array ('one' = 'bla', 'two' = 'blabla', 'three' = 'blablabla', 0 = 'blablablabla', 1 = 'blablablablabla'); In the above case you do have some keys that are strings and some that are integers but they are DIFFERENT keys, representing DIFFERENT values. Hope that answers your question... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Q: Array
Hi again Michael: Digging documentation I found out that this behaviour (string and int keys) is native for mysql_fetch_arrow() (found into the help: 'In addition to storing the data in the numeric indices of the result array, it also stores the data in associative indices, using the field names as keys. ') So the question is answered. Thank you for your help. Best regards Ivo Michael Sims [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... At 09:18 PM 1/10/2002 +0100, Ivo Stoykov wrote: How could I determine whether I have in the array's key integers *and* strings or integers only? I'm not sure exactly what you're asking but I'll give it a shot... i.e. $a = new array('one', 'two', 'three'); // this has only integers (am I wrong?) First of all, the new keyword assumes that you are instantiating an object. For example if you created an object with the name foo you would instantiate it like so: $a = new foo; So when creating arrays the new keyword is undesirable. To address your question, yes your example above (after removing the new keyword) will create an array named $a that has only integers for keys. It's functionally the same as this: $a = array(0 = 'one', 1 = 'two', 2 = 'three'); $b = new array('one' = 'bla', 'two' = 'blabla', 'three' = 'blablabla'); // integers strings The above example (again once corrected to remove the new keyword) will create an array named $b that has ONLY strings for keys. There are no keys that are integers because you didn't create any. You can test this by trying to echo the values out by key: echo $b['one']; //outputs bla echo $b[0]; //outputs nothing because this key does not have a value. This is perfectly legal: $b = array ('one' = 'bla', 'two' = 'blabla', 'three' = 'blablabla', 0 = 'blablablabla', 1 = 'blablablablabla'); In the above case you do have some keys that are strings and some that are integers but they are DIFFERENT keys, representing DIFFERENT values. Hope that answers your question... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Q: Array
Hi again Michael: Digging documentation I found out that this behaviour (string and int keys) is native for mysql_fetch_arrow() (found into the help: 'In addition to storing the data in the numeric indices of the result array, it also stores the data in associative indices, using the field names as keys. ') So the question is answered. Thank you for your help. Best regards Ivo Michael Sims [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... At 09:18 PM 1/10/2002 +0100, Ivo Stoykov wrote: How could I determine whether I have in the array's key integers *and* strings or integers only? I'm not sure exactly what you're asking but I'll give it a shot... i.e. $a = new array('one', 'two', 'three'); // this has only integers (am I wrong?) First of all, the new keyword assumes that you are instantiating an object. For example if you created an object with the name foo you would instantiate it like so: $a = new foo; So when creating arrays the new keyword is undesirable. To address your question, yes your example above (after removing the new keyword) will create an array named $a that has only integers for keys. It's functionally the same as this: $a = array(0 = 'one', 1 = 'two', 2 = 'three'); $b = new array('one' = 'bla', 'two' = 'blabla', 'three' = 'blablabla'); // integers strings The above example (again once corrected to remove the new keyword) will create an array named $b that has ONLY strings for keys. There are no keys that are integers because you didn't create any. You can test this by trying to echo the values out by key: echo $b['one']; //outputs bla echo $b[0]; //outputs nothing because this key does not have a value. This is perfectly legal: $b = array ('one' = 'bla', 'two' = 'blabla', 'three' = 'blablabla', 0 = 'blablablabla', 1 = 'blablablablabla'); In the above case you do have some keys that are strings and some that are integers but they are DIFFERENT keys, representing DIFFERENT values. Hope that answers your question... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Q: Array
Hi again Michael: Digging documentation I found out that this behaviour (string and int keys) is native for mysql_fetch_arrow() (found into the help: 'In addition to storing the data in the numeric indices of the result array, it also stores the data in associative indices, using the field names as keys. ') So the question is answered. Thank you for your help. Best regards Ivo Michael Sims [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... At 09:18 PM 1/10/2002 +0100, Ivo Stoykov wrote: How could I determine whether I have in the array's key integers *and* strings or integers only? I'm not sure exactly what you're asking but I'll give it a shot... i.e. $a = new array('one', 'two', 'three'); // this has only integers (am I wrong?) First of all, the new keyword assumes that you are instantiating an object. For example if you created an object with the name foo you would instantiate it like so: $a = new foo; So when creating arrays the new keyword is undesirable. To address your question, yes your example above (after removing the new keyword) will create an array named $a that has only integers for keys. It's functionally the same as this: $a = array(0 = 'one', 1 = 'two', 2 = 'three'); $b = new array('one' = 'bla', 'two' = 'blabla', 'three' = 'blablabla'); // integers strings The above example (again once corrected to remove the new keyword) will create an array named $b that has ONLY strings for keys. There are no keys that are integers because you didn't create any. You can test this by trying to echo the values out by key: echo $b['one']; //outputs bla echo $b[0]; //outputs nothing because this key does not have a value. This is perfectly legal: $b = array ('one' = 'bla', 'two' = 'blabla', 'three' = 'blablabla', 0 = 'blablablabla', 1 = 'blablablablabla'); In the above case you do have some keys that are strings and some that are integers but they are DIFFERENT keys, representing DIFFERENT values. Hope that answers your question... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Q: Array
Hi again Michael: Digging documentation I found out that this behaviour (string and int keys) is native for mysql_fetch_arrow() (found into the help: 'In addition to storing the data in the numeric indices of the result array, it also stores the data in associative indices, using the field names as keys. ') So the question is answered. Thank you for your help. Best regards Ivo Michael Sims [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... At 09:18 PM 1/10/2002 +0100, Ivo Stoykov wrote: How could I determine whether I have in the array's key integers *and* strings or integers only? I'm not sure exactly what you're asking but I'll give it a shot... i.e. $a = new array('one', 'two', 'three'); // this has only integers (am I wrong?) First of all, the new keyword assumes that you are instantiating an object. For example if you created an object with the name foo you would instantiate it like so: $a = new foo; So when creating arrays the new keyword is undesirable. To address your question, yes your example above (after removing the new keyword) will create an array named $a that has only integers for keys. It's functionally the same as this: $a = array(0 = 'one', 1 = 'two', 2 = 'three'); $b = new array('one' = 'bla', 'two' = 'blabla', 'three' = 'blablabla'); // integers strings The above example (again once corrected to remove the new keyword) will create an array named $b that has ONLY strings for keys. There are no keys that are integers because you didn't create any. You can test this by trying to echo the values out by key: echo $b['one']; //outputs bla echo $b[0]; //outputs nothing because this key does not have a value. This is perfectly legal: $b = array ('one' = 'bla', 'two' = 'blabla', 'three' = 'blablabla', 0 = 'blablablabla', 1 = 'blablablablabla'); In the above case you do have some keys that are strings and some that are integers but they are DIFFERENT keys, representing DIFFERENT values. Hope that answers your question... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] principiante(beginer)
quiero conectarme con un servidor sql server 2000 y hasta ahora no he podido. lo intentado con la funcion mssql_connect(server name, user name, contraseña) y en el browser recibo el siguiente mensaje Fatal error: Call to undefined function: mssql_connect() in c:\inetpub\wwwroot\receve\prueba.php alguien puede guiarme se lo agradeceria i wanna to connect to sql server 2000 and i can not. i try with the function of mssql' s library mssql_connect(server name, user name, contraseña) and not have good results Do Help me somebody? I need it very much thanks for all
Re: [PHP] principiante(beginer)
Hola !!! Tienes que ins oh, sorry. ;-)) You need to install MsSQL support for PHP, by getting the right PHP module and adding it in your 'php.ini' file see this file for the exact syntax. Hasta la vista ... Le Vendredi 11 Janvier 2002 19:14, vania a écrit : quiero conectarme con un servidor sql server 2000 y hasta ahora no he podido. lo intentado con la funcion mssql_connect(server name, user name, contraseña) y en el browser recibo el siguiente mensaje Fatal error: Call to undefined function: mssql_connect() in c:\inetpub\wwwroot\receve\prueba.php alguien puede guiarme se lo agradeceria --- - i wanna to connect to sql server 2000 and i can not. i try with the function of mssql' s library mssql_connect(server name, user name, contraseña) and not have good results Do Help me somebody? I need it very much thanks for all -- ( * Nicolas Costes, //\\ IUT de La Roche / Yon, poste 8449 ( \/ ) [EMAIL PROTECTED] http://luxregina.free.fr -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Newbie - PHP MySQL
Ben Clumeck wrote: When using MySQL to Authenticate users for a specific directory (i.e. www.mysite.com/user) how would it know to go to that directory (/user). How would it know to not let someone access a file directory in that directory (i.e. www.mysite.com/user/page2.php)? this question is too general - you should describe your idea of what you want to do and where your problem is a bit more. In general is is you who would be responsible to write the code that checks if a user is authenticated and should have access to something, and you have to include that piece of code at the beginning of each page you want to limit access for. If I am using MySQL to query a row in a table can how would it know to only let a specific user(s) have access to the information? this either a mysql related question - as mysql deals with the problem that a user has to be authenticated within mysql_connect or mysql_pconnect to access some information - or it is a matter of your application design - if you want only special users to do something or to get some views of the data you queried from mysql you can go and create a user table with users and poasswords, and a permission table where users are designated to specific tasks, then, before you show some data in your script, you ask the user for a password, look him up in your users table, and only let him view the things he is allowed to. but, again, this is a very general answer on a general question, which might be the reason why nobody answered until now, to get some real useful answers or solutions to your problem you have to be more specific. maybe you want to go through some basic tutorials first before doing such comlicated things and learn the basics of php and mysql before playing around with big applications, permissions for users, etc... (sorry, got no URL for something lkike this at hand now, use google) hope this still helps henning -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] both work? (was Re: [PHP] quick question)
On Friday, January 11, 2002, at 06:05 AM, Ford, Mike [LSS] wrote: Incidentally, I've occasionally had problems including a variable name containing an underscore in a double-quoted string (e.g. $num_recs records retrieved), where PHP tries to insert the value of $num followed by the string _recs, so I always {} those as well, just to be on the safe side ({$num_recs} ... or ${num_recs} ... both work. You mentioned that {$num_recs} and ${num_recs} both work -- I'm familiar with the second form from bash shell scripting, but not the first. Do they both work in all instances, or is one preferred over the other? Thanks Mike And sorry for making you repeat yourself (the first email I sent was incomplete but for some reason got sent, which you replied to and then the second, intended, email went out and that is when you wrote your second reply :). I have a better understanding of using associative indexes from arrays in double-quoted statements now. Erik -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] memory error
Hi I built PHP on an ALPHA running OSF V5.1 I did the install after the make just like i did in the past. This time, however, when i do: apachectl start i get this: /usr/local/apache/bin/apachectl: 323331 Memory fault /usr/local/apache/bin/apachectl start: httpd could not be started There are no error messages being print to any apache logs. Now, I had apache running previously with PHP. I realized that imap had not been properly installed into my PHP so i went back and rebuilt PHP. Now I get this problem. This is my configuration: ./configure --with-apxs=/usr/local/apache/bin/apxs --with-mysql=/usr/local/mysql --with-gd=/usr/local/src/gd-1.8.4 --with-png-dir=/usr/local/src/libpng-1.2.0 --with-zlib-dir=/usr/local/src/zlib --with-curl=/usr/local/lib --with-calendar --with-jpeg-dir=/usr/local/src/jpeg-6b/ --with-imap (imap was installed by putting c-client.a in /usr/lib and the appropriate header files in /usr/include) This time around I had to edit a php source file: in ext/standard/scanf.c and make the function scan_set_error_return to NOT be an inline function. Has any had this problem before? thanks! tom holton .. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] me and my CRON JOB
Quick tip -- locate and whereis are your friends in the shell. They make finding executables like php are a snap. As for emailing from php/cron, it depends on how your system is set up. Many email servers bounce any emails they receive from IPs that they can't reverse map or otherwise identify. If your machine is on a LAN for instance, the emails will probably get bounced. Another thing to check is that your user account can actually use your system's SMTP service. Email sent with php's mail() function are usually sent by the owner of the script (or the web server's user). J Mehmet Kamil Erisen wrote: hi, thanks for the tip. I was wondering about it too I do not have access to everywhere on the server. I tried /usr/bin/php and it worked.. :) I tested the following script for connection to database, executing my functions etc... everything seems to work but mail. any ideas? Thanks for the help. erisen btw: at last, I added the die to my mail command, and fair enough, I got the Can not send this as output. So, now the question is, how can I send mail with php / cron config. please note that the script worked fine on the browser. thx. code: #!/usr/bin/php -q ?php include (application.php); $subject=Cron Job has run; $body=test.php is running now; $sendtome = [EMAIL PROTECTED]; mail([EMAIL PROTECTED], $subject, $body,$sendtome) or die ('Can not send this'); echo $sendtome; echo hello world; echo turk_now() ; $array = get_user_stat($CONF) ; while (list($key,$value)=each($array)) { echo $key $valueBR; } ? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] PHP4.1.1 + RH7.2 + UCD-Snmp
Hi Everybody, Has anyone doing it sucefuly? I can compile it. The phpinfo(); call returns ok! (UCD-Snmp enable) but when I call the snmp functions I got a SegFault (on PHP-CGI). I already tried with an without --enable-ucd-snmp-hack, and recompiling the UCD-Snmp packages as told on the PHP manual pages (http://www.php.net/snmp). Any tips on this? Thanks in advance, Antonio. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Antonio S. Martins Jr. - System Analist | Only The Shadow Knows | | WorldNet Internet Maringa - PR - Brasil | what evil lurks in the | | E-Mail: [EMAIL PROTECTED] | Heart of Men! | | [EMAIL PROTECTED] | !!! Linux User: 52392 !!! | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ This e-mail message is 100% Microsoft free! /\ \ / CAMPANHA DA FITA ASCII - CONTRA MAIL HTML X ASCII RIBBON CAMPAIGN - AGAINST HTML MAIL / \ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] PHP Sessions and SSL
Hi, I am currently developing a site which makes use of SSL and sessions. However, sometimes when I submit form data (from an SSL page to another SSL page on the same server), I get an error saying This page contains both secure and unsecure items. Do you want to display the nonsecure items (I have had these results in IE5.5 and IE6, possibly IE5 too). If I press yes, a DNS error page appears. If i press no, a page saying simply NavigationCancelled (without any spaces) appears. This error seems to happen randomly, and only when form data is being sent with POST (I haven't tried it with GET or anything else as it may be a security risk to have the form contents displayed in the query string). I have found a way to fix this, however, it had some undesirable affects with pages being cashed (and therefore not being displayed with any changed session variables). This fix was done using session_cache_limiter('private'), but I don't want to use this due to these caching effects. Does anyone have any suggestions that could fix this problem? I would be very grateful. Richard Hilton -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
FW: [PHP] Using PHP to post the contents of an email to MySql database
Hi Guys, I've written the following program to write an email from PHP Standard Input to an html file: ** *** ?php $file = php://stdin; $fp = @fopen($file,rb); if ($fp){ $contents = fread($fp,filesize($file)); $fw = @fopen (/www/htdocs/pgs/htm/stdin.htm, wb+); if ($fw){ flock($fw, 1); fwrite($fw, $contents, filesize($file)); fclose($fw); } else { print The file stdin.htm does not exist!; } @fclose($fp); } else { print The file php://stdin does not exist!; } ? ** *** However, whenever the email attempts to access the program, the mailer-daemon returns the following error message: ** *** The original message was received at Fri, 11 Jan 2002 15:01:34 -0500 from [63.105.171.52] - The following addresses had permanent fatal errors - |php -q /www/htdocs/exe/php/Email2MySql.php (expanded from: [EMAIL PROTECTED]) - Transcript of session follows - sh: php: command not found 554 |php -q /www/htdocs/exe/php/Email2MySql.php... unknown mailer error 127 ** *** What am I doing wrong here? Did I screw up the alias? Does my system not support this functionality? HELP. P.S. My virtual server is running Linux. O From Now 'Till Then, \-Reginald Alex Mullin /\ 212-894-1690 -Original Message- From: [EMAIL PROTECTED] [SMTP:[EMAIL PROTECTED]] Sent: Friday, January 11, 2002 12:30 PM To: [EMAIL PROTECTED]; Mullin, Reginald Subject: Re: [PHP] Using PHP to post the contents of an email to MySql database on linux, you could simply open these 'files': /dev/stdin /dev/stdout for windows, and for portability, PHP provides the following dummy's, which can also simply be used by fopen() : php://stdin php://stdout bvr. On Fri, 11 Jan 2002 12:19:05 -0500, Mullin, Reginald wrote: Hi Guys, I recently read an email entitled Can a PHP program receive an e-mail and write it to a file??? in the PHP archives (see http://marc.theaimsgroup.com/?l=php-generalm=97986044121868w=2) and wanted to ask a follow up question. I'm a novice programmer, new to PHP, and unfamiliar with the ways in which to access the Standard Input for a PHP program. Can anyone provide me with some examples or online reference material as to how I can go about doing this. For example, is there a particular variable or function that I should call? Or, is there something that needs to be initialized? P.S. Thanks, in advance, for all of your help and assistance. O From Now 'Till Then, \-Reginald Alex Mullin /\ More Questions than Answers ** This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the postmaster at [EMAIL PROTECTED] www.sothebys.com ** -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] ** This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the postmaster at [EMAIL PROTECTED] www.sothebys.com ** -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Cannot load: iconv_module_entry
Well, I did not configure it any particular way. I just tried to build the mod_php4 port on FreeBSD. I assumed it would work. Why would the FreeBSD port developers commit something to the stable release that doesn't work? Thanks, Brian Brian Clark [EMAIL PROTECTED] wrote in message 20020110230835.GA1557@ganymede">news:20020110230835.GA1557@ganymede... * Brian Williams ([EMAIL PROTECTED]) [Jan 10. 2002 04:57]: Hi All, Hello When I try to run apache, I get this error message: Cannot load /usr/local/libexec/apache/libphp4.so into server: /usr/local/libexec/apache/libphp4.so: Undefined symbol 'iconv_module_entry' So you configured PHP --with-iconv? My guess is that you'll need to include the path to your libraries for iconv in /etc/ld,so.conf then run ldconfig. -- Brian Clark | Avoiding the general public since 1805! Fingerprint: 07CE FA37 8DF6 A109 8119 076B B5A2 E5FB E4D0 C7C8 Too many freaks, and not enough circuses. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Using a HTML button
Hi, I am rather new to PHP so I hope somebody can help me. I have a normal button (HTML code). Then I have made a function function multiply($X) { return 2*$X; } The button has an OnClick, which calls my function. INPUT TYPE=BUTTON name=HH value=Mul onClick=? $XX=multiply(5);? I then writes $X to the screen. ?php echo $X ? The problem is I dont even have to press the button. When the page loads it already has calculated 2*$X. Why is that. I would like to only call my function when I press my button. Please help Morten -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Cannot load: iconv_module_entry
So you configured PHP --with-iconv? My guess is that you'll need to include the path to your libraries for iconv in /etc/ld,so.conf then run ldconfig. I do not have /etc/ld.so.conf on my system, but I do have /usr/compat/linux/etc/ld.so.conf Thanks, Brian -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Re: Using a HTML button
PHP is a server-side language (i.e. Perl when used with mod_perl), not a client-side language (i.e. JavaScript). All of the processing is done on the server BEFORE it is sent to the user. Therefore, you can't call a PHP function directly from a web page after the user has received it, since all of the processing has already been done. J Morten Nielsen wrote: Hi, I am rather new to PHP so I hope somebody can help me. I have a normal button (HTML code). Then I have made a function function multiply($X) { return 2*$X; } The button has an OnClick, which calls my function. INPUT TYPE=BUTTON name=HH value=Mul onClick=? $XX=multiply(5);? I then writes $X to the screen. ?php echo $X ? The problem is I dont even have to press the button. When the page loads it already has calculated 2*$X. Why is that. I would like to only call my function when I press my button. Please help Morten -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Using a HTML button
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 * On 11-01-02 at 22:48 * Morten Nielsen said Hi, I am rather new to PHP so I hope somebody can help me. I have a normal button (HTML code). Then I have made a function function multiply($X) { return 2*$X; } The button has an OnClick, which calls my function. INPUT TYPE=BUTTON name=HH value=Mul onClick=? $XX=multiply(5);? I then writes $X to the screen. ?php echo $X ? The problem is I dont even have to press the button. When the page loads it already has calculated 2*$X. Why is that. I would like to only call my function when I press my button. What value is it returning 5, or 10? Nick Wilson Tel:+45 3325 0688 Fax:+45 3325 0677 Web:www.explodingnet.com -BEGIN PGP SIGNATURE- Version: GnuPG v1.0.6 (GNU/Linux) Comment: For info see http://www.gnupg.org iD8DBQE8P2ArHpvrrTa6L5oRAhPjAJ9Mv4k54bNNtu8DLGBegiD7SaQA1QCggJNl PolIOd8coSStooSyW/mmtk0= =MNoe -END PGP SIGNATURE- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Re: Using a HTML button
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 * On 11-01-02 at 22:57 * J Smith said PHP is a server-side language (i.e. Perl when used with mod_perl), not a client-side language (i.e. JavaScript). All of the processing is done on the server BEFORE it is sent to the user. Therefore, you can't call a PHP function directly from a web page after the user has received it, since all of the processing has already been done. Of course, I think in my case the expresion is 'barking up the wrong tree'. - -- Nick Wilson Tel:+45 3325 0688 Fax:+45 3325 0677 Web:www.explodingnet.com -BEGIN PGP SIGNATURE- Version: GnuPG v1.0.6 (GNU/Linux) Comment: For info see http://www.gnupg.org iD8DBQE8P2CdHpvrrTa6L5oRAuYZAKCVRqP6XhhLIu4X2b8+xL8ctnG+SwCff+v2 As7/xKIhSyk2niDW1aLgA40= =jQmN -END PGP SIGNATURE- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] using mysql_query() twice?
I am curious if using the same mysql_query() function twice causes some kind of problem. It seems that if I use $result = mysql_query($sql, $db); if (mysql_fetch_array($result)) { while ($row = mysql_fetch_array($result) or die(You lose. No data fetched.)) { // print some data // print a simple sentence to see if the WHILE statement even executes } } else { // print No results match your criteria } In this, I have used the $result variable twice. $result is essentially nothing more than a mysql_query() function. If I do the above, then the IF statement is true but the WHILE statement doesn't seem to produce its intended effect. In other words, I get the die() message You lose. No data fetched. This leads me to believe that I can't run two instances of mysql_query() or perhaps mysql_fetch_array(). Does anyone know for sure if this is the case? Erik -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Re: IMPORTANT about asking QUESTIONS
Many people use mail clients that don't do any sort of threading to follow what's going on on this list; I use Eudora, personally, when in Windows, and the Mozilla mail client when I'm in Linux. It was, quite literally, years before someone finally pointed out to me that in a mail reader or a news reader that supports threading, if I start a new thread I shouldn't reply to an old thread with a new subject line. I'm now very careful to follow that procedure. In my mail client, it makes no difference, but I know it affects other readers. That's just why it happens; because not everyone uses a newsreader to read this newsgroup, so many people don't even realize what's happening. At 11:22 AM 1/11/2002, l0t3k wrote: one of my biggest problems, which happens here a lot, is that some people will ask a completely different question (with a different topic header) under an existing thread rather than starting a new thread. all it takes is a few minutes to familiarize oneself with the newsreader, but apparently a few minutes is too much.. Sliante, Richard S. Crawford http://www.mossroot.com AIM: Buffalo2K ICQ: 11646404 Y!: rscrawford MSN: [EMAIL PROTECTED] It is only with the heart that we see rightly; what is essential is invisible to the eye. --Antoine de Saint Exupéry Push the button, Max! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Fixed! Re: [PHP] headers showing up in browser
After lots of trial and error I traced the problem back to a missing browscap.ini, I commented out that line in php.ini and it worked fine. I guess it was causing php to think the it wasn't dealing with a browser so it sent the headers differently (or something) thanks to everyone. - Mark -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] quick question
It seems that you are saying that not using quotes is bad (first), but then later you show that omitting the quotes does not result in an error. Or are you saying that the quotes can be omitted if the array element is being used in a string (between quotes), but generally the quotes around the constant are needed to perform non-string operations? Thank you, Erik On Friday, January 11, 2002, at 01:06 PM, Philip Olson wrote: $sql = SELECT * FROM tablename WHERE tablename.column=$_GET['criteria_integer']; but unfortunately, this isn't working. On a related note, outside of strings one should always surround keys with quotes, so: $arr = array('a' = 'apple', 'b' = 'banana'); print $arr['a']; // apple print $arr[a]; // apple BUT this is bad Without the quotes is bad because PHP first: a) looks for the constant named 'a' b) if constant 'a' is not found, an error of type E_NOTICE is thrown. So, let's do this: define('a','b'); print $arr['a']; // apple print $arr[a]; // banana (no error) Because constants are not looked for within strings, the following is appropriate: print an $arr[a]; // an apple As are: print an {$arr['a']}; // an apple print an . $arr['a']; // an apple Anyway, maybe that helps explain a few things :) Regards, Philip Olson -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Using a HTML button
PHP is entirely server-based. So when you load this page into your browser, all of the PHP is being parsed BEFORE it ever loads into the browser. So the function will be executed even before the page loads. Do it in JavaScript if you want it to be done in the browser. What you have written down will show up in the source code of your browser as: INPUT TYPE=BUTTON NAME=HH value=Mul onClick=1 (or something like that). PHP runs entirely on the server. Server! Server! Server! Server! Honest, I promise that it doesn't get interpreted by the browser. If you have any doubts, try writing a PHP script, reading it in your browser, and then viewing the source code to see what gets rendered. For browser-side scripting, I suggest you pick up a book on JavaScript programming. Nothing you do in PHP will ever be interpreted by a browser. At 01:59 PM 1/11/2002, Nick Wilson wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 * On 11-01-02 at 22:48 * Morten Nielsen said Hi, I am rather new to PHP so I hope somebody can help me. I have a normal button (HTML code). Then I have made a function function multiply($X) { return 2*$X; } The button has an OnClick, which calls my function. INPUT TYPE=BUTTON name=HH value=Mul onClick=? $XX=multiply(5);? I then writes $X to the screen. ?php echo $X ? The problem is I dont even have to press the button. When the page loads it already has calculated 2*$X. Why is that. I would like to only call my function when I press my button. What value is it returning 5, or 10? Nick Wilson Tel:+45 3325 0688 Fax:+45 3325 0677 Web:www.explodingnet.com -BEGIN PGP SIGNATURE- Version: GnuPG v1.0.6 (GNU/Linux) Comment: For info see http://www.gnupg.org iD8DBQE8P2ArHpvrrTa6L5oRAhPjAJ9Mv4k54bNNtu8DLGBegiD7SaQA1QCggJNl PolIOd8coSStooSyW/mmtk0= =MNoe -END PGP SIGNATURE- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] Sliante, Richard S. Crawford http://www.mossroot.com AIM: Buffalo2K ICQ: 11646404 Y!: rscrawford MSN: [EMAIL PROTECTED] It is only with the heart that we see rightly; what is essential is invisible to the eye. --Antoine de Saint Exupéry Push the button, Max! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Cannot load: iconv_module_entry
* Brian Williams ([EMAIL PROTECTED]) [Jan 11. 2002 16:46]: So you configured PHP --with-iconv? My guess is that you'll need to include the path to your libraries for iconv in /etc/ld,so.conf then run ldconfig. I do not have /etc/ld.so.conf on my system, but I do have /usr/compat/linux/etc/ld.so.conf I think FreeBSD uses rc.conf - check the shlib_dirs variable, IIRC. And a note about your earlier reply in this thread: I'm only guessing this will fix the problem. That's been the fix when I've seen error messages like that in the past when trying to load mod_php. -- Brian Clark | Avoiding the general public since 1805! Fingerprint: 07CE FA37 8DF6 A109 8119 076B B5A2 E5FB E4D0 C7C8 Freedoms precious metals, gold, silver and lead. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Sessions and SSL
Hi, I am currently developing a site which makes use of SSL and sessions. However, sometimes when I submit form data (from an SSL page to another SSL page on the same server), I get an error saying This page contains both secure and unsecure items. Do you want to display the nonsecure items (I have had these results in IE5.5 and IE6, possibly IE5 too). If I press yes, a DNS error page appears. If i press no, a page saying simply NavigationCancelled (without any spaces) appears. This error seems to happen randomly, and only when form data is being sent with POST (I haven't tried it with GET or anything else as it may be a security risk to have the form contents displayed in the query string). I have found a way to fix this, however, it had some undesirable affects with pages being cashed (and therefore not being displayed with any changed session variables). This fix was done using session_cache_limiter('private'), but I don't want to use this due to these caching effects. Does anyone have any suggestions that could fix this problem? I would be very grateful. Richard Hilton. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] using mysql_query() twice?
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 * On 11-01-02 at 23:08 * Erik Price said I am curious if using the same mysql_query() function twice causes some kind of problem. It seems that if I use $result = mysql_query($sql, $db); if (mysql_fetch_array($result)) { while ($row = mysql_fetch_array($result) or die(You lose. No data fetched.)) { // print some data // print a simple sentence to see if the WHILE statement even executes } } else { // print No results match your criteria } IF statement is true but the WHILE statement doesn't seem to produce its intended effect. In other words, I get the die() message You lose. No data fetched. I'll most likely be corrected (I just joined the list to brush up on my php) but I think that if you change this while ($row = mysql_fetch_array($result) or die(You lose. No data to this while ($row = mysql_fetch_array($another_result) or die(You lose. No data You'll be on the right track. This leads me to believe that I can't run two instances of mysql_query() or perhaps mysql_fetch_array(). No, of course you can. HTH - -- Nick Wilson Tel:+45 3325 0688 Fax:+45 3325 0677 Web:www.explodingnet.com -BEGIN PGP SIGNATURE- Version: GnuPG v1.0.6 (GNU/Linux) Comment: For info see http://www.gnupg.org iD8DBQE8P2XjHpvrrTa6L5oRArToAJ96owiXpTmPnOGSOI2jzvMHnAwm1ACbBXk2 DbgVDF6NwxSwOA8+p86zNC0= =0Z6i -END PGP SIGNATURE- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] using mysql_query() twice?
EXCELLENT! It worked perfect. So $result can't be used twice -- I wonder if it somehow is altered by the mysql_fetch_array() that is performed upon it. Thanks Nick. On Friday, January 11, 2002, at 05:23 PM, Nick Wilson wrote: I'll most likely be corrected (I just joined the list to brush up on my php) but I think that if you change this while ($row = mysql_fetch_array($result) or die(You lose. No data to this while ($row = mysql_fetch_array($another_result) or die(You lose. No data You'll be on the right track. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] removing an array element
Because, as a dope, I forget that you can invert IF statements like that -- you're right, I'd rather do that than mess with the array. Although the feedback on unset($arrayname['index']) was extremely useful knowledge! Thank you everyone. Erik On Friday, January 11, 2002, at 12:31 PM, Rasmus Lerdorf wrote: Why not just add a simple check inside that while loop? if($temprow['div_id'] != $home_div_id) echo option value=\ . $temprow['div_id'] . \ . $temprow['div_name'] . /option\n; Seems more logical to me than to mess with the array itself. -Rasmus -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] using mysql_query() twice?
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 * On 11-01-02 at 23:39 * Erik Price said EXCELLENT! It worked perfect. So $result can't be used twice -- I wonder if it somehow is altered by the mysql_fetch_array() that is performed upon it. That's not it. Your first $result is a resource indicator (container for results) so if you re-assign it (put another value into it) it becomes useless as your while statement depends on it. Happy to help :) - -- Nick Wilson Tel:+45 3325 0688 Fax:+45 3325 0677 Web:www.explodingnet.com -BEGIN PGP SIGNATURE- Version: GnuPG v1.0.6 (GNU/Linux) Comment: For info see http://www.gnupg.org iD8DBQE8P2pbHpvrrTa6L5oRAqWrAJ0RPOMtsW4IhBTkzKycyJnnZHwATACfTct6 Pi2wOViPXfXlpR1V3iw78Is= =RpGT -END PGP SIGNATURE- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] using mysql_query() twice?
On Friday, January 11, 2002, at 05:42 PM, Nick Wilson wrote: That's not it. Your first $result is a resource indicator (container for results) so if you re-assign it (put another value into it) it becomes useless as your while statement depends on it. (This may be redundant, but I'm hoping that someday someone will find this info in the archives as helpful:) INSIGHT! Now I understand. I was mistaken in the way that I first conceptualized the following: $sql = some SQL code; $result = mysql_query($sql, $db); Originally, I thought that $result was just a variable that represented the function mysql_query($sql, $db). And when $result is called by, for instance, mysql_fetch_array(), in the form mysql_fetch_array($result), all I was really doing was making a more organized form of this: mysql_fetch_array((mysql_query($sql, $db))) But no! It appears that defining the variable $result like so: $result = mysql_query($sql, $db); Is actually performing an operation! The mysql_query() function happens at this time! Not during the mysql_fetch_array() as I previously thought. If what I have written above here is correct (and I hope it is) then you have helped me learn a fundamental element of the way PHP works, at least with this command. I had not been thinking of $result as a container for results before, rather as a container for another function for later use. Awesome. Erik -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Upload - Link generator?
I am looking for a php script that allows me to upload a file via a browser, and the generates an automatic link on a predefined page. Is that possible? Regards [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] POSTing files
This is probably more of an HTML question, but... I would like to have the ability to upload files onto a site, however using the normal HTML input type=file... results in a somewhat disgusting looking control which I cannot seem to get to fit into my site's theme. Is there a better way - remembering of course that I still need the facility to browse the local system for a file Thanks -- Alan McFarlane [EMAIL PROTECTED] ICQ: 20787656 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Matching phrases in search engine
Hi. I´m trying to develop a search engine where users could search not only individual words, but also phrases enclosed by , but I´m having trouble to build the function to recognize each phrase and individual word from a variable sent with html form. Did anybody make something like this? Can you help me in this point? Thank you in advance. Josi
[PHP] Newbie looking for mentor
Hi, It all started when I wanted to create a photography competition and forum on my web site. I searched and searched for a program (script) on the web that would help me. I found one and paid $125.00 for it, but I am very unhappy with the way it works. It is not very user friendly and I'm loosing potential members because of it. I have asked the programmer to assist me in creating it the way I want it, he said he would, I have yet to see the updates I requested. So I've taken it upon myself to create a script tailored to my needs. I have written HTML, some JavaScript, and very little CGI. I thought I could handle creating this script. I went to my nearest Barnes and Noble and bought 5 books on PHP and MySQL. I have been reading them for 2 weeks and doing the lessons in one of the books until I'm bleary eyed. I have a basic understanding, but I don't know where to begin. I'm looking for someone with a little patience, who can get me on the right path and guide me through. I don't know what I can give you in return...we can talk about it if you're interested. P. Westover -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] PHP question regarding Cold Fusion
Cold Fusion, as far as I'm concerned, stinks. However, I have been involved in porting a website from Cold Fusion to PHP and during this transmogrification, I've come across something I'm not sure how to emulate in PHP. Perhaps if there are any CF/PHP gurus out there, they can help me out. The tag I am talking about is CFHTTP. This tag allows you to emulate the posting of a form, but also allows you to capture the results of the post. There are a couple of forms written in CF that connect to the merchant account, check a credit card, for example, and then wait for the approval/denial response. Is there anything in PHP that can do this same kind of thing? Any help would be appreciated. Best regards, Jeremy Reed -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] PHP question regarding Cold Fusion
Google for something called PostToHost I wrote ages ago. Lots of variations of that around. Basically you just fsockopen() to the site in question and fputs() your request and POST data and then fgets() the result. -Rasmus On Fri, 11 Jan 2002, Jeremy Reed wrote: Cold Fusion, as far as I'm concerned, stinks. However, I have been involved in porting a website from Cold Fusion to PHP and during this transmogrification, I've come across something I'm not sure how to emulate in PHP. Perhaps if there are any CF/PHP gurus out there, they can help me out. The tag I am talking about is CFHTTP. This tag allows you to emulate the posting of a form, but also allows you to capture the results of the post. There are a couple of forms written in CF that connect to the merchant account, check a credit card, for example, and then wait for the approval/denial response. Is there anything in PHP that can do this same kind of thing? Any help would be appreciated. Best regards, Jeremy Reed -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] preg_replace help
I have need to be able to replace text within a string to turn it into a link. In other words, I might have a phrase lik: blah, blah, blah, please visit my site at www.mysite.com. blah, blah,blah. I need to have the string converted to blah, blah, blah, please visit my site at http://www.mysite.com. blah, blah,blah. The link might have more than 3 sections and won't necessarily end in .com (.net,.com.nl, etc.). Here is what I have been testing (then I get stuck): $myLink = Please visit my web site at www.mysite.com. You will be glad you did!; $repLink = preg_replace(/(www.)/i,a href=http://\\1,$myLink); which yields Please visit my web site at a href=http://www.mysite.com. You will be glad you did! What I would need is Please visit my web site at a href=http://www.mysite.comwww.mysite.com/a. You will be glad you did! To be truthful, pattern matching is giving me migraines! Programming has always been natural to me (32 years of it), but this challenge (eregi, preg_match,etc.) is making me crazy! Can someone recommend a good tutorial or book on this subject? Thanks! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] ENUM COL to php
Hi, If I have en ENUM column in a mysql table, can I leverage this through PHP to restrict user entry with a list? Other option that I have is to create a lookup table, or use an array. = Mehmet Erisen http://www.erisen.com __ Do You Yahoo!? Send FREE video emails in Yahoo! Mail! http://promo.yahoo.com/videomail/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] ask cookies
how to set cookies in win98 using PWS ? if i set the session of php.ini, where is the cookies setting ? Mpu Strees -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] preg_replace help
on 1/11/02 8:20 PM, Gaylen Fraley at [EMAIL PROTECTED] wrote: Can someone recommend a good tutorial or book on this subject? Mastering Regular Expressions Jeffrey Friedl O'Reilly Associates ISBN 1-56592-257-3 -- mike cullerton -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] ENUM COL to php
On Saturday 12 January 2002 11:30, Mehmet Kamil ERISEN wrote: Hi, If I have en ENUM column in a mysql table, can I leverage this through PHP to restrict user entry with a list? Other option that I have is to create a lookup table, or use an array. You'll need to adapt this for your own use, but hopefully you'll get the general idea. #=== # create_list_from_ENUM #--- # Returns array [enum vals] # # Arguments # - # # $dbh: a $dbh object defined in class.DBI.inc # $table : the table to get the ENUM values from # $column : the column containing the ENUM values # #=== function create_list_from_ENUM($dbh, $table, $column) { $sth = $dbh-prepare(SHOW COLUMNS FROM $table LIKE '$column'); if ($sth) { $sth-execute(); while ($row = $sth-fetchrow_hash()) { ereg(('(.*)'), $row[1], $temp); $array = explode( ',', $temp[2] ); while (list ($key, $val) = each ($array)) { $return[] = $val; } } } return $return; } -- Jason Wong - Gremlins Associates - www.gremlins.com.hk /* A shortcut is the longest distance between two points. */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Using a HTML button
JAVASCRIPT VERSION html head titlemytitle/title script language=JavaScript type=text/javascript function multiply(x){ var myresult = 2 * x; document.write(myresult); } /script /head body form name=myform action=?$PHP_SELF? method=POST input type=button name=mybutton value=myvalue onClick=multiply(5) /form /body /html PHP VERSION html head titlemytitle/title /head body if($mybutton){ $myresult = 2 * $mybutton; print $myresult; }else{ print Click the button to see what 2 mulitplied by 5 is!; } form name=myform action=?$PHP_SELF? method=POST input type=button name=mybutton value=5 onClick=mysubmit() /form /body /html You can do it either way, don't take my code at face value (sorry, couldn't resist) I haven't tested it, but it should be enough to get you going. I would suggest that you use the PHP version, that way you don't have to worry about cross browser JavaScript compatibility. Hi, I am rather new to PHP so I hope somebody can help me. I have a normal button (HTML code). Then I have made a function function multiply($X) { return 2*$X; } The button has an OnClick, which calls my function. INPUT TYPE=BUTTON name=HH value=Mul onClick=? $XX=multiply(5);? I then writes $X to the screen. ?php echo $X ? The problem is I dont even have to press the button. When the page loads it already has calculated 2*$X. Why is that. I would like to only call my function when I press my button. What value is it returning 5, or 10? Nick Wilson Tel:+45 3325 0688 Fax:+45 3325 0677 Web:www.explodingnet.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
php-general Digest 12 Jan 2002 05:57:48 -0000 Issue 1106
php-general Digest 12 Jan 2002 05:57:48 - Issue 1106 Topics (messages 80214 through 80265): Re: Using PHP to post the contents of an email to MySql database 80214 by: bvr.xs4all.nl 80235 by: Mullin, Reginald Paging using arrays Question 80215 by: Lerp Re: removing an array element 80216 by: Rasmus Lerdorf 80218 by: Henning Sprang 80251 by: Erik Price IMPORTANT about asking QUESTIONS 80217 by: bvr.xs4all.nl 80219 by: Jason Wong 80232 by: l0t3k 80243 by: Richard S. Crawford Re: quick question 80220 by: Philip Olson 80245 by: Erik Price Re: Q: Array 80221 by: Ivo Stoykov 80222 by: Ivo Stoykov 80223 by: Ivo Stoykov 80224 by: Ivo Stoykov 80225 by: Ivo Stoykov principiante(beginer) 80226 by: vania 80227 by: Nicolas Costes Re: Newbie - PHP MySQL 80228 by: Henning Sprang both work? (was Re: [PHP] quick question) 80229 by: Erik Price memory error 80230 by: Thomas Holton Re: me and my CRON JOB 80231 by: J Smith PHP4.1.1 + RH7.2 + UCD-Snmp 80233 by: Antonio S. Martins Jr. PHP Sessions and SSL 80234 by: Richard Hilton Re: Cannot load: iconv_module_entry 80236 by: Brian Williams 80238 by: Brian Williams 80247 by: Brian Clark Using a HTML button 80237 by: Morten Nielsen 80239 by: J Smith 80240 by: Nick Wilson 80241 by: Nick Wilson 80246 by: Richard S. Crawford 80265 by: sundogcurt using mysql_query() twice? 80242 by: Erik Price 80249 by: Nick Wilson 80250 by: Erik Price 80252 by: Nick Wilson 80253 by: Erik Price Fixed! Re: [PHP] headers showing up in browser 80244 by: Mark Sessions and SSL 80248 by: Richard Hilton Upload - Link generator? 80254 by: ArtistHotel POSTing files 80255 by: Alan McFarlane Matching phrases in search engine 80256 by: José Ignacio Franqueiro Newbie looking for mentor 80257 by: P. Westover PHP question regarding Cold Fusion 80258 by: Jeremy Reed 80259 by: Rasmus Lerdorf preg_replace help 80260 by: Gaylen Fraley 80263 by: mike cullerton ENUM COL to php 80261 by: Mehmet Kamil ERISEN 80264 by: Jason Wong ask cookies 80262 by: gendeng Administrivia: To subscribe to the digest, e-mail: [EMAIL PROTECTED] To unsubscribe from the digest, e-mail: [EMAIL PROTECTED] To post to the list, e-mail: [EMAIL PROTECTED] -- ---BeginMessage--- on linux, you could simply open these 'files': /dev/stdin /dev/stdout for windows, and for portability, PHP provides the following dummy's, which can also simply be used by fopen() : php://stdin php://stdout bvr. On Fri, 11 Jan 2002 12:19:05 -0500, Mullin, Reginald wrote: Hi Guys, I recently read an email entitled Can a PHP program receive an e-mail and write it to a file??? in the PHP archives (see http://marc.theaimsgroup.com/?l=php-generalm=97986044121868w=2) and wanted to ask a follow up question. I'm a novice programmer, new to PHP, and unfamiliar with the ways in which to access the Standard Input for a PHP program. Can anyone provide me with some examples or online reference material as to how I can go about doing this. For example, is there a particular variable or function that I should call? Or, is there something that needs to be initialized? P.S. Thanks, in advance, for all of your help and assistance. O From Now 'Till Then, \-Reginald Alex Mullin /\ More Questions than Answers ** This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the postmaster at [EMAIL PROTECTED] www.sothebys.com ** -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] ---End Message--- ---BeginMessage--- Hi Guys, I've written the following program to write an email from PHP Standard Input to an html file: ** *** ?php $file = php://stdin; $fp = @fopen($file,rb); if ($fp){ $contents = fread($fp,filesize($file)); $fw = @fopen (/www/htdocs/pgs/htm/stdin.htm, wb+); if ($fw){ flock($fw, 1); fwrite($fw, $contents, filesize($file)); fclose($fw); } else { print The
[PHP] two mysql issues :)
Hi All, I am in sql mode today. Two issues that bother me: 1- I had a script select user_id, username from users having user_id = max(user_id) my max user_id = 150 or something, but script kept bringing 122 I fixed the issue by using a select max(user_id) and select username from users where user_id = $v_user_id 2- select max(commission) where territory=1 and salesperson=2232; this query should return 0 zero b/c it's a sum. but it returns null. any comments how I can work around this!!! thanks. Mehmet Erisen http://www.erisen.com - Do You Yahoo!? Send FREE video emails in Yahoo! Mail.
Re: [PHP] preg_replace help
Hi Gaylen, Please visit my web site at a href=http://www.mysite.comwww.mysite.com/a. You will be glad you did! assumming all link start with www and all word which start with www must be a link: $repLink = preg_replace(/ (www[^ ]*) /i, a href='http://\\1'\\1/a, $myLink); -- Jimmy People are like clouds, all unique. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Re: Newbie looking for mentor
Hi All, Thank you very much for all the responses to my SOS. Yoda has made contact. P. Westover P. Westover [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Hi, It all started when I wanted to create a photography competition and forum on my web site. I searched and searched for a program (script) on the web that would help me. I found one and paid $125.00 for it, but I am very unhappy with the way it works. It is not very user friendly and I'm loosing potential members because of it. I have asked the programmer to assist me in creating it the way I want it, he said he would, I have yet to see the updates I requested. So I've taken it upon myself to create a script tailored to my needs. I have written HTML, some JavaScript, and very little CGI. I thought I could handle creating this script. I went to my nearest Barnes and Noble and bought 5 books on PHP and MySQL. I have been reading them for 2 weeks and doing the lessons in one of the books until I'm bleary eyed. I have a basic understanding, but I don't know where to begin. I'm looking for someone with a little patience, who can get me on the right path and guide me through. I don't know what I can give you in return...we can talk about it if you're interested. P. Westover -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] PHP question regarding Cold Fusion
On Fri, 11 Jan 2002, Rasmus Lerdorf wrote: Google for something called PostToHost I wrote ages ago. Lots of variations of that around. Basically you just fsockopen() to the site in question and fputs() your request and POST data and then fgets() the result. With one variation being sendtohost() http://dodds.net/~cardinal/sendtohost.txt regards, Philip Olson -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] name and value tags in a form
Hey, Is there any way one can get the name tags for a form?? other then explicitly defining the tags in an array or any such thing. I just want to be able to get the name tags and there values dynamically... Regards, Kunal Jhunjhunwala -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]