Help with a variable! Can't figure it out!

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
mi3x
Forum Newbie
Posts: 13
Joined: Fri Mar 06, 2009 8:52 am

Help with a variable! Can't figure it out!

Post by mi3x »

Ok so I need a name of a file to be called like this (SMITH-FR3242SDSMI.html)
SMITH stands for the first name - $Lname
FR3242SDSMI for the Transaction ID - $Tid

How can I define this variable? Because it won't work with the "-" which unifies the two. Can somebody help?

Code: Select all

$file_name=$_POST["Lname-Tid"];
Thanks! :banghead:
User avatar
Benjamin
Site Administrator
Posts: 6935
Joined: Sun May 19, 2002 10:24 pm

Re: Help with a variable! Can't figure it out!

Post by Benjamin »

Code: Select all

 
$file_name = "{$_POST['Lname']}-{$_POST['Tid']}";
 
mi3x
Forum Newbie
Posts: 13
Joined: Fri Mar 06, 2009 8:52 am

Re: Help with a variable! Can't figure it out!

Post by mi3x »

Thanks for the quick reply, but I need it with a "-"separating them. Now it gives me SMITHFR3242SMI.html and I want SMITH-FR3242SMI.html

Can this be done? Thanks again! ;D
mi3x
Forum Newbie
Posts: 13
Joined: Fri Mar 06, 2009 8:52 am

Re: Help with a variable! Can't figure it out!

Post by mi3x »

astions wrote:

Code: Select all

 
$file_name = "{$_POST['Lname']}-{$_POST['Tid']}";
 

:drunk: Voilaaa! Thanks a bunch!
Post Reply