Re: [PHP-DB] PHP Command Line
Ryan Jameson (USA) wrote: Bummer... So I can't send the named variables as a query string? Well, this will work. Thanks! You could pass a querystring-style parameter to a script and then run it through http://php.net/parse_str but I can't see any benefit to doing that. -- Stuart -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] PHP and mail forms
There are several ways to do this. Some people like the approach: if ($submit) { send_email(); } or you can put a hidden field in your form, like op: input name=op type=hidden id=op value=send / and use: if (isset($HTTP_GET_VARS['op']) ($HTTP_GET_VARS['op'] == 'send')) { send_email(); } and there are many others. by the way in the code you wrote you have: form method=post . and then you use: $id=$_GET['id']; --- if this is the same than $HTTP_GET_VARS['id'] this wont work Where does that mail function (is it a function?) go? The function sends an email, for more details consult the php manual. - Original Message - From: Phil Matt [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, January 29, 2004 7:10 PM Subject: [PHP-DB] PHP and mail forms Hello to all. I am trying to write a simple (at least I thought it was simple...) Contact Us form that sends an email when it is submitted. The $to_name variable was passed from a previous page. I am sure that the variable was passed, as I can echo it and it is being passed correctly - thanks to this list! The problem I am having is this: I cannot quite figure out how an html form handles this mail function when the to field is filled with an existing variable. This is what I've got: (I removed all of the table formatting to make it clearer here) form name=mailer method=post action=? $_SERVER['PHP_SELF']; ? input name=from_name type=text id=from_name value=?=$from_name? input name=from_email type=text id=from_email value=?=$from_email? input name=subject type=text id=subject value=?=$subject? size=60 textarea name=message cols=55 rows=15 id=message?=$message?/textarea input name=userid type=hidden id=userid value=?$to_name? / input type=submit name=Submit value=mail So, I think that this sets up the form for processing, AFAIK. Then, I added the stuff that pulls the email address associated with the id in $to_name from the MySQL database, and adds the string for the proper domain. I've left out the connection stuff for clarity: $id=$_GET['id']; $string=@somedomain.com; $result= mysql_query(SELECT * FROM mydatabase WHERE ID=$id,$db); while ($myrow = mysql_fetch_row($result)){ $to_name=$myrow[3]$string; } ? I know that the thing that actually sends mail looks like this: mail($to_name, $from_name, $subject, $message, From: $from_email\nX-Mailer: PHP/ .. phpversion()); But how do I get this all to happen when the user hits the submit button? Where does that mail function (is it a function?) go? I have read a lot of stuff on the various PHP lists and sources, but I just cannot figure out this piece of the puzzle. TIA for your suggestions, and for your patience with my lack of knowledge here. -- Phil Matt -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] getting font size from browser
Is it possible to retreive the font size or view size from the browser. In the browser it is possible to change the screenview (make it larger or smaller for people with a visual aid). I would like to ineract my stylesheet with these default settings. thans Roy -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] getting font size from browser
PHP is SERVER side, not browser side. That's a Javascript question. Miles At 11:14 AM 1/30/2004 +0100, Roy G. Vervoort wrote: Is it possible to retreive the font size or view size from the browser. In the browser it is possible to change the screenview (make it larger or smaller for people with a visual aid). I would like to ineract my stylesheet with these default settings. thans Roy -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP-DB] getting font size from browser
php cannot read the sizes directly, but you can use javascript to pass information to php and then use that This is a routine I use to get screen size SCRIPT language=JavaScript !-- var screensize = screen.width; if (screensize = 640){ window.location = 'index.php?screensize=640x480' ; } else if (screensize = 800){ window.location = 'index.php?screensize=800x600' ; } else { window.location = 'index.php ; } // -- /SCRIPT this is on an opening page - which redirects to another page, passing parameters to php as it goes. HTH Peter -Original Message- From: Miles Thompson [mailto:[EMAIL PROTECTED] Sent: 30 January 2004 13:24 To: [EMAIL PROTECTED] Subject: Re: [PHP-DB] getting font size from browser PHP is SERVER side, not browser side. That's a Javascript question. Miles At 11:14 AM 1/30/2004 +0100, Roy G. Vervoort wrote: Is it possible to retreive the font size or view size from the browser. In the browser it is possible to change the screenview (make it larger or smaller for people with a visual aid). I would like to ineract my stylesheet with these default settings. thans Roy -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] ODBTP 1.1 Released for MSSQL, Access, FoxPro ODBC
ODBTP version 1.1 has been released is available at http://odbtp.sourceforge.net Many new functions and enhancements have been added to the odbtp extension. The changes make it the best PHP solutiion for connecting to MSSQL, Access, FoxPro and other Win32 ODBC accessible databases from any platform. Its native connection pool eliminates the need for persistent connectinns. All of the functions from the mssql extension are optionally supported. This means that existing PHP scripts that use the mssql extension would not have to modified to use ODBTP. The odbtp/mssql hybrid extension's performance and capabilities exceed both the FreeTDS (UNIX / Linux) and DB-Library (Win32) versions of the mssql extension. ODBTP uses Microsoft's ODBC driver for SQL Server, which is superior to FreeTDS and DB-Library when connecting to SQL Server 2000 databases. And, unlike the mssql extension, the odbtp/mssql extensinn's behaviour is exactly the same on all platforms. While the functions from the odbc extension are not supported, the odbtp extension provides better support for ODBC. Most of the odbc extension's limitations are caused by its use of ODVC 2 instead of ODBC 3, which is used by ODBTP. The odbtp extension is also considerably faster. Rather than further elaborating on why odbtp is the best sulution, which is obviously biased, the best thing is for users of the mssql and / or odbc extensions to try the odbtp extension. Not until then will they be able to determine whether or not the aforementioned is correct. And, to make it easy to try odbtp, a PEAR DB driver is included in the package. -- bob -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] PHP and mail forms
Ricardo Lopes wrote: There are several ways to do this. Some people like the approach: if ($submit) { send_email(); } or you can put a hidden field in your form, like op: input name=op type=hidden id=op value=send / and use: if (isset($HTTP_GET_VARS['op']) ($HTTP_GET_VARS['op'] == 'send')) { send_email(); } Thanks again, Ricardo. I now have the form communicating with the server. I think that I might have an error in my script: Where I join together the value of the passed variable ($myrow[3]) and the string containing the domain ( $string=@somedomain.com) I used: $to_name=$myrow[3]$string If the passed variable's value is, for instance, smith, then does my $to_name become: [EMAIL PROTECTED] On hitting the submit button, I see the server being called and data being sent, but nothing is being received. I'm just wondering if I've appended those two things correctly. TIA for your continued assistance. Cheers --- Phil -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] PHP and mail forms
I would recomed you to use: $to_name=$myrow[3].$string; -- Notice the dot . and no instead of: $to_name=$myrow[3]$string; On hitting the submit button, I see the server being called and data being sent, but nothing is being received. I'm just wondering if I've appended those two things correctly. If you mean the server sends the email but it isnt recived in the other server i can't help you i dont use the mail function, in this kind of questions you should use the other mailing list instead of this, this is only from database questions related to php. Good luck. BTW i guess there are other function you could use for sending email instead of mail consult the php documentation to know more. - Original Message - From: Phil Matt [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Friday, January 30, 2004 4:18 PM Subject: [PHP-DB] PHP and mail forms Ricardo Lopes wrote: There are several ways to do this. Some people like the approach: if ($submit) { send_email(); } or you can put a hidden field in your form, like op: input name=op type=hidden id=op value=send / and use: if (isset($HTTP_GET_VARS['op']) ($HTTP_GET_VARS['op'] == 'send')) { send_email(); } Thanks again, Ricardo. I now have the form communicating with the server. I think that I might have an error in my script: Where I join together the value of the passed variable ($myrow[3]) and the string containing the domain ( $string=@somedomain.com) I used: $to_name=$myrow[3]$string If the passed variable's value is, for instance, smith, then does my $to_name become: [EMAIL PROTECTED] On hitting the submit button, I see the server being called and data being sent, but nothing is being received. I'm just wondering if I've appended those two things correctly. TIA for your continued assistance. Cheers --- Phil -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] plPHP and php mail() example
Here is a simple function that takes 4 arguments ($arg0-3) and utilizes the php mail() function. I added the headers for an example of how easy it is to utilize plPHP in PostgreSQL. CREATE OR REPLACE FUNCTION phpmail(text,text,text,text) RETURNS integer AS ' # Argument list $email_address = $arg0; $email_from = $arg1; $subject = $arg2; $body = $arg3; # # ..Typically, you would validate arguments here # Build email headers $headers = From: $email_from\r\n; $headers .= Reply-To: $email_from\r\n; $headers .= X-Mailer: plPHP; # Send email if (mail($email_address, $subject, $body, $headers)) { return 1; } else { return 0; } ' LANGUAGE 'plphp'; # # Usage # plphp_test=# SELECT phpmail('[EMAIL PROTECTED]', '[EMAIL PROTECTED]', 'Subject Line', 'This is the email body\n\nMore body. Testing email. Test!\n\n\n-Robby') as email; INFO: ret_val(long): 1 email --- 1 (1 row) # # Output # [EMAIL PROTECTED] typed this on 01/30/2004 08:34 AM: This is a body More body. Testing email. Test! -Robby Feel free to join the plPHP mailing list as well. http://mail.commandprompt.com/mailman/listinfo/plphp Cheers, Robby Russell -- #--- # Robby Russell, | Sr. Administrator / Lead Programmer # Command Prompt, Inc. | http://www.commandprompt.com # [EMAIL PROTECTED] | Telephone: (503) 667.4564 #--- -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] counting a value
i want to know what i can use to count the number of times a value appears in a column listing where different values are listed. for example, say in the column of Favorite Number we have 100 students, and for each student his or her own row. and each student can pick a number from 1-10. So, we have a column of 100 rows and each field can contain either 1-10.Now, i want to know how can i count the number of times lets say the #2 appears in this list and give that count a number. so if #2 appears 43 times in that column, then i want it to say 2 is listed 43 times. how do i do this? thank you for your help with my beginner newbie questions. -james
Re: [PHP-DB] counting a value
You have to be know SQL language to achieve this. I recommend you start getting familiar with this, it will open a whole world to you. Going by your example favorite having values 1-10: Table name: stats table fields: name, lastname,midinit,dob,country,state,address,favorite //backendfunction = odbc_exec( ), mysql_query( ), etc. $query = Select count(favorite) from stats group by favorite ; $result = backendfunction($myconn,$query); This will give you a result with all the totals that you can later access using the functions to cycle through result sets. Rock Roll! - Original Message - From: js [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Friday, January 30, 2004 12:07 PM Subject: [PHP-DB] counting a value i want to know what i can use to count the number of times a value appears in a column listing where different values are listed. for example, say in the column of Favorite Number we have 100 students, and for each student his or her own row. and each student can pick a number from 1-10. So, we have a column of 100 rows and each field can contain either 1-10.Now, i want to know how can i count the number of times lets say the #2 appears in this list and give that count a number. so if #2 appears 43 times in that column, then i want it to say 2 is listed 43 times. how do i do this? thank you for your help with my beginner newbie questions. -james -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] counting a value
js typed this on 01/30/2004 10:07 AM: i want to know what i can use to count the number of times a value appears in a column listing where different values are listed. for example, say in the column of Favorite Number we have 100 students, and for each student his or her own row. and each student can pick a number from 1-10. So, we have a column of 100 rows and each field can contain either 1-10.Now, i want to know how can i count the number of times lets say the #2 appears in this list and give that count a number. so if #2 appears 43 times in that column, then i want it to say 2 is listed 43 times. how do i do this? thank you for your help with my beginner newbie questions. -james If your table was like this (in postgresql in this example): CREATE TABLE student_numbers ( id SERIAL, student_id int, fav_num int ); Now I have inserted in 9 rows of student id's and favorite numbers. # SELECT fav_num as Favorite Number, count(*) FROM student_number GROUP BY fav_num; Favorite Number | count -+--- 1 | 1 2 | 3 3 | 1 5 | 3 7 | 1 Cheers, Robby Russell -- #--- # Robby Russell, | Sr. Administrator / Lead Programmer # Command Prompt, Inc. | http://www.commandprompt.com # [EMAIL PROTECTED] | Telephone: (503) 667.4564 #--- -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] counting a value
SELECT favourite_nb, COUNT(*) AS tally FROM mytable GROUP BY favourite_nb HTH Ignatius _ - Original Message - From: js [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Friday, January 30, 2004 19:07 Subject: [PHP-DB] counting a value i want to know what i can use to count the number of times a value appears in a column listing where different values are listed. for example, say in the column of Favorite Number we have 100 students, and for each student his or her own row. and each student can pick a number from 1-10. So, we have a column of 100 rows and each field can contain either 1-10.Now, i want to know how can i count the number of times lets say the #2 appears in this list and give that count a number. so if #2 appears 43 times in that column, then i want it to say 2 is listed 43 times. how do i do this? thank you for your help with my beginner newbie questions. -james -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] Mail Function
Evening all, I've written a script which sends emails, there is no problem with that. I was wondering how I can check for email bounces, anyone know how to do that? Cheers, G :) -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] test post
please delete this -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] Mail Function
From: Graeme McLaren [EMAIL PROTECTED] Evening all, I've written a script which sends emails, there is no problem with that. I was wondering how I can check for email bounces, anyone know how to do that? There's no direct, easy way. You'll have to write/aquire a PHP script that logs into a mail server and checks your mail for bounces and reacts accordingly. PHP offers the function to log into mail servers. Check the manual. ---John Holmes... -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] Mail Function
Your script actually connects to an SMTP server and sends the email? If this is the case, you can have your script look for success/error messages returned by the server when it sends - unless you're delivering to an AOL address. AOL accepts everything you throw at it and then sends back a notification of success/failure via email...sometimes. There are a few other servers that act the same way, but AOL is the biggest culprit in making an email list manager's life a living hell. I've actually been kicking around the idea of a PHP-based list manager that will also go through bounce notifications but haven't done anything more than that. The biggest hurdle is getting through the bounced messages. --JMR Graeme McLaren wrote: Evening all, I've written a script which sends emails, there is no problem with that. I was wondering how I can check for email bounces, anyone know how to do that? Cheers, G :) -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] SQLite PRIMARY KEY.
I'm trying to get my PHP code to INSERT a new row and have the PRIMARY KEY field automatically set to the next available integer. I read, somewhere, that if I send null as the primary key value then SQLite will automatically incrememnt it for me. I've tried sending all sorts of things that I thought might work, but as yet I have not been able to get it right. Can someone please help me? Regards, Stuart Gilbert. -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] SQLite PRIMARY KEY.
Well, it appears I tried everything except JUST the word NULL. Sorry for wasting your time. Regards, Stuart Gilbert. Stuart Gilbert wrote: I'm trying to get my PHP code to INSERT a new row and have the PRIMARY KEY field automatically set to the next available integer. I read, somewhere, that if I send null as the primary key value then SQLite will automatically incrememnt it for me. I've tried sending all sorts of things that I thought might work, but as yet I have not been able to get it right. Can someone please help me? Regards, Stuart Gilbert. -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] counting a value REVISED pt2
p.s.- im using PHP with MySQL... if that helps any. thanks i want to know what i can use to count the number of times a value appears in a column listing where different values are listed. for example, say in the column of Favorite Number we have 100 students, and for each student his or her own row. and each student can pick a number from 1-10. So, we have a column of 100 rows and each field can contain either 1-10.Now, i want to know how can i count the number of times lets say the #2 appears in this list and give that count a number. so if #2 appears 43 times in that column, then i want it to say 2 is listed 43 times. how do i do this? thank you for your help with my beginner newbie questions. -james
Re: [PHP-DB] counting a value REVISED pt2
select count(FavNum) as Favorite where FavNum = 2; On Fri January 30 2004 8:19 pm, js wrote: p.s.- im using PHP with MySQL... if that helps any. thanks i want to know what i can use to count the number of times a value appears in a column listing where different values are listed. for example, say in the column of Favorite Number we have 100 students, and for each student his or her own row. and each student can pick a number from 1-10. So, we have a column of 100 rows and each field can contain either 1-10.Now, i want to know how can i count the number of times lets say the #2 appears in this list and give that count a number. so if #2 appears 43 times in that column, then i want it to say 2 is listed 43 times. how do i do this? thank you for your help with my beginner newbie questions. -james -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] counting a value REVISED pt2
js wrote: p.s.- im using PHP with MySQL... if that helps any. thanks i want to know what i can use to count the number of times a value appears in a column listing where different values are listed. for example, say in the column of Favorite Number we have 100 students, and for each student his or her own row. and each student can pick a number from 1-10. So, we have a column of 100 rows and each field can contain either 1-10.Now, i want to know how can i count the number of times lets say the #2 appears in this list and give that count a number. so if #2 appears 43 times in that column, then i want it to say 2 is listed 43 times. how do i do this? thank you for your help with my beginner newbie questions. -james Did you really review your question much? Do you have a php script that has connected to the database already? -Robby -- Robby Russell, | Sr. Administrator / Lead Programmer Command Prompt, Inc. | http://www.commandprompt.com [EMAIL PROTECTED] | Telephone: (503) 222.2783 -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] Re: [PHP] Oracle + PHP
Luis Moran Ochoa wrote: ORACLE_SID=OWEB ;export ORACLE_SID; ORACLE_HOME=/usr/oracle/product; export ORACLE_HOME; TNS_ADMIN=/usr/oracle/product/network/admin; export TNS_ADMIN; ORACLE_BASE=/usr/oracle; export ORACLE_BASE; ORA_NLS33=/usr/oracle/product/ocommon/nls/admin/data; export ORA_NLS33; ORA_NLS=/usr/oracle/product/ocommon/nls/admin/data; export ORA_NLS; NLS_LANG=spanish_spain.we8dec; export NLS_LANG; TNS_ADMIN=/usr/oracle/product/network/admin; export TNS_ADMIN; CLASSPATH=:/usr/local/jre:/usr/oracle/product/jdbc/lib/classes111.zip: export CLASSPATH; LD_LIBRARY_PATH=/usr/oracle/product/lib:/usr/oracle/product/jdbc/lib: export LD_LIBRARY_PATH Perhaps some variables are set in the start script, but not in your root shell. Put a export /tmp/apache-start in the start script to see which variables are set. Boot, move /tmp/apache-start to /tmp/apache-boot, stop apache, start apache from your root shell. diff -u /tmp/apache-boot /tmp/apache-start will show the differences. Or try to unset the locale variables in the start script: unset LANG LC_CTYPE LC_NUMERIC LC_TIME LC_COLLATE LC_MONETARY LC_MESSAGES LC_PAPER LC_NAME LC_ADDRESS LC_TELEPHONE LC_MEASUREMENT LC_IDENTIFICATION LC_ALL Some parts of Apache/Oracle/whatever-else apparently has trouble with locales. Regards... Michael -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php