Jump to content

peranha

Members
  • Posts

    878
  • Joined

  • Last visited

Everything posted by peranha

  1. peranha

    Login

    It is printing all because you are not giving it a where clause. $result = mysql_query("SELECT * FROM users WHERE tablecolumn = $first");
  2. Alright, Yes thanks, Just figured it out, Was looking at the manual, and just put in 1, 2, 3, and so on. Didnt read it fully.
  3. This is on the index.php page, and is supposed to redirect to the page depending on the action. I know it is setting the action as the echo writes out what is in the address bar. test.php?action=addcomm will echo addcomm which is the first case. <?php $action = $_GET['action']; echo $action; switch($action){ case 1: include('pages/addcomm.php'); break; case 2: include('pages/admin.php'); break; case 3: include('pages/adminuser.php'); break; case 4: include('pages/addcomm1.php'); break; case 5: include('pages/adminuser1.php'); break; case 6: include('pages/adminuser2.php'); break; case 7: include('pages/adminuser3.php'); break; case 8: include('pages/banipadd.php'); break; case 9: include('pages/banipadd1.php'); break; case 10: include('pages/banuser.php'); break; case 11: include('pages/banuserproc.php'); break; case 12: include('pages/citysupport.php'); break; case 13: include('pages/countrysupport.php'); break; case 14: include('pages/dealersupport.php'); break; case 15: include('pages/dealersupporttable.php'); break; case 16: include('pages/dealertablesubmit.php'); break; case 17: include('pages/distinctip.php'); break; case 18: include('pages/distinctip1.php'); break; case 19: include('pages/login.php'); break; case 20: include('pages/logout.php'); break; case 21: include('pages/prologin.php'); break; case 22: include('pages/statesupport.php'); break; } ?> Any ideas will be greatly appreciated.
  4. you are closing you PHP tag and then putting in the echo command. then openning it again after the echo command, to it is taking it as HTML.
  5. the site is a forum only until futher notice http://www.phpfreaks.com/forums/index.php/topic,181773.0.html That topic explains it all.
  6. $sql ="SELECT * FROM $table_name WHERE username = '$_POST[username]' AND password = password('$_POST[password]')"; $result = @mysql_query($sql,$connection)or die(mysql_error()); //get the number of rows in the result set $num = mysql_fetch_row($result); //print a message or redirect elsewhere,based on result if ($num['access_level'] == 1) { header("Location: http://www.bds-net.info/alan/admin_home.html"); exit; } else { header("Location: http://www.bds-net.info/alan/user-home.php"); exit; } Try the above code. I changed the $num = mysql_num_row($result); Also changed the if ($num !=0) You were counting rows, not actually getting the user level, and if there were more than 0 rows, which is true, it will always to go admin_home.php.
  7. If the column names are 1,2,3, 4, 5, 6, 7 $q = "UPDATE `points` SET `1`=$a, '2'=$b, '3'=$c WHERE `1`='$a'"; This will set each variable to a column and update where 1 is equal to $a. If this is what you want. Not quite sure.
  8. no problem that is what this forum is for.
  9. // create query $query = "INSERT INTO registrations (id, first, last, ) VALUES ('', '$first', $last', '$address', '$city', '$state', '$zipcode', '$phone', '$cell', '$email', '$age', '$weight1', '$height1', '$grade', '$position', '$school', '$coach')"; You forgot to put the field names from the table in after the registrations. I started, you should be able to finish it, just keep adding you fields with commas separating.
  10. I don't see how that's going to get anyone anywhere. It was a simple question. I agree 100% with the admins on that topic. As an admin myself, I would definitely not be giving out that type of info. IF you want to create this site, you will have to do what they posted in your post and create it yourself. There would be a definate security question going through the heads of the forum members as to what info they are giving out.
  11. Is the database name, or the table users. If the table is users, you will have to put in the DB name
  12. $conn = mysql_connect("localhost", "sqlusername", "sqlpassword") or die(mysql_error()); mysql_select_db('sqldatabasename', $conn) or die(mysql_error());
  13. $_GET['id] would be for page.php?id=1234
  14. <?php // set database server access variables: $host = "localhost"; $user = "user"; $pass = "pass"; $db = "dbname"; ?> <?php include ("includes.php"); include ("pagelog.php"); ?> <?php if (!isset($_POST['submit'])) { // form not submitted ?> <form action="name.php" method="post"> First Name: <input type="text" name="fname"><BR> Last Name: <input type="text" name="lname"><BR> Party: <input type="text" name="party"><BR> address: <input type="text" name="address"><BR> city: <input type="text" name="city"><BR> state: <input type="text" name="state"><BR> zip: <input type="text" name="zip"><BR> misc: <input type="text" name="misc"><BR> <input type="submit" name="submit"><BR> </form> <?php } else { // form submitted // open connection $connection = mysql_connect($host, $user, $pass) or die ("Unable to connect!"); // get form input // check to make sure it's all there // escape input values for greater safety $fname = mysql_escape_string($_POST['fname']); $lname = mysql_escape_string($_POST['lname']); $party = mysql_escape_string($_POST['party']); $address = mysql_escape_string($_POST['address']); $city = mysql_escape_string($_POST['city']); $state = mysql_escape_string($_POST['state']); $zip = mysql_escape_string($_POST['zip']); $misc = mysql_escape_string($_POST['misc']); // select database mysql_select_db($db) or die ("Unable to select database!"); // create query $query = "INSERT INTO user (firstname, lastname, numparty, address, city, state, zip, misc) VALUES ('$fname', '$lname', '$party', '$address', '$city', '$state', '$zip', '$misc')"; // execute query $result = mysql_query($query) or die ("Error in query: $query. ".mysql_error()); // close connection mysql_close($connection); } ?> The above is an example of what I believe you want.
  15. What errors are you getting
  16. where is the result at like $user_level = mysql_query($sql_validation_check)
  17. There is another post for this, but I cannot reply to that one either to add my comment.
  18. I cannot reply to any topics in the forum, keep getting white page after post is clicked. I hit refresh and get error.
  19. How would I go about creating a cert for my personal server and creating a secure server. Does anyone know what the steps would be for this. I would like to keep it on my server, that way I can keep down costs of paying for a dedicated server online, and I have 3 servers sitting in my house that I dont use, and would like to put them to use. I have just started using Apache, so not sure as to what it is about yet. I am using a Win 2000 Server machine, Apache 2.2, MySQL 5 and PHP 5. Thanks in advance.
  20. In firefox, my loading icon stays lit for about 54 seconds while loading each page. Like I said, it is not major, it is just a little slower loading than the old version.
  21. Yeah, it is loading a little slower for me as well, not much of a difference though.
  22. My code already creates a new row after each record is outputed. I need to know how to get mutiple TD's in a row. I have tried duplicating the TD part, and the screen displays nothing. That is what I need to know how to do.
  23. I want to display a result in a total of 3 columns. I have a sql database and here is the code that I use for it. // create query $query = "SELECT firstname, lastname, address, city, state, zip FROM testtable"; // execute query $result = mysql_query($query) or die ("Error in query: $query. ".mysql_error()); // see if any rows were returned if (mysql_num_rows($result) > 0) { // yes // print them one after another while($row = mysql_fetch_row($result)) { echo "<table>"; echo "<TR>"; echo "<TD>"; echo $row[0] . " " . $row[1] . "<BR>"; echo $row[2] . "<BR>"; echo $row[3] . ", " . $row[4] . " " . $row[5] . "<BR>"; echo "<BR>"; echo "</TD>"; echo "</tr>"; echo "</table>"; this puts the info in a single column, and I want to to span into 3 columns. example Record 1 Record 2 Record 3 Record 4 Record 5 Record 6
×
×
  • 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.