Jump to content

grabenair

Member
  • Posts

    338
  • Joined

  • Last visited

  • Days Won

    2

Everything posted by grabenair

  1. yes sir also sorry it took so long to get back to you my email is wrong here I need to change it but do not know my password. I just used the default one and my pc crashed so i lost my password file. Also how did you make color syntex it is so much easier to read? If it would help you help this php rookie out I can send you info on how to log in and see all my code in a pm.
  2. This is weird now I am getting this error and was not before. Parse error: syntax error, unexpected '`' in /home/sassy/public_html/cms/core/functions/users.php on line 7
  3. I am getting these errors and do not understand why. The code is exactly the way it is in the tut that I am working on and it work fine for them. Warning: array_walk() [function.array-walk]: The argument should be an array in /home/sassy/public_html/cms/core/functions/users.php on line 5 Warning: Invalid argument supplied for foreach() in /home/sassy/public_html/cms/core/functions/users.php on line 7 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 '`user_id` = . 24' at line 1 function update_user($update_data){ global $session_user_id; $update = array(); array_walk($update_data, 'array_sanitize'); foreach($update_data as $field=>$data){ $update[] = '`' . $field . '` = \'' . $data . '\''; } mysql_query("UPDATE `users` SET" . implode(', ', $update) . "WHERE `user_id` = . $session_user_id") or die(mysql_error()); }
  4. I got this working, had to add <?php ob_start(); ?> to the top of the page and just after mt closing </html> tag
  5. I am building a custom CMS. My problem is on the register user page. When I redirect after the user files out the form to register and clicks on the register button the form goes away and is replaced with a massage you have been registered check you email to activate. This works perfect in xampp on windows but when I put it up live I get this error: Warning: Cannot modify header information - headers already sent by (output started at /home/sassy/public_html/cms/includes/overall/header.php:3) in /home/sassy/public_html/cms/register.php on line 54 When I commit out the redirect line it works but with no massage. What I am using to redirect: header('Location: register.php?success'); The header file in the error: <!doctype html> <html> <?php include 'includes/head.php';?> <body> <?php include 'includes/header.php'?> <div id="container"> <?php include 'includes/aside.php'?> The reagester page: <?php include 'core/init.php'; logged_in_redirect(); include 'includes/overall/header.php'; if (empty($_POST) === false) { $requried_fields = array('username', 'password', 'password_again', 'first_name', 'email'); foreach($_POST as $key=>$value) { if(empty($value) && in_array($key, $requried_fields) === true) { $errors[] = 'Fields marked with an asterisk are requried.'; break 1; } } if (empty($errors) === true) { if (user_exists($_POST['username']) === true) { $errors[] = 'Sorry, the username \'' . $_POST['username'] . '\' is already taken.'; } if(preg_match("/\\s/", $_POST['username']) == true) { $errors[] = 'Your user name must cotain any spaces\.'; } if (strlen($_POST['password']) <6 || strlen($_POST['password']) >20) { $errors[] = 'Your password must be a least 6 character\'s in length and no more the 20.'; } if ($_POST['password'] != $_POST['password_again']) { $errors[] = 'Your passwords do not match.'; } if(filter_var($_POST['email'], FILTER_VALIDATE_EMAIL) === false) { $errors[] = 'A valid email address is requird. Your privacy is inportant to us. We will not give or sell it to anyone. '; } if(email_exists($_POST['email']) === true){ $errors[] = 'Sorry, the email \'' . ($_POST['email']) . '\' is already taken.'; } } } ?> <h1>Register for the site.</h1> <?php if (isset($_GET['success']) && empty($_GET['success'])){ echo'You have sussessfully registered.'; } else{ if(empty($_POST) === false && empty($errors) === true){ $register_data = array ( 'username' => $_POST['username'], 'password' => $_POST['password'], 'first_name' => $_POST['first_name'], 'last_name' => $_POST['last_name'], 'email' => $_POST['email'], ); register_user($register_data); header('Location: register.php?success'); exit(); } else if (empty($errors) === false) { echo output_errors($errors); } ?> <form action="" method="post"> <ul> <li> Username*:<br> <input type="text" name="username"> </li> <li> Password*:<br> <input type="password" name="password"> </li> <li> Password again*:<br> <input type="password" name="password_again"> </li> <li> First Name*:</br> <input type="text" name="first_name"> </li> <li>Last Name:<br> <input type="text" name="last_name"> </li> <li> Your E-Mail:<br> <input type="text" name="email"> </li> <li> <input type="submit" value="Register"> </li> </ul> </form> <?php } include 'includes/overall/footer.php';?>
  6. I do not even use tables for forms anymore <ul> is much easer. You solution to you problem is to put each line of text in a p tag and give both the img and p tag an id and then position them with margins. Or put one img and line of text in a div and position the div. I would probably use the second one and use id instead of class.
  7. Use word press it has all the plugins you need to get this done. For the sale stuff use the dukapress plug in.
  8. You could have two pages almost the same one with the massage and one without. Then have the submit button redirect to the page with the success massage added. But that would just be silly. You know javascript and php it just seems like you are trying to reinvent the wheel. By the way how did the contest go on your prom thing?
  9. I agree with everything LSW said. I would like to ad however that word press has come a long way in the past couple of years. I like it better then Joomla as far as teaching a client on how to use the back end to update there site. It is a lot easier to learn. But again depends on your personnel preference. Joomla is better then word press for e-commerce. Although again there is a plug in for word press called dukapress that is easy to learn and has everything thing you need for e-commerce and is easy to customize. You will have to experiment like LSW said to see which one works best for you. But again if you have never used a CMS as it sounds like you have not, you can learn word press in a lot less time then Joomla.
  10. Not sure I agree with the degree part. I have never been asked, what schooling I have had, Only what have you done and where can I find it at.
  11. I just got done reading a post by a new member wanting a list of webdesign companies where they live. Also a while back I read a post that says something like, I am having a hard time finding business where I live. I live in a small town. Anyway something to that effect. You have to remember what www stands for, a reminder world wide web. This means that you should not be limited to clients by where you live. Yes a face to face meeting with a client is nice but not at all necessary. I have had clients that were clear on the other side of the world, and yes I do not make enough cash to go see them. I have had clients only a few hundred miles away and still never saw them once. How did I do it? First I put a portfolio site on the www. Then I get phone calls or an email from people looking for a web site. That is all there is to it. Well not all. It takes a lot of time, so do not give up. There are also tools out there such as Skype. Now you can have a face to face, well close enough anyway. You can even do it on your phone if you have a forward facing camera. Just like star trek. Which I think is super awesome. Some times I video call my wife when I am walking the dog, just because it is cool. So my point is do not give up just because you live in a small town in the middle of nowhere. Believe me I can relate. I live in the middle of a corn field. When you have your skills down and a portfolio site up with a couple of sites that you built. Does not have to be sites from a client. The sites in your portfolio site can be something you made up. Just remember not to put a fake phone number on them or selling something. You can put a fake email address on the site to contact you. Just remember in the code to have it go to you and not nowhere. Now that you have that done it is time to go and find work. My method, Google for web design companies. Start calling them and ask them for there HR department. If they do not have one they will tell you. Once you get the person on the phone that does the hiring, ask them if they hire contractors. If they do they will start asking you questions. Companies want to see your design and code. Do not start talking to them about the schooling you have had. I found that 99.9% do not care. Again they want to see code and design. Just answer the questions they ask, do not start volunteering info you could say the wrong thing. They know what they are looking for. Well that is my thoughts on the whole thing, hope I did not make to many people mad. This was not my intention.
  12. Thanks I was doing this if (strlen($_POST['password']) < 6 || (strlen($_POST['password'])) > 20)
  13. I am writing a custom CMC to have a template. I came across this problem, when I try to code the password for it can not be over 20 characters in length I keep getting errors no matter how I change it up. I do not want to write another if statement just for that, although that works. What I am looking for is less then 6 but no more then 20. If I use && or || it tell's me Parse error: syntax error, unexpected '>' in C:\xampp\htdocs\cms\register.php on line 21 <?php include 'core/init.php'; include 'includes/overall/header.php'; if (empty($_POST) === false) { $requried_fields = array('username', 'password', 'password_again', 'first_name', 'email'); foreach($_POST as $key=>$value) { if(empty($value) && in_array($key, $requried_fields) === true) { $errors[] = 'Fields marked with an asterisk are requried.'; break 1; } } if (empty($errors) === true) { if (user_exists($_POST['username']) === true) { $errors[] = 'Sorry, the username \'' . $_POST['username'] . '\' is already taken.'; } if(preg_match("/\\s/", $_POST['username']) == true) { $errors[] = 'Your user name must cotain any spaces\.'; } ERROR HERE-> if (strlen($_POST['password']) <6 || >20) { $errors[] = 'Your password must be a least 6 character\'s in length and no more the 20.'; } if ($_POST['password'] != $_POST['password_again']) { $errors[] = 'Your passwords do not match.'; } if(filter_var($_POST['email']. FILTER_VALIDATE_EMAIL) === false) { $ERRORS[] = 'A valid email address is requird. Your privacy is inportant to us. We will not give or sell it to anyone. '; } if(email_exist($_POST['email']) === true){ $errors[] = 'Sorry, the email \'' . $_POST['email'] . '\' is already taken.'; } } } print_r($errors); ?> <h1>Register for the site.</h1> <form action="" method="post"> <ul> <li> Username*:<br> <input type="text" name="username"> </li> <li> Password*:<br> <input type="password" name="password"> </li> <li> Password again*:<br> <input type="password" name="password_again"> </li> <li> First Name*:</br> <input type="text" name="first_name"> </li> <li>Last Name:<br> <input type="text" name="last_name"> </li> <li> Your E-Mail:<br> <input type="text" name="email"> </li> <li> <input type="submit" value="Register"> </li> </ul> </form> <?php include 'includes/overall/footer.php';?>
  14. Can someone please tell me what this css rule does? clip:rect(20px, auto, auto, 20px); I found it in a wordpress theme that I am modifying.
  15. It looks right to me. Might try to use the new line tag instead of the br tag. It worked for me before, Can not tell you why it made a difference.
  16. I agree with Andrea it looks black to me. But if it is still red on your pc try dumping you cash, ya I know wrong cash but can not remember how to spell. I have been up all night working on a crashed word press site.
  17. Sorry Andrea, I was not clear enough. What I want to happen is to have the link in the nav stay yellow so the user knows what page they are on. I have never had a problem with this until this theme. The theme is Delicate. Again sorry for not giving you the link to the site. I was so let's say getting strongly upset when I came here to ask for help. The url is http://www.midwestweb designstudio.com/masoncitymotox.com This is a proboneo site am building, well kinda of I traded ride anytime I want and race for free.
  18. In word press how can I make the links stay the color that they are when hovered on when viewing the page for the user knows what page they are on. I would use the class currant in the li tag but I think that the nav is wrote in javascript and I do not know any javascript at all.
  19. Just a little something to help you out. You do not have to but name your files in lower case, not ROOT.CSS Your problem, make sure all of your files are in the same letter case. main.css and MAIN.CSS or index.html and INDEX.HTML are not the same. Make sure that your index.html not index.html.html It would also help us if you post your css file and what your file and folder names are.
  20. Just had a thought, you mentioned buying a windows lap top from a friend. Well at my local pawnshop I can but a laptop for under 200 bucks. Just an option for you.
  21. Have you tried Virtual Operating System. This lets you put different OS on your computer. Basically what this does is let you run any OS that you want on any computer. Google it and you will find all the info that you need to install it.
  22. Here is a novel idea learn the code.
  23. It works ok for me in Firefox. Why are you changing your screen resolution? Personally I leave mine alone and never touch it. Although I could be wrong in doing this. I have been wrong before and I am sure that I will be again soon. If you design your site content no more then 1000px wide you should be fine. This should work on older monitors just fine and look ok on the newer ones also. At least the last few years anyway. You also talked about working on your pc and your laptop and the different sizes of monitors . What I do is when on my pc with the large monitor I just shrink the browser window down to the size of a 15 inches, 38.1cm, this is because I am to lazy to get up and go over to my laptop.
  24. Just a side note for you, this is a good place to check out screen resolution. http://www.hobo-web.co.uk/best-screen-size/
×
×
  • Create New...