Unstoppable Domains — Expired Auctions

Striping text boxes of <br> tag

Spaceship Spaceship
Watch

Martin Crepaz

Established Member
Impact
3
Hello,

I have php which extracts data from a MySQL Database, However the database field contains the tag <br> in it, However when i call it in to the text box its showing the <br> tag, Is there anyway to remove this tag from the tag box before submitting the form.

Thanks

Martin
 
0
•••
The views expressed on this page by users and staff are their own, not those of NamePros.
.US domains.US domains
This might help:

PHP:
<?php
$var = "anything here <br> and here <p>";
$newvar = ereg_replace("<[^>]*>","",$var);
?>

Now the newvar variable has string without the HTML tags which you can feed in to your textbox.
 
0
•••
Hello,

I have just tried that but it wont remove the <br> tag from inside the text field.
Any other ways or ideas. or may be im doing it wrong.

Martin
 
0
•••
Okay this is what I assume.

You are running a query and fetching the data from the database.

Then you are echoing the text box something like this.

<input type="input" value="$var" name="textbox">

So above this line where you are sending the output to HTML put the code from my previous post. It will work.
 
0
•••
PHP:
$newvar = str_replace(array('<br>', '<br />'), '', $oldvar);
 
0
•••
Dynadot — .com TransferDynadot — .com Transfer
Appraise.net

We're social

Domain Recover
DomainEasy — Zero Commission
  • The sidebar remains visible by scrolling at a speed relative to the page’s height.
Back