EasyCFM.COM ColdFusion Forums / Coding Help! / Already defined variables undifined ?????

   Reply to Discussion | New Discussion << previous || next >> 
Posted By Discussion Topic: Already defined variables undifined ?????

book mark this topic Printer-friendly Version  send this discussion to a friend  new posts last

shogeluk
04-01-2009 @ 3:35 AM
Reply
Edit
Profile
Send P.M.
My Gravatar!
Powered by Gravatar
New Member
Posts: 1
Joined: Apr 2009

im trying to create a upload form that attributes already defined earlier but i keep getting a error that says song id is already defined around the upload section even though  it has already been defined
It's likely to be my structure but im new to this and really cant solve it
any help will be much appreciated



Select your covering artist and song
<cfif isDefined('form.artist_select')>
    <cfset page.artist_select = form.artist_select>
</cfif>

<cfoutput>
  <form name="DropDown" method="post">

  <cfquery name="get_artist" datasource="music">
     SELECT artistid, artist
     FROM artist
  </cfquery>

  <select name="artist_select" required="yes" onchange="this.form.submit()">
     <option>Select artist</option>
  
     <cfloop query="get_artist">
         <option value="#artistid#" <cfif isDefined('form.artist_select')><cfif form.artist_select eq "#artistid#">selected</cfif></cfif>>#artis t#</option>
     </cfloop>
</select>
<p>

<cfif isDefined('page.artist_select')>
   <cfset page.song_select = '0'>
Select covering song<br />
   <cfquery name="get_song" datasource="music">
        SELECT song, songid
        FROM   song
        WHERE artistid = #page.artist_select#
   </cfquery>

   <select name="song_select" required="yes">
      <option>Select song</option>
      
      <cfloop query="get_song">
         <option value="#get_artist.artistid#">#get_song.song#</option& gt;
      </cfloop>
   </select>

</cfif>
</form>

<!--------heres where the problems start------------>

    <cfif IsDefined("FORM.Upload") AND #FORM.Upload# EQ "Upload">
        <cffile action="upload" destination="C:\ColdFusion8\wwwroot\karaoke" filefield="FORM.File" nameconflict="overwrite" result = "filepath" >
        File Uploaded! to <cfoutput>#FORM.file#</cfoutput>S
        <cfset uploadlink ="#filepath.serverfile#" >
      
        <cfquery datasource="music">
        INSERT INTO upload(songid, artistid, userid, uploadlink)
        VALUES ('#get_song.songid#', '#get_song.artistid#', '#qcurrentuser.userid#', '#uploadlink#')
        </cfquery>
      
    </cfif>
  
    <cfset CurrentPage=GetFileFromPath(GetTemplatePath())>
    <form action="<cfoutput>#CurrentPage#</cfoutput>" method="post" enctype="multipart/form-data" name="Upload" id="Upload">
    <input type="file" name="File"/>
    <input type="submit" name="Upload" value="Upload"/>
    </form>



</cfoutput>



Website Designed and Developed by Pablo Varando.