Jump to content

mkklepper

New Members
  • Posts

    8
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

mkklepper's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. No, It preint the quotes and dots.
  2. I use two computers. My main studio PC is not hooked up to the internet. The other one is for the internet. I'm running the same software on both(Windows XP, WAMP, Dreamweaver). I copied the files from my studio PC to the internet PC and all of a sudden none of the variables work. [code]echo " My name is $var1. My favorite color is  $var2.";[/code] It prints [code]My name is $var1. My favorite color is  $var2.[/code] I've checked all the configuration files and the are the same. I know it's some mundane detail but I',m just not  seeing it. Any suggestions?
  3. I guess I was a little too close to the project huh?
  4. The problem is that the variable $trackname is not making it into the file path for the unlink function. (see the error msg)
  5. I am creating a music page for a local musician. He can upload files himself but I'm having trouble setting up a confirmation page for when he deletes a song. I am sending the info via $_GET in a <a href="..."> tag. [code]echo "<a href=\"del_music.php?trackname=".$trname."\">Delete Song</a>";[/code] My delete page looks like this [code]<? $trackname = $_GET['trackname']; $dir2 = ('uploads/music/'); $dir3 = ('uploads/mp3/'); $delete_music = $dir2 . $trackname . ".txt"; $delete_mp3 = $dir3 . $trackname . ".mp3"; if(isset($_POST['yes'])){ unlink($delete_music); unlink ($delete_mp3); if(!file_exists($delete_music)){ echo "<div id =\"box\" align=\"center\">The song \"".$trackname."\" has been deleted! <a href=\"manage_music.php\">Back</a></div>"; } }else{ if(isset($_POST['no'])){ header ('Location: manage_music.php'); exit(); } } require ('templates/edit_head.html'); ?> <div id="box" align="center"> <p>Are you sure you want to delete: <?= $trackname ?> ?</p> <form action="<?= $_SERVER['PHP_SELF'] ?>" method="post"> <input type="submit" name="yes" value="Yes" /> <input type="submit" name="no" value="No" /> </form> </div>[/code] Every time I push yes, I get the error msg: [code] Warning: unlink(uploads/music/.txt) [function.unlink]: No such file or directory in C:\wamp\www\Apollo2\del_music.php on line 12 Warning: unlink(uploads/mp3/.mp3) [function.unlink]: No such file or directory in C:\wamp\www\Apollo2\del_music.php on line 13[/code]
  6. I have a script that writes link info to a text file, this script reads and displays the information. Everything works bit I get this error  msg [b]Notice[/b]:Undefined index: 1 in [b]c:\inetpub\wwwroot\file\path.php on line 44[/b] [code] $display = "file\\path.txt"; if( is_file($file($display) ) { $fp = @fopen("$display", 'rb');     while( $line = @fgetcsv($fp, 100, "\t") ) {     print"<div align=\"center\"><a href=\" $line[1] \"> $line[0] </a></div>";     } } [/code]
  7. I'm building a website for a local musician. I want him to be able to update the site himself, upload/delete music, pictures and mini-profiles for his crew. The "edit_crew.php" page uploads a pic and writes information to text files in the dir "uploads/crew_files". My problem is getting the "crew.php" page to loop through the text files and display the info next to the pic. This is a modified version of a script I found on line combined with some of my own. It will display one file fine but gives me error message that the other files don't exist. I'm still new to php and I know it's probably simpler than I'm making it. Please help. (on a diffrent note, all of a sudden I can't copy and paste code in Dreamweaver 8) $dir = "uploads\\crew_files"; if (is_dir($dir)) { $dp = open("$dir");     while(($item = readdir($dp))  ==  true) {         if($item != "." && $item != ".." ) {         $file[] = $item;         $item_name = strtok("$item",'.');         }     }     if($pd == true ) {     closedir($dp);     } } for($i=0, $i<count($file); $i++ ) { $npart = $file[$i];     if(is_file($npart) ) {     $fp = fopen("$npart", 'rb');         if($line = fgetcsv($fp, 100, "\t")){         echo "<div id=\"crew">                 <table width=\"400px\">                 <tr><td rowspan=\"4\"><img src=\"upload/crew_pix/$item_name.jpeg\"></td>                         <td>$line[0]</td></tr>                 <tr><td>$line[1]</td></tr>                 <tr><td>$line[2]</td></tr>                 <tr><td>$line[3]</td></tr>                 </table>                 </div> ";         }     } } // mabee i'm on the wrong track
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.