Current location: Hot Scripts Forums » Programming Languages » Perl » CGI problem - Script only allows a small number of digits in my customers site url???


CGI problem - Script only allows a small number of digits in my customers site url???

Reply
  #1 (permalink)  
Old 10-09-05, 07:38 AM
Ireland Ireland is offline
Newbie Coder
 
Join Date: Oct 2005
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
CGI problem - Script only allows a small number of digits in my customers site url???

Need a small bit of help. I run a free real estate listing site at www.homefinder.ie in Ireland. The script I used is chilliscripts, which is no longer supported. There are 2 files within the script, and one of them seems to not allow my customers to enter their site url, if it has a large amount of characters in it, e.g. if it is pointing to a particular property, this is an example of a url it won't allow;

http://www.propertyteam.ie/details_s...=3415&sqlcnt=0

The 2 files are listed below are called submitad.cgi and submitad2.cgi Can somebody please have a look at them and tell me what I need to change. Thanking you in advance - Brian in Ireland

submitad.cgi is this:

#!/usr/bin/perl

################################################## ############################
# submitad.cgi Version 3.03 Released Jul 16 2003 #
# Email: sales@chilliscripts.com #
################################################## ############################
# #
# COPYRIGHT NOTICE #
# Copyright 1999 - 2002 Chilli Scripts All Rights Reserved. #
# #
# Files included in this distribution may be modified only by registered #
# users so long as this copyright notice and the comments above remain #
# intact. By using this code you agree to indemnify Chilli Scripts from any #
# liability that might arise from it's use. #
# #
################################################## ############################
# PLEASE DO NOT MODIFY ANYTHING BELOW THIS POINT #
# UNLESS YOU ARE SURE OF WHAT YOU ARE DOING #
################################################## ############################

require("global.config");
require("routines.pl");

###

#### USER-DEFINED VARIABLES ####

$cancel="<a href=index.cgi><img src=".$rooturl.$main_images."/cancel.gif hspace=15 border=0 alt=\"Click here to return to the Home page.\"></a>";

#### FORM VARIABLES ####
#### STEP 1 IS SUMMARY, STEP 2 IS FORM ####

$step=$form{'step'};
$spar=$form{'spar'};
if (!$step) {$step=1}

if ($cookies{'email'}) {$email=$cookies{'email'}} else {$email=$form{'email'}}
if ($cookies{'pw'}) {$pw=$cookies{'pw'}} else {$pw=$form{'pw'}}


#### CHECK FOR ERRORS ####

if ($cat<1 ) { $cat=0; }
if (length($spar)==8+$embedded_levels*$category_digit s) { $cat=substr($spar,0,$embedded_levels*$category_dig its); }

$return_url="${rootbin}submitad.cgi".($spar?"?spar =$spar":'');

&Check_Login($email,$pw,$return_url);

if ($charge_for_submiting) {


if ($step==2) {

if ($payment_service eq 'clickbank') {
$ticket=$form{'seed'};
$cbpop=$form{'cbpop'};
$cbreceipt=$form{'cbreceipt'};
$good_ticket=&Check_Ticket($ticket,$email,'');
if (!$good_ticket) {$good_ticket=&Check_Ticket($ticket,$email,$cbrece ipt)}
$valid_cbpop=&Check_Clickbank_Code($ticket,$cbpop) ;
if (!$good_ticket) {die "Wrong purchase ticket!\n"}
elsif (!$valid_cbpop) {die "Wrong ClickBank proof of purchase code!\n"}
if ($good_ticket and $valid_cbpop) {&Punch_Ticket($ticket,$email,$cbreceipt)}
}
elsif ($payment_service eq 'paypal') {
$ticket=$form{'seed'};
if ($registration_needed) {
$good_ticket=&Check_Ticket($ticket,$email,'');
} else {
$good_ticket=&Check_Ticket($ticket,'','');
}
if (!$good_ticket) {die "Wrong purchase ticket!\n"}
# if ($good_ticket) {&Punch_Ticket($ticket,$email,'')}
}
elsif ($payment_service eq 'nochex') {
$ticket=$form{'seed'};
if ($registration_needed) {
$good_ticket=&Check_Ticket($ticket,$email,'');
} else {
$good_ticket=&Check_Ticket($ticket,'','');
}
if (!$good_ticket) {die "Wrong purchase ticket!\n"}
# if ($good_ticket) {&Punch_Ticket($ticket,$email,'')}
}
}
}

