Jump to content

nworst

Members
  • Content Count

    36
  • Joined

  • Last visited

Community Reputation

0 Neutral

About nworst

  • Rank
    Newbie

Contact Methods

  • Website URL
    http://
  • ICQ
    0
  1. nworst

    Rounded corners

    Thanks all! I'll give it a try
  2. nworst

    Rounded corners

    How do I get the corners of a certain (rectangled) div to be rounded? What I mean is this.Thanks.
  3. I had exactly the same problem as you do. I'd indeed recommend you to take up PHP. You'll only need some basic knowledge to do it
  4. nworst

    I'm Confused About It

    It's just a matter of choice, if you prefer tables, just use tables I prefer using <div>.
  5. nworst

    Mail Function Problem

    Oh ok, I just wanted to experiment a bit with mailforms et cetera, so I'll just give up mailforms for now
  6. nworst

    Mail Function Problem

    I've made a mailform, but sending the mail doesn't yet work out as it should. This is the error code I get when sending the email: Warning: mail() [function.mail]: Failed to connect to mailserver at "localhost" port 25, verify your "SMTP" and "smtp_port" setting in php.ini or use ini_set() in C:\xampp\htdocs\Testweb\startpagina.php on line 106 What port should I be using if 25 (default) doesn't work?
  7. nworst

    Mail Function Problem

    Ah, I knew it was a dumb fault. Worked out properly now. Thanks very much, you really helped me out. Gotta say you really know a lot about PHP
  8. nworst

    Mail Function Problem

    Now it says Unknown database 'my_db', however I did save the file as my_db.mysql :SI think I'm making a really stupid mistake somewhere..By the way, I'm leaving now I'll be back tomorrow, hopefully it works out then
  9. nworst

    Mail Function Problem

    This is db.php: <?php$con = mysql_connect('localhost', 'root', ''); // host, username, passwordmysql_select_db('my_db', $con);function db_query($sql){ return mysql_query($sql, $GLOBALS['con']);}?> I filled in the name of the database behind mysql_select_db, should it be filled in somewhere else as well?
  10. nworst

    Mail Function Problem

    If I type in a password at db.php, it says Warning: mysql_connect() [function.mysql-connect]: Access denied for user 'root'@'localhost' (using password: YES) in C:\xampp\htdocs\Testweb\db.php on line 3Warning: mysql_select_db() expects parameter 2 to be resource, boolean given in C:\xampp\htdocs\Testweb\db.php on line 4Warning: mysql_real_escape_string() [function.mysql-real-escape-string]: Access denied for user 'ODBC'@'localhost' (using password: NO) in C:\xampp\htdocs\Testweb\register.php on line 27Warning: mysql_real_escape_string() [function.mysql-real-escape-string]: A link to the server could not be established in C:\xampp\htdocs\Testweb\register.php on line 27Warning: mysql_query() expects parameter 2 to be resource, boolean given in C:\xampp\htdocs\Testweb\db.php on line 8Access denied for user 'ODBC'@'localhost' (using password: NO) and if I don't type a password it says 'No database selected'...Am I just so stupid or is it not my fault?
  11. nworst

    Mail Function Problem

    Now it says 'No database selected'.
  12. nworst

    Mail Function Problem

    This is the code of register.php: <?phprequire_once 'db.php';$page_mode = isset($_POST['page_mode']) ? $_POST['page_mode'] : '';$error_string = '';if ($page_mode == 'register'){ $email = trim($_POST['email']); // trim to remove whitespace $name = trim($_POST['name']); // trim to remove whitespace $password = $_POST['password']; $conf_password = $_POST['conf_password']; if (!isValidEmail($email)) $error_string .= 'Vul aub een geldig emailadres in.<br>'; if ($name == '') $error_string .= 'Vul uw naam in aub.<br>'; if (strlen(trim($password)) < 6) $error_string .= 'Het wachtwoord moet uit minstens 6 letters bestaan.<br>'; if ($password != $conf_password) $error_string .= 'Uw wachtwoord komt niet overeen met het bevestigde wachtwoord.<br>'; if ($error_string == '') { $result = db_query("SELECT id FROM users WHERE email='" . mysql_real_escape_string($email) . "'"); if (mysql_num_rows($result) > 0) $error_string .= 'Dit emailadres is al geregistreerd.<br>'; else { $email = mysql_real_escape_string($email); // protect against SQL attacks $name = mysql_real_escape_string($name); $password = sha1($password); // hash password db_query("INSERT INTO users (email, name, password) VALUES ('{$email}', '{$name}', '{$password}')"); header('Location: thankyou.php'); exit(); } }}function isValidEmail($email = ''){ return preg_match("/^[\d\w\/+!=#|$?%{^&}*`'~-][\d\w\/\.+!=#|$?%{^&}*`'~-]*@[A-Z0-9][A-Z0-9.-]{1,61}[A-Z0-9]\.[A-Z]{2,6}$/ix",$email);}?><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"><html><head> <link rel="stylesheet" type="text/css" href="style.css" /> <title>Registreren</title> <meta name="description" content="" /> <meta name="keywords" content="" /> <style type="text/css"> .error_text {color:#FF0000;width:400px;text-align:center;} .left_box {float:left;width:150px;text-align:right;padding-right:5px;} .right_box{clear:right;} </style></head><body><div class="container"><div class="header"><h1 class="header"><br /><br /><br /><br /><div class="menu" style="font-size:12px"><?php include("menu.php"); ?> </div></h1><br /><br /></div><div class="left"><?php include("left.php"); ?></div><div class="content"> <div class="error_text"><?php echo $error_string; ?></div> <form action="register.php" method="post"> <input type="hidden" name="page_mode" value="register"> <div class="left_box">Emailadres</div> <div class="right_box"><input type="text" name="email" size="30" maxlength="255" value="<?php if (isset($email)) echo $email; ?>"></div> <div class="left_box">Naam</div> <div class="right_box"><input type="text" name="name" size="30" maxlength="255"></div> <div class="left_box">Wachtwoord</div> <div class="right_box"><input type="password" name="password" size="30"></div> <div class="left_box">Bevestig wachtwoord</div> <div class="right_box"><input type="password" name="conf_password" size="30"></div> <div class="left_box"> </div> <div class="right_box"><input type="submit" value="Registreer" size="30"></div> </form></div><br /></div><div class="footer"></div></body></html>
  13. nworst

    Mail Function Problem

    Ok, username now is root, and now the errors above the register.php and login.php page are gone. But when I now try to register, I get the following: Warning: mysql_num_rows() expects parameter 1 to be resource, boolean given in C:\xampp\htdocs\Testweb\register.php on line 28Warning: Cannot modify header information - headers already sent by (output started at C:\xampp\htdocs\Testweb\register.php:28) in C:\xampp\htdocs\Testweb\register.php on line 37 If you need any scripts, I'll post them
  14. nworst

    Mail Function Problem

    Downloaded XAMPP, but when I try to register (filled in all the fields in register.php), I get the following: Warning: mysql_connect() [function.mysql-connect]: Access denied for user 'ODBC'@'localhost' (using password: NO) in C:\xampp\htdocs\Testweb\db.php on line 3Warning: mysql_select_db() expects parameter 2 to be resource, boolean given in C:\xampp\htdocs\Testweb\db.php on line 4Warning: mysql_real_escape_string() [function.mysql-real-escape-string]: Access denied for user 'ODBC'@'localhost' (using password: NO) in C:\xampp\htdocs\Testweb\register.php on line 27Warning: mysql_real_escape_string() [function.mysql-real-escape-string]: A link to the server could not be established in C:\xampp\htdocs\Testweb\register.php on line 27Warning: mysql_query() expects parameter 2 to be resource, boolean given in C:\xampp\htdocs\Testweb\db.php on line 8Warning: mysql_num_rows() expects parameter 1 to be resource, null given in C:\xampp\htdocs\Testweb\register.php on line 28Warning: mysql_real_escape_string() [function.mysql-real-escape-string]: Access denied for user 'ODBC'@'localhost' (using password: NO) in C:\xampp\htdocs\Testweb\register.php on line 32Warning: mysql_real_escape_string() [function.mysql-real-escape-string]: A link to the server could not be established in C:\xampp\htdocs\Testweb\register.php on line 32Warning: mysql_real_escape_string() [function.mysql-real-escape-string]: Access denied for user 'ODBC'@'localhost' (using password: NO) in C:\xampp\htdocs\Testweb\register.php on line 33Warning: mysql_real_escape_string() [function.mysql-real-escape-string]: A link to the server could not be established in C:\xampp\htdocs\Testweb\register.php on line 33Warning: mysql_query() expects parameter 2 to be resource, boolean given in C:\xampp\htdocs\Testweb\db.php on line 8Warning: Cannot modify header information - headers already sent by (output started at C:\xampp\htdocs\Testweb\db.php:3) in C:\xampp\htdocs\Testweb\register.php on line 37 Also, above the register.php page and login.php page it says the following: Warning: mysql_connect() [function.mysql-connect]: Access denied for user 'ODBC'@'localhost' (using password: NO) in C:\xampp\htdocs\Testweb\db.php on line 3Warning: mysql_select_db() expects parameter 2 to be resource, boolean given in C:\xampp\htdocs\Testweb\db.php on line 4
  15. nworst

    Mail Function Problem

    Which WAMP would you recommend?
×
×
  • Create New...