On this code $appendPath was created for myFieldName['filename']
How would I add $appendimagePath to this code for myFieldName['visual'] ?

    $result = mysql_query($sql);
    //print $sql;
    if($result){
        $line = mysql_fetch_assoc($result);
        $myFile = $line[$myFieldName['filename']];
        if(file_exists($myFile)){
            pushfile($myFile, $action);
        } else {
            echo ("&retval=error 1 : file doesn't exist"."  ".$_REQUEST['theID']);
        }
    } else {
        echo "&retval=error 2 : No results from query!";
    }
    exit;


} else {


    $count=0;
    $sendback = "";
    $AmyDataSetup = array();
    $AqueryValues = explode("|", $queryValue);
    for($i=0;$i<sizeof($AqueryValues);$i++){
        $query = "SELECT * FROM ".$table_files." WHERE file like '%.mp3' ";
        $result = mysql_query($query);
        if($result){
            while ($line = mysql_fetch_assoc($result)) {
                $lineClean = array();
                foreach($line as $key=>$value){
                    if($count==0){
                        array_push($AmyDataSetup, $key);
                    }
                    if($key == $myFieldName['filename']){
                        if($forceTrailingSlash){
                            $myFile = forceTrailingSlash($appendPath).$value;
                        } else {
                            $myFile = @$appendPath.$value;
                        }
                        if(@$appendField != ''){
                            if($forceTrailingSlash){
                                $myFile = forceTrailingSlash(@$line[@$appendField]).$value;
                            } else {
                                $myFile = @$line[@$appendField].$value;
                            }

                        }
                        $lineClean[] = rawurlencode($myFile);
                    } else {
                        $lineClean[] = rawurlencode($value);
                    }
                }
                $sendback .= "&item$count=".implode("|", $lineClean);
                $count++;
            }
        }
    }

    $myDataSetup = implode("|", $AmyDataSetup);
    @mysql_free_result($result);
    mysql_close($link);
    $sendback .= "&totalitems=$count";
    $sendback .= "&datasetup=$myDataSetup";
    $sendback .= "&my_filename=".$myFieldName['filename'];
    $sendback .= "&my_artist=".$myFieldName['artist'];
    $sendback .= "&my_title=".$myFieldName['title'];
    $sendback .= "&my_visual=".$myFieldName['visual'];
    $sendback .= "&my_link=".$myFieldName['link'];
    $sendback .= "&my_id=".$myFieldName['uniqueID'];
    print ("$sendback");
}

?>

Recommended Answers

All 4 Replies

Do you mean how can you concatenate $appendimagePath with myFieldName ? $visualpath = $appendimagepath.myFieldName['visual']; like that ?

Do you mean how can you concatenate $appendimagePath with myFieldName['visual']?
$visualpath = $appendimagepath.myFieldName['visual']; like that?

Thank you for responding! I was was trying concatenate but not how you did. If you take a section of the code which is

for($i=0;$i<sizeof($AqueryValues);$i++){
    $query = "SELECT * FROM ".$table_files." WHERE file like '%.mp3' ";
    $result = mysql_query($query);
    if($result){
        while ($line = mysql_fetch_assoc($result)) {
            $lineClean = array();
            foreach($line as $key=>$value){
                if($count==0){
                    array_push($AmyDataSetup, $key);
                }
                if($key == $myFieldName['filename']){
                    if($forceTrailingSlash){
                        $myFile = forceTrailingSlash($appendPath).$value;
                    } else {
                        $myFile = @$appendPath.$value;
                    }
                    if(@$appendField != ''){
                        if($forceTrailingSlash){
                            $myFile = forceTrailingSlash(@$line[@$appendField]).$value;
                        } else {
                            $myFile = @$line[@$appendField].$value;
                        }

                    }
                    $lineClean[] = rawurlencode($myFile);
                } else {
                    $lineClean[] = rawurlencode($value);
                }
            }
            $sendback .= "&item$count=".implode("|", $lineClean);
            $count++;

what the code is doing is if a url is provided to appendPath, it added it to myFieldName['filename'] so for example when it retive the file name "music.mp3" If appendPath is provided with http://example.com then it will return as http://example.com/music.mp3.

Now my question is that what is done for myFieldName['filename'], how will i do the same for myFieldName['visual'] if I provide a url for appendimagePath?

PLEASE CHECK ATTACHMENT FOR THE TWO FILES. YOU WILL UNDERSTAND EVEN BETTER

You mean appendPath will have the value http://example.com and the filename is music.mp3 and you want to append those 2 ? $path=$appendPath."/".$filename; If that's not what you want, could you explain your question a lil better?

You mean appendPath will have the value http://example.com and the filename is music.mp3 and you want to append those 2 ? $path=$appendPath."/".$filename; If that's not what you want, could you explain your question a lil better?

Thank you every much for you help! Can you please take a look at the two files I uploaded. If you look at file wimpy.sql.ed.configs.php you will see $appendPath. Now if you look at wimpy.sql.ed.php you will see $appendPath is meant for $myField_File or $myFieldName. Now how would I add $appendimagePath meant for $myField_Image or $myFieldName

Remember that in the script (wimpy.sql.ed.configs.php)

$myFieldName = @$myField_File;
$myFieldName = @$myField_Image;

but basically I want to add $appendimagePath where I can put a url like I can for $appendPath

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.