Jump to content

shag

Members
  • Posts

    16
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

shag's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. no. not unless you have register_globals = On, which you probably don't. in that case, the form value is $_GET['select']; the code says "if $select is set, then set $select". Since $select isn't set, $select will never be set. you probably want something more like $select = ''; if (isset($_GET['select'])) { $select = $_GET['select']; } DOH can't believe it was so simple, everything is working perfectly now! Greatly appreciate your assistance
  2. isn't select set from the html form??
  3. This is the entire code, it shows the client names perfectly fine in the dropdown box, but it wont let me display all of the client info after hitting "select" that is the part i am stuck on if that makes sense.
  4. trying to be able to store client information in mysql db for reference later in an admin area. The code I have so far allows me to list the client names, but once I "select" the name I want it to show the rest of the database information stored for that user (email, height, weight, phone number, etc...) which it currently is not doing. Any and all help will be greatly appreciated, tired of struggling through this blindly. <? // Connect database mysql_connect("localhost","",""); mysql_select_db("mydb"); if(isset($select)&&$select!=""){ $select=$_GET['select']; } ?> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> </head> <body> <form id="form1" name="form1" method="get" action="<? echo $PHP_SELF; ?> "> Client Name : <select name="select"> <option value="">--- Select ---</option> <? // Get records from database (table "users"). $list=mysql_query("select * from users order by id asc"); while($row_list=mysql_fetch_assoc($list)){ ?> <option value="<? echo $row_list['id']; ?>" <? if($row_list['id']==$select){ echo "selected"; } ?>><? echo $row_list['name']; ?></option> <? } ?> </select> <input type="submit" name="Submit" value="Select" /> </form> <hr> <p> <? if(isset($select)&&$select!=""){ // Get records from database (table "users"). $result=mysql_query("select * from users where id='$select'"); $row=mysql_fetch_assoc($result); ?> Information about <strong><? echo $row['name']; ?></strong> client...</p> <p><? echo $row['email']; ?><br> ........................................<br> ........................................ <? // End if statement. } // Close database connection. mysql_close(); ?> </p> </body> </html>
  5. Have any tips or a link where I can get started??
  6. I currently have a navigation menu made up for my fraternity website and I have need for more menus than actual space. http://www.csulbsigmapi.com is the site. What I want to do is make the "Calendar" link have dropdown boxes that say "contact" and "forum" for now. Any ideas on how I can accomplish this without recoding the whole site? Let me know if you need me to post any code snippets or anything...
  7. I do not understand what you are saying... I do not have any names being displayed as I do not know how to go about listing 100 names neatly.
  8. This is my current navigation and as of right now I have no code for the names as I am not sure the best way to go about listing so many... <?php $page = $_GET['page']; if($page){ $site = file_exists($page.'.php') ? $page.'.php' : 'error.php';} else{ $site = 'home.php'; } include($site); ?>
  9. Sorry if I was unclear. Basically I am building a roster, which contains roughly 100 names. I need a way to list these nice and neat so the website does not look bad. I have my navigation setup to the page as site.com/?page=brothers Now when you click one of the names on the roster I would like it to be... site.com/?page=brothers&name="theirname". Does that make more sense?
  10. I have been working on a website and now I am at the point where I need to add a roster of about 100 names along with bios. I was wondering what the best way to go about creating such a large list would be so it did not look too terrible. I also have navigation to pages setup as ?page=brothers and I wanted to add a subnav to the brothers to include their name like: ?page=brothers&name=shag I did some searching but could not find anything that looked like it would work. Any tips and help are greatly appreciated.
  11. Thank you very much cage! Worked great can't believe I missed that...
  12. I understand what you are saying... I have the .css file and can <link media="screen" href="style.css" type="text/css" rel="stylesheet"> But what my question is to how to get the .html in there without going through every single line... Maybe provide an example?
  13. It is not... I simply have a .html file and a .css file.
  14. I understand what you are saying, but in order to add the content I want would I not have to go through the 400+ lines of html code and echo it all?? Or how would I go about that?
  15. Basically I have an admin area in /admin. Once going there it will check to see if you are logged in, and if not show the login page. Once you provide valid login details it shows the main admin area. I have no problem simply doing echo "Admin area"; etc... But I want it to be styled to look like the rest of my website. My index.php is <? session_start(); include("database.php"); include("login.php"); ?> <html> <link media="screen" href="style.css" type="text/css" rel="stylesheet"> <title>Admin Are</title> <body> <? displayLogin(); ?> </body> </html> I saved the whole html layout of how i want the site to look as "style.txt" in login.php I have: $template = file_get_contents("style.txt"); Then further down after it decides whether the user is logged in and if they are logged in i have: function displayLogin(){ global $logged_in; if($logged_in){ echo $template; } else{ display login form again... Any advice on how I can style the admin area? Or see an area where i mixed something up? Thanks.
×
×
  • 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.