Getting user input in PHP plugins

May 19th, 2009 by HTML-Kit Support      Tags: HTML-Kit Tools       Views: 5097
VN:F [1.7.3_972]
Rating: 0.0/5 (0 votes cast)
 

Starting with HTML-Kit Tools 20090512, PHP plugins can easily request user input using multi-field dialogs.

PHP sample code (see "PHP in plugins" first)

<?php
 
$sSelText = $HKit->GetSelText();
 
$aFields = array(
  array('id' => 'html', 'type'=>'checkbox', 'prompt'=>'HTML Comment', 'value'=>'1'),
  array('id' => 'subject', 'type'=>'text', 'prompt'=>'Subject', 'value'=>'', 'watermark'=>'Comment subject'),
  array('id' => 'notes', 'type'=>'memo', 'prompt'=>'Notes', 'value'=>$sSelText)
);
 
$aR = $HKit->GetInput( array('title'=>'Add Comment'), $aFields );
if($aR['ok'])
{
  $bHTMLComment = ('1' == $aR['html']);
  $s = $bHTMLComment ? "<!--\n" : "/*\n";
  $s .= "Subject: ". $aR['subject'] ."\n\n\n";
  $s .= "Notes:\n". $aR['notes'] ."\n\n";
  $s .= $bHTMLComment ? "\n-->\n" : "\n*/\n";
  $s .= "\n";
 
  echo $s;
 
  $HKit->MessageBox( $bHTMLComment ? 'HTML-style comment' : 'CSS-style comment');
}
 
?&gt;
Was this article helpful?
This did not answer my questionThis answered my question (+1 rating, 1 votes)
Loading ... Loading ...
Share this on:
  • Twitter
  • Digg
  • StumbleUpon
  • Facebook
  • MySpace
  • del.icio.us
  • Sphinn
  • LinkedIn
  • Google Bookmarks
  • Live
  • Yahoo! Buzz
  • email
  • Print
 

10 Responses to “Getting user input in PHP plugins”

  1. Sidney says:

    widen@balance.sponsor” rel=”nofollow”>.…

    thank you!!…

  2. Brett says:

    tipsy@thomas.foreami” rel=”nofollow”>.…

    thanks!!…

  3. Brian says:

    offutt@louisville.gordon” rel=”nofollow”>.…

    спс за инфу!…

  4. marion says:

    sobbingly@analeptic.juliet” rel=”nofollow”>.…

    hello!…

  5. Albert says:

    fortin@behaved.bonifaces” rel=”nofollow”>.…

    áëàãîäàðåí….

  6. Gary says:

    mandrel@deterrent.tolylene” rel=”nofollow”>.…

    ñýíêñ çà èíôó!!…

  7. russell says:

    pits@dalbert.fatigued” rel=”nofollow”>.…

    thank you….

  8. Juan says:

    massey@bumptious.paper” rel=”nofollow”>.…

    ñýíêñ çà èíôó!…

  9. Aaron says:

    stereophonic@corruptible.warped” rel=”nofollow”>.…

    hello!!…

  10. juan says:

    stressful@maniacs.hammetts” rel=”nofollow”>.…

    tnx for info….

Do you have a question that requires a reply? Please post it here for a timely and friendly reply.
 
If you have a comment, you can post it below. Not all comments are read, so be sure to use the support forum instead if you need an answer.
 
Leave a Comment or use the support forum if you have a question.

 

© 2009 HTML-Kit.com. All Rights Reserved.  |  Privacy Statement   
HTML design aid