php forum
php mysql forum
php mysql smarty
 
Topic Options
#101919 - 01/07/01 02:16 PM Print variable to file with quotes around it.
AllenAyres Offline

I type Like navaho

Registered: 03/10/00
Posts: 25580
Loc: Texas
Working on the pm's still... I am trying to get the variable to print to a private.setup file so they can be adjusted online from the browser...

Everything prints well, I am just having a difficult time getting it to print the variables with "quotes" around them ,as that is the way pm's reads them.

Code:
code:


How can I write those print statements so that when the private.setup file is written, the lines read as:
$instantmsg = "yes";
and not:
$instantmsg = yes;

gracias....

------------------
Allen

- http://www.stand318.com
_________________________
- Allen wavey
- What Drives You?

Top
#101920 - 01/07/01 02:26 PM Re: Print variable to file with quotes around it.
Mark Badolato Offline
P.I.T.A. / Programmer

Registered: 09/08/00
Posts: 836
Loc: Land O' Cactus
print FILE qq~$instantmsg = "$in{'instantmsg'}";n~;

--mark
_________________________
"Annnnnnnndd now, opening for Iron Maiden...... WYLD STALLYNS!!!" --Bill S. Preston, Esquire and Ted "Theodore " Logan

Top
#101921 - 01/07/01 02:50 PM Re: Print variable to file with quotes around it.
AllenAyres Offline

I type Like navaho

Registered: 03/10/00
Posts: 25580
Loc: Texas
Thanks Mark, for the quick response... worked perfectly...

------------------
Allen

- http://www.stand318.com
_________________________
- Allen wavey
- What Drives You?

Top
#101922 - 01/07/01 05:14 PM Re: Print variable to file with quotes around it.
zanardi Offline
Member

Registered: 05/30/00
Posts: 635
You could've just escaped the quotes. But why do more work that you have to

------------------
Powered by ZCom Bulletin Boards

Top
#101923 - 01/07/01 08:56 PM Re: Print variable to file with quotes around it.
Mark Badolato Offline
P.I.T.A. / Programmer

Registered: 09/08/00
Posts: 836
Loc: Land O' Cactus
Why escape the quotes and make it clutterd LTS (Leaning Toothpick Syndrome) when Perl provides alternate quoting mechanisms allowing you to avoid that?

--mark
_________________________
"Annnnnnnndd now, opening for Iron Maiden...... WYLD STALLYNS!!!" --Bill S. Preston, Esquire and Ted "Theodore " Logan

Top
#101924 - 01/07/01 09:05 PM Re: Print variable to file with quotes around it.
zanardi Offline
Member

Registered: 05/30/00
Posts: 635
That's why I said why do more work than you have to (referring to escaping all the quotes)

------------------
Powered by ZCom Bulletin Boards

Top
#101925 - 01/08/01 02:56 PM Re: Print variable to file with quotes around it.
Vipermad Offline
Member

Registered: 10/11/00
Posts: 344
Loc: Newport, RI
In the quest for MORE knowledge...

qq~$instantmsg = "$in{'instantmsg'}";n~;

the qq means it is quoted? and the ~ (leading and trailing denote WHAT is quoted? Thats the way I see it and was looking for confirmation is all. Back to me PERL book!!!

------------------
Tony (Vipermad) Rickard
Viper Club UBB Admin
_________________________
Tony (Vipermad) Rickard
Viper Club UBB Admin

Top
#101926 - 01/08/01 03:14 PM Re: Print variable to file with quotes around it.
zanardi Offline
Member

Registered: 05/30/00
Posts: 635
yes they are quoted strings

------------------
Powered by ZCom Bulletin Boards

Top
#101927 - 01/08/01 07:05 PM Re: Print variable to file with quotes around it.
Vipermad Offline
Member

Registered: 10/11/00
Posts: 344
Loc: Newport, RI
Thanking you! I owe you a steak dinner for that last one!!!

------------------
Tony (Vipermad) Rickard
Viper Club UBB Admin
_________________________
Tony (Vipermad) Rickard
Viper Club UBB Admin

Top



Latest Posts
[7.2.1] - Naked shoutbox
by bellaonline
05/05/12 05:00 PM
[7.x] Stop Forum Spam Integration v0.4
by bellaonline
05/05/12 03:53 PM
Shout Box

(Views)Popular Topics
Known public proxy servers 1689885
Integrated Index Page (IIP) 5.3.1 555705
Finished-[6.5.2] Games Arcade Deluxe v1.9 501236
Integrated Index Page (IIP) 5.1.1 415112
TLD Bv2.1 Released - Threads Links Directory 396822
[6.0x] Who's Online 4.0.0 [Finished] 389412
Finished-[6.5.1] Integrated Index Page (IIP) 6.5 330423
Q & A 298663
Slash UBB 266936
[6.3.x] [beta] Hit Hack 2.0 227970
Forum Stats
13621 Members
59 Forums
37191 Topics
295716 Posts

Max Online: 686 @ 06/28/07 07:04 AM

 

 

 
fusionbb message board php hacks