Page 1 of 1

assigning the \ to a variable

Posted: Thu Jul 14, 2005 4:45 pm
by kingconnections
ok so i am trying to make some dynamic code for a dynamic folder structure.
All i am really trying to do is have this:

c:\logs\July\filename

so here is my code:

Code: Select all

// get the date and time
$test_today = time();

// pulls out july
$today_filename2 = date( 'F', $test_today);

// puts file name in proper format
$today_filename = date( 'm_d_y', $test_today);

// the reason these are single quotes is because i have a path with spaces in the variable

$filename = 'c:\logs\';


$filename .="$today_filename2";

$filename .= "\Logfile_";
 
$filename .="$today_filename";
$filename .="P.csv";
echo"<br>";

Ok so here is the problem


this line

Code: Select all

$filename = 'c:\logs\';
no worky!

but this

Code: Select all

$filename = 'c:\logs';
works


but I can't get the stupid \ that I need in there for the right path

please help!

Thanks


Dan

JCART | Please use

Code: Select all

tags when posting php code. Review [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url][/color] dynamic folder structure.  
All i am really trying to do is have this:

c:\logs\July\filename

so here is my code:

Code: Select all

// get the date and time
$test_today = time();

// pulls out july
$today_filename2 = date( 'F', $test_today);

// puts file name in proper format
$today_filename = date( 'm_d_y', $test_today);

// the reason these are single quotes is because i have a path with spaces in the variable

$filename = 'c:\logs\';


$filename .=&quote;$today_filename2&quote;;

$filename .= &quote;\Logfile_&quote;;
 
$filename .=&quote;$today_filename&quote;;
$filename .=&quote;P.csv&quote;;
echo&quote;&lt;br&gt;&quote;;

Ok so here is the problem


this line

Code: Select all

$filename = 'c:\logs\';
no worky!

but this

Code: Select all

$filename = 'c:\logs';
works


but I can't get the stupid \ that I need in there for the right path

please help!

Thanks


Dan

eally trying to do is have this:

c:\logs\July\filename

so here is my code:

Code: Select all

// get the date and time
$test_today = time();

// pulls out july
$today_filename2 = date( 'F', $test_today);

// puts file name in proper format
$today_filename = date( 'm_d_y', $test_today);

// the reason these are single quotes is because i have a path with spaces in the variable

$filename = 'c:\logs\';


$filename .="$today_filename2";

$filename .= "\Logfile_";
 
$filename .="$today_filename";
$filename .="P.csv";
echo"<br>";

Ok so here is the problem


this line

Code: Select all

$filename = 'c:\logs\';
no worky!

but this

Code: Select all

$filename = 'c:\logs';
works


but I can't get the stupid \name

so here is my code:

Code: Select all

// get the date and time
$test_today = time();

// pulls out july
$today_filename2 = date( 'F', $test_today);

// puts file name in proper format
$today_filename = date( 'm_d_y', $test_today);

// the reason these are single quotes is because i have a path with spaces in the variable

$filename = 'c:\logs\';


$filename .="$today_filename2";

$filename .= "\Logfile_";
 
$filename .="$today_filename";
$filename .="P.csv";
echo"<br>";

Ok so here is the problem


this line

Code: Select all

$filename = 'c:\logs\';
no worky!

but this

Code: Select all

$filename = 'c:\logs';
works


but I can't get the stupid \ that I need in there for the right path


c:\logs\July\filename

so here is my code:

Code: Select all

// get the date and time
$test_today = time();

// pulls out july
$today_filename2 = date( 'F', $test_today);

// puts file name in proper format
$today_filename = date( 'm_d_y', $test_today);

// the reason these are single quotes is because i have a path with spaces in the variable

$filename = 'c:\logs\';


$filename .="$today_filename2";

$filename .= "\Logfile_";
 
$filename .="$today_filename";
$filename .=&to make some dynamic code for a dynamic folder structure.  
All i am really trying to do is have this:

c:\logs\July\filename

so here is my code:

Code: Select all

// get the date and time
$test_today = time();

// pulls out july
$today_filename2 = date( 'F', $test_today);

// puts file name in proper format
$today_filename = date( 'm_d_y', $test_today);

// the reason these are single quotes is because i have a path with spaces in the variable

$filename = 'c:\logs\';


$filename .=&quote;$today_filename2&quote;;

$filename .= &quote;\Logfile_&quote;;
 
$filename .=&quote;$today_filename&quote;;
$filename .=&quote;P.csv&quote;;
echo&quote;&lt;br&gt;&quote;;

Ok so here is the problem


this line

Code: Select all

$filename = 'c:\logs\';
no worky!

but this

Code: Select all

$filename = 'c:\logs';
works


but I can't get the stupid \ that I need in there for the right path

please help!

Thanks


Dan

JCART | Please use

Code: Select all

