NamePros
Welcome, Guest! Ready to make a name for yourself in the domain business? We welcome both the hobbyist and professional domainer to join the discussion as part of the NamePros community.

Click here to create your profile to start earning reputation for posting, and trader ratings for buying & selling in our free e-marketplace. Build your trader rating with each successful sale. Our system has tracked over 100,000 sales and counting!
FAQ & TOS Register Search Today's Posts Mark Forums Read

Go Back   NamePros.com > Website Development Discussion Forums > Programming
Reload this Page String and variables

Programming PHP, Perl, Ruby on Rails, AJAX, HTML, XHTML, CSS, JavaScript, MySQL and any other coding topics.

Advanced Search


Closed Thread
 
LinkBack Thread Tools
Old 10-30-2004, 06:08 AM THREAD STARTER               #1 (permalink)
Account Closed
Join Date: Sep 2003
Location: Romania
Posts: 115
lovelinuxlove is an unknown quantity at this point
 



String and variables


Hello , I got a .txt file , and inside the .txt file I got lot's of variables ... and I am reading that .txt file into a PHP program , because I would like to send it as a e-mail ... my problem is that my variables are sent as text, and not variables , someting like "Welcome on board $username" and not "Welcome on board John46"
How I can process a string ?
I know that there is a simple function for this , I even used it in the past but I forgot it , and now is so hard for me to find it again ....
lovelinuxlove is offline  
Old 10-30-2004, 11:03 AM   #2 (permalink)
NamePros Expert
 
Peter's Avatar
Join Date: Nov 2003
Location: Scotland
Posts: 5,069
Peter has a reputation beyond reputePeter has a reputation beyond reputePeter has a reputation beyond reputePeter has a reputation beyond reputePeter has a reputation beyond reputePeter has a reputation beyond reputePeter has a reputation beyond reputePeter has a reputation beyond reputePeter has a reputation beyond reputePeter has a reputation beyond reputePeter has a reputation beyond repute
 


Child Abuse Save The Children Save The Children Help The Homeless - Holiday 2009 Help The Homeless - Holiday 2009 Help The Homeless - Holiday 2009 Help The Homeless - Holiday 2009
dont know of any particular function that does that but it sounds like you need a template system such as the pear HTML_Template_IT located at http://pear.php.net/package/HTML_Template_IT

If you use 1 like this then your text file would need to be like

Welcome on board {name}

the template system would replace {name} with the persons name
__________________
Manage your portfolio using my new Domain Portfolio Management script.
Securing Your Domain Name From Theft
Peter is offline  
Old 10-31-2004, 05:26 AM   #3 (permalink)
Senior Member
Join Date: Aug 2002
Posts: 1,255
deadserious has a spectacular aura aboutdeadserious has a spectacular aura about
 



How are the variables formatted in your text file?

Are they "$var = value" or are they just a bunch of names that you need to get into variables or something else?
deadserious is offline  
Closed Thread


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools


Liquid Web Smart Servers  
All times are GMT -7. The time now is 07:34 PM.

Managed Web Hosting by Liquid Web
Domain name forum recommended by Domaining.com Powered by: vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.6.0 Ad Management plugin by RedTyger