Greenguy's Board


Go Back   Greenguy's Board > Programming & Scripting
Register FAQ Calendar Today's Posts

Reply
 
Thread Tools Search this Thread Rating: Thread Rating: 1 votes, 3.00 average. Display Modes
Old 2012-08-21, 07:26 AM   #1
tadpole
Oh! I haven't changed since high school and suddenly I am uncool
 
tadpole's Avatar
 
Join Date: Aug 2007
Location: Darkest Africa
Posts: 258
Send a message via ICQ to tadpole
Script tutorials

Hi

I don't know a damn thing about scripting. Does anyone know of a good resource for beginners, that has tutorials?
tadpole is offline   Reply With Quote
Old 2012-08-21, 04:33 PM   #2
pc
Shift Out / X-On
 
pc's Avatar
 
Join Date: Jul 2007
Location: unknown
Posts: 2,298
Send a message via ICQ to pc
Quote:
Originally Posted by tadpole View Post
Hi

I don't know a damn thing about scripting. Does anyone know of a good resource for beginners, that has tutorials?
Anything particular ?
pc is offline   Reply With Quote
Old 2012-08-22, 11:16 AM   #3
DiGiT
Aw, Dad, you've done a lot of great things, but you're a very old man, and old people are useless
 
Join Date: Apr 2012
Posts: 21
... and what kind of scripting - which language?

JavaScript? BASH Script? Powershell Script? Even PHP is a scripting language...
__________________
Adult Webmaster Cash
DiGiT is offline   Reply With Quote
Old 2012-08-22, 04:42 PM   #4
javbucks
You can now put whatever you want in this space :)
 
javbucks's Avatar
 
Join Date: Oct 2011
Posts: 544
Quote:
Originally Posted by tadpole View Post
Hi

I don't know a damn thing about scripting. Does anyone know of a good resource for beginners, that has tutorials?
Start with C if you really want to learn and have a GOOD understanding of how computers work.

http://c.learncodethehardway.org/boo...rd-waypa1.html
javbucks is offline   Reply With Quote
Old 2012-09-11, 08:58 AM   #5
tadpole
Oh! I haven't changed since high school and suddenly I am uncool
 
tadpole's Avatar
 
Join Date: Aug 2007
Location: Darkest Africa
Posts: 258
Send a message via ICQ to tadpole
Thanks for your replies. What I am after is how to use scripts, written in any scripting language. The instructions I have seen so far, appear to be written for people who know what they are doing.

Sorry, I didn't explain myself very well.
tadpole is offline   Reply With Quote
Old 2012-09-12, 05:34 PM   #6
javbucks
You can now put whatever you want in this space :)
 
javbucks's Avatar
 
Join Date: Oct 2011
Posts: 544
Quote:
Originally Posted by tadpole View Post
Thanks for your replies. What I am after is how to use scripts, written in any scripting language. The instructions I have seen so far, appear to be written for people who know what they are doing.

Sorry, I didn't explain myself very well.
Depends on the script and which language it is in really.

Are you trying to just execute it or configure it to a specific purpose?
javbucks is offline   Reply With Quote
Old 2012-09-13, 08:52 AM   #7
tadpole
Oh! I haven't changed since high school and suddenly I am uncool
 
tadpole's Avatar
 
Join Date: Aug 2007
Location: Darkest Africa
Posts: 258
Send a message via ICQ to tadpole
I just want to know how to execute a script
tadpole is offline   Reply With Quote
Old 2012-09-22, 09:43 AM   #8
ecchi
Banned
 
ecchi's Avatar
 
Join Date: Oct 2003
Location: About to be evicted!!!!
Posts: 4,082
Quote:
Originally Posted by tadpole View Post
I just want to know how to execute a script
If you mean how to upload and use one: upload it as an ASCII file (it won't work otherwise) to your cgi-bin then set the permissions to whatever is stated on the script (different FTP clients have different ways of doing this, see your FTP software's help file for details) and it should work. Some scripts require changes before uploading, but if the script creator is any damn good they should be in simple English (e.g. "Change 'YOUR_DOMAIN' to your actual domain name").