tags when posting php code. Review [url=http://forums.devnetwork.net/viewtopic.phpto make some dynamic code for a dynamic folder structure.  
All i am really trying to do is have this:

c:\logs\July\filename

so here is my code:

Code: Select all

// get the date and time
$test_today = time();

// pulls out july
$today_filename2 = date( 'F', $test_today);

// puts file name in proper format
$today_filename = date( 'm_d_y', $test_today);

// the reason these are single quotes is because i have a path with spaces in the variable

$filename = 'c:\logs\';


$filename .="$today_filename2";

$filename .= "\Logfile_";
 
$filename .="$today_filename";
$filename .="P.csv";
echo"<br>";

Ok so here is the problem


this line

Code: Select all

$filename = 'c:\logs\';
no worky!

but this

Code: Select all

$filename = 'c:\logs';
works


but I can't get the stupid \ that I need in there for the right path

please help!

Thanks


Dan

JCART | Please use

Code: Select all

tags when posting php code. Review [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url][/color]lename .="$today_filename";
$filename .="P.csv";
echo"<br>";

Ok so here is the problem


this line

Code: Select all

$filename = 'c:\logs\';
no worky!

but this

Code: Select all

$filename = 'c:\logs';
works


but I can't get the stupid \ that I need in there for the right path

please help!

Thanks


Dan

JCART | Please use

Code: Select all

tags when posting php code. Review [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url][/color] 'c:\logs\';
no worky!

but this

Code: Select all

$filename = 'c:\logs';
works


but I can't get the stupid \ that I need in there for the right path

please help!

Thanks


Dan

JCART | Please use

Code: Select all

tags when posting php code. Review [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url][/color:6f05really trying to do is have this:

c:\logs\July\filename

so here is my code:

Code: Select all

// get the date and time
$test_today = time();

// pulls out july
$today_filename2 = date( 'F', $test_today);

// puts file name in proper format
$today_filename = date( 'm_d_y', $test_today);

// the reason these are single quotes is because i have a path with spaces in the variable

$filename = 'c:\logs\';


$filename .="$today_filename2";

$filename .= "\Logfile_";
 
$filename .="$today_filename";
$filename .="P.csv";
echo"<br>";

Ok so here have this:

c:\logs\July\filename

so here is my code:

Code: Select all

// get the date and time
$test_today = time();

// pulls out july
$today_filename2 = date( 'F', $test_today);

// puts file name in proper format
$today_filename = date( 'm_d_y', $test_today);

// the reason these are single quotes is because i have a path with spaces in the variable

$filename = 'c:\logs\';


$filename .="$today_filename2";

$filename .= "\Logfile_";
 
$filename .="$today_filename";
$filename .="P.csv";
echo"<br>";

Ok so here is the problem


this line

Code: Select all

$filename = 'c:\logs\';[/php:1:6f05729d folder structure.  
All i am really trying to do is have this:

c:\logs\July\filename

so here is my code:

Code: Select all

// get the date and time
$test_today = time();

// pulls out july
$today_filename2 = date( 'F', $test_today);

// puts file name in proper format
$today_filename = date( 'm_d_y', $test_today);

// the reason these are single quotes is because i have a path with spaces in the variable

$filename = 'c:\logs\';


$filename .=&quote;$today_filename2&quote;;

$filename .= "\Logfile_";
 
$filename .="$today_filename";
$filename .="P.csv";
echo"<br>";

Ok so here is the problem


this line

Code: Select all

$filename = 'c:\logs\';
no worky!

but this

Code: Select all

$filename = 'c:\logs';
works


but I can't get the stupid \ that I need in there for the right path

please help!

Thanks


Dan

[b:6f0 time
$test_today = time();

// pulls out july
$today_filename2 = date( 'F', $test_today);

// puts file name in proper format
$today_filename = date( 'm_d_y', $test_today);

// the reason these are single quotes is because i have a path with spaces in the variable

$filename = 'c:\logs\';


$filename .=&quote;$today_filename2&quote;;

$filename .= &quote;\Logfile_&quote;;

$filename .=&quote;$today_filename&quote;;
$filename .=&quote;P.csv&quote;;
echo&quote;&lt;br&gt;&quote;;


Ok so here is the problem


this line

Code: Select all

$filename = 'c:\logs\';
no worky!

but this

Code: Select all

$filename = 'c:\logs';
works


but I can't get the stupid \ that I need in there for the right path

please help!

Thanks


Dan

JCART | Please use

Code: Select all

tags when posting php code. Review [url=http://forums.devnetwo', $test_today);

// the reason these are single quotes is because i have a path with spaces in the variable

$filename = 'c:\logs\';


$filename .="$today_filename2";

$filename .= "\Logfile_";
 
$filename .="$today_filename";
$filename .="P.csv";
echo"<br>";

Ok so here is the problem


this line

Code: Select all

$filename = 'c:\logs\';
no worky!

but this

Code: Select all

$fildynamic code for a dynamic folder structure.  
All i am really trying to do is have this:

c:\logs\July\filename

so here is my code:

Code: Select all

// get the date and time
$test_today = time();

// pulls out july
$today_filename2 = date( 'F', $test_today);

// puts file name in proper format
$today_filename = date( 'm_d_y', $test_today);

// the reason these are single quotes is because i have a path with spaces in the variable

$filename = 'c:\logs\';


$filename .="$today_filename2";

$filename .= "\Logfile_";
 
$filename .="$today_filename";
$filename .="P.csv";
echo"<br>";

Ok so here is the problem


this line

Code: Select all

$filename = 'c:\logs\';
no worky!

but this

Code: Select all

$filename = 'c:\logs';
works


but I can't get the stupid \ that I need in there for the right path

please help!

Thanks


Dan

JCART | Please use

Code: Select all

tags when posting php code. Review [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url][/color]ename2 = date( 'F', $test_today);

// puts file name in proper format
$today_filename = date( 'm_d_y', $test_today);

// the reason these are single quotes is because i have a path with spaces in the variable

$filename = 'c:\logs\';


$filename .="$today_filename2";

$filename .= "\Logfile_";
 
$filename .="$today_filename";
$filename .="P.csv";
echo"<br>";

Ok so here is the problem


this line

Code: Select all

$filename = 'c:\logs\';
no worky!

but this

Code: Select all

$filename = 'c:\logs';
works


but I can't get the stupid \ that I need in there for the right path

please help!

Thanks


Dan

JCART | Please use

Code: Select all

tags when posting php code. Review [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/he reason these are single quotes is because i have a path with spaces in the variable

$filename = 'c:\logs\';


$filename .="$today_filename2";

$filename .= "\Logfile_";
 
$filename .="$today_filename";
$filename .="P.csv";
echo"<br>";

Ok so here is the problem


this line

Code: Select all

$filename = 'c:\logs\';
no worky!

but this

Code: Select all

$filename = 'c:\logs';
works


but I can't get the stupid \ that I need in there for the right path

please help!

Thanks


Dan

JCART | Please use

Code: Select all

tags when posting php code. Review [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url][/color]Ok so here is the problem


this line

Code: Select all

$filename = 'c:\logs\';
no worky!

but this

Code: Select all

$filename = 'c:\logs';
works


but I can't get the stupid \ that I need in there for the right path

please help!

Thanks


Dan

JCART | Please use

Code: Select all

tags when posting php code. Review [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url][/color]_today = time();

// pulls out july
$today_filename2 = date( 'F', $test_today);

// puts file name in proper format
$today_filename = date( 'm_d_y', $test_today);

// the reason these are single quotes is because i have a path with spaces in the variable

$filename = 'c:\logs\';


$filename .="$today_filename2";

$filename .= "\Logfile_";
 
$filename .="$today_filename";
$filename .="P.csv";
echo"<br>";

Ok so here is the problem


this line

Code: Select all

$filename = 'c:\logs\';
no worky!

but this

Code: Select all

$filename = 'c:\logs';
works


but I can't get the stupid \ that I need in there for the right path

please help!

Thanks


Dan

[today);

// puts file name in proper format
$today_filename = date( 'm_d_y', $test_today);

// the reason these are single quotes is because i have a path with spaces in the variable

$filename = 'c:\logs\';


$filename .="$today_filename2";

$filename .= "\Logfile_";

$filename .="$today_filename";
$filename .="P.csv";
echo"<br>";


Ok so here is the problem


this line

Code: Select all

$filename = 'c:\logs\';
no worky!

but this

Code: Select all

$filename = 'c:\logote;\Logfile_";
 
$filename .="$today_filename";
$filename .="P.csv";
echo"<br>";

Ok so here is the problem


this line

Code: Select all

$filename = 'c:\logs\';
no worky!

but this

Code: Select all

$filename = 'c:\logs';
works


but I can't get the stupid \ that I need in there for the right path

please help!

Thanks


Dan

JCART | Please use

Code: Select all

tags when posting php code. Revito make some dynamic code for a dynamic folder structure.  
All i am really trying to do is have this:

c:\logs\July\filename

so here is my code:

Code: Select all

// get the date and time
$test_today = time();

// pulls out july
$today_filename2 = date( 'F', $test_today);

// puts file name in proper format
$today_filename = date( 'm_d_y', $test_today);

// the reason these are single quotes is because i have a path with spaces in the variable

$filename = 'c:\logs\';


$filename .="$today_filename2";

$filename .= "\Logfile_";
 
$filename .="$today_filename";
$filename .="P.csv";
echo"<br>";

Ok so here is the problem


this line

Code: Select all

$filename = 'c:\logs\';
no worky!

but this
[php:1:6f057have a path with spaces in the variable

$filename = 'c:\logs\';


$filename .="$today_filename2";

$filename .= "\Logfile_";

$filename .="$today_filename";
$filename .="P.csv";
echo"<br>";


Ok so here is the problem


this line

Code: Select all

$filename = 'c:\logs\';
no worky!

but this

Code: Select all

$filename = 'c:\logs';
works


but I can't get the stupid \ that I need in there for the right path

please help!

Thanks


Dan

JCART | Please use

Code: Select all

tags when posting php code. Review [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url][/color] a dynamic folder structure.  
All i am really trying to do is have this:

c:\logs\July\filename

so here is my code:

Code: Select all

// get the date and time
$test_today = time();

// pulls out july
$today_filename2 = date( 'F', $test_today);

// puts file name in proper format
$today_filename = date( 'm_d_y', $test_today);

// the reason these are single quotes is because i have a path with spaces in the variable

$filename = 'c:\logs\';


$filename .=&quote;$today_filename2&quote;;

$filename .= &quote;\Logfile_&quote;;
 
$filename .=&quote;$today_filename&quote;;
$filename .=&quote;P.csv&quote;;
echo&quote;&lt;br&gt;&quote;;

Ok so here is the problem


this line

Code: Select all

$filename = 'c:\logs\';
no worky!

but this

Code: Select all

$filename = 'c:\logs';
works


but I can't get the stupid \ that I need in there for the right path

please help!

Thanks


Dan

JCART | Please use

Code: Select all

tags when posting php code. Review [url=http://forums.devnetwork.net/viewtopic.php/ get the date and time
$test_today = time();

// pulls out july
$today_filename2 = date( 'F', $test_today);

// puts file name in proper format
$today_filename = date( 'm_d_y', $test_today);

// the reason these are single quotes is because i have a path with spaces in the variable

$filename = 'c:\logs\';


$filename .="$today_filename2";

$filename .= "\Logfile_";
 
$filename .="$today_filename";
$filename .="P.csv";
echo"<br>";

Ok so here is the problem


this line

Code: Select all

$filename = 'c:\logs\';
no worky!

but this

Code: Select all

$filename = 'c:\logs';
works


but I can't get the stupid \ that I need in there for the right path

please help!

Thanks


Dan

JCART | Please use

Code: Select all

tags when posting php code. Review [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url][/color]or a dynamic folder structure.  
All i am really trying to do is have this:

c:\logs\July\filename

so here is my code:

Code: Select all

// get the date and time
$test_today = time();

// pulls out july
$today_filename2 = date( 'F', $test_today);

// puts file name in proper format
$today_filename = date( 'm_d_y', $test_today);

// the reason these are single quotes is because i have a path with spaces in the variable

$filename = 'c:\logs\';


$filename .=&quote;$today_filename2&quote;;

$filename .= &quote;\Logfile_&quote;;
 
$filename .=&quote;$today_filename&quote;;
$filename .=&quote;P.csv&quote;;
echo&quote;&lt;br&gt;&quote;;

Ok so here is the problem


this line

Code: Select all

$filename = 'c:\logs\';
no worky!

but this

Code: Select all

$filename = 'c:\logs';
works


but I can't get the stupid \ that I need in there for the right path

pleapulls out july
$today_filename2 = date( 'F', $test_today);

// puts file name in proper format
$today_filename = date( 'm_d_y', $test_today);

// the reason these are single quotes is because i have a path with spaces in the variable

$filename = 'c:\logs\';


$filename .="$today_filename2";

$filename .= &quote;\Logfile_&quote;;

$filename .=&quote;$today_filename&quote;;
$filename .="P.csv";
echo"<br>";


Ok $test_today = time();

// pulls out july
$today_filename2 = date( 'F', $test_today);

// puts file name in proper format
$today_filename = date( 'm_d_y', $test_today);

// the reason these are single quotes is because i have a path with spaces in the variable

$filename = 'c:\logs\';


$filename .="$today_filename2&quote;;

$filename .= &quote;\Logfile_&quote;;

$filename .=&quote;$today_filename&quote;;
$filename .=&quote;P.csv&quote;;
echo&quote;&lt;br&gt;&quote;;


Ok so here is the problem


this line

Code: Select all

$filename = 'c:\logs\';
no worky!

but this

Code: Select all

$filename = 'c:\logs';
works


but I can't get the stupid \ that I need in there for the right path

please help!

Thanks


Dan

JCART | Please use

Code: Select all

tags when posting php code. Review [url=http://forumswith spaces in the variable

$filename = 'c:\logs\';


$filename .="$today_filename2&quote;;

$filename .= &quote;\Logfile_&quote;;
 
$filename .=&quote;$today_filename&quote;;
$filename .="P.csv";
echo"<br>";

Ok so here is the problem


this line

Code: Select all

$file( 'm_d_y', $test_today);

// the reason these are single quotes is because i have a path with spaces in the variable

$filename = 'c:\logs\';


$filename .="$today_filename2";

$filename .= "\Logfile_";
 
$filename .="$today_filename";
$filename .="P.csv";
echo"<br>";

Ok so here is the problem


this line

Code: Select all

$filename = 'c:\logs\';[/php:1:6f0572o is have this:

c:\logs\July\filename

so here is my code:

Code: Select all

// get the date and time
$test_today = time();

// pulls out july
$today_filename2 = date( 'F', $test_today);

// puts file name in proper format
$today_filename = date( 'm_d_y', $test_today);

// the reason these are single quotes is because i have a path with spaces in the variable

$filename = 'c:\logs\';


$filename .="$today_filename2";

$filename .= "\Logfile_";
 
$filename .="$today_filename";
$filename .="P.csv";
echo"<br>";

Ok so here is the problem


this line

Code: Select all

$filename = 'c:\logs\';
no worky!

but this

Code: Select all

$filename = 'c:\logs';
works


but I can't get the stupid \ that I need in there for the right path

please help!

Thanks


Dan

JCART | Please use

Code: Select all

tags when posting php code. Review [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url][/color]namic code for a dynamic folder structure.  
All i am really trying to do is have this:

c:\logs\July\filename

so here is my code:

Code: Select all

// get the date and time
$test_today = time();

// pulls out july
$today_filename2 = date( 'F', $test_today);

// puts file name in proper format
$today_filename = date( 'm_d_y', $test_today);

// the reason these are single quotes is because i have a path with spaces in the variable

$filename = 'c:\logs\';


$filename .="$today_filename2";

$filename .= "\Logfile_";
 
$filename .="$today_filename";
$filename .="P.csv";
echo"<br>";

Ok so here is the problem


this line

Code: Select all

$filename = 'c:\logs\';
no worky!

but this

Code: Select all

$filename = 'c:\logs';
works


but I can't get the stupid \ that I need in there for the right path

please help!

Thanks


Dan

JCART | Please use

Code: Select all

tags when posting php code. Review [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url][/color]ason these are single quotes is because i have a path with spaces in the variable

$filename = 'c:\logs\';


$filename .="$today_filename2";

$filename .= "\Logfile_";
 
$filename .="$today_filename";
$filename .="P.csv";
echo"<br>";

Okto make some dynamic code for a dynamic folder structure.
All i am really trying to do is have this:

c:\logs\July\filename

so here is my code:

Code: Select all

// get the date and time
$test_today = time();

// pulls out july
$today_filename2 = date( 'F', $test_today);

// puts file name in proper format
$today_filename = date( 'm_d_y', $test_today);

// the reason these are single quotes is because i have a path with spaces in the variable

$filename = 'c:\logs\';


$filename .="$today_filename2";

$filename .= "\Logfile_";
 
$filename .="$today_filename";
$filename .="P.csv";
echo"<br>";

Ok so here is the problem


this line

Code: Select all

$filename = 'c:\logs\';
no worky!

but this

Code: Select all

$filename = 'c:\logs';
works


but I can't get the stupid \ that I need in there for the right path

please help!

Thanks


Dan

JCART | Please use

Code: Select all

tags when posting php code. Review [url=http://forums.devnetwork.e
$test_today = time();

// pulls out july
$today_filename2 = date( 'F', $test_today);

// puts file name in proper format
$today_filename = date( 'm_d_y', $test_today);

// the reason these are single quotes is because i have a path with spaces in the variable

$filename = 'c:\logs\';


$filename .=&quote;$today_filename2&quote;;

$filename .= &quote;\Logfile_&quote;;
 
$filename .=&quote;$today_filename&quote;;
$filename .=&quote;P.csv&quote;;
echo&quote;&lt;br&gt;&quote;;

Ok so here is the problem


this line

Code: Select all

$filename = 'c:\logs\';
no worky!

but this
[phucture.
All i am really trying to do is have this:

c:\logs\July\filename

so here is my code:

Code: Select all

// get the date and time
$test_today = time();

// pulls out july
$today_filename2 = date( 'F', $test_today);

// puts file name in proper format
$today_filename = date( 'm_d_y', $test_today);

// the reason these are single quotes is because i have a path with spaces in the variable

$filename = 'c:\logs\';


$filename .=&quote;$today_filename2&quote;;

$filename .= &quote;\Logfile_&quote;;
 
$filename .=&quote;$today_filename&quote;;
$filename .=&quote;P.csv&quote;;
echo&quote;&lt;br&gt;&quote;;

Ok so here is the problem


this line

Code: Select all

$filename = 'c:\logs\';
no worky!

but this

Code: Select all

$filename = 'c:\logs';
works


but I can't get the stupid \ that I need in there for the right path

please help!

Thanks


Dan

JCART | Please use

Code: Select all

tags when posting php code. Review [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url][/color729db6]// get the date and time
$test_today = time();

// pulls out july
$today_filename2 = date( 'F', $test_today);

// puts file name in proper format
$today_filename = date( 'm_d_y', $test_today);

// the reason these are single quotes is because i have a path with spaces in the variable

$filename = 'c:\logs\';


$filename .="$today_filename2";

$filename .= "\Logfile_";
 
$filename .="$today_filename";
$filename .="P.csv";
echo"<br>";

Ok so here is the problem


this line

Code: Select all

$filename = 'c:\logs\';
no worky!

but this

Code: Select all

$filename = 'c:\logs';
works


but I can't get the stupid \ that I need in there for the right path

please help!

Thanks


Dan

JCART | Please use

Code: Select all

tags when posting php code. Review [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url][/color]to make some dynamic code for a dynamic folder structure.  
All i am really trying to do is have this:

c:\logs\July\filename

so here is my code:

Code: Select all

// get the date and time
$test_today = time();

// pulls out july
$today_filename2 = date( 'F', $test_today);

// puts file name in proper format
$today_filename = date( 'm_d_y', $test_today);

// the reason these are single quotes is because i have a path with spaces in the variable

$filename = 'c:\logs\';


$filename .=&quote;$today_filename2&quote;;

$filename .= &quote;\Logfile_&quote;;
 
$filename .=&quote;$today_filename&quote;;
$filename .=&quote;P.csv&quote;;
echo&quote;&lt;br&gt;&quote;;

Ok so here is the problem


this line

Code: Select all

$filename = 'c:\logs\';
no worky!

but this

Code: Select all

$filename = 'c:\logs';
works


but I can't get the stupid \ that I need in there for the right path

please help!

Thanks


Dan

JCART | Pleaseet the date and time
$test_today = time();

// pulls out july
$today_filename2 = date( 'F', $test_today);

// puts file name in proper format
$today_filename = date( 'm_d_y', $test_today);

// the reason these are single quotes is because i have a path with spaces in the variable

$filename = 'c:\logs\';


$filename .=&quote;$today_filename2";

$filename .= "\Logfile_";

$filename .="$today_filename";
$filename .="P.csv";
echo"<br>";


Ok so here is the problem


this line

Code: Select all

$filename = 'c:\logs\my code:

Code: Select all

// get the date and time
$test_today = time();

// pulls out july
$today_filename2 = date( 'F', $test_today);

// puts file name in proper format
$today_filename = date( 'm_d_y', $test_today);

// the reason these are single quotes is because i have a path with spaces in the variable

$filename = 'c:\logs\';


$filename .="$today_filename2";

$filename .= "\Logfile_";
 
$filename .="$today_filename";
$filename .="P.csv";
echo"<br>";

Ok so here is the problem


this line

Code: Select all

$filename = 'c:\logs\';
no worky!

but this

Code: Select all

$filename = 'c:\logs';
works


but I can't get the stupid \ that I need in there for the right path

please help!

Thanks
ote;;

$filename .="$today_filename";
$filename .="P.csv";
echo"<br>";


Ok so here is the problem


this line

Code: Select all

$filename = 'c:\logs\';
no worky!

but this

Code: Select all

$filename = 'c:\logs';
works


but I can't get the stupid \ that I need in there for the right path

please help!

Thanks


Dan

JCART | Please use

Code: Select all

tags when posse are single quotes is because i have a path with spaces in the variable

$filename = 'c:\logs\';


$filename .="$today_filename2";

$filename .= "\Logfile_";
 
$filename .="$today_filename";
$filename .="P.csv";
echo"<br>";

Ok so here is the problem


this line

Code: Select all

$filename = 'c:\logs\';
no worky!

but this

Code: Select all

$filename = 'c:\logs';
works


but I can't get the stupid \ that I need in there for the right path

please help!

Thanks


Dan

JCART | Please use

Code: Select all

tags when posting php code. Review [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url][/color]f05729db6]// get the date and time
$test_today = time();

// pulls out july
$today_filename2 = date( 'F', $test_today);

// puts file name in proper format
$today_filename = date( 'm_d_y', $test_today);

// the reason these are single quotes is because i have a path with spaces in the variable

$filename = 'c:\logs\';


$filename .="$today_filename2";

$filename .= "\Logfile_";
 
$filename .="$today_filename";
$filename .="P.csv";
echo"<br>";

Ok so here is the problem


this line

Code: Select all

$filename = 'c:\logs\';
no worky!

but this

Code: Select all

$filename = 'c:\logs';
works


but I can't get the stupid \ that I need in there for the right path

please help!

Thanks


Dan

JCART | Please use

Code: Select all

tags when posting php code. Review [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url][/color]to make some dynamic code for a dynamic folder structure.  
All i am really trying to do is have this:

c:\logs\July\filename

so here is my code:

Code: Select all

// get the date and time
$test_today = time();

// pulls out july
$today_filename2 = date( 'F', $test_today);

// puts file name in proper format
$today_filename = date( 'm_d_y', $test_today);

// the reason these are single quotes is because i have a path with spaces in the variable

$filename = 'c:\logs\';


$filename .=&quote;$today_filename2&quote;;

$filename .= &quote;\Logfile_&quote;;
 
$filename .=&quote;$today_filename&quote;;
$filename .=&quote;P.csv&quote;;
echo&quote;&lt;br&gt;&quote;;

Ok so here is the problem


this line

Code: Select all

$filename = 'c:\logs\';
no worky!

but this

Code: Select all

$filename = 'c:\logs';
works


but I can't get the stupid \ that I need in there for the right path

please help!

Thanks


Dan

JCART | Please use

Code: Select all

tags when posting php code. Review [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Fol i am really trying to do is have this:

c:\logs\July\filename

so here is my code:

Code: Select all

// get the date and time
$test_today = time();

// pulls out july
$today_filename2 = date( 'F', $test_today);

// puts file name in proper format
$today_filename = date( 'm_d_y', $test_today);

// the reason these are single quotes is because i have a path with spaces in the variable

$filename = 'c:\logs\';


$filename .=&quote;$today_filename2&quote;;

$filename .= &quote;\Logfile_&quote;;
 
$filename .=&quote;$today_filename&quote;;
$filename .=&quote;P.csv&quote;;
echo&quote;&lt;br&gt;&quote;;

Ok so here is the problem


this line

Code: Select all

$filename = 'c:\logs\';
e for a dynamic folder structure.
All i am really trying to do is have this:

c:\logs\July\filename

so here is my code:

Code: Select all

// get the date and time
$test_today = time();

// pulls out july
$today_filename2 = date( 'F', $test_today);

// puts file name in proper format
$today_filename = date( 'm_d_y', $test_today);

// the reason these are single quotes is because i have a path with spaces in the variable

$filename = 'c:\logs\';


$filename .="$today_filename2";

$filename .= "\Logfile_";
 
$filename .="$today_filename";
$filename .="P.csv";
echo"<br>";

Ok so here is the problem


this line

Code: Select all

$filename = 'c:\logs\';
no worky!

but this

Code: Select all

$filename = 'c:\logs';
works


but I can't get the stupid \ that I need in there for the right path

please help!

Thanks


Dan

JCART | Please use

Code: Select all

tags when posting php code. Review [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url][/color]a path with spaces in the variable

$filename = 'c:\logs\';


$filename .="$today_filename2";

$filename .= "\Logfile_";
 
$filename .="$today_filename";
$filename .="P.csv";
echo"<br>";

Ok so here is the problem


this line

Code: Select all

$fil

Code: Select all

// get the date and time
$test_today = time();

// pulls out july
$today_filename2 = date( 'F', $test_today);

// puts file name in proper format
$today_filename = date( 'm_d_y', $test_today);

// the reason these are single quotes is because i have a path with spaces in the variable

$filename = 'c:\logs\';


$filename .=&quote;$today_filename2&quote;;

$filename .= &quote;\Logfile_&quote;;
 
$filename .=&quote;$today_filename&quote;;
$filename .=&quote;P.csv&quote;;
echo&quote;&lt;br&gt;&quote;;

Ok so here is the problem


this line

Code: Select all

$filename = 'c:\logs\';
no worky!

but this

Code: Select all

$filename = 'c:\logs';
works


but I can't get the stupid \ that I need in there for the right path

please help!

Thanks


Dan

Jc:\logs\July\filename

so here is my code:

Code: Select all

// get the date and time
$test_today = time();

// pulls out july
$today_filename2 = date( 'F', $test_today);

// puts file name in proper format
$today_filename = date( 'm_d_y', $test_today);

// the reason these are single quotes is because i have a path with spaces in the variable

$filename = 'c:\logs\';


$filename .="$today_filename2";

$filename .= "\Logfile_";
 
$filename .="$today_filename";
$filename .="P.csv";
echo"<br>";

Ok so here is the problem


this line

Code: Select all

$filename = 'c:\logs\';
no worky!

but this

Code: Select all

$filename = 'c:\logs';
works


but I can't get the stupid \ that I need in there for the right path

please help!

Thanks


Dan

JCART | Please use

Code: Select all

tags when posting php code. Review [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the For a dynamic folder structure.  
All i am really trying to do is have this:

c:\logs\July\filename

so here is my code:

Code: Select all

// get the date and time
$test_today = time();

// pulls out july
$today_filename2 = date( 'F', $test_today);

// puts file name in proper format
$today_filename = date( 'm_d_y', $test_today);

// the reason these are single quotes is because i have a path with spaces in the variable

$filename = 'c:\logs\';


$filename .="$today_filename2";

$filename .= "\Logfile_";
 
$filename .="$today_filename";
$filename .="P.csv";
echo"<br>";[/php1]// get the date and time
$test_today = time();

// pulls out july
$today_filename2 = date( 'F', $test_today);

// puts file name in proper format
$today_filename = date( 'm_d_y', $test_today);

// the reason these are single quotes is because i have a path with spaces in the variable

$filename = 'c:\logs\';


$filename .=&quote;$today_filename2&quote;;

$filename .= &quote;\Logfile_&quote;;
 
$filename .=&quote;$today_filename&quote;;
$filename .=&quote;P.csv&quote;;
echo&quote;&lt;br&gt;&quote;;

Ok so here is the problem


this line

Code: Select all

$filename = 'c:\logs\';
no worky!

but this

Code: Select all

$filename = 'c:\logs';
works


but I can't get the stupid \ that I need in there for the right path

please help!

Thanks


Dan

[color=red:6f05729dying to do is have this:

c:\logs\July\filename

so here is my code:

Code: Select all

// get the date and time
$test_today = time();

// pulls out july
$today_filename2 = date( 'F', $test_today);

// puts file name in proper format
$today_filename = date( 'm_d_y', $test_today);

// the reason these are single quotes is because i have a path with spaces in the variable

$filename = 'c:\logs\';


$filename .="$today_filename2";

$filename .= "\Logfile_";
 
$filename .="$today_filename";
$filename .="P.csv";
echo"<br>";

Ok so here is the problem


this line

Code: Select all

$filename = 'c:\logs\';
no worky!

but this

Code: Select all

$filename = 'c:\logs';
works


but I can't get the stupid \ that I need in there for the right path

please help!

Thanks


Dan

JCART | Please use

Code: Select all

tags when posting php code. Review [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url][/color]cause i have a path with spaces in the variable

$filename = 'c:\logs\';


$filename .="$today_filename2";

$filename .= "\Logfile_";
 
$filename .="$today_filename";
$filename .="P.csv";
echo"<br>";

Ok so here is the problem


this line

Code: Select all

$filename = 'c:\logs\';
no worky!

but this

Code: Select all

$filename = 'c:\logs';
works


but I can't get the stupid \ that I need in there for the right patoday);

// the reason these are single quotes is because i have a path with spaces in the variable

$filename = 'c:\logs\';


$filename .=&quote;$today_filename2&quote;;

$filename .= &quote;\Logfile_&quote;;

$filename .=&quote;$today_filename&quote;;
$filename .=&quote;P.csv&quote;;
echo&quote;&lt;br&gt;&quote;;


Ok so here is the problem


this line

Code: Select all

$filename = 'c:\logs\';
no worky!

but this

Code: Select all

lename

so here is my code:

Code: Select all

// get the date and time
$test_today = time();

// pulls out july
$today_filename2 = date( 'F', $test_today);

// puts file name in proper format
$today_filename = date( 'm_d_y', $test_today);

// the reason these are single quotes is because i have a path with spaces in the variable

$filename = 'c:\logs\';


$filename .="$today_filename2";

$filename .= "\Logfile_";
 
$filename .="$today_filename";
$filename .="P.csv";
echo"<br>";

Ok so here is the problem


this line

Code: Select all

$filename = 'c5729db6]// get the date and time
$test_today = time();

// pulls out july
$today_filename2 = date( 'F', $test_today);

// puts file name in proper format
$today_filename = date( 'm_d_y', $test_today);

// the reason these are single quotes is because i have a path with spaces in the variable

$filename = 'c:\logs\';


$filename .="$today_filename2";

$filename .= "\Logfile_";
 
$filename .="$today_filename";
$filename .="P.csv";
echo"<br>";

Ok so here is the problem


this line

Code: Select all

$filename = 'c:\logs\';
no worky!

but this

Code: Select all

$filename = 'c:\logs';
works


but I can't get the stupid \ that I need in there for the right path

please help!

Thanks


Dan

JCART | Please use

Code: Select all

tags when posting php code. Review [url=http://forums.devnetwork.net/viewtopic.php?do is have this:

c:\logs\July\filename

so here is my code:

Code: Select all

// get the date and time
$test_today = time();

// pulls out july
$today_filename2 = date( 'F', $test_today);

// puts file name in proper format
$today_filename = date( 'm_d_y', $test_today);

// the reason these are single quotes is because i have a path with spaces in the variable

$filename = 'c:\logs\';


$filename .="$today_filename2";

$filename .= "\Logfile_";
 
$filename .="$today_filename";
$filename .="P.csv";
echo"<br>";

Ok so here is the problem


this line

Code: Select all

$filename = 'c:\logs\';
no worky!

but this

Code: Select all

$filename = 'c:\logs';
works


but I can't get the stupid \ that I need in there for the right path

please help!

Thanks


Dan

JCART | Please use

Code: Select all

tags when posting php cod

c:\logs\July\filename

so here is my code:

Code: Select all

// get the date and time
$test_today = time();

// pulls out july
$today_filename2 = date( 'F', $test_today);

// puts file name in proper format
$today_filename = date( 'm_d_y', $test_today);

// the reason these are single quotes is because i have a path with spaces in the variable

$filename = 'c:\logs\';


$filename .="$today_filename2";

$filename .= "\Logfile_";
 
$filename .=&quote;$today_filename&quote;;
$filename .=&quote;P.csv&quote;;
echo&quote;&lt;br&gt;&am
All i am really trying to do is have this:

c:\logs\July\filename

so here is my code:

Code: Select all

// get the date and time
$test_today = time();

// pulls out july
$today_filename2 = date( 'F', $test_today);

// puts file name in proper format
$today_filename = date( 'm_d_y', $test_today);

// the reason these are single quotes is because i have a path with spaces in the variable

$filename = 'c:\logs\';


$filename .="$today_filename2";

$filename .= "\Logfile_";
 
$filename .="$today_filename";
$filename .="P.csv";
echo"<br>";

Ok so here is the problem


this line

Code: Select all

$filename = 'c:\logs\';
no worlder structure.
All i am really trying to do is have this:

c:\logs\July\filename

so here is my code:

Code: Select all

// get the date and time
$test_today = time();

// pulls out july
$today_filename2 = date( 'F', $test_today);

// puts file name in proper format
$today_filename = date( 'm_d_y', $test_today);

// the reason these are single quotes is because i have a path with spaces in the variable

$filename = 'c:\logs\';


$filename .="$today_filename2";

$filename .= "\Logfile_";
 
$filename .="$today_filename";
$filename .="P.csv";
echo"<br>";

Ok so here is the problem


this line

Code: Select all

$filename = 'c:\logs\';
no worky!

but this

Code: Select all

$filename = 'c:\logs';
works


but I can't get the stupid \ that I need in there for the right path

please help!

Thank do is have this:

c:\logs\July\filename

so here is my code:

Code: Select all

// get the date and time
$test_today = time();

// pulls out july
$today_filename2 = date( 'F', $test_today);

// puts file name in proper format
$today_filename = date( 'm_d_y', $test_today);

// the reason these are single quotes is because i have a path with spaces in the variable

$filename = 'c:\logs\';


$filename .="$today_filename2";

$filename .= "\Logfile_";
 
$filename .="$today_filename";
$filename .="P.csv";
echo"<br>";[/ph]// get the date and time
$test_today = time();

// pulls out july
$today_filename2 = date( 'F', $test_today);

// puts file name in proper format
$today_filename = date( 'm_d_y', $test_today);

// the reason these are single quotes is because i have a path with spaces in the variable

$filename = 'c:\logs\';


$filename .="$today_filename2";

$filename .= "\Logfile_";
 
$filename .="$today_filename";
$filename .="P.csv";
echo"<br>";

Ok so here is the problem


this line

Code: Select all

$filename = 'c:\logs\';
no worky!

but this

Code: Select all

$filename = 'c:\logs';
works


but I can't get the stupid \ that I need in there for the right path

please help!

Thanks


Dan

JCART | Please use

Code: Select all

tags when posting n these are single quotes is because i have a path with spaces in the variable

$filename = 'c:\logs\';


$filename .="$today_filename2";

$filename .= "\Logfile_";
 
$filename .="$today_filename";
$filename .="P.csv";
echo"<br>";

Ok so here is the problem


this line

Code: Select all

$filename = 'c:\logs\';
no worky!

but this

Code: Select all

$filename = 'c:\logs';
works


but I can't get the stupid \ that I need in there for the right path

please help!

Thanks


Dan

JCART | Please use

Code: Select all

tags when posting php code. Review [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url][/color]
All i am really trying to do is have this:

c:\logs\July\filename

so here is my code:

Code: Select all

// get the date and time
$test_today = time();

// pulls out july
$today_filename2 = date( 'F', $test_today);

// puts file name in proper format
$today_filename = date( 'm_d_y', $test_today);

// the reason these are single quotes is because i have a path with spaces in the variable

$filename = 'c:\logs\';


$filename .=&quote;$today_filename2&quote;;

$filename .= &quote;\Logfile_&quote;;
 
$filename .=&quote;$today_filename";
$filename .="P.csv";
echo"<br>";[/phpructure.  
All i am really trying to do is have this:

c:\logs\July\filename

so here is my code:

Code: Select all

// get the date and time
$test_today = time();

// pulls out july
$today_filename2 = date( 'F', $test_today);

// puts file name in proper format
$today_filename = date( 'm_d_y', $test_today);

// the reason these are single quotes is because i have a path with spaces in the variable

$filename = 'c:\logs\';


$filename .="$today_filename2";

$filename .= "\Logfile_";
 
$filename .="$today_filename";
$filename .="P.csv";
echo"<br>";

Ok so here is the problem


this line

Code: Select all

$filename = 'c:\logs\';
no worky!

but this

Code: Select all

$filename = 'c:\logs';
works


but I can't get the stupid \ that I need in there for the right path

please help!

Thanks


Dan

JCART | Please use

Code: Select all

tags when posting php code. Review [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url][/color]e in proper format
$today_filename = date( 'm_d_y', $test_today);

// the reason these are single quotes is because i have a path with spaces in the variable

$filename = 'c:\logs\';


$filename .="$today_filename2";

$filename .= "\Logfile_";
 
$filename .="$today_filename";
$filename .="P.csv";
echo"<br>";[/phmic code for a dynamic folder structure.  
All i am really trying to do is have this:

c:\logs\July\filename

so here is my code:

Code: Select all

// get the date and time
$test_today = time();

// pulls out july
$today_filename2 = date( 'F', $test_today);

// puts file name in proper format
$today_filename = date( 'm_d_y', $test_today);

// the reason these are single quotes is because i have a path with spaces in the variable

$filename = 'c:\logs\';


$filename .="$today_filename2&quote;;

$filename .= &quote;\Logfile_&quote;;
 
$filename .=&quote;$today_filename&quote;;
$filename .=&quote;P.csv&quote;;
echo&quote;&lt;br&gt;&quote;;

Ok so here is the problem


this line

Code: Select all

$filename = 'c:\logs\';
no worky!

but this

Code: Select all

$filename = 'c:\logs';
works


but I can't get the stupid \ that I need in there for the right path

please help!

Thanks


Dan

JCART | Please use

Code: Select all

tags when posting php code. Review [url=http://forums.devnetoday_filename2 = date( 'F', $test_today);

// puts file name in proper format
$today_filename = date( 'm_d_y', $test_today);

// the reason these are single quotes is because i have a path with spaces in the variable

$filename = 'c:\logs\';


$filename .=&quote;$today_filename2&quote;;

$filename .= &quote;\Logfile_&quote;;
 
$filename .=&quote;$today_filename&quote;;
$filename .=&quote;P.csv&quote;;
echo&quote;&lt;br&gt;&quote;;

Ok so here is the problem


this line

Code: Select all

$filename = 'c:\logs\';
no worky!

but this

Code: Select all

$filename = 'c:\logs';
works


but I can't mic folder structure.
All i am really trying to do is have this:

c:\logs\July\filename

so here is my code:

Code: Select all

// get the date and time
$test_today = time();

// pulls out july
$today_filename2 = date( 'F', $test_today);

// puts file name in proper format
$today_filename = date( 'm_d_y', $test_today);

// the reason these are single quotes is because i have a path with spaces in the variable

$filename = 'c:\logs\';


$filename .="$today_filename2";

$filename .= "\Logfile_";
 
$filename .="$today_filename";
$filename .="P.csv";
echo"<br>";

Ok so here is the problem


this line

Code: Select all

$filename = 'c:\logs\';
no worky!

but this
[php:1:6f0572
All i am really trying to do is have this:

c:\logs\July\filename

so here is my code:

Code: Select all

// get the date and time
$test_today = time();

// pulls out july
$today_filename2 = date( 'F', $test_today);

// puts file name in proper format
$today_filename = date( 'm_d_y', $test_today);

// the reason these are single quotes is because i have a path with spaces in the variable

$filename = 'c:\logs\';


$filename .="$today_filename2";

$filename .= "\Logfile_";
 
$filename .="$today_filename";
$filename .="P.csv";
echo"<br>";

Ok so here is the problem


this line

Code: Select all

$filename = 'c:\logs\';
no worky!

but this

Code: Select all

$filename = 'c:\logs';
works


but I can't get the stupid \ tha/ pulls out july
$today_filename2 = date( 'F', $test_today);

// puts file name in proper format
$today_filename = date( 'm_d_y', $test_today);

// the reason these are single quotes is because i have a path with spaces in the variable

$filename = 'c:\logs\';


$filename .=&quote;$today_filename2&quote;;

$filename .= &quote;\Logfile_&quote;;

$filename .=&quote;$today_filename&quote;;
$filename .=&quote;P.csv&quote;;
echo"<br>";


Ok so here is the problem


this line

Code: Select all

$filename = 'c:\logs\';
no worky!

but this

Code: Select all

$filename = 'c:\logs';
works


but I can't get the stp;quote;P.csv";
echo"<br>";


Ok so here is the problem


this line

Code: Select all

$filename = 'c:\logs\';
no worky!

but this

Code: Select all

$filename = 'c:\logs';
works


but I can't get the stupid \ that I need in there for the right path

please help!

Thanks


Dan

folder structure.
All i am really trying to do is have this:

c:\logs\July\filename

so here is my code:

Code: Select all

// get the date and time
$test_today = time();

// pulls out july
$today_filename2 = date( 'F', $test_today);

// puts file name in proper format
$today_filename = date( 'm_d_y', $test_today);

// the reason these are single quotes is because i have a path with spaces in the variable

$filename = 'c:\logs\';


$filename .="$today_filename2";

$filename .= "\Logfile_";
 
$filename .="$today_filename";
$filename .="P.csv";
echo"<br>";

Ok so here is the problem


this line

Code: Select all

$filename = 'c:\logs\';
no worky!

but this

Code: Select all

$filename = 'c:\logs';
works


but I can't get the stupid \ that I need in there for the right path

please help!

Thanks


Dan

[color=red: am really trying to do is have this:

c:\logs\July\filename

so here is my code:

Code: Select all

// get the date and time
$test_today = time();

// pulls out july
$today_filename2 = date( 'F', $test_today);

// puts file name in proper format
$today_filename = date( 'm_d_y', $test_today);

// the reason these are single quotes is because i have a path with spaces in the variable

$filename = 'c:\logs\';


$filename .=&quote;$today_filename2&quote;;

$filename .= &quote;\Logfile_";
 
$filename .="$today_filename";
$filename .="P.csv&quote;;
echo&quote;&lt;br&gt;&quote;;

Ok s]// get the date and time
$test_today = time();

// pulls out july
$today_filename2 = date( 'F', $test_today);

// puts file name in proper format
$today_filename = date( 'm_d_y', $test_today);

// the reason these are single quotes is because i have a path with spaces in the variable

$filename = 'c:\logs\';


$filename .="$today_filename2&quote;;

$filename .= &quote;\Logfile_&quote;;

$filename .=&quote;$today_filename&quote;;
$filename .=&quote;P.csv&quote;;
echo&quote;&lt;br&gt;&quote;;


Ok so here is the problem


this line

Code: Select all

$filename = 'c:\logs\';
no worky!

but this

Code: Select all

$filename = 'c:\logs';
works


but I can't get the stupid \ that I need in there for the right path

please help!

Thanks


Dan

JCART | Please use

Code: Select all

tags when posting php code. Review [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url][/color]code:

Code: Select all

// get the date and time
$test_today = time();

// pulls out july
$today_filename2 = date( 'F', $test_today);

// puts file name in proper format
$today_filename = date( 'm_d_y', $test_today);

// the reason these are single quotes is because i have a path with spaces in the variable

$filename = 'c:\logs\';


$filename .="$today_filename2";

$filename .= "\Logfile_";
 
$filename .="$today_filename";
$filename .="P.csv";
echo"<br>";

Ok so here is the problem


this line [php:1:6y_filename = date( 'm_d_y', $test_today);

// the reason these are single quotes is because i have a path with spaces in the variable

$filename = 'c:\logs\';


$filename .="$today_filename2";

$filename .= "\Logfile_";

$filename .="$today_filename";
$filename .="P.csv";
echo"<br>";


Ok so here is the problem


this line

Code: Select all

$filename = 'c:\logs\';
no worky!

but this

Code: Select all

$filename = 'c:\logs';
works


but I can't get the stupid \ that I need in there for the right path

please help!

Thanks


Dan

JCART | Please use

Code: Select all

tags when posting php code. Review [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url][/color]re is my code:

Code: Select all

// get the date and time
$test_today = time();

// pulls out july
$today_filename2 = date( 'F', $test_today);

// puts file name in proper format
$today_filename = date( 'm_d_y', $test_today);

// the reason these are single quotes is because i have a path with spaces in the variable

$filename = 'c:\logs\';


$filename .="$today_filename2";

$filename .= &quote;\Logfile_&quote;;
 
$filename .=&quote;$today_filename&quote;;
$filename .=&quote;P.csv&quote;;
echo&quote;&lt;br

Posted: Thu Jul 14, 2005 4:52 pm
by Deemo
replace all your \ with \\

backslash is an escape character. so when you do \" you are basically rendering that quote usless and telling the compiler that " is a part of the path when its really the terminator of the string

Posted: Thu Jul 14, 2005 5:51 pm
by timvw
Or use / slashes for a path... It works ;)

Code: Select all

$path = 'f:/websites/test/fooooooooo.txt';
$file = file_get_contents($path);
At any given time you can display the "real path" to the user

Code: Select all

echo realpath($path);
p]
$path = 'f:/websites/test/fooooooooo.txt';
$file = file_get_contents($path);


At any given time you can display the "real path" to the user

Code: Select all

echo realpath($path);
[/php:1:779st/fooooooooo.txt';
$file = file_get_contents($path);
At any given time you can display the "real path" to the user

Code: Select all

echo realpath($path);
;


At any given time you can display the "real path" to the user

Code: Select all

echo realpath($path);
_get_contents($path);


At any given time you can display the "real path" to the user

Code: Select all

echo realpath($path);
or a path... It works ;)

Code: Select all

$path = 'f:/websites/test/fooooooooo.txt';
$file = file_get_contents($path);
At any given time you can display the "real path" to the user
[por a path... It works ;)

Code: Select all

$path = 'f:/websites/test/fooooooooo.txt';
$file = file_get_contents($path);
At any given time you can display the "real path" to the user

Code: Select all

echo realpath($path);
est/fooooooooo.txt';
$file = file_get_contents($path);


At any given time you can display the "real path" to the user

Code: Select all

echo realpath($path);
file = file_get_contents($path);


At any given time you can display the "real path" to the user

Code: Select all

echo realpath($path);
e87669]
$path = 'f:/websites/test/fooooooooo.txt';
$file = file_get_contents($path);


At any given time you can display the "real path" to the user

Code: Select all

echo realpath($path);
al path" to the user

Code: Select all

echo realpath($path);
It works ;)

Code: Select all

$path = 'f:/websites/test/fooooooooo.txt';
$file = file_get_contents($path);
At any given time you can display the "real path" to the user

Code: Select all

echo realpath($path);
);
the user

Code: Select all

echo realpath($path);
or a path... It works ;)

Code: Select all

$path = 'f:/websites/test/fooooooooo.txt';
$file = file_get_contents($path);
At any given time you can display the "real path" to the user

Code: Select all

echo realpath($path);
php]
$path = 'f:/websites/test/fooooooooo.txt';
$file = file_get_contents($path);


At any given time you can display the "real path" to the user

Code: Select all

an display the "real path" to the user

Code: Select all

echo realpath($path);

Code: Select all

$path = 'f:/websites/test/fooooooooo.txt';
$file = file_get_contents($path);
At any given time you can display the "real path" to the user

Code: Select all

echo realpath($path);
7669]
echo realpath($path);
" to the user

Code: Select all

echo realpath($path);
';
$file = file_get_contents($path);


At any given time you can display the "real path" to the user

Code: Select all

echo realpath($path);
works ;)

Code: Select all

$path = 'f:/websites/test/fooooooooo.txt';
$file = file_get_contents($path);
At any given time you can display the "real path" to the user

Code: Select all

echo realpath($path);
or a path... It works ;)

Code: Select all

$path = 'f:/websites/test/fooooooooo.txt';
$file = file_get_contents($path);
At any given time you can display the "real path" to the user

Code: Select all

echo realpath($path);
[/php:1:7793e876ath" to the user

Code: Select all

echo realpath($path);
ath = 'f:/websites/test/fooooooooo.txt';
$file = file_get_contents($path);


At any given time you can display the "real path" to the user

Code: Select all

echo realpath($path);
[/phpme you can display the "real path" to the user

Code: Select all

echo realpath($path);
or a path... It works ;)

Code: Select all

$path = 'f:/websites/test/fooooooooo.txt';
$file = file_get_contents($path);
At any given time you can display the "real path" to the user

Code: Select all

echo realpath($path);
display the "real path" to the user

Code: Select all

echo realpath($path);
69]

At any given time you can display the "real path" to the user

Code: Select all

echo realpath($path);
time you can display the "real path" to the user

Code: Select all

echo realpath($path);
or a path... It works ;)

Code: Select all

$path = 'f:/websites/test/fooooooooo.txt';
$file = file_get_contents($path);
At any given time you can display the "real path" to the user

Code: Select all

echo realpathsites/test/fooooooooo.txt';
$file = file_get_contents($path);
At any given time you can display the "real path" to the user

Code: Select all

echo realpath($path);

Code: Select all

$path = 'f:/websites/test/fooooooooo.txt';
$file = file_get_contents($path);
At any given time you can display the "real path" to the user

Code: Select all

echo realpath($path);
any given time you can display the "real path" to the user

Code: Select all

echo realpath($path);
t_contents($path);


At any given time you can display the "real path" to the user

Code: Select all

echo realpath($path);
php]
$path = 'f:/websites/test/fooooooooo.txt';
$file = file_get_contents($path);


At any given time you can display the "real path" to the user

Code: Select all

echo realpath($path);
ven time you can display the "real path" to the user

Code: Select all

echo realpath($path);
ooooo.txt';
$file = file_get_contents($path);


At any given time you can display the "real path" to the user

Code: Select all

echo realpath($path);
h);


At any given time you can display the "real path" to the user

Code: Select all

echo realpath($path);
ime you can display the "real path" to the user

Code: Select all

echo realpath($path);
t';
$file = file_get_contents($path);


At any given time you can display the "real path" to the user
[php:1:7_get_contents($path);


At any given time you can display the "real path" to the user

Code: Select all

echo realpath($path);
websites/test/fooooooooo.txt';
$file = file_get_contents($path);


At any given time you can display the "real path" to the user

Code: Select all

echo realpath($path);
669]
$path = 'f:/websites/test/fooooooooo.txt';
$file = file_get_contents($path);


At any given time you can display the "real path" to the user

Code: Select all

echo realpath($path);
xt';
$file = file_get_contents($path);


At any given time you can display the "real path" to the user

Code: Select all

echo realpath($path);
can display the "real path" to the user

Code: Select all

echo realpath($path);
websites/test/fooooooooo.txt';
$file = file_get_contents($path);


At any given time you can display the "real path" to the user

Code: Select all

echo realpath($path);
path = 'f:/websites/test/fooooooooo.txt';
$file = file_get_contents($path);


At any given time you can display the "real path" to the user

Code: Select all

echo realpath($path);
orks ;)

Code: Select all

$path = 'f:/websites/test/fooooooooo.txt';
$file = file_get_contents($path);
At any given time you can display the "real path" to the user

Code: Select all

echo realpath($path);
th($path);
793e87669]
$path = 'f:/websites/test/fooooooooo.txt';
$file = file_get_contents($path);


At any given time you can display the "real path" to the user

Code: Select all

echo realpath($path);
:/websites/test/fooooooooo.txt';
$file = file_get_contents($path);


At any given time you can display the "real path" to the user

Code: Select all

echo realpath($path);
e87669]
echo realpath($path);
87669]
$path = 'f:/websites/test/fooooooooo.txt';
$file = file_get_contents($path);


At any given time you can display the "real path" to the user

Code: Select all

echo realpath($path);
[/php:1:7793e8766es/test/fooooooooo.txt';
$file = file_get_contents($path);
At any given time you can display the "real path" to the user

Code: Select all

echo realpath($path);
en time you can display the "real path" to the user

Code: Select all

echo realpath($path);
At any given time you can display the "real path" to the user

Code: Select all

echo realpath($path);
93e87669]

At any given time you can display the "real path" to the user

Code: Select all

echo realpath($path);
t/fooooooooo.txt';
$file = file_get_contents($path);


At any given time you can display the "real path" to the user

Code: Select all

echo realpath($path);
e you can display the "real path" to the user

Code: Select all

echo realpath($path);
php]
$path = 'f:/websites/test/fooooooooo.txt';
$file = file_get_contents($path);


