Jump to content

Clinton

Members
  • Posts

    337
  • Joined

  • Last visited

Everything posted by Clinton

  1. I have no idea what any of that means. :-| *Where did I put my GOogle?*
  2. unexpected T_ELSE. Any ideas? (I /// HERE HERE /// the code in question) <?php /// LOGIN START /// /// CHECK TO SEE IF USER IS LOGGED IN /// if($_SESSION['logged_in'] == TRUE) { $query = mysql_query('SELECT prefix, lname FROM employers WHERE id = "'.mysql_real_escape_string($_SESSION['user_id']).'"'); $row = mysql_fetch_assoc($query); extract($row); ?> <div class="module_s2"> <div class="first"> <div class="sec"> <h2><? echo $prefix; echo $lname; ?></h2> <div class="box-indent"> <div class="width"> Welcome back. You have the con.<br /> <p> <a href="logout.php">Logout</a> </p> </div> </div> </div> </div> </div> <?php } /// IF USER IS NOT LOGGED IN THEN CHECK TO SEE IF FORM IS SUBMITTED /// elseif (isset($_POST['login'])) { if($_POST['username']!='' && $_POST['password']!='') { $query = mysql_query('SELECT id, username, active FROM users WHERE username = "'.mysql_real_escape_string($_POST['username']).'" AND password = "'.mysql_real_escape_string(md5($_POST['password'])).'"'); if(mysql_num_rows($query) == 1) { $row = mysql_fetch_assoc($query); if($row['active'] == NULL) { $_SESSION['user_id'] = $row['id']; $_SESSION['logged_in'] = TRUE; header("Location: index.php"); } ?> echo "<div class='module_s2'>"; echo "<div class='first'>"; echo "<div class='sec'>"; echo "<h3>Login</h3>"; echo "<div class='box-indent'>"; echo "<div class='width'>"; <?php /// HERE HERE HERE HERE /// else { $error = 'Your membership was not activated. Please open the email that we sent and click on the activation link'; } } else { $error = 'Login failed !'; } } else { $error = 'Please user both your username and password to access your account'; } } ?> <form action="<?=$_SERVER['PHP_SELF']?>" method="post" name="login" class="form-login"> <label> Username </label> <input type="text" name="username" class="inputbox"/> <input type="text" name="username" class="inputbox"/> <label> Password </label> <input type="password" name="password" class="inputbox" /><br /> <input type="checkbox" name="remember" class="checkbox" value="yes" /> <label class="remember"> Remember Me </label> <input type="submit" name="login" class="button" value="login" /> <p> <a href="passwordreset.php"> Forgot your password? </a></p> <p> <a href="usernamefind.php"> Forgot your username?</a> </p> <p> No Account Yet? <a href="register.php"><br /> Create an account</a> </p> </form> </div> </div> </div> </div> </div> <?php else { ?> echo "<div class='module_s2'>"; echo "<div class='first'>"; echo "<div class='sec'>"; echo "<h3>Login</h3>"; echo "<div class='box-indent'>"; echo "<div class='width'>"; <form action="<?=$_SERVER['PHP_SELF']?>" method="post" name="login" class="form-login"> <label> Username </label> <input type="text" name="username" class="inputbox"/> <input type="text" name="username" class="inputbox"/> <label> Password </label> <input type="password" name="password" class="inputbox" /><br /> <input type="checkbox" name="remember" class="checkbox" value="yes" /> <label class="remember"> Remember Me </label> <input type="submit" name="login" class="button" value="login" /> <p> <a href="passwordreset.php"> Forgot your password? </a></p> <p> <a href="usernamefind.php"> Forgot your username?</a> </p> <p> No Account Yet? <a href="register.php"><br /> Create an account</a> </p> </form> </div> </div> </div> </div> </div> <?php } ?> <?php /////END LOGIN//// ?>
  3. The log out didn't work. It's got to be something simple I'm missing. I'm just going to redo the whole thing from scratch. But why the session_regenerate_id(true);? Why do you get a new session id for each page? What's the purpose?
  4. Could it have something to do with the session start? " Just like with our cookies, the 1. session_start() session_start() code must be in the header and you can not send anything to the browser before it. It’s best to just put it directly after the to avoid potential problems. So how will it know it’s me? Most sessions set a cookie on your computer to uses as a key… it will look something like this: 350401be75bbb0fafd3d912a1a1d5e54. Then when a session is opened on another page, it scans your computer for a key. If there is a match, it accesses that session, if not it starts a new session for you. " But that needs to be on every page, right?
  5. Ok.... we're getting somewhere... it went right back to my index page and I noticed that the SESSION_ID had changed. Every time I go back and hit logout it gives me a new SES_ID. So what does that mean... that I'm resetting it somewhere in my code? Here's my entire index page. <?php session_start(); include 'connect/project.htm'; ?> <html> <head> <title>Welcome to test <?php echo session_id(); ?></title> <link href="images/favicon.ico" rel="shortcut icon" type="image/x-icon" /> <link rel="stylesheet" href="index.css" type="text/css" /> <link rel="stylesheet" href="constant.css" type="text/css" /> </head> <body> <div id="tail"> <div class="main"> <div id="top"> <div id="logo"> <a href="index.php"><img src="images/logo.png" alt="" /></a> </div> <div class="right"> <div id="topmenuposition"> </div> <div id="topmenu"> <div class="module_s10"> <div> <div> <div> <ul class="menu-nav"> <li class="item60"><a href="index.php"><span><em>Home</em></span></a></li> <li class="item29"><a href="aboutus.php"><span><em>About Us</em></span></a></li> <li class="item54"><a href="resources.php"><span><em>Resources</em></span></a></li> <li class="item55"><a href="press.php"><span><em>Press/Media</em></span></a></li> <li class="item56"><a href="contact.php"><span><em>Contact Us</em></span></a></li></ul> </div> </div> </div> </div> </div> </div> </div> <div id="header"> <div class="bg-right"> <div class="bg-left"> <div class="space"><img src="images/banner.png" alt="" /></div> </div> </div> </div> <div id="breadcrumb"> <div class="module_breadcrumb"> <div> <div> <div> <span class="breadcrumbs pathway"> <form name="search" action="search.php" method="POST"> <select name="major" onchange='this.form.submit()'> <?php $sql = "SELECT majors FROM degrees "."ORDER BY majors"; $rs = mysql_query($sql); while($row = mysql_fetch_array($rs)) { extract($row); echo "<option value='$majors'>$majors</option>"; } ?> </select> </form> </span> </div> </div> </div> </div> </div> <div id="wrapper"> <div class="indent"> <div id="right"> <div class="module_menu"> <div class="first"> <div class="sec"> <h3>Main Menu</h3> <div class="box-indent"> <div class="width"> <ul class="menu"> <li id="current" class="active item1"><a href="index.php"><span><em>Home</em></span></a></li> <li class="item2"><a href="aboutus.php"><span><em>About Us</em></span></a></li> <li class="item50"><a href="resources.php"><span><em>Resources</em></span></a></li> <li class="item57"><a href="press.php"><span><em>Press/Media</em></span></a></li> <li class="item58"><a href="press.php"><span><em>Contact Us</em></span></a></li> <li class="item41"><a href="faq.php"><span><em>FAQ</em></span></a></li></ul> </div> </div> </div> </div> </div> <?php /// LOGIN START /// ?> <?php if(!$_SESSION['logged_in']) { $query = mysql_query('SELECT prefix, lname FROM employers WHERE id = "'.mysql_real_escape_string($_SESSION['user_id']).'"'); $row = mysql_fetch_assoc($query); extract($row); ?> <div class="module_s2"> <div class="first"> <div class="sec"> <h2><?php echo $row[prefix]; echo $row[lname];; ?></h2> <div class="box-indent"> <div class="width"> Welcome back. You have the con.<br /> <p> <a href="logout.php">Logout</a> </p> </div> </div> </div> </div> </div> <?php } else { ?> <div class="module_s2"> <div class="first"> <div class="sec"> <h3>Login</h3> <div class="box-indent"> <div class="width"> <form action="<?=$_SERVER['PHP_SELF']?>" method="post" name="login" class="form-login"> <?php if(isset($_POST['login'])) { if($_POST['username']!='' && $_POST['password']!='') { //Use the input username and password and check against 'users' table $query = mysql_query('SELECT id, username, active FROM users WHERE username = "'.mysql_real_escape_string($_POST['username']).'" AND password = "'.mysql_real_escape_string(md5($_POST['password'])).'"'); if(mysql_num_rows($query) == 1) { $row = mysql_fetch_assoc($query); if($row['active'] == NULL) { $_SESSION['user_id'] = $row['id']; $_SESSION['logged_in'] = TRUE; } else { $error = 'You have not activated your membership yet. Please open the email that we sent and click on the activation link <br />'; } } else { $error = 'Login failed! <br />'; echo $_POST['username']; echo $_POST['password']; } } else { $error = 'Please use both your username and password to access your account <br />'; } } ?> <?php if(isset($error)){ echo $error;}?> <label for="mod_login_username"> Username </label> <input name="username" class="inputbox"/> <label for="mod_login_password"> Password </label> <input type="password" name="password" class="inputbox" /><br /> <input type="checkbox" name="remember" class="checkbox" value="yes" /> <label for="mod_login_remember" class="remember"> Remember Me </label> <input type="submit" name="login" class="button" value="login" /> <p> <a href="passwordreset.php"> Forgot your password? </a> </p> <p> <a href="usernamefind.php"> Forgot your username?</a> </p> <p> No Account Yet? <a href="register.php"><br /> Create an account</a> </p> </form> </div> </div> </div> </div> </div> <?php } ?> <?php /////END LOGIN//// ?> </div> <div id="content"> <div class="content-tl"> <div class="content-tr"> <div class="width"> <div id="boxes"> <div id="box1"> <div class="module"> <div class="first"> <div class="sec min-height"> <div class="box-indent"> <div class="width"> <h3><span> Holders</span></h3> <table width="95%" border="0" cellspacing="0" cellpadding="1" class="boxtitle"> <thead> <tr> <td> We've designed this with you in mind. </td> </tr> </thead> <tr> <td align="center"> <table class="pollstableborder" cellspacing="0" cellpadding="0" border="0"> <table class="pollstableborder" cellspacing="0" cellpadding="0" border="0"> <tr> <td> </td> <tr> <td> <label for="voteid1"> <img src="images/bullet.gif" alt="" /> </label> </td> </tr> <tr> <td> <label for="voteid1"> <img src="images/bullet.gif" alt="" /> We only allow eliminating clutter. </label> </td> </tr> <tr> <td> <label for="voteid1"> <img src="images/bullet.gif" alt="" /> No black holes. </label> </td> </tr> </table> </td> </tr> </table> </div> </div> </div> </div> </div> </div> <div id="box2"> <div class="module user2"> <div class="first"> <div class="sec min-height"> <div class="box-indent"> <div class="width"> <h3><span>People</span></h3> <table width="95%" border="0" cellspacing="0" cellpadding="1" class="boxtitle"> <thead> <tr> <td> You need the best, here's why we are it: </td> </tr> </thead> <table class="pollstableborder" cellspacing="0" cellpadding="0" border="0"> </table><br /> <center><a href="eregister.php" class="button">Continue </a></center> </table> </div> </div> </div> </div> </div> </div> </div> <div id="container"> <div class="cont-left"> <div class="cont-right"> <div class="width"> <table class="blog" cellpadding="0" cellspacing="0"> <tr> <td valign="top"> <div> <table class="contentpaneopen"> <tr> <td class="contentheading" width="100%"> Welcome to test! </td> </tr> </table> <table class="contentpaneopen"> <tr> <td> <div class="createdate bg"> 1 March 2009 </div> </td> </tr> </table> <span class="article_separator"> </span> </div> </td> </tr> </table> </div> </div> </div> </div> </div> </div> </div> </div> </div> </div> </div> </div> <div id="footer"> <div class="bg"> <div class="right-bg"> <div class="left-bg"> <div class="space"> © 2009 test </div> </div> </div> </div> </div> </body> </html>
  6. I'm going to jump. It shouldn't be this hard. I can't remember having problems with this in the past. This is the only thing in my logout.php page <?php session_start(); $_SESSION = array(); if(isset($_SESSION['user_id']) || isset($_SESSION['logged_in'])){ unset($_SESSION['user_id']); unset($_SESSION['logged_in']); session_destroy(); header( "Location: index.php" ); } ?> and it's not going back to index.php nor is it killing the session.
  7. Tried that... lol... then I realized it's not echoing any rows. Ok... If I use this : <? if(!$_SESSION['logged_in']) { $query = mysql_query('SELECT prefix, lname FROM employers WHERE id = "'.mysql_real_escape_string($_SESSION['user_id']).'"'); $row = mysql_fetch_assoc($query); extract($row); ?> It logs me in and finds the one user row just fine. BUT it does not log me out. It may be killing my user_id and logged_in but my session_id can still be echoed. If I use: <? if(isset($_SESSION['logged_in'])) { $query = mysql_query('SELECT prefix, lname FROM employers WHERE id = "'.mysql_real_escape_string($_SESSION['user_id']).'"'); $row = mysql_fetch_assoc($query); extract($row); ?> I can logout but my session id still remains and can be echoed. Then I have to enter my information twice to get a logged in status but it does not return any rows. Is there a way to kill the session id perhaps? Because this is just not working as for some reason the session id still remains... ??? [code] <?php session_start(); session_unset(); session_destroy(); header( "Location: index.php" ); ?>
  8. lol.... yea, but it's acting really weird now. I have to login twice for it to work (yea, twice before it shows me as logged in) and then it's not liking my extract $row bit.
  9. Well i'm using that code on my only two pages I have setup right now so if the errors not there than I have no idea. :-|
  10. Ok, give me a sec... here's my script code just in case... <? if(!$_SESSION['logged_in']) { $query = mysql_query('SELECT prefix, lname FROM employers WHERE id = "'.mysql_real_escape_string($_SESSION['user_id']).'"'); $row = mysql_fetch_assoc($query); extract($row); ?> <div class="module_s2"> <div class="first"> <div class="sec"> <h2><? echo $prefix; echo $lname; ?></h2> <div class="box-indent"> <div class="width"> Welcome back. You have the con.<br /> <p> <a href="logout.php">Logout</a> </p> </div> </div> </div> </div> </div> <? } else { ?> <div class="module_s2"> <div class="first"> <div class="sec"> <h3>Login</h3> <div class="box-indent"> <div class="width"> <form action="<?=$_SERVER['PHP_SELF']?>" method="post" name="login" class="form-login"> <? if(isset($_POST['login'])) { if($_POST['username']!='' && $_POST['password']!='') { //Use the input username and password and check against 'users' table $query = mysql_query('SELECT id, username, active FROM users WHERE username = "'.mysql_real_escape_string($_POST['username']).'" AND password = "'.mysql_real_escape_string(md5($_POST['password'])).'"'); if(mysql_num_rows($query) == 1) { $row = mysql_fetch_assoc($query); if($row['active'] == NULL) { $_SESSION['user_id'] = $row['id']; $_SESSION['logged_in'] = TRUE; } else { $error = 'You have not activated your membership yet. Please open the email that we sent and click on the activation link <br />'; } } else { $error = 'Login failed! <br />'; echo $_POST['username']; echo $_POST['password']; } } else { $error = 'Please use both your username and password to access your account <br />'; } } ?> <?php if(isset($error)){ echo $error;}?> <label for="mod_login_username"> Username </label> <input name="username" class="inputbox"/> <label for="mod_login_password"> Password </label> <input type="password" name="password" class="inputbox" /><br /> <input type="checkbox" name="remember" class="checkbox" value="yes" /> <label for="mod_login_remember" class="remember"> Remember Me </label> <input type="submit" name="login" class="button" value="login" /> <p> <a href="passwordreset.php"> Forgot your password? </a> </p> <p> <a href="usernamefind.php"> Forgot your username?</a> </p> <p> No Account Yet? <a href="register.php"><br /> Create an account</a> </p> </form> </div> </div> </div> </div> </div> <? } ?> <? /////END LOGIN//// ?>
  11. My sessions not dying no matter what I do. I'm on my computer (localhost) so I don't know if that has anything to do with it but I would assume not. I've tried everything and even the code below, which unsets my only two session variables and then destroys everything, still keeps me logged in. Why? :-\ <?php session_start(); $_SESSION = array(); unset($_SESSION['user_id']); unset($_SESSION['logged_in']); session_destroy(); header( "Location: index.php" ); ?>
  12. Cause I don't know how to (combine them).
  13. extract($_POST); I was inserting the variables without the _POST so I just extracted it. :-p
  14. What's wrong with the code below? It's not inserting into the second query. (If possible can I just combine the two into one statement?) if (empty($errors)) { $a = md5(uniqid(rand(), true)); $query = "INSERT INTO users (username, password, active) VALUES ('$username', SHA('$password'), '$a')"; $result = @mysql_query($query); $query2 = "INSERT INTO employers (username, fname, lname, title, prefix, cname, caddress, ccity, cstate, czip, cinfo, clogo, firstpnumber, secondpnumber, website, email, signuprate) VALUES ('$username', '$fname', '$lname', '$title', '$prefix', '$cname', '$caddress', '$ccity', '$cstate', '$czip', '$cinfo', '$clogo', '$pphone', '$sphone', '$cwebaddy', '$email', '$crate' )"; $result2 = @mysql_query($query2);
  15. Gotcha. Those make sense. Didn't know you could do that with POST either. Thanks guys.
  16. Ok, here's what this is supposed to be doing. If the form has been submitted then it does its check. If it finds something wrong it echos whats wrong and is supposed to pre-fill in the values so they don't have to type it in all over again. But it's not doing that. For some odd reason the only variable being passed and echoed is the e-mail variable. Any ideas? <?php if (isset($_POST['submitted'])) { $errors = array(); ///checks username/// if (eregi('^[[:alnum:]\.\'\-]{4,30}$', stripslashes(trim($_POST['username']))) ) { $user = mysql_real_escape_string($_POST['username']); $query = "SELECT username FROM users WHERE username = '$user'"; $result = @mysql_query($query); $num = @mysql_num_rows($result); if ($num> 0) { $errors[] = '<font color="red">The username you have chosen has already been taken, please try again.</font>'; } else { $username = mysql_real_escape_string($_POST['username']); } } else { $errors[] = '<font color="red">Please provide a valid username between 4 and 30 characters.</font>'; } ///checks email/// if (!eregi('^[a-zA-Z]+[a-zA-Z0-9_-]*@([a-zA-Z0-9]+){1}(\.[a-zA-Z0-9]+){1,2}', stripslashes(trim($_POST['email'])) )) { $errors[] = '<font color="red">Please provide a valid email address.</font>'; } else { $email = mysql_real_escape_string($_POST['email']); } ///Checks Password/// if (!empty($_POST['password1'])) { if ($_POST['password1'] != $_POST['password2']) { $errors[] = '<font color="red">The 2 passwords you have entered do not match.</font>'; } else { $password = $_POST['password1']; } } else { $errors[] = '<font color="red">Please provide a password.</font>'; } ///Confirms and Inserts/// if (empty($errors)) { $a = md5(uniqid(rand(), true)); $query = "INSERT INTO users (username, password, active) VALUES ('$username', SHA('$password'), '$a')"; $result = @mysql_query($query); if (mysql_affected_rows() == 1) { ///Sends the E-Mail/// $body = "Thank you for registering with blah.com. We are committed to helping you find the right match for your position. To activate your account, please click on this link:\n\n"; $body .= "localhost/project/activate.php?x=" . mysql_insert_id() . "&y=$a"; mail($_POST['email'], 'Registration Confirmation', $body, 'From: registration@blah.com'); ///Show thank you message/// echo '<h3>Thank You!</h3> You have succesfully registered. An e-mail has been sent to the address you specified. Please check your e-mail to activate this account.'; } else { echo '<font color="red">You could not be registered, please contact us about the problem and we will fix it as soon as we can.</font>'; } } else { echo '<h3>Error!</h3> The following error(s) occured:<br />'; foreach ($errors as $msg) { echo " - <font color=\"red\">$msg</font><br />\n"; } $_POST["prefix"] = $prefix; $_POST["fname"] = $fname; $_POST["lname"] = $lname; $_POST["title"] = $title; $_POST["pphone"] = $pphone; $_POST["sphone"] = $sphone; $_POST["email"] = $email; $_POST["cname"] = $cname; $_POST["caddress"] = $caddress; $_POST["ccity"] = $ccity; $_POST["cstate"] = $cstate; $_POST["czip"] = $czip; $_POST["cinfo"] = $cinfo; $_POST["clogo"] = $clogo; $_POST["cwebaddy"] = $cwebaddy; echo $prefix; echo $fname; echo $lname; echo $title; echo $pphone; echo $sphone; echo $email; ?> <table width="95%" border="0" cellspacing="0" cellpadding="1" class="boxtitle"> <tr><td> </td></tr> <tr><td> <form name="search" action="eregister.php" method="POST"> Prefix: <select name="prefix"> <option value="<? echo $_POST["fname"]; ?>" selected> <option value="mr">Mr.</option> <option value="ms">Ms.</option> <option value="miss">Miss</option> <option value="dr">Dr.</option> </select> First name: <input type="text" name="fname" value="<? echo $fname; ?>" /> Last name: <input type="text" name="lname" value="<? echo $lname; ?>" /> <a href="" onMouseover="ddrivetip('CEO, HR Manager, Etc.')"; onMouseout="hideddrivetip()">Title:</a> <input type="text" name="title" value="<? echo $title; ?>" /><br /> Username: <input type="text" name="username" /> Password: <input type="password" name="password1" /> Verify Password: <input type="password" name="password2" /><br /> <a href="" onMouseover="ddrivetip('XXX-XXX-XXXX')"; onMouseout="hideddrivetip()">Primary Phone #:</a> <input type="text" name="pphone" maxlength="12" value="<? echo $pphone; ?>" /> Secondary Phone #: <input type="text" name="sphone" maxlength="12" value="<? echo $sphone; ?>" /><br /> E-mail Address: <input type="text" name="email" STYLE="width:200" value="<? echo $email; ?>" /><br /> <br /> <font color="orange"> <center>/// Note, the information in orange below cannot be changed once entered. ///</center> <br /> Company Name: <input type="text" name="cname" value="<? echo $cname; ?>" /> Company Address: <input type="text" name="caddress" STYLE="width:200" value="<? echo $caddress; ?>" /> <br /> Company City: <input type="text" name="ccity" value="<? echo $ccity; ?>" /> Company State: <select name="cstate" size="1" > <option value="<? echo $cstate; ?>" selected><? echo $cstate; ?></option> <option value="AK">AK</option> <option value="AL">AL</option> <option value="AR">AR</option> <option value="AZ">AZ</option> <option value="CA">CA</option> <option value="CO">CO</option> <option value="CT">CT</option> <option value="DC">DC</option> <option value="DE">DE</option> <option value="FL">FL</option> <option value="GA">GA</option> <option value="HI">HI</option> <option value="IA">IA</option> <option value="ID">ID</option> <option value="IL">IL</option> <option value="IN">IN</option> <option value="KS">KS</option> <option value="KY">KY</option> <option value="LA">LA</option> <option value="MA">MA</option> <option value="MD">MD</option> <option value="ME">ME</option> <option value="MI">MI</option> <option value="MN">MN</option> <option value="MO">MO</option> <option value="MS">MS</option> <option value="MT">MT</option> <option value="NC">NC</option> <option value="ND">ND</option> <option value="NE">NE</option> <option value="NH">NH</option> <option value="NJ">NJ</option> <option value="NM">NM</option> <option value="NV">NV</option> <option value="NY">NY</option> <option value="OH">OH</option> <option value="OK">OK</option> <option value="OR">OR</option> <option value="PA">PA</option> <option value="RI">RI</option> <option value="SC">SC</option> <option value="SD">SD</option> <option value="TN">TN</option> <option value="TX">TX</option> <option value="UT">UT</option> <option value="VA">VA</option> <option value="VT">VT</option> <option value="WA">WA</option> <option value="WI">WI</option> <option value="WV">WV</option> <option value="WY">WY</option> </select> <?php $sql = "SELECT crate FROM rate"; $rs = mysql_query($sql); while($row = mysql_fetch_array($rs)) { extract($row); ?> Company Zipcode: <input type="text" name="czip" value="<? echo $czip; ?>" /> <br /> </font> <textarea cols="50" rows="4" name="cinfo" ONFOCUS="clearDefaultandCSS(this)" value="<? echo $cinfo; ?>" >Insert anything you want people to know about your company here, such as a typical company biography. This information will be pre-filled in on every job that you post.</textarea><br /> Company Logo: <input type="file" accept="image/gif, image/jpeg, image/png" name="clogo" value="<? echo $clogo; ?>" /><br /> <a href="" onMouseover="ddrivetip('www.XXXXXXX.com')"; onMouseout="hideddrivetip()">Company Website Address:</a> <input type="text" name="cwebaddy" STYLE="width:200" value="<? echo $cwebaddy; ?>" /> <br /> <br /> <input type="hidden" name="crate" value="<? echo "$crate" ?>" /> <input type="submit" value="Register!" class="button"><br /> <input type="hidden" name="submitted" value="TRUE" /> </form> </td></tr> </table> </div> </div> </div> </div> </div> </div> </div> <? } } else { ?> <h3><span> Register today! (See below for more info)</span></h3> <table width="95%" border="0" cellspacing="0" cellpadding="1" class="boxtitle"> <thead> <tr> <td> Registration Form:<br /> </td> </tr> </thead> <tr><td> <form name="search" action="eregister.php" method="POST"> Prefix: <select name="prefix"> <option value="mr">Mr.</option> <option value="ms">Ms.</option> <option value="miss">Miss</option> <option value="dr">Dr.</option> </select> First name: <input type="text" name="fname" /> Last name: <input type="text" name="lname" /> <a href="" onMouseover="ddrivetip('CEO, HR Manager, Etc.')"; onMouseout="hideddrivetip()">Title:</a> <input type="text" name="title" /><br /> Username: <input type="text" name="username" /> Password: <input type="password" name="password1" /> Verify Password: <input type="password" name="password2" /><br /> <a href="" onMouseover="ddrivetip('XXX-XXX-XXXX')"; onMouseout="hideddrivetip()">Primary Phone #:</a> <input type="text" name="pphone" maxlength="12" /> Secondary Phone #: <input type="text" name="sphone" maxlength="12" /><br /> E-mail Address: <input type="text" name="email" STYLE="width:200" /><br /> <br /> <font color="orange"> <center>/// Note, the information in orange below cannot be changed once entered. ///</center> <br /> Company Name: <input type="text" name="cname" /> Company Address: <input type="text" name="caddress" STYLE="width:200" /> <br /> Company City: <input type="text" name="ccity" /> Company State: <select name="cstate" size="1"> <option value="AK">AK</option> <option value="AL">AL</option> <option value="AR">AR</option> <option value="AZ">AZ</option> <option value="CA">CA</option> <option value="CO">CO</option> <option value="CT">CT</option> <option value="DC">DC</option> <option value="DE">DE</option> <option value="FL">FL</option> <option value="GA">GA</option> <option value="HI">HI</option> <option value="IA">IA</option> <option value="ID">ID</option> <option value="IL">IL</option> <option value="IN">IN</option> <option value="KS">KS</option> <option value="KY">KY</option> <option value="LA">LA</option> <option value="MA">MA</option> <option value="MD">MD</option> <option value="ME">ME</option> <option value="MI">MI</option> <option value="MN">MN</option> <option value="MO">MO</option> <option value="MS">MS</option> <option value="MT">MT</option> <option value="NC">NC</option> <option value="ND">ND</option> <option value="NE">NE</option> <option value="NH">NH</option> <option value="NJ">NJ</option> <option value="NM">NM</option> <option value="NV">NV</option> <option value="NY">NY</option> <option value="OH">OH</option> <option value="OK">OK</option> <option value="OR">OR</option> <option value="PA">PA</option> <option value="RI">RI</option> <option value="SC">SC</option> <option value="SD">SD</option> <option value="TN">TN</option> <option value="TX">TX</option> <option value="UT">UT</option> <option value="VA">VA</option> <option value="VT">VT</option> <option value="WA">WA</option> <option value="WI">WI</option> <option value="WV">WV</option> <option value="WY">WY</option> </select> <?php $sql = "SELECT crate FROM rate"; $rs = mysql_query($sql); while($row = mysql_fetch_array($rs)) { extract($row); ?> Company Zipcode: <input type="text" name="czip" /> <br /> </font> <textarea cols="50" rows="4" name="cinfo" ONFOCUS="clearDefaultandCSS(this)" >Insert anything you want people to know about your company here, such as a typical company biography. This information will be pre-filled in on every job that you post.</textarea><br /> Company Logo: <input type="file" accept="image/gif, image/jpeg, image/png" name="clogo" /><br /> <a href="" onMouseover="ddrivetip('www.XXXXXXX.com')"; onMouseout="hideddrivetip()">Company Website Address:</a> <input type="text" name="cwebaddy" STYLE="width:200" /> <br /> <br /> <input type="hidden" name="crate" value="<? echo "$crate" ?>" /> <input type="submit" value="Register!" class="button"><br /> <input type="hidden" name="submitted" value="TRUE" /> </form> </td></tr> </table> </div> </div> </div> </div> </div> </div> </div> <? } ?>
  17. I'm a bonehead. That was it. :-\ Thank you.
  18. Can't figure out my error... Database is called project table is called cities column is called city if (!$con) { die('Could not connect: ' . mysql_error()); } mysql_select_db("project", $con); $sql = "SELECT city FROM cities "."ORDER BY cities"; $rs = mysql_query($sql); while($row = mysql_fetch_array($rs)) { extract($row); echo "<option value=$city>$city</option>"; } mysql_close($con); ?>
  19. When I created my layout it looks fine at the resolution I am using (attached normal image) If I make my resolution to 800x600 (attached small image) it screws everything up. How do I fix this? CSS File: A {font-family:Verdana, Geneva, Arial, Helvetica, sans-serif; font-size: 1em;} A:link {color: #33FF33;} A:visited {color: #33FF33;} A:hover {text-decoration: none; color: #ff9900;} A:active {color: red;text-decoration: none} body { font-family: Arial, Helvetica, sans-serif; font-size: 1em; background-color: #3344DD; margin: 0; padding: 0; } div#header { height: 2em; margin: 0%; padding: 0%; border-bottom: solid #000 3px; background-color: #3298DC; } div#login { color: #33FF33; font-family : Verdana, Geneva, Arial, Helvetica, sans-serif; font-size: .8em; position: relative; top: 6px; } input.first { border : 1px solid Black; background-color : #CCCCCC; color : #000000; font-size : .8em; font-family : Verdana, Geneva, Arial, Helvetica, sans-serif; font-weight : bold; height: 15px; } div#backsplash { height: 22em; margin: 0%; padding: 0%; border-top: solid #000 3px; border-bottom: solid #000 3px; background-color: #3298DC; position: absolute; top: 10em; width: 100%; } div#leftcolumn { height: 18em; width: 25%; margin: 0%; padding: 0%; border-top: solid #000 3px; border-left: solid #000 3px; border-right: solid #000 3px; border-bottom: solid #000 3px; background-color: #98DC32; position: absolute; top: 12em; left: 1em; } div#topcolumn { height: 10em; width: 43%; margin: 0%; padding: 0%; border-top: solid #000 3px; border-left: solid #000 3px; border-right: solid #000 3px; border-bottom: solid #000 3px; background-color: #98DC32; position: absolute; top: 12em; left: 17.8em; } div#bottomcolumn { height: 7em; width: 43%; margin: 0%; padding: 0%; background-color: #3298DC; position: absolute; top: 23em; left: 17.8em; } div#rightcolumn { height: 18em; width: 25%; margin: 0%; padding: 0%; border-top: solid #000 3px; border-left: solid #000 3px; border-right: solid #000 3px; border-bottom: solid #000 3px; background-color: #98DC32; position: absolute; top: 12em; left: 46em; } HTML File: <html> <head> <title>A Work in Progress</title> <link rel="stylesheet" type="text/css" href="style/primary.css" /> <SCRIPT> function clearDefaultandCSS(el) { if (el.defaultValue==el.value) el.value = "" } </SCRIPT> </head> <body> <div id="header"> <form name="login" action="checkuser.php" method="POST"> <div align="right" id="login"><topr>Login: <INPUT class="first" TYPE=text name=username size=15 maxlength=255 value="username" ONFOCUS="clearDefaultandCSS(this)"> <INPUT class="first" TYPE=password name=password size=15 maxlength=255 value="password" ONFOCUS="clearDefaultandCSS(this)"> <INPUT class="first" TYPE=submit value="Submit"> <a href="join_form.html">Register</a></topr></form></div> </div> <div id="backsplash"> </div> <div id="leftcolumn"> </div> <div id="topcolumn"> </div> <div id="bottomcolumn"> Blazay Blazay Blazay </div> <div id="rightcolumn"> </div> </body> </html> [attachment deleted by admin]
  20. I'm trying to create a backsplash, basically a bar, that stretches from the left side to the right. I am eventually going to put stuff inside of that backsplash but for now my problem is that it's not extending 100% left to right. Instead it makes a box that stretches probably 95% across the screen with basically a small padding around it. Even if I add a width 100% it still doesn't budge. What am I doing wrong? HTML File: <title>A Work in Progress</title> <link rel="stylesheet" type="text/css" href="style/primary.css" /> </head> <body> <div id="backsplash"> </div> <div id="navbar2"> </div> </body> </html> CSS File: body { font-family: Arial, Helvetica, sans-serif; font-size: 13px; background-color: #CCFFCC; } div#backsplash { height: 30px; margin: 0; padding: 0; border-top: solid #000 3px; border-bottom: solid #000 3px; background-color: #336699; }
  21. TO those curious: concatenate the $message.
  22. Ok, I'll make it easier as I figured out the hard part. How do I get the VARIABLE in the $message to echo out it's results? $email = 'blah@gmail.com'; $subject = 'Weekly Training Expiring Report'; $message = '<html> <center><font color=green> LAKE CITY TRAINING EXPIRING REPORT<p></font> Expiring Driver Licenses<p></html> $driverlicensemail '; $headers = 'MIME-Version: 1.0' . "\r\n"; $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n"; $headers .= 'From: Me Services Group <blah@gmail.com>' . "\r\n"; mail($email, $subject, $message, $headers);
×
×
  • 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.