[PHP] Multiple Return Values from function
Can I return more than one value from a function? php Thank You Paul -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Calling C functions
I am including a code snippet that will aid you. # Location of your binary. $yourbinary = "/usr/bin/yourprogram"; # Location of the libs for your c program if needed $yourlib = YOUR_LIB . ":" . getenv("LD_LIBRARY_PATH"); putenv("LD_LIBRARY_PATH=$yourlib"); # The args to call the binary with # For example: $arg1 = 10; $arg2 = 15; # Put together the command string $command = "$yourbinary $arg1 $arg2"; $result = `$command`; Be sure to check the return result from your program. Hope this helps Paul -Original Message- From: Sharad Tiwari [mailto:[EMAIL PROTECTED]] Sent: Tuesday, October 08, 2002 10:07 PM To: [EMAIL PROTECTED] Subject: [PHP] Calling C functions hi all, I have just started working on PHP ... (just a couple of days back) I had posted a question yesterday and could not get any rep from anyone My problem is this ... I have to take inputs from a web-based interface and pass them as parameters to a C function (or an executable program) Could anyone of you kindly let me know how can I invoke such C library functions or executables from php. thanks for the help in advance. Warm Regards, Sharad -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] PHP "Cannot redeclare class" problem
I was able to solve the problem by using the "require_once " statement. Thank You -Original Message----- From: Paul Maine [mailto:[EMAIL PROTECTED]] Sent: Saturday, September 21, 2002 10:23 AM To: PHP PHP Subject: [PHP] PHP "Cannot redeclare class" problem When I call the function batch_delayed_capture(see below), I issue the "$this->delayed_capture($d);" statement. Both batch_delayed_capture and delayed_capture are in the same include file. The statement works fine the first time through the loop but gives the following error "Cannot redeclare class pfp_class"(see below). I added some echo statements to help identify where the problem was occuring. Your assistance is greatly appreciated. Paul PHP,MySQL * Array element 0= 21203749pnref= Made it to delayed capture Just after delayed capyure Array element 1= 21203748pnref= 1 Fatal error: Cannot redeclare class pfp_class in /var/www/html/shop/modules/checkout/lib/_class.pfp.php on line 76 * function batch_delayed_capture(&$d) { global $auth, $ps_vendor_id; if ($d) { //echo "Inside POST\n"; while (list($lvar, $lvalue) = each($d)) { if (ereg ("^d_c_arr", $lvar, $throwaway)) { $batch_d_c[]=$d["$lvar"]; } } } $dbresponse = new ps_DB; for($i = 0; $i < sizeof($batch_d_c); $i++){ echo " Array element $i= " . $batch_d_c[$i]; $qr = "SELECT pnref from transaction_response WHERE result='0' "; $qr .= "AND order_id=$batch_d_c[$i] AND delay_capture IS NULL"; $dbresponse->query($qr); $dbresponse->next_record(); $d["pnref"]=$dbresponse->f("pnref"); echo "pnref= " . $d["pnref"]; $this->delayed_capture($d); echo "Just after delayed capyure"; } return True; } ** -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] PHP "Cannot redeclare class" problem
When I call the function batch_delayed_capture(see below), I issue the "$this->delayed_capture($d);" statement. Both batch_delayed_capture and delayed_capture are in the same include file. The statement works fine the first time through the loop but gives the following error "Cannot redeclare class pfp_class"(see below). I added some echo statements to help identify where the problem was occuring. Your assistance is greatly appreciated. Paul PHP,MySQL * Array element 0= 21203749pnref= Made it to delayed capture Just after delayed capyure Array element 1= 21203748pnref= 1 Fatal error: Cannot redeclare class pfp_class in /var/www/html/shop/modules/checkout/lib/_class.pfp.php on line 76 * function batch_delayed_capture(&$d) { global $auth, $ps_vendor_id; if ($d) { //echo "Inside POST\n"; while (list($lvar, $lvalue) = each($d)) { if (ereg ("^d_c_arr", $lvar, $throwaway)) { $batch_d_c[]=$d["$lvar"]; } } } $dbresponse = new ps_DB; for($i = 0; $i < sizeof($batch_d_c); $i++){ echo " Array element $i= " . $batch_d_c[$i]; $qr = "SELECT pnref from transaction_response WHERE result='0' "; $qr .= "AND order_id=$batch_d_c[$i] AND delay_capture IS NULL"; $dbresponse->query($qr); $dbresponse->next_record(); $d["pnref"]=$dbresponse->f("pnref"); echo "pnref= " . $d["pnref"]; $this->delayed_capture($d); echo "Just after delayed capyure"; } return True; } ** -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Pass array in HTTP_POST_VARS question
Is it possible to pass an array in a form post? If so, how do I reference the array on the next page? Thank You Paul php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] PHP checkbox/hidden field question
I am executing the follwoing statement as part of a "while" loop. This is part of a form and I wish to pass the name and value of the checkbox as a hidden field only is the checkbox is checked. Can you suggest how I can accomplish this task? "> Thank You Paul php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] PHP/MySQL Error Log Parser
How can I set up MySQL error logging? Is there any PHP MySQL error log parsers? Thank You -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] PHP/MySQL Search Engine Query Question
I am currently working on a website that is implemented using PHP and MySQL. The site currently has a simple search engine that allows a shopper to type in a search string that is stored in $search. For example, if a shopper types in 1972 Ford Mustang $string ="1972 Ford Mustang" Using the following SQL statement: SELECT * FROM whatevertable WHERE whatevercolumn LIKE '%$search% Records are returned that have this exact string and in this exact order (I'm aware a wild card character is included on the front and back of the string). My desire is to be able to logically AND each token of the search together independent or the order of the tokens. I want to return all records that have Mustang AND 1972 AND Ford. Since a shopper inputs the search string in advance I don't know how many tokens will be used. I would appreciate any suggestions. Regards, Paul -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Paying Job...
In today's depressed IT market, what are the prevailing hourly rates for a very experienced PHP/MySQL developer? I desire to use this information as a guage of what I am currently charging. Paul -Original Message- From: Peter J. Schoenster [mailto:[EMAIL PROTECTED]] Sent: Thursday, July 25, 2002 11:36 AM To: [EMAIL PROTECTED] Subject: Re: [PHP] Paying Job... On 25 Jul 2002 at 11:46, Gerard Samuel wrote: > Basically, someone is looking to get a database driven site built, > and Ive never written code for money before. > Im looking for advice, as to how the experienced coders in here charge > for their work. Do you charge by the page, script or by the hour (that > would be nice). Not talking about what to charge but how to charge. Good question. I've travelled quite a bit and in a lot of countries a price is "how much do you want to pay". Seriously, when you ask the price the answer is usually that, sometimes excactly that or other times what the seller considers you might pay based on his quick evalution of you. Now, are software companies much different than that? I don't think so. Try to get a price on some software "products". Not as easy as it seems. What are you really selling? You are not selling "packaged" software. You are selling a service. Most, not all, services get priced by time. I worked at an ad agency and I had to account for 7.75 hours per day. I would attach my time to jobs and the account execs would bill the clients periodically (and sometimes they reduced the time I spent). Often there was the thought to bill for value provided rather than time which is tricky if not also walking an ethical borderline, imho. I love the people who bill by the project. They will spend all of 10 minutes to "know" a project and bid. I guess most of them hope to whine later to get more money. I would bet that this method has the most success. But then you would make more money selling drugs than providing software solutions so success is probably not measured by money or acceptance. Personally, if it's a small thing like fixing something broken in software I understand or just doing something that's pretty generic I will provide an estimate of time, as in from 4 - 8 hours. The client must trust me and be willing to pay the high figure if need be. I will usually not bill more than the high figure if I've underestimated. If it's a project (more than 15 hours) then I prefer to try and get a blueprint going so I can determine what it is I'm going to build before I agree to build it at a price. This worked for me three times, for FedEx and for an Architectural Firm and a "monster" type job company. Usually this method fails because your client will balk at paying for what is "so obvious" :) and when other developers will also agree that it's "so obvious". So, imho, it is a question of "who you are" to determine how to charge. Best bet, imho, is to try to understand the project as much as possible and give them a decent range. Be prepared to spend a lot more time on it than you budget. Try to get the job especially since it sounds like it's your first. If they want a fixed price for something which isn't even fixed yet, heck, give it, plenty of others will. Experience helps, understanding the nature of the client helps ... I'd suggest do whatever you have to do to get the job, you want the experience more than the money (possibly). Peter http://www.coremodules.com/ Web Application Software and Support at Affordable Prices -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Windows NT Server, FORK, SOCKETS, and seperate processes
You can use threads with NT to accomplish what you are asking. -Original Message- From: David Buerer [mailto:[EMAIL PROTECTED]] Sent: Monday, July 22, 2002 11:29 AM To: '[EMAIL PROTECTED]' Subject: [PHP] Windows NT Server, FORK, SOCKETS, and seperate processes I've got effectivly a glorified chat server which upon the arrival of a message thorugh a socket connection goes off and runs a bunch of database processed. My questions is this: How can I seperate the database processing into a seperate processor process? I really don't want the chat server to have to wait until after the database processing is done to go intercept and process another request--this just doesn't seem right. I want the chat server process to be able to deal with getting and receiving messages, and another process to deal with the database processing. That way if one of the processes get's slow, the other isn't affected. Something like the fork command would work really well, but fork doesn't exist in NT. Anyone have any ideas? I'm running Windows NT4.0 sp6a Apache Server 1.3.xx MySQL and of course, PHP 4.2.1 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php