Jump to content

ifusion

Members
  • Posts

    21
  • Joined

  • Last visited

    Never

Everything posted by ifusion

  1. But if i do that then the whole image would have to load when i hover. Theres got to be an easier way.
  2. Yea, and when i hover over the first link i want to include this: http://www.goome.co.nz/nav/round.png so that the link isnt square. But i cant add 2 images in one div?
  3. Sorry heres the link: http://www.goome.co.nz/nav/
  4. Hey, How do you add a round end on hover links. Heres my website. As you can see the first link on the left is round but when you hover over it it is square. HTML code: <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"> <head> <title>Nav</title> <link rel="stylesheet" href="style.css" type="text/css"/> </head> <body> <div id="header"></div><div id="grey"></div> <div id="center"> <h3 class="small_red">Projects in Process:</h3> <div id="nav"> <li><a href="#">In-Process</a><img src="border.png" width="2" height="34" class="border" /></li> <li><a href="#">Completed</a><img src="border.png" width="2" height="34" class="border" /></li> <li><a href="#">All Projects</a><img src="border.png" width="2" height="34" class="border"/></li> <li><a href="website.zip">Download!</a><img src="border.png" width="2" height="34" class="border"/></li> </div> <p> You can download this website by clicking the download link above^ </div> </body> </html> CSS code: body { margin: 0px; padding: 0px; font-family: Verdana; font-size: 11px; color: #2f2f2f; } #center { margin: 0 auto; width: 900px; } #header { background: url('header2.png') repeat-x; width: 100%; height: 150px; } #grey { background: url('grey.png') repeat-x; width: 100%; height: 30px; border-top: 1px solid #fff; } #nav { width: 500px; height: 34px; background: url('back.png') no-repeat; width: 661px; height: 34px; display: block; } #nav li { list-style-type: none; display: inline; } #nav li a { font-family: Verdana; font-size: 11px; color: #484848; font-weight: bold; text-decoration: none; padding: 11px 10px 10px 10px; float: left; } #nav li a:hover { background: url('hover.png') repeat-x; color: #eeeeee; } img.border { margin: 0px; padding: 0px; float: left; } h3.small_red { font-family: Verdana; font-size: 11px; color: #f93737; }
  5. Awsome! It works. Had to add a couple of things but it works now! Thanks heaps.
  6. Hey, I cant work out how to implement the cookie code into my script. Heres my code for my pages below: Login page <html> <head> <link rel="stylesheet" type="text/css" href="style.css"> <title>Login!</title> </head> <body> <div id="loginbox"> <form action="login2.php" method="post"> <label class="user" for="user"><strong>Username:</strong></label> <input type="text" name="username"><br><br> <label class="user" for="user"><strong>Password:</strong></label> <input type="password" name="password"><br><br> <input class="submit" type="submit" name="submit" value="Login!" id="submitbut" > </form> </div> <div id="underbox"><a class="reg" href="register.php">Register!</a><span class="text">Created by Kieran P</span></div> </body> </html> Login Check <?php //Includes the connection file that contains the MYSQL database information include('connection.php'); // Checking if the submit button has been checked. if(isset($_POST['submit'])){ // If the username and password fields are empty then print and error. if(empty($_POST['username']) || empty($_POST['password'])){ echo "Sorry you have to fill in all the forms!"; exit; } $user = $_POST['username']; $pass = $_POST['password']; $pass = md5($pass); if(strlen($user) > '15') { echo "Your username is more than 15 characters. It needs to be less than 15."; exit; } // Selects the username and password from the users database. $query = "SELECT username, password FROM `users` WHERE username='$user'"; $result = mysql_query($query); if(!$result) { echo "The query failed " . mysql_error(); } else { // If the row vairble does not equal the pass variable then an error occurs. $row = mysql_fetch_object($result); if($row->password != $pass) { echo "I'm sorry, but your username and password don't match. Please go back and enter the correct login details. You Click <a href=\"login.php\">here</a> to try again."; exit; } header('Location: logged.php'); } } ?> I need to implement this code into the the script above <?php if($login_incorrect){ if(isset($_COOKIE['login'])){ if($_COOKIE['login'] < 3){ $attempts = $_COOKIE['login'] + 1; setcookie('login', $attempts, time()+60*10); //set the cookie for 10 minutes with the number of attempts stored } else{ echo 'You are banned for 10 minutes. Try again later'; } } else{ setcookie('login', 1, time()+60*10); //set the cookie for 10 minutes with the initial value of 1 } } ?>
  7. Cheers for that man. Is there anyway of making it in a loop form? Like a for or while loop?
  8. Hey, I've written a very basic php login script but my problem is i cant work out how to limit the user so they can only try and log in 3 times. And after 3 times then ban them for 10mins? I just need something basic. Should be easy for and expert Cheers!
  9. Awsome dude, I had the $row = mysql_fetch_array($result) in a included file. Cheers man.
  10. Hey, My while loop isn't returning the first row, only the second and third rows of data etc? Why is that and how do i fix it? <?php while($row = mysql_fetch_array($result)) { echo "<tr>"; echo "<td>". $row['invoice_date']. "</td>"; echo "<td>". $row['due_in']. " days". "</td>"; echo "<td>". $row['invoice_id']. "</td>"; echo "<td>". $row['client_name']. "</td>"; echo "<td align=\"right\">"."$". $row['amount_due']. "</td>"; echo "</tr>"; } ?> Cheers, Fusion.
  11. It depends on what site you have but 3mins is very short imo. A minimum of 10 mins would be better.
  12. Hi there, I'm wanting to post information from a textarea, then if the user has added a break or paragraph in that info then have it display the same as how they wrote it in the form. For example: If the user writes this. Theres 2 spaces. If i echo that out with the code below it would echo out as one whole paragraph. Heres my code: <html> <head></head> <body> <form action="send.php" method="post"> <textarea name="info" rows="8" cols="40"></textarea><br> </form> </body> </html> PHP: <?php $info = $_POST['info']; echo $info; ?>
  13. This what i've done but all the rows are white?: <?php $mycon = mysql_connect('localhost', 'ifusion', 'sweet1') or die(mysql_error()); $db_con = mysql_select_db('kieran') or die(mysql_error()); if($mycon) { echo "Connected 2 mysql"; } if($db_con) { echo "Connected 2 db"; } $result = mysql_query("SELECT id, title, budget, url FROM jobs") or die(mysql_error()); while($row = mysql_fetch_array($result)){ } ?> <html> <head> <link rel="stylesheet" type="text/css" href="style.css" /> </head> <body> <?php echo $result = mysql_query("SELECT id, title, budget, url FROM jobs") or die(mysql_error()); $counter = 1; echo '<table border="0" id="maint">'; echo '<tr>'; echo '<td>Number</td>'; echo '<td>Title</td>'; echo '<td>Budget</td>'; echo '<td>Url</td>'; echo '</tr>'; while($row = mysql_fetch_array($result)){ $int = 1; $int = $int * -1; if($int == -1) { echo '<tr>'; echo "<td class='white'>$counter.</td>"; echo "<td class='white'>{$row['title']}</td>"; echo "<td class='white'>{$row['budget']}</td>"; echo "<td class='white'>{$row['url']}</td>"; echo '</tr>'; } else { echo '<tr>'; echo "<td class='blue'>$counter.</td>"; echo "<td class='blue'>{$row['title']}</td>"; echo "<td class='blue'>{$row['budget']}</td>"; echo "<td class='blue'>{$row['url']}</td>"; echo '</tr>'; } $counter++; } echo '</table>'; ?> </body> </html>
  14. Cheers for that but i can't quite work it out? How does it know if it is -1 or not etc?
  15. Hi, I've created a HTML table that loops the data from my mysql database. I want the first row to be blue and the second row to be white for example, like the picture below using CSS to style it. <?php $mycon = mysql_connect('localhost', 'ifusion', 'sweet1') or die(mysql_error()); $db_con = mysql_select_db('kieran') or die(mysql_error()); if($mycon) { echo "Connected 2 mysql"; } if($db_con) { echo "Connected 2 db"; } $result = mysql_query("SELECT id, title, budget, url FROM jobs") or die(mysql_error()); while($row = mysql_fetch_array($result)){ } ?> <html> <head> <link rel="stylesheet" type="text/css" href="style.css" /> </head> <body> <?php echo $result = mysql_query("SELECT id, title, budget, url FROM jobs") or die(mysql_error()); $counter = 1; echo '<table border="0" id="maint">'; echo '<tr>'; echo '<td>Number</td>'; echo '<td>Title</td>'; echo '<td>Budget</td>'; echo '<td>Url</td>'; echo '</tr>'; while($row = mysql_fetch_array($result)){ echo '<tr>'; echo "<td>$counter.</td>"; echo "<td>{$row['title']}</td>"; echo "<td>{$row['budget']}</td>"; echo "<td>{$row['url']}</td>"; echo '</tr>'; $counter++; } echo '</table>'; ?> </body> </html>
  16. Hey, Just need some help on how to insert information from my mysql database so it displays in an HTML table. This what i have so far, i realize that if i place: echo $row['title']; into the html it echos out what i want. But how do you write it so it prints each value out into its respective column etc. As you can see i've created a loop so it prints out every id, title, budget and url until its done. <?php $mycon = mysql_connect('localhost', 'ifusion', 'password') or die(mysql_error()); $db_con = mysql_select_db('kieran') or die(mysql_error()); if($mycon) { echo "Connected 2 mysql"; } if($db_con) { echo "Connected 2 db"; } $result = mysql_query("SELECT id, title, budget, url FROM jobs") or die(mysql_error()); while($row = mysql_fetch_array($result)){ //echo $row['title']; } ?> <html> <body> <?php echo $result = mysql_query("SELECT id, title, budget, url FROM jobs") or die(mysql_error()); while($row = mysql_fetch_array($result)){ echo '<table border="1">'; echo '<tr>'; echo '<td>Number</td>'; echo '<td>Title</td>'; echo '<td>Budget</td>'; echo '<td>Url</td>'; echo '</tr>'; echo '<tr>'; echo '<td>1.</td>'; echo '<td>Junior Web Programmer</td>'; echo '<td>$1000</td>'; echo '<td>www.google.com</td>'; echo '</tr>'; echo '</table>'; } ?> </body> </html>
  17. Brilliant! Thanks heaps all fixed now, just had to add the little `` to the table and its contents. Thanks heaps!
  18. Hi there! Just doing some php and keep getting this error when i submit the information: "You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'table (title, budget, description, url, email) VALUES ('Title goes here', '6', ' at line 1" It must be something simple? This is my html - testin.html <html> <body> <form name="form1" action="test.php" method="post"> Title: <input type="text" size="30" maxlength="60" name="title" /><p> Budget: <input type="text" size="30" maxlength="60" name="budget" /><p> Description:<br> <textarea cols="40" rows="5" wrap="OFF" name="description"></textarea><p> Url: <input type="text" size="30" maxlength="60" name="url" /><p> Email: <input type="text" size="30" maxlength="60" name="email" /><p> <input type="submit" value="Submit" name="submit" /> </form> </body> </html> PHP - test.php <?php mysql_connect('localhost', 'auction_ifusion', 'password') or die (mysql_error()); mysql_select_db('auction_test') or die (mysql_error()); $title = $_POST['title']; $budget = $_POST['budget']; $descrip = $_POST['description']; $url = $_POST['url']; $email = $_POST['email']; mysql_query("INSERT INTO table (title, budget, description, url, email) VALUES ('$title', '$budget', '$descrip', '$url', '$email')") or die (mysql_error()); ?> You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'table (title, budget, description, url, email) VALUES ('Title goes here', '6', ' at line 1 Cheers, Fusion.
×
×
  • 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.