-
Posts
241 -
Joined
-
Last visited
Never
Everything posted by pneudralics
-
[SOLVED] Php update NOW() not updating....
pneudralics replied to pneudralics's topic in PHP Coding Help
Thanks alot!! -
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);
-
[SOLVED] What is wrong with my mod rewrite?
pneudralics replied to pneudralics's topic in Apache HTTP Server
Got it. Did this: echo "<a href=\"/backgrounds/$categorylink\" class=\"backgroundsfg\">$categorylink</a><br />"; -
[SOLVED] What is wrong with my mod rewrite?
pneudralics replied to pneudralics's topic in Apache HTTP Server
.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 -
[SOLVED] What is wrong with my mod rewrite?
pneudralics replied to pneudralics's topic in Apache HTTP Server
and if I hover over links it'll say backgrounds/ instead of backgrounds.php -
[SOLVED] What is wrong with my mod rewrite?
pneudralics replied to pneudralics's topic in Apache HTTP Server
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/ ? -
[SOLVED] What is wrong with my mod rewrite?
pneudralics replied to pneudralics's topic in Apache HTTP Server
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. -
Anyone having issue with mod_rewrite for wampserver?
pneudralics replied to pneudralics's topic in Apache HTTP Server
I'm not getting any errors. It's just not rewriting. -
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.
-
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
-
Few newbie questions about sessions...
pneudralics replied to pneudralics's topic in PHP Coding Help
Thanks for all the info. How do I prevent the session from automatically deleting when I close the browser? -
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.
-
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.
-
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)));
-
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"; }
-
[SOLVED] How do I compare a variable to a function array?
pneudralics replied to pneudralics's topic in PHP Coding Help
Thanks the return() fixed the issue -
[SOLVED] How do I compare a variable to a function array?
pneudralics replied to pneudralics's topic in PHP Coding Help
Shouldn't the foreach display the array? Where does the ; go? -
[SOLVED] How do I compare a variable to a function array?
pneudralics replied to pneudralics's topic in PHP Coding Help
Also tried the below and got Invalid argument supplied for foreach() $badwords = badword(); foreach($badwords as $value) { echo "$value"; } -
[SOLVED] How do I compare a variable to a function array?
pneudralics replied to pneudralics's topic in PHP Coding Help
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"; -
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?