CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Beginner:
Creating Multiple Pages

 



etheracide
journeyman

Jul 20, 2001, 3:02 AM

Post #1 of 1 (800 views)
Creating Multiple Pages Can't Post

I started a new script this evening. I have gotten quite far on it, but i have come to a block. The script as it stands will now take the info submitted and post it to a page where all the results are shown. The posts are seperated by a horizontal rule (or a <p> if one chooses) and it creates one HTML page. I would like to have it set so that after so many entries, it will create a second page..and then third and so on. I want to create a scalar $maxentries in which the user can specify how many entries to display per page.

This isn't the entire script, but here is the part that creates the actual HTML page:

**********************************************************

print "Content-Type: text/html\n\n";

if ($FORM{'new'}){

open(PERSONALS, "$data_file");
@FILE = <PERSONALS>;
close(PERSONALS);

print PERSONALS "Content-Type: text/plain\n\n";
open(PERSONALS, ">$data_file");
#flock(PERSONALS,2);

if ($FORM{'url'}){
print PERSONALS"<TABLE><TR>";
print PERSONALS "<TD bgcolor=\"#006666\"><A HREF=\"$FORM{'url'}\">";
print PERSONALS"<B>$FORM{'name'}</B></A></TD>";
}else{
print PERSONALS "<TABLE><TR>";
print PERSONALS "<TD bgcolor=\"#006666\"><B>$FORM{'name'}</B></TD>";
}
print PERSONALS "<TD bgcolor=\"#006666\">Age: <B>$FORM{'age'}</B></TD>";
print PERSONALS "<TD bgcolor=\"#006666\">Sex: <B>$FORM{'sex'}</B></TD>";
print PERSONALS "<TD bgcolor=\"#006666\">City: <B>$FORM{'city'}</B></TD>";
print PERSONALS "<TD bgcolor=\"#006666\">State: <B>$FORM{'state'}</B></TD>";
print PERSONALS "<TD bgcolor=\"#006666\">Country: <B>$FORM{'country'}</B></TD>";
print PERSONALS "</TR></TABLE>";

print PERSONALS "Date Joined: <B>$thetime[2]-$thetime[1]-$thetime[4]</B><BR>";

if ($hyper_link eq '1'){
print PERSONALS "Email Address: <A HREF=\"mailto:$FORM{'emailadd'}\">$FORM{'emailadd'}</A><BR>";
}else{
print PERSONALS "Email Address: $FORM{'emailadd'}<BR>";
}
print PERSONALS "Sexual Orientation: <B>$FORM{'sexual'}</B><BR>";
print PENPALS "Family Status: <B>$FORM{'familstat'}</B><BR>";
print PERSONALS "Height: <B>$FORM{'height'}</B><BR>";
print PERSONALS "Weight: <B>$FORM{'weight'}</B><BR>";
print PERSONALS "Hair Color: <B>$FORM{'hair'}</B><BR>";
print PERSONALS "Hair Style: <B>$FORM{'style'}</B><BR>";
print PERSONALS "Eye Color: <B>$FORM{'eyes'}</B><BR>";
print PERSONALS "Education: <B>$FORM{'education'}</B><BR>";
print PERSONALS "Occupation: <B>$FORM{'occupation'}</B><BR>";
print PERSONALS "Ethnic Origin/Race: <B>$FORM{'race'}</B><BR>";
print PERSONALS "Religion: <B>$FORM{'religion'}</B><BR>";
print PERSONALS "Hobbies: <B>$FORM{'hobbies'}</B><BR>";
print PERSONALS "Partner's Age: <B>$FORM{'partnerage'}</B><BR>";
print PERSONALS "Looking For: <B>$FORM{'goal'}</B><BR>";

print PERSONALS "<P>$FORM{'describe'}</P>";
print PERSONALS "Picture: <br /><B><img src=\"$FORM{'picture'}\" height=150 width=150></B><BR>";


if ($seperate eq '1'){
print PERSONALS "<P>\n";
}else{
print PERSONALS "<HR>\n";
}
print PERSONALS @FILE;


#flock(PERSONALS,8);
close(PERSONALS);

********************************************************

If you need anything else, please let me know and I will do what I can to help you help me =0) And of course I always let people know on the site who helped me with my scripts =0)


 
 


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives