#!/usr/bin/perl #------------------------------------------------------------------------------# # NAME: : enewsViewNewsArticle.cgi # # PROGRAMMER : SL # # DATE : 00/08/2002 # # # # DESCRIPTION : View all news article. # # # #------------------------------------------------------------------------------# # This script is copyright Integrated System Technologies 2001 and beyond # #------------------------------------------------------------------------------# # COMPLETE # #------------------------------------------------------------------------------# #require("enewsLibrary.pl"); require("site_lib.pl"); use Time::Local; use DBI; #----------------------------------------# # Initialisation. # #----------------------------------------# &readParse(*input); #----------------------------------------# # Main Algorithm. # #----------------------------------------# #if ($input{'article_id'} eq "") { if ($input{'article_id'}) { # Get the record from the database. $cursor = ""; $dbh = DBI->connect("DBI:mysql:sss_db:$sqlServerDomain", "$mysqlUsername", "$mysqlPassword") or &errorMessagePage("DBI Problem Reported.

(" . $DBI::errstr .")

SQL: $sql

Please report this error to the webmaster.

"); # Select by article. $sql = "SELECT * FROM articles_tbl WHERE article_id = $input{'article_id'}"; # Grab the data from the database. $cursor = $dbh -> prepare($sql); $cursor -> execute() or &errorMessagePage("DBI Problem Reported.



Actual error reported:

(" . $DBI::errstr .")

SQL: $sql

Please report this error to the webmaster.

"); if ($hashRecordPtr = $cursor -> fetchrow_hashref()) { # Is there a picture? if ($$hashRecordPtr{'picture_url'}) { $pictureHTML = "\"News

"; } else { $pictureHTML = ""; } $cursor -> finish(); $dbh -> disconnect; } else { &errorMessageBox("Sorry, there is no news article with the id you provided."); exit(0); } } else { #$sql = "SELECT * FROM articles_tbl ORDER BY creation_time DESC"; #&errorMessagePage('Please specify a news article.') $cursor = ""; $dbh = DBI->connect("DBI:mysql:sss_db:$sqlServerDomain", "$mysqlUsername", "$mysqlPassword") or &errorMessagePage("DBI Problem Reported.

(" . $DBI::errstr .")

SQL: $sql

Please report this error to the webmaster.

"); # Select by article. $sql = "SELECT * FROM articles_tbl ORDER BY creation_time DESC"; # Grab the data from the database. $cursor = $dbh -> prepare($sql); $cursor -> execute() or &errorMessagePage("DBI Problem Reported.



Actual error reported:

(" . $DBI::errstr .")

SQL: $sql

Please report this error to the webmaster.

"); if ($hashRecordPtr = $cursor -> fetchrow_hashref()) { # Is there a picture? if ($$hashRecordPtr{'picture_url'}) { $pictureHTML = "\"News

"; } else { $pictureHTML = ""; } $cursor -> finish(); $dbh -> disconnect; } } print <<"HTML1"; Content-type: text/html\n Stainless Steel Services Ltd
 
 

Address
Stainless Steel Services Ltd
Middlemore Road
Birmingham
B21 0BH
England
UK

Sales & General Enquiries
Telephone:
+44 0121 523 8100

Fax:
+44 0121 523 8102


Accounts
Telephone:
+44 0121 523 1950
Fax:
+44 0121 523 8104
 
  To view all our regularly updated news and events simply click on the news article header links below.

$$hashRecordPtr{'title'}

$pictureHTML$$hashRecordPtr{'article'}
DATE: $$hashRecordPtr{'dd'}/$$hashRecordPtr{'mm'}/$$hashRecordPtr{'yyyy'}

Back
HTML1 # Get the record from the database. $cursor = ""; $dbh = DBI->connect("DBI:mysql:sss_db:$sqlServerDomain", "$mysqlUsername", "$mysqlPassword") or &errorMessagePage("DBI Problem Reported.

(" . $DBI::errstr .")

SQL: $sql

Please report this error to the webmaster.

"); # Select by article. $sql = "SELECT * FROM articles_tbl ORDER BY creation_time DESC"; # Grab the data from the database. $cursor = $dbh -> prepare($sql); $cursor -> execute() or &errorMessagePage("DBI Problem Reported.



Actual error reported:

(" . $DBI::errstr .")

SQL: $sql

Please report this error to the webmaster.

"); $hashRecordPtr2 = $cursor -> fetchrow_hashref(); do { print qq§ §; $articleDate = $$hashRecordPtr2{'dd'}."\\".$$hashRecordPtr2{'mm'}."\\".$$hashRecordPtr2{'yyyy'}; $articleExcert = ""; $articleExcert = substr($$hashRecordPtr2{'article'},undef,65); $articleExcert = "'$articleExcert.....'"; #javascript: NewWindow('news1.htm','cf',474,325,'no'); #document.URL = 'enewsViewNewsArticle.cgi?article_id=$$hashRecordPtr{'article_id'}'; print ""; } while ($hashRecordPtr2 = $cursor -> fetchrow_hashref()); $cursor -> finish(); $dbh -> disconnect; # # # # # # # # # ## # # # # print <<"HTML1";
$$hashRecordPtr2{'title'}
News Article Header 1
News Article Header 2
News Article Header 3
HTML1 # Get the record from the database. # $cursor = ""; # $dbh = DBI->connect("DBI:mysql:sss_db:$sqlServerDomain", # "$mysqlUsername", # "$mysqlPassword") or &errorMessagePage("DBI Problem Reported.

(" . $DBI::errstr .")

SQL: $sql

Please report this error to the webmaster.

"); # # # Select by article. # # $sql = "SELECT * FROM articles_tbl ORDER BY creation_time DESC"; # # # Grab the data from the database. # # $cursor = $dbh -> prepare($sql); # $cursor -> execute() or &errorMessagePage("DBI Problem Reported.



Actual error reported:

(" . $DBI::errstr .")

SQL: $sql

Please report this error to the webmaster.

"); # $hashRecordPtr2 = $cursor -> fetchrow_hashref(); # do { # # print qq§ §;# # $articleDate = $$hashRecordPtr2{'dd'}."\\".$$hashRecordPtr2{'mm'}."\\".$$hashRecordPtr2{'yyyy'}; # $articleExcert = ""; # $articleExcert = substr($$hashRecordPtr2{'article'},undef,65); # $articleExcert = "'$articleExcert.....'"; #javascript: NewWindow('news1.htm','cf',474,325,'no'); #document.URL = 'enewsViewNewsArticle.cgi?article_id=$$hashRecordPtr{'article_id'}'; # print " # $$hashRecordPtr2{'title'} "; # # } while ($hashRecordPtr2 = $cursor -> fetchrow_hashref()); # # $cursor -> finish(); # $dbh -> disconnect; #----------------------------------------# # End. # #----------------------------------------# exit(0);