Everything posted by Jay Gilford
- Price injection test
-
General question about classes
I never said there was anything wrong with it, just that in most cases classes make things quicker/easier
-
General question about classes
It really depends on the project though in most cases there are classes that can help you save time sure. Most likely when you've read about classes helping save time it will be with an MVC not just using classes
-
Best way to go about user comments when storing in database.
You create a table called comments with the necessary comment fields, then use a 'user_id' field where you assign the users id to the comment. This process is called normalization
- Wrapping my head around sessions and cookies
-
Wrapping my head around sessions and cookies
1. You need to start a session on EVERY page you want to use a session. Without doing so the session data can't be accessed 2. You will need to validate on each page that the user can access the page (ie has a valid session login) before executing code Using the approach you have, the easiest thing would be to create a new php file - we'll call it bootstrap.php for arguments sake. Now in there you put the session start code and some code to validate the current user session is valid, and if not redirecting to the login page. Then on every page you would add an include to bootstrap.php The one exception to this would be the login page which you would add the session start to on its own (otherwise you'll end up in an infinite loop)
-
GitHub/Local development
Don't use dropbox, palko will cry!
-
GitHub/Local development
Just because not everyone gets as aroused as you do about git doesn't mean they're wrong. You can't face the fact that your beloved git isn't as simple as dropbox for syncing files across platforms. If you don't like people's opinions that's fine. Stop being all high and mighty because you've learnt how to use a toy and think you're perfect. Sadly you aren't. You also sound like a retard using the word 'facile' followed by the word 'daft'
-
GitHub/Local development
You've never seen someone forget to do something? Sure it becomes part of the daily workflow...but it isn't to begin with. The point about dropbox is even if it's set up incorrectly (which is next to impossible really if you use the .msi file) is that you can correct it which only needs doing once and it then works all of the time And yes as I've pointed out I use version control. I don't use it to transfer files between two systems I work on though because it would slow me down not make me more productive
-
GitHub/Local development
Right - but you only need to fix any sync error once. Human error can and does happen more than that
-
GitHub/Local development
I've not once said Dropbox is better at version control than Git. Dropbox is better at syncing files. You've gone back to listing features the OP's not mentioned wanting like site updating, bug fixing, team collaboration etc. They're all lovely features but not ones the OP has asked for As for the "If you forget to push your changes then that's your fault". Sure it is, but with Dropbox that's not going to happen is it? Lets just agree to disagree here. Your parachute analogy is pretty unrealistic too. You can't undo hitting the ground and killing yourself...
-
GitHub/Local development
OK you say I've ignored the deployment side of this - what benefit does git have if the OP doesn't have SSH access to the server in question? Or git isn't installed? There's going to be no point to it. Not everyone has a VPS/Dedicated server where they can tinker with the workings of it. Also, what if you forget to commit and push, then go to your second location and realise you've not done so? You've then not got the files to work with. You keep mentioning laziness and what you see as laziness I see as being more efficient. I don't need to worry about syncing files because it all gets done and I know it's happening. I don't worry about forgetting what's done and what isn't - it all gets done as soon as the file is saved Also, I wouldn't want to be committing work just because I was going to a different location because I'd end up with a load of commits that are going to be garbage due to the file being incomplete or has bugs.
-
GitHub/Local development
It's not a 'half baked solution'. Dropbox is made for syncing files between different locations and does it well. Git does this sure, but you still need to commit every time you make changes. Dropbox will find your changes as they're made, add files as they're made and delete too. There's no 'drag and drop' functionality - it does it by itself. This sounds like you've not even used Dropbox to be honest Right, but the OP doesn't want version control This makes no sense. Dropbox is a great tool....but it's of no use? Either it's a great syncing tool or it isn't and if it is then you've just completely confirmed the fact that it is ideal for the OP's needs
-
GitHub/Local development
It does solve it sure, but what you're missing is the whole point of suggesting dropbox. Dropbox is easier for syncing. That is the fact of the matter here. All of the other features you've mentioned are beneficial sure - I know because I work on a few opensource projects on github and googlecode and know the benefits of them but what the op asked for git doesn't provide any better solution to the problem. Dropbox syncs all by itself between machines without any commands being run by the user. You should also realise that the OP doesn't use git and as such would need to learn how to do so taking more time. Before you start throwing your toys out of your pram about it, yes I know it's not that difficult to get to grips with but git will be slower than dropbox to sync between machines constantly
-
GitHub/Local development
Except for the bit on dropbox not allowing reverts of course - oh and this statement Yes it's inferior for VERSION CONTROL since it's not a version control system. Stop being lazy yourself and read the OP's question. Where does it ask for any of the features you listed? All the OP want's is to continue development between two machines. Oh, and Dropbox is superior to git in this instance since it doesn't require any user interaction as files are modified since they sync on the fly All of which the OP didn't ask for Where did the OP ask for this? Oh that's right they didn't There's a whole lot of what if's here. The easiest way to put this is that it's fine for your scenario but the OP's not asked for any of this. Just because it works for you doesn't mean it will work for them See above...git is not easier to sync than dropbox and if you think it is you're too lazy to work out how it works Thanks, I pride myself on it
-
GitHub/Local development
You're demonstrating an overly complex solution to a simple request. The OP want's one thing. Syncing files between two machines. Dropbox is PERFECT for this. How you can say Git does it 100 times better I don't know. As for the solution being awful - that's your opinion. You're wrong, but you are entitled to it. Oh, and I'm well aware of Git thanks. I didn't say I don't know how to use it, I said that for syncing between two machines Dropbox works well. Stop assuming and get your head out of your arse
-
GitHub/Local development
Actually yes you can. The OP wasn't asking for a version control system to work in a team, they were asking for a simple solution to sync files between two machines to continue development. The OP also never asked for a solution to branch off and make changes then merge back in the changes to an existing project. The only 'ridiculous' thing here is how 'atrocious' your literary skills are when it comes to reading what someone wants. Everything in your list of 'Can you...' the OP's not asked for
-
GitHub/Local development
Doing that is highly discouraged to be honest. Since databases can change rapidly, it's hard to do that. What is recommended is to just use a remote server for DB connections - that's what I do anyway
-
Help with uploading new website!
Following up from what Wickham and GalaxyTramp have said, technically speaking FTP is all that's required to upload a site. However, if your site is dynamic (needs a database) then the developer will need access to your database administration page (usually either in cPanel/Plesk or standalone if you don't have either of those) The most common is phpMyAdmin but there are others. Check with the designer if they need database access and if you don't find anything from your hosting setup emails relating to it, get in touch with them and ask them if they have something that the designer can use There is one other possibility and that's that the designers IP isn't allowed through your host's firewall. This would mean you would need the designer's IP address and supply it to your host so that they can allow it
-
GitHub/Local development
You can just separate different folders for dropbox. I use dropbox for websites and any other files. All you need to do is set the document root to match the dropbox directory
-
GitHub/Local development
You could do that sure, or what you could do is use dropbox instead which will update files automatically without having to commit files to a repo and then update on the new machine
-
wamp function GETDATE()
getdate isn't a mysql function. I think the one you need is curdate()
-
Passing php variables to javascript
Not really sure why you have duplicated the script or indeed the JS code... You would be better using <script> var pid = <?php echo $pid ? $pid : "''"; ?> </script> That said, personally I would put any js variables into an array in php, then use json_encode() and set one variable to have all the array values in, such as <?php $vars = array( 'pid' => $pid ); ?> <script> var v = <?php echo json_encode($vars); ?>; </script> Then to call the variable for $pid in JS, you could just use v.pid This is a more convoluted method for the single variable, but if you're passing multiple, this becomes far more convenient and means you don't have to assign loads of variables in JS
-
Can I sell one product without a database?
Simplest thing would be to use PP shopping cart http://webdesign.about.com/od/ecommerce/a/create-a-paypal-shopping-cart.htm
-
htaccess help needed
Oops it should have been change RewriteRule ^([a-z]+)$ http://www.website.co.uk/?page=$1 [NC] to RewriteRule ^([a-z]+)$ index.php?page=$1 [NC]