Raised This Month: $ Target: $400
 0% 

Can't write integers to html file?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Buckshot
Senior Member
Join Date: Mar 2014
Location: Sweden
Old 03-30-2014 , 04:10   Can't write integers to html file?
Reply With Quote #1

Examples:
This works:

PHP Code:
new szString46 ]
new 
szName32 ]
get_user_nameidszname31 )
formatexszString45"<b>Your name is: %s</b>"szName )
write_file"file.html"szString, -
But not this.
PHP Code:
szString32 ]
new 
randomnum random_num1,100 )
formatexszString,  31"<b>The random number is: %s</b>"randomnum )
write_file"file.html"szString, -
Why? All i get is "The random number is:" and nothing after it as the output in the html file .. Some of the times when i tried writing integers to the html file i just got weird outputs like "© ₳" where the integer is supposed to be.. And it's the same if i write any integer into the file. It just doesn't work. Only strings. I am currently making a Chatlog, and i have to check the time of when it was logged, and send that time to the html file.. Everything is working file, but when it's going into the html file is where everything goes wrong.
__________________
PM me for private work.



Last edited by Buckshot; 03-30-2014 at 04:28.
Buckshot is offline
Send a message via Skype™ to Buckshot
swapped
BANNED
Join Date: Mar 2014
Location: OrpheuRegisterHook
Old 03-30-2014 , 04:20   Re: Can't write integers to html file?
Reply With Quote #2

Code:
formatex( szString,  31, "<b>The random number is: %s</b>", randomnum )

= >>
Code:
formatex( szString,  31, "<b>The random number is: %i</b>", randomnum )

Last edited by swapped; 03-30-2014 at 04:21.
swapped is offline
Kiske
Veteran Member
Join Date: May 2009
Old 03-30-2014 , 04:20   Re: Can't write integers to html file?
Reply With Quote #3

%s for strings.
%d or %i for integers.
__________________

Kiske is offline
Send a message via Skype™ to Kiske
Buckshot
Senior Member
Join Date: Mar 2014
Location: Sweden
Old 03-30-2014 , 04:31   Re: Can't write integers to html file?
Reply With Quote #4

Facepalm.. i need some sleep.. 10am and i was up all night. I should not be allowed on alliedmods by this time. I would've known this if i had a working brain.
__________________
PM me for private work.



Last edited by Buckshot; 03-30-2014 at 04:31.
Buckshot is offline
Send a message via Skype™ to Buckshot
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 06:02.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode