TalkPHP
 
 
Account Login
Latest Articles
» The basic usage of PHPTAL, a XML/XHTML template library for PHP
» Vulnerable methods and the areas they are commonly trusted in.
» Simple way to protect a form from bot
» The Basics On: How Session Stealing Works
» How to keep your forms from double posting data
IRC Channel
IRC Speech Bubble Join the friendly bunch on IRC...
(#TalkPHP on Freenode)

...Also available via a web interface.

See this thread for information on the TalkPHP Free Hugs Initiative™. Subject to availability.
Associates
Associates
CSS Tutorials
Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old 03-04-2008, 01:43 PM   #1 (permalink)
Orc
The Prestige
 
Orc's Avatar
 
Join Date: Dec 2007
Posts: 1,044
Thanks: 193
Orc is on a distinguished road
Default Saving Strings to not be edited

I want to figure out how to save strings which cannot be edited any longer. How would I do this without files? Meaning an irreversible string or variable.
__________________
VillageIdiot can have my babbies ;d
Orc is offline  
Reply With Quote
Old 03-04-2008, 02:04 PM   #2 (permalink)
La Vida es Sueño
Advanced Programmer Top Contributor 
 
Wildhoney's Avatar
 
Join Date: Sep 2007
Location: Oldham
Posts: 2,280
Thanks: 90
Wildhoney is on a distinguished road
Default

Could you elaborate, please. I don't understand.
__________________
The man who comes back through the Door in the Wall will never be quite the same as the man who went out.
Send a message via AIM to Wildhoney Send a message via MSN to Wildhoney Send a message via Yahoo to Wildhoney
Wildhoney is offline  
Reply With Quote
Old 03-04-2008, 02:06 PM   #3 (permalink)
Orc
The Prestige
 
Orc's Avatar
 
Join Date: Dec 2007
Posts: 1,044
Thanks: 193
Orc is on a distinguished road
Default

Quote:
Originally Posted by Wildhoney View Post
Could you elaborate, please. I don't understand.
A variable that once its assigned, it cannot be modified. How would I do this?
__________________
VillageIdiot can have my babbies ;d
Orc is offline  
Reply With Quote
Old 03-04-2008, 03:58 PM   #4 (permalink)
The Contributor
 
Join Date: Jan 2008
Posts: 87
Thanks: 49
StevenF is on a distinguished road
Default

Quote:
Originally Posted by Orc View Post
A variable that once its assigned, it cannot be modified. How would I do this?
Forgive me, I'm fairly new to this - I don't understand what you mean, can't it only be modified by you? (or the person who has the script).
__________________
My Personal and Photo Blog
StevenF is offline  
Reply With Quote
Old 03-04-2008, 05:16 PM   #5 (permalink)
Alan @ CIT
Member of the Month
The Frequenter
Member of the Month Top Contributor 
 
Alan @ CIT's Avatar
 
Join Date: Apr 2005
Location: South UK
Posts: 483
Thanks: 51
Alan @ CIT is on a distinguished road
Default

I'm also confused Is the variable being assigned in your script or by a user? Is it being stored in a database or does it only exist in the PHP script?

Alan
Send a message via MSN to Alan @ CIT
Alan @ CIT is offline  
Reply With Quote
Old 03-04-2008, 08:03 PM   #6 (permalink)
The Frequenter
Newcomer 
 
xenon's Avatar
 
Join Date: Dec 2007
Location: Bucharest, Romania
Posts: 438
Thanks: 3
xenon is on a distinguished road
Default

I think he needs constants:

PHP Code:
define('SOME_VAR''abcde');

SOME_VAR 'test'// fatal error 
__________________
I have optimistic thoughts, even though sometimes (if not always) life's a bitch.
xenon is offline  
Reply With Quote
The Following User Says Thank You to xenon For This Useful Post:
Orc (03-05-2008)
Old 03-04-2008, 08:58 PM   #7 (permalink)
The Frequenter
 
ReSpawN's Avatar
 
Join Date: Nov 2007
Location: Netherlands
Posts: 460
Thanks: 49
ReSpawN is on a distinguished road
Default

Indeed Xenon, or
PHP Code:
define (_TALK_PHP'TalkPHP');
if ( 
defined _TALK_PHP ) ) { echo 'Defined'; } 
Make a function for defining those things I guess. There is a better way tho.
PHP Code:
    
    $lang 
= array();
    
$lang[] = 'talkphp';
    
$lang[] = 'talkPHP';
    
    function 
pushWord($word) {
        global 
$lang;
        if ( !
in_array($word$lang) ) {
            
array_push($lang$word);
            echo 
'Added to the list!';
        } else {
            echo 
$word.' is already in the array!';
        }
    }
    
    
pushWord('talkPHP');
    
    echo 
'<br><br>Your content of the $lang array:<br><br>';
    
    foreach (
$lang as $key => $value) {
        echo 
$value.'<br>';
    } 
__________________
"Life is a bitch, take that bitch on a ride"
Send a message via MSN to ReSpawN
ReSpawN is offline  
Reply With Quote
The Following User Says Thank You to ReSpawN For This Useful Post:
Orc (03-05-2008)
Old 03-05-2008, 12:59 PM   #8 (permalink)
Orc
The Prestige
 
Orc's Avatar
 
Join Date: Dec 2007
Posts: 1,044
Thanks: 193
Orc is on a distinguished road
Default

Perfect, thanks Xenon and Respawn!
__________________
VillageIdiot can have my babbies ;d
Orc is offline  
Reply With Quote
Reply



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

Advanced Search
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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


All times are GMT. The time now is 09:36 AM.

 
     

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0
Inactive Reminders By Icora Web Design