At any given time you can display the "real path" to the user

Code: Select all

echo realpath($path);
txt';
$file = file_get_contents($path);


At any given time you can display the "real path" to the user

Code: Select all

echo realpath($path);
$path = 'f:/websites/test/fooooooooo.txt';
$file = file_get_contents($path);


At any given time you can display the "real path" to the user

Code: Select all

echo realpath($path);

Almost the same problem

Posted: Fri Jul 15, 2005 1:46 am
by Eldis
Hiya I'm new to these boards but I've done a lot of php coding but I just cant overcome my current problem because of lack of knowledge on php strings.

So what I'm trying to do overly simplified is create a string:

Code: Select all

$test = &quote;<table class=\&quote;item\&quote;</table>&quote;;
Now naturally if I try now to view the string it appears like this :
"<table class="item"</table>"

But I would really want it to appear exactly the way I originally imputted it. So I would want my
$test variable to contain a string like "<table class=\"item\"</table>" I just have a clue what I need to do to achieve this.

If I do this:

Code: Select all

$test = &quote;<table class=\\&quote;item\\&quote;</table>&quote;;
I get errors.

Anything I could do to correct it ?

Posted: Fri Jul 15, 2005 5:24 am
by timvw
You not only need to escape " but also \

So, \\ and \" -> \\\" ->

