Jump to content

drisate

Members
  • Posts

    805
  • Joined

  • Last visited

Everything posted by drisate

  1. of course ... you need to loop your data in ... //start the form $sql = mysql_query("SELECT sum(q1='y'), sum(q1='n'), sum(q1='w'), sum(q2='y'), sum(q2='n'), sum(q2='w'), sum(q3='y'), sum(q3='n'), sum(q3='w'), sum(q4='y'), sum(q4='n'), sum(q4='w'), sum(q5='y'), sum(q5='n'), sum(q5='w'), sum(q6='y'), sum(q6='n'), sum(q6='w'), sum(q7='y'), sum(q7='n'), sum(q7='w'), sum(q8='y'), sum(q8='n'), sum(q8='w'), sum(q9='y'), sum(q9='n'), sum(q9='w'), sum(q10='y'), sum(q10='n'), sum(q10='w'), sum(q11='y'), sum(q11='n'), sum(q11='w'), sum(q12='y'), sum(q12='n'), sum(q12='w'), sum(q13='y'), sum(q13='n'), sum(q13='w') FROM survey") or die (mysql_error()); while($data= @mysql_fetch_array($sql )){ // put in your table row // Data will output like this $data[y] } // close your table by the way ... i am not even sur that sql query is gona work ... sum(q2='y') is gona erase sum(q1='y') should be something like sum(q2=y+y) or something like it
  2. like this ;-) $mailer = mysql_query("SELECT orders.widget, customers.contactLastName, customers.email, customers.subject, customers.message_body FROM orders JOIN customers ON orders.widget = customers.widget and orders.email_sent='0'") or die (mysql_error()); while($user = @mysql_fetch_array($mailer)){ // do your stuff // Ex: $user[contactLastName] //then $update = mysql_query("UPDATE ...") or die (mysql_error()); }
  3. Thats because your form has all email as name lol Full Name:<input name="email" type="text" /> should be Full Name:<input name="name" type="text" /> and same for every field names ;-)
  4. Hmm this is what i did in case somebody else has this prob if (function_exists(mb_list_encodings)) { $list_encoding = mb_list_encodings(); } else { // I did not upgrade to PHP 5 ... see the hassel? $list_encoding = array("pass", "auto", "wchar", "byte2be", "byte2le", "byte4be", "byte4le", "BASE64", "UUENCODE", "HTML-ENTITIES", "Quoted-Printable", "7bit", "8bit", "UCS-4", "UCS-4BE", "UCS-4LE", "UCS-2", "UCS-2BE", "UCS-2LE", "UTF-32", "UTF-32BE", "UTF-32LE", "UTF-16", "UTF-16BE", "UTF-16LE", "UTF-8", "UTF-7", "UTF7-IMAP", "ASCII", "EUC-JP", "SJIS", "eucJP-win", "SJIS-win", "JIS", "ISO-2022-JP", "Windows-1252", "ISO-8859-1", "ISO-8859-2", "ISO-8859-3", "ISO-8859-4", "ISO-8859-5", "ISO-8859-6", "ISO-8859-7", "ISO-8859-8", "ISO-8859-9", "ISO-8859-10", "ISO-8859-13", "ISO-8859-14", "ISO-8859-15", "EUC-CN", "CP936", "HZ", "EUC-TW", "BIG-5", "EUC-KR", "UHC", "ISO-2022-KR", "Windows-1251", "CP866", "KOI8-R"); }
  5. mb_list_encodings (PHP 5) DOH >.< ! Any way i can work this out in PHP 4?
  6. Thats weird i get undefined function: mb_list_encodings() but i cheked and i do have it installed ... this is my conf Multibyte String mbstring.detect_order: auto Multibyte String mbstring.encoding_translation: Off Multibyte String mbstring.func_overload: 0 Multibyte String mbstring.http_input: auto Multibyte String mbstring.http_output: SJIS Multibyte String mbstring.internal_encoding: EUC-JP Multibyte String mbstring.language: Japanese Multibyte String mbstring.substitute_character: none The code asking for this is function if_decode ( $string, $old = 'utf-8', $new = 'utf-8', $default = 'iso-8859-1' ){ $type = array_map ( 'strtolower', mb_list_encodings () ); $old = strtolower ( $old ); $new = strtolower ( $new ); $default = strtolower ( $default ); $keep = ''; $temp = imap_mime_header_decode ( $string ); $i = sizeof ( $temp ); for ( $j = 0; $j < $i; $j++ ){ $temp[$j]->charset = strtolower ( $temp[$j]->charset ); if ( $temp[$j]->charset == 'default' && $old == $new || $temp[$j]->charset == $new ){ $keep .= $temp[$j]->text; }else{ $keep .= mb_convert_encoding ( $temp[$j]->text, $new, ( in_array ( $temp[$j]->charset, $type ) ? $temp[$j]->charset : $default ) ); } return $keep; } } I am at php 4.4.7
  7. This did it thx ;-) function if_decode ( $string, $old = 'utf-8', $new = 'utf-8', $default = 'iso-8859-1' ){ $type = array_map ( 'strtolower', mb_list_encodings () ); $old = strtolower ( $old ); $new = strtolower ( $new ); $default = strtolower ( $default ); $keep = ''; $temp = imap_mime_header_decode ( $string ); $i = sizeof ( $temp ); for ( $j = 0; $j < $i; $j++ ){ $temp[$j]->charset = strtolower ( $temp[$j]->charset ); if ( $temp[$j]->charset == 'default' && $old == $new || $temp[$j]->charset == $new ){ $keep .= $temp[$j]->text; }else{ $keep .= mb_convert_encoding ( $temp[$j]->text, $new, ( in_array ( $temp[$j]->charset, $type ) ? $temp[$j]->charset : $default ) ); } return $keep; } }
  8. Hey guys i have a prob with this founction function if_decode($string,$old="utf-8",$new="utf-8",$default="iso-8859-1"){ $list = mb_list_encodings(); $type=array_map('strtolower', $list); $old=strtolower($old); $new=strtolower($new); $default=strtolower($default); $keep = ''; $temp = imap_mime_header_decode ( $string ); $i = sizeof ( $temp ); for ( $j = 0; $j < $i; $j++ ) { $temp[$j]->charset = strtolower ( $temp[$j]->charset ); if ( $temp[$j]->charset == 'default' && $old == $new || $temp[$j]->charset == $new ) { $keep .= $temp[$j]->text; } else { $keep .= mb_convert_encoding ( $temp[$j]->text, $new, ( in_array ( $temp[$j]->charset, $type ) ? $temp[$j]->charset : $default ) ); } } return $keep; } I get error Parse error: syntax error, unexpected T_VARIABLE in mail.php on line 1597 That points line $default=strtolower($default);
  9. In the HTML code theres a value="<?=$id?>" for the check box ... did you actualy give $id a value? like the question number? <?php if ($_POST){ // process the form here }else{ // the form stuff // <form [...] $questions[] = "What was your childhood nickname?"; // Question 0 $questions[] = "In what city did you meet your spouse/significant other? "; // Question 1 $questions[] = "What is the name of your favorite childhood friend?"; // Question 2 $i=0; foreach($questions as $q){ echo 'line '.$q.'<p> <input type="checkbox" id="'.$i.'" value="'.$i.'" name="question[]" /> What was your childhood nickname? <br /> <input id="'.$i.'" onfocus="getElementByid('.$i.').checked = true" type="text" name="answer[]" /> </p>'; $i++; } } ?>
  10. Something like $alpha = 'A.B.C.D.E.F.G.H.I.J.K.L.M.N.O.P.Q.R.S.T.U.V.W.X.Y.Z'; $alpha = explode ('.', $alpha); foreach ($alpha as $letter){ $query = "SELECT * FROM entry WHERE title like '$letter%'"; [...] }
  11. whats the last code line before that bro? EDIT : you beated me corbin lol It's time for me to go to bed anyway ... All yours bro hehe
  12. How abbout something like this <?php $check ="<b>Snake</b>"; $string="some of our Pacific Gopher <b>Snake</b> populations receive some gene flow from the Great Basin Gopher <b>Snake</b> (Pituophis catenifer deserticola). The Great Basin Gopher <b>Snake</b> does intergrade with the Pacific Gopher <b>Snake</b> to the north of us in Siskiyou"; $str = explode ($check, $string); foreach ($str as $array){ $new[]=$array; $new[]=$check; } ?>
  13. Would look like this :-) <?php /* The following code use to create random numbers and this number are embedding with existing image file, the first line used to initiate session, which use to carry the user inputs. */ session_start(); $RandomStr = md5(microtime()); $ResultStr = substr($RandomStr,0,5); $NewImage =imagecreatefromjpeg("img.jpg"); /* The second line [md5 (microtime ())] use to generate the random string, and the resultant string is trim by using third line [substr], which returns the portion of string specified by the start and length parameters. The function imagecreatefromjpeg ("img.jpg") is use to create a image by existing image file and as back ground ,so that you need to give an image file path. */ $LineColor = imagecolorallocate($NewImage,233,239,239); $TextColor = imagecolorallocate($NewImage, 255, 255, 255); imageline($NewImage,1,1,40,40,$LineColor); imageline($NewImage,1,100,60,0,$LineColor); imagestring($NewImage, 5, 20, 10, $ResultStr, $TextColor); /* After creation of back ground image, we generate some linear line, which is use to avoid the phrasing from random numbers, the respective lines are create by the function named imageline () and imagestring () use to draw a random string horizontally. */ $_SESSION['key'] = $ResultStr; /* The resultant random number [trimmed one], carry through session especially for validation purpose. */ header("Content-type: image/jpeg"); imagejpeg($NewImage); /* Finally above two functions are uses to display/out put the image to browser. So we can just call the particular file by through image source path, it will display the final image. */ if (!$_POST[name]) { $ERROR = $ERROR . "No name!"; } if (!$_POST[email]) { $ERROR = $ERROR . "No email!"; } if (!$_POST[comments]) { $ERROR = $ERROR . "No comments!"; } if(isset($_REQUEST['Submit'])){ $key=substr($_SESSION['key'],0,5); $number = $_REQUEST['number']; if($number!=$key){ $ERROR = $ERROR . "Validation string not valid! Please try again!"; }else{ if (!$ERROR) { $recipient = "PersonWhoGetsIt@emailadress.com"; //recipient $subject = "Comment Systeme"; //subject $header = "From: " . $_POST[name] . " <" . $_POST[email] . ">\r\n"; //optional headerfields mail($recipient, $subject, $_POST[comments], $header); //mail command $ERROR = "SUCCES!"; } } ?> You can download the captcha from this adress http://www.codewalkers.com/codefiles/630_PHP-CAPTCHA.zip
  14. OMG thank you thank you thank you printf ! You just made my day ! woohoo !
  15. Well the var is in PHP after the form was posted so he can't :-) It's imposible to look at the source of a PHP page $recipient = "PersonWhoGetsIt@emailadress.com"; //recipient $subject = "Comment Systeme"; //subject $header = "From: " . $_POST[name] . " <" . $_POST . ">\r\n"; //optional headerfields mail($recipient, $subject, $_POST[comments], $header); //mail command $ERROR = "SUCCES!"; The only bot you should care abbout are the spamer bot's lol all you have to do is add a captcha and they can't submit anything :-)
  16. well no need of a class for that ;-) Give the var the value and thats it hehe
  17. Hmm i think the best thing would be to create a function for the form like this: <?php if (!$_POST[name]) { $ERROR = $ERROR . "No name!"; } if (!$_POST[email]) { $ERROR = $ERROR . "No email!"; } if (!$_POST[comments]) { $ERROR = $ERROR . "No comments!"; } $email_sent = 0; if (!$ERROR) { $recipient = "PersonWhoGetsIt@emailadress.com"; //recipient $subject = "Comment Systeme"; //subject $header = "From: " . $_POST[name] . " <" . $_POST[email] . ">\r\n"; //optional headerfields mail($recipient, $subject, $_POST[comments], $header); //mail command $ERROR = "SUCCES!"; } ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>IAMAPATIENT</title> <link rel="stylesheet" type="text/css" href="css/styles.css" /> </head> <body> <div id="Wrapper"> <div id="Header"> <img src="images/logo.gif" width="100px" height="100px" > <h1>IAMAPATIENT</h1> <img src="images/logos.gif" width="100px" height="100px" style="float:right; margin-right:20px;" > <div class="clear"></div> </div> <div id="Content"> <div class="hook-1"> <div id="Left"> <ul> <li><a href="index.html">Home</a></li> <li><a href="whoweare.php">Who We Are</a></li> <li><a href="donor.php">Donor</a></li> <li><a href="contactus.php">Contact Us</a></li> <li><a href="links.html">Links</a></li> </ul> </div> <div id="Right"> <div id="ImgBar"> <img src="images/img2.gif" /> <img src="images/img3.gif" /> <img src="images/img1.gif" /> <img src="images/img4.gif" /> <div class="clear"></div> </div> <div id="PageContent"> <h2>Request More Information</h2> <p> Use this form to contact us to get more information or about our company, products, or services. Suggestions welcomed! </p> <?php form($ERROR); ?> </div> </div> <div class="clear"></div> </div> </div> </div> </body> </html> <?php function form($ERROR) { if ($ERROR) { echo "<b>$ERROR</b><br>"; } print ('<form action="#" method="post"> <table> <tr> <td>Name:</td> <td><input type="text" name="name" /></td> </tr> <tr> <td>Email:</td> <td><input type="text" name="email" /></td> </tr> <tr> <td valign="top">Comments:</td> <td><textarea name="comments" cols="30" rows="10"></textarea></td> </tr> <tr> <td></td> <td><input type="submit" value="Submit" name="contact" /></td> </tr> </table> </form>'); } ?>
  18. omg thx printf that would be awsome! I will be checking that board and helping while i whait. :-)
  19. Proper format is <?php $Name = "Da Duder"; //senders name $email = "email@adress.com"; //senders e-mail adress $recipient = "PersonWhoGetsIt@emailadress.com"; //recipient $mail_body = "The text for the mail..."; //mail body $subject = "Subject for reviever"; //subject $header = "From: ". $Name . " <" . $email . ">\r\n"; //optional headerfields mail($recipient, $subject, $mail_body, $header); //mail command ?>
  20. indeed thats why i use UsbWebserver v7.0 I rarly get my stuff working on the first try hehe
  21. well ... <p><input type="checkbox" value="<?=$id?>" name="question[]" value="ON"> QUESTION 1</p> <p><input type="text" name="awnser[]" size="50"></p> <p><input type="checkbox" value="<?=$id?>" name="question[]" value="ON">QUESTION 2</p> <p><input type="text" name="awnser[]" size="50"></p> <p><input type="checkbox" value="<?=$id?>" name="question[]" value="ON">QUESTION 3</p> <p><input type="text" name="awnser[]" size="50"></p> $i="0"; foreach ($_POST[question] as $question){ // Question number $question on loop $i goes with awnser $_POST[awnser][$i] }
  22. Well you never gave your check box a value ... so yeah ... <input type=\"checkbox\" id=\"1\" name=\"question[]\" value=\"MY VALUE\"/> oohh i see you got mixtup with the id="" and value="" hehe Well hopes this helps ya out ;-)
  23. well i am not certain i get your thing here care to try explaining your self again?
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.