Jump to content

jakatu

New Members
  • Posts

    8
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

jakatu's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. I am trying to get an array of all of the values in a column in a table in my database. can anybody tell me how to do this?
  2. I am trying to call each record in a user database table and display them in a member directory for my site and I only get the first users information for every record in my table. <?php $query = "SELECT id FROM users ORDER BY company ASC"; $result = mysql_query($query); confirm_query($result); $row = mysql_fetch_array($result); foreach($row as $id){ $query = "SELECT name, address, city, state, zip, phone, fax, email, company FROM users WHERE id = $id"; $result = mysql_query($query); confirm_query($result); $row = mysql_fetch_array($result); $name = $row['name']; $email = $row['email']; $company = $row['company']; ?> <td valign="top" style="font-size:12px; text-align:center"> <table> <tr> <td><?php echo $name; ?></td> </tr> <tr> <td><?php echo $company; ?></td> </tr> <tr> <td><?php echo $email; ?></td> </tr> </table> </td> <? } ?> I have tried doing a while loop and get the right id numbers back from the initial query but I have frankly never been able to get foreach right and I just want to finally do it. Any help would be appreciated.
  3. oooooHHHHHHH RHODESA I COULD KISS YOU!!!!!!!!!!!!!!!!!!!! you made me a very happy man. and saved my bacon thank you soo much the "if($_SERVER['REQUEST_METHOD'] == 'POST') " did the trick. thank thank thank you
  4. have put in the print_r thing and result in firefox is a blank page with this message; "Array ( [access] => password [submit] => Login )." Explorer still just does the refresh thing.
  5. this is in the body section of my page <table id="structure"> <tr> <td valign="top" id="navigation"> <h2>Login</h2> <br> <form action="user_login.php" method="post"> <?php if (!empty($message)) { echo "<p class=\"message\">" . $message . "</p>";} ?> and the redirect_to function is as follows function redirect_to( $location = NULL ) { if ($location != NULL) { header("Location: {$location}"); exit; } }
  6. I have also taken out the redirect_to part and just listed a positive message to be displayed if the access code is correct. That wont show up either. If I type in a bad access code it will however display the negative message
  7. I am pretty new to web programming and I am experiencing a weird problem. I (or any user) can login to the site fine when using firefox or safari, but when I try using Internet Explorer, it doesn't work. It gives me an error message when I type in a bad access code but when it is right the page just refreshes and nothing happens. I am inserting the code for the part that is goofy. if(isset($_POST['submit'])) { //Form has been submitted $errors = array(); //perform validations on the form data $required_fields = array('access'); $errors = array_merge($errors, check_required_fields($required_fields, $_POST)); $fields_with_lengths = array('access' => 30); $errors = array_merge($errors, check_max_field_lengths($required_fields, $_POST)); $access = $_POST['access']; if ( empty($errors)) { // Check database to see if the company and hashed password exist there. $query = "SELECT users_id, id FROM subjects WHERE access = '{$access}' "; $result_set = mysql_query($query); confirm_query($result_set); if (mysql_num_rows($result_set) == 1) { //company/password authenticated // and only one match $found_client = mysql_fetch_array($result_set); redirect_to("public.php?user=" . $found_client['users_id'] . "&subj=" . $found_client['id']); } else { // company/password combo was not found in the database $message = "Company and password combination incorrect.<br> Please make sure your caps lock is off and try again."; } } else { if (count($errors) == 1) { $message = "There was 1 error in the form."; } else { $message = "There were ". count($errors) . " errors in the form."; } } } else {//Form has not been submitted. $company = ""; $access = ""; } [/Code] I know that the functions that i created work i just cant figure it out. I am pretty sure its not the sql portion either. I have taken that out and just put the access code in the script just to check. It still didn't work. If anybody has ever experienced this let me know I am not alone and moreover those who have overcome this issue please share your knowledge with me. Thank you for your help
×
×
  • 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.