Jump to content

j.smith1981

Members
  • Posts

    333
  • Joined

  • Last visited

    Never

Everything posted by j.smith1981

  1. Yes and I obviously over looked that did not I, what is your problem anyway?
  2. No this one worked hence why I didn't reply, just neglected to click solved.
  3. There must be a way of simplifying this though: <?php preg_match('/^[a-z]+ [a-z]+ [a-z]+ [a-z]+ [a-z]+ [a-z]+ [a-z]+/', 'this may or may not be valid', $matches) print_r($matches); This works absolutely fine but I am just curious to know a better way of doing this. Any help's much appreciated and thank you so far for your help, Jeremy.
  4. You know what just hit me lol, I neglected to realise that it takes appreciation to spaces, so it only goes up to yes the first word but doesn't go any further than that. I was putting in the numeric value at the end, so anything past 'this' will be immediately ignored. Makes sense now, I therefore randomly put a number in the first part of the subject and it fails to find a value, also I am pretty tired today so probably why I didn't think about yesturdays occurence of more or less the same thing. Thank you again though much appreciated! Jeremy.
  5. Yes I know, I mean I just neglected to realise I'd need to put in the plus sign + to get it to span the whole of the input/subject. It's still allowing numeric values in though, why is this? I mean I don't mind it just thought logically it should not, here's my expression as it stands now: <?php preg_match('/[a-z]+/', 'this may or may not be valid 1')
  6. Hi there got a bit of a thing that's maybe not bugging me but wanted to check on something with regular expressions. I have one here: preg_match('/[a-z]/', 'this may or may not be valid with 1') This still works, but I thought logically I should be putting something like [a-z0-9] or something to make numeric values valid in a regular expression but this just allows with a-z anyways, should this be happening? I mean sorry just so I can get you to understand my problem again the above complete regular expression should logically not be permitting anything from 0-9 I thought and just anything from a-z but it's not, why is this happening? Any helps much appreciated, Jeremy.
  7. Ok when I renamed the pear directory in /usr/share/pear to something like /usr/share/.pear (so not to remove it completely incase something went wrong), I then reinstalled pear and it keeps coming up with not as many as 11 errors of the same occurence but just 2 now. What could still be causing this? I thought removing pear completely would eliminate such an error? Any help agains massively appreciated, Jeremy.
  8. I am having problems upgrading my existing packages in PEAR. I mean I did try removing the .channels folder in my /usr/share/pear folder but this doesn't fix it nor does uninstalling pear and then reinstalling is there something I am missing sorry? I mean I have been on about 10 blogs and every solution doesn't seem to work, I keep getting the message: This occurs for 11 times in a row when I run: What is actually causing this? I mean I have tried removing the .channels folder as I said above and even tried removing pear but nothing seems to work, might try removing the pear folder perhaps (as that did not remove last time), is there anything else I am missing? Any helps much appreciated! Jeremy
  9. Sorry the last post I made does exactly the same thing I think really must try and get my brain working though but thank you so much is there any real difference though between the 2? I suppose with the {} curly braces you could have a min set and the plus (+) would just say 1 or more (which I remember being the metachar for. Am I thinking in the right sense between + and {1,} ? Finally understanding some rather simple but dynamic regexes really happy with what I am doing. Really appreciate your help though! Jeremy.
  10. Finally my heads kicked in lol: <?php preg_match('/index.php\?cat=\d{1,}&post=\d{1,}/', 'index.php?cat=25&post=65', $matches); {1,} means the character before the iteration must appear at least once but multiple times, anyways it works, tried even with {1,5} and deliberately entered 6 characters in the numeric part and it still works even, well not results come up but if I was to put in 6 using the {1,} then it would work. Thanks for your help, Jeremy.
  11. Tried this: <?php preg_match('/index.php\?cat=\d&post=\d\d/', 'index.php?cat=25&post=65', $matches); Does not now come up with any results, there must be a method for saying up to the next character which would be a letter, but I just can't work out the logic.
  12. Hi there, I was wondering if I could pick someones brains please? I am doing some work in regular expressions again, I thought why not have some fun with it, well I have setup this literal example but a bit baffled with what I am trying to do. Here's my logic: <?php preg_match('/index.php\?cat=\d\d&post=\d\d/', 'index.php?cat=25&post=65', $matches); What I would like to do is allow the \d\d (2 digits) to be anything like say i don't know 1 10 even 100000 you see? Is this possible if so how? I am trying to think about this critically but failing to do so to add to this, just though it would be fun any helps much appreciated, Jeremy.
  13. Hi there, I have been pondering doing some kind of e-commerce solution of my own at some point but before I want to start on this, what in the sense of security should I be considering if I want to possibly charge people for downloading this? I am more interested in the security aspect at the moment and would love to get your opinions, not actual work of course this would be entirely my own but is there any good tutorials on the web to touch on such projects in the sense of security though? I mean just any feedback is greatly appreciated, it's just I have been pondering this for ages since I work in e-commerce and would love to develop one possibly over the winter break, if anything just HTML eventually going into CSS and maybe some other nice technologies I think might be useful. I mean just for now though I want to concentrate on the security side like how's the best way to make a check out based on security aspects, so one can't go in there and grab a persons address (I know it's like locking your door someone can still break in if they break the door down as such), but it would just be really interesting. Any replies are massively appreciated in advance, Jeremy.
  14. Ahh that's really good I will definately use your guide as a way to go about doing Normalisation. Thank you so much! Jeremy.
  15. Oh sorry yes that's what I meant probably didn't describe it in that manner. So in effect you'd never set the SKU as being unique then in an SQL schema? I have seen though on many ecommerce open source and paid for solutions that do set the SKU or a productcode as being unique though. Just a little confused about that. I mean one way around that would be I suppose to make your own system based prefix maybe on them or something, a compound key in effect but hmmm would that not be contradicting the rules of that level?
  16. Sorry I haven't replied to this for a while. But one thing I was notified about by a colleague of mine at work was each SKU like you said is unique so a product might be the same product but as the database would see it that has been used up and it's a new version of that product maybe a new cartridge with the same information so you'd get a whole new product even though it would have the same SKU, so their in effect 2 different products as the database see's it but to you and your customers its the same product, but the database won't see it like that. There's many occasions when we do that at work, so you never in effect delete a product ever, or you'd be in effect causing data duplication when there's no need for it.
  17. No I don't actually have any data really what I was after was just definitions as to what is what and what level data should be. I have another general question, probably specific to any kind of company that holds SKU's and has their own database to do this (though I doubt any database designer that's good with some amount of experience would most likely avoid for obvious reasons). Like say I have an orders table, all the stuff like the order amount, pre tax and including tax, who they paid through and the status things like that right? I then have a poorly designed database by where the SKU is used as a key that would presumably be in the 3rd Normal Form right? I mean it would have the other data about that product which would concern the order, obviously this is a bad idea, so you'd shift that to an order id no and make that the 2nd Normal Form wouldn't you? Since if say I was to replace that product with another say an updated version but with the same SKU, that would cause data problems I know, but am I thinking this in the sense of the correct normal forms, since we aren't talking about the actual products table, we are merely talking about products being added to a table that have been ordered on what occasion. We kind of have this problem with the ecommerce that I work on, one of the many reasons why I am asking this stuff to make a better database for our own purposes and want to really do this properly. Thank you ever so much for your help so far, it's great, and I look forward to your next reply, Jeremy.
  18. Infact no sorry 1NF is no repeating rows as a whole. Where each column may have 1 more occurence of repeating data, but when you take into account the whole row, at least 1 attribute of that table can have 1 or more repeating rows, but as a whole they can not repeat at all as a whole of attributes. If that makes any sense? 2NF as I have been studying is by where you have 1 set of data that can be applied to many rows, so you may have studentID repeated in 1NF 10 times, to create a FK on that relevant table, then to reference that by that 1 key to a unique row on another table, so anytime you want to refer to that studentID and change their details, you can do so without having to update many rows of student data on that. I am currently working on 3NF though but would love to get someones reply stating if I have got this correctly in my head really. Thank you so much for reading and I look forward to any replies, Jeremy.
  19. I am just concerned I may be thinking about this in the wrong sense and would like someone to correct me if I should be wrong about this assumption. 0NF is pretty easy it's all attributes on the same table, that is a no brainer for myself. The problem is is when it comes to understanding the 1NF and the 2NF. 1NF is having say a products table like so (this would then have the supplier ID): ProductID, Product Name, Product Price, VendorID But the 2NF would have say something along the lines of: ProductID, VendorID Containing no exact data about them just links to the other 2 perspective data's? am I going at this in the right sense though?
  20. Hi there has anyone ever used Prestashop by any chance? If so has anyone created a payment module with Prestashop using Paypoint before? I know there's a paid for solution out there but X Cart do it free with theirs, I mean I know Prestashop is free and as a consequence of how quick it is with regards to searching and the like, would it be possible for someone perhaps assist me with developing a module for this? I mean I was wanting to know what is the best way of starting this kind of project off, I really am clueless as to this. Any help is (and I really mean this too) hugely appreciated, Jeremy.
  21. Postfix is used for iRedmail, would rather get this working using what I have for now.
  22. I am having real problems sending emails using my ISPs SMTP service. What I am getting back is exactly this: I have tried the following steps: http://www.cyberciti.biz/faq/postfix-multiple-isp-accounts-smarthost-smtp-client/ But this doesn't work, have replaced the username (email) on the steps with my own ISPs email address (which I won't give out here for obvious reasons) and my current password but still no luck. By doing those steps it just says deffered, can someone help me to overcome this error? I mean surely if I am a registered user on their network I should be able to send emails surely? Any feedbacks greatly appreciated, Jeremy.
  23. Oh scratch that sorry I was thinking way too literally as if the user was on that one table, no you are quite right but really erm. So I would say trying to think this concept through logically. So you are suggesting (excuse my last part of my previous reply), I would get the user to login successfully save maybe the session_id to a cookie, that would say be existing in a table for users, with a link maybe to their userid, I mean trying to think this through logically where I am not saving the user's password in the database anywhere but finding this really confusing. Any help is hugely appreciated, I do not really want to save passwords as true values but how would I get what the user typed back though?
  24. Sorry just wanted to go over this again and see how it compares to my understanding of what you said, I am a little confused about what you said that's all. I really massively appreciate your reply and wanted to make sure I understand it. So you would only save this information if the user was previously successful in logging in I take it? I mean that's fine either way I think just wanted to get someone's opinion on this. But you would only save their userid in a session? That makes sense, because providing that one would never leave that information on how the database looks to the user (why would they?) then it would be a complete guess as to what their true username is, but the down side is they'd have it filled in on the form anyway, the only possible way of securing that's SSL but this is a piece of work where that kind of systems not really that important. You'd then if the cookie exists I would have thought logically where there is a userid greater than say 0 then the script would login to the database server, check to see what the username is for that userid, but how would you go for the password if it's encrypted? I mean that's what I honestly do not get, there are sites where people are able to but how would you go about getting that back at all by doing that?
  25. Hi there got a bit of a logic question here. I have been looking at doing a remember username and password for a persons login form. You'd need to set this as a cookie right? But when doing so would you place it just as the user has entered the form, or when the user has actually successfully logged in, I know mostly this 1st question would be up to me, but what would you do in your own opinion? On a second note to that, I have been going on this logic, just to try and work it out for myself but it keeps coming out with the encrypted password, is there a much better tutorial than going off my own assumptions? Here's the logic: <?php session_name('jeremysmith_remember_login'); session_start(); ini_set('display_errors', true); // see whats in the cookies overall! print_r($_COOKIE); // now do logic on the form example: if(!array_key_exists('login', $_POST)) { $message = 'User has not logged in yet, please login below:'; require 'form.php'; } else { if(strlen(trim($_POST['username'])) > 0 && strlen(trim($_POST['password'])) > 0) { // now save them to a cookie maybe? mysql_connect('localhost', '******', '*****') or die (mysql_error()); mysql_select_db('test') or die (mysql_error()); $username = mysql_real_escape_string($_POST['username']); $password = mysql_real_escape_string($_POST['password']); $sql = sprintf("SELECT * FROM users WHERE username LIKE '$username' AND password LIKE sha1('$password')"); $result = mysql_query($sql) or die (mysql_error()); if($result) { if(mysql_num_rows($result) === 1) { $_SESSION['logged_in'] = true; // this will be our only check for now though! if(IsSet($_POST['remember_login'])) { // but don't remember if they have not logged in, what would be the point in that? setcookie("username", $_POST['username']); setcookie("password", $_POST['password']); header('location: success.php'); } } } else { die(mysql_error()); } } else { $username = trim($_POST['username']); $error = 'You did not enter all the fields required to login, please try again'; require 'auth_form.php'; } } I am just a bit confused, any guidance is massively appreciated, Jeremy.
×
×
  • 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.