User Profile

Collapse

Profile Sidebar

Collapse
deppeler
deppeler
Last Activity: Aug 29 '07, 03:03 PM
Joined: Jul 23 '07
Location:
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • deppeler
    replied to Debugging CGI App - Delete image from server
    in Perl
    I worked it out.

    I just had to move:

    Code:
    my $file = '/home/childcar/www/toypics/$nktype;
    unlink($file);
    to before this:

    Code:
    print DBK "";
    }else{
    print DBK "$nktype,$nkcode,\n";
    }
    thanks!
    See more | Go to post

    Leave a comment:


  • deppeler
    replied to Debugging CGI App - Delete image from server
    in Perl
    Ok I have it working, thanks for the primer...BUT I have one problem

    When it deletes the file from the server it deletes the LAST file uploaded and not the correct file, any ideas?

    I used this code:
    Code:
    my $file = "/home/childcar/www/toypics/$nktype";
    unlink($file);
    thanks
    See more | Go to post

    Leave a comment:


  • deppeler
    replied to Debugging CGI App - Delete image from server
    in Perl
    If I use this:

    [CODE=perl]
    $DBK = '/home/childcar/db/dbp.txt';
    $databaseview = 'http://www.mysite.org/cgi-bin/admintoy/photo.pl';

    if ($input{'action '} eq 'delete'){
    open (DBK,">$DBK");
    @DB = <DBK>;
    foreach $rec (@ODB){
    chomp($rec);
    ($nktype,$nkcod e,) = split(/\,/,$rec);
    if ($nktype eq $input{'nktype' } && $nkcode eq $input{'nkcode' })...
    See more | Go to post
    Last edited by miller; Aug 22 '07, 04:22 PM. Reason: Code Tag and ReFormatting

    Leave a comment:


  • deppeler
    replied to Debugging CGI App - Delete image from server
    in Perl
    How would I do that?
    See more | Go to post

    Leave a comment:


  • deppeler
    replied to Debugging CGI App - Delete image from server
    in Perl
    Ok I tried this but it didn't work:

    [CODE=perl]
    $DBK = '/home/childcar/db/dbp.txt';
    $loc = '/home/childcar/www/toypics/';

    if ($input{'action '} eq 'delete') {
    open (DBK,">$DBK");
    @DB = <DBK>;
    foreach $rec (@ODB){
    chomp($rec);
    ($nktype, $nkcode,) = split(/\,/,$rec);
    $file='$loc$nkt ype';
    if ($nktype eq $input{'nktype' }...
    See more | Go to post
    Last edited by miller; Aug 22 '07, 04:19 PM. Reason: Code Tag and ReFormatting

    Leave a comment:


  • deppeler
    replied to Debugging CGI App - Delete image from server
    in Perl
    I am not seeing any error and I have the first script (where the users choose the image) auto reload on delete, the image name is being deleted from the DB but still not on the server.

    Paul
    See more | Go to post

    Leave a comment:


  • deppeler
    started a topic Debugging CGI App - Delete image from server
    in Perl

    Debugging CGI App - Delete image from server

    I have a script that allows the user to upload images to the server & writes the file name to a flat file DB.
    I have another script that allows the user to delete the image entry from the DB.
    Is there a way to also delete the image from the server folder as well?

    Here is the script I am using to delete the entry in the DB:

    [CODE=perl]
    if ($input{'action '} eq 'delete'){
    open (dbk,">$dbk");...
    See more | Go to post
    Last edited by miller; Aug 22 '07, 03:47 PM. Reason: Reformatted Code

  • deppeler
    replied to Reload parent window & query
    Perfect!

    thanx
    Paul
    See more | Go to post

    Leave a comment:


  • deppeler
    started a topic Reload parent window & query

    Reload parent window & query

    How do I reload a parent window that is part of a cgi script that has a query string?
    I have a script that shows a record with images uploaded into a DB.
    I have an image upload script (child window) which on close I would like it to refresh the parent window.
    The issue is the parent window has a query string attached to the script name.
    E.g.
    Code:
    http://www.mysite.org/cgi-bin/admintoy/dbedit_recccf.cgi?snumber=001&a
    ...
    See more | Go to post

  • deppeler
    replied to Debug Help - Script to edit a flat file DB
    in Perl
    I tried that but nothing.
    I did change the:
    Code:
    print "Location: $databaseview\n\n";
    to point back to the first script as I wanted to see any changes made.

    If I change this ($databaseview) to $file_name...$c aption I get a 'Not Found' error and the URL is the script with the Ist line of the database like this:

    Code:
    http://www.myorg.org/cgi-bin/admintoy/artsy.jpg,Art
    artsy.jpg is ($file_name)...
    See more | Go to post

    Leave a comment:


  • deppeler
    started a topic Debug Help - Script to edit a flat file DB
    in Perl

    Debug Help - Script to edit a flat file DB

    Can someone look at this for me:
    I am trying to set up a script to edit an item in a flat file DB but I don't seem to be getting the data to the Photoedit script. It seems to be reading the 1st line of the DB and not what is selected.
    I am all messed up..I know this is straight forward but I am having a real hard time with this.

    I am wanting the user to be able to select a photo (nfile_name - radio button) and if desired...
    See more | Go to post

  • deppeler
    replied to Redirect
    in Perl
    thanx a heap!

    Paul
    See more | Go to post

    Leave a comment:


  • deppeler
    started a topic Redirect
    in Perl

    Redirect

    I have a script that edits/writes a flat file DB.
    After execution the script redirects the user to another script - advstoy.pl (to choose another option).
    Is there a way to make the script reload the same page as was just edited?

    Here is a sample of the code:
    Code:
    $databaseview='http://www.mysite.org/cgi-bin/admintoy/advstoy.pl';
    print "Location: $databaseview\n\n";
    I tried this:...
    See more | Go to post

  • deppeler
    replied to Upload image
    in Perl
    thank you again!

    Paul
    See more | Go to post

    Leave a comment:


  • deppeler
    replied to Upload image
    in Perl
    Ok, that's great.....excep t how do I get it to show 5 images per row, I changed $i == 14; to 5 but that didn't work the top row showed 5 and the next row ALL the rest of the images in the DB.

    thanks
    Paul
    See more | Go to post

    Leave a comment:


  • deppeler
    replied to Upload image
    in Perl
    Ok, as you can see I am getting the correct image on each row.

    Can you give me a clue as to how I get this right.

    thanks
    Paul
    See more | Go to post

    Leave a comment:


  • deppeler
    replied to Upload image
    in Perl
    I tried that but what I get is the correct table width but each row contains just one image repeated across the 12 cells as per below.




    Again here is a snippet of code I am using:

    Code:
    <table cellpadding='2' border='0' width="729" cellspacing='2' bgcolor='#FFFFFF'>
    HTML
    
    open (BASE, $dbp) || do {&no_open;};
    @sorted = sort(<BASE>);
    foreach $pair (@sorted)
    ...
    See more | Go to post

    Leave a comment:


  • deppeler
    replied to Upload image
    in Perl
    I do know html but this is a little different because the number of images is always changing and to get it to format therefore wrap at 729px within the perl script is not easy.
    I just thought I had come across some perl code at some time that would do this but I guess not.

    thanks
    anyway
    Paul
    See more | Go to post

    Leave a comment:


  • deppeler
    replied to Upload image
    in Perl
    thanks for the info.
    I decided to go with the seperate upload script.

    I have one issue.
    I can get the script to write the uploaded images to the DB and display the result in cells in a table.
    My table width is '729' px how do I format it so when displayed, if I have say 20 images they will 'wrap' into the next row instead of continuing across the page.
    Here is a snippert of code I am using now.
    ...
    See more | Go to post

    Leave a comment:


  • deppeler
    started a topic Upload image
    in Perl

    Upload image

    I have a simple flat file db, a toy library
    When users add an entry they can choose which 'kit' it belongs to, include a name, description, ID number, etc.
    Is it possible to add an image at well.
    The only way I can think to do it is to run a seperate script (upload) from within the main script.
    The problem with that is that the location for the image file doesn't get written to the db, at least I don't know how to do that...
    See more | Go to post
No activity results to display
Show More
Working...