Some more complicated scripts require a slight programming knowledge but, as has already been posted, we need to know what language they are in. Asking for instructions for all programming languages is like asking a chef to give you a recipe that will make all types of food! However if you have some specific instruction that you do not understand, post it here and someone will probably be able to explain it for you.
ecchi is offline   Reply With Quote
Old 2012-09-22, 11:01 AM   #9
tadpole
Oh! I haven't changed since high school and suddenly I am uncool
 
tadpole's Avatar
 
Join Date: Aug 2007
Location: Darkest Africa
Posts: 258
Send a message via ICQ to tadpole
Okay thanks, your reply has answered a couple of things. I will re read the script and come back.

Many thanks
tadpole is offline   Reply With Quote
Old 2012-09-28, 11:43 AM   #10
tadpole
Oh! I haven't changed since high school and suddenly I am uncool
 
tadpole's Avatar
 
Join Date: Aug 2007
Location: Darkest Africa
Posts: 258
Send a message via ICQ to tadpole
Okay, so I am trying to install rstgp script which is supposed to be very basic. I use Core FTP

The instructions are as follows :

Step 1. Set permissions on your ROOT(public_html) directory to "0777" and upload file "rstgp_install.php" on your ROOT directory.

I do not have a public_html file, so I made one. (Go Daddy) when I checked my FTP for info on setting permissions, it had "comming soon" written under it. I looked at the permissions on my hosting, and they just say the file is viewable to the public.

So I don't know what to do next?

Could anyone please explain? Searching on google did not help me.
tadpole is offline   Reply With Quote
Old 2012-09-29, 08:15 AM   #11
ecchi
Banned
 
ecchi's Avatar
 
Join Date: Oct 2003
Location: About to be evicted!!!!
Posts: 4,082
PHP is not a language I know much about (I use Perl as it runs faster, so I never really learnt more than the most basic PHP) however WRT "permissions":

Quote:
Originally Posted by tadpole View Post
Set permissions on your ROOT(public_html) directory to "0777"
Umm, are you sure you need this script. I'd never set any folder to 777, this is basically telling your server "let any asshole do anything they like in this folder". A great gift for hackers!

Quote:
Originally Posted by tadpole View Post
I do not have a public_html file, so I made one.
I don't use the same host as you. However for every host I have used (it took 4 before I found the one I now use) you don't need to do this. Simply change the permissions on the directory.

This varies as to what FTP client you use (I'll say further down why I'm assuming it won't be Core FTP). On the FTP clients I have used you select the directory folder, then select "change permissions" either from a menu, from a button on the software window, or by right clicking on the directory name - if you don't have the instruction file for your FTP client, simply try all these and look for an option that says "change permissions" or "set permissions" or similar.

Once you have found this you may be lucky and your FTP client may simply allow you to set it to 777, but it may be called something else. It may say "allow all", or you may have to set three different things, which will be labelled; owner, group, and other to 7 (which is basically what 777 means "owner=7, group=7, other=7), or, if you are really unlucky, each of owner, group, and other may have an option of "read, write, and execute for each of owner, group, and other, all 9 of which you will have to set to "allow" or "yes" or "OK" or whatever terminology your FTP client uses. Sorry I am not being very clear on this part, but it depends on which FTP client you use. So if you cannot see how to set permissions to 777, you will have to read the help file on your FTP client, to see how that program expects you to do it.

Quote:
Originally Posted by tadpole View Post
Go Daddy
Whoa, change hosting. For a start, do a search on this board (or any board) for GoDaddy top see why they are shit. Secondly, unless they have changed policy, if you do anything vaguely adult and they find out, they will close down your site and lock you out of your own domain.

Quote:
Originally Posted by tadpole View Post
when I checked my FTP for info on setting permissions, it had "comming soon" written under it.
Then it is no good, change it. If it cannot change permissions then choosing it to run a website is like choosing a fork to eat soup. It is the wrong tool for the job, you cannot do what you need to do with it.

Quote:
Originally Posted by tadpole View Post
they just say the file is viewable to the public.
This basically means that surfers can "see" the page but cannot "use" it. Which basically means "any script will NOT work"

Sorry I'm being more negative than helpful, but if I am reading your post correctly your problem is not that you do not understand how to use scripts, but that you don't have the right tools to use them. So any attempt you make will fail. This is not only bad because it means the site won't work, but because it will confuse you when you do the right thing and everything fails, you will probably assume the fault is with your knowledge and give up. So the first two things you need to do are:

1) Get a FTP client (FTP software) that can change permissions.
2) Get a proper host, NOT GoDaddy.
ecchi is offline   Reply With Quote
Old 2012-09-29, 08:44 AM   #12
ecchi
Banned
 