#### START PAGE DISPLAY ####

print $Content_Header;

&HEADERHTML;
&BANNERHTML;

#### TOP PAGE DISPLAY ####
&TOP_NAVBAR('SUBMITAD');

print "".$table."0 width=600>\n";
print "<tr><td valign=top width=120>\n\n";

#### LEFT SIDE OF PAGE ####

print "".$table."0 width=120><tr><td>".$font."2>\n";

if ($step==2) {
print "<b>For your<br>information...</b><br><font size=1>Your password will allow you to edit or delete your ad at any time.<p>\n";
print "<font size=2><b>Add a picture<br>to your ad!</b><br><font size=1>The &quot;Picture&quot; field is optional, but it <i>will</i> improve your chances for a reply.<p>\n";
print "<font size=2>";
}

if ($step==1 or $step==2) {
print "<a href=help.cgi?sec=6>Help with<br>submitting ads</a><p>\n";
print "<a href=contactus.cgi?subject=4>Suggest a new<br>ad category</font></a></td></tr></table></td>\n\n";

print "<td width=8></td><td width=1 bgcolor=$hfcolor><hr size=0></td><td width=8></td>\n\n";
print "<td valign=top width=463>\n\n";

#### RIGHT SIDE OF PAGE ####

print "".$table."0 width=463><tr><td>".$font."2><b>SUBMIT YOUR AD</b></td></tr>\n";
print "<tr><td valign=top height=11><img src=".$rooturl.$main_images."/line.gif width=463 height=4 border=0></td></tr></table>\n";
print "".$table."0 width=463>\n";

}

#### PAGE ONE SUMMARY ####

if ($step==1) {
if ($charge_for_submiting) {

print "<tr><td>".$font."2>";
if ($payment_service eq 'paypal') {
print $paypal_message;

} elsif ($payment_service eq 'clickbank') {
print $clickbank_message;

} elsif ($payment_service eq 'nochex') {
print $nochex_message;
}

print "<a href=\"gentick.cgi";
if (length($spar)==8+$embedded_levels*$category_digit s) { print "?spar=$spar"; }
print "\"><img src=".$rooturl.$main_images."/continue.gif border=0 alt=\"Click here to pay for submit ad.\">$cancel";
}

else {

print "<form method=post action=submitad.cgi enctype=\"application/x-www-form-urlencoded\">\n";
print "<tr><td>".$font."2>";
print $free_message;
print "<input type=hidden name=\"step\" value=\"2\">";
if ($email) {print "<input type=hidden name=\"email\" value=\"$email\">";}
if ($pw) {print "<input type=hidden name=\"pw\" value=\"$pw\">";}
if (length($spar)==8+$embedded_levels*$category_digit s) { print "<input type=hidden name=\"spar\" value=\"$spar\">"; }
print "<input type=image src=".$rooturl.$main_images."/continue.gif border=0 alt=\"Click here to continue.\">$cancel";
}
}

#### PAGE TWO FORM ####

