Jump to content

pneudralics

Members
  • Posts

    241
  • Joined

  • Last visited

    Never

Everything posted by pneudralics

  1. Database field for login is timestamp. Can't seem to update the login time when I click submit. Is the code below correct? //Update login datetime $updateloginq = "UPDATE user SET login = \"NOW()\" WHERE email = \"$email\" LIMIT 1"; mysql_query ($updateloginq);
  2. Thanks. Just forgot the , $string = str_replace(" ", "-", $string);
  3. $string = "Hi this is my string"; //Want it to look like $string = "Hi-this-is-my-string";
  4. Got it. Did this: echo "<a href=\"/backgrounds/$categorylink\" class=\"backgroundsfg\">$categorylink</a><br />";
  5. .htaccess file now have this in it RewriteRule ^backgrounds/(.*)$ backgroundscategory.php?category=$1 [NC,L] php file with links now have this echo "<a href=\"backgrounds/$categorylink\" class=\"backgroundsfg\">$categorylink</a><br />"; Everytime I click on the link it keeps adding backgrounds/...so my url will eventually look like: http://localhost/backgrounds/backgrounds/backgrounds/backgrounds/category
  6. and if I hover over links it'll say backgrounds/ instead of backgrounds.php
  7. what do you do in order to try it ? Click on the links on the page that are dynamic.. When I type it in the browser it works. Now if I have this: <IfModule mod_rewrite.c> RewriteEngine On RewriteBase / RewriteRule ^backgrounds/$ backgrounds.php [NC,L] </IfModule> and I type http://localhost/backgrounds/ all my links are now under the backgrounds directory so none work anymore. Isn't mod_rewrite suppose to rewrite the url so if I type http://localhost/backgrounds.php it'll change that to http://localhost/backgrounds/ ?
  8. Where did you test it? I tried WAMPSERVER AND XAMMP and it still doesn't work. I don't get any errors, it just doesn't rewrite.
  9. I'm not getting any errors. It's just not rewriting.
  10. I've enabled it in the apache module. Check phpinfo() and it's there. I've done this.. # # AllowOverride controls what directives may be placed in .htaccess files. # It can be "All", "None", or any combination of the keywords: # Options FileInfo AuthConfig Limit # AllowOverride All # # Controls who can get stuff from this server. # I still can't get it to rewrite Options +FollowSymLinks RewriteEngine On RewriteRule ^home\.php$ index.php The way I'm getting to index.php is a link on the page or typing it manually in the url. Restarted wamp several times.
  11. Trying to attempt to mod rewrite but just getting error 500. What I'm trying to get is: backgrounds/Animals/Birdy/29 So will the first set of A-Z replace Animals or category? If it replaces Animals..does it just ignore category? RewriteEngine on RewriteBase / RewriteRule ^backgrounds/([A-Z]+)/([A-Z]+)/([0-9]+)$ backgroundsimage.php?category=Animals&title=Birdy&id=29
  12. Thanks for all the info. How do I prevent the session from automatically deleting when I close the browser?
  13. 1) Session is not a cookie and a session is stored in a temporary server folder somewhere. Am I correct? 2) For a website that have users..is it better to use sessions or cookies? 3) How long does a session last by default if the user doesn't logout? Thanks in advance.
  14. I sha 1 the password field now what do I do when they try to login? Do I just sha1 the $_POST password and compare that with the sha1 password in the database? Also... I was reading some post about sha1 and was wondering what people were refering to when they were talking about salt? Thanks in advance.
  15. You mentioned that my order is wrong. Where is it that I can find what order it goes? Just for future reference.
  16. Seems like all these fall under some kind of security issue.. so should I just always use it on anything that's going to search/post the database? They all seem to be very similiar..replace/strip special characters. Should I just do something like this to all my variables before sending them? strip_tags(htmlentities(mysql_real_escape_string($imhackerfree)));
  17. Having issues with my if and else statment. I'm not sure if I'm comparing them correctly. When I submit a name I want to check the database if the database has similiar names. If there are less names than zero I want to echo zero. Am I writing it correctly? Thanks $name = strip_tags(htmlentities(trim($_POST['name']))); $namesq = "SELECT * FROM names WHERE name LIKE '%$name%'"; if ($namesr = mysql_query ($namesq)) { while ($namesrow = mysql_fetch_array ($namesr)) { $name = $namesrow['name']; } } //if zero result echo zero if ($name < 0) { echo "zero"; } //else if more than zero result echo found else { echo "found"; }
  18. Thanks the return() fixed the issue
  19. Shouldn't the foreach display the array? Where does the ; go?
  20. Also tried the below and got Invalid argument supplied for foreach() $badwords = badword(); foreach($badwords as $value) { echo "$value"; }
  21. I seem to get: Wrong datatype for second argument When I try your example. I notice when I try to echo the below I don't get any output except Array. $badwords = array("badword1","badword2","badword3"); echo "$badwords";
  22. Want to compare name from form to badword list, but can't seem to get it to compare. function badword() { array("badword1","badword2","badword3") } $badword = badword(); //$name comes from form $name = $_POST['name']; if ("$name" != "$badword") { //if not badword do this } else { //bad word }
  23. I'm trying to make a php registration form. In the form I have one section where it randomly selects a question from the mysql table $queryquestion = 'SELECT * FROM question ORDER BY RAND() LIMIT 1'; if ($resultquestion = mysql_query ($queryquestion)) { while ($qrow = mysql_fetch_array ($resultquestion)) { $question = $qrow['question']; $answer = $qrow['answer']; } } Then in the isset submit for the form I have the following to check if the answer is correct if ($_POST['answer'] == "$answer") { //good we move on } else { echo "wrong answer"; } The issue is when submit is click I always get the else statement for wrong answer. I'm thinking everytime I click submit a new random answer from the table gets compared to the post answer. How can I solve this issue?
×
×
  • 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.