ecchi's Avatar
 
Join Date: Oct 2003
Location: About to be evicted!!!!
Posts: 4,082
Addenda to my last post:

I just downloaded the free version of the script to try it for you. I did not get very far (see point 2 for the reason) but trying it did tell me three things:

1) Don't worry too much about my comment "I'd never set any folder to 777" because this appears to be only while you set it up, afterwards it tells you to reset directory permissions to a more common (and safer) setting. However, for God's sake don't forget to reset it when they say so, if you leave it at 777 the site will probably still work, but your domain will be open for hackers!.

2) When you get a new FTP client (FTP software), don't just check it allows you to change permissions, make sure it allows you to do this to DIRECTORIES (FOLDERS). I'm using my old XP box at the moment, which only has a very old free FTP client on it, and trying to run your script I found out that it only allows me to change permissions on files and not on directories (folders), that will be no good to you. You need one that allows you to change the permissions on directories (folders).

3) When you do finally get the permissions thing worked out, I think you are home and dry. I could not create a site, because I cannot change permissions on directories on this computer, and I don't have time to fire up my Vista box at the moment, but I got as far as starting the set up, and it looks like a really easy script to use, probably great for beginners.
ecchi is offline   Reply With Quote
Old 2012-09-29, 09:02 AM   #13
tadpole
Oh! I haven't changed since high school and suddenly I am uncool
 
tadpole's Avatar
 
Join Date: Aug 2007
Location: Darkest Africa
Posts: 258
Send a message via ICQ to tadpole
Thanks very much for your reply.

I will take your advice about the FTP and Go Daddy, whom have never been helpful when it comes to support. I started using them on the advice of a webmaster when I first thought of trying Adult! Thanks for the tip!

I have tried installing the script, and have not got it working, so will make the changes you suggest and try again.


Thanks for your time and knowledge, appreciated.
tadpole is offline   Reply With Quote
Old 2012-10-05, 12:48 PM   #14
tadpole
Oh! I haven't changed since high school and suddenly I am uncool
 
tadpole's Avatar
 
Join Date: Aug 2007
Location: Darkest Africa
Posts: 258
Send a message via ICQ to tadpole
Hi ecchi

I have changed my hosting provider, found out how to change permissions on my FTP.

The script I was trying out, I do not need - I was using it to practise with as it is supposed to be simple.

I have a fetish site, and after reading the "something different "(your sig) I want to use your script in perl.

Perl and SSI are enabled on my new hosting. The path to perl is the same as you used. I have triple checked and re done everything and it is not appearing on my page, so a few questions :

1. I have set the executable permissions on the script. Must I also set the permissions on CGI?

2. I made a new page for this script to run on (blush - I use Front Page 2002!) Do I insert the code for call to SSI in the body?

3. When I save the script to a text file, what encoding should I use? I have windows vista and my choices are ANSI, unicode, unicode big endian and UTF-8.

4. In your script, where I put in my own ID code, I take it I put in the full URL with my code in it?

I have checked your reasons as to why the script is not working, and feel my error may be caused by one of the above.

Thanks
tadpole is offline   Reply With Quote
Old 2012-10-10, 05:26 AM   #15
ecchi
Banned
 
ecchi's Avatar
 
Join Date: Oct 2003
Location: About to be evicted!!!!
Posts: 4,082
Quote:
Originally Posted by tadpole View Post
1. I have set the executable permissions on the script. Must I also set the permissions on CGI?
By "CGI" I take it you mean the directory(folder)? If so, it should automatically have been set to allow execution of scripts. However if you have already tried changing it (eg to try the other script), you may have to change it back.

Quote:
Originally Posted by tadpole View Post
2. Do I insert the code for call to SSI in the body?
Yes, the SSI is basically a command that says "put the stuff here" so put it on the page exactly where you want the blog to appear.

