Jump to content

unidox

Members
  • Posts

    557
  • Joined

  • Last visited

    Never

Everything posted by unidox

  1. You will need sql, unless you want to use another php page.
  2. Yea, remove the php brackets. Unless you want to echo the whole thing.
  3. I just added the group section, working on access levels now. Any suggestions, tips, errors?
  4. <?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());
  5. 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.
  6. 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>"; } ?>
  7. Try this: http://www.avengex.com/tutorials/97/Simple_Searching/ and google for more if needed.
  8. Try changing this: $query_users = "SELECT id, username FROM users"; to $query_users = "SELECT * FROM users";
  9. All that will do is basically redirect the user to where the download will be. Are you trying to hide the download url?
  10. Try it this way: q = mysql_query(); while ($r = mysql_fetch_array($q)) { echo "<a href=\"" . $r['link'] . "\">Link</a>"; }
  11. Try setting your sessions the proper way, $_SESSION['name'] = value; Then try it.
  12. 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
  13. What are you rambling on about?
  14. Use the split function to separate it into an array, then then do it that way.
  15. Google, or you can use GET index.php?page=userid
  16. Here: <?php if (isset($_POST['button1'])) { a; } elseif (isset($_POST['button2'])) { a b } ?>
  17. 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.
  18. 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.
  19. I added that feature. Anything else?
×
×
  • 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.