Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 158707
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T10:43:45+00:00 2026-05-11T10:43:45+00:00

I am trying to create a page that lets a user delete an image

  • 0

I am trying to create a page that lets a user delete an image if he is logged in. I pass the image ID through the URL when the button is clicked. The problem is it does catch the image ID but when I click delete it passes the value of the button to the URL instead of the image ID. It looks like user_acc_images.cfm?delete=Delete instead of user_acc_images.cfm?uploaded_image_id=1 in the browser.

Here’s my code:

<cfif isdefined('session.username')> <cfoutput><h3 class='uname'>Hello #session.username# </h3></cfoutput></cfif>  <h2>Your Uploaded Images</h2>  <p>On this page you can view the list of all the images you uploaded.You can also delete some of your photographs if you wish.</p>       <table cellspacing='25'>          <cfif isDefined('session.username')>     <cfinvoke component='cfc.user_acc_images' method='viewimages' returnvariable='vimages'>         <cfoutput query='vimages'>            <tr>            <cfform name='formurl' action='http://www.humbermedia3.ca/portfolio0809/farnauz/AcePhotographyMain/user_acc_images.cfm?uploaded_photo_id=#uploaded_photo_id#' method='get'>              <td align='left'>                 <img src='#uploaded_photo_name#' name='photo_name' width='200' height='200'/>                 </td></tr><tr><td>                 <b>Uploaded on: </b>#upload_date# <br/><br/>                 <!---<button type='submit' name='delete' value='Delete' class='button' >--->                 <input type='submit' name='delete' value='Delete' class='button' />                 <br/><br /><hr/>             </td>              </tr></cfform>           </cfoutput>      </table>  <cfelse>     <cfoutput>           <h3>Sorry you cannot access this page.<h3>             <p>                 You have to be logged in to view your uploaded images.<br/><br/>                 Click<a href='login.cfm'> here </a>to log in.<br/>                 Dont have an account? Click<a href='register.cfm'> here </a>to create a new account.             </p>     </cfoutput> </cfif>  <cfif isDefined('form.delete')>     <cfinvoke component='cfc.user_acc_images' method='deleteimage' returnvariable='dimage'>     <cfinvokeargument name='url' value='#URL.uploaded_photo_id#'>     <cfoutput>#URL.uploaded_photo_id#</cfoutput> </cfif> 
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. 2026-05-11T10:43:45+00:00Added an answer on May 11, 2026 at 10:43 am

    Paolo is right, but I would also add that the reason you are having this trouble is because when you do a form GET any url variables in the action url are not passed along. His solution is best but you could also change it to a form post and then the url variables you are passing through the action attribute will be passed through.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 77k
  • Answers 77k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • added an answer HashMap<String, String> dataMap = new HashMap<String,String>(); Your dataMap variable isn't… May 11, 2026 at 3:33 pm
  • added an answer There is probably a way to do this that is… May 11, 2026 at 3:33 pm
  • added an answer There is no 3.0 version of VB.Net. Are you refering… May 11, 2026 at 3:33 pm

Related Questions

Recently I have been studying recursion; how to write it, analyze it, etc. I
I'm having a right barney getting my head around how everything fits together using
We have a Java Applet built using AWT. This applet lets you select pictures
I am trying to create a simple page that enters data in to a

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.