Quote:
Originally Posted by tadpole View Post
blush - I use Front Page 2002!
That could be your problem. The opening and closing angle brackets define the fact that the text between them is code. So when your server sees them it executes that code and deletes the text. However software like Front Page usually assume you don't want this to happen, so they replace the angle brackets with a special code that simply tells the browser to display an angle bracket and ignore the fact that it contains code. I have not used Front Page, but most programs like that have a setting to include code as code, rather than bugger with it. It may be a menu setting, or it may be a button that allows you to insert a line of code into the text. If anyone else reading this uses Front Page, perhaps they could post a reply telling you exactly what the Front Page commands are to make it do this.

Quote:
Originally Posted by tadpole View Post
3. When I save the script to a text file, what encoding should I use? I have windows vista and my choices are ANSI, unicode, unicode big endian and UTF-8.
You really want "plain text". I don't think it matters, but I'd go for ANSI.

Quote:
Originally Posted by tadpole View Post
4. In your script, where I put in my own ID code, I take it I put in the full URL with my code in it?
No, just the ID. For example my ID is ecchi, so I'd use:
Code:
$a1id = "ecchi";
ecchi is offline   Reply With Quote
Old 2012-10-10, 09:39 AM   #16
tadpole
Oh! I haven't changed since high school and suddenly I am uncool
 
tadpole's Avatar
 
Join Date: Aug 2007
Location: Darkest Africa
Posts: 258
Send a message via ICQ to tadpole
Hi

Quote:
I have not used Front Page, but most programs like that have a setting to include code as code, rather than bugger with it.
I do have a setting to insert code without it being tampered with by Front Page. Thats what I used


Thanks for your reply. You cleared up a few things for me. I eventually contacted my hosting provider with a screen shot, and got this reply :

It appears that the rule was not listed in the .htaccess file to enable the SSI. We have added the file for you. The URL does resolve to a black page, However, the file that is being referenced does not exist. Please review your scripting of the testing.shtml file.

The rule they added to .htaccess is : addhandler x-httpd-php5-cgi .shtml

When I pull up my testing.shtml page it is blank.


I have read and re read your instructions, and cannot see what I have missed. I will give it a break today, and try again from scratch tomorrow.
tadpole is offline   Reply With Quote
Old 2012-10-11, 05:04 AM   #17
ecchi
Banned
 
ecchi's Avatar
 