elsif ($step==2) {

print "<form method=POST action=submitad2.cgi enctype=\"multipart/form-data\">\n";
print "<tr valign=center><td width=130>".$font."2><b>Title:</b></td>\n";
print "<td width=333>".$font."2><input type=text name=title size=34 maxlength=40></td></tr>\n";
print "<tr><td></td><td>".$font."1><i>(example, &quot;For Sale in Killarney or To Let in Rathmines&quot</i></td></tr>\n";
print "<tr><td height=12></td></tr>\n";
print "<tr valign=center><td>".$font."2><b>Category:</b></td>\n";
print "<td>".$font."1><select name=cat><option value=00>[Select one]\n";

## SEE README.HTML FOR ADVICE BEFORE ALTERING BELOW. ####

foreach $cnt (sort keys %categories_names) {
if (!grep(/^$cnt\d{$category_digits}$/,keys %categories_names)) {
print "<option value=$cnt";

#### AUTO SELECT AD CATEGORY ####

if ($cat eq $cnt."0"x($embedded_levels*$category_digits-length($cnt))) { print " selected"; }
print ">";
Print_Category_Path($cnt);
}
}

print "</select></td></tr><tr><td height=12></td></tr>\n";

print "<tr valign=center><td>".$font."2><b>Price:</b></td>\n";
print "<td>".$font."2><input type=text name=loc size=29 maxlength=30></td></tr>\n";
print "<tr><td></td><td>".$font."1><i>(Important, &quot;Price in Euro&quot</i></td></tr>\n";
print "<tr><td height=12></td></tr>\n";
print "<tr valign=top><td>".$font."2><b>Description & <br>Contact Details:</b></td>\n";
print "<td>".$font."2><textarea name=desc cols=34 rows=5></textarea></td></tr>\n";
if ($handle_images) {
print "<tr><td></td><td>".$font."1><i>(Don't forget to put in a phone number)</i></td></tr>\n";
print "<tr><td height=12></td></tr>\n";
print "<tr valign=center><td>".$font."2><b>Picture:&nbsp;</b></td>\n";
print "<td>".$font."2><input type=file name=image size=32 maxlength=100></td></tr>\n";
print "<tr><td>&nbsp;</td><td>${font}1><i>(Jpg or Gif, 400x400 pixels at 100dpi max or $image_max_size bytes)</td></tr>";
print "<tr><td height=12></td></tr>\n";
}
print "<tr valign=center><td>".$font."2><b>Website link:&nbsp;</b></td>\n";
print "<td>".$font."2><input type=text name=link size=32
value=http://></td></tr>\n";
print "<tr><td height=12></td></tr>\n";
print "<tr valign=center><td>".$font."2><b>E-mail address:&nbsp;</b></td>\n";
print "<td>".$font."2><input type=text name=email size=23 maxlength=40";
if ($email) {print " value=\"$email\" disabled"}
print "></td></tr>\n";
print "<tr><td height=12></td></tr><tr valign=center><td>".$font."2><b>Password:</b></td><td>".$font."2><input type=password name=pw size=8 maxlength=8";
if ($pw) {print " value=\"$pw\" disabled"}
print "></td></tr>\n";
print "<tr><td colspan=2>";
print "<br>".$font."2><input type=checkbox name=mail_copy value=1> Send a copy of this ad to yourself</td></tr>\n";
print "</td></tr>\n";
if ($registration_needed and $email) {print "<input type=hidden name=\"email\" value=\"$email\">";}
if ($registration_needed and $pw) {print "<input type=hidden name=\"pw\" value=\"$pw\">";}
if ($charge_for_submiting) {
if ($payment_service eq 'clickbank') {
print "<input type=hidden name=\"seed\" value=\"$ticket\">";
print "<input type=hidden name=\"cbpop\" value=\"$cbpop\">";
print "<input type=hidden name=\"cbreceipt\" value=\"$cbreceipt\">";
} elsif ($payment_service eq 'paypal') {
print "<input type=hidden name=\"seed\" value=\"$ticket\">";
} elsif ($payment_service eq 'nochex') {
print "<input type=hidden name=\"seed\" value=\"$ticket\">";
}
}
print "<tr><td height=45 colspan=2 valign=bottom width=463><input type=image src=".$rooturl.$main_images."/submitad.gif border=0 alt=\"Click here to place your ad online.\">";
if (!$charge_for_submiting) {print "$cancel"};


## CONTINUE TO SUBMITAD2.CGI ####
}
print "</td></tr></form></table></td></tr></table>\n\n";

#### BOTTOM PAGE DISPLAY ####

