Re: [PHP] pop textarea field w/ text incl. quotes

2001-02-21 Thread David Allen Reid

Why store the html in the db? Why not have multiple db fields, say url and desc
then when you grab them from the db to be outputed put them into the html
print ''.$desc.'';

Then you wouldn't have to input all the html when it gets stored in the db, not
have to worry about quotes, or htmlspecialchars();.  Also out of curiosity are
you stripping all tags but  from the input?  Wouldn't want to get any nasty
users inputting  refresh tags or anything...

-David Reid

On Wed, 21 Feb 2001 17:46:30 -0800 (PST), John Monfort said:

> 
>  
>   Is it necessary to include the 'http:' in the DB field?
>  
>   It would make your life a lot easier to drop it.
>  
>   You would then store the url values as
>  www.mydomain.com
>  
>   Then, modify your code to add the 'HTTP' whenever it encounter a URL, or
>   wherever you will create a link.
>  
>   This would eliminate the need to deal with special characters...
>  
>  __John Monfort_
>  _+---+_
>   P E P I E  D E S I G N S
> www.pepiedesigns.com
>  "The world is waiting, are you ready?"
>  -+___+-
>  
>  On Wed, 21 Feb 2001, Paul Warner wrote:
>  
>  > Simon-
>  >
>  > Thanks for the tip...I trued using the htmlspecialchars() which allowed the
>  > remainder of the form to display properly, but left no value in the
>  > textarea.  Then I noticed a difference in the method I was using compared to
>  > yours - I'm still learning the ways of PHP so it will take me a while to
>  > determine the significance of the syntax differences:
>  >
>  > Mine:   > value="htmlspecialchars($linkurl)">\n' ?>
>  >
>  > Yours: " . htmlspecialchars($link) . "" ?>
>  >
>  > I wanted a graphical representation of the present link displayed above the
>  > textarea and then attempted to use php's substitution to build the text area
>  > within the same string.  I updated my code to be more like yours and arrived
>  > at:
>  >
>  > '?>" .
>  > htmlspecialchars($linkurl) . "\n"?>
>  >
>  > which seems to make the parser behave as I intended.
>  >
>  > Anyway...thanks!
>  >
>  > -- Paul
>  >
>  > - Original Message -
>  > From: "Simon Garner" <[EMAIL PROTECTED]>
>  > To: "Paul Warner" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
>  > Sent: Wednesday, February 21, 2001 8:19 PM
>  > Subject: Re: [PHP] pop textarea field w/ text incl. quotes
>  > >
>  > > Don't worry about quotes - the problem is that you have HTML markup inside
>  > > your . You just need to convert < and > to < and >,
>  > > respectively, in your link text. The functions htmlspecialchars() or
>  > > strip_tags() can do this for you.
>  > >
>  > > i.e.:
>  > >
>  > > " . htmlspecialchars($link) . "" ?>
>  > >
>  > > When the form is submitted (and when it's viewed), those entities will be
>  > > converted back to their real characters automatically by the browser.
>  > >
>  >
>  >
>  > --
>  > PHP General Mailing List (http://www.php.net/)
>  > To unsubscribe, e-mail: [EMAIL PROTECTED]
>  > For additional commands, e-mail: [EMAIL PROTECTED]
>  > To contact the list administrators, e-mail: [EMAIL PROTECTED]
>  >
>  >
>  
>  
>  -- 
>  PHP General Mailing List (http://www.php.net/)
>  To unsubscribe, e-mail: [EMAIL PROTECTED]
>  For additional commands, e-mail: [EMAIL PROTECTED]
>  To contact the list administrators, e-mail: [EMAIL PROTECTED]
>  
>  

-- 
Karl's version of Parkinson's Law:  Work expands to exceed the time alloted it.



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] getting what's between

2001-02-21 Thread David Allen Reid

Maybe something along the lines of:

$results = eregi("Item3[a-Z 0-9]", $data);

-David

On Wed, 21 Feb 2001 23:32:04 -0600, Tyler Longren said:

> Hello,
>  
>  I've been reading a LOT on how to solve my problem today, but haven't been
>  able to come up with anything yet.
>  
>  Here's my problem:
>  I have an html file that contains many table rows like this:
>  
>  Item1Item1 Again
>  Item2Item2 Again
>  Item3Item3 Again
>  Item4Item4 Again
>  
>  And so on.  I want to search this html for a table row that has 'Item3' in
>  the first cell.  And the second cell should contain 'Item3 Again'.  I know
>  that I can do this with something like this:
>  
>  $file = fopen("http://localhost/html.html", "r");
>  $data = fread($file, 1);
>  $results = eregi("Item3Item3 Again", $data);
>  
>  
>  However, this won't exactly work for me, because that contents of the
>  second cell will change daily, so tomorrow, the third table row could look
>  like this:
>  
>  Item3Item3 Has Changed
>  
>  I was thinking I could use sscanf() to do this, but couldn't get anything
>  to work.  I've tried everything I can think of.
>  
>  Sorry if the explanation of my problem was hard to understand, I don't
>  exactly understand it myself.  Thanks everybody!!!
>  
>  Regards,
>  Tyler Longren
>  
>  
>  -- 
>  PHP General Mailing List (http://www.php.net/)
>  To unsubscribe, e-mail: [EMAIL PROTECTED]
>  For additional commands, e-mail: [EMAIL PROTECTED]
>  To contact the list administrators, e-mail: [EMAIL PROTECTED]
>  

-- 
TANSTAAFL



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]