Jump to content

corbin

Staff Alumni
  • Posts

    8,102
  • Joined

  • Last visited

Everything posted by corbin

  1. Uhhh the session thing sounds like it should work... For the two people on the same account thing you could just add 3 rows to your database logged_in logged_in_ip last_active Have logged_in set to 1 when they login and have it 0 when they log out... And since most people just close their browser and dont hit log out you could use the logged_in_ip to track the last ip they logged on from and allow tem to login if it was the same ip... The last_active row comes in where if their not the ip from last time... That way if its been a certain amount of time since someone was active on the account it wont let them login but if its been like 5 minutes of activity it could let them login and void the session from the other person... I dont know exactly how you would make that all fit together but im sure you can figure something out.
  2. Ummmm no actually thats not what i meant... And on the sense of password protecting files... I would just use a very very simple login script...
  3. It shouldnt matter since you automatically append the .htm, but in the future if you ever wanted to change that to a different extension or something it could create issues since someone could edit their url in their browser and make it something like ?ad=../../yousecretfile.php
  4. hehe both of yall versions was better than mine... Oh well.. Didnt put much thought or effort into mine :D
  5. You need to know a SMTP server, or run one...
  6. Uhhh no it shouldnt be.  On the ad = X thing you should add the line $ad = str_replace("../", "", $ad); $ad = str_replace("/", "", $ad); some where once $ad is defined...
  7. Hehe I was kinda tired when I wrote that earlier... I just went back through it and its kinda... ummmm not good lol... I guess RockingGroudon said hes gonna make a script so ill just let them do that :D
  8. You need to set the settings in php.ini for that function to work...
  9. http://dev.mysql.com/doc/refman/5.0/en/insert.html http://dev.mysql.com/doc/refman/5.0/en/update.html http://dev.mysql.com/doc/refman/5.0/en/create-table.html http://us2.php.net/mysql_connect http://www.w3schools.com/php/php_mysql_intro.asp
  10. I generally use JPG or PNG... with an occasion GIF
  11. You cant do a lot of things with CSS that can be done with javascript... and i do mean A LOT of things...
  12. I use notepad++ for everything... I do have frontpage though and use it for tables everynow and then...
  13. I leave javascript on default settins in IE and FF...
  14. Hehehe, my dad told me bout punch cards one time... my name is Corbin, 14 years old. Started HTML when i was about 10, PHP at 11.5ish... Ive messed with some other languages but PHP is by far my favorite/most knowledgable.
  15. Adding on to raza.shahzad... Something like...: [code=php:0] <?php // your own email address $your_email = ($_POST['txtEmail']); // email subject line $subject = "Message via your contact form"; // This is displayed if all the fields are not filled in $empty_fields_message = "<p>Please go back and complete all the fields in the form.</p>"; // This is displayed when the email has been sent $thankyou_message = "<p>Thankyou. Your message has been sent.</p>"; // do not need to edit these lines $name = stripslashes($_POST['txtName']); $email = stripslashes($_POST['txtEmail']); $message = stripslashes($_POST['txtMessage']); if (!isset($_POST['txtName'])) { ?> <form method="post" action="<?php echo $_SERVER['REQUEST_URI']; ?>">     <p><label for="txtName">Name:</label>     <input type="text" title="Enter your name" name="txtName" /></p>     <p><label for="txtEmail">Email:</label>     <input type="text" title="Enter your email address" name="txtEmail" /></p>     <p><label for="txtMessage">Your message:</label>     <textarea title="Enter your message" name="txtMessage"></textarea></p> <label for="send_copy">Send me a copy:</label> <input type="checkbox" Title="Send Me a Copy" name="send_copy" />     <p><label title="Send your message">     <input type="submit" value="Send" /></label></p> </form> <?php } elseif (empty($name) || empty($email) || empty($message)) {     echo $empty_fields_message; } else {     // Stop the form being used from an external URL     // Get the referring URL     $referer = $_SERVER['HTTP_REFERER'];     // Get the URL of this page     $this_url = "http://".$_SERVER['HTTP_HOST'].$_SERVER["REQUEST_URI"];     // If the referring URL and the URL of this page don't match then     // display a message and don't send the email.     if ($referer != $this_url) {         echo "You do not have permission to use this script from another URL.";         exit;     }     // The URLs matched so send the email     mail($your_email, $subject, $message, "From: $name <$email>"); if($_POST['send_copy']) { $email = "you@you.com"; mail($email, $subject, $message, "From: $name <$email>"); }     // Display the thankyou message     echo $thankyou_message;     } ?> [/code]
  16. Hmmm I attached some files i made for displaying 20 random images from a folder... It stores the names of the 20 images to use and recreates that file every 24 hours... Just look through the files and you should be able to figure out whats going on... lol its not very good... I wrote it half asleep :D Also if you have a DB i suggest using it instead of flat files... [attachment deleted by admin]
  17. I think about 99% of people have cookies enabled... Your only problem with that script is that that session will stay set... So someone can go to one of your pages and then go to your css and itll work fine... try adding $_SESSION['css'] = 'n'; to the end of your css... Wait i just realized something as i was typing this... CSS files are cached... So theyll be cached no matter what... I wonder if headers could be used to not cache it though...
  18. Dang thats a tough one.... Lemme thing for a few minutes lol
  19. Try it when its not in a function and mysql_error() should out put an error...
  20. I was wondering that myself the other day... You could track them using a database and every time they reload a page update the time stamp in there... Then if its less then 5 minutes in the past consider them inactive.... Not sure though... You might be better off doing the same thing cept with session_id
  21. $title_old = "The payment system is currently unavailable while we perform a system upgrade. Bringing these features back is our top priority, and we expect to have them restored shortly."; I dont see online in there....
  22. Try $name = $value[$id]['name']; $children = $value[$id]['children'];
  23. Oh, dang dunno how i missed that... Hehe
  24. Hmmm sorry i thinki misunderstood your question...  I thought you meant it wouldnt connect at all... Hmm maybe it doesnt like the 's around users.  Try ` instead and then if that doesnt work put or die(mysql_error());
×
×
  • 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.