LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 03-13-2006, 04:14 PM   #1
Hockeyfan
Member
 
Registered: May 2004
Distribution: SuSe 10.0
Posts: 154

Rep: Reputation: 30
Question about output for php


I am creating a form dynamically and I've seen a method of outputing the form that I am not familiar with. I have seen a form be produced on the fly by putting the entire contents in a variable named $form. The form is displayed without any echo statement. I have searched the php manual and I couldn't find anything that explains it. If anyone knows would they plase take the time and explain it to me.

Thanks,

Hockeyfan
 
Old 03-14-2006, 09:30 AM   #2
zeitounator
Member
 
Registered: Aug 2003
Location: Montpellier, France, Europe, World, Solar System
Distribution: Debian Sarge, Fedora core 5 (i386 and x86_64)
Posts: 262

Rep: Reputation: 30
Any example code ?

My guess is that your $form variable holds some kind of form object which as a method to output its content... something like

Code:
$form = new FormObject;
$form->setAction('/some/url');
$form->addField('text', 'name');
$form->render();
But in any case, the content of the form must be printed to the output with an 'echo' or 'print' statement (in the example above, that would happen somewhere in the render() method of the form object.

The only other thing I can think of is that you have seen the use of some sort of 'echo/print' shortcut in an html template. Something like

Code:
[some html]
<?php
$form = '<form action"....................">all the content</form>';
?>
[some more html]
<?=$form?> <= this is a shortcut to <?php echo $form ?>
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Pipe output of command to php !!! ALInux Programming 7 12-30-2006 12:36 PM
display ifconfig output in php ?? ALInux Programming 1 10-29-2005 04:23 PM
No form output in PHP jabfinger Programming 2 07-15-2005 06:48 PM
PHP: save output to a file mikeshn Programming 2 10-25-2003 06:57 AM
Php output robbfen Linux - Newbie 2 06-20-2003 12:03 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 12:49 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration