Try these...
function encode($string) {
$string=stripslashes($string);
$temp='';
$newstring='';
for ( $counter=0; $counter != 9999; $counter++ ) {
$temp=substr($string, $counter, 1);
if ( $temp == '' ) {
break;
}
$newstring=$newstring . str_pad( ord($temp), 3, "0",
STR_PAD_LEFT);
}
return ($newstring);
}
function decode($string) {
$temp='';
$newstring='';
for ( $counter=0; $counter != 9999; $counter+=3 ) {
$temp=substr($string, $counter, 3);
if ( $temp == '' ) {
break;
}
$newstring=$newstring . chr($temp);
}
return ($newstring);
}
-----Original Message-----
From: Nick Richardson [mailto:[EMAIL PROTECTED]]
Sent: Monday, February 25, 2002 7:56 PM
To: PHP General
Subject: [PHP] Variables containing HTML?
Stupid question for everyone... i'm just having one of those braindead
moments.
I have a page which allows users to add custom headers and footers in
HTML.
(i.e. Fill in a text area with a bunch of html, and that's stored in a
mysql
database and retrived when that user logs in again).
The problem i'm having is this:
When a users fills in all the info, and hits submit, they are taken to a
preview page which renders everything and has an accept button.
If i try to store the header and footer data in a hidden input it just
renders it on the screen (if it's more than one line it gets even
worse).
How can i get this info (variable w/ strings that are QUITE long, and
include quotes and apostrophes) from the form they are entered on, into
a
preview page, then back into the script to be written into the database?
I have thought about sessions, and they work until the user decides they
dont like the way it turned out and try to discard and change it, even
after
re-registering the variables in the session, they do not change to the
new
input.
I hope someone out there can make sence of what i have said... because i
think i confused even myself.... ;)
Thanks for any help!
//Nick Richardson
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php