[PHP] problems with looping array
here's the situation. I'm making a shopping cart, when an item is added it's item number is added into an array. I then want this array's items to be compared agains the database. Unfortunately I haven't been able to use a variable in the query string of MySQL. something along the lines of ?PHP include ('connect.php'); $result = mysql_query(SELECT * FROM ar LEFT JOIN company on ar.company_id=company.company_id LEFT JOIN scale on ar.scale_id=scale.scale_id WHERE item_number = . $item[$index]); ? where $item is the array of item numbers and $index is an auto incrementing number that increments at the end of the loop. Please help if you know of anyway to use this variable. Also, I can post my whole script if needed...I just didn't want unneeded info posted. Thanks in advance. -Jordan -- 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: problems with looping array
Strings in your sql query must be quoted. Try this instead: $result = mysql_query(SELECT * FROM ar LEFT JOIN company on ar.company_id=company.company_id LEFT JOIN scale on ar.scale_id=scale.scale_id WHERE item_number = \$item[$index]\); Fred Jordan [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... here's the situation. I'm making a shopping cart, when an item is added it's item number is added into an array. I then want this array's items to be compared agains the database. Unfortunately I haven't been able to use a variable in the query string of MySQL. something along the lines of ?PHP include ('connect.php'); $result = mysql_query(SELECT * FROM ar LEFT JOIN company on ar.company_id=company.company_id LEFT JOIN scale on ar.scale_id=scale.scale_id WHERE item_number = . $item[$index]); ? where $item is the array of item numbers and $index is an auto incrementing number that increments at the end of the loop. Please help if you know of anyway to use this variable. Also, I can post my whole script if needed...I just didn't want unneeded info posted. Thanks in advance. -Jordan -- 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: problems with looping array
I tried but nothing different happened. I'm still playing though and I'll see if I can make it work. I'm new to all of this...so we'll see how it goes. Thanks for your help. -jordan Fred [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Strings in your sql query must be quoted. Try this instead: $result = mysql_query(SELECT * FROM ar LEFT JOIN company on ar.company_id=company.company_id LEFT JOIN scale on ar.scale_id=scale.scale_id WHERE item_number = \$item[$index]\); Fred Jordan [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... here's the situation. I'm making a shopping cart, when an item is added it's item number is added into an array. I then want this array's items to be compared agains the database. Unfortunately I haven't been able to use a variable in the query string of MySQL. something along the lines of ?PHP include ('connect.php'); $result = mysql_query(SELECT * FROM ar LEFT JOIN company on ar.company_id=company.company_id LEFT JOIN scale on ar.scale_id=scale.scale_id WHERE item_number = . $item[$index]); ? where $item is the array of item numbers and $index is an auto incrementing number that increments at the end of the loop. Please help if you know of anyway to use this variable. Also, I can post my whole script if needed...I just didn't want unneeded info posted. Thanks in advance. -Jordan -- 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: best way to handle a form with 60 fields !!!
Fred wrote: Third, it is ineffecient and unneccessary to put 60 fields in a single form. If you are using the GET method it probably will not work since it passes the variable names and values in the URL, which has a maximum length of 255 In my mind maximum length 255 is not true. There isn't any limit for GET/POST requests as I read in RFC documents. The limit depends on Your web server implementation. I've never tested but suppose Apache could handle GET method with URL longer than 255 characters. I've never had problems with form's data length using Apache and GET/POST methods. But if I'm wrong I apologize. Krzysztof -REKLAMA--- Juz w sprzedazy. Katalog Samochodowy AUTO TESTY 2002. Ceny i dane techniczne 1400 samochodow, 236 raportow z jazd, testy porownawcze, wszystko o bezpieczenstwie. -- 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 3 Dec 2001 10:32:24 -0000 Issue 1030
php-general Digest 3 Dec 2001 10:32:24 - Issue 1030 Topics (messages 76352 through 76370): Question about adding library to use with php 76352 by: Joelmon2001.aol.com SQL state S1090: Almost connected to mysql via PHP/odbc 76353 by: mweb 76357 by: Venu 76358 by: mweb content disposition and internet exploder 76354 by: Fred 76355 by: Jason Murray 76356 by: Rasmus Lerdorf 76359 by: Fred 76360 by: Fred Re: A tricky one? 76361 by: Justin French Re: How to set file extension php Mac OSX and PHP 4.0.6 76362 by: Rasmus Lerdorf pages will not refresh publically 76363 by: Keith Kwasigroch 76364 by: Miles Thompson 4800 Would you like to lose weight while you sleep? 5060017 76365 by: 1750600ultimate.excite.com Re: why didnt you come watch me on my webcam? you said you would! w 76366 by: Steve Maroney problems with looping array 76367 by: Jordan 76368 by: Fred 76369 by: Jordan Re: best way to handle a form with 60 fields !!! 76370 by: Krzysztof Kocjan 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--- Hello, i have one simple question With php installed, if the time comes where I want to add another library, let's say ming, do I redo the ./congigure script or do I redo the installation or just edit one file to accomodate the new software so it can work with php? This way if there is software not configured with php at the moment that comes out in a year or what not, I would know what to do. This is one area I am confused with. I am not sure if it is necessary to redo installation or just one simple modification. Thanks ---End Message--- ---BeginMessage--- Hello, thanks to the precious suggestions I had on this list some day ago, I have made some progresses, or at least have something new to report. I would like to ask now above the error mentioned in the subject, because I have not found it inside www.,mysql.com I have a database called m97. It *is* listed when I run show databases in themysql monitor. It *shows* when I run isql -v m97. I have modified /etc/odbc.ini and /etc/odbcinst.ini and /etc/odbc.ini as follows: /etc/odbc.ini [m97] Trace= On TraceFile= stderr Driver = /usr/lib/libmyodbc.so DSN = m97 SERVER = localhost USER = test PASSWORD = gee PORT = 3306 OPTIONS = 1 DATABASE= m97 SOCKET = /tmp/mysql.sock # /etc/odbcinst.ini # From the MyODBC package [MySQL] Description = ODBC for MySQL Driver = /usr/lib/libmyodbc.so FileUsage = 1 In the PHP file I have: putenv(LD_LIBRARY_PATH=/usr/lib/); putenv(ODBCINSTINI=/etc/odbcinst.ini); putenv(ODBCINI=/etc/odbc.ini); $DSN=m97; $cnx = odbc_connect( $DSN , 'test', 'gee' ); The result in netscape is still: Warning: SQL error: [unixODBC][TCX][MyODBC]Invalid DSN specified, SQL state S1090 in SQLConnect in /home/mweb/public_html/test.php on line 360 ---End Message--- ---BeginMessage--- Hi, -Original Message- From: mweb [mailto:[EMAIL PROTECTED]] Sent: Sunday, December 02, 2001 2:03 PM To: [EMAIL PROTECTED]; [EMAIL PROTECTED]; [EMAIL PROTECTED] Subject: SQL state S1090: Almost connected to mysql via PHP/odbc Hello, thanks to the precious suggestions I had on this list some day ago, I have made some progresses, or at least have something new to report. I would like to ask now above the error mentioned in the subject, because I have not found it inside www.,mysql.com I have a database called m97. It *is* listed when I run show databases in themysql monitor. It *shows* when I run isql -v m97. I have modified /etc/odbc.ini and /etc/odbcinst.ini and /etc/odbc.ini as follows: /etc/odbc.ini [m97] Trace= On TraceFile= stderr Driver = /usr/lib/libmyodbc.so DSN = m97 SERVER = localhost USER = test PASSWORD = gee PORT = 3306 OPTIONS = 1 DATABASE= m97 SOCKET = /tmp/mysql.sock # /etc/odbcinst.ini # From the MyODBC package [MySQL] Description = ODBC for MySQL Driver = /usr/lib/libmyodbc.so FileUsage = 1 In the PHP file I have: putenv(LD_LIBRARY_PATH=/usr/lib/); putenv(ODBCINSTINI=/etc/odbcinst.ini); putenv(ODBCINI=/etc/odbc.ini); $DSN=m97; $cnx = odbc_connect( $DSN , 'test', 'gee' ); The result in netscape is still: Warning: SQL error: [unixODBC][TCX][MyODBC]Invalid DSN specified, SQL state S1090 in SQLConnect in /home/mweb/public_html/test.php on line 360 The problem is that, unixODBC is not able to find your MyODBC DSN entry. This is probably due to the fact that
Re: [PHP] Re: best way to handle a form with 60 fields !!!
Krzysztof Kocjan wrote: Fred wrote: Third, it is ineffecient and unneccessary to put 60 fields in a single form. If you are using the GET method it probably will not work since it passes the variable names and values in the URL, which has a maximum length of 255 In my mind maximum length 255 is not true. There isn't any limit for GET/POST requests as I read in RFC documents. The limit depends on Your web server implementation. I've never tested but suppose Apache could handle GET method with URL longer than 255 characters. I've never had problems with form's data length using Apache and GET/POST methods. But if I'm wrong I apologize. This depends also on Your browser of course. AFAIK GET is OK for data up to 8kB, POST can be used for much bigger data -- ---/\-- Remigiusz Sokolowski 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] P3P Implementation and PHP-Sessions
Hi, I assume everyone has heard of P3P (Platform for Privacy Preferences), so I'll skip explaining in detail what it is. If you don't know, just skip this message *g*. I've got one Problem with this, and PHP may solve it: P3P has absolutely no Application-Server/Scripting support. It's just a simple XML-File that tells the User what (personal) data the Website collects, and is Requested with hard-coded relative URL's. Assume a PHP Website with URL-based Session's. A User Request the Homepage (/index.phtml) - he's anonymous, collected data is anonymous. The (static) P3P File tells the User that the collected data is anon. Well, now the User logs-in via a Form-Submit and reloads the Page (/index.phtml). The information is set in the PHP-Session, the User is shown other (personalized) Content, but the P3P-File is still the same, telling the user, that the collected data is still anonymous - this is (or may be) wrong now. P3P has no mechanism to handle this case, in P3P you can only set a different policy for (sub-)folders (differrent URI's). The problem is, that the GET Request is absolutely the same, it doesn't matter if the user is logged-in or anonymous (well, it would be a security hole, if someone is able to find out, if a user is logged-in when (s)he takes a look at the URL, hm?). Sure, it's possible to copy all templates to another subfolder and link logged-in users to this one, but why should I do so? The advantage of using templates (a I define them) is that they just show any content. They don't care if this content is personalized or not. The content is prepared by the business logic - programmed in PHP - and stored in a database. This way, I'm able to use the same templates for logged-in and anonymous users - well, half the work to do... I already talked to some P3P-Members, they think, it is no Problem, but didn't provide a solution - at least none I was able to understand *g*. I think, P3P should (must!!) be supported by the Application-Server or Scripting Language. It should be possible to catch a request for a P3P file from the Webserver, match Information from the Session, and generate the correct XML-contents on the fly or assign a matching P3P-File. Links: P3P - http://www.w3.org/P3P/ One of our Website's that will have the described problem. (Not coded in PHP - we do quite the same thing with PHP and the BroadVision Application Server): http://www.siemens.de/solutionprovider/dialog Bruno Baketaric Development Director WOB Interactive AG Werner-Heisenberg-Strasse 6a 68519 Viernheim Fon +49 (0)6204.970-274 Fax +49 (0)6204.970-211 E-Mail: [EMAIL PROTECTED] ICQ: 818981 http://www.wob.ag http://www.bbn-advertising.com Part of: BBN The multicultural agency -- 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: call_user_func problem
Hi, just do it like this - the result will be the same, and $bar is still passed by reference: $result = call_user_func(foo, $bar); function foo( $bar ) { $bar .= 'foobar'; return 1; } _ This error just tells you, that you have to declare pass-by-reference in your functions, and cannot use a generic function, that sometimes takes parameters by reference and sometimes by value. This problem has nothing to do with call_user_func(). C [EMAIL PROTECTED] schrieb im Newsbeitrag [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Prior to 4.0.6 it worked fine, however, now when I try: $result = call_user_func(foo, $bar); function foo( $bar ) { $bar .= 'foobar'; return 1; } I get this: Warning: Call-time pass-by-reference has been deprecated - argument passed by value; If you would like to pass it by reference, modify the declaration of call_user_func(). If you would like to enable call-time pass-by-reference, you can set allow_call_time_pass_reference to true in your INI file. However, future versions may not support this any longer. Does that mean I can't pass by reference anymore? I kinda need to (the two functions above are not my actual functions btw) 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] howto run shell script
hello php-general, how do I run a shell script from PHP web interface?? assume /path/to/my/script.sh as the path and the owner and group of this script are belong to apache Regards, -- Danar PrObOndaru -- -- 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] variable scope / preg_replace_callback question
Hi, Does anyone know of a way of passing other variables to the function being called by preg_replace_callback? For instance, I have the following code: function smarty_compile_lang($tpl_source) { // en.php contains a very large array, $_lang include_once '/home/test/en.php'; global $_lang; return preg_replace_callback('/##(.+?)##/', '_compile_lang', $tpl_source); } function _compile_lang($key){ // If I include $_lang here then it gets // loaded again and again - bad for performance as it is _very_ large return $_lang[$key[1]]; } // End _compile_lang Somehow I need to make $_lang global, or pass it through the function preg_replace_callback as an arguement for _compile_lang() - which I don't think is possible? What can I do? I've tried a global statement everywhere I can think of... and I don't want to include en.php outside the functions, as it'll be included then whether the templates are being compiled or not. I'm guessing that I may want to look at a higher level of abstraction from these functions, as even if I have the include in the current place, it means that every time a template is compiled it gets reloaded (though that's not as bad as every time preg_replace_callback() finds something) whereas the best way would be to load it once per script invocation - and then only when the templates wer being compiled... Suggestions? TIA, Peter. -- 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] variable scope / preg_replace_callback question
function _compile_lang($key){ global $_lang; return $_lang[$key[1]]; } // End _compile_lang HTH Regards, Andrey Hristov - Original Message - From: Peter Bowyer [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Monday, December 03, 2001 3:45 PM Subject: [PHP] variable scope / preg_replace_callback question Hi, Does anyone know of a way of passing other variables to the function being called by preg_replace_callback? For instance, I have the following code: function smarty_compile_lang($tpl_source) { // en.php contains a very large array, $_lang include_once '/home/test/en.php'; global $_lang; return preg_replace_callback('/##(.+?)##/', '_compile_lang', $tpl_source); } function _compile_lang($key){ // If I include $_lang here then it gets // loaded again and again - bad for performance as it is _very_ large return $_lang[$key[1]]; } // End _compile_lang Somehow I need to make $_lang global, or pass it through the function preg_replace_callback as an arguement for _compile_lang() - which I don't think is possible? What can I do? I've tried a global statement everywhere I can think of... and I don't want to include en.php outside the functions, as it'll be included then whether the templates are being compiled or not. I'm guessing that I may want to look at a higher level of abstraction from these functions, as even if I have the include in the current place, it means that every time a template is compiled it gets reloaded (though that's not as bad as every time preg_replace_callback() finds something) whereas the best way would be to load it once per script invocation - and then only when the templates wer being compiled... Suggestions? TIA, Peter. -- 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] Multiple database seeking
Hello, I am trying to make a something like a cooking recipe with some calculations. My problem is too much database querying. Is it really a problem??? Let's suppose there is a table with items and prices: item1price1 item2price2 item3price3 ... Then I have to calculate some new indegrient price, which is a result of calculating other prices: (ex: $new_price1 = 2*$price1 + $price2 ) To get wanted prices I used standard query: $result = mysql_query (SELECT price from price_list where id = '01'); $row = mysql_fetch_array($result); $price1 = $row[price]; $result = mysql_query (SELECT price from price_list where id = '02'); $row = mysql_fetch_array($result); $price2 = $row[price]; //...and so on for about 30 indegrients. And on the end: $new_price1 = 2*$price1 + $price2; print $new_price1; -- But, is there a quicker way to do this? Am I doing maybe the wholistic mistake in process? Or this is just OK? Please, help cooking the soup ;) regards, Alen
Re: [PHP] php without the php.ini
Isn't it called php.ini-dist first? Excerpt from the INSTALL file that accompanied my PHP 4.0.6 dist: Next you must copy php.ini-dist to the appropriate place (normally /usr/local/lib/php.ini) and edit it as necessary to set PHP options. Of course, this doesn't matter if you're appending a wildcard to your search ( 'php.ini*' ). Erik On Friday, November 30, 2001, at 10:40 PM, Paul Warner wrote: Hi, How can PHP work without the php.ini file? I have tried to find the php.ini file on a RAQ3, to no success. Looking at the php info and then looking at the system directories doesnt yield anything. The same goes with a server running the Plesk control panel. Any ideas on how this is done? Kunal- /etc/httpd/php.ini and /etc/admserv/php.ini are on mine. Try 'find / -name php.ini' from a telnet or ssh session. -- P -- 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] Multiple database seeking
Allen, Have you a table of recipes, like so: recipe1 item1 recipe1 item2 ... recipe1 itemn recipe2 item1 You could then fetch all the items for a given recipe, and loop through the returned results (an array), concatenating the prices. Alternately, you store all your items in an array for each recipe and loop through the array ... Here's an example of what I'm using, where the prompts for a page are stored in a table. This lets me handle different languages very easily: //all the connection stuff is up above ... $cLLangCode = GB; $cPageName = user_bid; $arr_lbl = array(); $sql = select cLblName,cLblText from prompt where cLangCode = '$cLangCode' and cPageName = '$cPageName'; $result = mysql_query( $sql, $db ) or die( Unable to fetch prompts for page $cPageName. ); while( $row = mysql_fetch_array( $result ) ) { $arr_lbl[$row[cLblName]] = $row[cLblText]; } In the $arr_lbl assignment, following the while(), you could execute queries for individual item costs, and add them up. Essentially nest the same code inside the while, except that it's executing for one ingredient at a time. If you will have to a lot of this, seriously consider PostgreSQL (or similar db) as it supports subqueries, and this situation cries out for their use. This single line would give you the sum of all your ingredients: Select sum(price) from items where item in (select item from recipe where recipe_id = choc_chip) Database querying isn't a problem, as it's all server side and really fast, no traffic across the wire. If you have a lot of complex queries, really consider something other than MySQL. Cheers - Miles Thompson http://www.cqagroup.ca At 03:31 PM 12/3/2001 +0100, =?iso-8859-2?Q?Alen_Nonkovi=E8?= wrote: Hello, I am trying to make a something like a cooking recipe with some calculations. My problem is too much database querying. Is it really a problem??? Let's suppose there is a table with items and prices: item1price1 item2price2 item3price3 ... Then I have to calculate some new indegrient price, which is a result of calculating other prices: (ex: $new_price1 = 2*$price1 + $price2 ) To get wanted prices I used standard query: $result = mysql_query (SELECT price from price_list where id = '01'); $row = mysql_fetch_array($result); $price1 = $row[price]; $result = mysql_query (SELECT price from price_list where id = '02'); $row = mysql_fetch_array($result); $price2 = $row[price]; //...and so on for about 30 indegrients. And on the end: $new_price1 = 2*$price1 + $price2; print $new_price1; -- But, is there a quicker way to do this? Am I doing maybe the wholistic mistake in process? Or this is just OK? Please, help cooking the soup ;) regards, Alen -- 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] Multiple database seeking
Use smth like this - $need_prices = '01,02'; $prices = new Array(); $sql = select * from price_list where id in ($need_prices) $result = mysql_query ($sql); {//cycle while $result is not empty - for every record $row = mysql_fetch_array($result); $prices[$row[id]] = $row[price]; } After this you'll get array of prices $prices - indexes are id value. so u can write $new_price1 = 2*$prices[1] + $prices[2] Zliy Pes, http://www.zliypes.com.ua - Original Message - From: Alen Nonkovi? [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Monday, December 03, 2001 4:31 PM Subject: [PHP] Multiple database seeking Hello, I am trying to make a something like a cooking recipe with some calculations. My problem is too much database querying. Is it really a problem??? Let's suppose there is a table with items and prices: item1price1 item2price2 item3price3 ... Then I have to calculate some new indegrient price, which is a result of calculating other prices: (ex: $new_price1 = 2*$price1 + $price2 ) To get wanted prices I used standard query: $result = mysql_query (SELECT price from price_list where id = '01'); $row = mysql_fetch_array($result); $price1 = $row[price]; $result = mysql_query (SELECT price from price_list where id = '02'); $row = mysql_fetch_array($result); $price2 = $row[price]; //...and so on for about 30 indegrients. And on the end: $new_price1 = 2*$price1 + $price2; print $new_price1; -- But, is there a quicker way to do this? Am I doing maybe the wholistic mistake in process? Or this is just OK? Please, help cooking the soup ;) regards, Alen -- 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] How to set file extension php Mac OSX and PHP 4.0.6
I don't think that Sherlock can recognize any file in the /etc directories. If you never use Terminal, then Sherlock is okay, but if you do stuff in the Terminal then you are working in levels of your computer that Apple has decided to hide from most users. The /etc directory is one example of this. For searches of the hard drive outside of the Apple-approved Sherlock-searchable directories, read the man page for find. In your case, the file is probably located at /etc/httpd/httd.conf. Open this file in pico or emacs, but be sure to use sudo emacs /etc/httpd/httpd.conf if you are not logged in as root because it is not writeable by normal users. Erik On Sunday, December 2, 2001, at 04:15 PM, René Fournier wrote: OK, that makes sense--that's what I did under WinME. The only problem is that I can't seem to find the httpd.conf file anywhere. At least, Sherlock is not returning any results. Do you know which directory httpd.conf is in? ...Rene On Sunday, December 2, 2001, at 01:56 PM, Michael B. Weiner wrote: modify the apache configuration file (i.e. httpd.conf) and add it as and AddType, as in the following: AddType application/x-httpd-php .php4 .php3 .phtml .php AddType application/x-httpd-php-source .phps HTH -- René Fournier wrote: I have successfully installed PHP 4.0.6, and it works! Only problem is that Apache only sends files to the PHP module that have a .php extension. However, I need to name the files .php4 (long story). As it stands, all I see is the actual PHP source, not the output. Does anyone know how I can change Apache and/or the PHP module to recognize .php4 files and execute them as such? Thanks. ...Rene -- 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] howto run shell script
Danar Prabandaru [EMAIL PROTECTED] wrote: how do I run a shell script from PHP web interface?? assume /path/to/my/script.sh as the path and the owner and group of this script are belong to apache See exec(), system(), etc. -- Steve Werby President, Befriend Internet Services LLC http://www.befriend.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] Some clients can't see PDF
I'm using this in a script to send pdf files from Apache: ? // get the $pdf_name and $len of the $pdf_name // stuff up here, and then ... header(Content-Type: application/pdf); header(Content-Disposition: inline; filename=$pdf_name); header(Content-Length: $len); readfile($pdf_name); ? About 6 out of 300 subscribers cannot see the PDF, although they can download and view other PDF's from the site, or from other sites. I'm also aware of the note regarding IE in the Manual, and am contacting them to determine what browser/version they are using. In the meantime, does anyone have any other suggestions? Regards - Miles Thompson -- 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] How to set file extension php Mac OSX and PHP 4.0.6
- Original Message - From: Erik Price [EMAIL PROTECTED] To: René Fournier [EMAIL PROTECTED] Cc: Michael B. Weiner [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Monday, December 03, 2001 4:23 PM Subject: Re: [PHP] How to set file extension php Mac OSX and PHP 4.0.6 I don't think that Sherlock can recognize any file in the /etc directories. If you never use Terminal, then Sherlock is okay, but if you do stuff in the Terminal then you are working in levels of your computer that Apple has decided to hide from most users. The /etc directory is one example of this. For searches of the hard drive outside of the Apple-approved Sherlock-searchable directories, read the man page for find. In your case, the file is probably located at /etc/httpd/httd.conf. Open this file in pico or emacs, but be sure to use sudo emacs /etc/httpd/httpd.conf if you are not logged in as root because it is not writeable by normal users. or use locate (you will have to set up the database first). You should be able to find a tool called Locator on www.versiontracker.com which provides a GUI for locate (although I'd rather use it in terminal). AND: Sherlock WILL find the files in /etc if you search for invisible files. But unfortunately drag drop doesn't work for those files and displayed filepath seems to be wrong (they are always displayed with a path like yourharddisk/filename) and another tipp for you: use BBedit (again available at versiontracker.com or www.barebones.com - for free) if you don't like terminal apps. It has a point Open hidden... below the menu File with which you can easily open and edit the httpd.conf (as erik said it is normally located under /etc/httpd/httpd.conf) . BBedit will probably tell you that you haven't appropriate rights to edit and save the file - log out and log in as root again (or chown/chmod the file). Erik Stefan Rusterholz, [EMAIL PROTECTED] -- interaktion gmbh Stefan Rusterholz Zürichbergstrasse 17 8032 Zürich -- T. +41 1 253 19 55 F. +41 1 253 19 56 W3 www.interaktion.ch -- On Sunday, December 2, 2001, at 04:15 PM, René Fournier wrote: OK, that makes sense--that's what I did under WinME. The only problem is that I can't seem to find the httpd.conf file anywhere. At least, Sherlock is not returning any results. Do you know which directory httpd.conf is in? ...Rene On Sunday, December 2, 2001, at 01:56 PM, Michael B. Weiner wrote: modify the apache configuration file (i.e. httpd.conf) and add it as and AddType, as in the following: AddType application/x-httpd-php .php4 .php3 .phtml .php AddType application/x-httpd-php-source .phps HTH -- René Fournier wrote: I have successfully installed PHP 4.0.6, and it works! Only problem is that Apache only sends files to the PHP module that have a .php extension. However, I need to name the files .php4 (long story). As it stands, all I see is the actual PHP source, not the output. Does anyone know how I can change Apache and/or the PHP module to recognize .php4 files and execute them as such? Thanks. ...Rene -- 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] which merchant account
Can anyone suggest a bank and/or merchant account provider that you've used successfully in the past. __ Do You Yahoo!? Buy the perfect holiday gifts at Yahoo! Shopping. http://shopping.yahoo.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 problem with freetype
I've installed PHP-4.0.6 using the following configuration: './configure' '--prefix=/ECommerce/bin/apache/1.3.22' '--with-oci8=/opt/apps/oracle/8.1.7' '--with-apxs=/ECommerce/bin/apache/1.3.22/bin/apxs' '--without-mysql' '--with-zlib-dir=/usr/local' '--with-jpeg-dir=/usr/local' '--with-png-dir=/usr/local' '--with-freetype-dir=/usr/local' '--enable-ftp' '--with-xpm-dir=/usr/local/lib' '--with-t1lib=/usr/local' '--with-ttf=/usr/local' '--with-gd=/usr/local' phpinfo() says that GD support is enabled, Freetype support is enabled and has freetype linkage, t1lib, jpeg, png and wbmp supports are all enabled. In short, the installation looks successful. Unfortunately, the developers cannot get the freetype functionality. If no font is specified, then the system chooses its own font which is then displayed. However, if a font like arial is explicitly named, then the fonts are not visible. Does anybody have any ideas as to what is going on? M. Dowling HEW
[PHP] Something wrong with the file() command.
I try to give it a value with a var, but it doesn't work. The code is something like this. $y=str_pad($y,5,.txt); \\ To give it a filename from a var that contains only 1 number (with 1 digit) If in this step I do a echo $y, it shows the correct string. Suposing it is 2, it shows 2.txt $temp[]=file($y); \\ To load the file into the array. But after the file nothing happens, the array only contains Array. Sorry for my bad english. Jose. Olinet S.L. -- 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: problems with looping array
First, make sure $item[$index] has anything in it by inserting an echo $item[$index]. You also have to prepend item_number with the table name as in ar.item_number. Try single quotes around $item[$index], too. If $index is a name, I've had trouble in the past getting associative arrays to resolve correctly inside strings. Try using this ... $result = mysql_query(SELECT * FROM ar LEFT JOIN company on ar.company_id=company.company_id LEFT JOIN scale on ar.scale_id=scale.scale_id WHERE ar.item_number = '.$item[$index].'); I tried but nothing different happened. I'm still playing though and I'll see if I can make it work. I'm new to all of this...so we'll see how it goes. Thanks for your help. -jordan Fred [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Strings in your sql query must be quoted. Try this instead: $result = mysql_query(SELECT * FROM ar LEFT JOIN company on ar.company_id=company.company_id LEFT JOIN scale on ar.scale_id=scale.scale_id WHERE item_number = \$item[$index]\); Fred Jordan [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... here's the situation. I'm making a shopping cart, when an item is added it's item number is added into an array. I then want this array's items to be compared agains the database. Unfortunately I haven't been able to use a variable in the query string of MySQL. something along the lines of ?PHP include ('connect.php'); $result = mysql_query(SELECT * FROM ar LEFT JOIN company on ar.company_id=company.company_id LEFT JOIN scale on ar.scale_id=scale.scale_id WHERE item_number = . $item[$index]); ? where $item is the array of item numbers and $index is an auto incrementing number that increments at the end of the loop. Please help if you know of anyway to use this variable. Also, I can post my whole script if needed...I just didn't want unneeded info posted. Thanks in advance. -Jordan -- 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] -- Jim Musil - Multimedia Programmer Nettmedia - 212-629-0004 [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 Bulletin Boards...how they work.
If you are just starting into PHP, try some something more basic. If you have some background into another language such as PERL, then you shouldn't have too much trouble. However, if you insist to taking on a bulletin board script for analyzing purposes, head over to hotscripts.com where I'm sure there is a few tutorials and many boards from the simplistic recursive wwwthreads style boards to the vertical setup like infopop and UBB. I've coded up BlazeBoard script last year and I must say, that majority of the work is getting the cool features rather than developing a foundation of the board. All a board does is input/output data from the database. So first step to take would be developing a core registration module, then utilizing it, authenticate the user so they can post to a forum, then build the module to retrieve the data. Of course there are other factors to consider on the complexity of the board, that is if you want to consider the ability to create more than one board for a forum or be able to categorize it. These are really features, and doesn't represent the core system of any board. Regards, Jonathan Chum http://www.flaap.com Flash resources Anthony Ritter [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... I'm using Windows 98 with Apache, mysql and PHP. I'm in the process of learning PHP and would like to find a few tutorials on PHP/mysql bulletin boards. I know that there are a few that you can download but I am trying to find a tutorial that will let me anylaze the syntax and logic of the code so that I can understand and breakdown the steps in how a BB program works. Any URL's will be helpful. Thanking all in advance. Tony Ritter -- 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] ereg help
- Original Message - From: Valentin V. Petruchek [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Monday, December 03, 2001 6:35 PM Subject: [PHP] ereg help I'm not new for php, but have no experience working with ereg functions. My problem is the following: i have string.. for example $s=id {name,title,nick} [http://www.php.net];; i want to break it in several parts: $p[0]=id; $p[1][0] =name; $p[1][1] =title; $p[1][2] =nick; $p[2]=http://www.php.net;; The part in [] is not neccessary, count of {} elements is not less than 1 I can do it with string fucntions, but it seemes to me it's better to use regular functions. Could anybody help me to solve this problem and advise resource for studying regular expresions? Zliy Pes, http://zliypes.com.ua -- 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] ereg help
This is a good starter about PHP and regular expressions. http://www.phpbuilder.com/columns/dario19990616.php3 - Original Message - From: Valentin V. Petruchek [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Monday, December 03, 2001 6:35 PM Subject: [PHP] ereg help I'm not new for php, but have no experience working with ereg functions. My problem is the following: i have string.. for example $s=id {name,title,nick} [http://www.php.net];; i want to break it in several parts: $p[0]=id; $p[1][0] =name; $p[1][1] =title; $p[1][2] =nick; $p[2]=http://www.php.net;; The part in [] is not neccessary, count of {} elements is not less than 1 I can do it with string fucntions, but it seemes to me it's better to use regular functions. Could anybody help me to solve this problem and advise resource for studying regular expresions? Zliy Pes, http://zliypes.com.ua -- 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] -- Jim Musil - Multimedia Programmer Nettmedia - 212-629-0004 [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] RealMedia
Hi guys, I want to write a script that inputs a file variable then it sends out a RealMedia header so that it sends the file location to RealPlayer. EG: If I click on http://www.randumian.co.uk/getsample.php?file=1234.rm, it should send the headers so that the computer thinks its a .rpm file then send me to http://www.randumian.co.uk/realaudio/1234.rm. Can anybody advise me on what to do please? Randum Ian DJ / Producer / Web Designer [EMAIL PROTECTED] - 07903 067339 Webmaster: http://www.randumian.co.uk Webmaster: http://www.danceportal.co.uk
Re: [PHP] RealMedia
This must be the first output of your script. header (Content-type: audio/x-pn-realaudio); and then your output should be in .ram file output. Is this what you are asking? Hi guys, I want to write a script that inputs a file variable then it sends out a RealMedia header so that it sends the file location to RealPlayer. EG: If I click on http://www.randumian.co.uk/getsample.php?file=1234.rm, it should send the headers so that the computer thinks its a .rpm file then send me to http://www.randumian.co.uk/realaudio/1234.rm. Can anybody advise me on what to do please? Randum Ian DJ / Producer / Web Designer [EMAIL PROTECTED] - 07903 067339 Webmaster: http://www.randumian.co.uk Webmaster: http://www.danceportal.co.uk -- Jim Musil - Multimedia Programmer Nettmedia - 212-629-0004 [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] Anyone got PHP to work under RedHat 7.2
I am having trouble with php to display from the Netscape. I installed both Apache and PHP using RPM. I modified httpd.conf file. Can anyone help me with this? Where should the php.ini be located? Mine is located in /etc dir. Should it be somewhere else? Thanks. Hai Nguyen -- 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: Something wrong with the file() command.
When you attempt to print or echo an array the result is simply array. You have to iterate through the elements of the array to see what each element contains. Read the array chapter in the manual for more information. Fred Jose [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... I try to give it a value with a var, but it doesn't work. The code is something like this. $y=str_pad($y,5,.txt); \\ To give it a filename from a var that contains only 1 number (with 1 digit) If in this step I do a echo $y, it shows the correct string. Suposing it is 2, it shows 2.txt $temp[]=file($y); \\ To load the file into the array. But after the file nothing happens, the array only contains Array. Sorry for my bad english. Jose. Olinet S.L. -- 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] Anyone got PHP to work under RedHat 7.2
Yes, I have PHP running just fine under 7.2 (source compile). PHP doesn't care one whit about your browser; however, Netscape is picky (as it should be) about end tags. The most common problem when pages display under IE but not under Netscape is the lask of a /table or /tr tag. Mark C. -Original Message- From: Hai Nguyen [mailto:[EMAIL PROTECTED]] I am having trouble with php to display from the Netscape. I installed both Apache and PHP using RPM. I modified httpd.conf file. -- 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] Something wrong with the file() command.
From: Jose [mailto:[EMAIL PROTECTED]] $temp[]=file($y); \\ To load the file into the array. --- file() returns an array! So, you ended up with an array ($temp) with element 0 an array (returned from file() ). Read the manual very carefully ... You probably meant to say $temp=file($y); // To load the file into the array. (watch those '//'s, too!) mark C. -- 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: Something wrong with the file() command.
Try this: ?php echo pre; print_r ($temp); echo /pre; ? and look for $temp content. Zliy Pes http://zliypes.com.ua - Original Message - From: Fred [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Monday, December 03, 2001 7:58 PM Subject: [PHP] Re: Something wrong with the file() command. When you attempt to print or echo an array the result is simply array. You have to iterate through the elements of the array to see what each element contains. Read the array chapter in the manual for more information. Fred Jose [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... I try to give it a value with a var, but it doesn't work. The code is something like this. $y=str_pad($y,5,.txt); \\ To give it a filename from a var that contains only 1 number (with 1 digit) If in this step I do a echo $y, it shows the correct string. Suposing it is 2, it shows 2.txt $temp[]=file($y); \\ To load the file into the array. But after the file nothing happens, the array only contains Array. Sorry for my bad english. Jose. Olinet S.L. -- 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] Session_start() issue??
Hi all, Has anyone seen this. I have a login form (login.htm) which calls a login handler (check_login.php). If the login is sucessfull the check_login.php will set a couple session variables, then redirect the user to a menu page. The problem I am seeing is that when I call session_start() from the menu page, I get a new session reference rather than a reference to the session I started in the check_login.php. Is there a setting in the php.ini I should change? Any thoughts would be greatly appreciated. Chris -- 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] problem with ImageCreateJPEG ...
Hello all, anyone can help me in line command to configure php : './configure' '--with-mysql' '--with-apache=/usr/src/packages/SOURCES/apache_1.3.9/' '--with-zlib-dir=/usr/src/packages/SOURCES/zlib/' '--with-png-dir=/usr/src/packages/SOURCES/libpng/' '--with-jpeg-dir=/usr/src/packages/SOURCES/jpeg-6b/' '--with-gd=/usr/src/packages/SOURCES/gd' '--enable-track-vars' in result of phpinfo() : gd GD Support enabled GD Version 1.6.2 or higher JPG Support enabled PNG Support enabled WBMP Support enabled zlib ZLib Support enabled 'zlib:' fopen wrapper enabled Compiled Version 1.1.3 Linked Version 1.1.3 ,but when use ImageCreateFromJPEG: br bWarning/b: imagecreatefromjpeg: .../testout.jpg' is not a valid JPEG file in b../a.php/b on line b4/bbr br bWarning/b: Supplied argument is not a valid Image resource in b../a.php/b on line b14 = ImageJPEG() what is my problem -- Best Regards Miguel Joaquim Rodrigues Loureiro -- 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 confusion
I have a file called sessionvars.php that I require() as the very first thing on all my pages, it has session_register(blah...) and about 40 or 50 variable names after that. sometimes I am seeing behavior where a form on one page that references a session variable doesn't carry over the change to the next page. in other words, i filled in a username in a form on page 1, hit submit, got to page 2 and it was remembered. but now i go back to page 1, change the value in the form, and when i get to page 2 it has the old value, not the new value! i have the following options in my apache config: php_value session.save_path /home/phpsession/ php_value session.name EINFO php_value session.cookie_lifetime 2592000 php_flag register_globals on what do i have to do to get the changes to propagate through?? -jsd- -- 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] problem with ImageCreateJPEG ...
It is difficult to know where your problem is without more information. It would appear that your jpeg file is not valid. Try another .jpg file. Post the problem code, too. Hello all, anyone can help me in line command to configure php : './configure' '--with-mysql' '--with-apache=/usr/src/packages/SOURCES/apache_1.3.9/' '--with-zlib-dir=/usr/src/packages/SOURCES/zlib/' '--with-png-dir=/usr/src/packages/SOURCES/libpng/' '--with-jpeg-dir=/usr/src/packages/SOURCES/jpeg-6b/' '--with-gd=/usr/src/packages/SOURCES/gd' '--enable-track-vars' in result of phpinfo() : gd GD Support enabled GD Version 1.6.2 or higher JPG Support enabled PNG Support enabled WBMP Support enabled zlib ZLib Support enabled 'zlib:' fopen wrapper enabled Compiled Version 1.1.3 Linked Version 1.1.3 ,but when use ImageCreateFromJPEG: br bWarning/b: imagecreatefromjpeg: .../testout.jpg' is not a valid JPEG file in b../a.php/b on line b4/bbr br bWarning/b: Supplied argument is not a valid Image resource in b../a.php/b on line b14 = ImageJPEG() what is my problem -- Best Regards Miguel Joaquim Rodrigues Loureiro -- 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] -- Jim Musil - Multimedia Programmer Nettmedia - 212-629-0004 [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[2]: [PHP] Re: Something wrong with the file() command.
Hello Valentin, Hehe, Valentin. Send my regards to beloved Zaporozhye and it's ppl :) Haven't been there for ages. Eh... VVP Try this: VVP ?php VVP echo pre; VVP print_r ($temp); VVP echo /pre; ? VVP and look for $temp content. -- Ivan 'Faeton aka xetrix' Danishevsky ICQ(240266) [EMAIL PROTECTED] www.xemi.info -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Session_start() issue??
If you redirect using the full (http://foo.bar/rex...) URL, it may be restarting your session. Try using relative URLs. Hi all, Has anyone seen this. I have a login form (login.htm) which calls a login handler (check_login.php). If the login is sucessfull the check_login.php will set a couple session variables, then redirect the user to a menu page. The problem I am seeing is that when I call session_start() from the menu page, I get a new session reference rather than a reference to the session I started in the check_login.php. Is there a setting in the php.ini I should change? Any thoughts would be greatly appreciated. Chris -- 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] -- Jim Musil - Multimedia Programmer Nettmedia - 212-629-0004 [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] Session_start() issue??
Also read about session management at http://php.net/session Hi all, Has anyone seen this. I have a login form (login.htm) which calls a login handler (check_login.php). If the login is sucessfull the check_login.php will set a couple session variables, then redirect the user to a menu page. The problem I am seeing is that when I call session_start() from the menu page, I get a new session reference rather than a reference to the session I started in the check_login.php. Is there a setting in the php.ini I should change? Any thoughts would be greatly appreciated. Chris -- 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] -- Jim Musil - Multimedia Programmer Nettmedia - 212-629-0004 [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] wordwrap
Hey Hey! I've got a question about wordwrap. It seems that when I run this on a string that contains spaces, if my replacement string happens to fall on a space, the space is removed completely from the string. This isn't good :-\ Any way around this? Thanks! - Scott -- 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] Duplicating a mySQL row
What's the best way to duplicate a mysql row with PHP and MYSQL? -- Jim Musil - Multimedia Programmer Nettmedia - 212-629-0004 [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: Duplicating a mySQL row
I don't know if it is the best but here's an idea: INSERT INTO table SELECT ha, he, hi, ho, hu FROM table LIMIT 1; -- Julio Nobrega Don't eat the yellow snow. Jim [EMAIL PROTECTED] wrote in message news:p0510100fb8318736de56@[192.168.1.17]... What's the best way to duplicate a mysql row with PHP and MYSQL? -- Jim Musil - Multimedia Programmer Nettmedia - 212-629-0004 [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: Session confusion
Jon Drukman [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... sometimes I am seeing behavior where a form on one page that references a session variable doesn't carry over the change to the next page. i just figured this out from reading the user comments at php.net. form posted variables don't automatically override session vars. so i added a loop at the top of each page which overwrites all session vars from posted form vars. unfortunately if you go straight to one of the middle pages (this is a 6 page form) you wind up wiping out whatever is recorded on that page. i'll figure out something i hope... -jsd- -- 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: Duplicating a mySQL row
It appears that this is forbidden ... From mysql.com: The target table of the INSERT statement cannot appear in the FROM clause of the SELECT part of the query because it's forbidden in ANSI SQL to SELECT from the same table into which you are inserting. (The problem is that the SELECT possibly would find records that were inserted earlier during the same run. When using sub-select clauses, the situation could easily be very confusing!) I don't know if it is the best but here's an idea: INSERT INTO table SELECT ha, he, hi, ho, hu FROM table LIMIT 1; -- Julio Nobrega Don't eat the yellow snow. Jim [EMAIL PROTECTED] wrote in message news:p0510100fb8318736de56@[192.168.1.17]... What's the best way to duplicate a mysql row with PHP and MYSQL? -- Jim Musil - Multimedia Programmer Nettmedia - 212-629-0004 [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] -- Jim Musil - Multimedia Programmer Nettmedia - 212-629-0004 [EMAIL PROTECTED]
[PHP] Uploading to Apache server from VB
Hello, I have a VB program which can download files from a web-site. The webserver is running Apache where we use PHP scripting. That is all working OK. Now I want to let certain people upload data from their PC's. I don't want to use FTP, because I don't want to hand out password's (also not in the code we are distributing). Anonymous FTP is not possible. I can upload files to the site from a browser, but I would to make it (very) easy for people to upload their data: a number of them are not very familiar with computers. I have seen (www.google.com) references to uploading from VB to IIS servers, but how about to Apache/PHP? I've tried some examples with the MicroSoft Internet Control and executing the POST command, but the file would not be uploaded (the PHP script did not get it anyway). Should it be possible? If so, can somebody point in the right direction/example? If not, could somebody please explain why not? Thanks in advance for your help, henk sandkuyl -- 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: Duplicating a mySQL row
Well, I skiped this manual part :-) Maybe the simple select and insert is the simplest form. -- Julio Nobrega Don't eat the yellow snow. Jim [EMAIL PROTECTED] wrote in message news:p05101010b8318afec141@[192.168.1.17]... It appears that this is forbidden ... From mysql.com: The target table of the INSERT statement cannot appear in the FROM clause of the SELECT part of the query because it's forbidden in ANSI SQL to SELECT from the same table into which you are inserting. (The problem is that the SELECT possibly would find records that were inserted earlier during the same run. When using sub-select clauses, the situation could easily be very confusing!) -- 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] Uploading to Apache server from VB
http://www.php.net/manual/en/features.file-upload.php I've done this successfully both with PHP and VB/ASP. I think PHP is the easiest, but there are several things that could go wrong. There is usually a 2MB limit to the file size and the safe mode setting also affects the outcome. On the HTML side, you must include ENCTYPE=multipart/form-data in your form tag. Once the file is uploaded (you can verify through phpinfo() command) you have to move it someplace. This can be tricky depending on how your server is set up. As a security, some servers do not allow scripts to save files. One solution is to have your script open an ftp socket and put the file in the right place. This way, the script has the ftp password which should be kept secret from the user. Hello, I have a VB program which can download files from a web-site. The webserver is running Apache where we use PHP scripting. That is all working OK. Now I want to let certain people upload data from their PC's. I don't want to use FTP, because I don't want to hand out password's (also not in the code we are distributing). Anonymous FTP is not possible. I can upload files to the site from a browser, but I would to make it (very) easy for people to upload their data: a number of them are not very familiar with computers. I have seen (www.google.com) references to uploading from VB to IIS servers, but how about to Apache/PHP? I've tried some examples with the MicroSoft Internet Control and executing the POST command, but the file would not be uploaded (the PHP script did not get it anyway). Should it be possible? If so, can somebody point in the right direction/example? If not, could somebody please explain why not? Thanks in advance for your help, henk sandkuyl -- 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] -- Jim Musil - Multimedia Programmer Nettmedia - 212-629-0004 [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] Session_start() issue??
Hi Jim, Thanks for you replies. I was using relative paths and still I got the seperate sessions being opened. The interesting part was this was only happening on my dev machine (win32), when I moved the files to a Linux box, I did not have the same problem. Must be something in the IIS or PHP.INI on the dev box I guess. Thanks again. Chris -- 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] newbie: Supplied argument is not a valid MySQL result..?
Hi, I wonder if someone could point out what is wrong with the following piece of code (taken directly from the 'PHP - fast easy web development' book) , which gives the following warning : Warning: Supplied argument is not a valid MySQL result resource in c:\program files\apache group\apache\htdocs\cms\pick_modcontact.php on line 23 -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= $result = mysql_query($sql,$connection);--line 23 while ($row = mysql_fetch_array($result)) { $id = $row['id']; $fname = $row['fname']; $lname = $row['lname']; $option_block .= option value=\$id\$lname, $fname/option; } -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= The mySQL query that is executed returns a result set when I use the mySQL shell, and the connection string is valid. If someone could advise me as to the error, I would greatly appreciate it. - Best regards, Lee -- 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: Supplied argument is not a valid MySQL result..?
No reply required; I see the problem. -- 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 urlencode to pass varfiables in a URL
Is there a limit to the number of variables once can pass in a URL using urlencode()? I seem to be hitting a wall where the browser returns a page not found once I go past a limit and I can't find any bugs in the code. Thanks, Don
[PHP] Zend Encoder
Hi, My company is looking into using the Zend Encoder to enforce licensing of some tools that I'm developing and I have a few questions that I hope someone who's used it can answer: 1) I understand that when you encode your files, they will stop working when the zend license expires. how easy is it to get them working again after you renew? do the pages need to be re-encoded from source? 2) Will files encoded on a windows machine run on linux with the zend optimizer? 3) are there any known problems with certain php modules (ming, gd, mcal) 4) are there competing products I should be looking at? thanks, - 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] Using urlencode to pass varfiables in a URL
There is a limit to the size of a GET request - can't remember what it is though POST's can be any size however. Maybe a search of the RFC's might tell you the limit of GET's http://sunsite.dk/RFC/ -Original Message- From: Don [mailto:[EMAIL PROTECTED]] Sent: Tuesday, December 04, 2001 9:03 AM To: php list Subject: [PHP] Using urlencode to pass varfiables in a URL Is there a limit to the number of variables once can pass in a URL using urlencode()? I seem to be hitting a wall where the browser returns a page not found once I go past a limit and I can't find any bugs in the code. Thanks, Don
[PHP] RE: MySQL ORDER BY or PHP Sort?
SELECT * FROM mytable ORDER BY series,price; -Original Message- From: René Fournier [mailto:[EMAIL PROTECTED]] Sent: Monday, December 03, 2001 4:27 PM To: [EMAIL PROTECTED] Subject: MySQL ORDER BY or PHP Sort? I want to select about 25 rows from a table, and sort them by two criteria. First, by each row's Series field (Baby, Genesis, Super, Predator, Millennium are the various Series, and the order I'd like the rows in the array). Within each Series, I'd like the rows sorted by their Price field, ascending. For example: Baby $5 Baby $10 Baby $15 Genesis $20 Genesis $35 Genesis $50 ...and so on. Now, I know how to structure my MySQL Select statment such that the rows it pulls from the table will be either sorted by Price OR by Series, but not both, in the way I'd like. Does anyone know if it's possibly to do this in the Select statement itself? (I'd rather do it that way, than resort in PHP.) Thanks! ...Rene --- René Fournier [EMAIL PROTECTED] - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php -- 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: MySQL ORDER BY or PHP Sort?
Don't forget LIMIT 0,25 (I want to select about 25 rows from a table...) SELECT * FROM mytable ORDER BY series,price LIMIT 0,25 Mike Rick Emery wrote: SELECT * FROM mytable ORDER BY series,price; -Original Message- From: René Fournier [mailto:[EMAIL PROTECTED]] Sent: Monday, December 03, 2001 4:27 PM To: [EMAIL PROTECTED] Subject: MySQL ORDER BY or PHP Sort? I want to select about 25 rows from a table, and sort them by two criteria. First, by each row's Series field (Baby, Genesis, Super, Predator, Millennium are the various Series, and the order I'd like the rows in the array). Within each Series, I'd like the rows sorted by their Price field, ascending. For example: Baby $5 Baby $10 Baby $15 Genesis $20 Genesis $35 Genesis $50 ...and so on. Now, I know how to structure my MySQL Select statment such that the rows it pulls from the table will be either sorted by Price OR by Series, but not both, in the way I'd like. Does anyone know if it's possibly to do this in the Select statement itself? (I'd rather do it that way, than resort in PHP.) Thanks! ...Rene --- René Fournier [EMAIL PROTECTED] - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php -- 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 3 Dec 2001 22:35:43 -0000 Issue 1031
php-general Digest 3 Dec 2001 22:35:43 - Issue 1031 Topics (messages 76371 through 76425): Re: best way to handle a form with 60 fields !!! 76371 by: Remigiusz Sokolowski P3P Implementation and PHP-Sessions 76372 by: Bruno Baketaric Re: call_user_func problem 76373 by: Bruno Baketaric howto run shell script 76374 by: Danar Prabandaru 76383 by: Steve Werby variable scope / preg_replace_callback question 76375 by: Peter Bowyer 76376 by: Andrey Hristov Multiple database seeking 76377 by: Alen Nonkoviè 76380 by: Miles Thompson 76381 by: Valentin V. Petruchek 3000 Would you like to lose weight while you sleep? 4537552 76378 by: 5245375travelincentives.aol.com Re: php without the php.ini 76379 by: Erik Price Re: How to set file extension php Mac OSX and PHP 4.0.6 76382 by: Erik Price 76385 by: Stefan Rusterholz Some clients can't see PDF 76384 by: Miles Thompson which merchant account 76386 by: Daniel Guerrier PHP problem with freetype 76387 by: MDowling.hew.de Something wrong with the file() command. 76388 by: Jose 76396 by: Fred 76398 by: Mark Charette 76399 by: Valentin V. Petruchek 76404 by: faeton Re: problems with looping array 76389 by: Jim Musil Re: PHP Bulletin Boards...how they work. 76390 by: Jonathan Chum ereg help 76391 by: Valentin V. Petruchek 76392 by: Jim Musil RealMedia 76393 by: Randum Ian 76394 by: Jim Musil Anyone got PHP to work under RedHat 7.2 76395 by: Hai Nguyen 76397 by: Mark Charette Session_start() issue?? 76400 by: Chris Seymour 76405 by: Jim Musil 76406 by: Jim Musil 76417 by: Chris Seymour problem with ImageCreateJPEG ... 76401 by: Miguel Loureiro 76403 by: Jim Musil Session confusion 76402 by: Jon Drukman 76410 by: Jon Drukman wordwrap 76407 by: Scott Aikin Duplicating a mySQL row 76408 by: Jim Musil 76409 by: Julio Nobrega Trabalhando 76411 by: Jim Musil 76413 by: Julio Nobrega Trabalhando Uploading to Apache server from VB 76412 by: Henk Sandkuyl 76414 by: Jim Musil The Truth Told! 76415 by: DSTRONGZ.aol.com 76416 by: Julio Nobrega Trabalhando Mass Mailing 76418 by: Nathan Cavicchi newbie: Supplied argument is not a valid MySQL result..? 76419 by: Lee Philip Reilly 76420 by: Lee Philip Reilly Using urlencode to pass varfiables in a URL 76421 by: Don 76423 by: Martin Towell Zend Encoder 76422 by: Mark Re: MySQL ORDER BY or PHP Sort? 76424 by: Rick Emery 76425 by: Mike Eheler 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--- Krzysztof Kocjan wrote: Fred wrote: Third, it is ineffecient and unneccessary to put 60 fields in a single form. If you are using the GET method it probably will not work since it passes the variable names and values in the URL, which has a maximum length of 255 In my mind maximum length 255 is not true. There isn't any limit for GET/POST requests as I read in RFC documents. The limit depends on Your web server implementation. I've never tested but suppose Apache could handle GET method with URL longer than 255 characters. I've never had problems with form's data length using Apache and GET/POST methods. But if I'm wrong I apologize. This depends also on Your browser of course. AFAIK GET is OK for data up to 8kB, POST can be used for much bigger data -- ---/\-- Remigiusz Sokolowski e-mail: [EMAIL PROTECTED]/ \ -/\- ---End Message--- ---BeginMessage--- Hi, I assume everyone has heard of P3P (Platform for Privacy Preferences), so I'll skip explaining in detail what it is. If you don't know, just skip this message *g*. I've got one Problem with this, and PHP may solve it: P3P has absolutely no Application-Server/Scripting support. It's just a simple XML-File that tells the User what (personal) data the Website collects, and is Requested with hard-coded relative URL's. Assume a PHP Website with URL-based Session's. A User Request the Homepage (/index.phtml) - he's anonymous, collected data is anonymous. The (static) P3P File tells the User that the collected data is anon. Well, now the User logs-in via a Form-Submit and reloads the Page (/index.phtml). The information is set in the PHP-Session, the User is shown other
Re: [PHP] Mass Mailing
OK Nathan, I have a couple of scripts that will do the job for you, if you are interested! Web inventor Michael Cronstrom At 22:51 02/12/01, you wrote: I started writing a set of scripts that would send out mutiple emails to a list of customers. I then realized that most likely this program, and/or snipits had most likely already been written. If so, can some one point me in the right direction and save me 3 or 4 days? Thanks Nathan Webmaster M-Y Communications -- 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] php_xmldom.dll
I have a problem with this dll, the dll exists on my hd and php does not load it. I have win2k pro with iis5, has anyone any kind of solutions ? Every morning is the dawn of a new error... narcotic
Re: [PHP] newbie: Supplied argument is not a valid MySQL result..?
On Tue, 4 Dec 2001 08:29, Lee Philip Reilly wrote: Hi, I wonder if someone could point out what is wrong with the following piece of code (taken directly from the 'PHP - fast easy web development' book) , which gives the following warning : Warning: Supplied argument is not a valid MySQL result resource in c:\program files\apache group\apache\htdocs\cms\pick_modcontact.php on line 23 -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= $result = mysql_query($sql,$connection);--line 23 Use mysql_error() here to return the error string from mysql, which will tell you more about your problem; it will be in the code before line 23 while ($row = mysql_fetch_array($result)) { Using extract($row) here will save you typing :-) $id = $row['id']; $fname = $row['fname']; $lname = $row['lname']; $option_block .= option value=\$id\$lname, $fname/option; } -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= The mySQL query that is executed returns a result set when I use the mySQL shell, and the connection string is valid. If someone could advise me as to the error, I would greatly appreciate it. - Best regards, Lee -- David Robley Techno-JoaT, Web Maintainer, Mail List Admin, etc CENTRE FOR INJURY STUDIES Flinders University, SOUTH AUSTRALIA He who always plows a straight furrow is in a rut. -- 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 LDAP
hi there.. i'm succesfully add ldap entry(jpegphoto) using PHP via below codes.. but failed to modify it.. any ideas? ADD LDAP ENTRY VIA PHP $userfile = addpicture.jpg; $fd = fopen ($userfile, r); $fsize = filesize ($userfile); $jpegStr = fread ($fd, $fsize); fclose ($fd); $ds = ldap_connect(localhost); $r= ldap_add($ds, uid=$uid,dc=orenda,dc=com, array(objectclass = inetorgperson, cn= $cn, uid = $uid, jpegphoto = $jpegStr ) ); MODIFY LDAP ENTRY VIA PHP $userfile = modifypic.jpg; $fd = fopen ($userfile, r); $fsize = filesize ($userfile); $jpegStr = fread ($fd, $fsize); fclose ($fd); $ds = ldap_connect(localhost); $bindp = secret; $bindn = uid=admin, dc=orenda, dc=com; ldap_bind($ds,$bindn,$bindp); $dn = uid= . $uid . , .dc=orenda, dc=com; $info['cn']=$cn; $info['jpegphoto']=$jpegStr; $info['objectclass']=person; if (count ($info) != 0) $r = ldap_modify ($ds, $dn, $info); -- 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] Multidimensional array construction
Here's a question for the list: I have a two-dimensional array; essentially a list of arrays. Each element (an array) can have any number of elements. As a small example: ( ( foo , bar , red , apple ), ( foo , bar , red , car), ( foo , green ) ) I would like to traverse this array and place all of the data into another multidimensional array. The following statements illustrate how I'd like to do this from the example: $myarray[foo][bar][red][apple] = $some_value1; $myarray[foo][bar][red][car] = $some_value2; $myarray[foo][green] = $some_value3; Is there any way to easily do this in PHP? I could cheat and use eval(), but there is probably a better way. I have thought of using each() or references, but nothing has come to mind so far. Any ideas? Should I just use eval() ? Darren Gamble Planner, Regional Services Shaw Cablesystems GP 630 - 3rd Avenue SW Calgary, Alberta, Canada T2P 4L4 (403) 781-4948 -- 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] Why are slashes automatically stripped from db result?
Hey all. I'm storing some jpeg images in a mysql database using the PEAR classes. Before inserting the image into the db I call addslashes() on the data, I was, accordingly, calling stripslashes() on the data after pulling the image back out of the database, but the image was getting mangled. I finally realized that the slashes were already stripped from my query results so stripping them again was removing legitimate slashes. The question is: why are the slashes already stripped out of the db results? I call set_magic_quotes_runtime(0) at the beginning of the scripts to turn off magic quoting. What else would cause this? Thanks for any suggestions. -Steve -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Problem with round
Hi to all: I can't understand, but i have a simple problem with round. I use the function round($value,2) to round a number with 2 decimals. But when i put the result in the screen, if $value don't have more or equal than 2 decimal numbers, the result only have one o none decimals. I do some examples, but not work correctly. Can someone help me. Thanks. Best Regards, Diego
RE: [PHP] Multidimensional array construction
I was thinking that you could use a pointer to var, eg: $var = 'myarray[foo][bar][red][apple]'; // this would obviously be created dynamically, hard coded for testing $$var = $some_value1; echo $myarray[foo][bar][red][apple]; but when I tried it, it didn't work :( looks like eval() to the rescue... -Original Message- From: Darren Gamble [mailto:[EMAIL PROTECTED]] Sent: Tuesday, December 04, 2001 10:37 AM To: PHP List Subject: [PHP] Multidimensional array construction Here's a question for the list: I have a two-dimensional array; essentially a list of arrays. Each element (an array) can have any number of elements. As a small example: ( ( foo , bar , red , apple ), ( foo , bar , red , car), ( foo , green ) ) I would like to traverse this array and place all of the data into another multidimensional array. The following statements illustrate how I'd like to do this from the example: $myarray[foo][bar][red][apple] = $some_value1; $myarray[foo][bar][red][car] = $some_value2; $myarray[foo][green] = $some_value3; Is there any way to easily do this in PHP? I could cheat and use eval(), but there is probably a better way. I have thought of using each() or references, but nothing has come to mind so far. Any ideas? Should I just use eval() ? Darren Gamble Planner, Regional Services Shaw Cablesystems GP 630 - 3rd Avenue SW Calgary, Alberta, Canada T2P 4L4 (403) 781-4948 -- 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] Why are slashes automatically stripped from db result?
maybe mysql is stripping the slashes and not php ?? -Original Message- From: Steve Cayford [mailto:[EMAIL PROTECTED]] Sent: Tuesday, December 04, 2001 10:57 AM To: [EMAIL PROTECTED] Subject: [PHP] Why are slashes automatically stripped from db result? Hey all. I'm storing some jpeg images in a mysql database using the PEAR classes. Before inserting the image into the db I call addslashes() on the data, I was, accordingly, calling stripslashes() on the data after pulling the image back out of the database, but the image was getting mangled. I finally realized that the slashes were already stripped from my query results so stripping them again was removing legitimate slashes. The question is: why are the slashes already stripped out of the db results? I call set_magic_quotes_runtime(0) at the beginning of the scripts to turn off magic quoting. What else would cause this? Thanks for any suggestions. -Steve -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] Problem with round
to print two decimal points always, use : printf(%.2f,$value); round() just rounds the number and doesn't store extra zeros. -Original Message- From: Diego Pérez [mailto:[EMAIL PROTECTED]] Sent: Tuesday, December 04, 2001 11:06 AM To: [EMAIL PROTECTED] Subject: [PHP] Problem with round Hi to all: I can't understand, but i have a simple problem with round. I use the function round($value,2) to round a number with 2 decimals. But when i put the result in the screen, if $value don't have more or equal than 2 decimal numbers, the result only have one o none decimals. I do some examples, but not work correctly. Can someone help me. Thanks. Best Regards, Diego
Re: [PHP] Why are slashes automatically stripped from db result?
I believe you're correct Martin. I think newer versions of MySQL automatically strip them out. Just use php's stripslashes() and addslashes() functions when you need them. Good luck Steve, Tyler Longren - Original Message - From: Martin Towell [EMAIL PROTECTED] To: 'Steve Cayford' [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Monday, December 03, 2001 6:04 PM Subject: RE: [PHP] Why are slashes automatically stripped from db result? maybe mysql is stripping the slashes and not php ?? -Original Message- From: Steve Cayford [mailto:[EMAIL PROTECTED]] Sent: Tuesday, December 04, 2001 10:57 AM To: [EMAIL PROTECTED] Subject: [PHP] Why are slashes automatically stripped from db result? Hey all. I'm storing some jpeg images in a mysql database using the PEAR classes. Before inserting the image into the db I call addslashes() on the data, I was, accordingly, calling stripslashes() on the data after pulling the image back out of the database, but the image was getting mangled. I finally realized that the slashes were already stripped from my query results so stripping them again was removing legitimate slashes. The question is: why are the slashes already stripped out of the db results? I call set_magic_quotes_runtime(0) at the beginning of the scripts to turn off magic quoting. What else would cause this? Thanks for any suggestions. -Steve -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP 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] Why are slashes automatically stripped from db result?
It's been my experience that there is no need for calling stripslashes when pulling the data out of the database. This is probably an effect of having magic_quotes_runtime off. Mike Martin Towell wrote: maybe mysql is stripping the slashes and not php ?? -Original Message- From: Steve Cayford [mailto:[EMAIL PROTECTED]] Sent: Tuesday, December 04, 2001 10:57 AM To: [EMAIL PROTECTED] Subject: [PHP] Why are slashes automatically stripped from db result? Hey all. I'm storing some jpeg images in a mysql database using the PEAR classes. Before inserting the image into the db I call addslashes() on the data, I was, accordingly, calling stripslashes() on the data after pulling the image back out of the database, but the image was getting mangled. I finally realized that the slashes were already stripped from my query results so stripping them again was removing legitimate slashes. The question is: why are the slashes already stripped out of the db results? I call set_magic_quotes_runtime(0) at the beginning of the scripts to turn off magic quoting. What else would cause this? Thanks for any suggestions. -Steve -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] Multidimensional array construction
This might be interesting ... The function extract() allows you to extract all values from an array and prefix them with a specified string. What I didn't know until just a second ago was that you can supply a function as a string, so ... $my_array = array(a,b,c,d,array(a,b,c,d)); $i = 1; extract($my_array,EXTR_PREFIX_ALL,SOMEVAL.$i++); print pre; print $SOMEVAL_1; print $SOMEVAL_2; print $SOMEVAL_3; print $SOMEVAL_4; print $SOMEVAL_5; print /pre; ... will produce: a b c d [Array] Which is cool. Not quite what you wanted, but maybe you could run with it. Jim -Original Message- From: Darren Gamble [mailto:[EMAIL PROTECTED]] Sent: Tuesday, December 04, 2001 10:37 AM To: PHP List Subject: [PHP] Multidimensional array construction Here's a question for the list: I have a two-dimensional array; essentially a list of arrays. Each element (an array) can have any number of elements. As a small example: ( ( foo , bar , red , apple ), ( foo , bar , red , car), ( foo , green ) ) I would like to traverse this array and place all of the data into another multidimensional array. The following statements illustrate how I'd like to do this from the example: $myarray[foo][bar][red][apple] = $some_value1; $myarray[foo][bar][red][car] = $some_value2; $myarray[foo][green] = $some_value3; Is there any way to easily do this in PHP? I could cheat and use eval(), but there is probably a better way. I have thought of using each() or references, but nothing has come to mind so far. Any ideas? Should I just use eval() ? Darren Gamble Planner, Regional Services Shaw Cablesystems GP 630 - 3rd Avenue SW Calgary, Alberta, Canada T2P 4L4 (403) 781-4948 -- 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] -- Jim Musil - Multimedia Programmer Nettmedia - 212-629-0004 [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] Multidimensional array construction
oops. That's not correct. I wish it was though! ;) This might be interesting ... The function extract() allows you to extract all values from an array and prefix them with a specified string. What I didn't know until just a second ago was that you can supply a function as a string, so ... $my_array = array(a,b,c,d,array(a,b,c,d)); $i = 1; extract($my_array,EXTR_PREFIX_ALL,SOMEVAL.$i++); print pre; print $SOMEVAL_1; print $SOMEVAL_2; print $SOMEVAL_3; print $SOMEVAL_4; print $SOMEVAL_5; print /pre; ... will produce: a b c d [Array] Which is cool. Not quite what you wanted, but maybe you could run with it. Jim -Original Message- From: Darren Gamble [mailto:[EMAIL PROTECTED]] Sent: Tuesday, December 04, 2001 10:37 AM To: PHP List Subject: [PHP] Multidimensional array construction Here's a question for the list: I have a two-dimensional array; essentially a list of arrays. Each element (an array) can have any number of elements. As a small example: ( ( foo , bar , red , apple ), ( foo , bar , red , car), ( foo , green ) ) I would like to traverse this array and place all of the data into another multidimensional array. The following statements illustrate how I'd like to do this from the example: $myarray[foo][bar][red][apple] = $some_value1; $myarray[foo][bar][red][car] = $some_value2; $myarray[foo][green] = $some_value3; Is there any way to easily do this in PHP? I could cheat and use eval(), but there is probably a better way. I have thought of using each() or references, but nothing has come to mind so far. Any ideas? Should I just use eval() ? Darren Gamble Planner, Regional Services Shaw Cablesystems GP 630 - 3rd Avenue SW Calgary, Alberta, Canada T2P 4L4 (403) 781-4948 -- 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] -- Jim Musil - Multimedia Programmer Nettmedia - 212-629-0004 [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] -- Jim Musil - Multimedia Programmer Nettmedia - 212-629-0004 [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] Multidimensional array construction
I did something like this recently. Here's how I did it: $some_value1 = 'Hello World'; $myarray['foo']['bar']['green']['apple'] = $some_value1; function get_opt($arr, $keys,$sep=':') { $var = $arr; $tmp = split($sep,$keys); foreach ($tmp as $k = $v) { $var = $var[$v]; } if (isset($var)) return $var; return ''; } echo get_opt($myarray, 'foo:bar:green:apple'); It needs refining, but it should do the job. That's entirely from memory, mind you.. it should work, though. Mike Martin Towell wrote: I was thinking that you could use a pointer to var, eg: $var = 'myarray[foo][bar][red][apple]'; // this would obviously be created dynamically, hard coded for testing $$var = $some_value1; echo $myarray[foo][bar][red][apple]; but when I tried it, it didn't work :( looks like eval() to the rescue... -Original Message- From: Darren Gamble [mailto:[EMAIL PROTECTED]] Sent: Tuesday, December 04, 2001 10:37 AM To: PHP List Subject: [PHP] Multidimensional array construction Here's a question for the list: I have a two-dimensional array; essentially a list of arrays. Each element (an array) can have any number of elements. As a small example: ( ( foo , bar , red , apple ), ( foo , bar , red , car), ( foo , green ) ) I would like to traverse this array and place all of the data into another multidimensional array. The following statements illustrate how I'd like to do this from the example: $myarray[foo][bar][red][apple] = $some_value1; $myarray[foo][bar][red][car] = $some_value2; $myarray[foo][green] = $some_value3; Is there any way to easily do this in PHP? I could cheat and use eval(), but there is probably a better way. I have thought of using each() or references, but nothing has come to mind so far. Any ideas? Should I just use eval() ? Darren Gamble Planner, Regional Services Shaw Cablesystems GP 630 - 3rd Avenue SW Calgary, Alberta, Canada T2P 4L4 (403) 781-4948 -- 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] ereg help
Something like this will work: eregi(^id \{([a-z]*),([a-z]+),([a-z]+)\} \[(.+)\]$, $str, $regs); $regs will be an array containing: [0] = id {name,title,nick} [http://www.php.net]; [1] = name [2] = title [3] = nick [4] = http://www.php.net; If course this isn't very foolproof or generic. For instance, this regex assumes that you have exactly three comma-delimited substrings between those curly braces and anything goes in the brackets. (It could be a URL, but it could also be anything else.) This is assuming there are three items between those curly braces, however. To handle multiple configurations within the curly braces, you'd probably, as the boundaries would cause items in the array to be overwritten during matching. Something like this may work half-decent... if (eregi((id) \{(.*)\} \[(.*)\]$, $str, $regs)) { $p[0] = $regs[1]; $p[1] = explode(,, $regs[2]); $p[2] = $regs[3]; } $p should now look like the following: [0] = id [1][0] = name [1][1] = title [1][2] = nick ) [2] = http://www.php.net; That should do it. Of course, the regex again isn't foolproof, as you could have crazy stuff for a URL, and it doesn't bother to check if there's anything after a comma in the curly braces, but will handle any number of items between the braces, and it's enough to get you started. J Valentin V. Petruchek wrote: - Original Message - From: Valentin V. Petruchek [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Monday, December 03, 2001 6:35 PM Subject: [PHP] ereg help I'm not new for php, but have no experience working with ereg functions. My problem is the following: i have string.. for example $s=id {name,title,nick} [http://www.php.net];; i want to break it in several parts: $p[0]=id; $p[1][0] =name; $p[1][1] =title; $p[1][2] =nick; $p[2]=http://www.php.net;; The part in [] is not neccessary, count of {} elements is not less than 1 I can do it with string fucntions, but it seemes to me it's better to use regular functions. Could anybody help me to solve this problem and advise resource for studying regular expresions? Zliy Pes, http://zliypes.com.ua -- 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] Running a perl script from PHP
echo system(perl /usr/local/site/domain.com/cgi-bin/script.pl -c test -cname testname -passwd testword); That's my code, however it does nothing. No feedback from the echo, no actions, nothing. I've also tried exec(), but again, no luck. When I run exactly the same code from the command line, it runs fine, and says Done. in the command line. Any ideas? -- 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] Pull from mysql_fetch_array at a given time
I'm trying to pull three results from a database and then display them in a page. The HTML is clugey so I would like to place print statements in three different places, rather then in a while loop and try and rewrite the HTML for each item. So far I have; $gethot_query = SELECT title FROM events WHERE status = 'hot' ORDER BY date; $gethot_result = mysql_query ($gethot_query) or die (Cannot get hot items!); $gethot_row = mysql_fetch_array ($gethot_result); ? tr td colspan=7 valign=top bgcolor=#FFE49A class=hotheadlines pbr ? print ($gethot_row[1]); ?/p I know I'm not calling the print statement correctly but hopefully you get the idea. I would like to add ? print ($gethot_row[1]); ? for the first item. ? print ($gethot_row[2]); ? for the second ? print ($gethot_row[1]); ? for the third. Am I approaching this from the wrong way? Thanks, Tom -- 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] Taking PHP out of safe mode - for one domain/user
How on earth do you do it? I know how to do it completely (php.ini), but I need to keep PHP in safe mode for all the other users. -- 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] Pull from mysql_fetch_array at a given time
On Tue, 4 Dec 2001 11:30, Tom Beidler wrote: I'm trying to pull three results from a database and then display them in a page. The HTML is clugey so I would like to place print statements in three different places, rather then in a while loop and try and rewrite the HTML for each item. So far I have; $gethot_query = SELECT title FROM events WHERE status = 'hot' ORDER BY date; $gethot_result = mysql_query ($gethot_query) or die (Cannot get hot items!); $gethot_row = mysql_fetch_array ($gethot_result); ? tr td colspan=7 valign=top bgcolor=#FFE49A class=hotheadlines pbr ? print ($gethot_row[1]); ?/p I know I'm not calling the print statement correctly but hopefully you get the idea. I would like to add ? print ($gethot_row[1]); ? for the first item. ? print ($gethot_row[2]); ? for the second ? print ($gethot_row[1]); ? for the third. Am I approaching this from the wrong way? Thanks, Tom First, I suspect that your query might fail, as you are attempting to sort by a filed you haven't selected. On to the meat of your question: I think you misunderstand how mysql_fetch_array works - it only fetches an array of the current record returned from the database, not an array with all the records found. What you might consider doing is retrieving all the records into an array, then displaying the elements of the array where you need them. Assuming that you are only interested in the filed 'title', something like this might do the job: $gethot_result = mysql_query ($gethot_query) or die (Cannot get hot items! Error: . mysql_error()); while ($gethot_row = mysql_fetch_array ($gethot_result)) { extract($gewthot_row); $your_array[] = $title; } and here you have all the values of title in $your_array. -- David Robley Techno-JoaT, Web Maintainer, Mail List Admin, etc CENTRE FOR INJURY STUDIES Flinders University, SOUTH AUSTRALIA This tagline will reformat your hard drive in 1.5 seconds! -- 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] odrer by alphabet
hi, i have about 100 names in my database. How should i list them by alphabet. 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]
RE: [PHP] odrer by alphabet
You can simply order by that field in your SQL string...ie: SELECT * FROM TABLENAME ORDER BY FIELDNAME; And to switch the order: SELECT * FROM TABLENAME ORDER BY FIELDNAME DESC; -Original Message- From: Rambo Amadeus [mailto:[EMAIL PROTECTED]] Sent: Tuesday, 4 December 2001 1:15 PM To: [EMAIL PROTECTED] Subject: [PHP] odrer by alphabet hi, i have about 100 names in my database. How should i list them by alphabet. Thanks -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Parsing RSS
Hi to all Does anyone know of any good books or online tutorials on parsing RSS feeds with PHP (or parsing XML in general in PHP)? Tom Malone Web Designer http://www.tom-malone.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] howto run shell script
On Mon, 3 Dec 2001 20:46:06 +0700 Danar Prabandaru [EMAIL PROTECTED] mentioned: $command=/path/to/my/script.sh; exec($command); hello php-general, how do I run a shell script from PHP web interface?? assume /path/to/my/script.sh as the path and the owner and group of this script are belong to apache Regards, -- Danar PrObOndaru -- -- 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] -- -=-=-=-=-=-=-=-=-=-=-=-=- Michael A. Peters http://24.5.29.77:10080/ -- 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] Multiple database seeking
Something like this for the SQL SELECT ( t1.price + t2.price ) as total FROM table t1, table t2 WHERE t1.id=1 AND t2.id=5; Jason Lotito [EMAIL PROTECTED] www.NewbieNetwork.net -Original Message- From: Alen Nonkoviè [mailto:[EMAIL PROTECTED]] Sent: Monday, December 03, 2001 9:31 AM To: [EMAIL PROTECTED] Subject: [PHP] Multiple database seeking Hello, I am trying to make a something like a cooking recipe with some calculations. My problem is too much database querying. Is it really a problem??? Let's suppose there is a table with items and prices: item1price1 item2price2 item3price3 ... Then I have to calculate some new indegrient price, which is a result of calculating other prices: (ex: $new_price1 = 2*$price1 + $price2 ) To get wanted prices I used standard query: $result = mysql_query (SELECT price from price_list where id = '01'); $row = mysql_fetch_array($result); $price1 = $row[price]; $result = mysql_query (SELECT price from price_list where id = '02'); $row = mysql_fetch_array($result); $price2 = $row[price]; //...and so on for about 30 indegrients. And on the end: $new_price1 = 2*$price1 + $price2; print $new_price1; -- But, is there a quicker way to do this? Am I doing maybe the wholistic mistake in process? Or this is just OK? Please, help cooking the soup ;) regards, Alen -- 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: Parsing RSS
Hello, Tom Malone wrote: Hi to all Does anyone know of any good books or online tutorials on parsing RSS feeds with PHP (or parsing XML in general in PHP)? You may find a few here: http://phpclasses.upperdesign.com/browse.html/class/4 Regards, Manuel Lemos -- 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: odrer by alphabet
SELECT column FROM table ORDER BY name; -- Julio Nobrega. Um dia eu chego lá: http://sourceforge.net/projects/toca Ajudei? Salvei? Que tal um presentinho? http://www.submarino.com.br/wishlistclient.asp?wlid=1767 Rambo Amadeus [EMAIL PROTECTED] wrote in message 001c01c17c69$87eab200$c181c7d9@com">news:001c01c17c69$87eab200$c181c7d9@com... hi, i have about 100 names in my database. How should i list them by alphabet. 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] URGENT-HELP !!!!!!
Hi All, Thanks very much for all who suggested ways to help me out. I sthere any better way of doing this [ please read the following ] using some code in PHP. Regards, Kumar. On Fri, 30 Nov 2001 Chamarty Prasanna Kumar wrote : Hi, Want to send mail through PHP script such that the receiver of that mail should not contain FROM header. I used mail() function with empty FROM header and even without FROM header, but the receiver is still getting FROM address as [EMAIL PROTECTED] Anyone can help Thanks in advance, Kumar. -- 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] Apache Php SSL
Hey, When rebuilding Apache/Php/Modssl etc can I re-use my existing server key and server certificate ? Do I need to get a new certificate from Thawte/Verisign even if its for the same host? Thanks, CCMA -- 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] Apache Php SSL
* Chris Allen [EMAIL PROTECTED] [Dec 03. 2001 23:09]: When rebuilding Apache/Php/Modssl etc can I re-use my existing server key and server certificate ? Do I need to get a new certificate from Thawte/Verisign even if its for the same host? As long as the cert is still valid, it should work just fine. You'll need to point your httpd.conf to the right (previous) certificates though. That is explained pretty nicely in the mod_ssl INSTALL. -- -Brian Clark -- 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] Minimum Apache CD-ROM root
Hello all, I'm writing a PHP application that will run on a cd-rom. I have two questions: 1) Apache Server I wanted to add the apache server on the disk. What are the minimum files that I need, for apache to run? i.e. apache.exe httpd.conf etc. 2) Configuration File PATH In the apache configuration file, the ServerRoot asks for a absolute path. Is there a Window's (system) Variable to shows the current directory? I'm hoping for something like ServerRoot DirPath/Apache/ So that, apache would run correctly, regardless if the CD-ROM drive is D: or F: or any other name. Any Ideas? If you have any suggestions on a small, portable, browser with PHP suport, then please let me know. Thanks in advance. __John Monfort_ _+---+_ P E P I E D E S I G N S www.pepiedesigns.com The world is waiting, are you ready? -+___+- -- 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] zip.exe files
check out the www.php.net and look into the using the header function to force the down load instead of trying to executing the file. www.php.net/header Jim - Original Message - From: AAustin [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, November 29, 2001 4:26 PM Subject: [PHP] zip.exe files Hi On the corp website we are wanting to make the zip files that clients download zip.exe self extract files. Our html a Href=filename.execlick here/a links no longer work. Now we get server error messages rather than the dialog box when the link is clicked. I think the file is trying to decompress when clicked to download. Is there a common procedure to get around this? Thanks in advance Andrew -- 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] Apache Php SSL
Ya thanks...I needed to make sure what I was reading was *what* I was reading... Thanks Again, ccma As long as the cert is still valid, it should work just fine. You'll need to point your httpd.conf to the right (previous) certificates though. That is explained pretty nicely in the mod_ssl INSTALL. -- -Brian Clark -- 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] BEST Book for Learning PHP/MySQL
I'm a PHP and MySQL beginner. What's the best book I can buy that will get me started using both these technologies? 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] The BEST Content Management Script?
Hi, I'm looking for a really good content management system written in PHP that's free or very little money. I looked on HotScripts.com, but, there are SO many of them! Can someone recommend one or two good ones? 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]
Re: [PHP] BEST Book for Learning PHP/MySQL
There's dozens upon dozens of messages in the archive about this topic, which comes up at least once per month. I believe there's also a blurb or two about PHP books on the PHP web site, php.net. Please check those resources. --kurt On Monday 03 December 2001 08:35 pm, Monty wrote: I'm a PHP and MySQL beginner. What's the best book I can buy that will get me started using both these technologies? 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]
Re: [PHP] BEST Book for Learning PHP/MySQL
Sorry, I did a search here and found only one message with book recommendations. Where's the archive? Is it a separate newsgroup? I looked on php.net, but, only found a long list of books available, no recommendations. Monty From: [EMAIL PROTECTED] (Kurt Lieber) Reply-To: [EMAIL PROTECTED] Newsgroups: php.general Date: Mon, 3 Dec 2001 20:50:29 -0800 To: [EMAIL PROTECTED] Subject: Re: [PHP] BEST Book for Learning PHP/MySQL There's dozens upon dozens of messages in the archive about this topic, which comes up at least once per month. I believe there's also a blurb or two about PHP books on the PHP web site, php.net. Please check those resources. --kurt On Monday 03 December 2001 08:35 pm, Monty wrote: I'm a PHP and MySQL beginner. What's the best book I can buy that will get me started using both these technologies? 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]
Re: [PHP] BEST Book for Learning PHP/MySQL
* Monty [EMAIL PROTECTED] [Dec 03. 2001 23:37]: I'm a PHP and MySQL beginner. What's the best book I can buy that will get me started using both these technologies? Thanks! http://www.php.net/books.php Take the time to look around the site. -- -Brian Clark -- 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] The BEST Content Management Script?
* Monty [EMAIL PROTECTED] [Dec 03. 2001 23:39]: Hi, I'm looking for a really good content management system written in PHP that's free or very little money. I looked on HotScripts.com, but, there are SO many of them! Can someone recommend one or two good ones? I like phpWebsite. google.com for it. Or check out freshmeat.net -- -Brian Clark -- 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] BEST Book for Learning PHP/MySQL
On Monday 03 December 2001 08:45 pm, Monty wrote: Sorry, I did a search here and found only one message with book recommendations. Where's the archive? Is it a separate newsgroup? I looked on php.net, but, only found a long list of books available, no recommendations. The archive is linked to off the php.net site in the support section. You can go to the archive directly here: http://marc.theaimsgroup.com/?l=php-general Searching for book yields 188 messages in the archive: http://marc.theaimsgroup.com/?l=php-generalw=2r=1s=bookq=b --kurt Monty From: [EMAIL PROTECTED] (Kurt Lieber) Reply-To: [EMAIL PROTECTED] Newsgroups: php.general Date: Mon, 3 Dec 2001 20:50:29 -0800 To: [EMAIL PROTECTED] Subject: Re: [PHP] BEST Book for Learning PHP/MySQL There's dozens upon dozens of messages in the archive about this topic, which comes up at least once per month. I believe there's also a blurb or two about PHP books on the PHP web site, php.net. Please check those resources. --kurt On Monday 03 December 2001 08:35 pm, Monty wrote: I'm a PHP and MySQL beginner. What's the best book I can buy that will get me started using both these technologies? 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] New Page Escape Sequence
I wish to take some information out of a database and create a text file with the information, nicely formatted. Does any one know of an escape sequence that works as a new page indicator for printing??? -- 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] popen
Please Cc: me with responses. I dunno how soon I'll be able to read php-general again... Short version: If a program doesn't take data from stdin, and you want to get data to it more securely than writing it to a file, is there some combination of exec/popen and/or Un*x redirection | that will get the data to go from PHP to the program, without hitting disk, and without being in ps -aux output? I *KNOW* I can do it with popen if it would just take data on stdin like any normal Un*x program. :-( :-( :-( I tried in the shell to use and and whatnot, but it didn't seem to like that... Does popen add any inherent ability to shove data to it via |, even if it's expecting a file?... How? Did I just not get the right magical combination of |? I grok | okay, and even , but as soon as you start using , I get lost for some reason... Long version: Suppose, hypothetically speaking, the following: Vendor provides a binary for talking to their credit-card processing center. Vendor provides PHP API script for accessing above binary. Said script boils down to this algorithm: Dump credit card info into $TEMP file. exec(binary ALLSTDIN $TEMP); unlink($TEMP); Now, granted, this is on an SSL server, and there shouldn't be any random users with access, and the files in question are being done via suExec, so it's not like they are world-readable... But *STILL*, I'm concerned about files sitting around on the hard drive with cc#s in them. What if somebody *DOES* break in and gets the suExec users's password somehow? What if they find and start reading those files? What if they don't get as far as that user's password, but they start resurrecting recently unallocated blocks from the hard drive? I just don't like the idea of storing credit card numbers on my web-site's hard drive, no matter how briefly. (And when their server is down or slow, it ain't gonna be all that brief...) Now I know that you can convert to popen() if the binary in question will take data from stdin. But the binary in question does not, at least from my lame attempts in a command shell. OTOH maybe that ALLSTDIN arg needs to change to something else to use stdin instead of a file... Though I would expect ALLSTDIN would be the keyword for data to come on stdin, not from a file, so I can't even *begin* to guess what keyword means ALLSTDINEVENTHECREDITCARDNUMBER... I've already emailed the vendor, but I'd just as soon patch their PHP API software as wait for their response, if there's some combination that works and doesn't just move the exposure to ps auxwww instead of the hard drive. They've got 200-page manuals about their API and their product and everything else that's not rocket-science, but nothing I can find about the actual binary and --help and -h don't put out usage prompts or anything standard like that :-( I even tried to run strings on it, in the hope of finding some nugget of info, but it wasn't particularly useful to somebody as dumb as me. I have had luck in the past with strings printing out the help itself (along with a lot of other crap) so I guess I'm not totally stupid to figure that one out, but no go this time. -- WARNING [EMAIL PROTECTED] email address is an endangered species Use [EMAIL PROTECTED] instead -- 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] automatic forward URL to other URL
I want automatic forward URL (www.mydomain.com) to (www.mydomain2.com) If i type in my brower www.mydomain.com the i will see www.mydomain2.com Greetings, Manu