SitePoint Sponsor

User Tag List

Results 1 to 20 of 20
  1. #1
    Extremists Beware! Rockrz's Avatar
    Join Date
    Mar 2001
    Location
    In God's Country!
    Posts
    1,317
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    CGI question . . . .

    I've learned how to upload a javascript file to my
    server, and then use it on a webpage by placing the
    URL in the head of the document . . . .

    My question is this:
    Can I do the same with a CGI script? Or does the CGI
    script need to be in its own folder?

    I'm wanting to utilize a CGI script I have for putting
    together an e-mail form for my visitors to send me
    messages.

    Thanx,
    Rockrz
    .

  2. #2
    PHP warrior dkode's Avatar
    Join Date
    Sep 2001
    Location
    Planet Namek
    Posts
    329
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You can't embed a CGI script within an html document (unless your're using mod_perl). With CGI you make a normal html page with a <form> </form> tags. Within these tags you would have all of your input boxes. then you set the <form action="http://www.server.com/cgi-bin/cgiscript.cgi">
    to that and then all of the variables will be sent to your cgi script. I reccomend using php instead as it is easier to learn and understand than cgi/perl plus your script is the html document.
    "Mankind cannot define memory, yet it defines mankind"
    -- Project 2501, Ghost in the Shell

    Smarty | PEAR | PHP Manual | MySQL Manual

  3. #3
    Extremists Beware! Rockrz's Avatar
    Join Date
    Mar 2001
    Location
    In God's Country!
    Posts
    1,317
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Wow! I thought PHP was allot more involved & complexed.

    So PHP can be set up to work in Netscape,and IE 4.0 and above?

    If so, where can I get some scripts to run a mail form and tutorials to go with it?

    Thanx,
    Rockrz
    .

  4. #4
    SitePoint Wizard silver trophy redemption's Avatar
    Join Date
    Sep 2001
    Location
    Singapore
    Posts
    5,269
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally posted by Rockrz
    Wow! I thought PHP was allot more involved & complexed.

    So PHP can be set up to work in Netscape,and IE 4.0 and above?
    i can only help you with this

    first, php is pretty much as easy to learn and use as CGI...

    and yes, php works for netscape, ie 4, or almost every browser because it's basically a server-side script... compatibilty would rest on the html content of your script ,eg. certain css

  5. #5
    Extremists Beware! Rockrz's Avatar
    Join Date
    Mar 2001
    Location
    In God's Country!
    Posts
    1,317
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    will it work with frames?

    How to get started?
    .

  6. #6
    SitePoint Wizard silver trophy redemption's Avatar
    Join Date
    Sep 2001
    Location
    Singapore
    Posts
    5,269
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    it's just a matter of setting up your html to do frames...

    as for where to start...

    and this thread
    here

    http://www.webmasterbase.com/article/525
    check out the other php articles too!

  7. #7
    Extremists Beware! Rockrz's Avatar
    Join Date
    Mar 2001
    Location
    In God's Country!
    Posts
    1,317
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I've already got my site set up with frames, and looking the same in Netscape & IE. I'm currently using "formmail.to" to process my e-mail form.

    Thanx for the tips & links. I'll head on over and study
    up on things, and see if I can pull it off.

    Thanx again,
    Rockrz
    .

  8. #8
    Mlle. Ledoyen silver trophy seanf's Avatar
    Join Date
    Jan 2001
    Location
    UK
    Posts
    7,168
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    PHP is not like HTML, all of the PHP code is processed on the server and then you send HTML to the browser

    Sean
    Harry Potter

    -- You lived inside my world so softly
    -- Protected only by the kindness of your nature

  9. #9
    PHP warrior dkode's Avatar
    Join Date
    Sep 2001
    Location
    Planet Namek
    Posts
    329
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    hey, my name is sean as well.. i see you spell it the CORRECT way like me
    "Mankind cannot define memory, yet it defines mankind"
    -- Project 2501, Ghost in the Shell

    Smarty | PEAR | PHP Manual | MySQL Manual

  10. #10
    Mlle. Ledoyen silver trophy seanf's Avatar
    Join Date
    Jan 2001
    Location
    UK
    Posts
    7,168
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    We need more Sean's around here

    Ok, time for the secret handshake

    Sean
    Harry Potter

    -- You lived inside my world so softly
    -- Protected only by the kindness of your nature

  11. #11
    Extremists Beware! Rockrz's Avatar
    Join Date
    Mar 2001
    Location
    In God's Country!
    Posts
    1,317
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    "then you set the <form action="http://www.server.com/cgi-bin/cgiscript.cgi">
    to that and then all of the variables will be sent to your cgi script"


    I've uploaded my cgi script to my server in it's own cgi bin. So now I just put my form on a page & test it out, right?
    .

  12. #12
    Mlle. Ledoyen silver trophy seanf's Avatar
    Join Date
    Jan 2001
    Location
    UK
    Posts
    7,168
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Yes, but you can't just create a cgi-bin as it has to have execute permissions, so your host has to create it

    Sean
    Harry Potter

    -- You lived inside my world so softly
    -- Protected only by the kindness of your nature

  13. #13
    Extremists Beware! Rockrz's Avatar
    Join Date
    Mar 2001
    Location
    In God's Country!
    Posts
    1,317
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    my webspace comes with a cgi-bin (according to tech support.

    So, does my folder have to be entitled "cgi-bin" like that? (lower case, and with a dash between cgi and bin)
    .

  14. #14
    Mlle. Ledoyen silver trophy seanf's Avatar
    Join Date
    Jan 2001
    Location
    UK
    Posts
    7,168
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    It should already be there

    Sean
    Harry Potter

    -- You lived inside my world so softly
    -- Protected only by the kindness of your nature

  15. #15
    Extremists Beware! Rockrz's Avatar
    Join Date
    Mar 2001
    Location
    In God's Country!
    Posts
    1,317
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Do you know if it should be there as "cgi-bin", "cgi", "cgibin"?

    When I create the cgi folder on my computer, exactly how should I entitle it? Doesn't it have to be the exact name as whats on my server?
    .

  16. #16
    Mlle. Ledoyen silver trophy seanf's Avatar
    Join Date
    Jan 2001
    Location
    UK
    Posts
    7,168
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    It is most likely cgi-bin. Some hosts will let you run cgi files in any folder

    Sean
    Harry Potter

    -- You lived inside my world so softly
    -- Protected only by the kindness of your nature

  17. #17
    What? Maelstrom's Avatar
    Join Date
    Oct 2001
    Location
    Whistler BC originally from Guelph Ontario
    Posts
    2,175
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally posted by seanf
    We need more Sean's around here

    Ok, time for the secret handshake

    Sean
    Does the middle name spelled correctly count...

    BTW I am really looking forward to seeing your completed buffy site
    Maelstrom Personal - Apparition Visions
    Development - PhP || Mysql || Zend || Devshed
    Unix - FreeBSD || FreeBsdForums || Man Pages
    They made me a sitepoint Mentor - Feel free to PM me or Email me and I will see if I can help.

  18. #18
    What? Maelstrom's Avatar
    Join Date
    Oct 2001
    Location
    Whistler BC originally from Guelph Ontario
    Posts
    2,175
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    For more info on php and php administration you can also try devshed

    www.devshed.com

    Has some fantastic articles on php and php admin etc...
    Maelstrom Personal - Apparition Visions
    Development - PhP || Mysql || Zend || Devshed
    Unix - FreeBSD || FreeBsdForums || Man Pages
    They made me a sitepoint Mentor - Feel free to PM me or Email me and I will see if I can help.

  19. #19
    Mlle. Ledoyen silver trophy seanf's Avatar
    Join Date
    Jan 2001
    Location
    UK
    Posts
    7,168
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I am working on the site now - I have been instructed to get a move on by some mentors!

    I suppose you count but we will have to call you Middle-Sean!

    Sean
    Harry Potter

    -- You lived inside my world so softly
    -- Protected only by the kindness of your nature

  20. #20
    Extremists Beware! Rockrz's Avatar
    Join Date
    Mar 2001
    Location
    In God's Country!
    Posts
    1,317
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    OK, man. Thanx

    I just wanted to start with CGI forms and move up from there. I'll eventually get to PHP.

    You guys have a good one.....
    .


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •