75 users online (0 members and 75 guests)  


  Results 1 to 6 of 6

Related

  1. PHP Variable    Forum: Javascript Forum
    Replies: 3
  2. convert a perl variable to javascript variable    Forum: Javascript Forum
    Replies: 0
  3. Can I get a variable name as a string?    Forum: PHP Forum
    Replies: 2
  4. Replies: 5
  5. Replies: 0
  1. #1
    bertugolu's Avatar
    New User

    Status
    Offline
    Join Date
    Mar 2007
    Posts
    15

    Talking Problem with variable on windows

    When i assign this variable

    PHP Code:
    $target="C:\wamp\www\player\aaa\"; 
    It gives an error. Now im sure that the error is by the last \

    I wanna do that because i want to do a loop to get id3 tags from mp3's. I know how to do it, but the only prob is the \ part.

    This is the script
    PHP Code:
    <?php
            
    include 'cnt.php';

                
    $get_list=@mysql_query('SELECT * FROM test');
                
                    while (
    $row0 mysql_fetch_array($get_list1))
                    {
                    
    $target="C:\wamp\www\player\aaa\";
                    
    $filename=$row['Filename'];
                    
    $tag=id3_get_tag( "$target$filename");
                    
    $title5=$tag['title'];
                        
                    echo "
    $title";    
    ?>
    cnt.php is just a script to connect to the database...please help me...

  2. #2
    bertugolu's Avatar
    New User

    Status
    Offline
    Join Date
    Mar 2007
    Posts
    15

    Re: Problem with variable on windows

    Someone pleaseeeeeeeeeeee

  3. #3
    vinyl-junkie's Avatar
    Moderator

    Status
    Offline
    Join Date
    Sep 2005
    Posts
    721

    Re: Problem with variable on windows

    Patience, my friend. We all have lives outside of this forum.

    You're getting an error because backslashes are considered special characters and need to be escaped. Curiously enough, a backslash is the escape's special character. Thus, your code becomes:

    Code:
    $target="C:\\wamp\\www\\player\\aaa\\";
    Music Around The World - Collecting tips, trade
    and want lists, album reviews, & more

  4. #4
    DeadMeatGF's Avatar
    Moderator

    Status
    Offline
    Join Date
    Sep 2005
    Posts
    381

    Re: Problem with variable on windows

    Quote Originally Posted by vinyl-junkie View Post
    Patience, my friend. We all have lives outside of this forum.
    You don't, you were a cyber-child, born on the forums

  5. #5
    vinyl-junkie's Avatar
    Moderator

    Status
    Offline
    Join Date
    Sep 2005
    Posts
    721

    Re: Problem with variable on windows

    Quote Originally Posted by DeadMeatGF View Post
    You don't, you were a cyber-child, born on the forums
    Ack! You've exposed my secret!
    Music Around The World - Collecting tips, trade
    and want lists, album reviews, & more

  6. #6
    bertugolu's Avatar
    New User

    Status
    Offline
    Join Date
    Mar 2007
    Posts
    15

    Thumbs up Re: Problem with variable on windows

    thanks a lot guys, owe you one xD



Tags for this Thread