&BOTTOM_NAVBAR;
&FOOTERHTML;

exit;


Submitad2.cgi is this code

#!/usr/bin/perl

################################################## ############################
# submitad2.cgi Version 3.03 Released Jul 16 2003 #
# Email: sales@chilliscripts.com #
################################################## ############################
# #
# COPYRIGHT NOTICE #
# Copyright 1999 - 2002 Chilli Scripts All Rights Reserved. #
# #
# Files included in this distribution may be modified only by registered #
# users so long as this copyright notice and the comments above remain #
# intact. By using this code you agree to indemnify Chilli Scripts from any #
# liability that might arise from it's use. #
# #
################################################## ############################
# PLEASE DO NOT MODIFY ANYTHING BELOW THIS POINT #
# UNLESS YOU ARE SURE OF WHAT YOU ARE DOING #
################################################## ############################


require("global.config");
require("routines.pl");

use CGI qw(:all);
#use Fcntl qw(EFAULT :flock);


$CGI:ISABLE_UPLOADS = 0;
$CGI:OST_MAX = $cgi_post_max;

$obj = new CGI;
# Subroutine cgi_error was added in CGI.pm 2.47
if ($obj->VERSION > 2.46) {
$obj->cgi_error and die "Error with form data: ".$obj->cgi_error."\n";
}

foreach $parameter ($obj->param) {$form{$parameter}=$obj->param($parameter)}

### FORM VARIABLES ####

$file="$data_file";
$cat=$form{'cat'};
$loc=$form{'loc'};
$desc=$form{'desc'};
$title=$form{'title'};
$link=$form{'link'};

if ($form{'email'}) {$email=$form{'email'}} else {$email=$cookies{'email'}}
if ($form{'pw'}) {$pw=$form{'pw'}} else {$pw=$cookies{'pw'}}

$image=$form{'image'};

if (Check_Password($email,$pw) ne "right_pw") {$loginerr=1};

if ($charge_for_submiting) {

if ($payment_service eq 'clickbank') {
$ticket=$form{'seed'};
$cbpop=$form{'cbpop'};
$cbreceipt=$form{'cbreceipt'};
if ($registration_needed){$good_ticket=&Check_Ticket( $ticket,$email,$cbreceipt)}
else {$good_ticket=&Check_Ticket($ticket,'',$cbreceipt) }
$valid_cbpop=&Check_Clickbank_Code($ticket,$cbpop) ;
if (!$good_ticket) {die "Wrong purchase ticket!\n"}
elsif (!$valid_cbpop) {die "Wrong ClickBank proof of purchase code!\n"}
}

elsif ($payment_service eq 'paypal') {
$ticket=$form{'seed'};
if ($registration_needed){$good_ticket=&Check_Ticket( $ticket,$email,'')}
else {$good_ticket=&Check_Ticket($ticket,'','')}
if (!$good_ticket) {die "Wrong purchase ticket!\n"}
}
elsif ($payment_service eq 'nochex') {
$ticket=$form{'seed'};
if ($registration_needed){$good_ticket=&Check_Ticket( $ticket,$email,'')}
else {$good_ticket=&Check_Ticket($ticket,'','')}
if (!$good_ticket) {die "Wrong purchase ticket!\n"}
}

}

#### SEE README.HTML FOR ADVICE BEFORE ALTERING BELOW. ####
#### CHECK FOR ERRORS, HTML TAGS, AND INVALID ENTRIES ####


if ($cat<1 || length($cat)%$category_digits) { $caterr=1; }
$loc=~ tr/|/-/;
$loc=~ tr/ //s;
$loc=~s/<.+?>//g;
if (length($loc)>35) { $locerr=1; }
while ($x<=length($desc)) {
$desc=~ tr/!//s;
$desc=~ tr/|/-/;
$desc=~ s/\.00//g;
$desc=~ s/\n/ /g;
$desc=~ s/\r/ /g;
$desc=~ tr/ //s;
$x++;
}
$x=0;
while ($x<=length($title)) {
$title=~ tr/!//s;
$title=~ tr/|/-/;
$title=~ s/\.00//g;
$title=~ tr/ //s;
$x++;
}


