Web Design and Development Forums

Changing Content On A Seperate Page

This is a discussion on "Changing Content On A Seperate Page" within the Perl, Python, Ruby and Others section. This forum, and the thread "Changing Content On A Seperate Page are both part of the Program Your Website category.


Go Back   Webforumz.com > Program Your Website > Perl, Python, Ruby and Others

Welcome to Webforumz.com.
Register Now Register now!

Reply
 
LinkBack Thread Tools Rate Thread
Old Sep 20th, 2007, 13:42   #1 (permalink)
Junior Member
 
Join Date: Dec 2006
Location: London
Age: 19
Posts: 32
Changing Content On A Seperate Page

What i want to do, is have content on a homepage, which can be edited via a form on a restricted page.

E.G.

I have news on home page, when i go to a restricted page (e.g. mysite.co.uk/admin) i am produced a form which if i type in, then enter, the news on the homepage is changed.

I can do this on a single page, but on a separate page is a bit confusing at the moment:

CGI:
Code: Select all
my $query = new CGI;
my $name = $query->param("name");
my $message = $query->param("message");

if ($query->param('action') eq 'insert') {
open (INSERT,">>msg.txt");
print INSERT "$name|$message\n";
close(INSERT);

      }

open (READ,"msg.txt");
my @loop_data = ();  
while (<READ>) {
chomp $_; 
my ($db_name,$db_message) = split(/\|/, $_); 
my %row_data;  

$row_data{NAME} = $db_name;
$row_data{MESSAGE} = $db_message;

 push(@loop_data, \%row_data);
}

      close(READ);

my $template = HTML::Template->new(filename => 'contactus.tmpl');
$template->param(LOOP => \@loop_data);  template
print "Content-Type: text/html\n\n";
print $template->output;
TMPL:
HTML: Select all
<TMPL_LOOP NAME="LOOP">
<strong>Name:</strong> <TMPL_VAR NAME="NAME"> <br />
<strong>Message:</strong> <TMPL_VAR NAME="MESSAGE"> <br /><br />
</TMPL_LOOP>
<form action='contactus.cgi' enctype='multipart/form-data' method='post'>
Name:<br />
<input type="text" name="name" /><br />
Message:<br />
<input type="text" name="message" /><br /><br />
 <input type="hidden" name="action" value="insert">
<input type='submit' value='submit' />
</form>
Any help would be greatly appreciated.

Last edited by josephman1988; Sep 20th, 2007 at 13:46.
josephman1988 is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] CSS changing page colour etc R8515198 CSS Forum 10 Nov 27th, 2007 00:54
A gap appears beween the Page Title and the Body Content of the page. sovereign6 HTML Forum 6 Dec 18th, 2006 19:14
Changing Content joshcxa JavaScript Forum 2 Dec 6th, 2006 00:41
Changing URL without refreshing page ? Perfection Studios JavaScript Forum 4 Sep 14th, 2006 12:22
Changing css with page refresh krrish CSS Forum 3 Jul 26th, 2006 08:20



Latest Updates

All Points SEO Security Advisory - CHECK YOUR SITE NOW!

Creative Coding :: February 2008

Webforumz is sponsored by: WESH UK Web Hosting
All times are GMT. The time now is 23:04.

Sleep Study Scoring :: Free Bet :: Website Templates :: Online Betting :: Bookmakers :: Funny Quotes :: Internet Recruitment Software :: Microsoft CRM Experts :: Online Casino :: Decorated Christmas Trees :: Midwife Forums :: Football Betting :: Ecommerce Software :: Web Hosting :: Football Stats :: Dry Cleaning Collection :: xtreme wales - extreme clothing :: Apuestas :: Sharepoint Consultants :: Website Optimisation :: Office Clearance London :: Sharepoint Experts :: Sports Betting :: Casino :: Website Templates :: Web Design Development India :: Online Gambling

Powered by: vBulletin Version 3.7, Copyright ©2000 - 2008, Jelsoft Enterprises Limited.
© 2003-2008 Webforumz.com : All Rights Reserved
Search Engine Friendly URLs by vBSEO 3.2.0 RC6


1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59