Jump to content

mazman13

Members
  • Posts

    156
  • Joined

  • Last visited

    Never

Everything posted by mazman13

  1. I found this script online...it's simple and it will do what i need for now. But I do have a problem with it. <?php session_start(); $errorMessage = ''; if (isset($_POST['txtUserId'])) { $userID = htmlentities($_POST['txtUserId']); $userPass = htmlentities($_POST['txtPassword']); //replace the following with your MySQL values //********************* $dbhost = "---"; $dbuser = "---"; $dbpass = ""; $dbname = "fleet_portal"; //********************* $conn = mysql_connect($dbhost, $dbuser, $dbpass) or die ('Error connecting to mysql'); mysql_select_db($dbname); // check if the user id and password combination exist in database $query = "SELECT * FROM company WHERE `username` = '$userID' AND `password` = '$userPass' AND `enabled`=1"; $result =mysql_query($query) or die('Query failed. ' . mysql_error()); if (mysql_num_rows($result) == 1) { // the user id and password match, // set the session $_SESSION['test_logged_in'] = true; $_SESSION['user']=$userID; // after login we move to the main page include"main_login.php"; exit; } else $errorMessage = 'Sorry, wrong user id / password'; } if ($errorMessage != '') { ?> <p align="center"><strong><font color="#990000"><?php echo $errorMessage; ?></font></strong></p> <?php } ?> <form id="frmLogin" name="frmLogin" method="post"> <table width="400" cellspacing="2" cellpadding="2" border="0" align="center"> <tbody> <tr> <td width>User Id</td> <td><input type="text" id="txtUserId" name="txtUserId" /></td> </tr> <tr> <td width>Password</td> <td><input type="password" id="txtPassword" name="txtPassword" /></td> </tr> <tr> <td width> </td> <td><input type="submit" value="Login" name="btnLogin" /></td> </tr> </tbody> </table> </form> As you can see, Ive included the main page they see after they log in... Well on that page I have a few forms that use PHP_SELF...everytime it goes back to main.php?whatever it pops a login again. What can be done to continue the session? // after login we move to the main page include"main_login.php"; exit;
  2. I found this script online...it's simple and it will do what i need for now. But I do have a problem with it. <?php session_start(); $errorMessage = ''; if (isset($_POST['txtUserId'])) { $userID = htmlentities($_POST['txtUserId']); $userPass = htmlentities($_POST['txtPassword']); //replace the following with your MySQL values //********************* $dbhost = "---"; $dbuser = "---"; $dbpass = ""; $dbname = "fleet_portal"; //********************* $conn = mysql_connect($dbhost, $dbuser, $dbpass) or die ('Error connecting to mysql'); mysql_select_db($dbname); // check if the user id and password combination exist in database $query = "SELECT * FROM company WHERE `username` = '$userID' AND `password` = '$userPass' AND `enabled`=1"; $result =mysql_query($query) or die('Query failed. ' . mysql_error()); if (mysql_num_rows($result) == 1) { // the user id and password match, // set the session $_SESSION['test_logged_in'] = true; $_SESSION['user']=$userID; // after login we move to the main page include"main_login.php"; exit; } else $errorMessage = 'Sorry, wrong user id / password'; } if ($errorMessage != '') { ?> <p align="center"><strong><font color="#990000"><?php echo $errorMessage; ?></font></strong></p> <?php } ?> <form id="frmLogin" name="frmLogin" method="post"> <table width="400" cellspacing="2" cellpadding="2" border="0" align="center"> <tbody> <tr> <td width>User Id</td> <td><input type="text" id="txtUserId" name="txtUserId" /></td> </tr> <tr> <td width>Password</td> <td><input type="password" id="txtPassword" name="txtPassword" /></td> </tr> <tr> <td width> </td> <td><input type="submit" value="Login" name="btnLogin" /></td> </tr> </tbody> </table> </form> As you can see, Ive included the main page they see after they log in... Well on that page I have a few forms that use PHP_SELF...everytime it goes back to main.php?whatever it pops a login again. What can be done to continue the session? // after login we move to the main page include"main_login.php"; exit;
  3. The footer icons are screwed up in IE...but they work great in firefox. Any ideas? www.mzliveonline.com/mzlive
  4. http://michaelzavala.com/new/home.php Well the footer is off centered. And it should have a 10px margin on the top. What site do I use to check my site for errors?
  5. Cool. So do you guys have the same problem with dreamweavers displays? Just don't use it?
  6. http://www.michaelzavala.com/new/home.php Having problems with the footer not being right in firefox. Any ideas? Someone told me that my css was all over the place. I think I've cleaned it up. Also...on the top where the subscription box is, I'm having a problem viewing it in Dreamweaver. When I include 'subscription.php' it throws my layout off. But when I view it on Firefox or look at the css code, it looks ok. Any ideas? Thanks
  7. Thanks! I'll go into everything and recode it this weekend. Thanks again
  8. I figured out the nav bar problem. I've also changed the design-- you can see it here: www.michaelzavala.com/new/home.php Still having problems with the nav BUTTONs in FIREFOX tho. Not sure why the arn't aligned right. Also the footer at the bottom is not at the bottom like it is in IE. Can someone let me know what I'm doing wrong is CSS? Thanks!
  9. I've got a few problems with the site design... www.michaelzavala.com/new/home.php 1) The black nav bar is at the very top of the page on Dreamweaver--- I'm afraid it will do the same on some older browsers. 2) On Firefox, the nav buttons are more to the right than they are on IE. Why? 3) Can someone check the Nav links and make sure everything looks ok?? Thanks again! body { font-family: Verdana, Geneva, Arial, helvetica, sans-serif; font-size: 14px; color: #000000; } /* Start Header styles */ #container { width: 760px; margin: 0 auto; } #header_logo { position: absolute; z-index: 10; width: 275px; height: 320px; } #greay_header { display: block; width: 650px; height: 75px; float: right; background-color: #dcdcdc; margin-top: 50px; clear: right; } #black_navbar { display: block; width: 650px; height: 25px; float: right; background-color: #000000; clear: right; } /* Start Nav links */ ul#navlinks { margin-top: 4px; margin-left: 150px; margin-right: 0px; } ul#navlinks li { display: inline; letter-spacing: 2; } a.nav_link:link { color:#FFFFFF; border: solid #FFFFFF 1px; padding-left: 10px; padding-right: 10px; text-decoration: none; font-size: 12px; } a:hover { border: solid #FFFFFF 1px; padding-left: 10px; padding-right: 10px; text-decoration: none; background: #FFFFFF; color: #000000 !important; font-size: 12px; } a:visited { color:#FFFFFF; border: solid #FFFFFF 1px; padding-left: 10px; padding-right: 10px; text-decoration: none; font-size: 12px; } <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <link rel="stylesheet" type="text/css" href="styles/main.css" /> <title>Untitled Document</title> </head> <body> <div id="container"> <img src="images/header_logo.png" alt="Michael Zavala Logo" id="header_logo"/> <div id="greay_header"></div> <div id="black_navbar"> <ul id="navlinks"> <li><a href="home.php" class="nav_link">Home</a></li> <li><a href="home.php?page=bio" class="nav_link">Bio</a></li> <li><a href="home.php?page=media" class="nav_link">Media</a></li> <li><a href="home.php?page=media" class="nav_link">Features</a></li> <li><a href="home.php?page=media" class="nav_link">Store</a></li> <li><a href="home.php?page=media" class="nav_link">Contact</a></li> </ul> </div> </div> </body> </html>
  10. No, that's cool. I get what your doing. I was trying to make it more complicated. Thanks again
  11. Sorry about that sentence. Lol that's what I for trying to multitask. The form is going to be much longer. But if something is wrong or is left blank, I want the form to come back with all the info they typed in. I'd hate for them to type everything all over again becuase they forgot to check a box or something.
  12. Ive never used functions in a PHP script...so I started to use them with this form. I was wondering if my setup is going the right way before I continue. <?php #####//Site Functions Start Here//##### function text_field($name, $value, $size, $max) { echo"<input name=\"$name\" type=\"text\" value=\"$value\" size=\"$size\" maxlength=\"$max\" />"; } #####//Processes Start Here//##### if($_REQUEST['submit_check'] == 1) { if($_REQUEST['fname'] == "") { echo "Please enter first name."; $error = 1; } else{ echo "Information has been added."; $error = 0; } } ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <title>Guest Database</title> <!-- Start Style--> <style> body { background:#FFFFFF; font-family:Verdana, Arial, Helvetica, sans-serif; size:10px; } </style> </head> <body> <!-- Start forms--> <form name="add_edit_info" action="<?php $_SERVER['PHP_SELF']; ?>" method="post"> <?php if(!isset($_REQUEST['submit_check']) and $error != "1") ////Start blank form { echo "First Name: "; text_field("fname", "", "20", "20"); echo "<br />Last Name: "; text_field("lname", "", "20", "20"); echo "<input name=\"submit_check\" type=\"hidden\" value=\"1\" />"; echo "<br /><input name=\"submit\" type=\"submit\" value=\"Submit\" />"; echo "test 1"; } else ////If something is wrong, or the entry needs to be editied, start edit form { echo "First Name: "; text_field("fname", $_REQUEST['fname'], "20", "20"); echo "<br />Last Name: "; text_field("lname", $_REQUEST['lname'], "20", "20"); echo "<input name=\"submit_check\" type=\"hidden\" value=\"1\" />"; echo "<br /><input name=\"submit\" type=\"submit\" value=\"Submit\" />"; echo "test 2"; } ?> </form> </body> </html> This would be if they are adding a new entry. And if it's wrong, it shoots back a form with the data and the correct or add it. Is it best to do all this in one script? Or should I break it down and have different pages? If I want to make a script with a form to EDIT data they already have in the DB, should I add that to this page? Or make it's own page? Or, if I do add it to this page, should I write the script in another page and include it here using an if statement? Sorry. Bunch of questions. Just want to make it right the first time.
  13. Its in a database. So I do need a program to make the feed? Will the feed update when the database updates?
  14. I have some data I want to turn into an rss feed. What's the best way to do this?
  15. I added a a display:block...also took off the padding for left and right...and took off float:left...it worked. lol don't know why.
  16. Yeah i saw that, but 80% of the site is margin-left:51... so i don't know why they are all doing it. is it cuz its floating?
  17. i want to learn javascript and didn't know if anyone knows of a good offline ebook or pdf ?
  18. i just looked at a snapshot of my new site in old ie browsers...i'm not sure why the links are offset... www.michaelzavala.com/show/new thanks again
  19. Yeah, i thought about that. but then we run into having 3 different people not look and type in 3 of the same guys in the database...maybe i should have a admin section for the agent section. were you have to go to another page to add/edit/delete a agent from the "add guest" form. think that will work?
  20. I'm creating a database that will have guest information for a radio show. I guess it's kinda their own version of IMDB but for the show itself. They will be able to add guest info to the database and then pull up the contact info when needed. My problem is this... Lets say they put the information in for Tom Hanks. They put in his contact info and then they go on to his pub. or agent info.. Lets say his agent is United Artists. What I don't want the user typing in 5 different types "United Artists" in the database. i.e. - "united artists" "united artists inc." "the united artists"...ect Because that would make it very difficult to locate artists for that agent. So on the form there will be a drop downbox full of these guys. If someone is not on it, there is a "new" link that will open a pop-up box so you can add a new agent (name, contact, ect). When they click Submit on that popup...what is the BEST way to have the page they have been working on refresh and add the new agent into the drop box? What is the best way to do this? AJAX? Or am I going about this the wrong way?
  21. Wow. That's simple. I didn't even know you could do something like that. Thanks!
  22. Is it possible to convert an XML file to a .CSV. I'm waiting to store a feed in a table...and I didn't know if that was possible. Thanks
  23. I guess what I'm asking is if there is any way to do this within a forloop? Whats the best way to do this? 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.