$desc=Strip_Tags($desc);

if (rindex($desc," ")+1==length($desc)) { chop($desc); }
if (length($desc)>$ad_description_size) { $descerr=1; }
$desc=~ s/</\&lt;/g;
$desc=~ s/"/\&quot;/g;
if (rindex($title," ")+1==length($title)) { chop($title); }
if (length($title)<3 || length($title)>45) { $titleerr=1; }
$title=~s/<.+?>//g;
$title=~ s/</\&lt;/g;
$title=~ s/"/\&quot;/g;

if (length($email)>5) {
$emailerr1=1;
if (index($email,"@")>-1 && index($email," ")<0 && index($email,"&")<0 && index($email,"|")<0) { $emailerr1=0; }
}
if (length($email)<6 || length($email)>40) { $emailerr2=1; }
$email=~ s/</\&lt;/g;

if ($ban_spammers) {
###### MAKE SURE POST ISN'T BY KNOWN SPAMMER ####
if (&Check_Spammer($email)) {$spamerr=1}
}

if (length($pw)<4 || index($pw," ")>-1) { $pwerr=1; }

if (index($link," ")>-1 || index($link,"&")>-1 || index($link,"|")>-1) { $linkerr2=1; }

#### CHECK FOR AND REMOVE BAD WORDS ####
@censored=split(/ /, $censorwords);
$title=&badwordcheck("$title");
$loc=&badwordcheck("$loc");
$desc=&badwordcheck("$desc");

#### MAKE SURE PICTURE IS RIGHT TYPE ####

if ($handle_images) {
if ($image) {
if ($image!~/\.gif|\.jpg|\.jpeg|\.png|\.bmp|\.tif/) {$picerr1=1}
if ($ENV{CONTENT_LENGTH}>$image_max_size+1000) {$picerr2=1}
}
}

#if ((substr($pic,0,7) ne "http://") && (substr($pic,0,6) ne "ftp://")) { $pic="http://$pic"; }
#if (length($pic)<11) {
# $pic="";
# $picerr1=0;
# $picerr2=0;
# $picerr3=0;
#}

$link=~ s/</\&lt;/g;

#### TOTAL # OF ERRORS ####
$err=$caterr+$locerr+$titleerr+$descerr+$emailerr1 +$emailerr2+$pwerr+$spamerr+$linkerr1+$linkerr2+$p icerr1+$picerr2+$loginerr;

#### IF NO ERRORS, CONTINUE ####

