Jump to content

revraz

Members
  • Posts

    6,911
  • Joined

  • Last visited

    Never

Everything posted by revraz

  1. No problem, I'd rather make you think about how to do it rather than do it for ya
  2. And I would say that's wrong. Just because it's not your Style doesn't make it Wrong. PHP should never control actual design, layouts, color, ect. Only to provide the data to display.
  3. ob_end_clean(); is probably doing it.
  4. See if this helps <?php /* If username and password entered query database to check they match in database */ if ($u && $p) { $query = "SELECT user_id, club_id, validate FROM users WHERE username='$u' AND password=PASSWORD('$p')";// AND validate = '1'"; $result = @mysql_query($query); $row = mysql_fetch_array ($result, MYSQL_NUM); /* If they match create session */ if ($row) { $validate=$row[2]; ob_end_clean(); if ($validate = 1) { /* Redirect to main.php when logged in */ $_SESSION['user_id']=$row[0]; $_SESSION['club_id']=$row[1]; header ("Location: http://" .$_SERVER['HTTP_HOST'] . dirname($_SERVER['PHP_SELF']) . "main.php"); exit(); } else { echo '<p><font color="red" size="+1">You are not validated yet, please try back later</font></p>'; exit; } } else { echo '<p><font color="red" size="+1">The username and password do not match</font></p>'; } mysql_close(); } ?>
  5. You should be able to make this work, or see what I'm doing. <?php /* If username and password entered query database to check they match in database */ if ($u && $p) { $query = "SELECT user_id, club_id, validate FROM users WHERE username='$u' AND password=PASSWORD('$p')";// AND validate = '1'"; $result = @mysql_query($query); $row = mysql_fetch_array ($result, MYSQL_NUM); /* If they match create session */ if ($row) { $_SESSION['user_id']=$row[0]; $_SESSION['club_id']=$row[1]; $validate=$row[2]; ob_end_clean(); if ($validate = 1) { /* Redirect to main.php when logged in */ header ("Location: http://" .$_SERVER['HTTP_HOST'] . dirname($_SERVER['PHP_SELF']) . "main.php"); exit(); } else { echo "You are not validated yet, please try back later"; exit; } } else { echo '<p><font color="red" size="+1">The username and password do not match</font></p>'; } mysql_close(); } ?> [/close]
  6. You need to seperate this $query = "SELECT user_id, club_id, validate FROM users WHERE username='$u' AND password=PASSWORD('$p') AND validate = '1'"; You are selecting the users that have all three match. So if my uname and pw are right, but I'm not validating, you are saying my PW is wrong. Have it select on just the uname/pw first. After you get that row,then deteremine if validate = 1.
  7. You setup a database, link the download to point to the database, enter the transaction, then let them download the file. Quite a few posts floating around that give examples on how to do it.
  8. Its hard to say without knowing what you want each table to do. Every table doesn't have to change, unless you are trying to do dynamic quantities and the like. A city table should only change if you add a new city. A state table should only chane if you add a new state. Using an ID instead of a username would be faster, since it's indexed. But I dont really understand what you mean by updating the different id's in the other tables. I assume you mean row or record, but I don't think you want to Update it, but rather Insert a new row. Unless someone is modifing their existing garage sale.
  9. Content placement and design shouldn't be controlled by your PHP, but by CSS. Sounds like your code flow isn't organized. Even with exits, you can still code it so the page that is displayed will show all the HTML.
  10. You first need to have a design on how you want each table to relate to each other. Example, a company inventory. Item Table itemno itemname Customer Table customerno customername itemno Here, in your Customer Table, you have a entry for the item no they bought. When you do a query and JOIN these on item.itemno=customer.itemno, you are making a relation to the two tables. This is all Database design and you would probably get better answers in the MySQL forum.
  11. The cron job includes the call that runs your .php script that does that.
  12. You've already showed how to do that up in your reply $query = "SELECT id, title, author, post, DATE_FORMAT(date, '%M %d, %Y') as sd FROM news_posts" LIMIT 0, 10; Just change it to display the last news entry, so ORDER BY date DESC limit 0, 1
  13. Have you tried searching for "paypal and php" in Google?
  14. It doesn't matter if the From: is in the Variable or in the mail () function, as long as it's there. The problem is you don't have a mail server.
  15. It is pulled from the page using the $_POST['Password'] array. $minlength = 8; $password = $_POST['Password']; if(strlen($password)>=$minlength) { echo "Good"; } else { echo "Too Short"; }
  16. 1. No, Name does 2. Yes
  17. These are both HTML questions. 1. Change the value= to what you want it to say on the page. The name= is what you use to read when the button is pressed. 2. Set the Input size= and maxlength= but you can't set a minimum. Use code to verify data.
  18. I don't have a seperate sessions.php file, I just have session_start(); at the top of every page I have. And honestly, if sessions get deleted off the server in a timely manner, I wouldn't even worry about it.
  19. Search on Sessions and Cookies and you'll find quite a few examples.
  20. Your URLs look wrong You are setting the URL to <a href="/members.php?member=$back">Last:</a>' But you are $_GETting "id". So either $_GET['member'] or change the url to members.php?id=
  21. You still have "0" instead of 0
  22. Do you have a mailserver?
  23. Use a IMG as a button?
  24. When the user Registers, you would want to build their DB row at that time. When they log in, just have a form come up that reads their Row and populates any data that they already have in their record. Provide a update button that UPDATES the DB with the new data.
  25. Post your updated code.
×
×
  • 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.