Re: [PHP] php form
Hi Brian I would need to email it as an attachment. Thanks Mohamed - Original Message - From: Brian Clark [EMAIL PROTECTED] To: PHP is not a drug. [EMAIL PROTECTED] Sent: Saturday, January 05, 2002 8:23 AM Subject: Re: [PHP] php form * M.E. Suliman ([EMAIL PROTECTED]) [Jan 05. 2002 00:22]: Hi Hello I'm pretty new to this PHP thing so this might sound a bit stupid, or easy for the pros out there. I need a basic php form that when submit is clicked all the information filled in that form is either generated into an html template or text file so it can be emailed. I would be looking at the As an attachment, or do you want to just email the information submitted? option later where it would give you the option to print or email the genrated file. If you're completely new to PHP, this is a good introduction: http://www.zend.com/zend/art/intro.php -- Brian Clark | Avoiding the general public since 1805! Fingerprint: 07CE FA37 8DF6 A109 8119 076B B5A2 E5FB E4D0 C7C8 Overflow on /dev/null, please empty the bit bucket. -- 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] array_walk inside class method
Hi All, I want to use array_walk function inside a class method. But the problem is i want the second argument to array_walk ( function name ) be a another function of the same class. when i gave like that its telling Error : function not exist. class some() { function func1() { } function func2() { array_walk($array,func1); } } What is the syntax or way to do this. Thanks in Advance. S.Murali Krishna [EMAIL PROTECTED] = We grow slow trying to be great - E. Stanley Jones - -- 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] array_walk inside class method
hi $this-func1(); best regards attila Hi All, I want to use array_walk function inside a class method. But the problem is i want the second argument to array_walk ( function name ) be a another function of the same class. when i gave like that its telling Error : function not exist. class some() { function func1() { } function func2() { array_walk($array,func1); } } What is the syntax or way to do this. Thanks in Advance. S.Murali Krishna [EMAIL PROTECTED] = We grow slow trying to be great - E. Stanley Jones - -- 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] check browser communication
Hiya ! A little offtopic this question, but really important .. I need to check all the communication between my client PC and a server in the world wide web. Inlcuding all the header info and so on .. Would be a great help for developeing my script ... Could anybody of you suggest me something ? I am using IE6 and Opera 6 .. thx ! Cya ! Daniel -- 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] Printing return value of array_count_values?
Hi! How do i echo the return values of array_count_values? Regards # Daniel Alsén| www.mindbash.com # # [EMAIL PROTECTED] | +46 704 86 14 92 # # ICQ: 63006462 | +46 8 694 82 22 # # PGP: http://www.mindbash.com/pgp/ # -- 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: Printing return value of array_count_values?
array_count_values() returns an array using the values of the input array as keys and their frequency in input as values ? $array = array (1, hello, 1, world, hello); $a=array_count_values ($array); // returns array (1=2, hello=2, world=1) while ($b = each($a)) echo $b[0].=.$b[1]. ; ? -- Best regards, George Nicolae IT Manager ___ X-Playin - Professional Web Design www.x-playin.f2s.com Daniel alsén [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Hi! How do i echo the return values of array_count_values? Regards # Daniel Alsén| www.mindbash.com # # [EMAIL PROTECTED] | +46 704 86 14 92 # # ICQ: 63006462 | +46 8 694 82 22 # # PGP: http://www.mindbash.com/pgp/ # -- 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]
SV: [PHP] Re: Still need help with miscount
I have worked this over in my head over the holidays and still haven´t got a solution. Can anyone help? I have a MySql table populated with numerical values from 0 to 10 in five different fields. I need a function that counts all occurances of each value, ie: 1: 12, 2: 3, 4: 74 etc... I have worked with this code: $num_vals = array (); for ($i=0; $i10; $i++) { $shot_count = SELECT COUNT(*) FROM statistik WHERE shooter='$shooter_login' AND ((shot_one = '$i') OR (shot_two = '$i') OR (shot_three = '$i') OR (shot_four = '$i') OR (shot_five = '$i')); $result = mysql_query($shot_count); $num_vals[$i] = mysql_fetch_array($result); } The code works...but returns the wrong results. If i count from the database manually there is always some occurances missing. So, today i tried to count the values from an array instead: $shotcount = SELECT shot_one, shot_two, shot_three, shot_four, shot_five FROM statistik WHERE shooter='$shooter_login'; $results = mysql_query($shotcount); $bam = mysql_fetch_array($results); $count = array_count_values ($bam); while (list($key,$value) = each($count)) { echo $key : $valuebr; } But this works even worse...it seems to stop populating the array (or counting the values) after only a couple of rows from the db. The result looks like: 3 : 4 5 : 2 7 : 2 9 : 2 And there should be alot more of those keys...and a couple of keys more as well... I would appreciate any help on this guys. I am s stuck :( # Daniel Alsén| www.mindbash.com # # [EMAIL PROTECTED] | +46 704 86 14 92 # # ICQ: 63006462 | +46 8 694 82 22 # # PGP: http://www.mindbash.com/pgp/ # -- 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] Problems Installing 4.1.1 on FreeBSD 4.4 STABLE
Hello Everyone. I just tried to upgrade my Apache 1.3.22 web server to us PHP 4.1.1. I was running PHP 4.0.6 without problems for months, but wanted to take advantage of the bug fixes and new features. The compile seemed to go OK, and the new httpd runs fine. However, I've encountered a strange bug when visitng my web sites using Netscape 4.78. Whenever you visit a page that uses PHP's mySQL capabilities extensively (in my estimation, anything that has an update query, but I've only confirmed this on a handfull of pages so it could be some other more subtle symptom), the httpd process that handles that request gets a signal 10 or signal 11 (it switches back and fourth, but it's mostly a signal 11). When you go to these pages in IE or any other browser, it works fine with very few exceptions - it has been found to sig10 or sig11 on a few requests from IE or other versions of Netscape, but not with any regularity. Netscape 4.78 causes it to crash every time. It's important to not that it does not happen with every request or on every site - most pages operate fine, even with updates. It just seems that the few that do cause it to crash have several selects/updates on one page. Has anyone else experienced this problem? Here's a list of the versions of things that I'm running: Apache 1.3.22 PHP 4.1.1 (4.0.6 works fine) mySQL 3.23.46 mod_ssl 2.8.5 OpenSSL 0.9.6a Any help would be greatly appreciated. Thanks. Tim -- 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 5 Jan 2002 14:18:07 -0000 Issue 1093
php-general Digest 5 Jan 2002 14:18:07 - Issue 1093 Topics (messages 79513 through 79556): Paging through MySQL results in PHP 79513 by: Nelson Goforth Re: configuring sever to send mail (Win2k) 79514 by: CJ 79534 by: CJ 79537 by: Brian Clark Re: How to clear a populated array 79515 by: Miles Thompson 79523 by: Michael Sims Re: NEWBIE IN DISTRESS: Install Instructions are not work for PHP 4.1.1!!! 79516 by: Miles Thompson 79532 by: Brian Clark Stupid question alert 79517 by: tim at 10Kv 79518 by: Bogdan Stancescu Re: Quick regular expressions question / preg_replace 79519 by: Bogdan Stancescu 79521 by: David Yee 79522 by: Bogdan Stancescu 79525 by: David Yee CGI and HTTP Authentication 79520 by: Gaylen Fraley 79538 by: Brian Clark 79540 by: Gaylen Fraley 79541 by: Gaylen Fraley 79542 by: Brian Clark 79544 by: Brian Clark 79545 by: Gaylen Fraley 79547 by: Brian Clark Re: Warning: Unknown persistent list entry type in module shutdown (11) 79524 by: Brian Clark Re: PHP XML with Dynamic Content 79526 by: Brian Clark Re: Cannot find imap library 79527 by: Brian Clark Re: compilation of PHP with SNMP support 79528 by: Kancha . Checking the season 79529 by: webapprentice Re: PEAR 79530 by: Brian Clark 79536 by: Bas van Rooijen Re: PHP-Friendly WYSIWYG HTML Editor 79531 by: Brian Clark Re: PHP Compile Errors 79533 by: Brian Clark Re: Stupid question alert] 79535 by: Bogdan Stancescu php form 79539 by: M.E. Suliman 79543 by: Brian Clark 79548 by: M.E. Suliman Re: Checking for characters in string 79546 by: Joe Webster array_walk inside class method 79549 by: S. Murali Krishna 79551 by: Attila Strauss want HTML class or php library 79550 by: S. Murali Krishna check browser communication 79552 by: Daniel Urstöger Printing return value of array_count_values? 79553 by: Daniel Alsén 79554 by: George Nicolae Re: Still need help with miscount 79555 by: Daniel Alsén Problems Installing 4.1.1 on FreeBSD 4.4 STABLE 79556 by: Tim Gustafson 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--- I have an application that returns a set of results from a MySQL query. Let's say I have 100 results from the query, but only want to show 25 per HTML page. The MySQL query is driven by a 'Search' page that creates an array $keywords - which can be of any size. I then loop through the $keywords array to create the SQL code. I understand how to use the LIMIT statement in MySQL - so I can 'page' the output, but how do I pass the $keywords array with each request for the next page? I create a link with a phrase like: printf(...A HREF=results.php?firstitem=1items=25kw=$kw...); but end up just showing that kw=array. Can anyone put me on the right track or point me to some resource? This seems like it should be simple but... Thanks, Nelson ---End Message--- ---BeginMessage--- thanks for the reply but i still need some help: PHP Version 4.0.6 [mail function] ; For Win32 only. SMTP = localhost ; For Win32 only. sendmail_from = [EMAIL PROTECTED] --- I get this error when i use the mail function on my local server (IIS 5.0, windows 2000 Pro). Maybe it's an IIS configuration problem. i'm really not sure. Error Warning: Server Error in F:\Inetpub\wwwroot\stowe\scripts\mail.php on line 42 Code ?php $to = '[EMAIL PROTECTED]'; $from = '[EMAIL PROTECTED]'; //Check if we have something POSTed by the form. if (isset($HTTP_POST_VARS)){ //Start with an empty body for the mail message $body = ''; //Iterate through all the POSTed variables, and add them to the message body. while (list($key, $value) = each($HTTP_POST_VARS)){ $body .= $key . ' = ' . $value . \r\n; } //Build up some nice From/Reply Headers $headers = From: $from\r\n; $headers .= Reply-To: $from\r\n; //Mail the message out. //Requires setting php3.ini sendmail path as per instructions $success = mail($to, Posted . date(m/d/Y), $body, $headers); //LINE 42 //Always check return codes from functions. if ($success){ echo BCENTERThank you for your input/CENTER/B\n; } else{ echo CENTERBInternal Error/B: Your input was
Re: [PHP] adding users on *nix
I'm not sure how you'd go about doing that, but be warned that you're walking on very thin ice (security-wise) to allow such an action. You must be very extra super careful not to get hacked! Not only that you'll be potentially allowing hackers to create users on your machine, but at some time the input from the user (username/pass) will be processed by a script running as root (you can't create users otherwise). That's one of the riskiest tricks I've seen around. Take care! Bogdan Chris Hogben wrote: Is there a way of adding a user to a *nix box thru php. Like, someone signs up, and they're account is added? 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] check browser communication
What do you mean exactly? You want to be able to monitor (as in see) the data being transacted by your browser with the server or is it something else you're after? Bogdan Daniel Urstöger wrote: Hiya ! A little offtopic this question, but really important .. I need to check all the communication between my client PC and a server in the world wide web. Inlcuding all the header info and so on .. Would be a great help for developeing my script ... Could anybody of you suggest me something ? I am using IE6 and Opera 6 .. thx ! -- 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] check browser communication
Bogdan Stancescu [EMAIL PROTECTED] schrieb im Newsbeitrag [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... What do you mean exactly? You want to be able to monitor (as in see) the data being transacted by your browser with the server or is it something else you're after? Bogdan Yeah, exactly ! I wanna view all the data coming from the server, and the data which is sent by the client. Is there any program who could show this ? The headers and so on ? Bcz the IE only shows the HTML file .. thx .. Cya ! Daniel -- 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] Plz help w/ php/MySQL
The following php script successfully e-mails both messages but it doesn't update in the table scr_149 the column notified. Why? ?php $connection=mysql_connect(localhost,wagner,123) or die (No connection!); $db=mysql_select_db(sbwresearch_com,$connection) or die (No database!); $message_1= Congratulations!\n\n You've qualified to take the online survey # 149.\n\n To take the survey, go to www.sbwresearch.com and click on Survey / Tests.\n\n ; $message_2= Sorry!\n\n You've not qualified to take the online survey # 149.\n\n We'll notify you by e-mail of upcoming screeners. ; $qry_1=select * from scr_149 where q05a!=\0\ notified=\n\; $qry_2=update scr_149 set notified='y' where username='$username'; $result_1=mysql_query($qry_1,$connection) or die (No query # 1!); while ($row_1=mysql_fetch_array($result_1, MYSQL_ASSOC)) { $username=$row_1[username]; $e_mail=$row_1[e_mail]; mail($e_mail, News from SBW Research, $message_1, From:SBW Research [EMAIL PROTECTED]\n); $result_2=mysql_query($qry_2,$connection) or die (No query # 2!); }; mysql_free_result($result_1); $qry_3=select * from scr_149 where q05a=\0\ notified=\n\; $qry_4=update scr_149 set notified=\y\ where username='$username'; $result_3=mysql_query($qry_3,$connection) or die (No query # 3!); while ($row_2=mysql_fetch_array($result_3, MYSQL_ASSOC)) { $username=$row_2[username]; $e_mail=$row_2[e_mail]; mail($e_mail, News from SBW Research, $message_2, From:SBW Research [EMAIL PROTECTED]\n); $result_4=mysql_query($qry_4,$connection) or die (No query # 4!); }; @mysql_free_result($result_3); @mysql_close($connection); header (location:done.htm); exit; ? Thanks! Anthony F. Rodriguez ([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 4.1.1 problem after compile
I am trying to ugrade php 4.0.3pl1 to PHP4.1.1...I am VERY new at this compiling stuff, but I though I had pretty good instructions to go by. My configure statement: ./configure --prefix=/usr --with-mysql --with-apxs=/usr/sbin/apxs --with-gd --with-gettext=/usr --enable-safe-mode --with-config-file-path=/etc/httpd -- with-exec-dir=/usr/bin --with-zlib --enable-magic-quotes --with-regex=system --with-ttf=/usr/lib/libttf.so --enable-track-vars --enable-xml --disable-de bug --with-db --with-interbase=shared --with-pgsql=shared --with-ldap --with -imap No errors that I could determine on make install. I stopped Apache, and restarted. Then I got this error: Setting up Web Service: Syntax error on line 58 of /etc/httpd/conf/httpd.conf: Cannot load /etc/httpd/modules/libphp4.so into server: /etc/httpd/modules/libphp4.so: undefined symbol: gdImageColorResolve /usr/sbin/httpd Does this mean I have an incompatible version of gd? Did I jump to many PHP versions? Or did I miss something else? Thanks for any help, Dennis Williams -- 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] Plz help w/ php/MySQL
Anthony Rodriguez wrote: The following php script successfully e-mails both messages but it doesn't update in the table scr_149 the column notified. Why? ?php $connection=mysql_connect(localhost,wagner,123) or die (No connection!); $db=mysql_select_db(sbwresearch_com,$connection) or die (No database!); $message_1= Congratulations!\n\n You've qualified to take the online survey # 149.\n\n To take the survey, go to www.sbwresearch.com and click on Survey / Tests.\n\n ; $message_2= Sorry!\n\n You've not qualified to take the online survey # 149.\n\n We'll notify you by e-mail of upcoming screeners. ; $qry_1=select * from scr_149 where q05a!=\0\ notified=\n\; $qry_2=update scr_149 set notified='y' where username='$username'; ^ What's the value of $username here? $result_1=mysql_query($qry_1,$connection) or die (No query # 1!); while ($row_1=mysql_fetch_array($result_1, MYSQL_ASSOC)) { $username=$row_1[username]; ^ Because setting $username here is too late... You should define $qry_2 after defining $username (move that line here). $e_mail=$row_1[e_mail]; mail($e_mail, News from SBW Research, $message_1, From:SBW Research [EMAIL PROTECTED]\n); $result_2=mysql_query($qry_2,$connection) or die (No query # 2!); }; mysql_free_result($result_1); $qry_3=select * from scr_149 where q05a=\0\ notified=\n\; $qry_4=update scr_149 set notified=\y\ where username='$username'; ^ Same thing here... $result_3=mysql_query($qry_3,$connection) or die (No query # 3!); while ($row_2=mysql_fetch_array($result_3, MYSQL_ASSOC)) { $username=$row_2[username]; ^ ...being moved here. $e_mail=$row_2[e_mail]; mail($e_mail, News from SBW Research, $message_2, From:SBW Research [EMAIL PROTECTED]\n); $result_4=mysql_query($qry_4,$connection) or die (No query # 4!); }; @mysql_free_result($result_3); @mysql_close($connection); header (location:done.htm); exit; ? -- 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] Help Please
Can anyone help me with this... ? if ($HTTP_POST_VARS[action] == 1) { checklogin($HTTP_POST_VARS[user_name], $HTTP_POST_VARS[password]); exit; } function checklogin($user_name, $password) { login($user_name, $password); if ($sid != -1) { header(Location: http://localhost/infekt/packages/imanager/index2.php?sid=$sid;); } else { header(Location: http://localhost/infekt/packages/imanager/index.php;); } } function login($user_name, $password) { $db = imanager; $SQL = SELECT * FROM users WHERE user_name='.$user_name.' AND password='.$password.'; # $connection = db_connect(); $query = mysql_query('$SQL'); if (mysql_num_rows($query) != 1) { return -1; } $row = mysql_fetch_array($query); $user_id = $row[user_id]; $sid = md5(blah blah.$user_id.$ttime); $remip = getenv (REMOTE_ADDR); $ttime = date(YmdHis); $SQL2 = INSERT INTO session ; $SQL2 = $SQL2 . (user_id, sid, ttime, remip) VALUES ; $SQL2 = $SQL2 . ('$user_id','$sid','$ttime','$remip') ; ### $result2 = mysql_db_query($db,$SQL2,$connection); if (!$result2) { echo(ERROR: . mysql_error() . \n$SQL\n); mysql_close($connection); exit; } ### SetCookie(iManager, $user_id:$sid:$ip, time()+3600); return $sid; } ? It is meant to check a user login from the same page POSTed back to it. Fields being user_name and password. When I try it I get an Error on Line 30: if (mysql_num_rows($query) != 1) Thankyou -- 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: Paging through MySQL results in PHP
hi nelson, i'm not sure if i get you right, but you could store the 'base' of your generated SQL query in a session variable, that way you don't have to drag the $kw array along. // before any html output (sends http headers) session_start(); // build query from keywords -- results in string $s_base_query session_register(s_base_query); then, for every new page you build your full query like this: $query = $s_base_query . LIMIT $firstitem,$items; hope this helps, phil -- 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] ob_gzhandler doesn't seem to be working
I thought I would try out the ability to GZip my PHP pages, so that they would be sent quicker and use less of my bandwidth :) Anyway I have found the following tutorials and information on this: http://www.zend.com/zend/art/buffering.php http://www.php.net/manual/en/function.ob-gzhandler.php http://www.phpbuilder.com/columns/piergiorgio20010321.php3?page=3 Unfortually I have been unable to get any of my pages to actually GZip up during transmittion. I have enabled output_buffering = On output_handler = ob_gzhandler in the php.ini file, with no luck I have tried php_flag output_buffering on php_value output_handler ob_gzhandler in .htaccess files I have even tried ob_start(ob_gzhandler); at the top of my PHP Files.. Unfortually the output is NOT GZips, I have been testing the output with this script: http://leknor.com/code/gziped.php or by manually sending a HTTP Request: GET /whatever.php HTTP/1.0 Host: localhost Accept-Encoding: gzip Nothing I try gets the page GZipped. I am using php 4.0.6 binaries on windowsXP with apache 1.3.20 If anyone has been able to get this working, or has a solution to my problem please contact me, Thanks Andrew
Re: SV: [PHP] Re: Still need help with miscount
I don't know if this is actually it, but the line $num_vals[$i] = mysql_fetch_array($result); seems strange to me - doesn't mysql_fetch_array return an array? You should try list($num_vals[$i]) = mysql_fetch_array($result); and see if you get any improvements... Daniel Alsén wrote: I have worked this over in my head over the holidays and still haven´t got a solution. Can anyone help? I have a MySql table populated with numerical values from 0 to 10 in five different fields. I need a function that counts all occurances of each value, ie: 1: 12, 2: 3, 4: 74 etc... I have worked with this code: $num_vals = array (); for ($i=0; $i10; $i++) { $shot_count = SELECT COUNT(*) FROM statistik WHERE shooter='$shooter_login' AND ((shot_one = '$i') OR (shot_two = '$i') OR (shot_three = '$i') OR (shot_four = '$i') OR (shot_five = '$i')); $result = mysql_query($shot_count); $num_vals[$i] = mysql_fetch_array($result); } The code works...but returns the wrong results. If i count from the database manually there is always some occurances missing. So, today i tried to count the values from an array instead: $shotcount = SELECT shot_one, shot_two, shot_three, shot_four, shot_five FROM statistik WHERE shooter='$shooter_login'; $results = mysql_query($shotcount); $bam = mysql_fetch_array($results); $count = array_count_values ($bam); while (list($key,$value) = each($count)) { echo $key : $valuebr; } But this works even worse...it seems to stop populating the array (or counting the values) after only a couple of rows from the db. The result looks like: 3 : 4 5 : 2 7 : 2 9 : 2 And there should be alot more of those keys...and a couple of keys more as well... I would appreciate any help on this guys. I am s stuck :( # Daniel Alsén| www.mindbash.com # # [EMAIL PROTECTED] | +46 704 86 14 92 # # ICQ: 63006462 | +46 8 694 82 22 # # PGP: http://www.mindbash.com/pgp/ # -- 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] Checking the season
You could do a case() or if/elseif, check if it's spring, summer or autumn and leave the code for winter as default/else. Bogdan webapprentice wrote: Hi, Just need a sounding board to help me think this through. I want to check the current date to determine what season it is and display the appropriate picture. I define spring as 03/21/, summer as 06/21/, autumn as 09/21/, and winter as 12/21/. I form a string for the current date and get a timestamp via mktime(). I also get the equivalent timestamps for the dates above for the seasonal changes. Then, I compare the current date to see if it's between the seasonal dates. The problem is when I go from 12/31/ to 01/01/(+1). Since winter and spring dates are one year apart, the current date timestamp comparison gets messed up and nothing displays. How do I do a proper comparison? I was thinking of just seeing if the current date timestamp is greater than each of the seasonal date timestamp, but it feels like I would miss something. Would I? Or is there another solution? Thank you for your time. --Stephen -- 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: Help Please
line 29: mysql_query('$SQL') will send the following query to your db: $SQL i know of no db that understands that ;-) everything in single quotes is NOT parsed by php. here, use double quotes, or better, none at all. hope it works now, phil. -- 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: Help Please (clarification)
Phillip Oertel wrote: line 29: mysql_query('$SQL') will send the following query to your db: $SQL -- it sends exactly this string instead of the content of your variable $SQL, which contains the real query. -- 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] Webmail with attach
Hi all, I am making a small webmail, But I need that this webmail have attach, I can to put one attach athis mail, but I need many attach in the webmail, I made a bucle for many attach, but now I can't to manipulate this attach for that the user send mail with many attach. Some body can help me? Thanks in advanced, Regards _ Chat with friends online, try MSN Messenger: http://messenger.msn.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] print on printer
Hi All I have a php that access to database and show the values in the browser, But I need add hte option of print on printer, but that only print the table with values. Somebody can help me? Thanks in Advanced, Regards, _ Send and receive Hotmail on your mobile device: http://mobile.msn.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] xmldoc undefined with domxml apparently enabled
Hi, I can't get DOMXML to work. The line $doc = xmldoc($xml); // (line 26) (where $xml is a string containing a valid xml document) raises a fatal error: Fatal error: Call to undefined function: xmldoc() in d:\...\class.xmltemplate.php on line 26 I'm running PHP 4.1.1 as an Apache module with Apache 1.3.22 on Win98 (but I was experiencing the same problem with PHP 4.0.6, 4.0.7, 4.1.0 and Apache 1.3.14). All the required dlls (libxml2.dll, iconv-1.3.dll) have been copied to the system directory, and phpinfo() tells me that DOMXML is enabled (with libxml 2.4.1). Same problem with xmldocfile(). Best regards, Luca -- 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] MySQL error... but it works!!??
Does anyone have any idea why this is giving me a Warning: Supplied argument is not a valid MySQL result resource in... error? The funny thing is that apart from that error message it works perfectly!! --- $crdate = date(Y-m-d); $result = mysql_query(SELECT * FROM sites WHERE creation_date = '$crdate' AND status = 'T'); while ($sitedata = mysql_fetch_array($result)) { echo $sitedata['name'] . br; } --- Cheers Simon -- 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] MySQL error... but it works!!??
Does anyone have any idea why this is giving me a Warning: Supplied argument is not a valid MySQL result resource in... error? You'll have to give more code, which line you get that error from, etc., to give us a better idea why it's not working. However, a quick tip: $crdate = date(Y-m-d); $result = mysql_query(SELECT * FROM sites WHERE creation_date = '$crdate' AND status = 'T'); These two lines can be condensed since MySQL has a built-in function to get the current time/date: SELECT * FROM sites WHERE creation_date = NOW() AND status = 'T' -Adam -- 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] Webmail with Attach
Hi All, I am making a webmail, this webmail can send with just one attach, but I need that that my webmail can send mail with many attach. Now my function have the follwing code line: if ($attach != none) { $file = fopen($attach, r); $contents = fread($file, $attach_size); $encoded_attach = chunk_split(base64_encode($contents)); fclose($file); //$encoded_attach = base64_encode($attach);\ //$encoded_attach = $attach; $mailheaders .= MIME-version: 1.0\n; $mailheaders .= Content-type: multipart/mixed; ; $mailheaders .= boundary=\Message-Boundary\\n; $mailheaders .= Content-transfer-encoding: 7BIT\n; $mailheaders .= X-attachments: $attach_name; $body_top = --Message-Boundary\n; $body_top .= Content-type: text/plain; charset=US-ASCII\n; $body_top .= Content-transfer-encoding: 7BIT\n; $body_top .= Content-description: Mail message body\n\n; $msg_body = $body_top . $msg_body; $msg_body .= \n\n--Message-Boundary\n; $msg_body .= Content-type: $attach_type; name=\$attach_name\\n; $msg_body .= Content-Transfer-Encoding: BASE64\n; $msg_body .= Content-disposition: attachment; filename=\$attach_name\\n\n; $msg_body .= $encoded_attach\n; $msg_body .= --Message-Boundary--\n; } How can I do it? Some body can help me? Thanks in Advanced, Regards, _ Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] PHP XML with Dynamic Content
Writing it on the fly would be kinda redundant.. I think.. :( from mysql data to xml to data.. .. would slow things down a bit i think.. :( Brian Clark [EMAIL PROTECTED] wrote in message 20020105030550.GD17616@ganymede">news:20020105030550.GD17616@ganymede... * Emile Bosch ([EMAIL PROTECTED]) [Jan 03. 2002 15:38]: Hi a lot of todays proffesional content management systems use XML, now i was wondering how it's possible to mix XML with Dynamic Content, or content which is change sensitive, IE A shop, or an auction, let's say you have a shop with 1000 products, how am i gonna mix this in the XML? Does anyone know how this is solved, because i don't think that you are gonna write hundreds of XML files for each article, can someone please help me out here? I understand the first paragraph up to how am i gonna mix this in the XML? Why couldn't you store information in a database and write the XML files on the fly when you need XML? Or update the XML file when something changes? Or, why use XML at all? Do you _really_ need it? *confused* -- Brian Clark | Avoiding the general public since 1805! Fingerprint: 07CE FA37 8DF6 A109 8119 076B B5A2 E5FB E4D0 C7C8 Sex is the most fun you can have without laughing. -- 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] XML based content management system.
Does anyone know an opensource XML based content management system? Written in PHP? Warm regards, Emile Bosch -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Fw: [PHP] MySQL error... but it works!!??
- Original Message - From: Bas van Rooijen [EMAIL PROTECTED] To: Adam Baratz [EMAIL PROTECTED] Sent: Saturday, January 05, 2002 4:39 PM Subject: Re: [PHP] MySQL error... but it works!!?? maybe try: if (!$result) { echo(mysql_error()); } bvr. On Sat, 5 Jan 2002 15:55:39 -0500, Adam Baratz wrote: Does anyone have any idea why this is giving me a Warning: Supplied argument is not a valid MySQL result resource in... error? You'll have to give more code, which line you get that error from, etc., to give us a better idea why it's not working. However, a quick tip: $crdate = date(Y-m-d); $result = mysql_query(SELECT * FROM sites WHERE creation_date = '$crdate' AND status = 'T'); These two lines can be condensed since MySQL has a built-in function to get the current time/date: SELECT * FROM sites WHERE creation_date = NOW() AND status = 'T' -Adam -- 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] Can't get accurate day of year
Hello All and Happy New Year. I have a simple routine to get the year, date and the day of year. Year and date come out correctly but the day of year is one less than the date. It being January, it's easy to see the error. The only thing I can figure, is that the date(z) function gets a fractional value and rounds down not rounds up. I really could use some input on this before I just add one to the result and move on. Thanks, Hugh $date_array=getdate(); / / gets today's date info foreach ($date_array as $key=$val) { $key=$val; } $current_year=$date_array[year]; / / returns 2002 $std_date=date(n-j-y);/ / returns 1-5-02 $day_of_year=date(z); / / returns 4 !!
Re: [PHP] MySQL error... but it works!!??
Hi, So far the best way to troubleshoot mysql+php for me has been to add an or die after the sql exec. $crdate = date(Y-m-d); $result = mysql_query(SELECT * FROM sites WHERE creation_date = '$crdate' AND status = 'T') or die ('CAN NOT EXEC SQL'); Or you can do $sql = SELECT * FROM sites WHERE creation_date = '$crdate' AND status = 'T'; echo $sql; $result = mysql_query($sql) or die .; and try to run your sql against mysql directly to make sure your sql is fine. one thing to always check is your connection to the database. did you connect? Simon Kimber [EMAIL PROTECTED] wrote: Does anyone have any idea why this is giving me a Warning: Supplied argument is not a valid MySQL result resource in... error? The funny thing is that apart from that error message it works perfectly!! --- $crdate = date(Y-m-d); $result = mysql_query(SELECT * FROM sites WHERE creation_date = '$crdate' AND status = 'T'); while ($sitedata = mysql_fetch_array($result)) { echo $sitedata['name'] . ; } --- Cheers Simon -- 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] Mehmet Erisen http://www.erisen.com - Do You Yahoo!? Send FREE video emails in Yahoo! Mail.
[PHP] output compression and imp 2.x not working under IE
Hi, I've recently upgraded my server to php 4.1.1 and turned on the output compression under php.ini. For some browsers (IE 5/5.5 so far) it made imp stop working. Does anybody know if this is a limitation of php, imp or explorer ? Anyone has tried that with the latest imp/horde ? thanks. __ Do You Yahoo!? Send FREE video emails in Yahoo! Mail! http://promo.yahoo.com/videomail/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Re: Can't get accurate day of year
Hugh Danaher [EMAIL PROTECTED] wrote: Hello All and Happy New Year. I have a simple routine to get the year, date and the day of year. Year and date come out correctly but the day of year is one less than the date. It being January, it's easy to see the error. The only thing I can figure, is that the date(z) function gets a fractional value and rounds down not rounds up. I really could use some input on this before I just add one to the result and move on. as http://www.php.net/date says, the range of the 'z' format is from 0 to 365. january 1st is day 0. jim -- 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: Can't get accurate day of year
So, I add 1 to the number and move on. Thanks, Hugh - Original Message - From: Jim Winstead [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Saturday, January 05, 2002 3:24 PM Subject: [PHP] Re: Can't get accurate day of year Hugh Danaher [EMAIL PROTECTED] wrote: Hello All and Happy New Year. I have a simple routine to get the year, date and the day of year. Year and date come out correctly but the day of year is one less than the date. It being January, it's easy to see the error. The only thing I can figure, is that the date(z) function gets a fractional value and rounds down not rounds up. I really could use some input on this before I just add one to the result and move on. as http://www.php.net/date says, the range of the 'z' format is from 0 to 365. january 1st is day 0. jim -- 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] Here ya go..
5 hosting plans, apache 1.3 - debian 2.22r3. lets also say i have the same 5 plans, except on a windows 2000 adv server. i want to limit access levels and functions my users are allowed to use. This is preliminary -- I am somewhat familiar with how shell hosting works, and I believe my answer is there, but I could be wrong..if anyone has conquered this problem ( i know some of you have ) help is in dier need. Thnx in adv. --- Chris Hall Web Application Development --- hardwired industries -- 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] HTML doc check in PHP? How to?
Hi, I would like to be able to check html documents against a template html document using PHP. In the example below I would like to check if the document starts with a h1 + string + /h1, and is followed by a h1 + version + ... etc. etc. Should/could I use XML? Any ideas would be greatly appreciated! center h1DataSelect Installation and Configuration/h1 h3version 1.0 - Dec 20th, 2001 (dsl/d0001v10)/h3 by Simon.de.Kraa ([EMAIL PROTECTED]) /center h2Table of content/h2 ul lia href=#introductionIntroduction/a lia href=#installationInstallation/a lia href=#configurationConfiguration/a ul lia href=#dataselect_objectsDataSelect Objects/a lia href=#dataselectDataSelect/a /ul /ul !-- --- INTRODUCTION --- -- h2a name=introductionIntroduction/a/h2 This document describes the complete process of installing and configuring DataSelect. !-- --- INSTALLATION --- -- h2a name=installationInstallation/a/h2 ... !-- --- CONFIGURATION --- -- h2a name=configurationConfiguration/a/h2 h3a name=dataselect_objectsDataSelect Objects/a/h3 ... h3a name=dataselectDataSelect/a/h3 ... Met vriendelijke groet / With kind regards, ICL Nederland B.V. Simon de Kraa e-Applications / Logistic Systems Systems Architect Het Kwadrant 1 Tel. +31 346 598865 Postbus 4000Fax +31 346 562703 3600 KA MAARSSEN The Netherlands mailto:[EMAIL PROTECTED] --- Progress 9.1c, Roundtable 9.1c, NuSphere Pro Advantage 2.3.1 @ MS Windows 2000 5.00.2195 SP 2 Progress 9.1c @ SCO UnixWare 7.1.1 -- 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] jukebox
On Friday 04 January 2002 22:20, Scott wrote: Has anyone experimented with controlling an mp3 player like mpg123 from php? I want to build a radio automation system using a web interface, but not sure how I want to handle the actual playing of music. Basically I would have a mysql database that rotates the music based on categories and it would move down the list resetting every hour. If you have done an exec to mpg123 before, how did you control the output? I want the output to be on the local machine and not streamed across a network. Thanks in advance. -Scott Hi Scott, A quick search at freshmeat shows several projects doing the same thing already, you might want to check them out for reference: http://freshmeat.net/search/?q=jukebox%20php -- Meir Kriheli -- 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] quote 76
Hi, how can i make data submited throug form, Quoted Printable Encode to 76 characters. 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] array_walk inside class method
it may be better: array_walk($this-array, array($this, 'func1'); Attila Strauss [EMAIL PROTECTED] wrote in message 001d01c195db$67647da0$[EMAIL PROTECTED]">news:001d01c195db$67647da0$[EMAIL PROTECTED]... | hi | | $this-func1(); | | | best regards | attila | | | | | Hi All, | I want to use array_walk function inside a class method. But the | problem is i want the second argument to array_walk ( function name ) | be a another function of the same class. when i gave like that its telling | | Error : function not exist. | | class some() | { | | function func1() | { | } | function func2() | { | array_walk($array,func1); | } | } | | What is the syntax or way to do this. | | | Thanks in Advance. | | S.Murali Krishna | [EMAIL PROTECTED] | = | We grow slow trying to be great | | - E. Stanley Jones | - | | | -- | 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] sorting and limitin sql in php pages??????
Hi, As the data grows I like to add the functionality that people see 30 lines of the result on one page. Also I like to give users the ability to sort per columns... I know this is done pretty much everwhere. What's the best or easiest way of doing it? Mehmet Erisen http://www.erisen.com - Do You Yahoo!? Send FREE video emails in Yahoo! Mail.
Re: [PHP] Checking the season
I'll have to use and if/elseif construct, because I don't believe a switch() constructs cases can take expressions, can it? - Original Message - From: Bogdan Stancescu [EMAIL PROTECTED] To: webapprentice [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Sent: Saturday, January 05, 2002 11:38 AM Subject: Re: [PHP] Checking the season You could do a case() or if/elseif, check if it's spring, summer or autumn and leave the code for winter as default/else. Bogdan webapprentice wrote: Hi, Just need a sounding board to help me think this through. I want to check the current date to determine what season it is and display the appropriate picture. I define spring as 03/21/, summer as 06/21/, autumn as 09/21/, and winter as 12/21/. I form a string for the current date and get a timestamp via mktime(). I also get the equivalent timestamps for the dates above for the seasonal changes. Then, I compare the current date to see if it's between the seasonal dates. The problem is when I go from 12/31/ to 01/01/(+1). Since winter and spring dates are one year apart, the current date timestamp comparison gets messed up and nothing displays. How do I do a proper comparison? I was thinking of just seeing if the current date timestamp is greater than each of the seasonal date timestamp, but it feels like I would miss something. Would I? Or is there another solution? Thank you for your time. --Stephen -- 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] regular expressions
Need some help with this one. Dont know where to begin. I have content in a string and a constant that changes depending on if yourre in the root or in a directory. The purpose of the constant is to provide dynamic links. The string will have href links like a href=index.phpIndex/a I want to figure out a way to inject my constant value into the href like so a href='._CONSTANT'index.phpIndex/a I would like the rules to say, If string contains href= and there are alphanumerical chars .php place _CONSTANT between href= and alphanumerical chars I figure a regular expression, but I have no idea where to start.. 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 Digest 6 Jan 2002 03:16:54 -0000 Issue 1094
php-general Digest 6 Jan 2002 03:16:54 - Issue 1094 Topics (messages 79557 through 79591): Re: adding users on *nix 79557 by: Bogdan Stancescu Re: check browser communication 79558 by: Bogdan Stancescu 79559 by: Daniel Urstöger Plz help w/ php/MySQL 79560 by: Anthony Rodriguez 79562 by: Bogdan Stancescu PHP 4.1.1 problem after compile 79561 by: DWilliams Help Please 79563 by: Necro 79568 by: Phillip Oertel Re: Paging through MySQL results in PHP 79564 by: Phillip Oertel ob_gzhandler doesn't seem to be working 79565 by: Andrew Brampton Re: Still need help with miscount 79566 by: Bogdan Stancescu Re: Checking the season 79567 by: Bogdan Stancescu 79590 by: webapprentice Re: Help Please (clarification) 79569 by: Phillip Oertel Webmail with attach 79570 by: Luz Lopez 79575 by: Luz Lopez print on printer 79571 by: Luz Lopez xmldoc undefined with domxml apparently enabled 79572 by: Luca MySQL error... but it works!!?? 79573 by: Simon Kimber 79574 by: Adam Baratz 79578 by: Adam Baratz 79580 by: Mehmet Kamil ERISEN Re: PHP XML with Dynamic Content 79576 by: Emile Bosch XML based content management system. 79577 by: Emile Bosch Can't get accurate day of year 79579 by: Hugh Danaher 79582 by: Jim Winstead 79583 by: Hugh Danaher output compression and imp 2.x not working under IE 79581 by: Robert Mena Here ya go.. 79584 by: Chris Hall HTML doc check in PHP? How to? 79585 by: Kraa de Simon Re: jukebox 79586 by: Meir Kriheli quote 76 79587 by: Rambo Amadeus Re: array_walk inside class method 79588 by: Gyozo Papp sorting and limitin sql in php pages?? 79589 by: Mehmet Kamil ERISEN regular expressions 79591 by: Gerard Samuel 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--- I'm not sure how you'd go about doing that, but be warned that you're walking on very thin ice (security-wise) to allow such an action. You must be very extra super careful not to get hacked! Not only that you'll be potentially allowing hackers to create users on your machine, but at some time the input from the user (username/pass) will be processed by a script running as root (you can't create users otherwise). That's one of the riskiest tricks I've seen around. Take care! Bogdan Chris Hogben wrote: Is there a way of adding a user to a *nix box thru php. Like, someone signs up, and they're account is added? Thanks. ---End Message--- ---BeginMessage--- What do you mean exactly? You want to be able to monitor (as in see) the data being transacted by your browser with the server or is it something else you're after? Bogdan Daniel Urstöger wrote: Hiya ! A little offtopic this question, but really important .. I need to check all the communication between my client PC and a server in the world wide web. Inlcuding all the header info and so on .. Would be a great help for developeing my script ... Could anybody of you suggest me something ? I am using IE6 and Opera 6 .. thx ! ---End Message--- ---BeginMessage--- Bogdan Stancescu [EMAIL PROTECTED] schrieb im Newsbeitrag [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... What do you mean exactly? You want to be able to monitor (as in see) the data being transacted by your browser with the server or is it something else you're after? Bogdan Yeah, exactly ! I wanna view all the data coming from the server, and the data which is sent by the client. Is there any program who could show this ? The headers and so on ? Bcz the IE only shows the HTML file .. thx .. Cya ! Daniel ---End Message--- ---BeginMessage--- The following php script successfully e-mails both messages but it doesn't update in the table scr_149 the column notified. Why? ?php $connection=mysql_connect(localhost,wagner,123) or die (No connection!); $db=mysql_select_db(sbwresearch_com,$connection) or die (No database!); $message_1= Congratulations!\n\n You've qualified to take the online survey # 149.\n\n To take the survey, go to www.sbwresearch.com and click on Survey / Tests.\n\n ; $message_2= Sorry!\n\n You've not qualified to take the online survey # 149.\n\n We'll notify you by e-mail of upcoming screeners. ; $qry_1=select * from scr_149 where q05a!=\0\ notified=\n\; $qry_2=update scr_149 set notified='y' where username='$username'; $result_1=mysql_query($qry_1,$connection) or die (No query # 1!); while ($row_1=mysql_fetch_array($result_1, MYSQL_ASSOC)) { $username=$row_1[username]; $e_mail=$row_1[e_mail]; mail($e_mail, News from SBW
[PHP] To you know-it-all's out there...
Yeah this is a BIT of topic... I have this code: ? header(Content-type: image/svg+xml); print('?xml version=1.0 encoding=iso-8859-1?'); ? ?php $text=This page uses PHP and SVG; ? !DOCTYPE svg PUBLIC -//W3C//DTD SVG 2303 Stylable//EN http://www.w3.org/TR/2000/03/WD-SVG-2303/DTD/svg-2303-stylable.dtd; svg xml:space=preserve width=100% height=20 descUsing styles/desc rect style=fill:#33 x=0 y=0 width=100% height=145/ text x=50 y=70 style=text-anchor:left; fill:#cc; font-size:26; font-weight:15; font-family:Tahoma, Verdana; font-style:regular?php echo $text; ?/text /svg See for yourself at: http://www.torkiljohnsen.com/xperiment/index.psvg This produces an error message (which you can read at the same page). Why is this? I had an xml/svg specialist make this code and it works perfectly on his server... Anyone got ANY clue as to why this is happening? ehhh... does anyone know of any good XML/SVG mailing lists out there ? :S Didn't know where else to ask. - Torkil -- 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: To you know-it-all's out there...
Torkil Johnsen wrote: Yeah this is a BIT of topic... I have this code: ? header(Content-type: image/svg+xml); print('?xml version=1.0 encoding=iso-8859-1?'); ? ?php $text=This page uses PHP and SVG; ? !DOCTYPE svg PUBLIC -//W3C//DTD SVG 2303 Stylable//EN http://www.w3.org/TR/2000/03/WD-SVG-2303/DTD/svg-2303-stylable.dtd; svg xml:space=preserve width=100% height=20 descUsing styles/desc rect style=fill:#33 x=0 y=0 width=100% height=145/ text x=50 y=70 style=text-anchor:left; fill:#cc; font-size:26; font-weight:15; font-family:Tahoma, Verdana; font-style:regular?php echo $text; ?/text /svg See for yourself at: http://www.torkiljohnsen.com/xperiment/index.psvg This produces an error message (which you can read at the same page). Why is this? I had an xml/svg specialist make this code and it works perfectly on his server... Anyone got ANY clue as to why this is happening? It is not an error. The server just returns the script contents in plain text, so it is not executed as a PHP script. You need to configure your server to either process this script as a PHP script (it could be as simple as rename its extension to .php) or configure it to process all files with extension .psvg as PHP scripts. 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]
Re: [PHP] regular expressions
At 10:16 PM 1/5/2002 -0500, Gerard Samuel wrote: Need some help with this one. Dont know where to begin. I have content in a string and a constant that changes depending on if yourre in the root or in a directory. The purpose of the constant is to provide dynamic links. The string will have href links like a href=index.phpIndex/a I want to figure out a way to inject my constant value into the href like so a href='._CONSTANT'index.phpIndex/a I would like the rules to say, If string contains href= and there are alphanumerical chars .php place _CONSTANT between href= and alphanumerical chars I figure a regular expression, but I have no idea where to start.. This seems to work: ? define(_CONSTANT,/path/); $string = Click a href=\index.php\here/a to return to the main page.; echo insertpath($string); function insertpath($string) { return preg_replace(/(a href=\)(.*\.*\/a)/i,$1._CONSTANT.$2,$string); } ? Preg_replace allows you to use backreferences and access them via variables such as $1 and $2, etc. Earlier versions of PHP required you to use \\1, \\2 instead (see the documentation for preg_replace for more info). Each section of the regex that is in parenthesis can be accessed. In the above example, the (a href=\) section is reprinted in the replacement string by using $1, so on a so forth. The .* in the regex basically means match any old junk since the . refers to any single character and the * means match the previous character zero or more times. http://download.php.net/manual/en/function.preg-replace.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] regular expressions
At 10:22 PM 1/5/2002 -0600, Michael Sims wrote: function insertpath($string) { return preg_replace(/(a href=\)(.*\.*\/a)/i,$1._CONSTANT.$2,$string); } ? Forgot to mention that the i at the end of the regex means to make the match case-insensitive... -- 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] Checking the season
Hi This should work: ? $year = date(Y); $spring = mktime (0,0,0,3,21,$year); $summer = mktime (0,0,0,6,21,$year); $autumn = mktime (0,0,0,9,21,$year); $winter = mktime (0,0,0,12,21,$year); $now = mktime(); if($now $spring || $now = $winter): echo Winter; elseif($now = $autumn): echo Autumn; elseif($now = $summer): echo Summer; else: echo Spring; endif; ? BTW There may be a bug in mktime() (php4) if you use 08 or 09 in the month part...on my system this happens (linux/apache/php4.1) ? $autumn = mktime (0,0,0,09,21,2002); echo date = .date(d/m/Y,$autumn).br; ? This prints: date = 21/12/2001 Also prints the same date for a month of 08 Tom At 11:34 AM 6/01/02, webapprentice wrote: I'll have to use and if/elseif construct, because I don't believe a switch() constructs cases can take expressions, can it? - Original Message - From: Bogdan Stancescu [EMAIL PROTECTED] To: webapprentice [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Sent: Saturday, January 05, 2002 11:38 AM Subject: Re: [PHP] Checking the season You could do a case() or if/elseif, check if it's spring, summer or autumn and leave the code for winter as default/else. Bogdan webapprentice wrote: Hi, Just need a sounding board to help me think this through. I want to check the current date to determine what season it is and display the appropriate picture. I define spring as 03/21/, summer as 06/21/, autumn as 09/21/, and winter as 12/21/. I form a string for the current date and get a timestamp via mktime(). I also get the equivalent timestamps for the dates above for the seasonal changes. Then, I compare the current date to see if it's between the seasonal dates. The problem is when I go from 12/31/ to 01/01/(+1). Since winter and spring dates are one year apart, the current date timestamp comparison gets messed up and nothing displays. How do I do a proper comparison? I was thinking of just seeing if the current date timestamp is greater than each of the seasonal date timestamp, but it feels like I would miss something. Would I? Or is there another solution? Thank you for your time. --Stephen -- 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] Checking the season
Thanks for the code snippet. I see that everybody defaults to a season. I was doing a comparison between two seasons, so that's why it messed up when it into the new year. Thanks to Bogdan and Tom for the helpers. I can go debug my code. And make it less complicated. ^_^;;; (It's was a lot longer than what is here.) - Original Message - From: Tom Rogers [EMAIL PROTECTED] To: webapprentice [EMAIL PROTECTED]; Bogdan Stancescu [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Sent: Saturday, January 05, 2002 11:17 PM Subject: Re: [PHP] Checking the season Hi This should work: ? $year = date(Y); $spring = mktime (0,0,0,3,21,$year); $summer = mktime (0,0,0,6,21,$year); $autumn = mktime (0,0,0,9,21,$year); $winter = mktime (0,0,0,12,21,$year); $now = mktime(); if($now $spring || $now = $winter): echo Winter; elseif($now = $autumn): echo Autumn; elseif($now = $summer): echo Summer; else: echo Spring; endif; ? BTW There may be a bug in mktime() (php4) if you use 08 or 09 in the month part...on my system this happens (linux/apache/php4.1) ? $autumn = mktime (0,0,0,09,21,2002); echo date = .date(d/m/Y,$autumn).br; ? This prints: date = 21/12/2001 Also prints the same date for a month of 08 Tom At 11:34 AM 6/01/02, webapprentice wrote: I'll have to use and if/elseif construct, because I don't believe a switch() constructs cases can take expressions, can it? - Original Message - From: Bogdan Stancescu [EMAIL PROTECTED] To: webapprentice [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Sent: Saturday, January 05, 2002 11:38 AM Subject: Re: [PHP] Checking the season You could do a case() or if/elseif, check if it's spring, summer or autumn and leave the code for winter as default/else. Bogdan webapprentice wrote: Hi, Just need a sounding board to help me think this through. I want to check the current date to determine what season it is and display the appropriate picture. I define spring as 03/21/, summer as 06/21/, autumn as 09/21/, and winter as 12/21/. I form a string for the current date and get a timestamp via mktime(). I also get the equivalent timestamps for the dates above for the seasonal changes. Then, I compare the current date to see if it's between the seasonal dates. The problem is when I go from 12/31/ to 01/01/(+1). Since winter and spring dates are one year apart, the current date timestamp comparison gets messed up and nothing displays. How do I do a proper comparison? I was thinking of just seeing if the current date timestamp is greater than each of the seasonal date timestamp, but it feels like I would miss something. Would I? Or is there another solution? Thank you for your time. --Stephen -- 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] NEWBIE IN DISTRESS: Install Instructions are not work for PHP 4.1.1!!!
Nothing noted in the error log. The lines I have tried using are the EXACT ones stated in the install.txt file. I basically copied them from the install doc and pasted it into the httpd.conf file. Mark Brian Clark [EMAIL PROTECTED] wrote in message 20020105034518.GH17616@ganymede">news:20020105034518.GH17616@ganymede... * Mark ([EMAIL PROTECTED]) [Jan 04. 2002 12:14]: [...] the Module version (Get a Requested Operation Failed message). can someone please help? My system is as follows: Windows 2000 SP2 Apache 2.0.28 (I have also tried version 1.3.22 with same results as People had problems in that past with 2.x; I don't know if the php-dev's have worked that out yet. mentioned above) PHP 4.1.1 MDAC 2.7 MySQL 3.23.46a Are there any hints in Apache's error_log? What is your exact LoadModule line you're using in httpd.conf? -- Brian Clark | Avoiding the general public since 1805! Fingerprint: 07CE FA37 8DF6 A109 8119 076B B5A2 E5FB E4D0 C7C8 In politics, stupidity is not a handicap. -- 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] Is the 'dl' function a bad idea to use?
Hey, thanks for your time. You are busy, so I'll be brief A.) If I were to use it, for a gd or mysql library, not oftenly, certainly not more than 100 requests per day, would it affect the server negatively? B.) Is there a delay in using it as oppossed to compiling them during installation (or recompile) I ask as I am not familiar at all with this feature, but saw it in some code, (For ming, actually, to make flash movies) and it worked well for me So, if I use it, am I doing myself a disservice? Or not? Thanks, I have no clue Joel Ps. In case one asks why I'd use such a method, I am picklehead, no intelligent answer, can be provided, I am just curious as I wasn't really aware of such an option earlier on. Thanks ;)
[PHP] take links from url
I want to take string between table/table tags in put it in variable How can I do that ?