if ($err<1) {

#### CHECK FOR OLD ADS AND CREATE A REMOVE LIST ####

my @adlines=();

if (&File_Exist("$file")) {
&open_file(FILE1,"<",$file);
while ($line=&read_file(FILE1)) {
%data=Resolve_Data($line,@main_data_sequence);

$id=$data{'id'};

if (Check_Expire_Ad($id)) {
push(@fdel,"$id");
}
#### IF AD IS NOT OLD, ADD TO NEW LIST ####

else { push(@adlines,$line)}
}
&close_file(FILE1);
}

#### CREATE AD ID NUMBER ####

$date=&Current_RDate.sprintf("%02u%02u%02u",(local time(time))[2],(localtime(time))[1],(localtime(time))[0]);

if (length($link)>2000) { $link2=1; }

#### ENCRYPT PW ####

if ($pw!~/^Zq/) {$pw=crypt($pw,"Zq")};

# Store images
if ($handle_images and $image) {
$filename=$obj->param('image');
$image_name=&Store_Image($date,$image,$filename);
if ($image_name) {$pic="1"}
}

#### CREATE AD FILE ####

push(@adlines,"$date|$cat|$pic|$link2|$title|$emai l|$pw\n");

$idline="$loc|$desc";
if ($link) { $idline="$idline|$link"} else {$idline="$idline|"}
if ($image_name) {$idline.="|$image_name"}
$idline.="\n";

Write_Ad("$data_directory/$date.txt",$idline);

#### DELETE OLD AD FILES ####

foreach $ad (@fdel) { &Delete_Ad($ad,"system","expired") }

#### REWRITE MAIN DATA FILE ####
&Rewrite_Main_Data(@adlines);

if ($moderating_ads) {
&open_file(FILE2,">>",$unmoderated_ads_file);
&write_file(FILE2,"$date\n");
&close_file(FILE2);
}

### CALCULATE AD DURATION ####
#### GET DATE AND TIME ####

$expire_date=Get_Expire_Date((localtime(time))[3],(localtime(time))[4]+1,(localtime(time))[5]+1900);

$desc=Return_Tags($desc);

### Send email copy of Ad to user
# if ($form{'mail_copy'}) {
#
# $email_to_friend_message="*** This is a copy of the e-mail that you have sent. ***\n".
# "*** Do not reply to this automated message. ***\n\n".$submited_ad_message;
#
# &Send_Mail($email,$mailtech,$mailtech,"Your new ad 'id:$date' at $mainname.",$message_text);
#}

if ($image_name) {$have_image="yes"} else {$have_image="no"}
if (!$link or $link eq 'http://') {$have_link="no"} else {$have_link=$link}
$category_name=$categories_names{$cat};

if ($moderating_ads) {
$message_text=Get_Message($unmoderated_ad_message) ;
} else {
$message_text=Get_Message($submited_ad_message);
}

&Send_Mail($email,$mailtech,$mailtech,"Your new ad 'id:$date' at $mainname.",$message_text);

#}

######

if ($form{'mail_copy'}) {

$submited_ad_message_copy="*** This is a copy of the ad that you have placed. ***\n".
"*** Do not reply to this automated message. ***\n\n".$message_text;
#}
&Send_Mail($email,$mailtech,$mailtech,"Your new ad 'id:$date' at $mainname.",$submited_ad_message_copy);
}


if ($mail_copy_ad_to_admin) {
$submited_ad_message_copy="*** This is a copy of ad 'id:$date'. ***\n".
"\n".$message_text;

&Send_Mail($mailtech,$mailtech,$mailtech,"Admin notification of new ad 'id:$date' at $mainname.",$submited_ad_message_copy);
}


#####


if ($charge_for_submiting) {
if ($payment_service eq 'clickbank') {
if ($good_ticket and $valid_cbpop) {&Delete_Ticket($ticket,$email,$cbreceipt)}
}
elsif ($payment_service eq 'paypal') {
if ($good_ticket) {&Delete_Ticket($ticket,$email,'')}
}
elsif ($payment_service eq 'nochex') {
if ($good_ticket) {&Delete_Ticket($ticket,$email,'')}
}
}

if ($logging) {
Write_Log("User '$email' submit ".($moderating_ads ? "unmoderated " : "")."ad: $date|$cat|$title|$loc|$link|$image_name|$desc\n") ;
}

}

#### START PAGE DISPLAY ####

print $Content_Header;

&HEADERHTML;
#foreach (sort keys %form) {print "$_: \"$form{$_}\"<BR>"};
&BANNERHTML;

#### TOP PAGE DISPLAY ####
print $debug;

&TOP_NAVBAR('SUBMITAD');

print "".$table."0 width=600>\n";
print "<tr><td valign=top width=120>\n\n";

#### LEFT SIDE OF PAGE ####

print "".$table."0 width=120><tr><td>".$font."2>\n";
if ($err<1) {
print "<a href=submitad.cgi?step=2&spar=";
if ($cat<10) { print "0"; }
print "".$cat."0000001>Place a new<br>ad online</a><p>\n";
}
print "<a href=help.cgi?sec=6>Help with<br>submitting ads</font></a></td></tr></table></td>\n\n";

print "<td width=8></td><td width=1 bgcolor=$hfcolor><hr size=0></td><td width=8></td>\n\n";
print "<td valign=top width=463>\n\n";

#### RIGHT SIDE OF PAGE ####

