Jump to content

wadie

Members
  • Posts

    21
  • Joined

  • Last visited

Profile Information

  • Gender
    Not Telling

wadie's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Your post explains exactly what I did wrong ! The values are stored correctly in two cookies,but I guess only checking for the cookies won't display their username. How do I do what you explained in the last paragraph ? Thanks a lot mate.
  2. Thanks a lot! But any idea why isn't it working ?
  3. and now logging in normally using the details stored in the cookie isn't working! it shows that the login details are wrong. Need help ASAP please.
  4. Seems to be working..not sure.. To call the cookie I use: if (empty($login_errors) && !$register_submit && logged_in() && !isset($_COOKIE['imgit_note']) || isset($_COOKIE['login_email']) && isset($_COOKIE['login_password'])) { echo '<div class="info" id="welcome_back">Welcome back <span class="capitalize">' . get_username() . '</span> } For some reason the username is Guests and the account isn't logged in. it only shows that the log in was successful.
  5. Hi, I'm creating a remember me feature for my site which obviously sets a cookie and when the visitors loads the site again,he would already be logged in. This is a part of the code which is related : $login_email = request_var('login_email', ''); $login_password = request_var('login_password', ''); $login_remember = (isset($_POST['remember']) && $_POST['remember'] == 1) ? true: false; setcookie('login_email', $_POST['login_email'], time()+60*60*24*365, '/','localhost',false); setcookie('login_password', md5($_POST['login_password']), time()+60*60*24*365, '/','localhost',false); HTML: <strong class="normal"><input type="checkbox" name="remember" value="1">Remember</strong>
  6. Oh I see.. Thanks!
  7. I want to show an image or anything,and also show the download window.
  8. I've written the following code: <?php echo '<img src="Sheph.png" />'; function Wad(){ if (file_exists("Sheph.png")) { header('Content-Description: File Transfer'); header('Content-Type: application/octet-stream'); header('Content-Disposition: attachment; filename='.basename("Sheph.png")); header('Content-Transfer-Encoding: binary'); header('Expires: 0'); header('Cache-Control: must-revalidate'); header('Pragma: public'); header('Content-Length: ' . filesize("Sheph.png")); ob_clean(); flush(); readfile("Sheph.png"); exit; } } Wad(); ?> What I want to do is show the image AND show a file download window. The problem is that it shows the download window but the image doesn't appear. and if I comment the function and keep the echo part only,the image appears normally. What's wrong ?
  9. OK,thanks.
  10. Can they be used to track or pull any info ? Just wondering what's the different uses of cookies..
  11. Can cookies be used to harm a computer or create anything vulnerable on the user's end ?
  12. It's not working that way. There's even another problem which is it doesn't matter what's the full URL. it's enough to assign http://www. to the variable $post_data['your_url'] and then it will always show that the url exists no matter what's the url I'm trying to post. I'd really appreciate it and even willing to pay if someone can make it fully work cause it's getting on my nerve now
  13. ohh sorry about that,I just copied my previous question. I know how to do that,I just removed the else part and it works. My question is: How do I let it check the whole url and not the domain name only ? for example http://www.google.com/this
  14. I'm trying to create a function which checks if a url has been posted before,and if it has then an error is given. This is what I have so far in /includes/functions_posting.php function http_file_exists($url) { $f = @fopen($url,"r"); if($f) { fclose($f); return true; } return false; } And this is what I have in posting.php if ($submit || $preview || $refresh) { $post_data['your_url'] = "http://www.google.com"; //remove the equals and url value if using in real post $your_url = $post_data['your_url']; $your_url_exists = (isset($your_url)) ? true : false; $your_url = preg_replace(array('#&\#46;#','#&\#58;#','/\[(.*?)\]/'), array('.',':',''), $your_url); if ($your_url_exists && http_file_exists($your_url) == true) { trigger_error('exists!'); } else if ($your_url_exists && http_file_exists($your_url) == false) { trigger_error('doesnt exist..'); } It works fine,but I still don't know how to do one last thing. if the url doesn't exist,I want it to continue posting. else,trigger the error message that url exists. I think I'm close,but not sure where to go now
  15. OK I have what I want. I just removed the else if part and it's posting if the link doesn't exist. Problem: How do I make it check if the domain.com and the rest of it for example domain.com/something exists ?
×
×
  • 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.