-
Posts
557 -
Joined
-
Last visited
Never
Everything posted by unidox
-
[SOLVED] loging in to accounts using hashed passwords
unidox replied to thedecline's topic in PHP Coding Help
And can we see some code? -
You will need sql, unless you want to use another php page.
-
[SOLVED] Searching database with drop down lists
unidox replied to pure_skill_2000's topic in PHP Coding Help
Yea, remove the php brackets. Unless you want to echo the whole thing. -
I just added the group section, working on access levels now. Any suggestions, tips, errors?
-
<?php //connect to MySQL $connect = mysql_connect('localhost', 'xxx', 'xxx') or die(mysql_error()); mysql_select_db('xxx') or die(mysql_error()); //select tags for movie $query = 'SELECT * FROM `tags` WHERE `name` = "enchanted"'; $result = mysql_query($query, $connect) or die(mysql_error()); while ($nt=mysql_fetch_array($result)) { echo "<a href=\"tags.php?id=" . $nt['id'] . "\">" . $nt['tags'] . "</a>"; } ?> //for the user to insert a new tag into the database <form action="insert.php" method="post"> Tag: <input type="text" name="name" /> <input type="submit" /> </form> Now in tag.php in order to find the right row in mysql, use get. Like: $id = $_GET['id']; $q = mysql_query("SELECT * FROM `table` WHERE `table_id` = '$id'") or die(mysql_error());
-
Sure, post the code.
-
Try this: <?php $dbcon = mysql_connect("localhost", $dbuser, $dbpswd); if ($dbcon) { mysql_select_db($dbuser, $dbcon); $username = $_POST['username']; $password = $_POST['pswd']; $username = stripslashes($username); $password = stripslashes($pswd); $username = mysql_real_escape_string($username); $password = mysql_real_escape_string($pswd); $q = mysql_query("SELECT * FROM `credentials` WHERE `username` = '$username' and `password` = '$password'"); $count = mysql_num_rows($q); if($count == 1) { $_SESSION['username'] = $username; $_SESSION['pswd'] = $password; header("location: form6.php"); exit(); } else { echo "Wrong Username or Password"; exit(); } } ?> then in form6.php, right at the top of the file, I have the following: <?php session_start(); if(!$_SESSION['username']) { header("location:login.php"); exit(); } ?> form 6 can then get me to recipe_wizard.php through a get method <form action="recipe_wizard.php" method="POST"> <input type="submit" name="addscore" value="New Recipe" /> </form> I am thinking that's why I can't have the above code. I am not sure but does that add html to the next page preventing the validation above to not be the first thing in the next file? Anyway's I then have this at the top fo the recipe_wizard.php file the very first thing: <?php session_start(); if(!$_SESSION['username']) { header("location:login.php"); exit(); } ?> I changed some of the names and changed the form method to post. See if that works.
-
[SOLVED] Dynamic drop down menu not showing first record
unidox replied to Eiolon's topic in PHP Coding Help
Try this: <?php $q = mysql_query("SELECT * FROM `users`") or die(mysql_error()); ?> <select name="user"> <? while ($r = mysql_fetch_array($q)) { echo "<option value=\"" . $r['id'] . "\">" . $r['username'] . "</option>"; } ?> -
Try using <a>Link</a>
-
[SOLVED] Searching database with drop down lists
unidox replied to pure_skill_2000's topic in PHP Coding Help
Try this: http://www.avengex.com/tutorials/97/Simple_Searching/ and google for more if needed. -
[SOLVED] Dynamic drop down menu not showing first record
unidox replied to Eiolon's topic in PHP Coding Help
Try changing this: $query_users = "SELECT id, username FROM users"; to $query_users = "SELECT * FROM users"; -
All that will do is basically redirect the user to where the download will be. Are you trying to hide the download url?
-
Please post all the code.
-
Try it this way: q = mysql_query(); while ($r = mysql_fetch_array($q)) { echo "<a href=\"" . $r['link'] . "\">Link</a>"; }
-
Try setting your sessions the proper way, $_SESSION['name'] = value; Then try it.
-
I am getting: Warning: mysql_connect() [function.mysql-connect]: Access denied for user 'root'@'localhost' (using password: YES) in /home/scoop987/public_html/shoutbox/config.php on line 27 Cannot connect to database
-
What are you rambling on about?
-
[SOLVED] Not Equal (okay)... a "not in" operator?
unidox replied to pmg206's topic in PHP Coding Help
Use the split function to separate it into an array, then then do it that way. -
Google, or you can use GET index.php?page=userid
-
You could use mod_rewrite
-
Here: <?php if (isset($_POST['button1'])) { a; } elseif (isset($_POST['button2'])) { a b } ?>
-
Authenticating the user according to level set in the database.
unidox replied to iarp's topic in PHP Coding Help
How would they get by? Make sure it is numeric and because it is a session, someone would have to access your server in order to set the same session. That way is secure. -
Well anything you store in cookies are unsecure, anyone can copy the cookie and use it on their computer. But the hard time is someone actually getting ahold of those cookies. I would store the md5 with a salt and a username.
-
I added that feature. Anything else?