print "".$table."0 width=463><tr><td>".$font."2><b>AD SUBMISSION ";
if ($err>0) { print "IN"; }
print "COMPLETE</b></td></tr>\n";
print "".$bar."\n";
print "<tr><td>".$font."2>\n";

#### IF ERROR FOUND ####

if ($err>0) {
print "Before your ad can be placed online, please correct the following error";
if ($err>1) { print "s"; } ## SPEAK ENGLISH
print ":<p>";
if ($caterr>0) { print "The &quot;Category&quot; field was not selected.<br>\n"; }
if ($locerr>0) { print "The &quot;Price&quot; field must be less than 36 characters.<br>\n"; }
$temp="field must contain between";
$temp2="The &quot;Website link&quot;";
if ($titleerr>0) { print "The &quot;Title&quot; $temp 3 and 45 characters.<br>\n"; }
if ($descerr>0) { print "The &quot;Description&quot; field must be $ad_description_size characters or less.<br>\n"; }
if ($emailerr1>0) { print "The e-mail address you entered is not valid.<br>\n"; }
if ($emailerr2>0) { print "Your e-mail address must be between 6 and 40 characters.<br>\n"; }
if ($pwerr>0) { print "Your password must be larger than 4 characters and must be without spaces.<br>\n"; }
if ($linkerr1>0) { print "$temp2 $temp 11 and 2000 characters without spaces.<br>\n"; }
if ($linkerr2>0) { print "$temp2 address you entered is not valid.<br>\n"; }
if ($picerr1>0) { print "Image must be a GIF, JPG, PNG, TIF or BMP file.<br>\n"; }
if ($picerr2>0) { print "Image file must be not larger than $image_max_size bytes.<br>\n"; }
if ($spamerr>0) { print "You have been banned from posting due to previous spamming of the site.<br>\n"; }
if ($loginerr>0) { print "Authorization error!<br>\n"; }

print "<p>Please return to the previous page and make the necessary corrections.";
}

#### IF NO ERRORS ####

else {

if ($moderating_ads) {print "After checking by the Administrator of $mainname, your ad will be added"}
else {print "Your ad has been added"}
print " to our database and will remain online until $expire_date in your selected category.<p>\n";
print "You can edit your ad, delete it early, or change your password at any time by selecting &quot;MY ADS&quot; from the top menu.<p>\n";
print "<b>LINK TO YOUR AD</b></td></tr>\n";
print "".$bar."</table>\n";
print "".$table."0 width=463>\n";
print "<tr valign=top><td width=20>".$font."2>1.</td>\n";
print "<td width=443>".$font."2>You can link directly to your ad by using this address:<br><a href=".$rootbin."viewad.cgi?id=$date&edit=1>".$roo tbin."viewad.cgi?id=$date</a></td></tr>\n";
print "<tr><td height=4></td></tr>\n";
print "<tr valign=top><td>".$font."2>2.</td>\n";
print "<td>".$font."2>Visitors can view a complete list of all your ads by searching for your e-mail address from the Home page.</td></tr>\n";
print "<tr><td height=4></td></tr>\n";
print "<tr valign=top><td>".$font."2>3.</td>\n";
print "<td>".$font."2>Visitors can go directly to your ad by searching for its ad number, <b>$date</b>.</td></tr></table>\n";
print "<p><b><a href=myads.cgi><img src=".$rooturl."$main_images/backtomyads.gif border=0></a></b>";
}
print "</td></tr></table></td></tr></table>\n\n";

#### BOTTOM PAGE DISPLAY ####

&BOTTOM_NAVBAR;
&FOOTERHTML;

exit;
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #2 (permalink)  
Old 10-09-05, 11:21 AM
End User's Avatar
End User End User is online now
Level II Curmudgeon
 
Join Date: Dec 2004
Posts: 3,027
Thanks: 14
Thanked 35 Times in 33 Posts
It's possible that some lines like this are the problem:

print "<td>".$font."2><input type=text name=loc size=29 maxlength=30></td></tr>\n";

