Creating file name with $variable

Creating file name with $variable

am 21.09.2009 00:08:03 von Haig Davis

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

Sent from my iPhone

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

Re: Creating file name with $variable

am 21.09.2009 00:43:24 von Ralph Deffke

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@yahoo.de

"Haig Davis" wrote in message
news:46C80589-5A86-4C10-8F23-389A619BF580@gmail.com...
> 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
>
> Sent from my iPhone



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

Re: Re: Creating file name with $variable

am 21.09.2009 01:26:37 von Tommy Pham

----- Original Message ----
> From: Ralph Deffke
> To: php-general@lists.php.net
> Sent: Sunday, September 20, 2009 3:43:24 PM
> Subject: [PHP] Re: Creating file name with $variable
>
> 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@yahoo.de
>
> "Haig Davis" wrote in message
> news:46C80589-5A86-4C10-8F23-389A619BF580@gmail.com...
> > 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
> >
> > Sent from my iPhone
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php

Perhaps he's trying to do URL rewrite without the URL rewrite?


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

Re: Re: Creating file name with $variable

am 21.09.2009 10:52:07 von Lars Torben Wilson

On Mon, 21 Sep 2009 00:43:24 +0200
"Ralph Deffke" 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@yahoo.de

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" wrote in message
> news:46C80589-5A86-4C10-8F23-389A619BF580@gmail.com...
> > 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