Jump to content

popcornplya

Members
  • Posts

    83
  • Joined

  • Last visited

    Never

Everything posted by popcornplya

  1. I want the db class to work in multiple classes, sorry for slow reply..
  2. If you had a database connect class, what would be the best way to inherit it in another class?
  3. Just ignore it, nothing serious.
  4. Thanks guys.. I fixed this by setting a reset. And I removed the other <html>. Also, line height never worked xD but thanks
  5. For the first time, something works in IE but not in Firefox.. Anyway, here is my problem.. Submit button text is not aligned correctly. My code: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Form</title> <style type="text/css"> p,form { margin:0; padding:0; } #contact { width:500px; font:12px Arial, Helvetica, sans-serif } #contact label { color:#666; } #contact label span { color:#F00; } #contact p { margin:5px 0 5px; } #contact .contact_text, #contact .contact_textarea { width:100%; border:1px solid #CCC; padding:5px; background:url('form_bg.png') repeat-x; } #contact .contact_submit { background:url('form_button.png') no-repeat; width:139px; height:21px; border:0 none; color:#FFF; } #contact .contact_textarea { height:150px; } </style> </head> <body> <div id="contact"> <label>Recipient's Name: <span>*</span></label> <p> <input type="text" class="contact_text" /> </p> <label>Subject:</label> <p> <input type="text" class="contact_text" /> </p> <label>Message:</label> <p> <textarea class="contact_textarea"></textarea> </p> <p> <input type="submit" class="contact_submit" value="Send Message" /> </p> </div> </body> </html> Any help is appreciated
  6. $box = '#box1'; if($box == '#box1') { $box = '#box2'; } then just do id="$box"
  7. Thanks for your help guys, but I just fixed this with htaccess (made it redirect to www.)
  8. How do you edit ini's on shared hosting? Sorry I'm not a PHP pro so if I ask any stupid questions please excuse me.
  9. Login.php <?php session_start(); if($_SESSION['logged_in']==true) { header("Location: index.php"); exit; } $user = $_POST['user']; $pass = md5($_POST['pass']); if($user && $pass) { include("config.php"); $user = mysql_real_escape_string($user); $user = htmlentities($user); $sql = mysql_query("SELECT * FROM `users` WHERE `username`='$user' && `password`='$pass'"); if(mysql_num_rows($sql)==1) { $_SESSION['logged_in']=true; $_SESSION['user']=$user; header("Location: index.php"); exit; } else { header("Location: index.php?e=1"); exit; } } else { header("Location: index.php"); } ?> Other pages: <?php session_start(); if($_SESSION['logged_in']) { echo '<p>Welcome, '.$_SESSION['user'].'</p>'; } ?>
  10. Sorry, can't edit.. but my client is using godaddy hosting if that helps.
  11. I have a script I'm working on, and the session variables are empty when I don't have www. in my url, any help? Is this a php issue?
  12. Is there a point in declaring an array? like $test = array(); $test[] = 'whatever'; even though it works without it and what is the difference between if(!$test) and if(!isset($test))
  13. The design is MUCH better, but still need to work on the coding a bit more.
  14. My code errors when you fill in 2 or more fields. <form action="index.php" method="get"> <table> <tr> <td>User</td><td>Name</td><td>Number</td><td>Address</td><td>Email</td><td>Website</td> </tr> <tr> <td><input type="text" name="user" /></td><td><input type="text" name="name" /></td><td><input type="text" name="number" /></td><td><input type="text" name="address" /></td><td><input type="text" name="email" /></td><td><input type="text" name="website" /></td><td><input type="submit" value="Search" name="search" /></td> </tr> </table> </form> <?php if($_GET['search']) { // slash() is custom function $name = slash($_GET['name']); $number = slash($_GET['number']); $address = slash($_GET['address']); $email = slash($_GET['email']); $website = slash($_GET['website']); $user = slash($_GET['user']); if($name || $number || $address || $email || $website || $user) { $query = "SELECT * FROM `card` WHERE "; if($user) { $query .= "`user` LIKE '%$user%'"; } if($name) { $query .= " `name` LIKE '%$name%'"; } if($number) { $query .= " `number` LIKE '%$number%'"; } if($address) { $query .= " `number` LIKE '%$address%'"; } if($email) { $query .= " `number` LIKE '%$email%'"; } if($website) { $query .= " `number` LIKE '%$website%'"; } $sql = mysql_query($query) or die(mysql_error()); if(mysql_num_rows($sql) >= 1) { while($fetch = mysql_fetch_assoc($sql)) { $user = $fetch['user']; echo $user; } } else { echo "no results"; } } else { echo "enter something"; } } ?> Any help?
  15. I suck at explaining stuff so sorry if you don't understand, but when you don't specify a width, the width is gonna be a % of your resolution. So as you decrease the resolution of IE the width gets less forcing the text to drop.
  16. Try specifying a width for #statpanel
  17. ??? should I just <div id="box"> <img src="project.png" /> <div id="previous"></div> <div id="next"></div> </div> Relative position the #box then absolute position the #previous and #next divs outside the #box?
  18. Np, and like I said before needs a better header.. would also look nicer if it was centered
  19. poorly coded design needs some work, the header part is just a cut out image with text on it
×
×
  • 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.