Jump to content

Eggzorcist

Members
  • Posts

    214
  • Joined

  • Last visited

    Never

Posts posted by Eggzorcist

  1. I'm not too good in creating REGEX codes, so far I've been using my standard ones for email and usernames, but for my next project I need some different ones. I was wondering if there was any generator out there or a good resource providing good regex commands.

     

    Thanks a lot!

  2.  function login_user($email, $password){
    
    $username = secure_var($email);
    $password = md5($password);
    
    if ($username != NULL and $password != NULL){
    
    	$login_query = mysql_query("SELECT * FROM user_info WHERE email = '$email' AND password = '$password'");
    
    	$login_status = mysql_num_rows($login_query);
    	$login_vars = mysql_fetch_array($login_query);
    
    
    	if($login_status == 1){
    
    	set_login_sessions($login_vars['email'], $password, $login_vars['auth']);
    	header('Location: usercp.php');
    	exit;
    
    }
    
    else { echo "The entered username and/or password are incorrect. Please try again."; }
    
    }
    
    else { echo "Please enter a username and/or password."; }
    
    
    }
    [/code

  3. Here's my code...

    <?php  require_once('functions.php');
    
    if(isset($_POST['login'])){
    
    login_user($_POST['login_email'], $_POST['login_pass']);
    
    } 
    
    ?>
    <!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-Type" content="text/html; charset=UTF-8" />
    <title>Login</title>
    </head>
    
    <body>
    <div id="login_error">
    </div>
    <form id="login" method="post" action="<?php $_SERVER['PHP_SELF'];  ?>">
    <label>E-mail:
    <input type="text" name="login_email" id="login_email" />
    </label>
    <label>Password:
    <input type="password" name="login_pass" id="login_pass" />
    </label>
    <input type="submit" name="login" value="login"  id="Login" />
    </form>
    </body>
    </html> 

  4. this is the error I'm getting.

    Warning: Cannot modify header information - headers already sent by (output started at index.php:11) in functions.php on line 30

     

    what I am trying to do is get the header to work in the functions.php file, functions.php is included at the very top of the page, I'm not sure why I'm getting this as an issue...

     

    Any help much appreciated, thanks

  5. I'm not quite sure what's wrong here, I've tried a few alternatives but it seems like hardly of them are working... Could someone help me out, the isset isn't working...

    <?php
    require_once('functions.php');
    
    if(isset($_POST['login'])){
    
    login_user($_POST['login_email'], $_POST['login_pass']);
    
    }
    
    ?>
    <!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-Type" content="text/html; charset=UTF-8" />
    <title>Login</title>
    </head>
    
    <body>
    <div id="login_error"></div>
    <form id="login" method="post" action="<?php echo $_SERVER['PHP_SELF'];  ?>">
    <label>E-Mail:
    <input type="text" name="email" id="login_email" />
    </label>
    <label>Password:
    <input type="password" name="password" id="login_pass" />
    </label>
    <input type="button" name="login" value="login"  id="Login" />
    </form>
    </body>
    </html>

     

  6. if I use dreamweaver to create my CSS and html files and upload it to my server. Would it be possible for someone to know I used dreamweaver instead of notepad or something like that? If so, how can I use dreamweaver and make it look like I used textedit or notepad...

     

    Thanks

  7. Well, is there a way to create a regex style validation? So basically if I already have

     

     if (!preg_match("/\A[^0-9][a-zA-Z0-9_]+([.][a-zA-Z0-9_]+)*[@][a-zA-Z0-9_]+([.][a-zA-Z0-9_]+)*[.][a-zA-Z]{2,4}$/", $email)){
    	$Error .= "Email Address Must Be In format: [username]@[domain].[extension] <br />";
    }

     

    is there a javascript way of doing this? My javascript is pretty bad :P

  8. I currently use mysql_real_escape function in order to secure my inputed strings, however, this has created complication when trying to show html codes which contain double quotes for styling purposes... I tried fixing that with:

     

    $descriptiondetails = str_replace("\"", "", $info['pagedescription']);

     

    $descriptiondetails = str_replace("\", "", $info['pagedescription']); (but this makes it an error as the forward slash makes it so that double quote not there, I also tried with double quotes...

     

    How could I do this?

     

    Thanks for any help! :)

×
×
  • 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.