Re: Re: Creating file name with $variable

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, 21 Sep 2009 00:43:24 +0200
"Ralph Deffke" <ralph_deffke@xxxxxxxx> wrote:

> Hi Haig,
> 
> it would be better if u tell us what purpose u want to solf with this
> approuch. Its hard to understand for a prov why u want to create a
> filename .php
> .php files are scrips containing functions or classes,
> called/instantinated with parameters.
> why the hell u want to create a filename with these parameters? does
> this file excist?
> you can create 'dynamic code' in php, but u would never write it to a
> file!
> 
> understand that that question is wierd and appears that ur concept is
> wild and realy sick.
> 
> ralph_deffke@xxxxxxxx

Hi Ralph,

First, please don't top-post.

Second, please use complete words. 'u' is not a word.

Third, I have no idea why you feel that such an knee-jerk reaction and
abusive post would be helpful or useful. If you have nothing to add to
the conversation, do not post. 

> "Haig Davis" <level510@xxxxxxxxx> wrote in message
> news:46C80589-5A86-4C10-8F23-389A619BF580@xxxxxxxxxxxx
> > Good Afternoon All,
> >
> > Thanks for the help with the checkbox issue the other day.
> >
> > Todays question: I want to create a filename.php from a variable
> > more specifically the results if a mySQL query I.e. userID +
> > orderNumber = filename. Is this possible? 'cause I've tried every
> > option I can think of and am not winng.
> >
> > Thanks a ton
> >
> > Haig

Hi Haig,

Yes, this is possible; there is nothing special about creating such a
file. Simply construct the filename as a string in normal PHP fashion,
and then use that filename with file_put_contents(), fopen(), or
similar, to create the file. 

It will be hard to help you further without an example (as short as you
can make it) of what you are trying to do, and an explanation of how
it's failing to do what you want it to do.

Please post a short example of the code you have which is failing, and
a longer explanation of exactly what you want to achieve, and perhaps we
can explain how to make it work or suggest a better solution to your
problem.

Ralph did get one thing right, in that it's generally better to explain
what you're trying to do instead of explaining how you're trying to do
it. There are many ways to do almost any task, so it is possible that
there is another way to do what you want which is simpler and less
error-prone.


Regards,

Torben

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux