Jump to content

mazman13

Members
  • Posts

    156
  • Joined

  • Last visited

    Never

Everything posted by mazman13

  1. Thank you. I will def do that. As far as the positioning the layout, I'm I doing it right?
  2. I have a layout that I would like someone to look at. It looks good in IE and Firefox but I just want to make sure the way I'm laying out the site it good and everything looks right. I don't want ot get in a habbit of making sites like this when it isn't the right way. http://mzliveonline.com/mzLive/ I'm going to add more content on the center col... So if the top box is 200px high, would i do the second like?: left: 410; top: 205px; Is that the way to do it or should I just start using floats for everything?
  3. thats right. well i changed it all up. and now its working but it won't carry over $userID in header. How come?
  4. I would also change your .inc file to a php. The php could be read if pulled up directly.
  5. It seems like this script isn't working with header(Location:) You can see what I mean www.collisionspecialiststx.com/fleetportal u-michael p-test Here is the script <!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-Language" content="en-us"> <meta http-equiv="Content-Type" content="text/html; charset=windows-1252" /> <title>Fleet Portal</title> <link rel="stylesheet" type="text/css" href="../pagestyle.css"> </head> <body> <div id="wrapper"> <div id="header"> <p> </p> </div> <div id="tabs"> <ul> <li><a href="../index.html"><span> Home </span></a></li> <li><a href="../contactus.htm"><span>Contact Us</span></a></li> <li><a href="../checkvehicle.htm"><span>Check Vehicle</span></a></li> <li><a href="../agents.htm"><span>Agents</span></a></li> <li><a href="../repairsteps.htm"><span>Repair Steps</span></a></li> <li><a href="../shoptour.htm"><span>Shop Tour</span></a></li> <li><a href="../employment.cfm"><span>Jobs</span></a></li> <li><a href="../commitment.htm"><span>Our Commitment</span></a></li> <li><a href="../warranty.htm"><span>Warranty</span></a></li> <li><a href="../fleet.htm"><span>Fleet</span></a></li> </ul> </div> <div id="content"> <table align="center" border="0" width="350" bgcolor="#99CCFF" cellspacing="0" cellpadding="0" style="border: 2px solid #6699FF; margin: 20px auto 20px auto;"> <tr> <td bgcolor="#6699FF" height="30" colspan="5"> <p align="center"><font face="Verdana" size="2" color="#FFFFFF"><b>Login</b></font></td> </tr> <td> <?php session_start(); $_SESSION['username']; $errorMessage = ''; if (isset($_POST['txtUserId'])) { $userID = htmlentities($_POST['txtUserId']); $userPass = htmlentities($_POST['txtPassword']); //replace the following with your MySQL values //********************* include('includes/connection.php'); // 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 header('Location:main.php?username=$userID'); 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="350" cellspacing="2" cellpadding="2" border="0" align="center"> <tbody> <tr> <td width>Username: </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> </td> </tr> </table> </div> <div id="footer"> <!--webbot bot="Include" U-Include="footer.htm" TAG="BODY" startspan --> <p class="style1"> <font color="#C0C0C0"><a target="_blank" href="http://www.ase.com"><img border="0" src="../images/ase.gif" width="49" height="45" align="middle"></a></font><font color="#FFFFFF"><a target="_blank" href="http://www.i-car.com"><img border="0" src="../images/footer2.gif" align="middle" width="46" height="59"></a></font><font color="#000000"><a target="_blank" href="http://www.hertz.com"><img height="32" src="../images/Hertzlogo-Transparent.gif" width="72" border="0" align="middle"></a></font></p> <!--webbot bot="Include" i-checksum="47141" endspan --></div> </div> </body> </html>
  6. can you give me an example of how that? i'm just trying to get my head around it.
  7. I have a form that I have in the admin section of a site. This form is used for adding new companies to the database. I also have a drop down box below it showing all the companies currently in the db. I want to use this page as an add/edit page. I want them to be able to click on a company in the drop down box and populate the form with the info from the drop down box so they can edit...but i also want to use the form from them to add info... In the past I had two forms...one normal (for adding) and the another for editing field with php....but there has to be a better way than to call each form... whats the best way?
  8. Ok with the foreach one, how to i make it so that the current year shows first? It prob needs to be in desc order. echo "<select name='year'>"; foreach (range(date('Y')-20, date('Y')) as $year) { echo " <option value='$year'>$year</option>"; } echo "</select>";
  9. I'm trying to make a drop down box with years (2001, 2002, 2003, ect) but I don't want to enter then all and update them every year when the year changes. Whats the best way to do a drop down box using the current year and going back 20? Thanks
  10. Any ideas on how to do a slideshow type menu with ajax?? i don't want to use flash (mavs.com) and i figure javascript can do it (kiddlive.com)...i'm super new to ajax so I don't know if anyone has a script i can see. thanks
  11. If I want to get records from 2008-1-1 to 2008-3-1....what would be the best query to get that?? Thanks
  12. Seemed to work. What did that do? Also, i tried that on the logo and it didn't work. It's centered in IE and to the left in FF.
  13. Where would I put that to make it work?
  14. Nope. everything is good. nvm. Thanks again.
  15. Yep. It worked thanks. One more question. I'm new with session. I want to carry the username from the login page to the protected page (it acts as my key to get certain info for certain users)...what is the simple was to carry it over? I've tried header('location:main.php?username=$username') The var doesn't even show up on the bar on the main page.
  16. I closed and reopened the browers and it still does it. Everytime I go straight to the "protected" page it opens right up.
  17. Ok. I have everything redirecting to the page now. Everything seems good. Here is what I'm using : session_start(); if (!isset($_SESSION['test_logged_in']) || !$_SESSION['test_logged_in']) { die("You are not logged in."); } But when I go to the redirected page directly, it still works as if it when through the login...is it cuz session_start() is before the test?
  18. Any ideas on how to make main_login.php password protected if they were trying to go there straight?
×
×
  • 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.