RE: [PHP-DB] Email Form
Hi, Combine the two scripts Begin script Accept the post variables Insert them into the database Mail them End script jack -Original Message- From: Philip O'Rourke [mailto:[EMAIL PROTECTED] Sent: Tuesday, September 16, 2003 10:46 AM To: [EMAIL PROTECTED] Subject: [PHP-DB] Email Form I am new to PHP and need some help with an form mail problem. Basically i know how to get a form to submit data to MySQL and I know how email the content of a form. But how do i get a form to do both? -- 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] Email Form
Hi Jcck, here is an example of how I'm connecting to the database to complete a registration process. What I'm trying to get at is where to insert the relevant email code. ?php require_once('../Connections/casu.php'); ??php session_start(); function GetSQLValueString($theValue, $theType, $theDefinedValue = , $theNotDefinedValue = ) { $theValue = (!get_magic_quotes_gpc()) ? addslashes($theValue) : $theValue; switch ($theType) { case text: $theValue = ($theValue != ) ? ' . $theValue . ' : NULL; break; case long: case int: $theValue = ($theValue != ) ? intval($theValue) : NULL; break; case double: $theValue = ($theValue != ) ? ' . doubleval($theValue) . ' : NULL; break; case date: $theValue = ($theValue != ) ? ' . $theValue . ' : NULL; break; case defined: $theValue = ($theValue != ) ? $theDefinedValue : $theNotDefinedValue; break; } return $theValue; } $editFormAction = $HTTP_SERVER_VARS['PHP_SELF']; if (isset($HTTP_SERVER_VARS['QUERY_STRING'])) { $editFormAction .= ? . $HTTP_SERVER_VARS['QUERY_STRING']; } if ((isset($HTTP_POST_VARS[MM_update])) ($HTTP_POST_VARS[MM_update] == form1)) { $updateSQL = sprintf(UPDATE users SET user_name=%s, fName=%s, sName=%s, job=%s, org=%s, org_type=%s, address=%s, postCode=%s, tel=%s, email=%s, c_of_c=%s, newsletter=%s, appTime=%s, group_id=%s, status=%s, drowssap=%s WHERE id=%s, GetSQLValueString($HTTP_POST_VARS['user_name'], text), GetSQLValueString($HTTP_POST_VARS['fName'], text), GetSQLValueString($HTTP_POST_VARS['sName'], text), GetSQLValueString($HTTP_POST_VARS['job'], text), GetSQLValueString($HTTP_POST_VARS['org'], text), GetSQLValueString($HTTP_POST_VARS['org_type'], text), GetSQLValueString($HTTP_POST_VARS['address'], text), GetSQLValueString($HTTP_POST_VARS['postCode'], text), GetSQLValueString($HTTP_POST_VARS['tel'], text), GetSQLValueString($HTTP_POST_VARS['email'], text), GetSQLValueString(isset($HTTP_POST_VARS['c_of_c']) ? true : , defined,'Y','N'), GetSQLValueString(isset($HTTP_POST_VARS['newsletter']) ? true : , defined,'Y','N'), GetSQLValueString($HTTP_POST_VARS['appTime'], date), GetSQLValueString($HTTP_POST_VARS['group_id'], int), GetSQLValueString($HTTP_POST_VARS['status'], int), GetSQLValueString($HTTP_POST_VARS['drowssap'], text), GetSQLValueString($HTTP_POST_VARS['id'], int)); mysql_select_db($database_casu, $casu); $Result1 = mysql_query($updateSQL, $casu) or die(mysql_error()); $updateGoTo = new_member.php; if (isset($HTTP_SERVER_VARS['QUERY_STRING'])) { $updateGoTo .= (strpos($updateGoTo, '?')) ? : ?; $updateGoTo .= $HTTP_SERVER_VARS['QUERY_STRING']; } header(sprintf(Location: %s, $updateGoTo)); } ? ?php $varSearch_rsUserDetails = 1; if (isset($HTTP_SESSION_VARS['userSession'])) { $varSearch_rsUserDetails = (get_magic_quotes_gpc()) ? $HTTP_SESSION_VARS['userSession'] : addslashes($HTTP_SESSION_VARS['userSession']); } mysql_select_db($database_casu, $casu); $query_rsUserDetails = sprintf(SELECT * FROM users WHERE id = '%s', $varSearch_rsUserDetails); $rsUserDetails = mysql_query($query_rsUserDetails, $casu) or die(mysql_error()); $row_rsUserDetails = mysql_fetch_assoc($rsUserDetails); $totalRows_rsUserDetails = mysql_num_rows($rsUserDetails); ? html head titleUntitled Document/title meta http-equiv=Content-Type content=text/html; charset=iso-8859-1 /head body form method=post name=form1 action=?php echo $editFormAction; ? table align=center tr valign=baseline td nowrap align=rightId:/td td?php echo $row_rsUserDetails['id']; ?/td /tr tr valign=baseline td nowrap align=rightUser_name:/td tdinput type=text name=user_name value=?php echo $row_rsUserDetails['user_name']; ? size=32 /td /tr tr valign=baseline td nowrap align=rightFName:/td tdinput type=text name=fName value=?php echo $row_rsUserDetails['fName']; ? size=32 /td /tr tr valign=baseline td nowrap align=rightSName:/td tdinput type=text name=sName value=?php echo $row_rsUserDetails['sName']; ? size=32 /td /tr tr valign=baseline td nowrap align=rightJob:/td tdinput type=text name=job value=?php echo $row_rsUserDetails['job']; ? size=32 /td /tr tr valign=baseline td nowrap align=rightOrg:/td tdinput type=text name=org value=?php echo $row_rsUserDetails['org']; ? size=32 /td /tr tr valign=baseline td nowrap align=rightOrg_type:/td tdinput type=text name=org_type value=?php echo $row_rsUserDetails['org_type']; ? size=32 /td /tr tr
Re: [PHP-DB] Email Form
My Last post seems to have generated some sort of spam alert, so I'll attach the file. Jacob A. Van Zanen [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Hi, Combine the two scripts Begin script Accept the post variables Insert them into the database Mail them End script jack -Original Message- From: Philip O'Rourke [mailto:[EMAIL PROTECTED] Sent: Tuesday, September 16, 2003 10:46 AM To: [EMAIL PROTECTED] Subject: [PHP-DB] Email Form I am new to PHP and need some help with an form mail problem. Basically i know how to get a form to submit data to MySQL and I know how email the content of a form. But how do i get a form to do both? -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php begin 666 example.php M/#]P:' @F5Q=6ER95]O;F-E*N+B]#;VYN96-T:6]NR]C87-U+G!HI M.R _/CP_AP#0IS97-S:6]N7W-T87)T*D[#0H-F9U;F-T:6]N($=E=%-1 M3%9A;'5E4W1R:6YG*1T:5686QU92P@)'1H951Y4L(1T:5$969I;F5D M5F%L=64@/2 B(BP@)'1H94YO=$1E9FEN961686QU92 ]((B*2 -GL-B @ M)'1H959A;'5E([EMAIL PROTECTED]%G971?;6%G:6-?75O=[EMAIL PROTECTED] _(%D9'-L M87-H97,H)'1H959A;'5E*2 Z(1T:5686QU93L-@T*(!S=VET8V@@*1T M:547!E*2![#0H@( @8V%S92 B=5X=(Z#0H@( @( D=AE5F%L=64@ M/2 H)'1H959A;'5E($]((B*2 _((G(B N(1T:5686QU92 N((G(B Z M().54Q,(CL-B @( @()R96%K.R @( -B @(!C87-E()L;VYG(CH- MB @(!C87-E()I;[EMAIL PROTECTED]( @( @)'1H959A;'5E([EMAIL PROTECTED]1T:5686QU M92 A/2 B(BD@/R!I;G1V86PH)'1H959A;'5E*2 Z().54Q,(CL-B @( @ M()R96%K.PT*( @(-AV4@(F1O=6)L92(Z#0H@( @( D=AE5F%L=64@ M/2 H)'1H959A;'5E($]((B*2 _((G(B N(1O=6)L979A;@D=AE5F%L M=64I(X@(BB(#H@(DY53$PB.PT*( @( @8G)E86L[#0H@( @8V%S92 B M9%T92(Z#0H@( @( D=AE5F%L=64@/2 H)'1H959A;'5E($]((B*2 _ M((G(B N(1T:5686QU92 N((G(B Z().54Q,(CL-B @( @()R96%K M.PT*( @(-AV4@([EMAIL PROTECTED]( @( @)'1H959A;'5E([EMAIL PROTECTED]1T M:5686QU92 A/2 B(BD@/R D=AE15F:6YE9%9A;'5E(#H@)'1H94YO=$1E M9FEN961686QU93L-B @( @()R96%K.PT*(!]#0H@(')E='5R;B D=AE M5F%L=64[#0I]#0H-B1E9ET1F]R;4%C=EO;B ](1(5%107U-%4E9%4E]6 M05)36R=02%!?4T5,1B==.PT*:[EMAIL PROTECTED]ESV5T*1(5%107U-%4E9%4E]605)3 M6R=1545265]35%))3DG72DI('L-B @)5D:71;W)M06-T:6]N(X]((_ M(B N(1(5%107U-%4E9%4E]605)36R=1545265]35%))3DG73L-GT-@T* M:[EMAIL PROTECTED]AIW-E=@D2%144%]03U-47U9!4E-;(DU-7W5P9%T92)=*2D@)B8@ M*1(5%107U!/4U1?5D%24ULB34U?=7!D871E(ET@/3T@(F9OFTQ(BDI('L- MB @)'5P9%T95-13 ]('-PFEN=8H(E501$%412!UV5R[EMAIL PROTECTED] ME]N86UE/25S+!F3F%M93TERP@TYA;64])7,L(IO8CTERP@;W)G/25S M+!OF=?='EP93TE[EMAIL PROTECTED]F5SSTERP@]S=$-O94])7,L('1E;#TE M[EMAIL PROTECTED]:6P])7,L(-?;V9?8STERP@;F5WVQE='1ECTE[EMAIL PROTECTED]EM M93TE[EMAIL PROTECTED])O=7!?:60])7,L('-T871USTE[EMAIL PROTECTED]')O=W-S87 ])7,@5TA% M4D4@:60])7,B+ T*( @( @( @( @( @( @( @(!'971344Q686QU M95-T[EMAIL PROTECTED];)W5S97)?;F%M92==+ B=5X=(I M+ T*( @( @( @( @( @( @( @(!'971344Q686QU95-T[EMAIL PROTECTED] M2%144%]03U-47U9!4E-;)V9.86UE)UTL()T97AT(BDL#0H@( @( @( @ M( @( @( @( @($=E=%-13%9A;'5E4W1R:6YG*1(5%107U!/4U1?5D%2 M4ULGTYA;64G72P@(G1E'0B*2P-B @( @( @( @( @( @( @( @ M1V5T4U%,5F%L=653=')I;FH)$A45%!?4$]35%]605)36R=J;V(G72P@(G1E M'0B*2P-B @( @( @( @( @( @( @( @1V5T4U%,5F%L=653=')I M;FH)$A45%!?4$]35%]605)36R=OFG72P@(G1E'0B*2P-B @( @( @ M( @( @( @( @( @1V5T4U%,5F%L=653=')I;FH)$A45%!?4$]35%]6 M05)36R=OF=?='EP92==+ B=5X=(I+ T*( @( @( @( @( @( @ M( @(!'971344Q686QU95-T[EMAIL PROTECTED];)V%D9')E MW,G72P@(G1E'0B*2P-B @( @( @( @( @( @( @( @1V5T4U%, M5F%L=653=')I;FH)$A45%!?4$]35%]605)36R=P;W-T0V]D92==+ B=5X M=(I+ T*( @( @( @( @( @( @( @(!'971344Q686QU95-TFEN [EMAIL PROTECTED];)W1E;==+ B=5X=(I+ T*( @( @( @ M( @( @( @( @(!'971344Q686QU95-T[EMAIL PROTECTED] M4E-;)V5M86EL)UTL()T97AT(BDL#0H@( @( @( @( @( @( @( @ M($=E=%-13%9A;'5E4W1R:6YG*ESV5T*1(5%107U!/4U1?5D%24ULG8U]O M9E]C)UTI(#\@(G1R=64B(#H@(B(L()D969I;F5D(BPB)UDG(BPB)TXG(BDL M#0H@( @( @( @( @( @( @( @($=E=%-13%9A;'5E4W1R:6YG*ES MV5T*1(5%107U!/4U1?5D%24ULG;F5WVQE='1EB==*2 _()TG5E(B Z M((B+ B95F:6YE9(L(B=9)R(L(B=.)R(I+ T*( @( @( @( @( @ M( @( @(!'971344Q686QU95-T[EMAIL PROTECTED];)V%P M%1I;64G72P@(F1A=4B*2P-B @( @( @( @( @( @( @( @1V5T M4U%,5F%L=653=')I;FH)$A45%!?4$]35%]605)36R=GF]U%]I9==+ B M:6YT(BDL#0H@( @( @( @( @( @( @( @($=E=%-13%9A;'5E4W1R M:6YG*1(5%107U!/4U1?5D%24ULGW1A='5S)UTL()I;G0B*2P-B @( @ M( @( @( @( @( @( @1V5T4U%,5F%L=653=')I;FH)$A45%!?4$]3 M5%]605)36R=DF]WW-A==+ B=5X=(I+ T*( @( @( @( @( @ M( @( @(!'971344Q686QU95-T[EMAIL PROTECTED];)VED M)UTL()I;G0B*2D[#0H-B @;7ES6Q?V5L96-T7V1B*1D871A8F%S95]C M87-U+ D8V%S=2D[#0H@(1297-U;'0Q(#T@;7ES6Q?75EGDH)'5P9%T M95-13P@)-AW4I(]R(1I92AM7-Q;%]EG)O[EMAIL PROTECTED]@T*( D=7!D M871E1V]4;R ]()N97=?;65M8F5R+G!H([#0H@(EF(AIW-E=@D2%14 M4%]315)615)?5D%24ULG455%4EE?4U1224Y')UTI*2![#0H@( @)'5P9%T M94=O5[EMAIL PROTECTED]@*'-TG!O[EMAIL PROTECTED];RP@)S\G*2D@/R B)B(@.B B M/R([#0H@( @)'5P9%T94=O5[EMAIL PROTECTED]@)$A45%!?4T525D527U9!4E-;)U%5 M15)97U-44DE.1R==.PT*(!]#0H@(AE861EBAS')I;G1F*),;V-A=EO M;CH@)7,B+ D=7!D871E1V]4;RDI.PT*?0T*/SX-@T*/#]P:' -B1V87)3 M96%R8VA?G-5V5R15T86ELR ]((Q(CL-FEF(AIW-E=@D2%144%]3
RE: [PHP-DB] email form
Try the mail function, you can get creative and use html as well. It's documented: http://www.php.net/manual/en/function.mail.php Ryan -Original Message- From: Ryan Holowaychuk [mailto:[EMAIL PROTECTED]] Sent: Tuesday, December 10, 2002 4:23 PM To: [EMAIL PROTECTED] Subject: [PHP-DB] email form I am trying to figure out how to take the data that I have collected in a form and format it into another page basically a bunch of tables and graphics, and then email that form to a specific email address. I have been able to get it to collect, place into the page, but now how to email the complete form?? Does anybody have an idea??? Thanks Ryan -- 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] email form
This is where I am stuck, I can not get the variables to be placed in to the email. /* message */ $message = ' html head titleQuote Request/title /head body font size=4 face=Arial, Helvetica, sans-serif font color=#FF table width=105% border=0 cellspacing=3 cellpadding=2 tr td width=123 height=26font size=2 face=Arial, Helvetica, sans-serifCustomer: = $customer /font/td etc. I believe that I am not using the proper syntax for placing the customer field ($customer) The form still emails, but with no data in there, just he input as I have put it -Original Message- From: Ryan Holowaychuk [mailto:[EMAIL PROTECTED]] Sent: Tuesday, December 10, 2002 3:23 PM To: [EMAIL PROTECTED] Subject: [PHP-DB] email form I am trying to figure out how to take the data that I have collected in a form and format it into another page basically a bunch of tables and graphics, and then email that form to a specific email address. I have been able to get it to collect, place into the page, but now how to email the complete form?? Does anybody have an idea??? Thanks Ryan -- 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] email form
Hi, When you use single quotes to define your strings php variables will not be replaced. Try $message = ...$customer..; You will have to escape all double quotes used in the string (\) or use single quote. - Frank This is where I am stuck, I can not get the variables to be placed in to the email. /* message */ $message = ' html head titleQuote Request/title /head body font size=4 face=Arial, Helvetica, sans-serif font color=#FF table width=105% border=0 cellspacing=3 cellpadding=2 tr td width=123 height=26font size=2 face=Arial, Helvetica, sans-serifCustomer: = $customer /font/td etc. I believe that I am not using the proper syntax for placing the customer field ($customer) The form still emails, but with no data in there, just he input as I have put it -Original Message- From: Ryan Holowaychuk [mailto:[EMAIL PROTECTED]] Sent: Tuesday, December 10, 2002 3:23 PM To: [EMAIL PROTECTED] Subject: [PHP-DB] email form I am trying to figure out how to take the data that I have collected in a form and format it into another page basically a bunch of tables and graphics, and then email that form to a specific email address. I have been able to get it to collect, place into the page, but now how to email the complete form?? Does anybody have an idea??? Thanks Ryan -- 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