Code: Select all

$test = "<table class=\\\"item\\\"</table>";
echo $test;
\ and \" -> \\\" ->

Code: Select all

$test = "<table class=\\\"item\\\"</table>";
echo $test;
hp]
$test = "<table class=\\\"item\\\"</table>";
echo $test;
e class=\\\"item\\\"</table>";
echo $test;
ote;<table class=\\\"item\\\"</table>";
echo $test;
to escape " but also \

So, \\ and \" -> \\\" ->

Code: Select all

$test = &quote;&lt;table class=\\\&quote;item\\\&quote;&lt;/tabto escape " but also \

So, \\ and \" -> \\\" ->

Code: Select all

$test = "<table class=\\\"item\\\"</table>";
echo $test;
php]
$test = "<table class=\\\"item\\\"</table>";
echo $test;
t = "<table class=\\\"item\\\"</table>";
echo $test;
-> \\\" ->

Code: Select all

$test = "<table class=\\\"item\\\"</table>";
echo $test;
gt;";
echo $test;
ut also \

So, \\ and \" -> \\\" ->

Code: Select all

$test = "<table class=\\\"item\\\"</table>";
echo $test;
e;;
echo $test;
to escape " but also \

So, \\ and \" -> \\\" ->

Code: Select all

$test = "<table class=\\\"item\\\"</table>";
echo $test;
\\ and \" -> \\\" ->

