path ......!!! in windows ....

 
Post new topic   Reply to topic    Aprelium Forum Index -> FastCGI/CGI
View previous topic :: View next topic  
Author Message
elviz
Guest





PostPosted: Thu Nov 14, 2002 6:33 pm    Post subject: path ......!!! in windows .... Reply with quote

Sorry for my dummy question.? I'm using windows98sed i would like to know what is the path in Windows ...

$guestbookreal = "/home/yourname/public_html/guestbook.html";


and how can i find the path for date in windows ... as well

$date_command = "/usr/bin/date";

thanks in advance!
Back to top
cgi dude
Guest





PostPosted: Thu Nov 14, 2002 11:47 pm    Post subject: Reply with quote

your guestbooks realtive path would be where you are hosting the files from off of your machine:

like guestbook = /where/your/files/are/located
and usually if you want the date added on the posts
you would put something like this in your .cgi code

sub get_time {
my ($min,$hour,$mday,$mon,$year,$wday,@month,@days);
@months = ('January','February','March','April','May','June','July','August','September','October','November','December');
@days = ('Sunday','Monday','Tuesday','Wednesday','Thursday','Friday','Saturday');

($min,$hour,$mday,$mon,$year,$wday) = (localtime(time+($fix_time*3600)))[1,2,3,4,5,6];
$min = "0$min" if ($min < 10);
$hour = "0$hour" if ($hour < 10);
$mday = "0$mday" if ($mday < 10);
$year += 1900;
$this_day = ("$days[$wday], $months[$mon] $mday, $year at $hour:$min");
}

sub add_entry {
my ($remain,$entry_id,$page_num,$page_val,$num_min,$num_max,@lines,@filename,@foundlist,@booklines,@pages_id,@sublines);
&get_host;
&get_time;

heres a link for a cool & easy way to display the time and date
http://www.geocities.com/felgall_com_au/javatip3.htm

hope I was of some help, But I do suggest buying a book to learn about perl and cgi related issues. :) goodluck bro.
Back to top
aprelium
-


Joined: 22 Mar 2002
Posts: 6800

PostPosted: Fri Nov 15, 2002 12:20 am    Post subject: Re: path ......!!! in windows .... Reply with quote

elviz wrote:
Sorry for my dummy question.? I'm using windows98sed i would like to know what is the path in Windows ...

$guestbookreal = "/home/yourname/public_html/guestbook.html";

These are UNIX-style paths. In Windows, paths looks like
$guestbookreal = "c:/program files/abyss web server/htdocs/guestbook.html";

elviz wrote:

and how can i find the path for date in windows ... as well

$date_command = "/usr/bin/date";

thanks in advance!

You script seems a script written to a UNIX system so it depends heavily on the tools usually available on that kind of systems. /usr/bin/date is the path to the command that displays the time in UNIX. In Windows, similar commands are date and time but they don't work the same way.
You'd better include a function (as suggested by cgi dude) to generate the date instead of calling an external program as in UNIX.
_________________
Support Team
Aprelium - http://www.aprelium.com
Back to top View user's profile Send private message Send e-mail
elviz
Guest





PostPosted: Fri Nov 15, 2002 2:16 am    Post subject: Reply with quote

thanks guys !!!! but how i know went the Script is for Unix or Windows ... is any way to find out ..

thanks one more time .....
Back to top
aprelium
-


Joined: 22 Mar 2002
Posts: 6800

PostPosted: Fri Nov 15, 2002 3:09 am    Post subject: Reply with quote

elviz wrote:
thanks guys !!!! but how i know went the Script is for Unix or Windows ... is any way to find out ..

thanks one more time .....

Most scripts work in both worlds (UNIX and Windows.) Some of them make some UNIX assumptions but can be easily converted to work on Windows. Some rare case doesn't work on Windows because they are too UNIX-specific.
How to know that ? Read the documentation of the script if there is one. If none is available, try to edit the script and to read the comments your find in it. You can also just give it a try. In clear words, there are no simple criteria that can imply if a script is UNIX specific or not.
The best is to learn the scripting language (Perl in your case) so that you can understand other people scripts. You will also be able to hack them and to make them work even if they weren't meant to run on Windows.
_________________
Support Team
Aprelium - http://www.aprelium.com
Back to top View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic   Reply to topic    Aprelium Forum Index -> FastCGI/CGI All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB phpBB Group