Jump to content

Eggzorcist

Members
  • Posts

    214
  • Joined

  • Last visited

    Never

Everything 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. Can it be for example a function sending out sessions? or another include?
  3. 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
  4. I'm comfused, the header() is within the login_user function isn't it already before line 11?
  5. 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>
  6. Is it because the header is already sent by the sessions and I cannot send the header()?
  7. I have read it and I'm still comfused. My header is before any html code...
  8. 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
  9. 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>
  10. I do realize this, but its for a school assignment where we shoudn't use dreamweaver
  11. 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
  12. How can I get the entire link in a string with the $_GET extensions... Any ideas?
  13. Yes, I do. However, this needs to be in javascript to be able to use the onSubmit html function, because I'm trying to use the validation before the action which leads off to another file. Is there a way to implement the php regex prior the action(register.php) file? Thanks
  14. I'm trying to validate, firstly, a name more than 3 letters. and an email.
  15. 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
  16. Though it seems like the function has to be in javascript, it only works when it is. I tried with a php function but nothing worked.
  17. So you mean if I create a onSubmit, the onSubmit function will pass before the action? meaning if Onsubmit = false it wont submit? and if its true, it full go to the action?
  18. so on the register button, the onclick? I'm not sure if I understand this technique...
  19. I'm wondering wether it's possible that if there is an error as in if $error isset, it will stay on this page displaying the error otherwise, it will go to the destined action='register.php' is this possible? if so, how would i be doing this? Thanks a bunch!
  20. well ill be getting the info for the dropdown menu's from the database, and the database will have the values of id, name, price. I want it so if you select item_1 I will be able to put a sql_query to attach id, name and price, to the user using the program.
  21. Is it possible in php to create a dropdown menu with 2 values. so if - Item 1 - has value "hello" and value id "5" and value_cost "50$" how can I make it so there is 3 values from that one item from a dropdown menu? any ideas? thanks
  22. 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.