Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

Coding Forum


You are currently viewing our Coding Forum as a guest. Please register to participate.
Login



Reply
How To Hide Something (PHP-Like), but PHP doesn't work!
Old 11-18-2009, 09:15 PM How To Hide Something (PHP-Like), but PHP doesn't work!
Physicsguy's Avatar
404 - Title not found

Latest Blog Post:
Challenges
Posts: 824
Name: Scott
Location: Ontario
Trades: 0
Hello again,

I've made a text file, and in with all the information is a password. It's easy to find, if you know where to look, so I'd like to be able to hide it. Here's my text file:

Code:
***Stuff I need to hide***Just some Information|
Now, I have my script to echo everything to the page. It needs to do that, otherwise my other scripts won't work.

How can I just output "Just some Information" minus the ***Stuff I need to hide***?

I've thought, just echo everything after the second find of "***", but I need to have it there, just invisible.

I've also tried this:

Code:
<?php $hiddenstuff = "Stuff I need to hide"; ?>Just some Information|
But when you view the source, you can see in it "<?php $hiddenstuff = "Stuff I need to hide"; ?>Just some Information".

So I need a way for it to echo to the page, but not be visible to either the page or the source...?

How can I do this? It's stumped me for about 10 minutes...
__________________
Check out my
Please login or register to view this content. Registration is FREE
Physicsguy is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 11-19-2009, 05:25 AM Re: How To Hide Something (PHP-Like), but PHP doesn't work!
chrishirst's Avatar
Missing! presumed drunk.

Posts: 41,519
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
use a .php extension
__________________
Chris. ->> Links are advertising NOT optimising!! <<-
A foolish consistency is the hobgoblin of little minds
Thought for today:- I SEO the only industry where all the cowboys are Indians?
chrishirst is online now
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 11-19-2009, 03:04 PM Re: How To Hide Something (PHP-Like), but PHP doesn't work!
Lashtal's Avatar
wherenomanhasgonebefore

Posts: 679
Name: Lashtal
Trades: 0
They're called nutbars (/* */), just put all the info you want in the bars, and you will be able to hide that info, while still being able to put it in the script.

Example:

Code:
/* The stuff you put in here is not web-visible, but is still included through the script when you wish to access the source code. Programmers do this a lot to make notes about the things they've programmed, stuff that they should worry about and reference, yet not be visible to the end-user. */

Does this answer your question?
__________________
Currently Reading:
Please login or register to view this content. Registration is FREE
Lashtal is offline
Reply With Quote
View Public Profile
 
Old 11-19-2009, 03:07 PM Re: How To Hide Something (PHP-Like), but PHP doesn't work!
Lashtal's Avatar
wherenomanhasgonebefore

Posts: 679
Name: Lashtal
Trades: 0
also, in PHP5, you can now use "#", the pound sign.

Code:
#not web-visible in PHP5, but not compatible with PHP4!
__________________
Currently Reading:
Please login or register to view this content. Registration is FREE
Lashtal is offline
Reply With Quote
View Public Profile
 
Old 11-19-2009, 04:23 PM Re: How To Hide Something (PHP-Like), but PHP doesn't work!
Physicsguy's Avatar
404 - Title not found

Latest Blog Post:
Challenges
Posts: 824
Name: Scott
Location: Ontario
Trades: 0
Yes, I am aware of that.

However, this information I'm hiding is passwords. Any crafty user can get to the right file and all the passwords are there.

And the .php file extension is a good idea, I have a question about it though;
Since I'm using the current one as .txt, I'm using it as a flat-file database. Would the script to write and pull from the flat file database work if it was changed to .php?

Thanks
__________________
Check out my
Please login or register to view this content. Registration is FREE
Physicsguy is offline
Reply With Quote
View Public Profile
 
Old 11-19-2009, 04:33 PM Re: How To Hide Something (PHP-Like), but PHP doesn't work!
chrishirst's Avatar
Missing! presumed drunk.

Posts: 41,519
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
PHP files are text

the advantage of "hiding" values as variables inside parsable extensions is that unless they are plain text or HTML it will NOT be sent as output to the useragent.
So unless the infiltrator has FTP access the items will not become visible to the outside world.
__________________
Chris. ->> Links are advertising NOT optimising!! <<-
A foolish consistency is the hobgoblin of little minds
Thought for today:- I SEO the only industry where all the cowboys are Indians?
chrishirst is online now
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 11-19-2009, 04:52 PM Re: How To Hide Something (PHP-Like), but PHP doesn't work!
Physicsguy's Avatar
404 - Title not found

Latest Blog Post:
Challenges
Posts: 824
Name: Scott
Location: Ontario
Trades: 0
Alright, thanks!
__________________
Check out my
Please login or register to view this content. Registration is FREE
Physicsguy is offline
Reply With Quote
View Public Profile
 
Old 11-19-2009, 09:42 PM Re: How To Hide Something (PHP-Like), but PHP doesn't work!
JeremyMiller's Avatar
WT Moderator

Posts: 1,712
Name: Jeremy Miller
Location: Las Vegas, NV
Trades: 0
Quote:
Originally Posted by Physicsguy View Post
However, this information I'm hiding is passwords. Any crafty user can get to the right file and all the passwords are there.
Passwords that you need only for logging into your own system can be stored in a hashed format. For more information, see the sticky.
__________________
Jeremy Miller

Please login or register to view this content. Registration is FREE
JeremyMiller is offline
Reply With Quote
View Public Profile Visit JeremyMiller's homepage!
 
Old 11-19-2009, 09:55 PM Re: How To Hide Something (PHP-Like), but PHP doesn't work!
Physicsguy's Avatar
404 - Title not found

Latest Blog Post:
Challenges
Posts: 824
Name: Scott
Location: Ontario
Trades: 0
Pretty much, the passwords are safe unless the user finds out where they're stored, which is only in the PHP (which they can't see).

For example, all my passwords are stored in a flat file called ' passwords.txt'. Only users that know where passwords.txt is will be able to gain access.

But in the future, an encryption will be included.
__________________
Check out my
Please login or register to view this content. Registration is FREE
Physicsguy is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to How To Hide Something (PHP-Like), but PHP doesn't work!
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.29388 seconds with 12 queries