Change the "maxlength" parameter to a larger value (like 100 or 200) and that may be all you need to do. You'll probably need to change these parameters iin a couple of places, but that would be my guess at what's causing it to stop.
__________________
I don't live on the edge, but sometimes I go there to visit.
-------------------------------------------------------------------------
Sanitize Your Data | Oracle Date & Substring Functions | Code Snippet Library | [url=http://www.codmb.com/Call Of Duty[/url]
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #3 (permalink)  
Old 10-09-05, 12:22 PM
Ireland Ireland is offline
Newbie Coder
 
Join Date: Oct 2005
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Anybody got more specific?

Thanks very much for last reply. Still not working. The only thing that gives the problem is the web link. As you see, any ones I thought was that web link, I changed to 2000. Is there a line in this code that I can just delete, so it would bypass the error check, and just let the LONG url through without checking its length. Failing that, I could probably delete ALL error checking lines, if I knew where they were. I know nothing about programming this code. Thanks for all replies.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #4 (permalink)  
Old 10-09-05, 03:22 PM
End User's Avatar
End User End User is online now
Level II Curmudgeon
 
Join Date: Dec 2004
Posts: 3,027
Thanks: 14
Thanked 35 Times in 33 Posts
Quote:
Originally Posted by Ireland
Thanks very much for last reply. Still not working. The only thing that gives the problem is the web link. As you see, any ones I thought was that web link, I changed to 2000. Is there a line in this code that I can just delete, so it would bypass the error check, and just let the LONG url through without checking its length. Failing that, I could probably delete ALL error checking lines, if I knew where they were. I know nothing about programming this code. Thanks for all replies.
Hmmm, betond what I suggested I'd have to look at it running and plow through the code to see where it's getting hung up. I didn't see anything else that should limit it in the code (assuming you made all the right changes in the right places). Is it using any external scripts or libraries? Can you post the modified code?
__________________
I don't live on the edge, but sometimes I go there to visit.
-------------------------------------------------------------------------
Sanitize Your Data | Oracle Date & Substring Functions | Code Snippet Library | [url=http://www.codmb.com/Call Of Duty[/url]
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #5 (permalink)  
Old 10-09-05, 04:18 PM
mab's Avatar
mab mab is offline
Community VIP
 
Join Date: Oct 2005
Location: Denver, Co. USA
Posts: 2,674
Thanks: 0
Thanked 0 Times in 0 Posts
In addition to the line that End User mentions, there is a line about mid way down in your post ----

if (length($loc)>35) { $locerr=1; }

---- that sets a limit of 35 (assuming that the loc variable receives the URL.) Hope this helps...
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #6 (permalink)  
Old 10-09-05, 05:00 PM
Ireland Ireland is offline
Newbie Coder
 
Join Date: Oct 2005
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Reply

You are extremely good to even bother to reply to this. The script can be found in action at www.homefinder.ie Theres no libraries. It all seems down to these 2 files. Theres something in the lines of this code that 'check's to see if the amount of characters is within a certain limit. I notice a couple of 'IF's there. Anything to do with that? Should I attach my whole script as an attachment here? Good on you - Brian
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #7 (permalink)  
Old 10-09-05, 08:09 PM
Ireland Ireland is offline
Newbie Coder
 
Join Date: Oct 2005
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
This problem has been sorted

Thanks to 2 users End User and mab This has been sorted. I searched for stuff with maxlength on it!!!! Thank you guys. I have another post for something totally diiferent now up top.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

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
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
2 profitable script sites for sale cms-master.com General Advertisements 3 07-03-07 11:17 AM
Complete Image Hosting Site Script ktools General Advertisements 0 07-19-04 10:08 AM
Creating Website Script Problem Dainbramaged05 PHP 4 06-30-04 01:29 PM
Problem with Image Slideshow script jthornton13 JavaScript 1 06-24-04 10:27 PM
Please help me sort out a small part of my php script... robertisunemployed PHP 8 03-03-04 11:02 PM


All times are GMT -5. The time now is 11:09 AM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.