On Tuesday 05 June 2001 07:38, Vontel Girish wrote:
> Can anyone tell me how do i proceed with creating
> dynamic pages???

Dynamic pages is a term that means web pages generated on the fly by a 
scripting language in response to a condition. 

Example : user bob  fills in a request form on a web page . When he submits 
it a script generates an new page based on  what bob sumited. As most folks 
here use Perl as the scripting language  creating dynamic pages  is a process 
of useing Perl scripting on a web server.

To start read the  manual pages to CGI.pm to get  an idea of how powerful it 
can be.

The most simple of dynamic pages consits of a web page wriitten in HTML that 
consist of a form that calls a Perl script opon submission. The Perl script 
generate the new HTML and passes it back to the web browser.

# demo of dynamic page creation

you can use  Perl or HTML to create the calling page , I'll use HTML for this 
example.

<html>
<head>
<title>Demo</title>
</head>
<body>
<form action ="/cgi-bin/demo.pl" METHOD="POST">
Select  a suprise level<p>
<SELECT NAME ="selection" >
<OPTION SELECTED>big</OPTION>
<OPTION>small</OPTION>
</SELECT>
<p>
Rember to  press the submit button for your suprise !!!
<INPUT TYPE="submit" NAME="submit">
</form>
</body>
</html>

# now we generate a page  on the web server based on what was selected
# demo.pl
use strict;
use CGI;
my $q=new CGI;
my $choice = q->param( "selection" );
if($choice eq "big"){
        print $q->header("text/html"),
               $q->start_html( "BIG SUPRISE"),
               $q->p( "You have been elected as leader of the earth !"),
               $q->end_html;
        }
if($choice eq "small"){
        print $q->header("text/html"),
               $q->start_html( "SMALL SUPRISE"),
               $q->p( " Look inside that cracker jaxs box I think you won a prize"),
                   $q->end_html;
        }

You see based on whats selected a "Dynamic" page is created and returned to 
the web browser to display


hope this gets you going

Greg
 


> Thanks,
> Girish
>
> =====
> V.GIRISH
> 5/29, White Street,
> Southport, Gold Coast,
> QLD 4215, AUSTRALIA
> Cell: +61 414510375
> home: +61 7 5528 0794
>
> ____________________________________________________________
> Do You Yahoo!?
> For regular News updates go to http://in.news.yahoo.com

Reply via email to