Is there a way to remove a #.
I'm making a php generator for myspace layouts. But the problem is.. My color wheel produces the #html color.
Well myspace funks up when you give a color like #FF0000, what i need is to just have FF0000. ( Not necessary that color. )
Is there a tag or code of some sort that i could have on the second page or first don't matter to remove the '#' apon hitting the submit.
Need code to remove '#'
Moderator: General Moderators
Code: Select all
str_replace("#", "", "#ffffff");-
QuickSnail
- Forum Commoner
- Posts: 46
- Joined: Fri Dec 21, 2007 11:13 am
I presume you would pass the value via posting it, in which case if the form field where the value is stored is called "color" for example, you could use this:
EDIT:
In your HTML, you then have this:
Code: Select all
$_POST['color'] = str_replace("#", "", $_POST['color']);In your HTML, you then have this:
Code: Select all
<input type="text" name="color" value="<?= $_POST['color']; ?>" />-
QuickSnail
- Forum Commoner
- Posts: 46
- Joined: Fri Dec 21, 2007 11:13 am
- RobertGonzalez
- Site Administrator
- Posts: 14293
- Joined: Tue Sep 09, 2003 6:04 pm
- Location: Fremont, CA, USA
To make it easy you could apply the replace to the entire $_POST array.
Code: Select all
<?php
$_POST = str_replace('#', '', $_POST);
?>