Tag: web

How to use SVN on 1and1 account

When creating a project it is always wise to use some version control program.

I prefer to use SVN it is fast, easy to use and its support is build in in NetBeans IDE. Since I use hosting at 1and1 I tried to install my own SVN repository there. It is very easy and it worked almost instantly.

First step: create svn repository on the server.

Just SSH to your account and create a new directory and svn repository in it:

cd /
mkdir svn
svnadmin create /kunden/homepages/……/htdocs/svn

to get a full path to your home directory call “pwd” command and replace ……. with your information

Now your svn repository is set up – we can procees to the second step: netbeans configuration

from putty download page (here) get plink.exe and place it in c:\Program Files\Putty\ (you can choose different path)
now in your Project window right click on your project name and select Versioning->Import into subversion repository
for Repository URL select svn+ssh:// and enter:svn+ssh://your.domain.com/kunden/homepages/……./htdocs/svn (same path that you have used for svnadmin command)
then as Tunnel Command enter: C:/Program Files/Putty/plink.exe -l ssh_username -pw ssh_password
click Next
now in “Repository Folder” enter desired name like “my_project”
enter a message – for example “initial import”
click Next again
after a while you will be prompted what files you want to import – usually you want to import whole project so just click Finish

And you are done – enjoy your SVN on 1and1 account

the only thing that I don’t like is having open text password for my ssh account in netbeans – it I find a way to hide somewhere I will share it with you


Why should you use jQuery

If you ask me one year ago “have you seen jQuery” my answer would be “have you seen what?”

If you ask me six months ago I would say “I heard about it but I don’t see any benefit in using it. I know javascript well enough to write my own code”.

And I was sooooo WRONG.

I just finished small project for my friend www.jardinsdesreves.pl and I decided to give it a try.
The benefit: my js file is only 170 lines long.

I just want to show you couple benefits of this wonderfull framework.

FORMS:

I have never seen a simpler way to submit forms via ajax.

Just look at the simple example:

1
2
3
4
5
6
7
<form>
  <input type="hidden" name="id" value="2">
  <input type="hidden" name="save" value="1">
  Title: <input type="text" name="form_title"><br>
  Content: <textarea name="form_content" cols="25" rows="8"></textarea>
  <input type="button" value="Save changes" onclick="sendForm('text_save.php');">
</form>
1
2
3
4
5
6
7
8
9
10
function sendForm(post_url) {
  var request = $("form").serialize();
  $.post(post_url, request, function(data) {
    formResponse(data);
  });
}
 
function formResponse(resp_data) {
  $("#message").text(resp_data);
}

As you can see jQuery does all job for us.
There is only one requirement – each form element needs to have a name (not id).

serialize() function does great job and will post all form to ‘text_save.php’ where we can do processing and show response to the user.

In the next article I will show you how to use great jQuery plugin ‘ajaxfileupload.js’ to upload files.


no “Hello world” today

This is just a beginning.

I hope to find enough time to write some articles about web development (PHP, Javascript, CSS, Flex …) and my hobby photography.

I spend a lot of time writing code and even more time googling around for help and solutions. I know how difficult it is to find something useful. That’s why on my blog I will post only useful information and I will try not to copy anything that is already posted on other blogs.

Don’t expect to find a new post every day but if you have any questions or comments to my articles I will respond ASAP

Lets get started :)


Copyright © 1996-2010 Artur's Blog. All rights reserved.
iDream theme by Templates Next | Powered by WordPress