Code: Select all

$test = "<table class=\\\"item\\\"</table>";
echo $test;
[/php:1:6914lt;/table>";
echo $test;
o, \\ and \" -> \\\" ->

Code: Select all

$test = "<table class=\\\"item\\\"</table>";
echo $test;
];quote;;
echo $test;

$test = "<table class=\\\"item\\\"</table>";
echo $test;
also \

So, \\ and \" -> \\\" ->

Code: Select all

$test = "<table class=\\\"item\\\"</table>";
echo $test;
to escape " but also \

So, \\ and \" -> \\\" ->

Code: Select all

$test = "<table class=\\\"item\\\"</table>";
echo $test;
amp;quote;;
echo $test;
\\\" ->

Code: Select all

$test = "<table class=\\\"item\\\"</table>";
echo $test;
[/phpamp;lt;/table>";
echo $test;
to escape " but also \

So, \\ and \" -> \\\" ->

Code: Select all

$test = "<table class=\\\"item\\\"</table>";
echo $test;
/table>";
echo $test;
te;item\\\"</table>";
echo $test;
e;</table>";
echo $test;
to escape " but also \

So, \\ and \" -> \\\" ->

Code: Select all

$test = &quote;&lt;table class=\\\&quote;item\\\&quote;&lt;/table&gt;&quote;;
ech;

Code: Select all

$test = "<table class=\\\"item\\\"</table>";
echo $test;
So, \\ and \" -> \\\" ->

Code: Select all

$test = "<table class=\\\"item\\\"</table>";
echo $test;
\"</table>";
echo $test;
;<table class=\\\"item\\\"</table>";
echo $test;
\\ and \" -> \\\" ->

Code: Select all

$test = "<table class=\\\"item\\\"</table>";
echo $test;
uote;</table&gt;&quote;;
echo $test;
4a52b21]
$test = "<table class=\\\"item\\\"</table>";
echo $test;
ble class=\\\"item\\\"</table>";
echo $test;
</table>";
echo $test;

$test = "<table class=\\\"item\\\"</table>";
echo $test;

Posted: Fri Jul 15, 2005 6:05 am
by Eldis
I actually tried your suggestion and it did work but I got \\"item\\"

So the only way I got it to work the way I wanted it was to do \\"item\" I don't know why but when I checked the actual content of the string it was what I wanted. So when I did this I got \"item\"

Posted: Fri Jul 15, 2005 9:28 am
by kingconnections
Thanks guys! That worked great.


I have another question when I write my log file,if the directory does not exist it will fail out. Is there a way that I can make it so that when it writes the log file, it will create the directory if it is not there?

So basically it will always produce a log at the path that was defined?

Thanks

Dan