Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Page 1 of 2 12 LastLast
Results 1 to 15 of 20

Thread: how do i

  1. #1
    New Coder
    Join Date
    Jun 2002
    Location
    chaoticrealities.com
    Posts
    32
    Thanks
    0
    Thanked 0 Times in 0 Posts

    how do i

    how do i add a image url to a cgi file as when i try i get a http 500 error

  • #2
    Regular Coder
    Join Date
    Jun 2002
    Posts
    905
    Thanks
    23
    Thanked 5 Times in 5 Posts
    you need to escape bits of it
    so say you got for example
    <img src="pics/pic.gif" border="0"> etc you get the idea
    you need to escape the "`s so if you had that you`d need to replace it with
    <imh src=\"pics/pic.gif\" boder=\"0\">
    ok?
    sir p

  • #3
    New Coder
    Join Date
    Jun 2002
    Location
    chaoticrealities.com
    Posts
    32
    Thanks
    0
    Thanked 0 Times in 0 Posts
    thanks dude

  • #4
    Regular Coder
    Join Date
    Jun 2002
    Posts
    905
    Thanks
    23
    Thanked 5 Times in 5 Posts
    thats alright..anytime.

  • #5
    New Coder
    Join Date
    Jun 2002
    Location
    chaoticrealities.com
    Posts
    32
    Thanks
    0
    Thanked 0 Times in 0 Posts
    i still got the http 500 error

  • #6
    Regular Coder
    Join Date
    Jun 2002
    Posts
    905
    Thanks
    23
    Thanked 5 Times in 5 Posts
    ok post the bit of code that is causing the error and i`ll loook at it for ya

  • #7
    New Coder
    Join Date
    Jun 2002
    Location
    chaoticrealities.com
    Posts
    32
    Thanks
    0
    Thanked 0 Times in 0 Posts
    i might have got it wrong but here you go =

    Software error:
    syntax error at cbsboard.cgi line 62, near "<IMG SRC="http://www.chaoticrealities.com/cbs.gif" ALIGN="TOP" WIDTH="300" HEIGHT="100"><"
    Execution of cbsboard.cgi aborted due to compilation errors.

  • #8
    Regular Coder
    Join Date
    Jun 2002
    Posts
    905
    Thanks
    23
    Thanked 5 Times in 5 Posts
    could the post the bit of code right from the code and not from the error?
    thanks
    sir p

  • #9
    New Coder
    Join Date
    Jun 2002
    Location
    chaoticrealities.com
    Posts
    32
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Internet Explorer

    well here is all the code i have to date , it works fine when i take the image out =

    #!/usr/bin/perl
    ###########################################

    ###################################################

    use CGI::Carp qw(fatalsToBrowser);
    print "Content-type:text/html\n\n";
    print "<html><head><title>CBSForums</title></head>\n\n";
    print "<body>\n";
    print "<p><H1><center>CBSBoard</center></H1><H4><center>Out of chaos , comes a community...</center></H4></p>\n";
    $file = 'data.txt' ; # Name the file
    open(INFO, "<$file" ) ; # Open the file
    @lines = <INFO> ; # Read it into an array
    close(INFO) ; # Close the file
    print " <BODY>\n" ;
    foreach $line (@lines) # assign @lines to $line, one at a time
    { # braces {} are required, bracket code
    print "\n <P> $line </P>" ; # print formatted lines to screen
    }
    ##################################################################################
    $correctUsername = "*****";
    $correctPassword = "*****";



    #################
    # Form Data Parsing

    if ($ENV{'REQUEST_METHOD'} eq 'GET') { $buffer = $ENV{'QUERY_STRING'}; }
    else { read(STDIN, $buffer, $ENV{'CONTENT_LENGTH'}); }

    @pairs = split(/&/, $buffer);

    foreach $pair (@pairs) {
    ($name, $value) = split(/=/, $pair);
    $value =~ tr/+/ /;
    $value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg;
    $FORM{$name} = $value;
    }

    ################
    # Comparison

    #Use a nested if/else statement like the one below to make debugging
    #much easier
    if ($FORM{'username'} eq $correctUsername) {
    if($FORM{'password'} eq $correctPassword) { print "You've passed the test!\n"; }
    else { print "Password Incorrect.\n"; }
    }

    else { print "Username Incorrect.\n"; }

    ######################
    <P ALIGN="CENTER"><A HREF="http://www.chaoticrealities.com/cgi-bin/cbsboard/cbsboard.cgi"><IMG SRC="http://www.chaoticrealities.com/cbs.gif" ALIGN="TOP" WIDTH="300" HEIGHT="100"></A></P>
    Last edited by chaotic; 06-24-2002 at 04:11 PM.

  • #10
    Regular Coder
    Join Date
    Jun 2002
    Posts
    905
    Thanks
    23
    Thanked 5 Times in 5 Posts
    yeh you didnt escape it...
    change
    <P ALIGN="CENTER"><A HREF="http://www.chaoticrealities.com/cgi-bin/cbsboard/cbsboard.cgi"><IMG SRC="http://www.chaoticrealities.com/cbs.gif" ALIGN="TOP" WIDTH="300" HEIGHT="100"></A></P>

    to this
    <P ALIGN=\"CENTER\"><A HREF=\"http://www.chaoticrealities.com/cgi-bin/cbsboard/cbsboard.cgi\"><IMG SRC=\"http://www.chaoticrealities.com/cbs.gif\" ALIGN=\"TOP\" WIDTH=\"300\" HEIGHT=\"100\"></A></P>
    and it will work fine
    sir p

  • #11
    New Coder
    Join Date
    Jun 2002
    Location
    chaoticrealities.com
    Posts
    32
    Thanks
    0
    Thanked 0 Times in 0 Posts
    now i get this =

    syntax error at cbsboard.cgi line 60, near "center>"
    (Might be a runaway multi-line "" string starting on line 56)
    Unrecognized character \xA9 at cbsboard.cgi line 60.

    would it be easier if i did it in php ?
    Last edited by chaotic; 06-24-2002 at 05:18 PM.

  • #12
    Regular Coder
    Join Date
    Jun 2002
    Posts
    905
    Thanks
    23
    Thanked 5 Times in 5 Posts
    no,

    i see what you done now...your not printing it your just using html...you must print html like this...

    print"<P ALIGN=\"CENTER\"><A HREF=\"http://www.chaoticrealities.com/cgi-\n";
    etc..make sure every line is inside print" " ;
    ok?
    sir p

  • #13
    New Coder
    Join Date
    Jun 2002
    Location
    chaoticrealities.com
    Posts
    32
    Thanks
    0
    Thanked 0 Times in 0 Posts
    so thats the problem i had whoops
    got it working , thanks again dude
    Last edited by chaotic; 06-24-2002 at 08:17 PM.

  • #14
    Regular Coder
    Join Date
    Jun 2002
    Posts
    905
    Thanks
    23
    Thanked 5 Times in 5 Posts
    anytime

  • #15
    Regular Coder
    Join Date
    Jun 2002
    Location
    the Netherlands
    Posts
    215
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I've been wondering what characters to escape...

    Can you (SirP) or anyone tell me wich?

    The ones I ALWAYS escape:
    <
    >
    &
    $
    ^
    \
    /
    "
    '

    That's about it...

    Mzzl, Chris


  •  
    Page 1 of 2 12 LastLast

    Posting Permissions

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