Join Date: Oct 2003
Location: About to be evicted!!!!
Posts: 4,082
Try uploading the following as your testing.shtml page:
Code:
<html><head><title>Test</title>
</head>
<body>
<!--#include virtual="cgi-bin/readblog.cgi"-->
</body></html>
That should just give you a page with the blog on it.
If you get a message "an error has occurred executing this directive" or similar, the problem is with the script file.
If you get a blank page, take a look at the source code in your browser (on IE, simply select "source" from the "view" menu") and let me know what you get.
ecchi is offline   Reply With Quote
Old 2012-10-15, 12:57 PM   #18
tadpole
Oh! I haven't changed since high school and suddenly I am uncool
 
tadpole's Avatar
 
Join Date: Aug 2007
Location: Darkest Africa
Posts: 258
Send a message via ICQ to tadpole
I uploaded that as my testing page and am still receiving a blank page. The source I am getting is :

<p><!--webbot bot="HTMLMarkup" startspan --><html><head><title>Test</title>
</head>
<body>
<!--#include virtual="cgi-bin/readblog.cgi"-->
</body></html><!--webbot bot="HTMLMarkup" endspan --></p>

That was using the insert button Front page has, I also typed it in exactly as your sample code and got a blank page.
tadpole is offline   Reply With Quote
Old 2012-10-15, 03:12 PM   #19
ecchi
Banned
 
ecchi's Avatar
 
Join Date: Oct 2003
Location: About to be evicted!!!!
Posts: 4,082
Quote:
Originally Posted by tadpole View Post
I uploaded that as my testing page and am still receiving a blank page.
Your host has not enabled SSI. They may also have not enabled your CGI-BIN. If they were both enabled that page would have either worked or given you an error message. And either way, the server at your host's end should have deleted the following line from your source code:
Code:
<!--#include virtual="cgi-bin/readblog.cgi"-->
Copy and paste the last three messages on this board, and send them to your hosting company. They will be able to work out what they are doing wrong from these three posts.
ecchi is offline   Reply With Quote
Old 2012-10-16, 08:53 AM   #20
tadpole
Oh! I haven't changed since high school and suddenly I am uncool
 
tadpole's Avatar
 
Join Date: Aug 2007
Location: Darkest Africa
Posts: 258
Send a message via ICQ to tadpole
Many thanks, I have contacted my hosting company and am waiting for a reply. They had assured me after a previous e mail that the SSI and CGI bin was enabled. Hopefully a different person will receive my latest e mail
tadpole is offline   Reply With Quote
Old 2012-10-17, 10:36 AM   #21
tadpole
Oh! I haven't changed since high school and suddenly I am uncool
 
tadpole's Avatar
 
Join Date: Aug 2007
Location: Darkest Africa
Posts: 258
Send a message via ICQ to tadpole
Below is the reply I received from my hosting company :-

I understand you are inquiring about SSI and CGI for fetishfiends.com. The script mentioned references "/cgi-bin", which is incorrect. Your current directory is named as "/cgi". I do show both SSI and CGI are enabled. Server-side scripts and executables can be uploaded to any directory on your site and are not restricted to run only in the cgi directory. These scripts and executables are any files with the following extensions: .cgi, .pl, and .py.

So it looks like I will need a slightly different script. I tried making a directory called cgi-bin, and uploaded the script to that, but it didn't work.
tadpole is offline   Reply With Quote
Old 2012-10-19, 06:52 AM   #22
ecchi
Banned
 
ecchi's Avatar
 
Join Date: Oct 2003
Location: About to be evicted!!!!
Posts: 4,082
Quote:
Originally Posted by tadpole View Post
I tried making a directory called cgi-bin, and uploaded the script to that, but it didn't work.
No, the CGI-BIN is not like a normal folder, you cannot make it yourself, it is done at the server end.

Quote:
Originally Posted by tadpole View Post
The script mentioned references "/cgi-bin", which is incorrect. Your current directory is named as "/cgi".
What they are saying is that for some reason they have decided to ignore the convention of calling the folder where scripts are stored as "CGI-BIN" and instead called it cgi. In the SSI call change "cgi-bin/readblog.cgi" to "cgi/readblog.cgi":

Code:
<html><head><title>Test</title>
</head>
<body>
<!--#include virtual="cgi/readblog.cgi"-->
</body></html>
If that does not work try the following (but by "work" I mean "do something", if you get an error message, assume this part has worked and let me know what the error message says.):
Code:
<html><head><title>Test</title>
</head>
<body>
<!--#include virtual="/cgi/readblog.cgi"-->
</body></html>
(the same thing but with a slash before cgi.)


Note that practically every script you get will assume your host will be calling the folder where scripts are stored as "CGI-BIN" so you will always have to remember to change the call from "CGI-BIN" to "cgi"

Quote:
Originally Posted by tadpole View Post
So it looks like I will need a slightly different script.
No the script should still work, all you need to change is the SSI call, in the way I mentioned above.

Quote:
Originally Posted by tadpole View Post
Server-side scripts and executables can be uploaded to any directory on your site and are not restricted to run only in the cgi directory.
Are you trying to run test.shtml from the cgi folder? If so only readblog.cgi should be in the cgi folder - test.shtml should be in root (or whatever your hosting company called the other folder).

Quote:
Originally Posted by tadpole View Post
I do show both SSI and CGI are enabled.
I'm still not convinced of this because if SSI were enabled you should at the very least get an error message, and the line with the include statement should have been deleted from the source code. However, if you have put test.shtml in the cgi folder, perhaps SSI is only active in the root folder.

If you are running test.shtml in the root directory (or whatever your host calls the other folder) and you are still not getting either the blog appearing or an error message, then let me know and I'll tell you what to say to your host to get things fixed at their end.
ecchi is offline   Reply With Quote
Old 2012-10-19, 07:45 AM   #23
flowersgone
Are you sure you're an accredited and honored pornographer?
 
Join Date: Sep 2008
Posts: 67
Quote:
Originally Posted by tadpole View Post
The source I am getting is :

<p><!--webbot bot="HTMLMarkup" startspan --><html><head><title>Test</title>
</head>
<body>
<!--#include virtual="cgi-bin/readblog.cgi"-->
</body></html><!--webbot bot="HTMLMarkup" endspan --></p>
That also indicates to me that the file is not being processed with server side include processing. With server side include processing the <!--#include ... line should be gone and replaced with something else.

I have set up an example page here: http://development.toosxxx4.com/ssh-test/test.shtml

The source code is below:

HTML Code:
<!DOCTYPE HTML>

<html>
<head><title>shtml test page</title></head>
<body>

<h3>include flat html</h3>
<!--#include virtual="static.html"-->

<h3>include cgi from bad config</h3>
<!--#include virtual="/no-such-cgi-bin/noprog.cgi"-->

<h3>include cgi from good config</h3>
<!--#include virtual="/cgi-bin/smaller-min.cgi"-->

</body>
</html>
When you do a view source on the result page all the #include lines are gone including the one with a bad cgi directive. The line with a bad cgi directive is replaced at the hosting computer with an error message so the message and not the include line is sent to the browser.

fg
__________________
Thank you for checking out my:
Portfolio and Tech Services

Last edited by flowersgone; 2012-10-19 at 07:53 AM.. Reason: improved fmting etc
flowersgone is offline   Reply With Quote
Old 2012-10-19, 11:55 AM   #24
tadpole
Oh! I haven't changed since high school and suddenly I am uncool
 
tadpole's Avatar
 
Join Date: Aug 2007
Location: Darkest Africa
Posts: 258
Send a message via ICQ to tadpole
Thanks for your reply ecchi, and flowersgone for the example page.

The script I have uploaded to cgi, and the test.shtml is in the root. I have tried both codes :-

<html><head><title>Test</title>
</head>
<body>
<!--#include virtual="cgi/readblog.cgi"-->
</body></html>

and

<html><head><title>Test</title>
</head>
<body>
<!--#include virtual="/cgi/readblog.cgi"-->
</body></html>

I am still receiving a blank page that shows the source code exactly as the above two examples.

I have tried saving the script file with .txt and .cgi extensions, but nothing is working or giving me an error message.
tadpole is offline   Reply With Quote
Old 2012-10-23, 04:05 AM   #25
ecchi
Banned
 
ecchi's Avatar
 
Join Date: Oct 2003
Location: About to be evicted!!!!
Posts: 4,082
Quote:
Originally Posted by tadpole View Post
I have tried saving the script file with .txt and .cgi extensions, but nothing is working or giving me an error message.
At this point it does not matter what you do with the script file because the shtml file is not even looking at it yet. Your host has NOT enabled SSI. I cannot understand how they think they have. Try sending them the message below, although obviously replace (name) and (domain) with your own name and domain.
Quote:
I am trying to help (name) get a script of mine working on (domain). The script is called from a shtml page. Although you have assured (name) that SSI is enabled, this is not correct. If you look at the page on the domain called test.shtml in a web browser you will notice that it is a blank page. If both the script and SSI call are working it would show an adult blog feed. If there was a problem with the script the page would show an error message. There is no such message. Even if I were to assume your server was running some cut price software that did not show an error code (I'm NOT saying you are, I am just trying to cover all possibilities here), it would still delete the call to SSI from the page. If you look at the source code, you will see that this has not been done. The only way that can happen is if SSI is not enabled for this account. So please could you enable it.

Also: To save the possibility of future problems please check that CGI is enabled and that your Perl engine is live.

Finally, in your previous message you stated that your server does not use the usual protocol of calling the folder where the scripts are stored "cgi-bin" and instead calls it simply "cgi". Could I ask you to confirm this and also let me know if there are any other unusual settings on your server that I need to know about, to avoid future problems. And is your path to Perl "usr/bin/perl" as is common, or do you use any unusual folder names/directory structure that I need to know about?

Thank you in advance for your help.
ecchi is offline   Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 03:10 AM.


Mark Read
Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
© Greenguy Marketing Inc