Jump to content

alpine

Members
  • Posts

    759
  • Joined

  • Last visited

Everything posted by alpine

  1. Just remember that not all links work with "www" but simply as "http://foo"
  2. Case closed ! You are obviously in lack of basic understanding about how a forum like this works. We are not here to tell you that you need to post the current code when you need help, and we are definetively not here to tell you what exactly that means. A thread like this will without doubt go on for pages and my "be patient scale" just exceeded.
  3. The current script is the contents of index.html or whatever you are calling the problem of yours....
  4. What is your current script and what is it named then ?
  5. And please, next time post your code between code tags (the button with # on it)
  6. php differs between upper and lower case, V is not the same as v - so you have one of those in your foreach...
  7. A lot of those bulk issues can be avoided by providing som proper headers in the message. A lot of questions is regarding this exact problem, so i'll provide an example of a setup that should improve this - study it: [code] <?php // $your_sitename = "here"; // $your_sitemail = "mail@here.net"; // $recipient = $_POST['recipient']; // or a static one ofcourse // $subject = $_POST['message']; // or a static one // $message = $_POST['message']; $naughty = "/(%0A|%0D|\\n+|\\r+)(content-type:|mime-version:|cc:|bcc:)/i"; if(preg_match($naughty, $subject) || preg_match($naughty, $recipient)) {   die("Sorry, injection attempt blocked!"); } if(!eregi("^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,3})$", $recipient)) {   die("Not a valid email adress was provided"); } $eol = "\r\n"; $headers = "From: $your_sitename <$your_sitemail>".$eol; $headers .= "Reply-To: $your_sitename <$your_sitemail>".$eol; $headers .= "Return-Path: $your_sitename <$your_sitemail>".$eol; $headers .= "X-Mailer: PHP v".phpversion().$eol; $headers .= "Date: ".date("r").$eol; $headers .= "Message-ID: <".date("YmdHis").substr(md5(rand()),12)."@".$_SERVER['SERVER_NAME'].">".$eol; $mime_boundary = md5(time()); $headers .= 'MIME-Version: 1.0'.$eol; $headers .= "Content-Transfer-Encoding: 8bit".$eol; $headers .= "Content-Type: multipart/related; boundary=\"".$mime_boundary."\"".$eol; $msg = ""; $msg .= "--".$mime_boundary.$eol; $msg .= "Content-Transfer-Encoding: 8bit".$eol; $msg .= "Content-Type: text/plain; charset=iso-8859-1".$eol; // <-- modify charset to suit $msg .= $eol.$eol.$message.$eol.$eol; $msg = wordwrap($msg, 70); if(ini_get('safe_mode')) { mail($recipient, $subject, $msg, $headers); } else { mail($recipient, $subject, $msg, $headers, "-f" . $your_sitemail); } ?> [/code]
  8. alpine

    MSFirefox

    LOL - check this parody out: http://www.msfirefox.com/
  9. ...missing quotes inside your header call, and it cannot run inside a htm file !
  10. It was discussed wether to kill the short tags from php6, it seems however that it's desided to allow <? for now. But who knows in future releases, i would stick to <?php http://php6dev.blogspot.com/#remove-support-for-and-script-language-php-and-add-php-var
  11. This one should work as you want it to: [code] <?php $result = mysql_query("SELECT * FROM Topics WHERE Parent=0 ORDER BY UNIX_TIMESTAMP(datetime) DESC",$forumdb) or die(mysql_error()); ?> [/code]
  12. You could set a cookie that lasts for a year at a time, so unless the user cleans up his cookies (deletes them) it will be an autologin feature for a year at a time. Example to set a cookie after login success: [code] <?php if($login_ok) // simplified example { // set a cookie that will work for 365 days (one year) setcookie("user", "Donald Duck", time()+60*60*24*365,"/",".Duckburg_yourdomain.com",0); } ?> [/code] And on your main page, check if this cookie already exists - something like this: [code] <?php if(isset($_COOKIE['user']) && !empty($_COOKIE['user'])) {   // your cookie is found   $user = htmlspecialchars($_COOKIE['user'], ENT_QUOTES);     print "Hello {$user}, Welcome back!";     // or redirect   header("Location: members.php");   exit(); } else {   // no cookie found matching your check   print "Hello guest, If you already have an account, please log in first"; } ?> [/code] For understanding cookies, use the manual: http://no2.php.net/manual/en/function.setcookie.php
  13. Just ditch the foreach loop [code] <?php $pies = 'a:1:{i:6;s:7:"cwam";}'; preg_match('/(?:")([\w\d]+)(?:")/',$pies,$match); echo $match[1]; // prints cwam ?> [/code]
  14. replace [code] $check = mysql_query("SELECT * FROM users WHERE pass = '$pass' AND id = '$id'"); [/code] with [code] $check = mysql_query("SELECT * FROM users WHERE pass = '$pass' AND id = '$id'") or die(mysql_error()); [/code] and see what the mysql error is
  15. Yes it will be until january 18, 2038 But then i guess the problem might be another... http://www.unixtimestamp.com
  16. [quote author=Mutley link=topic=121052.msg497868#msg497868 date=1168048065] I like yours Alpine but if my cookie is encrypted, does it read it normally or do I need some PHP to decode it? [/quote] You don't decrypt the cookie value, you simply compare encrypted value (like the cookie value) with another encrypted value (like the encrypted db-value) to see if they match. If they match, the values before encryption is in most cases identical. This is if the encryption methods are the same on both values ofcourse (md5() etc)
  17. [code] <?php $str = "Mary Had A Little Lamb and She LOVED It So"; $str = strtoupper($str); echo $str; // Prints MARY HAD A LITTLE LAMB AND SHE LOVED IT SO ?> [/code]
  18. Follow this one: http://www.phpfreaks.com/forums/index.php/topic,118229.0.html
  19. [quote author=psychohagis link=topic=121052.msg497564#msg497564 date=1168023521] why are you using cookies? sessions are more secure? [/quote] was that supposed to be a question or a statement ? ...It really doesn't matter much if you do not validate user input from injecting your query, yours is wide open!
  20. Look at this, an example using cookies [code] <?php if(!empty($_COOKIE['user']) && !empty($_COOKIE['pass'])) {   $user = htmlspecialchars($_COOKIE['user'], ENT_QUOTES);   $pass = htmlspecialchars($_COOKIE['pass'], ENT_QUOTES);     $check = mysql_query("SELECT * FROM users WHERE pass = '$pass' AND user = '$user'");     if(mysql_num_rows($check) <> 1)   {     echo "No accsess granted with your current userdata";     exit();   }   else   {     echo "Logged in as $user";   } } else {   echo "You have to be logged in to visit this section";   exit(); } ?> [/code]
  21. This is not a board to do advertising - as you have already released this new feature ? ? Your link does not point to a spesific demo/test.
  22. Regarding margin etc: I've actually done over one of my sites to fully CSS myself the last couple of days - and i have to admit that when getting <sort of> the hang of it, it's cool to work with (i never thought i should <ever> say that). I have one friend running ONLY Linux, i get him to screenshot me various browsers whenever i need - and i have another friend (i actually have a few friends when i start thinking.!.) that is running ONLY Mac, i also get a few screenshots there when i ask. A screenshot tells definitively more than one can ever explain. * And EDIT: Only IE7 states error, not IE6
  23. I don't get any dialogbox with warning in IE7 but it states an syntax error on line 2 char 1. Attach some screenshots (not FF as you have it ?) [attachment deleted by admin]
  24. You will find some examples at http://www.w3schools.com/php/php_file_upload.asp
×
×
  • 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.